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::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 58 of file SiPixelModuleStatus.cc.

58 { return fDetid; }

References fDetid.

Referenced by updateModuleStatus().

◆ digiOccMOD()

unsigned int SiPixelModuleStatus::digiOccMOD ( )

return module status (= hits on module)

Definition at line 49 of file SiPixelModuleStatus.cc.

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

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

◆ digiOccROC()

unsigned int SiPixelModuleStatus::digiOccROC ( int  iroc)

return ROC status (= hits on ROC iroc)

Definition at line 46 of file SiPixelModuleStatus.cc.

46 { return (iroc < fNrocs ? fRocs[iroc].digiOccROC() : -1); }

References fNrocs, and fRocs.

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

◆ fillDIGI()

void SiPixelModuleStatus::fillDIGI ( int  iroc)

fill with online coordinates

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 35 of file SiPixelModuleStatus.cc.

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 }

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

◆ getRoc()

SiPixelRocStatus * SiPixelModuleStatus::getRoc ( int  i)

get a ROC

Definition at line 91 of file SiPixelModuleStatus.cc.

91 { return &fRocs[i]; }

References fRocs, and mps_fire::i.

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

◆ nrocs()

int SiPixelModuleStatus::nrocs ( )

◆ perRocDigiOcc()

double SiPixelModuleStatus::perRocDigiOcc ( )

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

Definition at line 67 of file SiPixelModuleStatus.cc.

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 }

References digiOccROC(), and fNrocs.

Referenced by perRocDigiOccVar().

◆ perRocDigiOccVar()

double SiPixelModuleStatus::perRocDigiOccVar ( )

Definition at line 76 of file SiPixelModuleStatus.cc.

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 }

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

◆ setNrocs()

void SiPixelModuleStatus::setNrocs ( int  iroc)

Definition at line 64 of file SiPixelModuleStatus.cc.

64 { fNrocs = iroc; }

References fNrocs.

Referenced by SiPixelDetectorStatus::readFromFile().

◆ updateDIGI()

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

fill with online coordinates (nhit > 1)

Definition at line 29 of file SiPixelModuleStatus.cc.

29  {
30  if (iroc < fNrocs)
31  fRocs[iroc].updateDIGI(nhit);
32 }

References fNrocs, and fRocs.

◆ updateModuleDIGI()

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

combine new data to update(topup) module status

Definition at line 94 of file SiPixelModuleStatus.cc.

94 { fRocs[iroc].updateDIGI(nhits); }

References fRocs, and nhits.

Referenced by SiPixelDetectorStatus::readFromFile().

◆ updateModuleStatus()

void SiPixelModuleStatus::updateModuleStatus ( SiPixelModuleStatus  newData)

Definition at line 96 of file SiPixelModuleStatus.cc.

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 }

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

Member Data Documentation

◆ fDetid

int SiPixelModuleStatus::fDetid
private

Definition at line 47 of file SiPixelModuleStatus.h.

Referenced by detid(), and updateModuleStatus().

◆ fNrocs

int SiPixelModuleStatus::fNrocs
private

◆ fRocs

std::vector<SiPixelRocStatus> SiPixelModuleStatus::fRocs
private
mps_fire.i
i
Definition: mps_fire.py:355
SiPixelModuleStatus::fDetid
int fDetid
Definition: SiPixelModuleStatus.h:47
SiPixelModuleStatus::fNrocs
int fNrocs
Definition: SiPixelModuleStatus.h:47
SiPixelRocStatus
Definition: SiPixelRocStatus.h:5
SiPixelRocStatus::isFEDerror25
bool isFEDerror25()
Definition: SiPixelRocStatus.h:14
SiPixelModuleStatus::detid
int detid()
accessors and setters
Definition: SiPixelModuleStatus.cc:58
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:67
a
double a
Definition: hdecay.h:119
SiPixelModuleStatus::getRoc
SiPixelRocStatus * getRoc(int i)
get a ROC
Definition: SiPixelModuleStatus.cc:91
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
createfilelist.int
int
Definition: createfilelist.py:10
SiPixelModuleStatus::digiOccROC
unsigned int digiOccROC(int iroc)
return ROC status (= hits on ROC iroc)
Definition: SiPixelModuleStatus.cc:46
PixelFEDChannel::roc_last
unsigned int roc_last
Definition: PixelFEDChannel.h:7
SiPixelModuleStatus::fRocs
std::vector< SiPixelRocStatus > fRocs
Definition: SiPixelModuleStatus.h:48
SiPixelModuleStatus::nrocs
int nrocs()
Definition: SiPixelModuleStatus.cc:61
PixelFEDChannel::roc_first
unsigned int roc_first
Definition: PixelFEDChannel.h:7