CMS 3D CMS Logo

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

#include <HODigiSortedTable.h>

Public Member Functions

void add (const HODataFrame *digi, const edm::ESHandle< HcalDbService > &dbService)
 
 HODigiSortedTable (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< int > > dvs_
 
std::vector< std::vector< int > > ers_
 
std::vector< std::vector< float > > fcs_
 
std::vector< std::vector< int > > fiberChans_
 
std::vector< int > fiberIdleOffsets_
 
std::vector< std::vector< int > > fibers_
 
std::vector< int > ietas_
 
std::vector< int > iphis_
 
unsigned int nTS_
 
std::vector< std::vector< float > > pedestalfcs_
 
std::vector< int > rawIds_
 
std::vector< int > sois_
 
std::vector< int > subdets_
 
std::vector< bool > valids_
 

Detailed Description

Definition at line 18 of file HODigiSortedTable.h.

Constructor & Destructor Documentation

◆ HODigiSortedTable()

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

Definition at line 3 of file HODigiSortedTable.cc.

References adcs_, capids_, depths_, did_indexmap_, dids_, dvs_, ers_, fcs_, fiberChans_, fiberIdleOffsets_, fibers_, ietas_, createfilelist::int, iphis_, nTS_, pedestalfcs_, rawIds_, sois_, subdets_, 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 
11  ietas_.resize(dids_.size());
12  iphis_.resize(dids_.size());
13  subdets_.resize(dids_.size());
14  depths_.resize(dids_.size());
15  rawIds_.resize(dids_.size());
16  fiberIdleOffsets_.resize(dids_.size());
17  sois_.resize(dids_.size());
18  valids_.resize(dids_.size());
19 
20  adcs_.resize(nTS_, std::vector<int>(dids_.size()));
21  fcs_.resize(nTS_, std::vector<float>(dids_.size()));
22  pedestalfcs_.resize(nTS_, std::vector<float>(dids_.size()));
23  capids_.resize(nTS_, std::vector<int>(dids_.size()));
24  fibers_.resize(nTS_, std::vector<int>(dids_.size()));
25  fiberChans_.resize(nTS_, std::vector<int>(dids_.size()));
26  dvs_.resize(nTS_, std::vector<int>(dids_.size()));
27  ers_.resize(nTS_, std::vector<int>(dids_.size()));
28 }
std::vector< int > fiberIdleOffsets_
std::vector< std::vector< float > > pedestalfcs_
std::vector< std::vector< int > > adcs_
std::vector< std::vector< int > > fibers_
std::vector< std::vector< int > > ers_
std::vector< int > subdets_
std::vector< std::vector< int > > fiberChans_
std::vector< std::vector< int > > dvs_
std::vector< std::vector< float > > fcs_
std::vector< int > sois_
std::vector< std::vector< int > > capids_
std::vector< HcalDetId > dids_
std::vector< int > iphis_
std::vector< int > rawIds_
std::vector< int > depths_
std::map< HcalDetId, unsigned int > did_indexmap_
std::vector< int > ietas_
std::vector< bool > valids_

Member Function Documentation

◆ add()

void HODigiSortedTable::add ( const HODataFrame digi,
const edm::ESHandle< HcalDbService > &  dbService 
)

Definition at line 30 of file HODigiSortedTable.cc.

References HcalQIESample::adc(), adcs_, AlignmentProducer_cff::calibrations, HcalQIESample::capid(), capids_, depths_, did_indexmap_, HcalQIESample::dv(), dvs_, HcalQIESample::er(), ers_, fcs_, HODataFrame::fiberIdleOffset(), fiberIdleOffsets_, HODataFrame::id(), ietas_, createfilelist::int, iphis_, pedestalfcs_, HODataFrame::presamples(), rawIds_, HODataFrame::sample(), HODataFrame::size(), sois_, subdets_, and valids_.

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

30  {
31  HcalDetId did = digi->id();
32  unsigned int index = did_indexmap_.at(did);
33 
34  CaloSamples digiCaloSamples = hcaldqm::utilities::loadADC2fCDB<HODataFrame>(dbService, did, *digi);
35  HcalCalibrations calibrations = dbService->getHcalCalibrations(did);
36 
37  ietas_[index] = did.ieta();
38  iphis_[index] = did.iphi();
39  subdets_[index] = did.subdet();
40  depths_[index] = did.depth();
41  rawIds_[index] = did.rawId();
43  sois_[index] = digi->presamples();
44 
45  for (unsigned int iTS = 0; iTS < (unsigned int)digi->size(); ++iTS) {
46  adcs_[iTS][index] = digi->sample(iTS).adc();
47  capids_[iTS][index] = digi->sample(iTS).capid();
48  fcs_[iTS][index] = digiCaloSamples[iTS];
49  pedestalfcs_[iTS][index] = calibrations.pedestal(digi->sample(iTS).capid());
50  dvs_[iTS][index] = digi->sample(iTS).dv();
51  ers_[iTS][index] = digi->sample(iTS).er();
52  }
53  valids_[index] = true;
54 }
constexpr const HcalQIESample & sample(int i) const
access a sample
Definition: HODataFrame.h:40
std::vector< int > fiberIdleOffsets_
std::vector< std::vector< float > > pedestalfcs_
std::vector< std::vector< int > > adcs_
std::vector< std::vector< int > > ers_
std::vector< int > subdets_
constexpr bool dv() const
is the Data Valid bit set?
Definition: HcalQIESample.h:49
std::vector< std::vector< int > > dvs_
std::vector< std::vector< float > > fcs_
std::vector< int > sois_
std::vector< std::vector< int > > capids_
constexpr int fiberIdleOffset() const
offset of bunch number for this channel relative to nominal set in the unpacker (range is +7->-7...
Definition: HODataFrame.h:43
std::vector< int > iphis_
constexpr int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware) ...
Definition: HODataFrame.h:29
constexpr int size() const
total number of samples in the digi
Definition: HODataFrame.h:27
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:47
constexpr bool er() const
is the error bit set?
Definition: HcalQIESample.h:51
std::vector< int > rawIds_
constexpr int adc() const
get the ADC sample
Definition: HcalQIESample.h:43
std::vector< int > depths_
std::map< HcalDetId, unsigned int > did_indexmap_
std::vector< int > ietas_
std::vector< bool > valids_
constexpr HcalDetId const & id() const
Definition: HODataFrame.h:23

