CMS 3D CMS Logo

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

void adc2fC (const CastorDataFrame &df, CaloSamples &lf) const override
 
 CastorCoderDb (const CastorQIECoder &fCoder, const CastorQIEShape &fShape)
 
void fC2adc (const CaloSamples &clf, CastorDataFrame &df, int fCapIdOffset) const override
 
- Public Member Functions inherited from CastorCoder
virtual ~CastorCoder ()=default
 

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::CastorCoderDb ( const CastorQIECoder fCoder,
const CastorQIEShape fShape 
)

Definition at line 11 of file CastorCoderDB.cc.

12  : mCoder(&fCoder), mShape(&fShape) {}

Member Function Documentation

◆ adc2fC()

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

Implements CastorCoder.

Definition at line 34 of file CastorCoderDB.cc.

34 { adc2fC_(df, lf); }

References adc2fC_(), and hgcalPerformanceValidation::df.

Referenced by CastorTTRecord::getEnergy_fC().

◆ adc2fC_()

template<class Digi >
void CastorCoderDb::adc2fC_ ( const Digi &  df,
CaloSamples clf 
) const
private

Definition at line 15 of file CastorCoderDB.cc.

15  {
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 }

References gpuClustering::adc, CastorQIECoder::charge(), hgcalPerformanceValidation::df, mps_fire::i, mCoder, mShape, and CaloSamples::setPresamples().

Referenced by adc2fC().

◆ fC2adc()

void CastorCoderDb::fC2adc ( const CaloSamples clf,
CastorDataFrame df,
int  fCapIdOffset 
) const
overridevirtual

Implements CastorCoder.

Definition at line 36 of file CastorCoderDB.cc.

36  {
37  fC2adc_(clf, df, fCapIdOffset);
38 }

References hgcalPerformanceValidation::df, and fC2adc_().

◆ fC2adc_()

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

Definition at line 24 of file CastorCoderDB.cc.

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 }

References CastorQIECoder::adc(), hgcalPerformanceValidation::df, TrendClient_cfi::Digi, mps_fire::i, CaloSamples::id(), mCoder, mShape, CaloSamples::presamples(), and CaloSamples::size().

Referenced by fC2adc().

Member Data Documentation

◆ mCoder

const CastorQIECoder* CastorCoderDb::mCoder
private

Definition at line 30 of file CastorCoderDb.h.

Referenced by adc2fC_(), and fC2adc_().

◆ mShape

const CastorQIEShape* CastorCoderDb::mShape
private

Definition at line 31 of file CastorCoderDb.h.

Referenced by adc2fC_(), and fC2adc_().

mps_fire.i
i
Definition: mps_fire.py:428
CaloSamples::size
int size() const
get the size
Definition: CaloSamples.h:24
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
TrendClient_cfi.Digi
Digi
Definition: TrendClient_cfi.py:7
HcalQIESample
Definition: HcalQIESample.h:32
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
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
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
hgcalPerformanceValidation.df
df
Definition: hgcalPerformanceValidation.py:733
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