CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SiPixelModuleStatus Class Reference

#include <SiPixelModuleStatus.h>

Public Member Functions

int detid ()
 accessors and setters More...
 
unsigned long int digiOccDC (int iroc, int idc)
 return DC status of a ROC (=hits on DC idc on ROC iroc) More...
 
unsigned long int digiOccMOD ()
 return module status (= hits on module) More...
 
unsigned long int digiOccROC (int iroc)
 return ROC status (= hits on ROC iroc) More...
 
void digiOccupancy ()
 calculate (averaged over this module's ROCs) mean hit number and its sigma More...
 
void fillDIGI (int iroc, int idc)
 fill with online coordinates More...
 
void fillStuckTBM (PixelFEDChannel ch, std::time_t time)
 fill stuck TBM More...
 
SiPixelRocStatusgetRoc (int i)
 get a ROC More...
 
int nrocs ()
 
double perRocDigiOcc ()
 
double perRocDigiOccVar ()
 
void setNrocs (int iroc)
 
 SiPixelModuleStatus (int det=0, int nrocs=16)
 
void updateDIGI (int iroc, int idc, unsigned long nhit)
 fill with online coordinates (nhit > 1) More...
 
void updateModuleDIGI (int roc, int dc, unsigned long int nhits)
 combine new data to update(topup) module status More...
 
void updateModuleStatus (SiPixelModuleStatus newData)
 
 ~SiPixelModuleStatus ()
 

Private Attributes

int fDetid
 
double fModAverage
 
double fModSigma
 
int fNrocs
 
std::vector< SiPixelRocStatusfRocs
 

Detailed Description

Definition at line 11 of file SiPixelModuleStatus.h.

Constructor & Destructor Documentation

SiPixelModuleStatus::SiPixelModuleStatus ( int  det = 0,
int  nrocs = 16 
)

Definition at line 14 of file SiPixelModuleStatus.cc.

References a, fModAverage, fModSigma, fNrocs, fRocs, and mps_fire::i.

14  : fDetid(detId), fNrocs(nrocs) {
15 
16  for (int i = 0; i < fNrocs; ++i) {
18  fRocs.push_back(a);
19  }
20 
21  fModAverage = fModSigma = 0.;
22 
23 };
std::vector< SiPixelRocStatus > fRocs
double a
Definition: hdecay.h:121
SiPixelModuleStatus::~SiPixelModuleStatus ( )

Definition at line 27 of file SiPixelModuleStatus.cc.

27 {};

Member Function Documentation

int SiPixelModuleStatus::detid ( )

accessors and setters

Definition at line 89 of file SiPixelModuleStatus.cc.

References fDetid.

Referenced by updateModuleStatus().

89  {
90 
91  return fDetid;
92 
93 }
unsigned long int SiPixelModuleStatus::digiOccDC ( int  iroc,
int  idc 
)

return DC status of a ROC (=hits on DC idc on ROC iroc)

Definition at line 61 of file SiPixelModuleStatus.cc.

References fNrocs, and fRocs.

Referenced by updateModuleStatus().

61  {
62 
63  return (iroc < fNrocs ? fRocs[iroc].digiOccDC(idc) : -1);
64 
65 }
std::vector< SiPixelRocStatus > fRocs
unsigned long int digiOccDC(int iroc, int idc)
return DC status of a ROC (=hits on DC idc on ROC iroc)
unsigned long int SiPixelModuleStatus::digiOccMOD ( )

return module status (= hits on module)

Definition at line 77 of file SiPixelModuleStatus.cc.

References KineDebug3::count(), digiOccROC(), and fNrocs.

77  {
78 
79  unsigned long int count(0);
80  for (int iroc = 0; iroc < fNrocs; ++iroc) {
81  count += digiOccROC(iroc);
82  }
83  return count;
84 
85 }
unsigned long int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)
unsigned long int SiPixelModuleStatus::digiOccROC ( int  iroc)

return ROC status (= hits on ROC iroc)