◆ reset()

void HODigiSortedTable::reset ( void  )

Definition at line 56 of file HODigiSortedTable.cc.

References adcs_, capids_, depths_, dids_, dvs_, ers_, fcs_, fiberChans_, fiberIdleOffsets_, fibers_, EcalPhiSymFlatTableProducers_cfi::fill, mps_fire::i, ietas_, iphis_, dqmiolumiharvest::j, nTS_, pedestalfcs_, rawIds_, sois_, subdets_, and valids_.

Referenced by HcalDigiSortedTableProducer::produce().

56  {
57  std::fill(ietas_.begin(), ietas_.end(), 0);
58  std::fill(iphis_.begin(), iphis_.end(), -100);
59  std::fill(subdets_.begin(), subdets_.end(), -1);
60  std::fill(depths_.begin(), depths_.end(), 0);
61  std::fill(rawIds_.begin(), rawIds_.end(), 0);
63  std::fill(sois_.begin(), sois_.end(), -1);
64  std::fill(valids_.begin(), valids_.end(), false);
65 
66  for (unsigned int i = 0; i < nTS_; ++i) {
67  for (unsigned int j = 0; j < dids_.size(); ++j) {
68  adcs_[i][j] = 0;
69  fcs_[i][j] = 0;
70  pedestalfcs_[i][j] = 0;
71  capids_[i][j] = 0;
72  fibers_[i][j] = 0;
73  fiberChans_[i][j] = 0;
74  dvs_[i][j] = 0;
75  ers_[i][j] = 0;
76  }
77  }
78 }
std::vector< int > fiberIdleOffsets_
std::vector< std::vector< float > > pedestalfcs_
std::vector< std::vector< int > > adcs_
std::vector< std::vector< int > > fibers_
std::vector< std::vector< int > > ers_
std::vector< int > subdets_
std::vector< std::vector< int > > fiberChans_
std::vector< std::vector< int > > dvs_
std::vector< std::vector< float > > fcs_
std::vector< int > sois_
std::vector< std::vector< int > > capids_
std::vector< HcalDetId > dids_
std::vector< int > iphis_
std::vector< int > rawIds_
std::vector< int > depths_
std::vector< int > ietas_
std::vector< bool > valids_

Member Data Documentation

◆ adcs_

std::vector<std::vector<int> > HODigiSortedTable::adcs_

◆ capids_

std::vector<std::vector<int> > HODigiSortedTable::capids_

◆ depths_

std::vector<int> HODigiSortedTable::depths_

◆ did_indexmap_

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

Definition at line 21 of file HODigiSortedTable.h.

Referenced by add(), and HODigiSortedTable().

◆ dids_

std::vector<HcalDetId> HODigiSortedTable::dids_

Definition at line 20 of file HODigiSortedTable.h.

Referenced by HODigiSortedTable(), and reset().

◆ dvs_

std::vector<std::vector<int> > HODigiSortedTable::dvs_

◆ ers_

std::vector<std::vector<int> > HODigiSortedTable::ers_

◆ fcs_

std::vector<std::vector<float> > HODigiSortedTable::fcs_

◆ fiberChans_

std::vector<std::vector<int> > HODigiSortedTable::fiberChans_

◆ fiberIdleOffsets_

std::vector<int> HODigiSortedTable::fiberIdleOffsets_

◆ fibers_

std::vector<std::vector<int> > HODigiSortedTable::fibers_

◆ ietas_

std::vector<int> HODigiSortedTable::ietas_

◆ iphis_

std::vector<int> HODigiSortedTable::iphis_

◆ nTS_

unsigned int HODigiSortedTable::nTS_

Definition at line 32 of file HODigiSortedTable.h.

Referenced by HODigiSortedTable(), and reset().

◆ pedestalfcs_

std::vector<std::vector<float> > HODigiSortedTable::pedestalfcs_

◆ rawIds_

std::vector<int> HODigiSortedTable::rawIds_

◆ sois_

std::vector<int> HODigiSortedTable::sois_

◆ subdets_

std::vector<int> HODigiSortedTable::subdets_

◆ valids_

std::vector<bool> HODigiSortedTable::valids_