CMS 3D CMS Logo

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

#include <QIE11DigiSortedTable.h>

Public Member Functions

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

Public Attributes

std::vector< std::vector< int > > adcs_
 
std::vector< bool > capidErrors_
 
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< float > > pedestalfcs_
 
std::vector< int > rawIds_
 
std::vector< uint8_t > sipmTypes_
 
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 QIE11DigiSortedTable.h.

Constructor & Destructor Documentation

◆ QIE11DigiSortedTable()

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

Definition at line 3 of file QIE11DigiSortedTable.cc.

References adcs_, capidErrors_, capids_, depths_, did_indexmap_, dids_, fcs_, flags_, ietas_, createfilelist::int, iphis_, linkErrors_, nTS_, pedestalfcs_, rawIds_, sipmTypes_, 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  capidErrors_.resize(dids_.size());
17  flags_.resize(dids_.size());
18  sois_.resize(dids_.size());
19  valids_.resize(dids_.size());
20  sipmTypes_.resize(dids_.size());
21 
22  adcs_.resize(nTS_, std::vector<int>(dids_.size()));
23  fcs_.resize(nTS_, std::vector<float>(dids_.size()));
24  pedestalfcs_.resize(nTS_, std::vector<float>(dids_.size()));
25  tdcs_.resize(nTS_, std::vector<int>(dids_.size()));
26  capids_.resize(nTS_, std::vector<int>(dids_.size()));
27 }
std::vector< bool > capidErrors_
std::vector< bool > linkErrors_
std::vector< std::vector< int > > tdcs_
std::vector< int > iphis_
std::vector< int > ietas_
std::vector< bool > valids_
std::vector< std::vector< int > > adcs_
std::vector< std::vector< float > > fcs_
std::vector< std::vector< float > > pedestalfcs_
std::vector< int > subdets_
std::vector< int > flags_
std::vector< int > depths_
std::vector< int > rawIds_
std::vector< std::vector< int > > capids_
std::vector< int > sois_
std::vector< uint8_t > sipmTypes_
std::vector< HcalDetId > dids_
std::map< HcalDetId, unsigned int > did_indexmap_

Member Function Documentation

◆ add()

void QIE11DigiSortedTable::add ( const QIE11DataFrame digi,
const edm::ESHandle< HcalDbService > &  dbService 
)

Definition at line 29 of file QIE11DigiSortedTable.cc.

References adcs_, AlignmentProducer_cff::calibrations, QIE11DataFrame::capidError(), capidErrors_, capids_, depths_, QIE11DataFrame::detid(), did_indexmap_, fcs_, QIE11DataFrame::flags(), flags_, ietas_, createfilelist::int, iphis_, QIE11DataFrame::linkError(), linkErrors_, pedestalfcs_, rawIds_, QIE11DataFrame::samples(), sipmTypes_, 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<QIE11DataFrame>(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  capidErrors_[index] = digi->capidError();
43  flags_[index] = digi->flags();
44  sipmTypes_[index] = (uint8_t)dbService->getHcalSiPMParameter(did)->getType();
45 
46  for (unsigned int iTS = 0; iTS < (unsigned int)digi->samples(); ++iTS) {
47  if ((*digi)[iTS].soi()) {
48  sois_[index] = iTS;
49  }
50  adcs_[iTS][index] = (*digi)[iTS].adc();
51  tdcs_[iTS][index] = (*digi)[iTS].tdc();
52  capids_[iTS][index] = (*digi)[iTS].capid();
53  fcs_[iTS][index] = digiCaloSamples[iTS];
54  pedestalfcs_[iTS][index] = calibrations.pedestal((*digi)[iTS].capid());
55  }
56  valids_[index] = true;
57 }
constexpr uint16_t flags() const
get the flag word
std::vector< bool > capidErrors_
std::vector< bool > linkErrors_
std::vector< std::vector< int > > tdcs_
std::vector< int > iphis_
constexpr bool capidError() const
std::vector< int > ietas_
constexpr DetId detid() const
Get the detector id.
std::vector< bool > valids_
std::vector< std::vector< int > > adcs_
std::vector< std::vector< float > > fcs_
std::vector< std::vector< float > > pedestalfcs_
std::vector< int > subdets_
std::vector< int > flags_
constexpr int samples() const
total number of samples in the digi
std::vector< int > depths_
std::vector< int > rawIds_
std::vector< std::vector< int > > capids_
std::vector< int > sois_
std::vector< uint8_t > sipmTypes_
constexpr bool linkError() const
was there a link error?
std::map< HcalDetId, unsigned int > did_indexmap_

