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

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
 
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 () override
 
- 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::HcalFeatureHFEMBit ( double  ShortMinE,
double  LongMinE,
double  ShortLongCutSlope,
double  ShortLongCutOffset,
const HcalDbService conditions 
)

Definition at line 8 of file HcalFeatureHFEMBit.cc.

References LongMinE_, ShortLongCutOffset_, ShortLongCutSlope_, and ShortMinE_.

14  ShortMinE_ = ShortMinE; //minimum energy deposited
15  LongMinE_ = LongMinE;
17  ShortLongCutSlope; // this is a the slope of the cut line related to energy deposited in short fibers vrs long fibers
18  ShortLongCutOffset_ = ShortLongCutOffset; // this is the offset of said line.
19 }
const HcalDbService & conditions_

◆ ~HcalFeatureHFEMBit()

HcalFeatureHFEMBit::~HcalFeatureHFEMBit ( )
override

Definition at line 21 of file HcalFeatureHFEMBit.cc.

21 {}

Member Function Documentation

◆ fineGrainbit() [1/2]

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 35 of file HcalFeatureHFEMBit.cc.

References getE(), heavyIonCSV_trainingSettings::idx, LongMinE_, ShortLongCutOffset_, ShortLongCutSlope_, and ShortMinE_.

43  {
44  float shortE = 0;
45  if (validShort1)
46  shortE += getE(short1, idx);
47  if (validShort2)
48  shortE += getE(short2, idx);
49  if (validShort1 and validShort2)
50  shortE *= .5;
51 
52  float longE = 0;
53  if (validLong1)
54  longE += getE(long1, idx);
55  if (validLong2)
56  longE += getE(long2, idx);
57  if (validLong1 and validLong2)
58  longE *= .5;
59 
60  if (shortE < ShortMinE_)
61  return false;
62  if (longE < LongMinE_)
63  return false;
64 
65  return (shortE < (longE - ShortLongCutOffset_) * ShortLongCutSlope_);
66 }
float getE(const T &f, int idx) const

◆ fineGrainbit() [2/2]

bool HcalFeatureHFEMBit::fineGrainbit ( const HFDataFrame shortDigi,
const HFDataFrame longDigi,
int  idx 
) const
overridevirtual

Implements HcalFeatureBit.

Definition at line 23 of file HcalFeatureHFEMBit.cc.

References getE(), heavyIonCSV_trainingSettings::idx, LongMinE_, ShortLongCutOffset_, ShortLongCutSlope_, and ShortMinE_.

23  {
24  float shortE = getE(shortDigi, idx);
25  float longE = getE(longDigi, idx);
26 
27  if (shortE < ShortMinE_)
28  return false;
29  if (longE < LongMinE_)
30  return false;
31 
32  return (shortE < (longE - ShortLongCutOffset_) * ShortLongCutSlope_);
33 }
float getE(const T &f, int idx) const

◆ getE()

template<typename T >
float HcalFeatureHFEMBit::getE ( const T f,
int  idx 
) const
private

Definition at line 38 of file HcalFeatureHFEMBit.h.

References AlignmentProducer_cff::calibrations, conditions_, alignCSCRings::corr, dqmiodatasetharvest::db, f, HcalDbService::getHcalCalibrations(), HcalDbService::getHcalCoder(), HcalDbService::getHcalShape(), l1ctLayer2EG_cff::id, heavyIonCSV_trainingSettings::idx, EgammaValidation_cff::samples, and l1trig_cff::shape.

Referenced by fineGrainbit().

38  {
39  const HcalDetId id(f.id());
41  const auto* coder = conditions_.getHcalCoder(id);
42  const auto* shape = conditions_.getHcalShape(coder);
43 
44  HcalCoderDb db(*coder, *shape);
46  db.adc2fC(f, samples);
47 
48  auto ped = calibrations.effpedestal(f[idx].capid());
49  auto corr = calibrations.respcorrgain(f[idx].capid());
50 
51  return (samples[idx] - ped) * corr;
52 }
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
dictionary corr
const HcalDbService & conditions_
double f[11][100]
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const

Member Data Documentation

◆ conditions_

const HcalDbService& HcalFeatureHFEMBit::conditions_
private

Definition at line 34 of file HcalFeatureHFEMBit.h.

Referenced by getE().

◆ LongMinE_

double HcalFeatureHFEMBit::LongMinE_
private

Definition at line 33 of file HcalFeatureHFEMBit.h.

Referenced by fineGrainbit(), and HcalFeatureHFEMBit().

◆ ShortLongCutOffset_

double HcalFeatureHFEMBit::ShortLongCutOffset_
private

Definition at line 33 of file HcalFeatureHFEMBit.h.

Referenced by fineGrainbit(), and HcalFeatureHFEMBit().

◆ ShortLongCutSlope_

double HcalFeatureHFEMBit::ShortLongCutSlope_
private

Definition at line 33 of file HcalFeatureHFEMBit.h.

Referenced by fineGrainbit(), and HcalFeatureHFEMBit().

◆ ShortMinE_

double HcalFeatureHFEMBit::ShortMinE_
private

Definition at line 33 of file HcalFeatureHFEMBit.h.

Referenced by fineGrainbit(), and HcalFeatureHFEMBit().