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
CastorCoderDb Class Reference

#include <CastorCoderDb.h>

Inheritance diagram for CastorCoderDb:
CastorCoder

Public Member Functions

virtual void adc2fC (const CastorDataFrame &df, CaloSamples &lf) const
 
 CastorCoderDb (const CastorQIECoder &fCoder, const CastorQIEShape &fShape)
 
virtual void fC2adc (const CaloSamples &clf, CastorDataFrame &df, int fCapIdOffset) const
 

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
 

Private Attributes

const CastorQIECodermCoder
 
const CastorQIEShapemShape
 

Detailed Description

coder which uses DB services to convert to fC

Definition at line 16 of file CastorCoderDb.h.

Constructor & Destructor Documentation

CastorCoderDb::CastorCoderDb ( const CastorQIECoder fCoder,
const CastorQIEShape fShape 
)

Definition at line 11 of file CastorCoderDB.cc.

12  : mCoder (&fCoder),
13  mShape (&fShape)
14 {}
const CastorQIEShape * mShape
Definition: CastorCoderDb.h:29
const CastorQIECoder * mCoder
Definition: CastorCoderDb.h:28

Member Function Documentation

void CastorCoderDb::adc2fC ( const CastorDataFrame df,
CaloSamples lf 
) const
virtual

Implements CastorCoder.

Definition at line 34 of file CastorCoderDB.cc.

References adc2fC_().

Referenced by CastorTTRecord::getEnergy_fC().

34 {adc2fC_ (df, lf);}
void adc2fC_(const Digi &df, CaloSamples &clf) const
template<class Digi >
void CastorCoderDb::adc2fC_ ( const Digi &  df,
CaloSamples clf 
) const
private

Definition at line 16 of file CastorCoderDB.cc.

References ecalMGPA::adc(), CastorQIECoder::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
const CastorQIEShape * mShape
Definition: CastorCoderDb.h:29
float charge(const CastorQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -&gt; fC conversion.
void setPresamples(int pre)
set presample information
Definition: CaloSamples.cc:31
const CastorQIECoder * mCoder
Definition: CastorCoderDb.h:28
void CastorCoderDb::fC2adc ( const CaloSamples clf,
CastorDataFrame df,
int  fCapIdOffset 
) const
virtual

Implements CastorCoder.

Definition at line 36 of file CastorCoderDB.cc.

References fC2adc_().

36 {fC2adc_ (clf, df, fCapIdOffset);}
void fC2adc_(const CaloSamples &clf, Digi &df, int fCapIdOffset) const
template<class Digi >
void CastorCoderDb::fC2adc_ ( const CaloSamples clf,
Digi &  df,
int  fCapIdOffset 
) const
private

Definition at line 24 of file CastorCoderDB.cc.

References CastorQIECoder::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
std::tuple< unsigned int, int, int, DigiType, int, int, int, float > Digi
Definition: GenericDigi.h:30
const CastorQIEShape * mShape
Definition: CastorCoderDb.h:29
const CastorQIECoder * mCoder
Definition: CastorCoderDb.h:28
int size() const
get the size
Definition: CaloSamples.h:24
DetId id() const
get the (generic) id
Definition: CaloSamples.h:21
unsigned adc(const CastorQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -&gt; ADC conversion

Member Data Documentation

const CastorQIECoder* CastorCoderDb::mCoder
private

Definition at line 28 of file CastorCoderDb.h.

Referenced by adc2fC_(), and fC2adc_().

const CastorQIEShape* CastorCoderDb::mShape
private

Definition at line 29 of file CastorCoderDb.h.

Referenced by adc2fC_(), and fC2adc_().