|
20 | 20 | #include "rapidjson/document.h" |
21 | 21 | #include "ReconstructionDataFormats/GlobalTrackID.h" |
22 | 22 |
|
23 | | -namespace o2 |
24 | | -{ |
25 | | -namespace event_visualisation |
| 23 | +namespace o2::event_visualisation |
26 | 24 | { |
| 25 | + |
27 | 26 | class VisualisationCalo |
28 | 27 | { |
29 | 28 | friend class VisualisationEventJSONSerializer; |
30 | 29 | friend class VisualisationEventROOTSerializer; |
31 | 30 |
|
32 | 31 | public: |
33 | | - // Default constructor |
34 | 32 | VisualisationCalo(); |
35 | 33 |
|
36 | 34 | /// constructor parametrisation (Value Object) for VisualisationCalo class |
37 | | - /// |
38 | | - /// Simplifies passing parameters to constructor of VisualisationCalo |
39 | | - /// by providing their names |
40 | 35 | struct VisualisationCaloVO { |
41 | 36 | float time = 0; |
42 | 37 | float energy = 0.0f; |
43 | 38 | float phi = 0; |
44 | 39 | float eta = 0; |
45 | 40 | int PID = 0; |
46 | | - std::string gid = ""; |
47 | | - o2::dataformats::GlobalTrackID::Source source; |
| 41 | + o2::dataformats::GlobalTrackID gid = 0; |
48 | 42 | }; |
49 | | - |
50 | | - // Constructor with properties initialisation |
51 | 43 | explicit VisualisationCalo(const VisualisationCaloVO& vo); |
52 | 44 |
|
53 | 45 | VisualisationCalo(const VisualisationCalo& src); |
54 | 46 |
|
55 | | - // Energy getter |
56 | | - float getEnergy() const |
57 | | - { |
58 | | - return mEnergy; |
59 | | - } |
60 | | - |
61 | | - // Time getter |
62 | | - float getTime() const |
63 | | - { |
64 | | - return mTime; |
65 | | - } |
66 | | - |
67 | | - // PID (particle identification code) getter |
68 | | - int getPID() const |
69 | | - { |
70 | | - return mPID; |
71 | | - } |
72 | | - |
73 | | - // GID getter |
74 | | - std::string getGIDAsString() const |
75 | | - { |
76 | | - return mGID; |
77 | | - } |
78 | | - |
79 | | - // Source Getter |
80 | | - o2::dataformats::GlobalTrackID::Source getSource() const |
81 | | - { |
82 | | - return mSource; |
83 | | - } |
84 | | - |
85 | | - // Phi getter |
86 | | - float getPhi() const |
87 | | - { |
88 | | - return mPhi; |
89 | | - } |
90 | | - |
91 | | - // Theta getter |
92 | | - float getEta() const |
93 | | - { |
94 | | - return mEta; |
95 | | - } |
| 47 | + [[nodiscard]] float getEnergy() const { return mEnergy; } |
| 48 | + [[nodiscard]] float getTime() const { return mTime; } |
| 49 | + [[nodiscard]] int getPID() const { return mPID; } |
| 50 | + [[nodiscard]] o2::dataformats::GlobalTrackID getGID() const { return mBGID; } |
| 51 | + [[nodiscard]] o2::dataformats::GlobalTrackID::Source getSource() const { return static_cast<o2::dataformats::GlobalTrackID::Source>(mBGID.getSource()); } |
| 52 | + [[nodiscard]] float getPhi() const { return mPhi; } |
| 53 | + [[nodiscard]] float getEta() const { return mEta; } |
96 | 54 |
|
97 | 55 | private: |
98 | | - // Set coordinates of the beginning of the track |
99 | | - void addStartCoordinates(const float xyz[3]); |
100 | | - |
101 | 56 | float mTime; /// time |
102 | 57 | float mEnergy; /// Energy of the particle |
103 | | - |
104 | | - int mPID; /// PDG code of the particle |
105 | | - std::string mGID; /// String representation of gid |
106 | | - |
107 | | - float mEta; /// An angle from Z-axis to the radius vector pointing to the particle |
108 | | - float mPhi; /// An angle from X-axis to the radius vector pointing to the particle |
109 | | - |
110 | | - // std::vector<int> mChildrenIDs; /// Unique IDs of children particles |
111 | | - o2::dataformats::GlobalTrackID::Source mSource; /// data source of the track (debug) |
| 58 | + int mPID; /// PDG code of the particle |
| 59 | + float mEta; /// An angle from Z-axis to the radius vector pointing to the particle |
| 60 | + float mPhi; /// An angle from X-axis to the radius vector pointing to the particle |
| 61 | + o2::dataformats::GlobalTrackID mBGID; |
112 | 62 | }; |
113 | 63 |
|
114 | | -} // namespace event_visualisation |
115 | | -} // namespace o2 |
| 64 | +} // namespace o2::event_visualisation |
116 | 65 |
|
117 | 66 | #endif // O2EVE_VISUALISATIONCALO_H |
0 commit comments