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.

12  : fDetid_(detId), fNrocs_(nrocs) {
13  for (int i = 0; i < fNrocs_; ++i) {
15  fRocs_.push_back(a);
16  }
17 };

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

◆ ~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.

38 { return fDetid_; }

References fDetid_.

Referenced by setDetId(), and updateModuleStatus().

◆ digiOccMOD()

unsigned int SiPixelModuleStatus::digiOccMOD ( )

return module status (= hits on module)

Definition at line 62 of file SiPixelModuleStatus.cc.

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

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

◆ digiOccROC()

unsigned int SiPixelModuleStatus::digiOccROC ( int  iroc)

return ROC status (= hits on ROC iroc)

Definition at line 58 of file SiPixelModuleStatus.cc.

58 { return (iroc < fNrocs_ ? fRocs_[iroc].digiOccROC() : 0); }

References fNrocs_, and fRocs_.

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

◆ fedError25()

bool SiPixelModuleStatus::fedError25 ( int  iroc)

return ROC FEDerror25

Definition at line 60 of file SiPixelModuleStatus.cc.

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

References fNrocs_, and fRocs_.

Referenced by updateFEDerror25(), and updateModuleStatus().

◆ fillDIGI()

void SiPixelModuleStatus::fillDIGI ( int  iroc)

fill digi

Definition at line 23 of file SiPixelModuleStatus.cc.

23  {
24  if (iroc < fNrocs_)
25  fRocs_[iroc].fillDIGI();
26 }

References fNrocs_, and fRocs_.

◆ fillFEDerror25()

void SiPixelModuleStatus::fillFEDerror25 ( PixelFEDChannel  ch)

fill FEDerror25

Definition at line 28 of file SiPixelModuleStatus.cc.

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 }

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

◆ getRoc()

SiPixelRocStatus * SiPixelModuleStatus::getRoc ( int  i)

get a ROC

Definition at line 95 of file SiPixelModuleStatus.cc.

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

References fNrocs_, and fRocs_.

Referenced by SiPixelDetectorStatus::getFEDerror25Rocs().

◆ 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.

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 }

References digiOccROC(), and fNrocs_.

Referenced by perRocDigiOccVar().

◆ perRocDigiOccVar()

double SiPixelModuleStatus::perRocDigiOccVar ( )

Definition at line 80 of file SiPixelModuleStatus.cc.

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 }

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

◆ setDetId()

void SiPixelModuleStatus::setDetId ( int  detid)

Definition at line 42 of file SiPixelModuleStatus.cc.

42 { fDetid_ = detid; }

References detid(), and fDetid_.

◆ setNrocs()

void SiPixelModuleStatus::setNrocs ( int  iroc)

Definition at line 44 of file SiPixelModuleStatus.cc.

44 { fNrocs_ = nRoc; }

References fNrocs_.

Referenced by SiPixelDetectorStatus::readFromFile().

◆ updateDIGI()

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

update digi (nhit > 1)

Definition at line 47 of file SiPixelModuleStatus.cc.

47  {
48  if (iroc < fNrocs_)
49  fRocs_[iroc].updateDIGI(nhit);
50 }

References fNrocs_, and fRocs_.

◆ updateFEDerror25()

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

update FEDerror25

Definition at line 52 of file SiPixelModuleStatus.cc.

52  {
53  if (iroc < fNrocs_)
54  fRocs_[iroc].updateFEDerror25(fedError25);
55 }

References fedError25(), fNrocs_, and fRocs_.

◆ 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.

98  {
99  if (iroc < fNrocs_)
100  fRocs_[iroc].updateDIGI(nhits);
101 }

References fNrocs_, fRocs_, and nhits.

Referenced by SiPixelDetectorStatus::readFromFile().

◆ updateModuleStatus()

void SiPixelModuleStatus::updateModuleStatus ( SiPixelModuleStatus  newData)

Definition at line 103 of file SiPixelModuleStatus.cc.

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 }

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

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
mps_fire.i
i
Definition: mps_fire.py:428
SiPixelModuleStatus::fNrocs_
int fNrocs_
Definition: SiPixelModuleStatus.h:52
SiPixelModuleStatus::fRocs_
std::vector< SiPixelRocStatus > fRocs_
Definition: SiPixelModuleStatus.h:53
SiPixelRocStatus
Definition: SiPixelRocStatus.h:5
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
SiPixelModuleStatus::detid
int detid()
accessors and setters
Definition: SiPixelModuleStatus.cc:38
nhits
Definition: HIMultiTrackSelector.h:42
SiPixelModuleStatus::perRocDigiOcc
double perRocDigiOcc()
calculate (averaged over this module's ROCs) mean hit number and its sigma
Definition: SiPixelModuleStatus.cc:71
a
double a
Definition: hdecay.h:119
createfilelist.int
int
Definition: createfilelist.py:10
SiPixelModuleStatus::fDetid_
int fDetid_
Definition: SiPixelModuleStatus.h:52
SiPixelModuleStatus::digiOccROC
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)
Definition: SiPixelModuleStatus.cc:58
PixelFEDChannel::roc_last
unsigned int roc_last
Definition: PixelFEDChannel.h:7
SiPixelModuleStatus::nrocs
int nrocs()
Definition: SiPixelModuleStatus.cc:40
SiPixelModuleStatus::fedError25
bool fedError25(int iroc)
return ROC FEDerror25
Definition: SiPixelModuleStatus.cc:60
PixelFEDChannel::roc_first
unsigned int roc_first
Definition: PixelFEDChannel.h:7