CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HcalCoderDb Class Reference

#include <HcalCoderDb.h>

Inheritance diagram for HcalCoderDb:
HcalCoder

Public Member Functions

void adc2fC (const HBHEDataFrame &df, CaloSamples &lf) const override
 
void adc2fC (const HcalCalibDataFrame &df, CaloSamples &lf) const override
 
void adc2fC (const HFDataFrame &df, CaloSamples &lf) const override
 
void adc2fC (const HODataFrame &df, CaloSamples &lf) const override
 
void adc2fC (const QIE10DataFrame &df, CaloSamples &lf) const override
 
void adc2fC (const QIE11DataFrame &df, CaloSamples &lf) const override
 
void adc2fC (const ZDCDataFrame &df, CaloSamples &lf) const override
 
void fC2adc (const CaloSamples &clf, HBHEDataFrame &df, int fCapIdOffset) const override
 
void fC2adc (const CaloSamples &clf, HcalCalibDataFrame &df, int fCapIdOffset) const override
 
void fC2adc (const CaloSamples &clf, HFDataFrame &df, int fCapIdOffset) const override
 
void fC2adc (const CaloSamples &clf, HODataFrame &df, int fCapIdOffset) const override
 
void fC2adc (const CaloSamples &clf, QIE10DataFrame &df, int fCapIdOffset) const override
 
void fC2adc (const CaloSamples &clf, QIE11DataFrame &df, int fCapIdOffset) const override
 
void fC2adc (const CaloSamples &clf, ZDCDataFrame &df, int fCapIdOffset) const override
 
 HcalCoderDb (const HcalQIECoder &fCoder, const HcalQIEShape &fShape)
 
- Public Member Functions inherited from HcalCoder
virtual ~HcalCoder ()=default
 

Private Member Functions

template<class Digi >
void adc2fC_ (const Digi &df, CaloSamples &clf) const
 
template<>
void adc2fC_ (const QIE10DataFrame &df, CaloSamples &clf) const
 
template<>
void adc2fC_ (const QIE11DataFrame &df, CaloSamples &clf) const
 
template<class Digi >
void fC2adc_ (const CaloSamples &clf, Digi &df, int fCapIdOffset) const
 
template<>
void fC2adc_ (const CaloSamples &clf, QIE10DataFrame &df, int fCapIdOffset) const
 
template<>
void fC2adc_ (const CaloSamples &clf, QIE11DataFrame &df, int fCapIdOffset) const
 

Private Attributes

const HcalQIECodermCoder
 
const HcalQIEShapemShape
 

Detailed Description

coder which uses DB services to convert to fC $Author: ratnikov

Definition at line 15 of file HcalCoderDb.h.

Constructor & Destructor Documentation

◆ HcalCoderDb()

HcalCoderDb::HcalCoderDb ( const HcalQIECoder fCoder,
const HcalQIEShape fShape 
)

Definition at line 10 of file HcalCoderDb.cc.

10 : mCoder(&fCoder), mShape(&fShape) {}

Member Function Documentation

◆ adc2fC() [1/7]

void HcalCoderDb::adc2fC ( const HBHEDataFrame df,
CaloSamples lf 
) const
overridevirtual

◆ adc2fC() [2/7]

void HcalCoderDb::adc2fC ( const HcalCalibDataFrame df,
CaloSamples lf 
) const
overridevirtual

Implements HcalCoder.

Definition at line 77 of file HcalCoderDb.cc.

77 { adc2fC_(df, lf); }

References adc2fC_(), and hgcalPerformanceValidation::df.

◆ adc2fC() [3/7]

void HcalCoderDb::adc2fC ( const HFDataFrame df,
CaloSamples lf 
) const
overridevirtual

Implements HcalCoder.

Definition at line 75 of file HcalCoderDb.cc.

75 { adc2fC_(df, lf); }

References adc2fC_(), and hgcalPerformanceValidation::df.

◆ adc2fC() [4/7]

void HcalCoderDb::adc2fC ( const HODataFrame df,
CaloSamples lf 
) const
overridevirtual

Implements HcalCoder.

Definition at line 74 of file HcalCoderDb.cc.

74 { adc2fC_(df, lf); }

References adc2fC_(), and hgcalPerformanceValidation::df.

◆ adc2fC() [5/7]

void HcalCoderDb::adc2fC ( const QIE10DataFrame df,
CaloSamples lf 
) const
overridevirtual

Implements HcalCoder.

Definition at line 78 of file HcalCoderDb.cc.

78 { adc2fC_(df, lf); }

References adc2fC_(), and hgcalPerformanceValidation::df.

◆ adc2fC() [6/7]

void HcalCoderDb::adc2fC ( const QIE11DataFrame df,
CaloSamples lf 
) const
overridevirtual

Implements HcalCoder.

