CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
QIE10DigiSortedTable Class Reference

#include <QIE10DigiSortedTable.h>

Public Member Functions

void add (const QIE10DataFrame *digi, const edm::ESHandle< HcalDbService > &dbService)
 
 QIE10DigiSortedTable (const std::vector< HcalDetId > &dids, const unsigned int nTS)
 
void reset ()
 

Public Attributes

std::vector< std::vector< int > > adcs_
 
std::vector< std::vector< int > > capids_
 
std::vector< int > depths_
 
std::map< HcalDetId, unsigned int > did_indexmap_
 
std::vector< HcalDetIddids_
 
std::vector< std::vector< float > > fcs_
 
std::vector< int > flags_
 
std::vector< int > ietas_
 
std::vector< int > iphis_
 
std::vector< bool > linkErrors_
 
unsigned int nTS_
 
std::vector< std::vector< bool > > oks_
 
std::vector< std::vector< float > > pedestalfcs_
 
std::vector< int > rawIds_
 
std::vector< int > sois_
 
std::vector< int > subdets_
 
std::vector< std::vector< int > > tdcs_
 
std::vector< bool > valids_
 

Detailed Description

Definition at line 18 of file QIE10DigiSortedTable.h.

Constructor & Destructor Documentation

◆ QIE10DigiSortedTable()

QIE10DigiSortedTable::QIE10DigiSortedTable ( const std::vector< HcalDetId > &  dids,
const unsigned int  nTS 
)

Definition at line 3 of file QIE10DigiSortedTable.cc.

References adcs_, capids_, depths_, did_indexmap_, dids_, fcs_, flags_, ietas_, createfilelist::int, iphis_, linkErrors_, nTS_, oks_, pedestalfcs_, rawIds_, sois_, subdets_, tdcs_, and valids_.

3  {
4  dids_ = dids;
5  for (std::vector<HcalDetId>::const_iterator it_did = dids_.begin(); it_did != dids_.end(); ++it_did) {
6  did_indexmap_[*it_did] = (unsigned int)(it_did - dids_.begin());
7  }
8 
9  nTS_ = nTS;
10  ietas_.resize(dids_.size());
11  iphis_.resize(dids_.size());
12  subdets_.resize(dids_.size());
13  depths_.resize(dids_.size());
14  rawIds_.resize(dids_.size());
15  linkErrors_.resize(dids_.size());
16  flags_.resize(dids_.size());
17  sois_.resize(dids_.size());
18  valids_.resize(dids_.size());
19  //sipmTypes_.resize(dids_.size());
20 
21  adcs_.resize(nTS_, std::vector<int>(dids_.size()));
22  fcs_.resize(nTS_, std::vector<float>(dids_.size()));
23  pedestalfcs_.resize(nTS_, std::vector<float>(dids_.size()));
24  tdcs_.resize(nTS_, std::vector<int>(dids_.size()));
25  capids_.resize(nTS_, std::vector<int>(dids_.size()));
26  oks_.resize(nTS_, std::vector<bool>(dids_.size()));
27 }
std::vector< int > rawIds_
std::vector< std::vector< float > > pedestalfcs_
std::vector< int > ietas_
std::vector< int > sois_
std::vector< bool > linkErrors_
std::vector< HcalDetId > dids_
std::vector< int > flags_
std::vector< int > iphis_
std::vector< int > depths_
std::vector< std::vector< bool > > oks_
std::vector< std::vector< float > > fcs_
std::vector< int > subdets_
std::map< HcalDetId, unsigned int > did_indexmap_
std::vector< std::vector< int > > adcs_
std::vector< bool > valids_
std::vector< std::vector< int > > capids_
std::vector< std::vector< int > > tdcs_

Member Function Documentation

◆ add()

void QIE10DigiSortedTable::add ( const QIE10DataFrame digi,
const edm::ESHandle< HcalDbService > &  dbService 
)

Definition at line 29 of file QIE10DigiSortedTable.cc.

References adcs_, AlignmentProducer_cff::calibrations, capids_, depths_, QIE10DataFrame::detid(), did_indexmap_, fcs_, QIE10DataFrame::flags(), flags_, ietas_, createfilelist::int, iphis_, QIE10DataFrame::linkError(), linkErrors_, oks_, pedestalfcs_, rawIds_, QIE10DataFrame::samples(), sois_, subdets_, tdcs_, and valids_.

Referenced by HcalDigiSortedTableProducer::produce(), counter.Counter::register(), SequenceTypes._TaskBase::remove(), and SequenceTypes._TaskBase::replace().

