CMS 3D CMS Logo

CastorCoderDB.cc
Go to the documentation of this file.
1 
8 
10 
12  : mCoder(&fCoder), mShape(&fShape) {}
13 
14 template <class Digi>
15 void CastorCoderDb::adc2fC_(const Digi& df, CaloSamples& clf) const {
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 }
22 
23 template <class Digi>
24 void CastorCoderDb::fC2adc_(const CaloSamples& clf, Digi& df, int fCapIdOffset) const {
25  df = Digi(clf.id());
26  df.setSize(clf.size());
27  df.setPresamples(clf.presamples());
28  for (int i = 0; i < clf.size(); i++) {
29  int capId = (fCapIdOffset + i) % 4;
30  df.setSample(i, HcalQIESample(mCoder->adc(*mShape, clf[i], capId), capId, 0, 0));
31  }
32 }
33 
34 void CastorCoderDb::adc2fC(const CastorDataFrame& df, CaloSamples& lf) const { adc2fC_(df, lf); }
35 
36 void CastorCoderDb::fC2adc(const CaloSamples& clf, CastorDataFrame& df, int fCapIdOffset) const {
37  fC2adc_(clf, df, fCapIdOffset);
38 }
ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:11
mps_fire.i
i
Definition: mps_fire.py:355
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
CastorCoderDb::fC2adc
void fC2adc(const CaloSamples &clf, CastorDataFrame &df, int fCapIdOffset) const override
Definition: CastorCoderDB.cc:36
CastorCoderDb::mShape
const CastorQIEShape * mShape
Definition: CastorCoderDb.h:31
CastorCoderDb::fC2adc_
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: CastorCoderDB.cc:24
CaloSamples::setPresamples
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:33
CastorDataFrame
Definition: CastorDataFrame.h:15
CastorCoderDb::mCoder
const CastorQIECoder * mCoder
Definition: CastorCoderDb.h:30
CastorQIECoder::charge
float charge(const CastorQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
Definition: CastorQIECoder.cc:17
CastorCoderDb::CastorCoderDb
CastorCoderDb(const CastorQIECoder &fCoder, const CastorQIEShape &fShape)
Definition: CastorCoderDB.cc:11
CaloSamples::id
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
CaloSamples
Definition: CaloSamples.h:14
CastorQIECoder::adc
unsigned adc(const CastorQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
Definition: CastorQIECoder.cc:22
CastorQIECoder.h
CastorCoderDb.h
CaloSamples::presamples
int presamples() const
access presample information
Definition: CaloSamples.h:36
CastorCoderDb::adc2fC_
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: CastorCoderDB.cc:15
CastorQIECoder
Definition: CastorQIECoder.h:21
CastorCoderDb::adc2fC
void adc2fC(const CastorDataFrame &df, CaloSamples &lf) const override
Definition: CastorCoderDB.cc:34
CastorQIEShape.h
CastorQIEShape
Definition: CastorQIEShape.h:14