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  // reset
17  void resetDetectorStatus();
18  // combine detector status
20 
21  // file I/O
23  void dumpToFile(std::ofstream& outFile);
24 
25  /*|||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
26 
27  // add SiPixelModuleStatus for detID, specifying nrocs
28  void addModule(int detid, int nrocs);
29  // add a SiPixelModuleStatus obj for detID
30  void addModule(int detid, SiPixelModuleStatus a);
31  // get a Module
32  bool findModule(int detid);
33  SiPixelModuleStatus* getModule(int detid);
34 
35  // fill hit in double idc in ROC roc into module detid
36  void fillDIGI(int detid, int roc);
37  // fill FEDerror25 info
38  void fillFEDerror25(int detid, PixelFEDChannel ch);
39 
40  // detector status : std:map - collection of module status
41  std::map<int, SiPixelModuleStatus> getDetectorStatus() { return fModules_; }
42  // list of ROCs with FEDerror25
43  std::map<int, std::vector<int>> getFEDerror25Rocs();
44  // total number of DIGIs
45  unsigned long int digiOccDET() { return fDetHits_; }
46  // total processed events
47  void setNevents(unsigned long int N) { ftotalevents_ = N; }
48  unsigned long int getNevents() { return ftotalevents_; }
49 
50  // number of modules in detector
51  int nmodules();
52  // determine detector average nhits and RMS
53  double perRocDigiOcc();
54  double perRocDigiOccVar();
55 
56  // set the time stamps
57  void setRunRange(int run0, int run1) {
58  fRun0_ = run0;
59  fRun1_ = run1;
60  }
61  std::pair<int, int> getRunRange() { return std::make_pair(fRun0_, fRun1_); }
63  void setLSRange(int ls0, int ls1) {
64  fLS0_ = ls0;
65  fLS1_ = ls1;
66  }
67  std::pair<int, int> getLSRange() { return std::make_pair(fLS0_, fLS1_); }
68 
69  // provide for iterating over the entire detector
70  std::map<int, SiPixelModuleStatus>::iterator begin();
71  std::map<int, SiPixelModuleStatus>::iterator next();
72  std::map<int, SiPixelModuleStatus>::iterator end();
73 
74 private:
75  std::map<int, SiPixelModuleStatus> fModules_;
76 
77  // first and last lumisection seen in this instance
78  int fLS0_, fLS1_;
79  // first and last run (should be the same number! as currently only perform Single Run Harvestor)
80  int fRun0_, fRun1_;
81 
82  // number of events processed
83  unsigned long int ftotalevents_;
84 
85  // total hits in detector
86  unsigned long int fDetHits_;
87 };
88 
89 #endif
SiPixelDetectorStatus::fDetHits_
unsigned long int fDetHits_
Definition: SiPixelDetectorStatus.h:86
SiPixelDetectorStatus::next
std::map< int, SiPixelModuleStatus >::iterator next()
SiPixelDetectorStatus::fLS1_
int fLS1_
Definition: SiPixelDetectorStatus.h:78
SiPixelDetectorStatus::fLS0_
int fLS0_
Definition: SiPixelDetectorStatus.h:78
SiPixelDetectorStatus::resetDetectorStatus
void resetDetectorStatus()
Definition: SiPixelDetectorStatus.cc:223
PixelFEDChannel
Definition: PixelFEDChannel.h:6
SiPixelDetectorStatus::getFEDerror25Rocs
std::map< int, std::vector< int > > getFEDerror25Rocs()
Definition: SiPixelDetectorStatus.cc:127
SiPixelDetectorStatus::getModule
SiPixelModuleStatus * getModule(int detid)
Definition: SiPixelDetectorStatus.cc:159
SiPixelDetectorStatus::begin
std::map< int, SiPixelModuleStatus >::iterator begin()
Definition: SiPixelDetectorStatus.cc:150
SiPixelDetectorStatus::setLSRange
void setLSRange(int ls0, int ls1)
Definition: SiPixelDetectorStatus.h:63
SiPixelDetectorStatus::SiPixelDetectorStatus
SiPixelDetectorStatus()
Definition: SiPixelDetectorStatus.cc:14
SiPixelDetectorStatus::findModule
bool findModule(int detid)
Definition: SiPixelDetectorStatus.cc:166
SiPixelDetectorStatus
Definition: SiPixelDetectorStatus.h:11
SiPixelDetectorStatus::dumpToFile
void dumpToFile(std::ofstream &outFile)
Definition: SiPixelDetectorStatus.cc:85
SiPixelDetectorStatus::addModule
void addModule(int detid, int nrocs)
Definition: SiPixelDetectorStatus.cc:102
SiPixelDetectorStatus::getDetectorStatus
std::map< int, SiPixelModuleStatus > getDetectorStatus()
Definition: SiPixelDetectorStatus.h:41
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:67
N
#define N
Definition: blowfish.cc:9
SiPixelDetectorStatus::nmodules
int nmodules()
Definition: SiPixelDetectorStatus.cc:156
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
L1TdeCSCTF_cfi.outFile
outFile
Definition: L1TdeCSCTF_cfi.py:5
SiPixelDetectorStatus::getNevents
unsigned long int getNevents()
Definition: SiPixelDetectorStatus.h:48
SiPixelDetectorStatus::fillFEDerror25
void fillFEDerror25(int detid, PixelFEDChannel ch)
Definition: SiPixelDetectorStatus.cc:120
a
double a
Definition: hdecay.h:119
SiPixelDetectorStatus::setNevents
void setNevents(unsigned long int N)
Definition: SiPixelDetectorStatus.h:47
SiPixelDetectorStatus::perRocDigiOccVar
double perRocDigiOccVar()
Definition: SiPixelDetectorStatus.cc:187
SiPixelDetectorStatus::end
std::map< int, SiPixelModuleStatus >::iterator end()
Definition: SiPixelDetectorStatus.cc:153
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelDetectorStatus::updateDetectorStatus
void updateDetectorStatus(SiPixelDetectorStatus newData)
Definition: SiPixelDetectorStatus.cc:207
SiPixelDetectorStatus::ftotalevents_
unsigned long int ftotalevents_
Definition: SiPixelDetectorStatus.h:83
SiPixelDetectorStatus::readFromFile
void readFromFile(std::string filename)
Definition: SiPixelDetectorStatus.cc:23
SiPixelDetectorStatus::fModules_
std::map< int, SiPixelModuleStatus > fModules_
Definition: SiPixelDetectorStatus.h:75
SiPixelModuleStatus.h
SiPixelDetectorStatus::fRun0_
int fRun0_
Definition: SiPixelDetectorStatus.h:80
DeadROCCounter.nrocs
nrocs
Definition: DeadROCCounter.py:57
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
SiPixelDetectorStatus::setRunRange
void setRunRange(int run0, int run1)
Definition: SiPixelDetectorStatus.h:57
SiPixelDetectorStatus::perRocDigiOcc
double perRocDigiOcc()
Definition: SiPixelDetectorStatus.cc:174
SiPixelDetectorStatus::fRun1_
int fRun1_
Definition: SiPixelDetectorStatus.h:80
SiPixelDetectorStatus::digiOccDET
unsigned long int digiOccDET()
Definition: SiPixelDetectorStatus.h:45
SiPixelDetectorStatus::getRunRange
std::pair< int, int > getRunRange()
Definition: SiPixelDetectorStatus.h:61