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 Attributes
HcalFeatureHFEMBit Class Reference

#include <HcalFeatureHFEMBit.h>

Inheritance diagram for HcalFeatureHFEMBit:
HcalFeatureBit

Public Member Functions

virtual bool fineGrainbit (int ADCShort, HcalDetId Sid, int CapIdS, int ADCLong, HcalDetId Lid, int CapIdL) const
 
 HcalFeatureHFEMBit (double ShortMinE, double LongMinE, double ShortLongCutSlope, double ShortLongCutOffset, const HcalDbService &conditions)
 
 ~HcalFeatureHFEMBit ()
 
- Public Member Functions inherited from HcalFeatureBit
 HcalFeatureBit ()
 
virtual ~HcalFeatureBit ()
 

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

References LongMinE_, ShortLongCutOffset_, ShortLongCutSlope_, and ShortMinE_.

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

Definition at line 22 of file HcalFeatureHFEMBit.cc.

22 { }

Member Function Documentation

bool HcalFeatureHFEMBit::fineGrainbit ( int  ADCShort,
HcalDetId  Sid,
int  CapIdS,
int  ADCLong,
HcalDetId  Lid,
int  CapIdL 
) const
virtual

Reimplemented from HcalFeatureBit.

Definition at line 24 of file HcalFeatureHFEMBit.cc.

References HcalCoderDb::adc2fC(), HcalCalibrations::pedestal(), HcalCalibrations::respcorrgain(), HFDataFrame::setSample(), and HFDataFrame::setSize().

25 {
26 
27  float ShortE = 0; //holds deposited energy
28  float LongE = 0;
29 
30 
31  HcalQIESample sQIESample(ADCShort, CapIdS, 1, 1);
32  //makes a QIE sample for the short fiber.
33  HFDataFrame shortf(Sid);
34  shortf.setSize(1); //not planning on there being anything else here at this point in time so setting the size to 1 shouldn't matter
35  shortf.setSample(0, sQIESample); //inputs data into digi.
36  const HcalCalibrations& calibrations = conditions_.getHcalCalibrations(Sid);
37  const HcalQIECoder* channelCoderS = conditions_.getHcalCoder(Sid);
38  const HcalQIEShape* shapeS = conditions_.getHcalShape(channelCoderS);
39 
40  HcalCoderDb coders(*channelCoderS, *shapeS);
41 
42  CaloSamples tools;
43  coders.adc2fC(shortf, tools);
44  ShortE = (tools[0] - calibrations.pedestal(CapIdS)) * calibrations.respcorrgain(CapIdS);
45 
46  HcalQIESample lQIESample(ADCLong, CapIdL, 1, 1);
47  HFDataFrame longf(Lid);
48  longf.setSize(1);
49  longf.setSample(0, lQIESample);
50  const HcalCalibrations& calibrationL = conditions_.getHcalCalibrations(Lid);
51 
52  CaloSamples tool_l;
53 
54  const HcalQIECoder* channelCoderL = conditions_.getHcalCoder(Lid);
55  const HcalQIEShape* shapeL = conditions_.getHcalShape(channelCoderL);
56 
57  HcalCoderDb coderL(*channelCoderL, *shapeL);
58 
59  coderL.adc2fC(longf, tool_l); // this fills tool_l[0] with linearized adc
60  LongE = (tool_l[0] - calibrationL.pedestal(CapIdL)) * calibrationL.respcorrgain(CapIdL);
61 
62 
63  // this actually does the cut
64  if((ShortE < ((LongE)-(ShortLongCutOffset_)) * ShortLongCutSlope_) && LongE > LongMinE_ && ShortE > ShortMinE_) return true;
65  else return false;
66 }
double respcorrgain(int fCapId) const
get response corrected gain for capid=0..3
double pedestal(int fCapId) const
get pedestal for capid=0..3
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 16 of file HcalFeatureHFEMBit.h.

double HcalFeatureHFEMBit::LongMinE_
private

Definition at line 15 of file HcalFeatureHFEMBit.h.

Referenced by HcalFeatureHFEMBit().

double HcalFeatureHFEMBit::ShortLongCutOffset_
private

Definition at line 15 of file HcalFeatureHFEMBit.h.

Referenced by HcalFeatureHFEMBit().

double HcalFeatureHFEMBit::ShortLongCutSlope_
private

Definition at line 15 of file HcalFeatureHFEMBit.h.

Referenced by HcalFeatureHFEMBit().

double HcalFeatureHFEMBit::ShortMinE_
private

Definition at line 15 of file HcalFeatureHFEMBit.h.

Referenced by HcalFeatureHFEMBit().