Definition at line 69 of file SiPixelModuleStatus.cc.

References fNrocs, and fRocs.

Referenced by digiOccMOD(), digiOccupancy(), and SiPixelStatusHarvester::endRun().

69  {
70 
71  return (iroc < fNrocs ? fRocs[iroc].digiOccROC() : -1);
72 
73 }
std::vector< SiPixelRocStatus > fRocs
unsigned long int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)
void SiPixelModuleStatus::digiOccupancy ( )

calculate (averaged over this module's ROCs) mean hit number and its sigma

Definition at line 122 of file SiPixelModuleStatus.cc.

References digiOccROC(), fModAverage, fModSigma, and fNrocs.

Referenced by perRocDigiOcc(), and perRocDigiOccVar().

122  {
123 
124  fModAverage = fModSigma = 0.;
125  unsigned long int ave(0.), sig(0.);
126  for (int iroc = 0; iroc < fNrocs; ++iroc) {
127  unsigned long int inc = digiOccROC(iroc);
128  ave += inc;
129  }
130  fModAverage = (1.0*ave)/fNrocs;
131 
132  for (int iroc = 0; iroc < fNrocs; ++iroc) {
133  unsigned long int inc = digiOccROC(iroc);
134  sig += (fModAverage-inc)*(fModAverage-inc);
135  }
136 
137  fModSigma = sig/(fNrocs-1);
138  fModSigma = TMath::Sqrt(fModSigma);
139 
140 }
unsigned long int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)
void SiPixelModuleStatus::fillDIGI ( int  iroc,
int  idc 
)

fill with online coordinates

Definition at line 31 of file SiPixelModuleStatus.cc.

References fNrocs, and fRocs.

31  {
32 
33  if (iroc < fNrocs)
34  fRocs[iroc].fillDIGI(idc);
35 
36 }
std::vector< SiPixelRocStatus > fRocs
void SiPixelModuleStatus::fillStuckTBM ( PixelFEDChannel  ch,
std::time_t  time 
)

fill stuck TBM

Definition at line 47 of file SiPixelModuleStatus.cc.

References PixelFEDChannel::fed, fNrocs, fRocs, createfilelist::int, PixelFEDChannel::link, PixelFEDChannel::roc_first, and PixelFEDChannel::roc_last.

47  {
48 
49  int fed = int(ch.fed);
50  int link = int(ch.link);
51  int roc_first = int(ch.roc_first); int roc_last = int(ch.roc_last);
52  for (int iroc = 0; iroc < fNrocs; iroc++){
53  if(iroc>=roc_first && iroc<=roc_last){
54  fRocs[iroc].fillStuckTBM(fed,link,time);
55  }
56  }
57 
58 }
unsigned int fed
unsigned int link
unsigned int roc_last
std::vector< SiPixelRocStatus > fRocs
unsigned int roc_first
SiPixelRocStatus * SiPixelModuleStatus::getRoc ( int  i)

get a ROC

Definition at line 145 of file SiPixelModuleStatus.cc.

References fRocs, and mps_fire::i.

Referenced by SiPixelDetectorStatus::getStuckTBMsRocs(), and updateModuleStatus().

145  {
146  return &fRocs[i];
147 }
std::vector< SiPixelRocStatus > fRocs
int SiPixelModuleStatus::nrocs ( )
double SiPixelModuleStatus::perRocDigiOcc ( )

Definition at line 108 of file SiPixelModuleStatus.cc.

References digiOccupancy(), and fModAverage.

