CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ( 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

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

Implements HcalCoder.

Definition at line 74 of file HcalCoderDb.cc.

References adc2fC_().

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

Implements HcalCoder.

Definition at line 75 of file HcalCoderDb.cc.

References adc2fC_().

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

Implements HcalCoder.

Definition at line 76 of file HcalCoderDb.cc.

References adc2fC_().

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

Implements HcalCoder.

Definition at line 77 of file HcalCoderDb.cc.

References adc2fC_().

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

Implements HcalCoder.

Definition at line 78 of file HcalCoderDb.cc.

References adc2fC_().

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

Implements HcalCoder.

Definition at line 79 of file HcalCoderDb.cc.

References adc2fC_().

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

Definition at line 22 of file HcalCoderDb.cc.

References gpuClustering::adc, isotrackApplyRegressor::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 }
constexpr edm::DataFrame::id_type id() const
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:33
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:43
constexpr int samples() const
total number of samples in the digi
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:42
uint16_t *__restrict__ uint16_t const *__restrict__ adc
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -&gt; fC conversion.
Definition: HcalQIECoder.cc:20
template<>
void HcalCoderDb::adc2fC_ ( const QIE11DataFrame df,
CaloSamples clf 
) const
private

Definition at line 32 of file HcalCoderDb.cc.

References gpuClustering::adc, isotrackApplyRegressor::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
constexpr int samples() const
total number of samples in the digi
constexpr edm::DataFrame::id_type id() const
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:42
uint16_t *__restrict__ uint16_t const *__restrict__ adc
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -&gt; fC conversion.
Definition: HcalQIECoder.cc:20
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(), 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
uint16_t *__restrict__ uint16_t const *__restrict__ adc
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -&gt; fC conversion.
Definition: HcalQIECoder.cc:20
void HcalCoderDb::fC2adc ( const CaloSamples clf,
HBHEDataFrame df,
int  fCapIdOffset 
) const
overridevirtual

Implements HcalCoder.

Definition at line 81 of file HcalCoderDb.cc.

References 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
void HcalCoderDb::fC2adc ( const CaloSamples clf,
HFDataFrame df,
int  fCapIdOffset 
) const
overridevirtual

Implements HcalCoder.

Definition at line 84 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 87 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 90 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 93 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 96 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 99 of file HcalCoderDb.cc.

References fC2adc_().

99  {
100  fC2adc_(clf, df, fCapIdOffset);
101 }
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:42
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(), 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 presamples() const
access presample information
Definition: CaloSamples.h:36
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:43
int size() const
get the size
Definition: CaloSamples.h:24
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -&gt; ADC conversion
Definition: HcalQIECoder.cc:25
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:42
template<>
void HcalCoderDb::fC2adc_ ( const CaloSamples clf,
QIE10DataFrame df,
int  fCapIdOffset 
) const
private

Definition at line 53 of file HcalCoderDb.cc.

References isotrackApplyRegressor::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 }
constexpr void setSample(edm::DataFrame::size_type isample, int adc, int le_tdc, int te_tdc, int capid, bool soi=false, bool ok=true)
set the sample contents
int presamples() const
access presample information
Definition: CaloSamples.h:36
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:43
int size() const
get the size
Definition: CaloSamples.h:24
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -&gt; ADC conversion
Definition: HcalQIECoder.cc:25
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:42
template<>
void HcalCoderDb::fC2adc_ ( const CaloSamples clf,
QIE11DataFrame df,
int  fCapIdOffset 
) const
private

Definition at line 63 of file HcalCoderDb.cc.

References isotrackApplyRegressor::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 presamples() const
access presample information
Definition: CaloSamples.h:36
constexpr void setSample(edm::DataFrame::size_type isample, int adc, int tdc, bool soi=false)
set the sample contents
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:43
int size() const
get the size
Definition: CaloSamples.h:24
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -&gt; ADC conversion
Definition: HcalQIECoder.cc:25
constexpr void setCapid0(int cap0)
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:42

Member Data Documentation

const HcalQIECoder* HcalCoderDb::mCoder
private

Definition at line 42 of file HcalCoderDb.h.

Referenced by adc2fC_(), and fC2adc_().

const HcalQIEShape* HcalCoderDb::mShape
private

Definition at line 43 of file HcalCoderDb.h.

Referenced by adc2fC_(), and fC2adc_().