CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HcalFeatureHFEMBit Class Reference

#include <HcalFeatureHFEMBit.h>

Inheritance diagram for HcalFeatureHFEMBit:
HcalFeatureBit

Public Member Functions

virtual bool fineGrainbit (const QIE10DataFrame &short1, const QIE10DataFrame &short2, const QIE10DataFrame &long1, const QIE10DataFrame &long2, bool validShort1, bool validShort2, bool validLong1, bool validLong2, int idx) const override
 
virtual bool fineGrainbit (const HFDataFrame &shortDigi, const HFDataFrame &longDigi, int idx) const override
 
 HcalFeatureHFEMBit (double ShortMinE, double LongMinE, double ShortLongCutSlope, double ShortLongCutOffset, const HcalDbService &conditions)
 
 ~HcalFeatureHFEMBit ()
 
- Public Member Functions inherited from HcalFeatureBit
 HcalFeatureBit ()
 
virtual ~HcalFeatureBit ()
 

Private Member Functions

template<typename T >
float getE (const T &f, int idx) const
 

Private Attributes

const HcalDbServiceconditions_
 
double LongMinE_
 
double ShortLongCutOffset_
 
double ShortLongCutSlope_
 
double ShortMinE_
 

Detailed Description

Definition at line 8 of file HcalFeatureHFEMBit.h.

Constructor & Destructor Documentation

HcalFeatureHFEMBit::HcalFeatureHFEMBit ( double  ShortMinE,
double  LongMinE,
double  ShortLongCutSlope,
double  ShortLongCutOffset,
const HcalDbService conditions 
)

Definition at line 9 of file HcalFeatureHFEMBit.cc.

References LongMinE_, ShortLongCutOffset_, ShortLongCutSlope_, and ShortMinE_.

10  : conditions_(conditions)
11 {
12  ShortMinE_ = ShortMinE; //minimum energy deposited
13  LongMinE_ = LongMinE;
14  ShortLongCutSlope_ = ShortLongCutSlope; // this is a the slope of the cut line related to energy deposited in short fibers vrs long fibers
15  ShortLongCutOffset_ = ShortLongCutOffset; // this is the offset of said line.
16 
17 
18 
19 }
const HcalDbService & conditions_
HcalFeatureHFEMBit::~HcalFeatureHFEMBit ( )

Definition at line 21 of file HcalFeatureHFEMBit.cc.

21 { }

Member Function Documentation

bool HcalFeatureHFEMBit::fineGrainbit ( const QIE10DataFrame short1,
const QIE10DataFrame short2,
const QIE10DataFrame long1,
const QIE10DataFrame long2,
bool  validShort1,
bool  validShort2,
bool  validLong1,
bool  validLong2,
int  idx 
) const
overridevirtual

Implements HcalFeatureBit.

Definition at line 40 of file HcalFeatureHFEMBit.cc.

References getE(), LongMinE_, ShortLongCutOffset_, ShortLongCutSlope_, and ShortMinE_.

50 {
51  float shortE = 0;
52  if (validShort1)
53  shortE += getE(short1, idx);
54  if (validShort2)
55  shortE += getE(short2, idx);
56  if (validShort1 and validShort2)
57  shortE *= .5;
58 
59  float longE = 0;
60  if (validLong1)
61  longE += getE(long1, idx);
62  if (validLong2)
63  longE += getE(long2, idx);
64  if (validLong1 and validLong2)
65  longE *= .5;
66 
67  if (shortE < ShortMinE_)
68  return false;
69  if (longE < LongMinE_)
70  return false;
71 
72  return (shortE < (longE - ShortLongCutOffset_) * ShortLongCutSlope_);
73 }
float getE(const T &f, int idx) const
bool HcalFeatureHFEMBit::fineGrainbit ( const HFDataFrame shortDigi,
const HFDataFrame longDigi,
int  idx 
) const
overridevirtual

Implements HcalFeatureBit.

Definition at line 24 of file HcalFeatureHFEMBit.cc.

References getE(), LongMinE_, ShortLongCutOffset_, ShortLongCutSlope_, and ShortMinE_.

28 {
29  float shortE = getE(shortDigi, idx);
30  float longE = getE(longDigi, idx);
31 
32  if (shortE < ShortMinE_)
33  return false;
34  if (longE < LongMinE_)
35  return false;
36 
37  return (shortE < (longE - ShortLongCutOffset_) * ShortLongCutSlope_);
38 }
float getE(const T &f, int idx) const
template<typename T >
float HcalFeatureHFEMBit::getE ( const T f,
int  idx 
) const
private

Definition at line 38 of file HcalFeatureHFEMBit.h.

References HcalCoderDb::adc2fC(), AlignmentProducer_cff::calibrations, conditions_, corr, HcalDbService::getHcalCalibrations(), HcalDbService::getHcalCoder(), HcalDbService::getHcalShape(), hcalTTPDigis_cfi::id, and hcalTTPDigis_cfi::samples.

Referenced by fineGrainbit().

39 {
40  const HcalDetId id(f.id());
42  const auto* coder = conditions_.getHcalCoder(id);
43  const auto* shape = conditions_.getHcalShape(coder);
44 
45  HcalCoderDb db(*coder, *shape);
47  db.adc2fC(f, samples);
48 
49  auto ped = calibrations.pedestal(f[idx].capid());
50  auto corr = calibrations.respcorrgain(f[idx].capid());
51 
52  return (samples[idx] - ped) * corr;
53 }
const HcalDbService & conditions_
double f[11][100]
JetCorrectorParameters corr
Definition: classes.h:5
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const

Member Data Documentation

const HcalDbService& HcalFeatureHFEMBit::conditions_
private

Definition at line 33 of file HcalFeatureHFEMBit.h.

Referenced by getE().

double HcalFeatureHFEMBit::LongMinE_
private

Definition at line 32 of file HcalFeatureHFEMBit.h.

Referenced by fineGrainbit(), and HcalFeatureHFEMBit().

double HcalFeatureHFEMBit::ShortLongCutOffset_
private

Definition at line 32 of file HcalFeatureHFEMBit.h.

Referenced by fineGrainbit(), and HcalFeatureHFEMBit().

double HcalFeatureHFEMBit::ShortLongCutSlope_
private

Definition at line 32 of file HcalFeatureHFEMBit.h.

Referenced by fineGrainbit(), and HcalFeatureHFEMBit().

double HcalFeatureHFEMBit::ShortMinE_
private

Definition at line 32 of file HcalFeatureHFEMBit.h.

Referenced by fineGrainbit(), and HcalFeatureHFEMBit().