108  {
109  digiOccupancy();
110  return fModAverage;
111 }
void digiOccupancy()
calculate (averaged over this module&#39;s ROCs) mean hit number and its sigma
double SiPixelModuleStatus::perRocDigiOccVar ( )

Definition at line 115 of file SiPixelModuleStatus.cc.

References digiOccupancy(), and fModSigma.

115  {
116 
117  digiOccupancy();
118  return fModSigma;
119 }
void digiOccupancy()
calculate (averaged over this module&#39;s ROCs) mean hit number and its sigma
void SiPixelModuleStatus::setNrocs ( int  iroc)

Definition at line 102 of file SiPixelModuleStatus.cc.

References fNrocs.

Referenced by SiPixelDetectorStatus::readFromFile().

102  {
103  fNrocs = iroc;
104 }
void SiPixelModuleStatus::updateDIGI ( int  iroc,
int  idc,
unsigned long  nhit 
)

fill with online coordinates (nhit > 1)

Definition at line 39 of file SiPixelModuleStatus.cc.

References fNrocs, and fRocs.

39  {
40 
41  if (iroc < fNrocs)
42  fRocs[iroc].updateDIGI(idc, nhit);
43 
44 }
std::vector< SiPixelRocStatus > fRocs
void SiPixelModuleStatus::updateModuleDIGI ( int  roc,
int  dc,
unsigned long int  nhits 
)

combine new data to update(topup) module status

Definition at line 150 of file SiPixelModuleStatus.cc.

References fRocs.

Referenced by SiPixelDetectorStatus::readFromFile().

150  {
151  fRocs[iroc].updateDIGI(idc,nhits);
152 }
std::vector< SiPixelRocStatus > fRocs
void SiPixelModuleStatus::updateModuleStatus ( SiPixelModuleStatus  newData)

Definition at line 154 of file SiPixelModuleStatus.cc.

References detid(), digiOccDC(), fDetid, fNrocs, fRocs, SiPixelRocStatus::getBadFed(), SiPixelRocStatus::getBadFreq(), SiPixelRocStatus::getBadLink(), getRoc(), SiPixelRocStatus::getStartBadTime(), SiPixelRocStatus::isStuckTBM(), and nrocs().

Referenced by SiPixelDetectorStatus::combineDetectorStatus().

154  {
155 
156  bool isSameModule = true;
157  if( fDetid!=newData.detid() || fNrocs!=newData.nrocs()) {
158  isSameModule = false;
159  }
160 
161  if(isSameModule){
162 
163  for (int iroc = 0; iroc < fNrocs; ++iroc) {
164  int nDC = fRocs[iroc].nDC();
165  //update occupancy
166  for(int idc = 0; idc < nDC; ++idc) {
167  fRocs[iroc].updateDIGI(idc,newData.digiOccDC(iroc,idc));
168  }
169  //update stuckTBM
170  SiPixelRocStatus* rocStatus = newData.getRoc(iroc);
171  if(rocStatus->isStuckTBM()){
172  fRocs[iroc].updateStuckTBM(rocStatus->getBadFed(), rocStatus->getBadLink(),rocStatus->getStartBadTime(), rocStatus->getBadFreq());
173  }
174  }
175 
176  } // if same module
177 
178 }
int detid()
accessors and setters
std::vector< SiPixelRocStatus > fRocs
unsigned long int getBadFreq()
unsigned int getBadLink()
unsigned int getBadFed()
std::time_t getStartBadTime()
SiPixelRocStatus * getRoc(int i)
get a ROC
unsigned long int digiOccDC(int iroc, int idc)
return DC status of a ROC (=hits on DC idc on ROC iroc)

Member Data Documentation

int SiPixelModuleStatus::fDetid
private

Definition at line 55 of file SiPixelModuleStatus.h.

Referenced by detid(), and updateModuleStatus().

double SiPixelModuleStatus::fModAverage
private

Definition at line 56 of file SiPixelModuleStatus.h.

Referenced by digiOccupancy(), perRocDigiOcc(), and SiPixelModuleStatus().

double SiPixelModuleStatus::fModSigma
private

Definition at line 56 of file SiPixelModuleStatus.h.

Referenced by digiOccupancy(), perRocDigiOccVar(), and SiPixelModuleStatus().

int SiPixelModuleStatus::fNrocs
private
std::vector<SiPixelRocStatus> SiPixelModuleStatus::fRocs
private