Belle II Software  release-05-01-25
ECLTRGInformation.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Torben Ferber (torben.ferber@desy.de) *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/logging/Logger.h>
14 
15 namespace Belle2 {
22  class ECLTRGInformation : public TObject {
23 
24  public:
25 
27  static constexpr int c_nTCs = 576;
28 
33  m_thetaIdTC(c_nTCs + 1),
34  m_phiIdTC(c_nTCs + 1),
36  m_timingTC(c_nTCs + 1),
37  m_revoGDLTC(c_nTCs + 1),
38  m_revoFAMTC(c_nTCs + 1),
39  m_hitWinTC(c_nTCs + 1),
45  m_evtTiming(std::numeric_limits<float>::quiet_NaN()),
46  m_maximumTCId(-1)
47  {
48  // some vectors should not be initialized with zeroes but with NaN
49  for (unsigned idx = 0; idx <= c_nTCs; idx++) {
50  m_timingTC[idx] = std::numeric_limits<float>::quiet_NaN();
51  m_timingTCECLCalDigit[idx] = std::numeric_limits<float>::quiet_NaN();
52  m_hitWinTC[idx] = std::numeric_limits<int>::quiet_NaN();
53  }
54  }
55 
57  void setThetaIdTC(const int& tcid, const int& tcthetaid)
58  {
59  if (tcid > 0 and tcid <= c_nTCs + 1) {
60  m_thetaIdTC[tcid] = tcthetaid;
61  } else {
62  B2ERROR("TC " << tcid << " does not exist.");
63  }
64  }
65 
67  void setPhiIdTC(const int& tcid, const int& tcphiid)
68  {
69  if (tcid > 0 and tcid < c_nTCs + 1) {
70  m_phiIdTC[tcid] = tcphiid;
71  } else {
72  B2ERROR("TC " << tcid << " does not exist.");
73  }
74  }
75 
77  void setEnergyTC(const int& tcid, const float& tcenergy)
78  {
79  if (tcid >= 1 and tcid < c_nTCs + 1) {
80  m_energyTC[tcid] = tcenergy;
81  } else {
82  B2ERROR("TC " << tcid << " does not exist.");
83  }
84  }
85 
87  void setTimingTC(const int& tcid, const float& tctiming)
88  {
89  if (tcid >= 1 and tcid < c_nTCs + 1) {
90  m_timingTC[tcid] = tctiming;
91  } else {
92  B2ERROR("TC " << tcid << " does not exist.");
93  }
94  }
95 
97  void setEvtTiming(float evttiming) { m_evtTiming = evttiming; }
98 
100  void setRevoGDLTC(const int& tcid, const float& tcrevotrg)
101  {
102  if (tcid >= 1 and tcid < c_nTCs + 1) {
103  m_revoGDLTC[tcid] = tcrevotrg;
104  } else {
105  B2ERROR("TC " << tcid << " does not exist.");
106  }
107  }
108 
110  void setRevoFAMTC(const int& tcid, const float& tcrevofam)
111  {
112  if (tcid >= 1 and tcid < c_nTCs + 1) {
113  m_revoFAMTC[tcid] = tcrevofam;
114  } else {
115  B2ERROR("TC " << tcid << " does not exist.");
116  }
117  }
118 
120  void setHitWinTC(const int& tcid, const int& hitwin)
121  {
122  if (tcid >= 1 and tcid < c_nTCs + 1) {
123  m_hitWinTC[tcid] = hitwin;
124  } else {
125  B2ERROR("TC " << tcid << " does not exist.");
126  }
127  }
128 
130  int getPhiIdTC(const int& tcid)
131  {
132  if (tcid >= 1 and tcid < c_nTCs + 1) {
133  return m_phiIdTC[tcid];
134  } else {
135  B2ERROR("TC " << tcid << " does not exist.");
136  return 0.;
137  }
138  }
139 
141  int getThetaIdTC(const int& tcid)
142  {
143  if (tcid > 0 and tcid < c_nTCs + 1) {
144  return m_thetaIdTC[tcid];
145  } else {
146  B2ERROR("TC " << tcid << " does not exist.");
147  return 0.;
148  }
149  }
150 
152  float getEnergyTC(const int& tcid)
153  {
154  if (tcid > 0 and tcid < c_nTCs + 1) {
155  return m_energyTC[tcid];
156  } else {
157  B2ERROR("TC " << tcid << " does not exist.");
158  return 0.;
159  }
160  }
161 
163  float getTimingTC(const int& tcid)
164  {
165  if (tcid > 0 and tcid < c_nTCs + 1) {
166  return m_timingTC[tcid];
167  } else {
168  B2ERROR("TC " << tcid << " does not exist.");
169  return 0.;
170  }
171  }
172 
174  float getRevoGDLTC(const int& tcid)
175  {
176  if (tcid > 0 and tcid < c_nTCs + 1) {
177  return m_revoGDLTC[tcid];
178  } else {
179  B2ERROR("TC " << tcid << " does not exist.");
180  return 0.;
181  }
182  }
183 
185  float getRevoFAMTC(const int& tcid)
186  {
187  if (tcid > 0 and tcid < c_nTCs + 1) {
188  return m_revoFAMTC[tcid];
189  } else {
190  B2ERROR("TC " << tcid << " does not exist.");
191  return 0.;
192  }
193  }
194 
196  float getHitWinTC(const int& tcid)
197  {
198  if (tcid > 0 and tcid < c_nTCs + 1) {
199  return m_hitWinTC[tcid];
200  } else {
201  B2ERROR("TC " << tcid << " does not exist.");
202  return 0.;
203  }
204  }
205 
207  void setEnergyTCECLCalDigit(const int& tcid, const float& tcenergy)
208  {
209  if (tcid > 0 and tcid < c_nTCs + 1) {
210  m_energyTCECLCalDigit[tcid] = tcenergy;
211  } else {
212  B2ERROR("TC " << tcid << " does not exist.");
213  }
214  }
215 
217  float getEnergyTCECLCalDigit(const int& tcid)
218  {
219  if (tcid > 0 and tcid < c_nTCs + 1) {
220  return m_energyTCECLCalDigit[tcid];
221  } else {
222  B2ERROR("TC " << tcid << " does not exist.");
223  return 0.;
224  }
225  }
226 
228  void setTimingTCECLCalDigit(const int& tcid, const float& tctiming)
229  {
230  if (tcid > 0 and tcid < c_nTCs + 1) {
231  m_timingTCECLCalDigit[tcid] = tctiming;
232  } else {
233  B2ERROR("TC " << tcid << " does not exist.");
234  }
235  }
236 
238  float getTimingTCECLCalDigit(const int& tcid)
239  {
240  if (tcid > 0 and tcid < c_nTCs + 1) {
241  return m_timingTCECLCalDigit[tcid];
242  } else {
243  B2ERROR("TC " << tcid << " does not exist.");
244  return 0.;
245  }
246  }
247 
249  void setClusterEnergyThreshold(float thresh) { m_clusterEnergyThreshold = thresh; }
250 
252  float getClusterEnergyThreshold() const
253  {
255  }
256 
259 
262  {
264  }
265 
267  void setSumEnergyECLCalDigitInECLCluster(float sumenergy) { m_sumEnergyECLCalDigitInECLCluster = sumenergy; }
268 
271  {
273  }
274 
276  float getEvtTiming() const
277  {
278  return m_evtTiming;
279  }
280 
282  void setMaximumTCId(int maxtcid) { m_maximumTCId = maxtcid; }
283 
285  int getMaximumTCId() const
286  {
287  return m_maximumTCId;
288  }
289 
290  private:
291 
292  std::vector<int>
294  std::vector<int>
295  m_phiIdTC;
296  std::vector<float> m_energyTC;
297  std::vector<float> m_timingTC;
298  std::vector<float> m_revoGDLTC;
299  std::vector<float> m_revoFAMTC;
300  std::vector<int> m_hitWinTC;
302  std::vector<float> m_energyTCECLCalDigit;
303  std::vector<float>
309  float m_evtTiming;
314  };
315 
317 } // end namespace Belle2
Belle2::ECLTRGInformation::setEnergyTCECLCalDigit
void setEnergyTCECLCalDigit(const int &tcid, const float &tcenergy)
Set m_energyTCECLCalDigit.
Definition: ECLTRGInformation.h:215
Belle2::ECLTRGInformation::setEvtTiming
void setEvtTiming(float evttiming)
Set m_evtTiming.
Definition: ECLTRGInformation.h:105
Belle2::ECLTRGInformation::getMaximumTCId
int getMaximumTCId() const
Get m_maximumTCId.
Definition: ECLTRGInformation.h:293
Belle2::ECLTRGInformation::ECLTRGInformation
ECLTRGInformation()
Default constructor.
Definition: ECLTRGInformation.h:40
Belle2::ECLTRGInformation::m_hitWinTC
std::vector< int > m_hitWinTC
hitwindow, one entry per ECL TC
Definition: ECLTRGInformation.h:308
Belle2::ECLTRGInformation::c_nTCs
static constexpr int c_nTCs
Number of TCs.
Definition: ECLTRGInformation.h:35
Belle2::ECLTRGInformation::m_revoFAMTC
std::vector< float > m_revoFAMTC
revofam, one entry per ECL TC
Definition: ECLTRGInformation.h:307
Belle2::ECLTRGInformation::getPhiIdTC
int getPhiIdTC(const int &tcid)
Get m_phiIdTC.
Definition: ECLTRGInformation.h:138
Belle2::ECLTRGInformation::setPhiIdTC
void setPhiIdTC(const int &tcid, const int &tcphiid)
Set m_phiIdTC.
Definition: ECLTRGInformation.h:75
Belle2::ECLTRGInformation::m_maximumTCId
int m_maximumTCId
TC Id of TC with maximum FADC count.
Definition: ECLTRGInformation.h:318
Belle2::ECLTRGInformation::getSumEnergyECLCalDigitInECLCluster
float getSumEnergyECLCalDigitInECLCluster() const
Get m_clusterEnergyThreshold.
Definition: ECLTRGInformation.h:278
Belle2::ECLTRGInformation::setSumEnergyECLCalDigitInECLCluster
void setSumEnergyECLCalDigitInECLCluster(float sumenergy)
Set m_sumEnergyECLCalDigitInECLCluster.
Definition: ECLTRGInformation.h:275
Belle2::ECLTRGInformation::m_energyTC
std::vector< float > m_energyTC
energy, one entry per ECL TC
Definition: ECLTRGInformation.h:304
Belle2::ECLTRGInformation::getSumEnergyTCECLCalDigitInECLCluster
float getSumEnergyTCECLCalDigitInECLCluster() const
Get m_clusterEnergyThreshold.
Definition: ECLTRGInformation.h:269
Belle2::ECLTRGInformation::m_sumEnergyTCECLCalDigitInECLCluster
float m_sumEnergyTCECLCalDigitInECLCluster
sum of energy in ECL TCs based on ECLCalDigits that are part of an ECLCluster above threshold
Definition: ECLTRGInformation.h:315
Belle2::ECLTRGInformation::setRevoGDLTC
void setRevoGDLTC(const int &tcid, const float &tcrevotrg)
Set m_revoGDLTC.
Definition: ECLTRGInformation.h:108
Belle2::ECLTRGInformation::setTimingTC
void setTimingTC(const int &tcid, const float &tctiming)
Set m_timingTC.
Definition: ECLTRGInformation.h:95
Belle2::ECLTRGInformation::getClusterEnergyThreshold
float getClusterEnergyThreshold() const
Get m_clusterEnergyThreshold.
Definition: ECLTRGInformation.h:260
Belle2::ECLTRGInformation::setHitWinTC
void setHitWinTC(const int &tcid, const int &hitwin)
Set m_hitWinTC.
Definition: ECLTRGInformation.h:128
Belle2::ECLTRGInformation::getTimingTCECLCalDigit
float getTimingTCECLCalDigit(const int &tcid)
Get m_timingTCECLCalDigit.
Definition: ECLTRGInformation.h:246
Belle2::ECLTRGInformation::setEnergyTC
void setEnergyTC(const int &tcid, const float &tcenergy)
Set m_energyTC.
Definition: ECLTRGInformation.h:85
Belle2::ECLTRGInformation::setTimingTCECLCalDigit
void setTimingTCECLCalDigit(const int &tcid, const float &tctiming)
Set m_timingTCECLCalDigit.
Definition: ECLTRGInformation.h:236
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ECLTRGInformation::getEvtTiming
float getEvtTiming() const
Get m_evtTiming.
Definition: ECLTRGInformation.h:284
Belle2::ECLTRGInformation::getEnergyTCECLCalDigit
float getEnergyTCECLCalDigit(const int &tcid)
Get m_energyTCECLCalDigit.
Definition: ECLTRGInformation.h:225
Belle2::ECLTRGInformation::getRevoGDLTC
float getRevoGDLTC(const int &tcid)
Get m_revoGDLTC.
Definition: ECLTRGInformation.h:182
Belle2::ECLTRGInformation::getHitWinTC
float getHitWinTC(const int &tcid)
Get m_hitWinTC.
Definition: ECLTRGInformation.h:204
Belle2::ECLTRGInformation::m_evtTiming
float m_evtTiming
TC evttime, one entry per event.
Definition: ECLTRGInformation.h:317
Belle2::ECLTRGInformation::m_clusterEnergyThreshold
float m_clusterEnergyThreshold
energy threshold for clusters to be included in m_sumEnergyTCECLCalDigitInECLCluster
Definition: ECLTRGInformation.h:314
Belle2::ECLTRGInformation::m_revoGDLTC
std::vector< float > m_revoGDLTC
revogdl, one entry per ECL TC
Definition: ECLTRGInformation.h:306
Belle2::ECLTRGInformation::m_timingTCECLCalDigit
std::vector< float > m_timingTCECLCalDigit
timing (of highest energy eclcaldigit), one entry per ECL TC based on ECLCalDigits
Definition: ECLTRGInformation.h:312
Belle2::ECLTRGInformation::m_phiIdTC
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
Definition: ECLTRGInformation.h:303
Belle2::ECLTRGInformation::getTimingTC
float getTimingTC(const int &tcid)
Get m_timingTC.
Definition: ECLTRGInformation.h:171
Belle2::ECLTRGInformation::setMaximumTCId
void setMaximumTCId(int maxtcid)
Set m_maximumTCId.
Definition: ECLTRGInformation.h:290
Belle2::ECLTRGInformation::m_timingTC
std::vector< float > m_timingTC
timing, one entry per ECL TC
Definition: ECLTRGInformation.h:305
Belle2::ECLTRGInformation::setThetaIdTC
void setThetaIdTC(const int &tcid, const int &tcthetaid)
Set m_thetaIdTC.
Definition: ECLTRGInformation.h:65
Belle2::ECLTRGInformation
Class to store information about ECL trigger cells (TCs)
Definition: ECLTRGInformation.h:30
Belle2::ECLTRGInformation::getThetaIdTC
int getThetaIdTC(const int &tcid)
Get m_thetaIdTC.
Definition: ECLTRGInformation.h:149
Belle2::ECLTRGInformation::setRevoFAMTC
void setRevoFAMTC(const int &tcid, const float &tcrevofam)
Set m_revoFAMTC.
Definition: ECLTRGInformation.h:118
Belle2::ECLTRGInformation::getRevoFAMTC
float getRevoFAMTC(const int &tcid)
Get m_revoFAMTC.
Definition: ECLTRGInformation.h:193
Belle2::ECLTRGInformation::ClassDef
ClassDef(ECLTRGInformation, 3)
class definition
Belle2::ECLTRGInformation::m_thetaIdTC
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...
Definition: ECLTRGInformation.h:301
Belle2::ECLTRGInformation::m_energyTCECLCalDigit
std::vector< float > m_energyTCECLCalDigit
energy, one entry per ECL TC based on ECLCalDigits
Definition: ECLTRGInformation.h:310
Belle2::ECLTRGInformation::m_sumEnergyECLCalDigitInECLCluster
float m_sumEnergyECLCalDigitInECLCluster
sum of energy based on ECLCalDigits that are part of an ECLCluster above threshold
Definition: ECLTRGInformation.h:316
Belle2::ECLTRGInformation::setClusterEnergyThreshold
void setClusterEnergyThreshold(float thresh)
Set m_clusterEnergyThreshold.
Definition: ECLTRGInformation.h:257
Belle2::ECLTRGInformation::getEnergyTC
float getEnergyTC(const int &tcid)
Get m_energyTC.
Definition: ECLTRGInformation.h:160
Belle2::ECLTRGInformation::setSumEnergyTCECLCalDigitInECLCluster
void setSumEnergyTCECLCalDigitInECLCluster(float sumenergy)
Set m_sumEnergyTCECLCalDigitInECLCluster.
Definition: ECLTRGInformation.h:266