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 11 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 
14  for (int i = 0; i < fNrocs; ++i) {
16  fRocs.push_back(a);
17  }
18 
19 };
std::vector< SiPixelRocStatus > fRocs
double a
Definition: hdecay.h:121
SiPixelModuleStatus::~SiPixelModuleStatus ( )

Definition at line 23 of file SiPixelModuleStatus.cc.

23 {};

Member Function Documentation

int SiPixelModuleStatus::detid ( )

accessors and setters

Definition at line 73 of file SiPixelModuleStatus.cc.

References fDetid.

Referenced by updateModuleStatus().

73  {
74 
75  return fDetid;
76 
77 }
unsigned int SiPixelModuleStatus::digiOccMOD ( )

return module status (= hits on module)

Definition at line 62 of file SiPixelModuleStatus.cc.

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

62  {
63 
64  unsigned int count(0);
65  for (int iroc = 0; iroc < fNrocs; ++iroc) {
66  count += digiOccROC(iroc);
67  }
68  return count;
69 
70 }
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 55 of file SiPixelModuleStatus.cc.

References fNrocs, and fRocs.

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

55  {
56 
57  return (iroc < fNrocs ? fRocs[iroc].digiOccROC() : -1);
58 
59 }
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 27 of file SiPixelModuleStatus.cc.

References fNrocs, and fRocs.

27  {
28 
29  if (iroc < fNrocs)
30  fRocs[iroc].fillDIGI();
31 
32 }
std::vector< SiPixelRocStatus > fRocs
void SiPixelModuleStatus::fillFEDerror25 ( PixelFEDChannel  ch)

fill FEDerror25

Definition at line 43 of file SiPixelModuleStatus.cc.

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

43  {
44 
45  int roc_first = int(ch.roc_first); int roc_last = int(ch.roc_last);
46  for (int iroc = 0; iroc < fNrocs; iroc++){
47  if(iroc>=roc_first && iroc<=roc_last){
48  fRocs[iroc].fillFEDerror25();
49  }
50  }
51 
52 }
unsigned int roc_last
std::vector< SiPixelRocStatus > fRocs
unsigned int roc_first
SiPixelRocStatus * SiPixelModuleStatus::getRoc ( int  i)

get a ROC

Definition at line 122 of file SiPixelModuleStatus.cc.

References fRocs, and mps_fire::i.

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

122  {
123 
124  return &fRocs[i];
125 
126 }
std::vector< SiPixelRocStatus > fRocs
int SiPixelModuleStatus::nrocs ( )

Definition at line 80 of file SiPixelModuleStatus.cc.

References fNrocs.

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

80  {
81 
82  return fNrocs;
83 
84 }
double SiPixelModuleStatus::perRocDigiOcc ( )

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

Definition at line 94 of file SiPixelModuleStatus.cc.

References digiOccROC(), and fNrocs.

Referenced by perRocDigiOccVar().

94  {
95 
96  unsigned int ave(0);
97  for (int iroc = 0; iroc < fNrocs; ++iroc) {
98  unsigned int inc = digiOccROC(iroc);
99  ave += inc;
100  }
101  return (1.0*ave)/fNrocs;
102 
103 }
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)
double SiPixelModuleStatus::perRocDigiOccVar ( )

Definition at line 105 of file SiPixelModuleStatus.cc.

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

105  {
106 
107  double fModAverage = SiPixelModuleStatus::perRocDigiOcc();
108 
109  double sig = 1.0;
110  for (int iroc = 0; iroc < fNrocs; ++iroc) {
111  unsigned int inc = digiOccROC(iroc);
112  sig += (fModAverage-inc)*(fModAverage-inc);
113  }
114 
115  double fModSigma = sig/(fNrocs-1);
116  return TMath::Sqrt(fModSigma);
117 
118 }
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 87 of file SiPixelModuleStatus.cc.

References fNrocs.

Referenced by SiPixelDetectorStatus::readFromFile().

87  {
88 
89  fNrocs = iroc;
90 
91 }
void SiPixelModuleStatus::updateDIGI ( int  iroc,
unsigned int  nhit 
)

fill with online coordinates (nhit > 1)

Definition at line 35 of file SiPixelModuleStatus.cc.

References fNrocs, and fRocs.

35  {
36 
37  if (iroc < fNrocs)
38  fRocs[iroc].updateDIGI(nhit);
39 
40 }
std::vector< SiPixelRocStatus > fRocs
void SiPixelModuleStatus::updateModuleDIGI ( int  roc,
unsigned int  nhits 
)

combine new data to update(topup) module status

Definition at line 129 of file SiPixelModuleStatus.cc.

References fRocs.

Referenced by SiPixelDetectorStatus::readFromFile().

129  {
130 
131  fRocs[iroc].updateDIGI(nhits);
132 
133 }
std::vector< SiPixelRocStatus > fRocs
void SiPixelModuleStatus::updateModuleStatus ( SiPixelModuleStatus  newData)

Definition at line 135 of file SiPixelModuleStatus.cc.

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

135  {
136 
137  bool isSameModule = true;
138  if( fDetid!=newData.detid() || fNrocs!=newData.nrocs()) {
139  isSameModule = false;
140  }
141 
142  if(isSameModule){
143 
144  for (int iroc = 0; iroc < fNrocs; ++iroc) {
145  //update occupancy
146  fRocs[iroc].updateDIGI(newData.digiOccROC(iroc));
147  //update FEDerror25
148  SiPixelRocStatus* rocStatus = newData.getRoc(iroc);
149  if(rocStatus->isFEDerror25()){
150  fRocs[iroc].fillFEDerror25();
151  }
152  }
153 
154  } // if same module
155 
156 }
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 51 of file SiPixelModuleStatus.h.

Referenced by detid(), and updateModuleStatus().

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