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...
 
void fillDIGI (int iroc)
 fill with online coordinates 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 setNrocs (int iroc)
 
 SiPixelModuleStatus (int det=0, int nrocs=16)
 
void updateDIGI (int iroc, unsigned int nhit)
 fill with online coordinates (nhit > 1) 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 ( 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:119
SiPixelModuleStatus::~SiPixelModuleStatus ( )

Definition at line 20 of file SiPixelModuleStatus.cc.

20 {};

Member Function Documentation

int SiPixelModuleStatus::detid ( )

accessors and setters

Definition at line 58 of file SiPixelModuleStatus.cc.

References fDetid.

Referenced by updateModuleStatus().

58 { return fDetid; }
unsigned int SiPixelModuleStatus::digiOccMOD ( )

return module status (= hits on module)

Definition at line 49 of file SiPixelModuleStatus.cc.

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

49  {
50  unsigned int count(0);
51  for (int iroc = 0; iroc < fNrocs; ++iroc) {
52  count += digiOccROC(iroc);
53  }
54  return count;
55 }
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)
unsigned int SiPixelModuleStatus::digiOccROC ( int  iroc)

return ROC status (= hits on ROC iroc)

Definition at line 46 of file SiPixelModuleStatus.cc.

References fNrocs, and fRocs.

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

46 { return (iroc < fNrocs ? fRocs[iroc].digiOccROC() : -1); }
std::vector< SiPixelRocStatus > fRocs
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)
void SiPixelModuleStatus::fillDIGI ( int  iroc)

fill with online coordinates

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
void SiPixelModuleStatus::fillFEDerror25 ( PixelFEDChannel  ch)

fill FEDerror25

Definition at line 35 of file SiPixelModuleStatus.cc.

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

35  {
36  int roc_first = int(ch.roc_first);
37  int roc_last = int(ch.roc_last);
38  for (int iroc = 0; iroc < fNrocs; iroc++) {
39  if (iroc >= roc_first && iroc <= roc_last) {
40  fRocs[iroc].fillFEDerror25();
41  }
42  }
43 }
unsigned int roc_last
std::vector< SiPixelRocStatus > fRocs
unsigned int roc_first
SiPixelRocStatus * SiPixelModuleStatus::getRoc ( int  i)

get a ROC

Definition at line 91 of file SiPixelModuleStatus.cc.

References fRocs, and mps_fire::i.

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

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

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

Definition at line 67 of file SiPixelModuleStatus.cc.

References digiOccROC(), and fNrocs.

Referenced by perRocDigiOccVar().

67  {
68  unsigned int ave(0);
69  for (int iroc = 0; iroc < fNrocs; ++iroc) {
70  unsigned int inc = digiOccROC(iroc);
71  ave += inc;
72  }
73  return (1.0 * ave) / fNrocs;
74 }
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)
double SiPixelModuleStatus::perRocDigiOccVar ( )

Definition at line 76 of file SiPixelModuleStatus.cc.

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

76  {
77  double fModAverage = SiPixelModuleStatus::perRocDigiOcc();
78 
79  double sig = 1.0;
80  for (int iroc = 0; iroc < fNrocs; ++iroc) {
81  unsigned int inc = digiOccROC(iroc);
82  sig += (fModAverage - inc) * (fModAverage - inc);
83  }
84 
85  double fModSigma = sig / (fNrocs - 1);
86  return TMath::Sqrt(fModSigma);
87 }
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
void SiPixelModuleStatus::setNrocs ( int  iroc)

Definition at line 64 of file SiPixelModuleStatus.cc.

References fNrocs.

Referenced by SiPixelDetectorStatus::readFromFile().

64 { fNrocs = iroc; }
void SiPixelModuleStatus::updateDIGI ( int  iroc,
unsigned int  nhit 
)

fill with online coordinates (nhit > 1)

Definition at line 29 of file SiPixelModuleStatus.cc.

References fNrocs, and fRocs.

29  {
30  if (iroc < fNrocs)
31  fRocs[iroc].updateDIGI(nhit);
32 }
std::vector< SiPixelRocStatus > fRocs
void SiPixelModuleStatus::updateModuleDIGI ( int  roc,
unsigned int  nhits 
)

combine new data to update(topup) module status

Definition at line 94 of file SiPixelModuleStatus.cc.

References fRocs.

Referenced by SiPixelDetectorStatus::readFromFile().

94 { fRocs[iroc].updateDIGI(nhits); }
std::vector< SiPixelRocStatus > fRocs
void SiPixelModuleStatus::updateModuleStatus ( SiPixelModuleStatus  newData)

Definition at line 96 of file SiPixelModuleStatus.cc.

References detid(), digiOccROC(), fDetid, fNrocs, fRocs, getRoc(), SiPixelRocStatus::isFEDerror25(), and nrocs().

96  {
97  bool isSameModule = true;
98  if (fDetid != newData.detid() || fNrocs != newData.nrocs()) {
99  isSameModule = false;
100  }
101 
102  if (isSameModule) {
103  for (int iroc = 0; iroc < fNrocs; ++iroc) {
104  //update occupancy
105  fRocs[iroc].updateDIGI(newData.digiOccROC(iroc));
106  //update FEDerror25
107  SiPixelRocStatus* rocStatus = newData.getRoc(iroc);
108  if (rocStatus->isFEDerror25()) {
109  fRocs[iroc].fillFEDerror25();
110  }
111  }
112 
113  } // if same module
114 }
int detid()
accessors and setters
std::vector< SiPixelRocStatus > fRocs
SiPixelRocStatus * getRoc(int i)
get a ROC
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)

Member Data Documentation

int SiPixelModuleStatus::fDetid
private

Definition at line 47 of file SiPixelModuleStatus.h.

Referenced by detid(), and updateModuleStatus().

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