CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 ( 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_.

13  : conditions_(conditions) {
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 ( )
override

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

References getE(), 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
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(), 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
template<typename T >
float HcalFeatureHFEMBit::getE ( const T f,
int  idx 
) const
private

Definition at line 38 of file HcalFeatureHFEMBit.h.

References HcalCoderDb::adc2fC(), conditions_, alignCSCRings::corr, EcalCondDB::db, HcalDbService::getHcalCalibrations(), HcalDbService::getHcalCoder(), HcalDbService::getHcalShape(), and gpuClustering::id.

Referenced by fineGrainbit().

38  {
39  const HcalDetId id(f.id());
40  const HcalCalibrations& calibrations = conditions_.getHcalCalibrations(id);
41  const auto* coder = conditions_.getHcalCoder(id);
42  const auto* shape = conditions_.getHcalShape(coder);
43 
44  HcalCoderDb db(*coder, *shape);
45  CaloSamples samples;
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 }
uint16_t *__restrict__ id
tuple db
Definition: EcalCondDB.py:153
const HcalDbService & conditions_
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 34 of file HcalFeatureHFEMBit.h.

Referenced by getE().

double HcalFeatureHFEMBit::LongMinE_
private

Definition at line 33 of file HcalFeatureHFEMBit.h.

Referenced by fineGrainbit(), and HcalFeatureHFEMBit().

double HcalFeatureHFEMBit::ShortLongCutOffset_
private

Definition at line 33 of file HcalFeatureHFEMBit.h.

Referenced by fineGrainbit(), and HcalFeatureHFEMBit().

double HcalFeatureHFEMBit::ShortLongCutSlope_
private

Definition at line 33 of file HcalFeatureHFEMBit.h.

Referenced by fineGrainbit(), and HcalFeatureHFEMBit().

double HcalFeatureHFEMBit::ShortMinE_
private

Definition at line 33 of file HcalFeatureHFEMBit.h.

Referenced by fineGrainbit(), and HcalFeatureHFEMBit().