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);
29  // fill FEDerror25 info
30  void fillFEDerror25(int detid, PixelFEDChannel ch);
31 
32  std::map<int, std::vector<int>> getFEDerror25Rocs();
33 
34  // determine detector average nhits and RMS
35  double perRocDigiOcc();
36  double perRocDigiOccVar();
37 
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 
58  // total processed events
59  void setNevents(unsigned long int N){ fNevents = N; }
60  unsigned long int getNevents(){ return fNevents; }
61 
63  fRun0 = 99999999; fRun1 = 0; fLS0 = 99999999; fLS1 = 0;
64  }
65 
66  // combine detector status
68 
69  // detector status
70  std::map<int, SiPixelModuleStatus> getDetectorStatus(){ return fModules; }
71 
72  private:
73 
74  std::map<int, SiPixelModuleStatus> fModules;
75 
76  // first and last lumisection seen in this instance
77  int fLS0, fLS1;
78  // first and last run seen in this instance (should be the same number!)
79  int fRun0, fRun1;
80 
81  // number of events processed
82  unsigned long int fNevents;
83 
84  // total hits in detector
85  unsigned long int fDetHits;
86 
87 };
88 
89 #endif
void addModule(int detid, int nrocs)
void updateDetectorStatus(SiPixelDetectorStatus newData)
unsigned long int digiOccDET()
void fillFEDerror25(int detid, PixelFEDChannel ch)
std::map< int, std::vector< int > > getFEDerror25Rocs()
void fillDIGI(int detid, int roc)
std::map< int, SiPixelModuleStatus > fModules
unsigned long int fDetHits
unsigned long int fNevents
void readFromFile(std::string filename)
void setNevents(unsigned long int N)
std::map< int, SiPixelModuleStatus >::iterator end()
std::map< int, SiPixelModuleStatus >::iterator begin()
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
unsigned long int getNevents()
std::map< int, SiPixelModuleStatus >::iterator next()
SiPixelModuleStatus * getModule(int detid)