CMS 3D CMS Logo

SiPixelRocStatus.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <map>
3 #include <cmath>
4 #include <vector>
5 
7 
8 using namespace std;
9 
10 // ----------------------------------------------------------------------
12 
13  for (int i = 0; i < nDC_; ++i) {
14  fDC[i] = 0;
15  }
16  isStuckTBM_ = false;
17  badFed_ = -1;
18  badLink_ = -1;
19  startBadTime_ = -1;
20  badFreq_ = 0;
21 }
22 
23 
24 // ----------------------------------------------------------------------
26 
27 }
28 
29 // ----------------------------------------------------------------------
31 
32  if (idc<nDC_) fDC[idc]++;
33 
34 }
35 
36 // ----------------------------------------------------------------------
37 void SiPixelRocStatus::updateDIGI(int idc, unsigned long int hits) {
38 
39  if (idc<nDC_) fDC[idc] += hits;
40 
41 }
42 
43 // ----------------------------------------------------------------------
44 void SiPixelRocStatus::fillStuckTBM(unsigned int fed, unsigned int link, std::time_t time){
45 
46  isStuckTBM_ = true;
47  if(badFreq_==0){
48  startBadTime_ = time;
49  }
50  badFed_ = fed; badLink_ = link;
51  badFreq_ = badFreq_ + 1;
52 }
53 
54 void SiPixelRocStatus::updateStuckTBM(unsigned int fed, unsigned int link, std::time_t time, unsigned long int freq){
55 
56  isStuckTBM_ = true;
57  if(badFreq_==0){
58  startBadTime_ = time;
59  }
60  badFed_ = fed; badLink_ = link;
61  badFreq_ = badFreq_ + freq;
62 }
63 
64 // ----------------------------------------------------------------------
65 unsigned long int SiPixelRocStatus::digiOccDC(int idc) {
66 
67  return (idc<nDC_?fDC[idc]:-1);
68 
69 }
70 
71 // ----------------------------------------------------------------------
72 unsigned long int SiPixelRocStatus::digiOccROC() {
73 
74  unsigned long int count(0) ;
75  for (int idc = 0; idc < nDC_; ++idc) {
76  count += fDC[idc];
77  }
78  return count;
79 }
80 
void updateDIGI(int idc, unsigned long int hits)
void fillStuckTBM(unsigned int fed, unsigned int link, std::time_t time)
unsigned long int digiOccDC(int idc)
void fillDIGI(int idc)
void updateStuckTBM(unsigned int fed, unsigned int link, std::time_t time, unsigned long int freq)
unsigned long int digiOccROC()