HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HarpoDetSet.cxx
Go to the documentation of this file.
1 //
2 // File HarpoDetSet.cxx
3 //
10 #include "HarpoDetSet.h"
11 #include <iostream>
12 
13 
14 ClassImp(HarpoDetSet)
15 
17 
18 HarpoDetSet * HarpoDetSet::_instance = NULL;
19 
20 HarpoDetSet * HarpoDetSet::Instance()
21 {
22  std::cout << "In Instance " << std::endl;
23  if (_instance == NULL ) {
24  _instance = new HarpoDetSet;
25  }
26  return _instance;
27 }
29 void HarpoDetSet::SetMask(ULong_t detset)
30 {
31  // std::cout << "In SetMask " << std::hex << detset << std::endl;
32  // print();
33  hdets.reset();
34  ULong_t mask = 0x1;
35  for(ULong_t i=0; i<gkNDetectors;i++) {
36  if ( detset & mask ) hdets.set(i);
37  mask <<= 1;
38  }
39  //std::cout << "After In SetMask " << std::hex << detset << std::endl;
40  //print();
41 }
42 
44 {
45  std::cout << "---HarpoDetectors Set " << std::endl
46  << " Max Detectors : " << gkNDetectors << std::endl
47  << " Bit Mask (bin) : " << hdets << std::endl;
48 }
49 
50 // HarpoDetReader* HarpoDetSet::NewDetReader(ULong_t det)
51 // {
52 // if( hdets.test(XDCC)) return new HarpoDccReader();
53 
54 // }
virtual void print()
Definition: HarpoDetSet.cxx:43
A generic class for HARPO datectors The class is ....
Definition: HarpoDetSet.h:21
void SetMask(ULong_t detmask)
Redefine active detector set.
Definition: HarpoDetSet.cxx:29
DetSet_t hdets
Definition: HarpoDetSet.h:62
const ULong_t gkNDetectors
Definition: HarpoDet.h:14
R__EXTERN HarpoDetSet * gHDetSet
Definition: HarpoDetSet.h:71