CMS 3D CMS Logo

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

virtual void adc2fC (const HBHEDataFrame &df, CaloSamples &lf) const
 
virtual void adc2fC (const HODataFrame &df, CaloSamples &lf) const
 
virtual void adc2fC (const HFDataFrame &df, CaloSamples &lf) const
 
virtual void adc2fC (const ZDCDataFrame &df, CaloSamples &lf) const
 
virtual void adc2fC (const HcalCalibDataFrame &df, CaloSamples &lf) const
 
virtual void adc2fC (const HcalUpgradeDataFrame &df, CaloSamples &lf) const
 
virtual void fC2adc (const CaloSamples &clf, HBHEDataFrame &df, int fCapIdOffset) const
 
virtual void fC2adc (const CaloSamples &clf, HFDataFrame &df, int fCapIdOffset) const
 
virtual void fC2adc (const CaloSamples &clf, HODataFrame &df, int fCapIdOffset) const
 
virtual void fC2adc (const CaloSamples &clf, ZDCDataFrame &df, int fCapIdOffset) const
 
virtual void fC2adc (const CaloSamples &clf, HcalCalibDataFrame &df, int fCapIdOffset) const
 
virtual void fC2adc (const CaloSamples &clf, HcalUpgradeDataFrame &df, int fCapIdOffset) const
 
 HcalCoderDb (const HcalQIECoder &fCoder, const HcalQIEShape &fShape)
 

Private Member Functions

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<class Digi >
void fCUpgrade2adc_ (const CaloSamples &clf, Digi &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 11 of file HcalCoderDb.cc.

12  : mCoder (&fCoder),
13  mShape (&fShape)
14 {}
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:39
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:38

Member Function Documentation

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

Implements HcalCoder.

Definition at line 45 of file HcalCoderDb.cc.

References adc2fC_().

45 {adc2fC_ (df, lf);}
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: HcalCoderDb.cc:16
void HcalCoderDb::adc2fC ( const HFDataFrame df,
CaloSamples lf 
) const
virtual

Implements HcalCoder.

Definition at line 46 of file HcalCoderDb.cc.

References adc2fC_().

46 {adc2fC_ (df, lf);}
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: HcalCoderDb.cc:16
void HcalCoderDb::adc2fC ( const ZDCDataFrame df,
CaloSamples lf 
) const
virtual

Implements HcalCoder.

Definition at line 47 of file HcalCoderDb.cc.

References adc2fC_().

47 {adc2fC_ (df, lf);}
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: HcalCoderDb.cc:16
void HcalCoderDb::adc2fC ( const HcalCalibDataFrame df,
CaloSamples lf 
) const
virtual

Implements HcalCoder.

Definition at line 48 of file HcalCoderDb.cc.

References adc2fC_().

48 {adc2fC_ (df, lf);}
void adc2fC_(const Digi &df, CaloSamples &clf) const
Definition: HcalCoderDb.cc:16
void HcalCoderDb::adc2fC ( const HcalUpgradeDataFrame df,
CaloSamples lf 
) const
virtual

Implements HcalCoder.

Definition at line 49 of file HcalCoderDb.cc.

References adc2fC_().

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

Definition at line 16 of file HcalCoderDb.cc.

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

Referenced by adc2fC().

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

Implements HcalCoder.

Definition at line 51 of file HcalCoderDb.cc.

References fC2adc_().

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

51 {fC2adc_ (clf, df, fCapIdOffset);}
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:24
void HcalCoderDb::fC2adc ( const CaloSamples clf,
HFDataFrame df,
int  fCapIdOffset 
) const
virtual

Implements HcalCoder.

Definition at line 52 of file HcalCoderDb.cc.

References fC2adc_().

52 {fC2adc_ (clf, df, fCapIdOffset);}
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:24
void HcalCoderDb::fC2adc ( const CaloSamples clf,
HODataFrame df,
int  fCapIdOffset 
) const
virtual

Implements HcalCoder.

Definition at line 53 of file HcalCoderDb.cc.

References fC2adc_().

53 {fC2adc_ (clf, df, fCapIdOffset);}
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:24
void HcalCoderDb::fC2adc ( const CaloSamples clf,
ZDCDataFrame df,
int  fCapIdOffset 
) const
virtual

Implements HcalCoder.

Definition at line 54 of file HcalCoderDb.cc.

References fC2adc_().

54 {fC2adc_ (clf, df, fCapIdOffset);}
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:24
void HcalCoderDb::fC2adc ( const CaloSamples clf,
HcalCalibDataFrame df,
int  fCapIdOffset 
) const
virtual

Implements HcalCoder.

Definition at line 55 of file HcalCoderDb.cc.

References fC2adc_().

55 {fC2adc_ (clf, df, fCapIdOffset);}
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:24
void HcalCoderDb::fC2adc ( const CaloSamples clf,
HcalUpgradeDataFrame df,
int  fCapIdOffset 
) const
virtual

Implements HcalCoder.

Definition at line 56 of file HcalCoderDb.cc.

References fCUpgrade2adc_().

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

Definition at line 24 of file HcalCoderDb.cc.

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

Referenced by fC2adc().

24  {
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 }
int i
Definition: DBlmapReader.cc:9
int presamples() const
access presample information
Definition: CaloSamples.h:36
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:39
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:38
template<class Digi >
void HcalCoderDb::fCUpgrade2adc_ ( const CaloSamples clf,
Digi &  df,
int  fCapIdOffset 
) const
private

Definition at line 34 of file HcalCoderDb.cc.

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

Referenced by fC2adc().

34  {
35  df = HcalUpgradeDataFrame(clf.id(), fCapIdOffset, clf.size(),
36  clf.presamples());
37  for (int i=0; i<clf.size(); ++i) {
38  df.setSample(i, mCoder->adc(*mShape, clf[i], df.capId(i)),
39  0, true);
40  }
41 }
int i
Definition: DBlmapReader.cc:9
int presamples() const
access presample information
Definition: CaloSamples.h:36
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:39
void setSample(int iSample, uint16_t adc, uint16_t tdc, bool dv)
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:38

Member Data Documentation

const HcalQIECoder* HcalCoderDb::mCoder
private

Definition at line 38 of file HcalCoderDb.h.

Referenced by adc2fC_(), fC2adc_(), and fCUpgrade2adc_().

const HcalQIEShape* HcalCoderDb::mShape
private

Definition at line 39 of file HcalCoderDb.h.

Referenced by adc2fC_(), fC2adc_(), and fCUpgrade2adc_().