Definition at line 79 of file HcalCoderDb.cc.

79 { adc2fC_(df, lf); }

References adc2fC_(), and hgcalPerformanceValidation::df.

◆ adc2fC() [7/7]

void HcalCoderDb::adc2fC ( const ZDCDataFrame df,
CaloSamples lf 
) const
overridevirtual

Implements HcalCoder.

Definition at line 76 of file HcalCoderDb.cc.

76 { adc2fC_(df, lf); }

References adc2fC_(), and hgcalPerformanceValidation::df.

◆ adc2fC_() [1/3]

template<class Digi >
void HcalCoderDb::adc2fC_ ( const Digi &  df,
CaloSamples clf 
) const
private

Definition at line 13 of file HcalCoderDb.cc.

13  {
14  clf = CaloSamples(df.id(), df.size());
15  for (int i = 0; i < df.size(); i++) {
16  clf[i] = mCoder->charge(*mShape, df[i].adc(), df[i].capid());
17  }
18  clf.setPresamples(df.presamples());
19 }

References ecalLiteDTU::adc(), HcalQIECoder::charge(), hgcalPerformanceValidation::df, mps_fire::i, mCoder, mShape, and CaloSamples::setPresamples().

Referenced by adc2fC().

◆ adc2fC_() [2/3]

template<>
void HcalCoderDb::adc2fC_ ( const QIE10DataFrame df,
CaloSamples clf 
) const
private

Definition at line 22 of file HcalCoderDb.cc.

22  {
23  clf = CaloSamples(df.id(), df.samples());
24  for (int i = 0; i < df.samples(); i++) {
25  clf[i] = mCoder->charge(*mShape, df[i].adc(), df[i].capid());
26  if (df[i].soi())
27  clf.setPresamples(i);
28  }
29 }

References ecalLiteDTU::adc(), HcalQIECoder::charge(), hgcalPerformanceValidation::df, mps_fire::i, mCoder, mShape, and CaloSamples::setPresamples().

◆ adc2fC_() [3/3]

template<>
void HcalCoderDb::adc2fC_ ( const QIE11DataFrame df,
CaloSamples clf 
) const
private

Definition at line 32 of file HcalCoderDb.cc.

32  {
33  clf = CaloSamples(df.id(), df.samples());
34  for (int i = 0; i < df.samples(); i++) {
35  clf[i] = mCoder->charge(*mShape, df[i].adc(), df[i].capid());
36  if (df[i].soi())
37  clf.setPresamples(i);
38  }
39 }

References ecalLiteDTU::adc(), HcalQIECoder::charge(), hgcalPerformanceValidation::df, mps_fire::i, mCoder, mShape, and CaloSamples::setPresamples().

◆ fC2adc() [1/7]

void HcalCoderDb::fC2adc ( const CaloSamples clf,
HBHEDataFrame df,
int  fCapIdOffset 
) const
overridevirtual

Implements HcalCoder.

Definition at line 81 of file HcalCoderDb.cc.

81  {
82  fC2adc_(clf, df, fCapIdOffset);
83 }

References hgcalPerformanceValidation::df, and fC2adc_().

Referenced by edm::DataMixingHcalDigiWorker::putHcal().

◆ fC2adc() [2/7]

void HcalCoderDb::fC2adc ( const CaloSamples clf,
HcalCalibDataFrame df,
int  fCapIdOffset 
) const
overridevirtual

Implements HcalCoder.

Definition at line 93 of file HcalCoderDb.cc.

93  {
94  fC2adc_(clf, df, fCapIdOffset);
95 }

References hgcalPerformanceValidation::df, and fC2adc_().

◆ fC2adc() [3/7]

void HcalCoderDb::fC2adc ( const CaloSamples clf,
HFDataFrame df,
int  fCapIdOffset 
) const
overridevirtual

Implements HcalCoder.

Definition at line 84 of file HcalCoderDb.cc.

84  {
85  fC2adc_(clf, df, fCapIdOffset);
86 }

References hgcalPerformanceValidation::df, and fC2adc_().

◆ fC2adc() [4/7]

void HcalCoderDb::fC2adc ( const CaloSamples clf,
HODataFrame df,
int  fCapIdOffset 
) const
overridevirtual

Implements HcalCoder.

Definition at line 87 of file HcalCoderDb.cc.

87  {
88  fC2adc_(clf, df, fCapIdOffset);
89 }

References hgcalPerformanceValidation::df, and fC2adc_().

◆ fC2adc() [5/7]

void HcalCoderDb::fC2adc ( const CaloSamples clf,
QIE10DataFrame df,
int  fCapIdOffset 
) const
overridevirtual

Implements HcalCoder.

Definition at line 96 of file HcalCoderDb.cc.

96  {
97  fC2adc_(clf, df, fCapIdOffset);
98 }

