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
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
SiPixelDetectorStatus::next
std::map< int, SiPixelModuleStatus >::iterator next()
SiPixelDetectorStatus::resetDetectorStatus
void resetDetectorStatus()
Definition: SiPixelDetectorStatus.h:66
PixelFEDChannel
Definition: PixelFEDChannel.h:6
SiPixelDetectorStatus::fNevents
unsigned long int fNevents
Definition: SiPixelDetectorStatus.h:91
SiPixelDetectorStatus::getFEDerror25Rocs
std::map< int, std::vector< int > > getFEDerror25Rocs()
Definition: SiPixelDetectorStatus.cc:127
SiPixelDetectorStatus::fRun1
int fRun1
Definition: SiPixelDetectorStatus.h:88
SiPixelDetectorStatus::getModule
SiPixelModuleStatus * getModule(int detid)
Definition: SiPixelDetectorStatus.cc:164
SiPixelDetectorStatus::begin
std::map< int, SiPixelModuleStatus >::iterator begin()
Definition: SiPixelDetectorStatus.cc:150
SiPixelDetectorStatus::setLSRange
void setLSRange(int ls0, int ls1)
Definition: SiPixelDetectorStatus.h:56
SiPixelDetectorStatus::SiPixelDetectorStatus
SiPixelDetectorStatus()
Definition: SiPixelDetectorStatus.cc:14
SiPixelDetectorStatus::findModule
bool findModule(int detid)
Definition: SiPixelDetectorStatus.cc:171
SiPixelDetectorStatus
Definition: SiPixelDetectorStatus.h:11
SiPixelDetectorStatus::addModule
void addModule(int detid, int nrocs)
Definition: SiPixelDetectorStatus.cc:105
SiPixelDetectorStatus::getDetectorStatus
std::map< int, SiPixelModuleStatus > getDetectorStatus()
Definition: SiPixelDetectorStatus.h:80
ntuplemaker.run1
run1
Definition: ntuplemaker.py:85
SiPixelDetectorStatus::fillDIGI
void fillDIGI(int detid, int roc)
Definition: SiPixelDetectorStatus.cc:114
SiPixelDetectorStatus::getLSRange
std::pair< int, int > getLSRange()
Definition: SiPixelDetectorStatus.h:60
N
#define N
Definition: blowfish.cc:9
SiPixelDetectorStatus::nmodules
int nmodules()
Definition: SiPixelDetectorStatus.cc:161
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
SiPixelDetectorStatus::~SiPixelDetectorStatus
~SiPixelDetectorStatus()
Definition: SiPixelDetectorStatus.cc:20
SiPixelModuleStatus
Definition: SiPixelModuleStatus.h:10
ntuplemaker.run0
run0
Definition: ntuplemaker.py:84
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelDetectorStatus::getNevents
unsigned long int getNevents()
Definition: SiPixelDetectorStatus.h:64
SiPixelDetectorStatus::fillFEDerror25
void fillFEDerror25(int detid, PixelFEDChannel ch)
Definition: SiPixelDetectorStatus.cc:120
SiPixelDetectorStatus::fDetHits
unsigned long int fDetHits
Definition: SiPixelDetectorStatus.h:94
a
double a
Definition: hdecay.h:119
SiPixelDetectorStatus::setNevents
void setNevents(unsigned long int N)
Definition: SiPixelDetectorStatus.h:63
SiPixelDetectorStatus::dumpToFile
void dumpToFile(std::string filename)
Definition: SiPixelDetectorStatus.cc:84
SiPixelDetectorStatus::perRocDigiOccVar
double perRocDigiOccVar()
Definition: SiPixelDetectorStatus.cc:192
SiPixelDetectorStatus::fModules
std::map< int, SiPixelModuleStatus > fModules
Definition: SiPixelDetectorStatus.h:83
SiPixelDetectorStatus::end
std::map< int, SiPixelModuleStatus >::iterator end()
Definition: SiPixelDetectorStatus.cc:158
SiPixelDetectorStatus::updateDetectorStatus
void updateDetectorStatus(SiPixelDetectorStatus newData)
Definition: SiPixelDetectorStatus.cc:210
SiPixelDetectorStatus::readFromFile
void readFromFile(std::string filename)
Definition: SiPixelDetectorStatus.cc:23
SiPixelModuleStatus.h
DeadROCCounter.nrocs
nrocs
Definition: DeadROCCounter.py:57
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
SiPixelDetectorStatus::fLS1
int fLS1
Definition: SiPixelDetectorStatus.h:86
SiPixelDetectorStatus::setRunRange
void setRunRange(int run0, int run1)
Definition: SiPixelDetectorStatus.h:51
SiPixelDetectorStatus::perRocDigiOcc
double perRocDigiOcc()
Definition: SiPixelDetectorStatus.cc:179
SiPixelDetectorStatus::fRun0
int fRun0
Definition: SiPixelDetectorStatus.h:88
SiPixelDetectorStatus::digiOccDET
unsigned long int digiOccDET()
Definition: SiPixelDetectorStatus.h:36
SiPixelDetectorStatus::fLS0
int fLS0
Definition: SiPixelDetectorStatus.h:86
SiPixelDetectorStatus::getRunRange
std::pair< int, int > getRunRange()
Definition: SiPixelDetectorStatus.h:55