Belle II Software  release-08-01-10
ECLTRGInformation.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 #include <framework/logging/Logger.h>
12 
13 namespace Belle2 {
20  class ECLTRGInformation : public TObject {
21 
22  public:
23 
25  static constexpr int c_nTCs = 576;
26 
31  m_thetaIdTC(c_nTCs + 1),
32  m_phiIdTC(c_nTCs + 1),
33  m_energyTC(c_nTCs + 1),
34  m_timingTC(c_nTCs + 1),
35  m_revoGDLTC(c_nTCs + 1),
36  m_revoFAMTC(c_nTCs + 1),
37  m_hitWinTC(c_nTCs + 1),
43  m_evtTiming(std::numeric_limits<float>::quiet_NaN()),
44  m_maximumTCId(-1)
45  {
46  // some vectors should not be initialized with zeroes but with NaN
47  for (unsigned idx = 0; idx <= c_nTCs; idx++) {
48  m_timingTC[idx] = std::numeric_limits<float>::quiet_NaN();
49  m_timingTCECLCalDigit[idx] = std::numeric_limits<float>::quiet_NaN();
50  m_hitWinTC[idx] = std::numeric_limits<int>::quiet_NaN();
51  }
52  }
53 
55  void setThetaIdTC(const int& tcid, const int& tcthetaid)
56  {
57  if (tcid > 0 and tcid <= c_nTCs + 1) {
58  m_thetaIdTC[tcid] = tcthetaid;
59  } else {
60  B2ERROR("TC " << tcid << " does not exist.");
61  }
62  }
63 
65  void setPhiIdTC(const int& tcid, const int& tcphiid)
66  {
67  if (tcid > 0 and tcid < c_nTCs + 1) {
68  m_phiIdTC[tcid] = tcphiid;
69  } else {
70  B2ERROR("TC " << tcid << " does not exist.");
71  }
72  }
73 
75  void setEnergyTC(const int& tcid, const float& tcenergy)
76  {
77  if (tcid >= 1 and tcid < c_nTCs + 1) {
78  m_energyTC[tcid] = tcenergy;
79  } else {
80  B2ERROR("TC " << tcid << " does not exist.");
81  }
82  }
83 
85  void setTimingTC(const int& tcid, const float& tctiming)
86  {
87  if (tcid >= 1 and tcid < c_nTCs + 1) {
88  m_timingTC[tcid] = tctiming;
89  } else {
90  B2ERROR("TC " << tcid << " does not exist.");
91  }
92  }
93 
95  void setEvtTiming(float evttiming) { m_evtTiming = evttiming; }
96 
98  void setRevoGDLTC(const int& tcid, const float& tcrevotrg)
99  {
100  if (tcid >= 1 and tcid < c_nTCs + 1) {
101  m_revoGDLTC[tcid] = tcrevotrg;
102  } else {
103  B2ERROR("TC " << tcid << " does not exist.");
104  }
105  }
106 
108  void setRevoFAMTC(const int& tcid, const float& tcrevofam)
109  {
110  if (tcid >= 1 and tcid < c_nTCs + 1) {
111  m_revoFAMTC[tcid] = tcrevofam;
112  } else {
113  B2ERROR("TC " << tcid << " does not exist.");
114  }
115  }
116 
118  void setHitWinTC(const int& tcid, const int& hitwin)
119  {
120  if (tcid >= 1 and tcid < c_nTCs + 1) {
121  m_hitWinTC[tcid] = hitwin;
122  } else {
123  B2ERROR("TC " << tcid << " does not exist.");
124  }
125  }
126 
128  int getPhiIdTC(const int& tcid) const
129  {
130  if (tcid >= 1 and tcid < c_nTCs + 1) {
131  return m_phiIdTC[tcid];
132  } else {
133  B2ERROR("TC " << tcid << " does not exist.");
134  return 0.;
135  }
136  }
137 
139  int getThetaIdTC(const int& tcid) const
140  {
141  if (tcid > 0 and tcid < c_nTCs + 1) {
142  return m_thetaIdTC[tcid];
143  } else {
144  B2ERROR("TC " << tcid << " does not exist.");
145  return 0.;
146  }
147  }
148 
150  float getEnergyTC(const int& tcid) const
151  {
152  if (tcid > 0 and tcid < c_nTCs + 1) {
153  return m_energyTC[tcid];
154  } else {
155  B2ERROR("TC " << tcid << " does not exist.");
156  return 0.;
157  }
158  }
159 
161  float getTimingTC(const int& tcid) const
162  {
163  if (tcid > 0 and tcid < c_nTCs + 1) {
164  return m_timingTC[tcid];
165  } else {
166  B2ERROR("TC " << tcid << " does not exist.");
167  return 0.;
168  }
169  }
170 
172  float getRevoGDLTC(const int& tcid) const
173  {
174  if (tcid > 0 and tcid < c_nTCs + 1) {
175  return m_revoGDLTC[tcid];
176  } else {
177  B2ERROR("TC " << tcid << " does not exist.");
178  return 0.;
179  }
180  }
181 
183  float getRevoFAMTC(const int& tcid) const
184  {
185  if (tcid > 0 and tcid < c_nTCs + 1) {
186  return m_revoFAMTC[tcid];
187  } else {
188  B2ERROR("TC " << tcid << " does not exist.");
189  return 0.;
190  }
191  }
192 
194  float getHitWinTC(const int& tcid) const
195  {
196  if (tcid > 0 and tcid < c_nTCs + 1) {
197  return m_hitWinTC[tcid];
198  } else {
199  B2ERROR("TC " << tcid << " does not exist.");
200  return 0.;
201  }
202  }
203 
205  void setEnergyTCECLCalDigit(const int& tcid, const float& tcenergy)
206  {
207  if (tcid > 0 and tcid < c_nTCs + 1) {
208  m_energyTCECLCalDigit[tcid] = tcenergy;
209  } else {
210  B2ERROR("TC " << tcid << " does not exist.");
211  }
212  }
213 
215  float getEnergyTCECLCalDigit(const int& tcid) const
216  {
217  if (tcid > 0 and tcid < c_nTCs + 1) {
218  return m_energyTCECLCalDigit[tcid];
219  } else {
220  B2ERROR("TC " << tcid << " does not exist.");
221  return 0.;
222  }
223  }
224 
226  void setTimingTCECLCalDigit(const int& tcid, const float& tctiming)
227  {
228  if (tcid > 0 and tcid < c_nTCs + 1) {
229  m_timingTCECLCalDigit[tcid] = tctiming;
230  } else {
231  B2ERROR("TC " << tcid << " does not exist.");
232  }
233  }
234 
236  float getTimingTCECLCalDigit(const int& tcid) const
237  {
238  if (tcid > 0 and tcid < c_nTCs + 1) {
239  return m_timingTCECLCalDigit[tcid];
240  } else {
241  B2ERROR("TC " << tcid << " does not exist.");
242  return 0.;
243  }
244  }
245 
247  void setClusterEnergyThreshold(float thresh) { m_clusterEnergyThreshold = thresh; }
248 
251  {
253  }
254 
257 
260  {
262  }
263 
266 
269  {
271  }
272 
274  float getEvtTiming() const
275  {
276  return m_evtTiming;
277  }
278 
280  void setMaximumTCId(int maxtcid) { m_maximumTCId = maxtcid; }
281 
283  int getMaximumTCId() const
284  {
285  return m_maximumTCId;
286  }
287 
288  private:
289 
290  std::vector<int>
292  std::vector<int>
294  std::vector<float> m_energyTC;
295  std::vector<float> m_timingTC;
296  std::vector<float> m_revoGDLTC;
297  std::vector<float> m_revoFAMTC;
298  std::vector<int> m_hitWinTC;
300  std::vector<float> m_energyTCECLCalDigit;
301  std::vector<float>
307  float m_evtTiming;
312  };
313 
315 } // end namespace Belle2
Class to store information about ECL trigger cells (TCs)
std::vector< int > m_thetaIdTC
thetaid, one entry per ECL TC - this is a constant quantity, no actual need to store it for every eve...
float m_evtTiming
TC evttime, one entry per event.
std::vector< float > m_revoFAMTC
revofam, one entry per ECL TC
void setClusterEnergyThreshold(float thresh)
Set m_clusterEnergyThreshold.
ClassDef(ECLTRGInformation, 3)
class definition
int m_maximumTCId
TC Id of TC with maximum FADC count.
void setRevoFAMTC(const int &tcid, const float &tcrevofam)
Set m_revoFAMTC.
float m_sumEnergyTCECLCalDigitInECLCluster
sum of energy in ECL TCs based on ECLCalDigits that are part of an ECLCluster above threshold
std::vector< float > m_timingTCECLCalDigit
timing (of highest energy eclcaldigit), one entry per ECL TC based on ECLCalDigits
float getEnergyTCECLCalDigit(const int &tcid) const
Get m_energyTCECLCalDigit.
void setSumEnergyTCECLCalDigitInECLCluster(float sumenergy)
Set m_sumEnergyTCECLCalDigitInECLCluster.
float getHitWinTC(const int &tcid) const
Get m_hitWinTC.
std::vector< float > m_timingTC
timing, one entry per ECL TC
void setHitWinTC(const int &tcid, const int &hitwin)
Set m_hitWinTC.
float getSumEnergyTCECLCalDigitInECLCluster() const
Get m_clusterEnergyThreshold.
int getMaximumTCId() const
Get m_maximumTCId.
int getPhiIdTC(const int &tcid) const
Get m_phiIdTC.
float getSumEnergyECLCalDigitInECLCluster() const
Get m_clusterEnergyThreshold.
void setSumEnergyECLCalDigitInECLCluster(float sumenergy)
Set m_sumEnergyECLCalDigitInECLCluster.
void setEnergyTC(const int &tcid, const float &tcenergy)
Set m_energyTC.
std::vector< int > m_phiIdTC
phiid, one entry per ECL TC - this is a constant quantity, no actual need to store if for every event
float getTimingTC(const int &tcid) const
Get m_timingTC.
std::vector< int > m_hitWinTC
hitwindow, one entry per ECL TC
ECLTRGInformation()
Default constructor.
void setThetaIdTC(const int &tcid, const int &tcthetaid)
Set m_thetaIdTC.
void setEnergyTCECLCalDigit(const int &tcid, const float &tcenergy)
Set m_energyTCECLCalDigit.
void setPhiIdTC(const int &tcid, const int &tcphiid)
Set m_phiIdTC.
std::vector< float > m_energyTC
energy, one entry per ECL TC
void setEvtTiming(float evttiming)
Set m_evtTiming.
float getEvtTiming() const
Get m_evtTiming.
void setMaximumTCId(int maxtcid)
Set m_maximumTCId.
void setRevoGDLTC(const int &tcid, const float &tcrevotrg)
Set m_revoGDLTC.
float getClusterEnergyThreshold() const
Get m_clusterEnergyThreshold.
void setTimingTC(const int &tcid, const float &tctiming)
Set m_timingTC.
float m_sumEnergyECLCalDigitInECLCluster
sum of energy based on ECLCalDigits that are part of an ECLCluster above threshold
void setTimingTCECLCalDigit(const int &tcid, const float &tctiming)
Set m_timingTCECLCalDigit.
float m_clusterEnergyThreshold
energy threshold for clusters to be included in m_sumEnergyTCECLCalDigitInECLCluster
float getRevoGDLTC(const int &tcid) const
Get m_revoGDLTC.
float getTimingTCECLCalDigit(const int &tcid) const
Get m_timingTCECLCalDigit.
static constexpr int c_nTCs
Number of TCs.
float getEnergyTC(const int &tcid) const
Get m_energyTC.
float getRevoFAMTC(const int &tcid) const
Get m_revoFAMTC.
std::vector< float > m_energyTCECLCalDigit
energy, one entry per ECL TC based on ECLCalDigits
int getThetaIdTC(const int &tcid) const
Get m_thetaIdTC.
std::vector< float > m_revoGDLTC
revogdl, one entry per ECL TC
Abstract base class for different kinds of events.