HerdSoftware  0.1.1
CaloPDEventChannelInfo.h
Go to the documentation of this file.
1 /*
2  * CaloPDEventChannelInfo.h
3  *
4  * Created on: 06 Aug. 2020
5  * Author: Lorenzo Pacini
6  */
7 
10 #ifndef HERD_CALOPDEVENTCHANNELINFO_H_
11 #define HERD_CALOPDEVENTCHANNELINFO_H_
12 
13 #include "common/AxesArray.h"
14 #include "common/BitMask.h"
15 #include "dataobjects/Point.h"
16 
17 #include <vector>
18 
19 #ifdef HS_USE_ROOT
20 #include "Rtypes.h"
21 #endif
22 
23 namespace Herd {
24 
30 
31 #ifdef HS_USE_ROOT
32  friend void CaloPDEventChannelInfoStreamer(TBuffer &buf, void *voidPtr);
33 #endif
34 
45  enum class Flag : unsigned short { NONE = 0, HIGHGAIN = 1, SATURATED = 1 << 1, INFOVALID = 1 << 15 };
46 
52 
58  CaloPDEventChannelInfo(unsigned int nChannels) { SetNChannels(nChannels); };
59 
61  virtual ~CaloPDEventChannelInfo() = default;
62 
67  void SetNChannels(size_t nChannels) { _channelInfoStatusFlags.resize(nChannels); };
68 
74  Flag StatusFlags(unsigned int volID) const { return _channelInfoStatusFlags[volID]; };
75 
82  void SetStatusFlags(unsigned int volID, Flag channelInfoStatusFlags);
83 
84 private:
88  std::vector<Flag> _channelInfoStatusFlags;
89 
90 // This calss has a custom streamer, please check teh custom streamer if you change teh calss def.
91 #ifdef HS_USE_ROOT
92  ClassDef(CaloPDEventChannelInfo, 1)
93 #endif
94 };
95 
96 } // namespace Herd
97 
98 // Enable bitmask operations on Flag
100 
101 #endif /* HERD_CALOPDEVENTCHANNELINFO_H_ */
Flag StatusFlags(unsigned int volID) const
Return the binary code which contains all the flags corresponding to the ID.
Definition: CaloPDEventChannelInfo.h:74
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
CaloPDEventChannelInfo()
Default constructor with the number of channels = 0.
Definition: CaloPDEventChannelInfo.h:51
std::vector< Flag > _channelInfoStatusFlags
binary code use to store some information
Definition: CaloPDEventChannelInfo.h:88
virtual ~CaloPDEventChannelInfo()=default
Virtual destructor.
void SetNChannels(size_t nChannels)
Setup the total number of channels and initialize the values.
Definition: CaloPDEventChannelInfo.h:67
CaloPDEventChannelInfo(unsigned int nChannels)
Constructor.
Definition: CaloPDEventChannelInfo.h:58
Data structure for information regarding a channel connected to a Calo photodiode.
Definition: CaloPDEventChannelInfo.h:29
void SetStatusFlags(unsigned int volID, Flag channelInfoStatusFlags)
Set the entire binary corresponding to this ID.
Definition: CaloPDEventChannelInfo.cpp:13
#define ENABLE_BITMASK_OPERATORS(x)
Type safe implementation of a bitmask enum.
Definition: BitMask.h:21
Flag
Enum used as index for the bitset member LSB rappresents the Gain: 1 -> high gain; 0 -> low gain...
Definition: CaloPDEventChannelInfo.h:45