Skip to content

Commit 6cfd74c

Browse files
authored
TS_in_DataHeader (#119)
* TimeSlice length added to DataHeader * Print TS length
1 parent 29a44ad commit 6cfd74c

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

core/DataHeader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ void DataHeader::Print(Option_t*) const {
1313
std::cout << " at beam momentum " << beam_mom_;
1414
std::cout << " (sqrt(s_NN) = " << sqrtsNN_ << ")" << std::endl;
1515
std::cout << " beam rapidity is " << beam_y_ << std::endl;
16+
std::cout << "TimeSlice length : " << ts_length_ << std::endl;
1617

1718
for (const auto& mod_pos : modules_pos_) {
1819
mod_pos.Print();
@@ -33,4 +34,4 @@ ModulePositions& DataHeader::AddDetector() {
3334
return modules_pos_.back();
3435
}
3536

36-
}// namespace AnalysisTree
37+
}// namespace AnalysisTree

core/DataHeader.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ class DataHeader : public TObject {
3333
void SetDetectorPosition(const TVector3& pos) {
3434
det_pos_.emplace_back(pos);
3535
}
36+
void SetTimeSliceLength(float tslength) { ts_length_ = tslength; }
3637

3738
ANALYSISTREE_ATTR_NODISCARD Floating_t GetBeamRapidity() const { return beam_y_; }
3839
ANALYSISTREE_ATTR_NODISCARD std::string GetSystem() const { return system_; }
3940
ANALYSISTREE_ATTR_NODISCARD const TVector3& GetDetectorPosition(int i) const { return det_pos_.at(i); }
41+
ANALYSISTREE_ATTR_NODISCARD Floating_t GetTimeSliceLength() const { return ts_length_; }
4042

4143
ANALYSISTREE_ATTR_NODISCARD const ModulePositions& GetModulePositions(Integer_t idet) const {
4244
return modules_pos_.at(idet);
@@ -54,6 +56,7 @@ class DataHeader : public TObject {
5456
Floating_t beam_mom_{UndefValueFloat};
5557
Floating_t beam_y_{UndefValueFloat};
5658
Floating_t sqrtsNN_{UndefValueFloat};
59+
Floating_t ts_length_{UndefValueFloat};
5760

5861
ClassDef(DataHeader, 1)
5962
};

0 commit comments

Comments
 (0)