KaliVeda
Toolkit for HIC analysis
KVINDRACodeMask.h
1 
4 #ifndef __KVINDRACODEMASK__
5 #define __KVINDRACODEMASK__
6 
7 #include "TObject.h"
8 
10 
11 
12 
112 class KVINDRACodeMask: public TObject {
113 
114 private:
117 
118 public:
119  /* Global bits for code masks */
120  enum EVedaCodes {
121  kIDCode0 = BIT(0), //these bits concern KVINDRACodeMask::fIDMask
122  kIDCode1 = BIT(1),
123  kIDCode2 = BIT(2),
124  kIDCode3 = BIT(3),
125  kIDCode4 = BIT(4),
126  kIDCode5 = BIT(5),
127  kIDCode6 = BIT(6),
128  kIDCode7 = BIT(7),
129  kIDCode8 = BIT(8),
130  kIDCode9 = BIT(9),
131  kIDCode10 = BIT(10),
132  kIDCode11 = BIT(11),
133  kIDCode14 = BIT(12),
134  kIDCode15 = BIT(13),
135  kECode0 = BIT(0), //these bits concern KVINDRACodeMask::fEMask
136  kECode1 = BIT(1),
137  kECode2 = BIT(2),
138  kECode3 = BIT(3),
139  kECode11 = BIT(4),
140  kECode15 = BIT(5),
141  kECode4 = BIT(6),
142  kECode5 = BIT(7)
143  };
144 
145  enum EIDCodes {
162  };
163  void Copy(TObject& object) const
164  {
165  KVINDRACodeMask& i = (KVINDRACodeMask&)object;
166  i.fIDMask = fIDMask;
167  i.fEMask = fEMask;
168  TObject::Copy(object);
169  }
170 
172  {
174  fIDMask = 0;
175  fEMask = 0;
176  };
178  {
180  fIDMask = 0;
181  fEMask = 0;
182  };
183 
185  {
186  return fIDMask;
187  }
189  {
190  return fEMask;
191  }
192  void SetIDMask(UShort_t codes)
193  {
194  fIDMask = codes;
195  }
196  Bool_t TestIDCode(UShort_t code);
197  Bool_t TestECode(UChar_t code);
198  void SetEMask(UChar_t codes)
199  {
200  fEMask = codes;
201  }
202 
204  {
205  return (TestIDCode(msk.GetIDMask()) && TestECode(msk.GetEMask()));
206  };
207 
208  void Clear(Option_t* = "")
209  {
210  fIDMask = 0;
211  fEMask = 0;
212  TObject::Clear();
213  };
214 
215  Bool_t IsNull() const
216  {
218  return (!fIDMask && !fEMask);
219  }
220 
221  ClassDef(KVINDRACodeMask, 1); //Handles setting and testing code masks for particle calibration quality control
222 };
223 
224 
225 #endif
bool Bool_t
unsigned short UShort_t
unsigned char UChar_t
const char Option_t
#define BIT(n)
Bool_t IsNull() const
UShort_t fIDMask
16-bit mask with id codes
Bool_t TestIDCode(UShort_t code)
void SetEMask(UChar_t codes)
ClassDef(KVINDRACodeMask, 1)
void SetIDMask(UShort_t codes)
void Copy(TObject &object) const
virtual ~ KVINDRACodeMask()
void Clear(Option_t *="")
Bool_t operator&(KVINDRACodeMask &msk)
UChar_t fEMask
8-bit mask with e-calibration codes
Bool_t TestECode(UChar_t code)
UShort_t GetIDMask()
virtual void Clear(Option_t *="")
virtual void Copy(TObject &object) const