HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HarpoDetSet.h
Go to the documentation of this file.
1 #ifndef HARPODETSET_H
2 #define HARPODETSET_H
3 
5 //
6 // HarpoDetSet
7 //
8 // Generic class for HARPO Detectors Sets ( full list, active detectors)
9 //
10 
11 #include <bitset>
12 #include <cstring>
13 
14 #include "TObject.h"
15 //Detectors Type
16 #include "HarpoDet.h"
17 //#include "HarpoDetReader.h"
18 
19 typedef std::bitset<gkNDetectors> DetSet_t;
20 
21 class HarpoDetSet : public TObject{
22 
23  public:
24  static HarpoDetSet * Instance(); //Get pointer for unique detset
25 
26  virtual ~HarpoDetSet() {}
27 
28  virtual void print();
29  void SetMask(ULong_t detmask);
30  void Set(ULong_t det) { hdets.set(det); }
31  void UnSet(ULong_t det) { hdets.reset(det); }
32  Bool_t isExist(ULong_t det) {
34  /* if( hdets.test(SIMDET)){ */
35  /* if(det == SIMDET) return true; */
36  /* return false; */
37  /* } */
38  //if(det==SIMDET) return false;
39  return hdets.test(det);
40  }
41  Bool_t isSim(){return hdets.test(SIMDET);}
42  /* Bool_t isDcc(ULong_t det){ */
43  /* if( hdets.test(XDCC)) return true; */
44  /* if( hdets.test(YDCC)) return true; */
45  /* if( hdets.test(SIMDET)) return true; */
46  /* return false; */
47  /* } */
49  Long_t countDets() const {
50  if(hdets.test(SIMDET)) return hdets.count()-1;
51  return hdets.count();
52  }
54  Long_t MaxDetectors() /* const */ { return hdets.size(); }
55  /* const */ ULong_t GetMask() /* const */ { return hdets.to_ulong();}
56 
57  /* HarpoDetReader* NewDetReader(); */
58 
59  private:
61 
62  DetSet_t hdets; // Empty Harpo Detectors maks
63  static HarpoDetSet * _instance; // Unique instace of class
64 
65  ClassDef(HarpoDetSet,1) //Event structure
66 
67  };
68 
69 // Global Pointer to Detector Set
70 
71 R__EXTERN HarpoDetSet *gHDetSet;
72 
73 #endif
virtual void print()
Definition: HarpoDetSet.cxx:43
static HarpoDetSet * Instance()
Definition: HarpoDetSet.cxx:20
Long_t MaxDetectors()
Max Number of Detectors.
Definition: HarpoDetSet.h:54
Bool_t isExist(ULong_t det)
Detecror date exist //! Number of Real Detectors.
Definition: HarpoDetSet.h:33
Long_t countDets() const
Real Detectors number.
Definition: HarpoDetSet.h:49
void UnSet(ULong_t det)
Add Detector.
Definition: HarpoDetSet.h:31
A generic class for HARPO datectors The class is ....
Definition: HarpoDetSet.h:21
Bool_t isSim()
Definition: HarpoDetSet.h:41
virtual ~HarpoDetSet()
Definition: HarpoDetSet.h:26
Data from Keller temperuture and pressure sensors.
Definition: HarpoDet.h:22
static HarpoDetSet * _instance
Global pointer.
Definition: HarpoDetSet.h:63
void SetMask(ULong_t detmask)
Redefine active detector set.
Definition: HarpoDetSet.cxx:29
ULong_t GetMask()
Definition: HarpoDetSet.h:55
DetSet_t hdets
Definition: HarpoDetSet.h:62
void Set(ULong_t det)
Definition: HarpoDetSet.h:30
std::bitset< gkNDetectors > DetSet_t
Definition: HarpoDetSet.h:19
R__EXTERN HarpoDetSet * gHDetSet
Definition: HarpoDetSet.h:71