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 ( const HcalQIECoder fCoder,
const HcalQIEShape fShape 
)

Definition at line 10 of file HcalCoderDb.cc.

11  : mCoder (&fCoder),
12  mShape (&fShape)
13 {}
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:41
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:40

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 69 of file HcalCoderDb.cc.

References adc2fC_().

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

Implements HcalCoder.

Definition at line 70 of file HcalCoderDb.cc.

References adc2fC_().

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

Implements HcalCoder.

Definition at line 71 of file HcalCoderDb.cc.

References adc2fC_().

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

Implements HcalCoder.

Definition at line 72 of file HcalCoderDb.cc.

References adc2fC_().

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

Implements HcalCoder.

Definition at line 73 of file HcalCoderDb.cc.

References adc2fC_().

73 {adc2fC_ (df, lf);}
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: HcalCoderDb.cc:15
void HcalCoderDb::adc2fC ( const QIE11DataFrame 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:15
template<>
void HcalCoderDb::adc2fC_ ( const QIE10DataFrame df,
CaloSamples clf 
) const
private

Definition at line 23 of file HcalCoderDb.cc.

References ecalMGPA::adc(), HcalQIECoder::charge(), mps_fire::i, mCoder, and mShape.

23  {
24  clf=CaloSamples(df.id(),df.samples());
25  for (int i=0; i<df.samples(); i++) {
26  clf[i]=mCoder->charge (*mShape, df[i].adc (), df[i].capid ());
27  if(df[i].soi()) clf.setPresamples(i);
28  }
29 }
int samples() const
total number of samples in the digi
edm::DataFrame::id_type id() const
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:33
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:41
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:40
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
Definition: HcalQIECoder.cc:20
template<>
void HcalCoderDb::adc2fC_ ( const QIE11DataFrame df,
CaloSamples clf 
) const
private

Definition at line 31 of file HcalCoderDb.cc.

References ecalMGPA::adc(), HcalQIECoder::charge(), mps_fire::i, mCoder, and mShape.

31  {
32  clf=CaloSamples(df.id(),df.samples());
33  for (int i=0; i<df.samples(); i++) {
34  clf[i]=mCoder->charge (*mShape, df[i].adc (), df[i].capid ());
35  if(df[i].soi()) clf.setPresamples(i);
36  }
37 }
edm::DataFrame::id_type id() const
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:33
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:41
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:40
int samples() const
total number of samples in the digi
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
Definition: HcalQIECoder.cc:20
template<class Digi >
void HcalCoderDb::adc2fC_ ( const Digi &  df,
CaloSamples clf 
) const
private

Definition at line 15 of file HcalCoderDb.cc.

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

Referenced by adc2fC().

15  {
16  clf=CaloSamples(df.id(),df.size());
17  for (int i=0; i<df.size(); i++) {
18  clf[i]=mCoder->charge (*mShape, df[i].adc (), df[i].capid ());
19  }
20  clf.setPresamples(df.presamples());
21 }
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:33
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:41
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:40
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
Definition: HcalQIECoder.cc:20
void HcalCoderDb::fC2adc ( const CaloSamples clf,
HBHEDataFrame df,
int  fCapIdOffset 
) const
overridevirtual

Implements HcalCoder.

Definition at line 76 of file HcalCoderDb.cc.

References fC2adc_().

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

76 {fC2adc_ (clf, df, fCapIdOffset);}
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:39
void HcalCoderDb::fC2adc ( const CaloSamples clf,
HFDataFrame df,
int  fCapIdOffset 
) const
overridevirtual

Implements HcalCoder.

Definition at line 77 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 78 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 79 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 80 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 81 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 82 of file HcalCoderDb.cc.

References fC2adc_().

82 {fC2adc_ (clf, df, fCapIdOffset);}
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:39
template<class Digi >
void HcalCoderDb::fC2adc_ ( const CaloSamples clf,
Digi &  df,
int  fCapIdOffset 
) const
private

Definition at line 39 of file HcalCoderDb.cc.

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

Referenced by fC2adc().

39  {
40  df = Digi (clf.id ());
41  df.setSize (clf.size ());
42  df.setPresamples (clf.presamples ());
43  for (int i=0; i<clf.size(); i++) {
44  int capId = (fCapIdOffset + i) % 4;
45  df.setSample(i, HcalQIESample(mCoder->adc(*mShape, clf[i], capId), capId, 0, 0));
46  }
47 }
int presamples() const
access presample information
Definition: CaloSamples.h:36
std::tuple< unsigned int, int, int, DigiType, int, int, int, float > Digi
Definition: GenericDigi.h:40
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:41
int size() const
get the size
Definition: CaloSamples.h:24
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
Definition: HcalQIECoder.cc:25
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:40
template<>
void HcalCoderDb::fC2adc_ ( const CaloSamples clf,
QIE10DataFrame df,
int  fCapIdOffset 
) const
private

Definition at line 49 of file HcalCoderDb.cc.

References HcalQIECoder::adc(), mps_fire::i, mCoder, and mShape.

49  {
50  int presample = clf.presamples ();
51  for (int i=0; i<clf.size(); i++) {
52  int capId = (fCapIdOffset + i) % 4;
53  bool soi = (i==presample);
54  df.setSample(i, mCoder->adc(*mShape, clf[i], capId), 0, 0, capId, soi, true);
55  }
56 }
int presamples() const
access presample information
Definition: CaloSamples.h:36
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:41
int size() const
get the size
Definition: CaloSamples.h:24
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
Definition: HcalQIECoder.cc:25
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:40
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
template<>
void HcalCoderDb::fC2adc_ ( const CaloSamples clf,
QIE11DataFrame df,
int  fCapIdOffset 
) const
private

Definition at line 58 of file HcalCoderDb.cc.

References HcalQIECoder::adc(), mps_fire::i, mCoder, and mShape.

58  {
59  int presample = clf.presamples ();
60  df.setCapid0(fCapIdOffset%4);
61  for (int i=0; i<clf.size(); i++) {
62  int capId = (fCapIdOffset + i) % 4;
63  bool soi = (i==presample);
64  df.setSample(i, mCoder->adc(*mShape, clf[i], capId), 0, soi);
65  }
66 }
void setSample(edm::DataFrame::size_type isample, int adc, int tdc, bool soi=false)
set the sample contents
void setCapid0(int cap0)
int presamples() const
access presample information
Definition: CaloSamples.h:36
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:41
int size() const
get the size
Definition: CaloSamples.h:24
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
Definition: HcalQIECoder.cc:25
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:40

Member Data Documentation

const HcalQIECoder* HcalCoderDb::mCoder
private

Definition at line 40 of file HcalCoderDb.h.

Referenced by adc2fC_(), and fC2adc_().

const HcalQIEShape* HcalCoderDb::mShape
private

Definition at line 41 of file HcalCoderDb.h.

Referenced by adc2fC_(), and fC2adc_().