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 int digiOccMOD ()
 return module status (= hits on module) More...
 
unsigned int digiOccROC (int iroc)
 return ROC status (= hits on ROC iroc) More...
 
bool fedError25 (int iroc)
 return ROC FEDerror25 More...
 
void fillDIGI (int iroc)
 fill digi More...
 
void fillFEDerror25 (PixelFEDChannel ch)
 fill FEDerror25 More...
 
SiPixelRocStatusgetRoc (int i)
 get a ROC More...
 
int nrocs ()
 
double perRocDigiOcc ()
 calculate (averaged over this module's ROCs) mean hit number and its sigma More...
 
double perRocDigiOccVar ()
 
void setDetId (int detid)
 
void setNrocs (int iroc)
 
 SiPixelModuleStatus (int det=0, int nrocs=16)
 
void updateDIGI (int iroc, unsigned int nhit)
 update digi (nhit > 1) More...
 
void updateFEDerror25 (int iroc, bool FEDerror25)
 update FEDerror25 More...
 
void updateModuleDIGI (int roc, unsigned int nhits)
 combine new data to update(topup) module status More...
 
void updateModuleStatus (SiPixelModuleStatus newData)
 
 ~SiPixelModuleStatus ()
 

Private Attributes

int fDetid_
 
int fNrocs_
 
std::vector< SiPixelRocStatusfRocs_
 

Detailed Description

Definition at line 10 of file SiPixelModuleStatus.h.

Constructor & Destructor Documentation

◆ SiPixelModuleStatus()

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

Definition at line 12 of file SiPixelModuleStatus.cc.

References a, fNrocs_, fRocs_, and mps_fire::i.

12  : fDetid_(detId), fNrocs_(nrocs) {
13  for (int i = 0; i < fNrocs_; ++i) {
15  fRocs_.push_back(a);
16  }
17 };
std::vector< SiPixelRocStatus > fRocs_
double a
Definition: hdecay.h:121

◆ ~SiPixelModuleStatus()

SiPixelModuleStatus::~SiPixelModuleStatus ( )

Definition at line 20 of file SiPixelModuleStatus.cc.

20 {};

Member Function Documentation

◆ detid()

int SiPixelModuleStatus::detid ( )

accessors and setters

Definition at line 38 of file SiPixelModuleStatus.cc.

References fDetid_.

Referenced by setDetId(), and updateModuleStatus().

38 { return fDetid_; }

◆ digiOccMOD()

unsigned int SiPixelModuleStatus::digiOccMOD ( )

return module status (= hits on module)

Definition at line 62 of file SiPixelModuleStatus.cc.

References submitPVResolutionJobs::count, digiOccROC(), and fNrocs_.

62  {
63  unsigned int count(0);
64  for (int iroc = 0; iroc < fNrocs_; ++iroc) {
65  count += digiOccROC(iroc);
66  }
67  return count;
68 }
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)

◆ digiOccROC()

unsigned int SiPixelModuleStatus::digiOccROC ( int  iroc)

return ROC status (= hits on ROC iroc)

Definition at line 58 of file SiPixelModuleStatus.cc.

References fNrocs_, and fRocs_.

Referenced by digiOccMOD(), SiPixelStatusHarvester::dqmEndRun(), perRocDigiOcc(), perRocDigiOccVar(), and updateModuleStatus().

58 { return (iroc < fNrocs_ ? fRocs_[iroc].digiOccROC() : 0); }
std::vector< SiPixelRocStatus > fRocs_
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)

◆ fedError25()

bool SiPixelModuleStatus::fedError25 ( int  iroc)

return ROC FEDerror25

Definition at line 60 of file SiPixelModuleStatus.cc.

References fNrocs_, and fRocs_.

Referenced by updateFEDerror25(), and updateModuleStatus().

60 { return (iroc < fNrocs_ ? fRocs_[iroc].isFEDerror25() : false); }
std::vector< SiPixelRocStatus > fRocs_

◆ fillDIGI()

void SiPixelModuleStatus::fillDIGI ( int  iroc)

fill digi

Definition at line 23 of file SiPixelModuleStatus.cc.

References fNrocs_, and fRocs_.

23  {
24  if (iroc < fNrocs_)
25  fRocs_[iroc].fillDIGI();
26 }
std::vector< SiPixelRocStatus > fRocs_

◆ fillFEDerror25()

void SiPixelModuleStatus::fillFEDerror25 ( PixelFEDChannel  ch)

fill FEDerror25

Definition at line 28 of file SiPixelModuleStatus.cc.

References fNrocs_, fRocs_, createfilelist::int, PixelFEDChannel::roc_first, and PixelFEDChannel::roc_last.

28  {
29  int roc_first = int(ch.roc_first);
30  int roc_last = int(ch.roc_last);
31  for (int iroc = 0; iroc < fNrocs_; iroc++) {
32  if (iroc >= roc_first && iroc <= roc_last) {
33  fRocs_[iroc].fillFEDerror25();
34  }
35  }
36 }
std::vector< SiPixelRocStatus > fRocs_
unsigned int roc_last
unsigned int roc_first

◆ getRoc()

SiPixelRocStatus * SiPixelModuleStatus::getRoc ( int  i)

get a ROC

Definition at line 95 of file SiPixelModuleStatus.cc.

