AnalysisTree
Loading...
Searching...
No Matches
DataHeader.hpp
1/* Copyright (C) 2019-2021 GSI, Universität Tübingen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Viktor Klochkov, Ilya Selyuzhenkov */
4#ifndef ANALYSISTREE_DATAHEADER_H
5#define ANALYSISTREE_DATAHEADER_H
6
7#include <vector>
8
9#include "TObject.h"
10#include "TVector3.h"
11
12#include "Detector.hpp"
13
14namespace AnalysisTree {
15
19class DataHeader : public TObject {
20 public:
21 DataHeader() = default;
22 DataHeader(const DataHeader&) = default;
23 DataHeader(DataHeader&&) = default;
24 DataHeader& operator=(DataHeader&&) = default;
25 DataHeader& operator=(const DataHeader&) = default;
26
27 ModulePositions& AddDetector();
28
29 void Print(Option_t* = "") const;
30
31 void SetSystem(std::string sys) { system_ = std::move(sys); }
32 void SetBeamMomentum(float mom, float m_target = 0.938, float m_beam = 0.938);
33 void SetDetectorPosition(const TVector3& pos) {
34 det_pos_.emplace_back(pos);
35 }
36 void SetTimeSliceLength(float tslength) { ts_length_ = tslength; }
37
38 ANALYSISTREE_ATTR_NODISCARD Floating_t GetBeamRapidity() const { return beam_y_; }
39 ANALYSISTREE_ATTR_NODISCARD std::string GetSystem() const { return system_; }
40 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_; }
42
43 ANALYSISTREE_ATTR_NODISCARD const ModulePositions& GetModulePositions(Integer_t idet) const {
44 return modules_pos_.at(idet);
45 }
46
47 ANALYSISTREE_ATTR_NODISCARD Floating_t GetModulePhi(int det_id, int module_id) const {
48 return modules_pos_.at(det_id).GetChannel(module_id).GetPhi();
49 }
50
51 protected:
52 std::vector<ModulePositions> modules_pos_;
53 std::vector<TVector3> det_pos_{};
54
55 std::string system_;
56 Floating_t beam_mom_{UndefValueFloat};
57 Floating_t beam_y_{UndefValueFloat};
58 Floating_t sqrtsNN_{UndefValueFloat};
59 Floating_t ts_length_{UndefValueFloat};
60
61 ClassDef(DataHeader, 1)
62};
63
64}// namespace AnalysisTree
65#endif//ANALYSISTREE_DATAHEADER_H
Definition DataHeader.hpp:19
std::vector< ModulePositions > modules_pos_
in a local coordinate system
Definition DataHeader.hpp:52
Definition Detector.hpp:21
Cuts keep list of SimpleCuts. Logical AND is applied for all SimpleCut in the Cuts object.
Definition BranchConfig.cpp:10