CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
void addModule(int detid, int nrocs)
void updateDetectorStatus(SiPixelDetectorStatus newData)
void dumpToFile(std::ofstream &outFile)
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::pair< int, int > getLSRange()
unsigned long int fDetHits_
unsigned long int ftotalevents_
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::map< int, SiPixelModuleStatus > fModules_
#define N
Definition: blowfish.cc:9
void setRunRange(int run0, int run1)
double a
Definition: hdecay.h:119
unsigned long int getNevents()
tuple filename
Definition: lut2db_cfg.py:20
std::map< int, SiPixelModuleStatus >::iterator next()
SiPixelModuleStatus * getModule(int detid)