MEvent/Counter.h
Go to the documentation of this file.
1 #ifndef _mevt_Counter_h_
2 #define _mevt_Counter_h_
3 
4 #include <evt/ComponentGroup.h>
5 #include <mevt/Module.h>
6 #include <mevt/CounterSimData.h>
7 #include <utl/ShadowPtr.h>
8 #include <utl/ConsecutiveEnumFactory.h>
9 
10 
11 // forward declaration used for friendship
12 namespace io {
13  class Counter_ROOT;
14 }
15 
16 
17 namespace mevt {
18 
28  class Counter {
29 
30  private:
32 
33  public:
40 
41  Module& GetModule(const int mId) { return fModules.Get(mId); }
42 
43  const Module& GetModule(const int mId) const { return fModules.Get(mId); }
44 
45  void MakeModule(const int mId) { fModules.Make(mId); }
46 
47  bool HasModule(const int mId) const { return fModules.Has(mId); }
48 
49  int GetNumberOfModules() const { return fModules.GetNumberOf(); }
50 
52 
54 
56 
58 
60 
65 
66  const CounterSimData& GetSimData() const { return *fSimData; }
67 
68  void MakeSimData();
69 
70  bool HasSimData() const { return bool(fSimData); }
72 
77  // Counter reconstructed data
78  bool HasRecData() const;
79 
81 
97  int GetId() const { return fId; }
98 
99  // Rely on implicit ones.
100  //Counter(const Counter& counter);
101  //Counter& operator=(const Counter& counter);
102 
104 
105 
117  bool IsCandidate() const;
118 
120  bool IsRejected() const;
121 
123  bool IsSilent() const;
124 
126  bool IsSaturated() const;
128  bool IsADCCalibratedLG() const;
130  bool IsADCCalibratedHG() const;
131 
136  void SetRejected(const std::string& reason = "");
137 
142  void SetSilent();
143 
144  void SetT1(const double t1) { fT1 = t1; }
145 
146  double GetT1() { return fT1; }
147 
154  double GetNumberOfEstimatedMuons() const;
155  double GetNumberOfMuonsErrorHigh() const;
156  double GetNumberOfMuonsErrorLow() const;
157 
158  double GetMeanMuons() const;
159  double GetMeanMuonsErrorHigh() const;
160  double GetMeanMuonsErrorLow() const;
161 
168  double GetNumberOfEstimatedMuonsLG() const;
169  double GetNumberOfMuonsErrorHighLG() const;
170  double GetNumberOfMuonsErrorLowLG() const;
171 
172  double GetNumberOfEstimatedMuonsHG() const;
173  double GetNumberOfMuonsErrorHighHG() const;
174  double GetNumberOfMuonsErrorLowHG() const;
175 
184  double GetNumberOfMuonsLowLimit() const;
185  double GetMeanMuonsLowLimit() const;
186 
187  double GetActiveArea() const;
188 
189  double GetActiveAreaLG() const;
190  double GetActiveAreaHG() const;
191 
198  double GetMuonDensity() const;
199  double GetMuonDensityErrorHigh() const;
200  double GetMuonDensityErrorLow() const;
201 
202  double GetMeanMuonDensity() const;
203  double GetMeanMuonDensityErrorHigh() const;
204  double GetMeanMuonDensityErrorLow() const;
205 
212  double GetMuonDensityLG() const;
213  double GetMuonDensityErrorHighLG() const;
214  double GetMuonDensityErrorLowLG() const;
215 
216  double GetMuonDensityHG() const;
217  double GetMuonDensityErrorHighHG() const;
218  double GetMuonDensityErrorLowHG() const;
219 
225  unsigned int GetNumberOfChannelsOn() const;
226 
230  bool IsEmpty() const { return !GetNumberOfChannelsOn(); }
231 
237  double GetLDFResidual() const;
238 
240  double GetTimeResidual() const { return fTimeResidual; }
241  void SetTimeResidual(const double residual) { fTimeResidual = residual; }
242 
244  double GetPlaneFrontDelay() const { return fPlaneFrontDelay; }
245  void SetPlaneFrontDelay(const double c) { fPlaneFrontDelay = c; }
246 
251  bool HasT50() const { return fHasT50; }
253  void SetSignalT50(const utl::TimeStamp& time) { fSignalT50 = time; fHasT50 = true; }
254 
255  double GetT50Error() const { return fT50Error; } // error in nanoseconds
256  void SetT50Error(const double e) { fT50Error = e; }
257 
259  double GetT502SdStart() const { return fT502SdStart; }
260  void SetT502SdStart(const double c) { fT502SdStart = c; }
261 
262  // Implicit ones.
263  //Counter(const Counter& counter);
264  //Counter& operator=(const Counter& counter);
265 
266  private:
268  Counter(const int cId) : fId(cId), fT1(0), fHasT50(false) { }
269 
270  //Counter() { }
271 
272  ~Counter() { }
273 
276 
281  template<class T>
282  friend void boost::checked_delete(T*) BOOST_NOEXCEPT;
283 
284  /*
285  * XXX Up to now, no refactor on Sim + Rec + id pattern for evt classes;
286  * keep the current usage: there could be a superclass for rec, sim,
287  * calib: but that seems too much and not worth (would lead to multiple
288  * virtual inhertance).
289  * Another posibility is to define a
290  * a wrapper (to ShadowPtr) in order
291  * to put there this logic (make/has/get) for single values, but that
292  * would be the only logic but there.
293  */
294 
296  size_t CountCandidateModules() const;
297 
298  size_t CountSilentModules() const;
299 
300  size_t CountRejectedModules() const;
301 
302  int fId = -1;
303  double fT1 = 0;
305  utl::ShadowPtr<CounterSimData> fSimData;
306 
307  bool fHasT50 = false;
308  utl::TimeStamp fSignalT50;
309  double fT50Error = 0;
310 
311  double fTimeResidual = 0;
312  double fPlaneFrontDelay = 0;
313  double fT502SdStart = 0;
314 
315  };
316 
317 }
318 
319 
320 #endif
ComponentIterator Begin()
Module & GetModule(const int mId)
bool IsCandidate() const
The muon counter status.
double GetNumberOfMuonsErrorHighHG() const
double GetNumberOfMuonsErrorHighLG() const
InternalModuleCollection fModules
double GetLDFResidual() const
The LDF residual of the counter is calculated as the sum of the estimated muons of the associated mod...
boost::transform_iterator< ConstComponentResolver, PairConstIterator > ComponentConstIterator
Alias for constant iterator over contained components.
double GetMeanMuonsLowLimit() const
boost::transform_iterator< ComponentResolver, PairIterator > ComponentIterator
Alias for non-constant iterator over contained components.
evt::ComponentGroup< Module > InternalModuleCollection
double GetNumberOfEstimatedMuonsLG() const
The number of estimated muons with the ADC is calculated as the sum of the estimated muons of the ass...
double fTimeResidual
ModuleIterator ModulesBegin()
bool HasRecData() const
Counter is flagged has having reconstructed data if at least one of its associated modules has recons...
Counter level event data.
size_t CountRejectedModules() const
double GetT50Error() const
double GetMeanMuonDensityErrorLow() const
bool HasT50() const
The median of the arrival time of muons in GPS sec, ns All modules associated to the counter are cons...
double GetMeanMuonDensityErrorHigh() const
bool IsSaturated() const
Check if the counter is &quot;hardware&quot; saturated (limit imposed by detector segmentation) ...
void Make(int id)
Construct by id.
ModuleIterator ModulesEnd()
double GetActiveAreaLG() const
double GetNumberOfMuonsErrorHigh() const
bool IsADCCalibratedLG() const
Check if the counter ADC LG channel is calibrated.
Counter(const int cId)
Constructs the Counter with the given identificator.
bool IsRejected() const
Check if the counter is rejected.
void SetT502SdStart(const double c)
bool IsEmpty() const
Checks if there are muons in the counter.
double GetMeanMuonDensity() const
void SetT1(const double t1)
friend void boost::checked_delete(T *) BOOST_NOEXCEPT
Friendship for destruction. Depends on evt::ComponentGroup innards.
double GetMuonDensityHG() const
bool IsSilent() const
Check if the counter is silent.
double GetMuonDensityErrorLowLG() const
bool Has(const int id) const
Query existence.
double GetMuonDensityErrorHighLG() const
double GetActiveAreaHG() const
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
int GetNumberOf() const
Query quantity.
void SetSilent()
Set the status of all modules in this counter to silent. This is used if the associated tank does not...
const Component & const
Retrieve by id.
double GetActiveArea() const
utl::TimeStamp fSignalT50
double fPlaneFrontDelay
double GetMuonDensity() const
The density measured by a counter is the calculated as the number of estimated muons over the active ...
double GetTimeResidual() const
Residual of geometry fit.
double GetMeanMuons() const
bool IsADCCalibratedHG() const
Check if the counter ADC HG channel is calibrated.
Module level event data.
Definition: MEvent/Module.h:41
double GetMuonDensityErrorLowHG() const
double GetNumberOfMuonsLowLimit() const
The lower limit to the number of muons in a counter.
size_t CountSilentModules() const
const Module & GetModule(const int mId) const
double GetMuonDensityErrorHighHG() const
unsigned int GetNumberOfChannelsOn() const
double GetNumberOfMuonsErrorLowHG() const
InternalModuleCollection::ComponentIterator ModuleIterator
ModuleConstIterator ModulesBegin() const
Common class for groups of components of the Event hierarchy.
size_t CountCandidateModules() const
Count the number of modules in the counter by status.
bool HasModule(const int mId) const
Counter level simulation data.
double GetMuonDensityErrorHigh() const
double GetNumberOfMuonsErrorLow() const
void SetSignalT50(const utl::TimeStamp &time)
void SetRejected(const std::string &reason="")
Set the status of all modules in this counter to rejected. As described for the muon counter status...
double GetMeanMuonsErrorLow() const
int GetId() const
The id of the counter.
ModuleConstIterator ModulesEnd() const
void SetTimeResidual(const double residual)
void MakeModule(const int mId)
double GetPlaneFrontDelay() const
Delay of the couner wrt to a plane front oriented with the reconstructed shower axis.
void SetT50Error(const double e)
double GetNumberOfEstimatedMuons() const
The number of estimated muons of the counter is calculated as the sum of the estimated muons of the a...
utl::TimeStamp GetSignalT50() const
double GetMeanMuonsErrorHigh() const
bool HasSimData() const
InternalModuleCollection::ComponentConstIterator ModuleConstIterator
double GetMuonDensityLG() const
int GetNumberOfModules() const
void SetPlaneFrontDelay(const double c)
double GetMuonDensityErrorLow() const
ComponentIterator End()
const CounterSimData & GetSimData() const
CounterSimData & GetSimData()
Component & Get(const int id)
Retrieve by id.
double GetNumberOfEstimatedMuonsHG() const
double GetT502SdStart() const
Nanoseconds between the MD t50 and the SD signal start time (md t50-sd start)
double GetNumberOfMuonsErrorLowLG() const
utl::ShadowPtr< CounterSimData > fSimData

, generated on Tue Sep 26 2023.