CMS 3D CMS Logo

SiPixelDetectorStatus.h
Go to the documentation of this file.
1 #ifndef SIPIXELDETECTORSTATUS_h
2 #define SIPIXELDETECTORSTATUS_h
3 
4 #include <ctime>
5 #include <map>
6 #include <string>
7 
9 
10 // ----------------------------------------------------------------------
12 
13 public:
14 
17 
18  // file I/O
20  void dumpToFile(std::string filename);
21 
22  // add SiPixelModuleStatus for detID, specifying nrocs
23  void addModule(int detid, int nrocs);
24  // add a SiPixelModuleStatus obj for detID
25  void addModule(int detid, SiPixelModuleStatus a);
26 
27  // fill hit in double idc in ROC roc into module detid
28  void fillDIGI(int detid, int roc, int idc);
29  // fill stuck TBM info
30  void fillStuckTBM(int detid, PixelFEDChannel ch, std::time_t time);
31 
32  std::map<int, std::vector<int>> getStuckTBMsRocs();
33 
34  // determine detector average nhits and RMS
35  void digiOccupancy();
36  double perRocDigiOcc(){ digiOccupancy(); return fDetAverage; }
37  double perRocDigiOccVar(){ digiOccupancy(); return fDetSigma; }
38  unsigned long int digiOccDET(){ return fDetHits; }
39 
40  // number of modules in detector
41  int nmodules();
42 
43  // get a Module
44  bool findModule(int detid);
45  SiPixelModuleStatus* getModule(int detid);
46 
47  // provide for iterating over the entire detector
48  std::map<int, SiPixelModuleStatus>::iterator begin();
49  std::map<int, SiPixelModuleStatus>::iterator next();
50  std::map<int, SiPixelModuleStatus>::iterator end();
51 
52  // set the time stamps
53  void setRunRange(int run0, int run1) {fRun0 = run0;fRun1 = run1;}
54  std::pair<int,int> getRunRange() {return std::make_pair(fRun0,fRun1);}
55  void setLSRange(int ls0, int ls1) {fLS0 = ls0; fLS1 = ls1;}
56  std::pair<int,int> getLSRange() {return std::make_pair(fLS0,fLS1);}
57  void setRefTime(std::time_t refTime0, std::time_t refTime1) {fTime0 = refTime0; fTime1 = refTime1;}
58  std::pair<std::time_t,std::time_t> getRefTime() {return std::make_pair(fTime0,fTime1);}
59 
60  // total processed events
61  void setNevents(unsigned long int N){ fNevents = N; }
62  unsigned long int getNevents(){ return fNevents; }
63 
65  fRun0 = 99999999; fRun1 = 0; fLS0 = 99999999; fLS1 = 0;
66  fTime0 = 0; fTime1 = 0;
67  }
68 
69  // combine detector status
72 
73  // detector status
74  std::map<int, SiPixelModuleStatus> getDetectorStatus(){ return fModules; }
75 
76  private:
77 
78  std::map<int, SiPixelModuleStatus> fModules;
79 
80  // first and last lumisection seen in this instance
81  int fLS0, fLS1;
82 
83  // first and last run seen in this instance (likely to be the same number!)
84  int fRun0, fRun1;
85 
86  // being and end time stamp
87  std::time_t fTime0, fTime1;
88 
89  // number of events processed
90  unsigned long int fNevents;
91 
92  // average (per module) number of hits over entire detector
94 
95  // total hits in detector
96  unsigned long int fDetHits;
97 
98 };
99 
100 #endif
void addModule(int detid, int nrocs)
void updateDetectorStatus(SiPixelDetectorStatus newData)
unsigned long int digiOccDET()
std::map< int, SiPixelModuleStatus > fModules
std::map< int, std::vector< int > > getStuckTBMsRocs()
std::map< int, SiPixelModuleStatus >::iterator begin()
unsigned long int fDetHits
unsigned long int fNevents
void readFromFile(std::string filename)
void setNevents(unsigned long int N)
SiPixelDetectorStatus combineDetectorStatus(SiPixelDetectorStatus newData)
std::map< int, SiPixelModuleStatus >::iterator end()
void setLSRange(int ls0, int ls1)
std::map< int, SiPixelModuleStatus > getDetectorStatus()
std::pair< int, int > getRunRange()
#define N
Definition: blowfish.cc:9
void dumpToFile(std::string filename)
std::pair< int, int > getLSRange()
void setRunRange(int run0, int run1)
double a
Definition: hdecay.h:121
void setRefTime(std::time_t refTime0, std::time_t refTime1)
std::pair< std::time_t, std::time_t > getRefTime()
unsigned long int getNevents()
void fillStuckTBM(int detid, PixelFEDChannel ch, std::time_t time)
std::map< int, SiPixelModuleStatus >::iterator next()
SiPixelModuleStatus * getModule(int detid)
void fillDIGI(int detid, int roc, int idc)