CMS 3D CMS Logo

HcalFeatureHFEMBit.cc
Go to the documentation of this file.
1 
2 //HcalFeatureHFEMBit
3 //version 2.0
4 
7 
8 
9 HcalFeatureHFEMBit::HcalFeatureHFEMBit(double ShortMinE, double LongMinE,
10  double ShortLongCutSlope, double ShortLongCutOffset, const HcalDbService& conditions) : 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 }
20 
22 
23 bool
25  const HFDataFrame& shortDigi,
26  const HFDataFrame& longDigi,
27  int idx) const
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 }
39 
41  const QIE10DataFrame& short1,
42  const QIE10DataFrame& short2,
43  const QIE10DataFrame& long1,
44  const QIE10DataFrame& long2,
45  bool validShort1,
46  bool validShort2,
47  bool validLong1,
48  bool validLong2,
49  int idx) const
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
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
HcalFeatureHFEMBit(double ShortMinE, double LongMinE, double ShortLongCutSlope, double ShortLongCutOffset, const HcalDbService &conditions)