CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalCoderDb.cc
Go to the documentation of this file.
1 
10 
12 
13 HcalCoderDb::HcalCoderDb (const HcalQIECoder& fCoder, const HcalQIEShape& fShape)
14  : mCoder (&fCoder),
15  mShape (&fShape)
16 {}
17 
18 template <class Digi> void HcalCoderDb::adc2fC_ (const Digi& df, CaloSamples& clf) const {
19  clf=CaloSamples(df.id(),df.size());
20  for (int i=0; i<df.size(); i++) {
21  clf[i]=mCoder->charge (*mShape, df[i].adc (), df[i].capid ());
22  }
23  clf.setPresamples(df.presamples());
24 }
25 
26 template <class Digi> void HcalCoderDb::fC2adc_ (const CaloSamples& clf, Digi& df, int fCapIdOffset) const {
27  df = Digi (clf.id ());
28  df.setSize (clf.size ());
29  df.setPresamples (clf.presamples ());
30  for (int i=0; i<clf.size(); i++) {
31  int capId = (fCapIdOffset + i) % 4;
32  df.setSample(i, HcalQIESample(mCoder->adc(*mShape, clf[i], capId), capId, 0, 0));
33  }
34 }
35 
36 
37 void HcalCoderDb::adc2fC(const HBHEDataFrame& df, CaloSamples& lf) const {adc2fC_ (df, lf);}
38 void HcalCoderDb::adc2fC(const HODataFrame& df, CaloSamples& lf) const {adc2fC_ (df, lf);}
39 void HcalCoderDb::adc2fC(const HFDataFrame& df, CaloSamples& lf) const {adc2fC_ (df, lf);}
40 void HcalCoderDb::adc2fC(const ZDCDataFrame& df, CaloSamples& lf) const {adc2fC_ (df, lf);}
41 void HcalCoderDb::adc2fC(const HcalCalibDataFrame& df, CaloSamples& lf) const {adc2fC_ (df, lf);}
42 
43 void HcalCoderDb::fC2adc(const CaloSamples& clf, HBHEDataFrame& df, int fCapIdOffset) const {fC2adc_ (clf, df, fCapIdOffset);}
44 void HcalCoderDb::fC2adc(const CaloSamples& clf, HFDataFrame& df, int fCapIdOffset) const {fC2adc_ (clf, df, fCapIdOffset);}
45 void HcalCoderDb::fC2adc(const CaloSamples& clf, HODataFrame& df, int fCapIdOffset) const {fC2adc_ (clf, df, fCapIdOffset);}
46 void HcalCoderDb::fC2adc(const CaloSamples& clf, ZDCDataFrame& df, int fCapIdOffset) const {fC2adc_ (clf, df, fCapIdOffset);}
47 void HcalCoderDb::fC2adc(const CaloSamples& clf, HcalCalibDataFrame& df, int fCapIdOffset) const {fC2adc_ (clf, df, fCapIdOffset);}
48 
int adc(sample_type sample)
get the ADC sample (12 bits)
int i
Definition: DBlmapReader.cc:9
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: HcalCoderDb.cc:18
int presamples() const
access presample information
Definition: CaloSamples.h:31
virtual void fC2adc(const CaloSamples &clf, HBHEDataFrame &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:43
HcalCoderDb(const HcalQIECoder &fCoder, const HcalQIEShape &fShape)
Definition: HcalCoderDb.cc:13
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:26
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const
Definition: HcalCoderDb.cc:37
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:15
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:38
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:27
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:37
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -&gt; fC conversion.
Definition: HcalQIECoder.cc:22