References hgcalPerformanceValidation::df, and fC2adc_().

◆ fC2adc() [6/7]

void HcalCoderDb::fC2adc ( const CaloSamples clf,
QIE11DataFrame df,
int  fCapIdOffset 
) const
overridevirtual

Implements HcalCoder.

Definition at line 99 of file HcalCoderDb.cc.

99  {
100  fC2adc_(clf, df, fCapIdOffset);
101 }

References hgcalPerformanceValidation::df, and fC2adc_().

◆ fC2adc() [7/7]

void HcalCoderDb::fC2adc ( const CaloSamples clf,
ZDCDataFrame df,
int  fCapIdOffset 
) const
overridevirtual

Implements HcalCoder.

Definition at line 90 of file HcalCoderDb.cc.

90  {
91  fC2adc_(clf, df, fCapIdOffset);
92 }

References hgcalPerformanceValidation::df, and fC2adc_().

◆ fC2adc_() [1/3]

template<class Digi >
void HcalCoderDb::fC2adc_ ( const CaloSamples clf,
Digi &  df,
int  fCapIdOffset 
) const
private

Definition at line 42 of file HcalCoderDb.cc.

42  {
43  df = Digi(clf.id());
44  df.setSize(clf.size());
45  df.setPresamples(clf.presamples());
46  for (int i = 0; i < clf.size(); i++) {
47  int capId = (fCapIdOffset + i) % 4;
48  df.setSample(i, HcalQIESample(mCoder->adc(*mShape, clf[i], capId), capId, 0, 0));
49  }
50 }

References HcalQIECoder::adc(), hgcalPerformanceValidation::df, TrendClient_cfi::Digi, mps_fire::i, CaloSamples::id(), mCoder, mShape, CaloSamples::presamples(), and CaloSamples::size().

Referenced by fC2adc().

◆ fC2adc_() [2/3]

template<>
void HcalCoderDb::fC2adc_ ( const CaloSamples clf,
QIE10DataFrame df,
int  fCapIdOffset 
) const
private

Definition at line 53 of file HcalCoderDb.cc.

53  {
54  int presample = clf.presamples();
55  for (int i = 0; i < clf.size(); i++) {
56  int capId = (fCapIdOffset + i) % 4;
57  bool soi = (i == presample);
58  df.setSample(i, mCoder->adc(*mShape, clf[i], capId), 0, 0, capId, soi, true);
59  }
60 }

References HcalQIECoder::adc(), hgcalPerformanceValidation::df, mps_fire::i, mCoder, mShape, CaloSamples::presamples(), and CaloSamples::size().

◆ fC2adc_() [3/3]

template<>
void HcalCoderDb::fC2adc_ ( const CaloSamples clf,
QIE11DataFrame df,
int  fCapIdOffset 
) const
private

Definition at line 63 of file HcalCoderDb.cc.

63  {
64  int presample = clf.presamples();
65  df.setCapid0(fCapIdOffset % 4);
66  for (int i = 0; i < clf.size(); i++) {
67  int capId = (fCapIdOffset + i) % 4;
68  bool soi = (i == presample);
69  df.setSample(i, mCoder->adc(*mShape, clf[i], capId), 0, soi);
70  }
71 }

References HcalQIECoder::adc(), hgcalPerformanceValidation::df, mps_fire::i, mCoder, mShape, CaloSamples::presamples(), and CaloSamples::size().

Member Data Documentation

◆ mCoder

const HcalQIECoder* HcalCoderDb::mCoder
private

Definition at line 42 of file HcalCoderDb.h.

Referenced by adc2fC_(), and fC2adc_().

◆ mShape

const HcalQIEShape* HcalCoderDb::mShape
private

Definition at line 43 of file HcalCoderDb.h.

Referenced by adc2fC_(), and fC2adc_().

mps_fire.i
i
Definition: mps_fire.py:428
HcalQIECoder::charge
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
Definition: HcalQIECoder.cc:20
CaloSamples::size
int size() const
get the size
Definition: CaloSamples.h:24
TrendClient_cfi.Digi
Digi
Definition: TrendClient_cfi.py:7
HcalQIESample
Definition: HcalQIESample.h:32
ecalLiteDTU::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalLiteDTUSample.h:12
CaloSamples::setPresamples
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:33
HcalCoderDb::fC2adc_
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:42
CaloSamples::id
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
CaloSamples
Definition: CaloSamples.h:14
hgcalPerformanceValidation.df
df
Definition: hgcalPerformanceValidation.py:640
CaloSamples::presamples
int presamples() const
access presample information
Definition: CaloSamples.h:36
HcalCoderDb::adc2fC_
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: HcalCoderDb.cc:13
HcalCoderDb::mShape
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:43
HcalQIECoder::adc
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
Definition: HcalQIECoder.cc:25
HcalCoderDb::mCoder
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:42