29  {
30  HcalDetId did = digi->detid();
31  unsigned int index = did_indexmap_.at(did);
32 
33  CaloSamples digiCaloSamples = hcaldqm::utilities::loadADC2fCDB<QIE10DataFrame>(dbService, did, *digi);
34  HcalCalibrations calibrations = dbService->getHcalCalibrations(did);
35 
36  ietas_[index] = did.ieta();
37  iphis_[index] = did.iphi();
38  subdets_[index] = did.subdet();
39  depths_[index] = did.depth();
40  rawIds_[index] = did.rawId();
41  linkErrors_[index] = digi->linkError();
42  flags_[index] = digi->flags();
43  //sipmTypes_[index] = (uint8_t)dbService->getHcalSiPMParameter(did)->getType();
44 
45  for (unsigned int iTS = 0; iTS < (unsigned int)digi->samples(); ++iTS) {
46  if ((*digi)[iTS].soi()) {
47  sois_[index] = iTS;
48  }
49  oks_[iTS][index] = (*digi)[iTS].ok();
50  adcs_[iTS][index] = (*digi)[iTS].adc();
51  tdcs_[iTS][index] = (*digi)[iTS].le_tdc();
52  //tetdcs_[iTS][index] = (*digi)[iTS].te_tdc();
53  capids_[iTS][index] = (*digi)[iTS].capid();
54  fcs_[iTS][index] = digiCaloSamples[iTS];
55  pedestalfcs_[iTS][index] = calibrations.pedestal((*digi)[iTS].capid());
56  }
57  valids_[index] = true;
58 }
std::vector< int > rawIds_
std::vector< std::vector< float > > pedestalfcs_
constexpr DetId detid() const
Get the detector id.
std::vector< int > ietas_
std::vector< int > sois_
std::vector< bool > linkErrors_
std::vector< int > flags_
std::vector< int > iphis_
constexpr uint16_t flags() const
get the flag word
std::vector< int > depths_
constexpr bool linkError() const
std::vector< std::vector< bool > > oks_
std::vector< std::vector< float > > fcs_
std::vector< int > subdets_
std::map< HcalDetId, unsigned int > did_indexmap_
std::vector< std::vector< int > > adcs_
std::vector< bool > valids_
std::vector< std::vector< int > > capids_
std::vector< std::vector< int > > tdcs_
constexpr int samples() const
total number of samples in the digi

◆ reset()

void QIE10DigiSortedTable::reset ( void  )

Definition at line 60 of file QIE10DigiSortedTable.cc.

References adcs_, capids_, depths_, dids_, fcs_, ntuplemaker::fill, flags_, mps_fire::i, ietas_, iphis_, dqmiolumiharvest::j, linkErrors_, nTS_, oks_, pedestalfcs_, rawIds_, sois_, subdets_, tdcs_, and valids_.

Referenced by HcalDigiSortedTableProducer::produce().

60  {
61  std::fill(ietas_.begin(), ietas_.end(), 0);
62  std::fill(iphis_.begin(), iphis_.end(), 0);
63  std::fill(subdets_.begin(), subdets_.end(), 0);
64  std::fill(depths_.begin(), depths_.end(), 0);
65  std::fill(rawIds_.begin(), rawIds_.end(), 0);
66  std::fill(linkErrors_.begin(), linkErrors_.end(), 0);
67  std::fill(flags_.begin(), flags_.end(), 0);
68  std::fill(sois_.begin(), sois_.end(), -1);
69  std::fill(valids_.begin(), valids_.end(), false);
70  //std::fill(sipmTypes_.begin(), sipmTypes_.end(), 0);
71 
72  for (unsigned int i = 0; i < nTS_; ++i) {
73  for (unsigned int j = 0; j < dids_.size(); ++j) {
74  adcs_[i][j] = 0;
75  fcs_[i][j] = 0.;
76  pedestalfcs_[i][j] = 0.;
77  tdcs_[i][j] = 0;
78  capids_[i][j] = 0;
79  oks_[i][j] = false;
80  }
81  }
82 }
std::vector< int > rawIds_
std::vector< std::vector< float > > pedestalfcs_
std::vector< int > ietas_
std::vector< int > sois_
std::vector< bool > linkErrors_
std::vector< HcalDetId > dids_
std::vector< int > flags_
std::vector< int > iphis_
std::vector< int > depths_
std::vector< std::vector< bool > > oks_
std::vector< std::vector< float > > fcs_
std::vector< int > subdets_
std::vector< std::vector< int > > adcs_
std::vector< bool > valids_
std::vector< std::vector< int > > capids_
std::vector< std::vector< int > > tdcs_

Member Data Documentation

◆ adcs_

std::vector<std::vector<int> > QIE10DigiSortedTable::adcs_

◆ capids_

std::vector<std::vector<int> > QIE10DigiSortedTable::capids_

◆ depths_

std::vector<int> QIE10DigiSortedTable::depths_

◆ did_indexmap_

std::map<HcalDetId, unsigned int> QIE10DigiSortedTable::did_indexmap_

Definition at line 21 of file QIE10DigiSortedTable.h.

Referenced by add(), and QIE10DigiSortedTable().

◆ dids_

std::vector<HcalDetId> QIE10DigiSortedTable::dids_

Definition at line 20 of file QIE10DigiSortedTable.h.

Referenced by QIE10DigiSortedTable(), and reset().

◆ fcs_

std::vector<std::vector<float> > QIE10DigiSortedTable::fcs_

◆ flags_

std::vector<int> QIE10DigiSortedTable::flags_

◆ ietas_

std::vector<int> QIE10DigiSortedTable::ietas_

◆ iphis_

std::vector<int> QIE10DigiSortedTable::iphis_

◆ linkErrors_

std::vector<bool> QIE10DigiSortedTable::linkErrors_

◆ nTS_

unsigned int QIE10DigiSortedTable::nTS_

Definition at line 34 of file QIE10DigiSortedTable.h.

Referenced by QIE10DigiSortedTable(), and reset().

◆ oks_

std::vector<std::vector<bool> > QIE10DigiSortedTable::oks_

◆ pedestalfcs_

std::vector<std::vector<float> > QIE10DigiSortedTable::pedestalfcs_

◆ rawIds_

std::vector<int> QIE10DigiSortedTable::rawIds_

◆ sois_

std::vector<int> QIE10DigiSortedTable::sois_

◆ subdets_

std::vector<int> QIE10DigiSortedTable::subdets_

◆ tdcs_

std::vector<std::vector<int> > QIE10DigiSortedTable::tdcs_

◆ valids_

std::vector<bool> QIE10DigiSortedTable::valids_