MEvent/Module.h
Go to the documentation of this file.
1 #ifndef _mevt_Module_h_
2 #define _mevt_Module_h_
3 
4 #include <evt/ComponentGroup.h>
5 
6 #include <mevt/Scintillator.h>
7 #include <mevt/Channel.h>
8 #include <mevt/ModuleSimData.h>
9 #include <mevt/ModuleRecData.h>
10 
11 #include <utl/Trace.h>
12 #include <utl/ShadowPtr.h>
13 
14 
15 // forward declaration used for friendship
16 namespace io {
17  class Module_ROOT;
18 }
19 
20 namespace mevt {
21 
31  //This is temporary until we integrate the calibration in CDAS
33  long UTC;
34  double chargeA;
35  double chargeB;
36  double noiseA;
37  double noiseB;
38  };
39 
40 
41  class Module {
42 
43  /*
44  * On the detector level the hierarchy was split in
45  * Module->FrontEnd->Channel
46  * Module->PMT->Pixel
47  * because there was some common information at the
48  * PMT or FrontEnd level.
49  * In the event level having a PMT or FrontEnd doesn't
50  * seem worth (or even proper) because the data
51  * will have to be associated a the Channel or Pixel level.
52  *
53  * So we cut corners and hold the Channels here without
54  * the circumlocution of the FrontEnd. In any case,
55  * if in the future the FrontEnd need arises, these methods
56  * here accesing the Channel will be a shorcut to those
57  * in the FrontEnd.
58  */
61 
62  public:
69 
75  const utl::TraceUSI& GetDynodeTrace() const;
76  void MakeDynodeTrace();
77  bool HasDynodeTrace() const;
78 
79  /*
80  * Integrator traces for SiPMs electronics
81  * */
82 
84  const utl::TraceUSI& GetIntegratorATrace() const;
85  void MakeIntegratorATrace();
86  bool HasIntegratorATrace() const;
87 
89  const utl::TraceUSI& GetIntegratorBTrace() const;
90  void MakeIntegratorBTrace();
91  bool HasIntegratorBTrace() const;
92 
93  const std::vector<CalibrationData> GetCalibrationData() { return fCalibrationData; }
94 
95  Channel& GetChannel(const int cId) { return fChannels.Get(cId); }
96  const Channel& GetChannel(const int cId) const { return fChannels.Get(cId); }
97  void MakeChannel(const int cId) { fChannels.Make(cId); }
98  bool HasChannel(const int cId) const { return fChannels.Has(cId); }
99  int GetNumberOfChannels() const { return fChannels.GetNumberOf(); }
104 
111 
112  Scintillator& GetScintillator(const int sId) { return fScintillators.Get(sId); }
113  const Scintillator& GetScintillator(const int sId) const { return fScintillators.Get(sId); }
114  void MakeScintillator(const int sId) { fScintillators.Make(sId); }
115  bool HasScintillator(const int sId) const { return fScintillators.Has(sId); }
122 
127  const ModuleSimData& GetSimData() const { return *fSimData; }
128  void MakeSimData();
129  bool HasSimData() const { return bool(fSimData); }
130 
132 
133 
135  bool IsCandidate() const { return fRecStatus == eCandidate; }
136 
138  bool IsSilent() const { return fRecStatus == eSilent; }
139 
140  void SetRejected(const std::string& reason = "")
141  { fRecStatus = eRejected; fRejectionReason = reason; }
142  bool IsRejected() const { return fRecStatus == eRejected; }
143  std::string GetRejectionReason() const { return fRejectionReason; }
144 
145  void SetChannelMask(const std::bitset<64>& mask) { fChannelMask = mask; }
146  size_t GetNumberOfActiveChannels() const { return fChannelMask.size() - fChannelMask.count(); }
147 
149 
154  const ModuleRecData& GetRecData() const { return *fRecData; }
155  void MakeRecData();
156  bool HasRecData() const { return bool(fRecData); }
157  //@
158  int GetId() const { return fId; }
159 
160  // Implicit ones.
161  //Module(const Module& module);
162  //Module& operator=(const Module& module);
163 
164  private:
180  };
181 
182  //Module() { }
183 
184  Module(const int mId) : fId(mId) { fRecStatus = eUndefined; }
185 
186  ~Module() { }
187 
193 
199  template<class T>
200  friend void boost::checked_delete(T*) BOOST_NOEXCEPT;
201 
208  friend class io::Module_ROOT;
209 
211 
212  int fId = -1;
214  std::string fRejectionReason;
217 
223 
224  std::vector<CalibrationData> fCalibrationData;
225 
226  std::bitset<64> fChannelMask; // mask of working channels 0 = working, 1 = not working
227 
228  };
229 
230 }
231 
232 
233 #endif
ComponentIterator Begin()
Module level reconstruction data. This class contains all data required by the muon reconstruction...
Definition: ModuleRecData.h:29
ChannelIterator ChannelsEnd()
pointer with built-in initialization, deletion, deep copying
Definition: ShadowPtr.h:163
ScintillatorConstIterator ScintillatorsBegin() const
ModuleReconstructionStatus
The muon module status.
void MakeChannel(const int cId)
Definition: MEvent/Module.h:97
ScintillatorConstIterator ScintillatorsEnd() const
std::string fRejectionReason
boost::transform_iterator< ConstComponentResolver, PairConstIterator > ComponentConstIterator
Alias for constant iterator over contained components.
bool HasIntegratorBTrace() const
boost::transform_iterator< ComponentResolver, PairIterator > ComponentIterator
Alias for non-constant iterator over contained components.
utl::ShadowPtr< ModuleSimData > fSimData
bool HasScintillator(const int sId) const
void MakeScintillator(const int sId)
void SetSilent()
bool HasDynodeTrace() const
void Make(int id)
Construct by id.
std::string GetRejectionReason() const
const std::vector< CalibrationData > GetCalibrationData()
Definition: MEvent/Module.h:93
utl::ShadowPtr< utl::TraceUSI > fIntegratorBTrace
void MakeDynodeTrace()
Module(const int mId)
int GetId() const
evt::ComponentGroup< Scintillator > InternalScintillatorCollection
Definition: MEvent/Module.h:59
bool Has(const int id) const
Query existence.
int GetNumberOf() const
Query quantity.
const Component & const
Retrieve by id.
utl::ShadowPtr< utl::TraceUSI > fDynodeTrace
utl::TraceUSI & GetDynodeTrace()
Definition: MEvent/Module.cc:7
InternalScintillatorCollection fScintillators
Scintillator & GetScintillator(const int sId)
Scintillator level event data.
bool HasSimData() const
constexpr double s
Definition: AugerUnits.h:163
Module level event data.
Definition: MEvent/Module.h:41
ChannelIterator ChannelsBegin()
InternalScintillatorCollection::ComponentConstIterator ScintillatorConstIterator
std::bitset< 64 > fChannelMask
ChannelConstIterator ChannelsBegin() const
utl::ShadowPtr< ModuleRecData > fRecData
bool IsSilent() const
Channel & GetChannel(const int cId)
Definition: MEvent/Module.h:95
const Channel & GetChannel(const int cId) const
Definition: MEvent/Module.h:96
const ModuleRecData & GetRecData() const
int GetNumberOfChannels() const
Definition: MEvent/Module.h:99
utl::ShadowPtr< utl::TraceUSI > fIntegratorATrace
ModuleReconstructionStatus fRecStatus
void MakeSimData()
utl::TraceUSI & GetIntegratorATrace()
bool HasIntegratorATrace() const
bool HasChannel(const int cId) const
Definition: MEvent/Module.h:98
void MakeIntegratorATrace()
InternalChannelCollection fChannels
void SetRejected(const std::string &reason="")
Module level simulation data.
Definition: ModuleSimData.h:22
ChannelConstIterator ChannelsEnd() const
const Scintillator & GetScintillator(const int sId) const
ScintillatorIterator ScintillatorsEnd()
friend void boost::checked_delete(T *) BOOST_NOEXCEPT
Friendship for destruction.
evt::ComponentGroup< Channel > InternalChannelCollection
Definition: MEvent/Module.h:60
Template class for a FADC data or calibrated data container. Use the typedefs (TraceD, TraceI, etc.) defined in Trace-fwd.h.
Definition: Trace-fwd.h:19
ModuleRecData & GetRecData()
bool IsRejected() const
Channel level event data.
InternalScintillatorCollection::ComponentIterator ScintillatorIterator
std::vector< CalibrationData > fCalibrationData
int GetNumberOfScintillators() const
void SetChannelMask(const std::bitset< 64 > &mask)
InternalChannelCollection::ComponentConstIterator ChannelConstIterator
Definition: MEvent/Module.h:67
void MakeIntegratorBTrace()
ModuleSimData & GetSimData()
utl::TraceUSI & GetIntegratorBTrace()
ComponentIterator End()
ScintillatorIterator ScintillatorsBegin()
bool HasRecData() const
Component & Get(const int id)
Retrieve by id.
void SetCandidate()
bool IsCandidate() const
size_t GetNumberOfActiveChannels() const
void MakeRecData()
const ModuleSimData & GetSimData() const
InternalChannelCollection::ComponentIterator ChannelIterator
Definition: MEvent/Module.h:68
void SetRecStatus(const int s)

, generated on Tue Sep 26 2023.