test
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 adc2fC (const QIE10DataFrame &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
 
virtual void fC2adc (const CaloSamples &clf, QIE10DataFrame &df, int fCapIdOffset) const
 
 HcalCoderDb (const HcalQIECoder &fCoder, const HcalQIEShape &fShape)
 

Private Member Functions

template<>
void adc2fC_ (const QIE10DataFrame &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<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:41
const HcalQIECoder * mCoder
Definition: HcalCoderDb.h:40

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

References adc2fC_().

61 {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 62 of file HcalCoderDb.cc.

References adc2fC_().

62 {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 63 of file HcalCoderDb.cc.

References adc2fC_().

63 {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 64 of file HcalCoderDb.cc.

References adc2fC_().

64 {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 65 of file HcalCoderDb.cc.

References adc2fC_().

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

Implements HcalCoder.

Definition at line 66 of file HcalCoderDb.cc.

References adc2fC_().

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

Definition at line 24 of file HcalCoderDb.cc.

References ecalMGPA::adc(), i, and CaloSamples::setPresamples().

24  {
25  clf=CaloSamples(df.id(),df.samples());
26  for (int i=0; i<df.samples(); i++) {
27  clf[i]=mCoder->charge (*mShape, df[i].adc (), df[i].capid ());
28  if(df[i].soi()) clf.setPresamples(i);
29  }
30 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int samples() const
total number of samples in the digi
int i
Definition: DBlmapReader.cc:9
edm::DataFrame::id_type id() const
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:31
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] -&gt; fC conversion.
Definition: HcalQIECoder.cc:22
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:31
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] -&gt; fC conversion.
Definition: HcalQIECoder.cc:22
void HcalCoderDb::fC2adc ( const CaloSamples clf,
HBHEDataFrame df,
int  fCapIdOffset 
) const
virtual

Implements HcalCoder.

Definition at line 68 of file HcalCoderDb.cc.

References fC2adc_().

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

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

Implements HcalCoder.

Definition at line 69 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 70 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 71 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 72 of file HcalCoderDb.cc.

References fC2adc_().

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

Implements HcalCoder.

Definition at line 73 of file HcalCoderDb.cc.

References fCUpgrade2adc_().

73 {fCUpgrade2adc_ (clf, df, fCapIdOffset);}
void fCUpgrade2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
Definition: HcalCoderDb.cc:42
void HcalCoderDb::fC2adc ( const CaloSamples clf,
QIE10DataFrame df,
int  fCapIdOffset 
) const
virtual

Implements HcalCoder.

Definition at line 74 of file HcalCoderDb.cc.

References fC2adc_().

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

Definition at line 32 of file HcalCoderDb.cc.

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

Referenced by fC2adc().

32  {
33  df = Digi (clf.id ());
34  df.setSize (clf.size ());
35  df.setPresamples (clf.presamples ());
36  for (int i=0; i<clf.size(); i++) {
37  int capId = (fCapIdOffset + i) % 4;
38  df.setSample(i, HcalQIESample(mCoder->adc(*mShape, clf[i], capId), capId, 0, 0));
39  }
40 }
int i
Definition: DBlmapReader.cc:9
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:30
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] -&gt; ADC conversion
Definition: HcalQIECoder.cc:27
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 51 of file HcalCoderDb.cc.

References i.

51  {
52  int presample = clf.presamples ();
53  for (int i=0; i<clf.size(); i++) {
54  int capId = (fCapIdOffset + i) % 4;
55  bool soi = (i==presample);
56  df.setSample(i, mCoder->adc(*mShape, clf[i], capId), 0, 0, capId, soi, true);
57  }
58 }
int i
Definition: DBlmapReader.cc:9
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] -&gt; ADC conversion
Definition: HcalQIECoder.cc:27
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<class Digi >
void HcalCoderDb::fCUpgrade2adc_ ( const CaloSamples clf,
Digi &  df,
int  fCapIdOffset 
) const
private

Definition at line 42 of file HcalCoderDb.cc.

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

Referenced by fC2adc().

42  {
43  df = HcalUpgradeDataFrame(clf.id(), fCapIdOffset, clf.size(),
44  clf.presamples());
45  for (int i=0; i<clf.size(); ++i) {
46  df.setSample(i, mCoder->adc(*mShape, clf[i], df.capId(i)),
47  0, true);
48  }
49 }
int i
Definition: DBlmapReader.cc:9
int presamples() const
access presample information
Definition: CaloSamples.h:36
const HcalQIEShape * mShape
Definition: HcalCoderDb.h:41
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:40

Member Data Documentation

const HcalQIECoder* HcalCoderDb::mCoder
private

Definition at line 40 of file HcalCoderDb.h.

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

const HcalQIEShape* HcalCoderDb::mShape
private

Definition at line 41 of file HcalCoderDb.h.

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