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

Private Member Functions

template<>
void adc2fC_ (const QIE10DataFrame &df, CaloSamples &clf) const
 
template<>
void adc2fC_ (const QIE11DataFrame &df, CaloSamples &clf) const
 
template<class Digi >
void adc2fC_ (const Digi &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) {}
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:43
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:42

Member Function Documentation

◆ adc2fC() [1/7]

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

◆ adc2fC() [2/7]

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

Implements HcalCoder.

Definition at line 74 of file HcalCoderDb.cc.

References adc2fC_(), and hgcalPerformanceValidation::df.

74 { adc2fC_(df, lf); }
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: HcalCoderDb.cc:13

◆ adc2fC() [3/7]

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

Implements HcalCoder.

Definition at line 75 of file HcalCoderDb.cc.

References adc2fC_(), and hgcalPerformanceValidation::df.

75 { adc2fC_(df, lf); }
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: HcalCoderDb.cc:13

◆ adc2fC() [4/7]

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

Implements HcalCoder.

Definition at line 76 of file HcalCoderDb.cc.

References adc2fC_(), and hgcalPerformanceValidation::df.

76 { adc2fC_(df, lf); }
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: HcalCoderDb.cc:13

◆ adc2fC() [5/7]

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

Implements HcalCoder.

Definition at line 77 of file HcalCoderDb.cc.

References adc2fC_(), and hgcalPerformanceValidation::df.

77 { adc2fC_(df, lf); }
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: HcalCoderDb.cc:13

◆ adc2fC() [6/7]

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

Implements HcalCoder.

Definition at line 78 of file HcalCoderDb.cc.

References adc2fC_(), and hgcalPerformanceValidation::df.

78 { adc2fC_(df, lf); }
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: HcalCoderDb.cc:13

◆ adc2fC() [7/7]

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

Implements HcalCoder.

Definition at line 79 of file HcalCoderDb.cc.

References adc2fC_(), and hgcalPerformanceValidation::df.

79 { adc2fC_(df, lf); }
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: HcalCoderDb.cc:13

◆ adc2fC_() [1/3]

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

Definition at line 22 of file HcalCoderDb.cc.

References gpuClustering::adc, hgcalPerformanceValidation::df, mps_fire::i, and CaloSamples::setPresamples().

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 }
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:33
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:43
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:42
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
Definition: HcalQIECoder.cc:20
uint16_t *__restrict__ uint16_t const *__restrict__ adc

◆ adc2fC_() [2/3]

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

Definition at line 32 of file HcalCoderDb.cc.

References gpuClustering::adc, hgcalPerformanceValidation::df, mps_fire::i, and CaloSamples::setPresamples().

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 }
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:33
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:43
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:42
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
Definition: HcalQIECoder.cc:20
uint16_t *__restrict__ uint16_t const *__restrict__ adc

◆ adc2fC_() [3/3]

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

Definition at line 13 of file HcalCoderDb.cc.

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

Referenced by adc2fC().

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 }
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:33
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:43
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:42
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
Definition: HcalQIECoder.cc:20
uint16_t *__restrict__ uint16_t const *__restrict__ adc

◆ 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.

References hgcalPerformanceValidation::df, and fC2adc_().

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

81  {
82  fC2adc_(clf, df, fCapIdOffset);
83 }
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:42

◆ fC2adc() [2/7]

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

Implements HcalCoder.

Definition at line 84 of file HcalCoderDb.cc.

References hgcalPerformanceValidation::df, and fC2adc_().

84  {
85  fC2adc_(clf, df, fCapIdOffset);
86 }
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:42

◆ fC2adc() [3/7]

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

Implements HcalCoder.

Definition at line 87 of file HcalCoderDb.cc.

References hgcalPerformanceValidation::df, and fC2adc_().

87  {
88  fC2adc_(clf, df, fCapIdOffset);
89 }
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:42

◆ fC2adc() [4/7]

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

Implements HcalCoder.

Definition at line 90 of file HcalCoderDb.cc.

References hgcalPerformanceValidation::df, and fC2adc_().

90  {
91  fC2adc_(clf, df, fCapIdOffset);
92 }
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:42

◆ fC2adc() [5/7]

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

Implements HcalCoder.

Definition at line 93 of file HcalCoderDb.cc.

References hgcalPerformanceValidation::df, and fC2adc_().

93  {
94  fC2adc_(clf, df, fCapIdOffset);
95 }
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:42

◆ fC2adc() [6/7]

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

Implements HcalCoder.

Definition at line 96 of file HcalCoderDb.cc.

References hgcalPerformanceValidation::df, and fC2adc_().

96  {
97  fC2adc_(clf, df, fCapIdOffset);
98 }
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:42

◆ fC2adc() [7/7]

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

Implements HcalCoder.

Definition at line 99 of file HcalCoderDb.cc.

References hgcalPerformanceValidation::df, and fC2adc_().

99  {
100  fC2adc_(clf, df, fCapIdOffset);
101 }
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:42

◆ 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.

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

Referenced by fC2adc().

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 }
int size() const
get the size
Definition: CaloSamples.h:24
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:43
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
Definition: HcalQIECoder.cc:25
int presamples() const
access presample information
Definition: CaloSamples.h:36
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:42

◆ fC2adc_() [2/3]

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

Definition at line 53 of file HcalCoderDb.cc.

References hgcalPerformanceValidation::df, and mps_fire::i.

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 }
int size() const
get the size
Definition: CaloSamples.h:24
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:43
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
Definition: HcalQIECoder.cc:25
int presamples() const
access presample information
Definition: CaloSamples.h:36
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:42

◆ fC2adc_() [3/3]

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

Definition at line 63 of file HcalCoderDb.cc.

References hgcalPerformanceValidation::df, and mps_fire::i.

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 }
int size() const
get the size
Definition: CaloSamples.h:24
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:43
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
Definition: HcalQIECoder.cc:25
int presamples() const
access presample information
Definition: CaloSamples.h:36
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:42

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_().