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 public:
15 
16  // file I/O
18  void dumpToFile(std::string filename);
19 
20  // add SiPixelModuleStatus for detID, specifying nrocs
21  void addModule(int detid, int nrocs);
22  // add a SiPixelModuleStatus obj for detID
23  void addModule(int detid, SiPixelModuleStatus a);
24 
25  // fill hit in double idc in ROC roc into module detid
26  void fillDIGI(int detid, int roc);
27  // fill FEDerror25 info
28  void fillFEDerror25(int detid, PixelFEDChannel ch);
29 
30  std::map<int, std::vector<int>> getFEDerror25Rocs();
31 
32  // determine detector average nhits and RMS
33  double perRocDigiOcc();
34  double perRocDigiOccVar();
35 
36  unsigned long int digiOccDET() { return fDetHits; }
37 
38  // number of modules in detector
39  int nmodules();
40 
41  // get a Module
42  bool findModule(int detid);
43  SiPixelModuleStatus* getModule(int detid);
44 
45  // provide for iterating over the entire detector
46  std::map<int, SiPixelModuleStatus>::iterator begin();
47  std::map<int, SiPixelModuleStatus>::iterator next();
48  std::map<int, SiPixelModuleStatus>::iterator end();
49 
50  // set the time stamps
51  void setRunRange(int run0, int run1) {
52  fRun0 = run0;
53  fRun1 = run1;
54  }
55  std::pair<int, int> getRunRange() { return std::make_pair(fRun0, fRun1); }
56  void setLSRange(int ls0, int ls1) {
57  fLS0 = ls0;
58  fLS1 = ls1;
59  }
60  std::pair<int, int> getLSRange() { return std::make_pair(fLS0, fLS1); }
61 
62  // total processed events
63  void setNevents(unsigned long int N) { fNevents = N; }
64  unsigned long int getNevents() { return fNevents; }
65 
67  fModules.clear();
68  fDetHits = 0;
69  fNevents = 0;
70  fRun0 = 99999999;
71  fRun1 = 0;
72  fLS0 = 99999999;
73  fLS1 = 0;
74  }
75 
76  // combine detector status
78 
79  // detector status
80  std::map<int, SiPixelModuleStatus> getDetectorStatus() { return fModules; }
81 
82 private:
83  std::map<int, SiPixelModuleStatus> fModules;
84 
85  // first and last lumisection seen in this instance
86  int fLS0, fLS1;
87  // first and last run seen in this instance (should be the same number!)
88  int fRun0, fRun1;
89 
90  // number of events processed
91  unsigned long int fNevents;
92 
93  // total hits in detector
94  unsigned long int fDetHits;
95 };
96 
97 #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()
std::pair< int, int > getRunRange()
void fillDIGI(int detid, int roc)
std::map< int, SiPixelModuleStatus > fModules
std::pair< int, int > getLSRange()
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()
#define N
Definition: blowfish.cc:9
void dumpToFile(std::string filename)
void setRunRange(int run0, int run1)
double a
Definition: hdecay.h:119
unsigned long int getNevents()
std::map< int, SiPixelModuleStatus >::iterator next()
SiPixelModuleStatus * getModule(int detid)