◆ reset()

void QIE11DigiSortedTable::reset ( void  )

Definition at line 59 of file QIE11DigiSortedTable.cc.

References adcs_, capidErrors_, capids_, depths_, fcs_, ntuplemaker::fill, flags_, ietas_, iphis_, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, linkErrors_, pedestalfcs_, rawIds_, sipmTypes_, sois_, subdets_, tdcs_, and valids_.

Referenced by HcalDigiSortedTableProducer::produce().

59  {
60  std::fill(ietas_.begin(), ietas_.end(), 0);
61  std::fill(iphis_.begin(), iphis_.end(), 0);
62  std::fill(subdets_.begin(), subdets_.end(), 0);
63  std::fill(depths_.begin(), depths_.end(), 0);
64  std::fill(rawIds_.begin(), rawIds_.end(), 0);
65  std::fill(linkErrors_.begin(), linkErrors_.end(), false);
66  std::fill(capidErrors_.begin(), capidErrors_.end(), false);
67  std::fill(flags_.begin(), flags_.end(), 0);
68  std::fill(sois_.begin(), sois_.end(), 0);
69  std::fill(valids_.begin(), valids_.end(), false);
70  std::fill(sipmTypes_.begin(), sipmTypes_.end(), 0);
71 
72  for (auto& it : adcs_) {
73  std::fill(it.begin(), it.end(), 0);
74  }
75  for (auto& it : fcs_) {
76  std::fill(it.begin(), it.end(), 0);
77  }
78  for (auto& it : pedestalfcs_) {
79  std::fill(it.begin(), it.end(), 0);
80  }
81  for (auto& it : tdcs_) {
82  std::fill(it.begin(), it.end(), 0);
83  }
84  for (auto& it : capids_) {
85  std::fill(it.begin(), it.end(), 0);
86  }
87 }
std::vector< bool > capidErrors_
std::vector< bool > linkErrors_
std::vector< std::vector< int > > tdcs_
std::vector< int > iphis_
std::vector< int > ietas_
std::vector< bool > valids_
std::vector< std::vector< int > > adcs_
std::vector< std::vector< float > > fcs_
std::vector< std::vector< float > > pedestalfcs_
std::vector< int > subdets_
std::vector< int > flags_
std::vector< int > depths_
std::vector< int > rawIds_
std::vector< std::vector< int > > capids_
std::vector< int > sois_
std::vector< uint8_t > sipmTypes_

Member Data Documentation

◆ adcs_

std::vector<std::vector<int> > QIE11DigiSortedTable::adcs_

◆ capidErrors_

std::vector<bool> QIE11DigiSortedTable::capidErrors_

◆ capids_

std::vector<std::vector<int> > QIE11DigiSortedTable::capids_

◆ depths_

std::vector<int> QIE11DigiSortedTable::depths_

◆ did_indexmap_

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

Definition at line 21 of file QIE11DigiSortedTable.h.

Referenced by add(), and QIE11DigiSortedTable().

◆ dids_

std::vector<HcalDetId> QIE11DigiSortedTable::dids_

Definition at line 20 of file QIE11DigiSortedTable.h.

Referenced by QIE11DigiSortedTable().

◆ fcs_

std::vector<std::vector<float> > QIE11DigiSortedTable::fcs_

◆ flags_

std::vector<int> QIE11DigiSortedTable::flags_

◆ ietas_

std::vector<int> QIE11DigiSortedTable::ietas_

◆ iphis_

std::vector<int> QIE11DigiSortedTable::iphis_

◆ linkErrors_

std::vector<bool> QIE11DigiSortedTable::linkErrors_

◆ nTS_

unsigned int QIE11DigiSortedTable::nTS_

Definition at line 35 of file QIE11DigiSortedTable.h.

Referenced by QIE11DigiSortedTable().

◆ pedestalfcs_

std::vector<std::vector<float> > QIE11DigiSortedTable::pedestalfcs_

◆ rawIds_

std::vector<int> QIE11DigiSortedTable::rawIds_

◆ sipmTypes_

std::vector<uint8_t> QIE11DigiSortedTable::sipmTypes_

◆ sois_

std::vector<int> QIE11DigiSortedTable::sois_

◆ subdets_

std::vector<int> QIE11DigiSortedTable::subdets_

◆ tdcs_

std::vector<std::vector<int> > QIE11DigiSortedTable::tdcs_

◆ valids_

std::vector<bool> QIE11DigiSortedTable::valids_