References fNrocs_, and fRocs_.

Referenced by SiPixelDetectorStatus::getFEDerror25Rocs().

95 { return (iroc < fNrocs_ ? &fRocs_[iroc] : nullptr); }
std::vector< SiPixelRocStatus > fRocs_

◆ nrocs()

int SiPixelModuleStatus::nrocs ( )

◆ perRocDigiOcc()

double SiPixelModuleStatus::perRocDigiOcc ( )

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

Definition at line 71 of file SiPixelModuleStatus.cc.

References digiOccROC(), and fNrocs_.

Referenced by perRocDigiOccVar().

71  {
72  unsigned int ave(0);
73  for (int iroc = 0; iroc < fNrocs_; ++iroc) {
74  unsigned int inc = digiOccROC(iroc);
75  ave += inc;
76  }
77  return (1.0 * ave) / fNrocs_;
78 }
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)

◆ perRocDigiOccVar()

double SiPixelModuleStatus::perRocDigiOccVar ( )

Definition at line 80 of file SiPixelModuleStatus.cc.

References digiOccROC(), fNrocs_, and perRocDigiOcc().

80  {
81  double fModAverage = SiPixelModuleStatus::perRocDigiOcc();
82 
83  double sig = 1.0;
84  for (int iroc = 0; iroc < fNrocs_; ++iroc) {
85  unsigned int inc = digiOccROC(iroc);
86  sig += (fModAverage - inc) * (fModAverage - inc);
87  }
88 
89  double fModSigma = sig / (fNrocs_ - 1);
90  return TMath::Sqrt(fModSigma);
91 }
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)
double perRocDigiOcc()
calculate (averaged over this module&#39;s ROCs) mean hit number and its sigma

◆ setDetId()

void SiPixelModuleStatus::setDetId ( int  detid)

Definition at line 42 of file SiPixelModuleStatus.cc.

References detid(), and fDetid_.

42 { fDetid_ = detid; }
int detid()
accessors and setters

◆ setNrocs()

void SiPixelModuleStatus::setNrocs ( int  iroc)

Definition at line 44 of file SiPixelModuleStatus.cc.

References fNrocs_.

Referenced by SiPixelDetectorStatus::readFromFile().

44 { fNrocs_ = nRoc; }

◆ updateDIGI()

void SiPixelModuleStatus::updateDIGI ( int  iroc,
unsigned int  nhit 
)

update digi (nhit > 1)

Definition at line 47 of file SiPixelModuleStatus.cc.

References fNrocs_, and fRocs_.

47  {
48  if (iroc < fNrocs_)
49  fRocs_[iroc].updateDIGI(nhit);
50 }
std::vector< SiPixelRocStatus > fRocs_

◆ updateFEDerror25()

void SiPixelModuleStatus::updateFEDerror25 ( int  iroc,
bool  FEDerror25 
)

update FEDerror25

Definition at line 52 of file SiPixelModuleStatus.cc.

References fedError25(), fNrocs_, and fRocs_.

52  {
53  if (iroc < fNrocs_)
54  fRocs_[iroc].updateFEDerror25(fedError25);
55 }
std::vector< SiPixelRocStatus > fRocs_
bool fedError25(int iroc)
return ROC FEDerror25

◆ updateModuleDIGI()

void SiPixelModuleStatus::updateModuleDIGI ( int  roc,
unsigned int  nhits 
)

combine new data to update(topup) module status

Definition at line 98 of file SiPixelModuleStatus.cc.

References fNrocs_, fRocs_, and nhits.

Referenced by SiPixelDetectorStatus::readFromFile().

98  {
99  if (iroc < fNrocs_)
100  fRocs_[iroc].updateDIGI(nhits);
101 }
std::vector< SiPixelRocStatus > fRocs_

◆ updateModuleStatus()

void SiPixelModuleStatus::updateModuleStatus ( SiPixelModuleStatus  newData)

Definition at line 103 of file SiPixelModuleStatus.cc.

References detid(), digiOccROC(), fDetid_, fedError25(), fNrocs_, fRocs_, and nrocs().

103  {
104  bool isSameModule = true;
105  if (fDetid_ != newData.detid() || fNrocs_ != newData.nrocs()) {
106  isSameModule = false;
107  }
108 
109  if (isSameModule) {
110  for (int iroc = 0; iroc < fNrocs_; ++iroc) { // loop over rocs
111  //update occupancy
112  fRocs_[iroc].updateDIGI(newData.digiOccROC(iroc));
113  //update FEDerror25
114  fRocs_[iroc].updateFEDerror25(newData.fedError25(iroc));
115 
116  } // loop over rocs
117 
118  } // if same module
119 }
std::vector< SiPixelRocStatus > fRocs_
int detid()
accessors and setters
bool fedError25(int iroc)
return ROC FEDerror25
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)

Member Data Documentation

◆ fDetid_

int SiPixelModuleStatus::fDetid_
private

Definition at line 52 of file SiPixelModuleStatus.h.

Referenced by detid(), setDetId(), and updateModuleStatus().

◆ fNrocs_

int SiPixelModuleStatus::fNrocs_
private

◆ fRocs_

std::vector<SiPixelRocStatus> SiPixelModuleStatus::fRocs_
private