CMS 3D CMS Logo

HcalNoiseHPD.cc
Go to the documentation of this file.
1 //
2 // HcalNoiseHPD.cc
3 //
4 // description: container class of HPD information for analyzing HCAL Noise
5 //
6 // author: J.P. Chou, Brown
7 //
8 //
9 
11 
12 using namespace reco;
13 
14 // default constructor
16  : idnumber_(0),
17  totalZeros_(0),
18  maxZeros_(0),
19  bigCharge_(HBHEDataFrame::MAXSAMPLES, 0.0),
20  big5Charge_(HBHEDataFrame::MAXSAMPLES, 0.0) {
21  // reserve some space, so that there's no reallocation issues
22  rechits_.reserve(19);
23  calotowers_.reserve(19);
24 }
25 
26 // destructor
28 
29 // accessors
30 int HcalNoiseHPD::idnumber(void) const { return idnumber_; }
31 
32 const std::vector<float> HcalNoiseHPD::bigCharge(void) const { return bigCharge_; }
33 
34 float HcalNoiseHPD::bigChargeTotal(void) const {
35  float total = 0;
36  for (unsigned int i = 0; i < bigCharge_.size(); i++) {
37  total += bigCharge_[i];
38  }
39  return total;
40 }
41 
42 float HcalNoiseHPD::bigChargeHighest2TS(unsigned int firstts) const {
43  float total = 0;
44  for (unsigned int i = firstts; i < firstts + 2 && i < bigCharge_.size(); i++)
45  total += bigCharge_[i];
46  return total;
47 }
48 
49 float HcalNoiseHPD::bigChargeHighest3TS(unsigned int firstts) const {
50  float total = 0;
51  for (unsigned int i = firstts; i < firstts + 3 && i < bigCharge_.size(); i++)
52  total += bigCharge_[i];
53  return total;
54 }
55 
56 const std::vector<float> HcalNoiseHPD::big5Charge(void) const { return big5Charge_; }
57 
58 float HcalNoiseHPD::big5ChargeTotal(void) const {
59  float total = 0;
60  for (unsigned int i = 0; i < big5Charge_.size(); i++) {
61  total += big5Charge_[i];
62  }
63  return total;
64 }
65 
66 float HcalNoiseHPD::big5ChargeHighest2TS(unsigned int firstts) const {
67  float total = 0;
68  for (unsigned int i = firstts; i < firstts + 2 && i < big5Charge_.size(); i++)
69  total += big5Charge_[i];
70  return total;
71 }
72 
73 float HcalNoiseHPD::big5ChargeHighest3TS(unsigned int firstts) const {
74  float total = 0;
75  for (unsigned int i = firstts; i < firstts + 2 && i < big5Charge_.size(); i++)
76  total += big5Charge_[i];
77  return total;
78 }
79 
80 int HcalNoiseHPD::totalZeros(void) const { return totalZeros_; }
81 
82 int HcalNoiseHPD::maxZeros(void) const { return maxZeros_; }
83 
85 
86 float HcalNoiseHPD::recHitEnergy(const float threshold) const {
87  double total = 0.0;
88  for (edm::RefVector<HBHERecHitCollection>::const_iterator it = rechits_.begin(); it != rechits_.end(); ++it) {
89  const float energy = (*it)->eraw();
90  if (energy >= threshold)
91  total += energy;
92  }
93  return total;
94 }
95 
96 float HcalNoiseHPD::recHitEnergyFailR45(const float threshold) const {
97  double total = 0.0;
98  for (edm::RefVector<HBHERecHitCollection>::const_iterator it = rechits_.begin(); it != rechits_.end(); ++it) {
99  const float energy = (*it)->eraw();
100  if ((*it)->flagField(HcalCaloFlagLabels::HBHETS4TS5Noise) && !(*it)->flagField(HcalCaloFlagLabels::HBHEOOTPU))
101  if (energy >= threshold)
102  total += energy;
103  }
104  return total;
105 }
106 
107 float HcalNoiseHPD::minRecHitTime(const float threshold) const {
108  float mintime = 9999999;
109  for (edm::RefVector<HBHERecHitCollection>::const_iterator it = rechits_.begin(); it != rechits_.end(); ++it) {
110  if ((*it)->energy() < threshold)
111  continue;
112  float time = (*it)->time();
113  if (mintime > time)
114  mintime = time;
115  }
116  return mintime;
117 }
118 
119 float HcalNoiseHPD::maxRecHitTime(const float threshold) const {
120  float maxtime = -9999999;
121  for (edm::RefVector<HBHERecHitCollection>::const_iterator it = rechits_.begin(); it != rechits_.end(); ++it) {
122  if ((*it)->energy() < threshold)
123  continue;
124  float time = (*it)->time();
125  if (maxtime < time)
126  maxtime = time;
127  }
128  return maxtime;
129 }
130 
131 int HcalNoiseHPD::numRecHits(const float threshold) const {
132  int count = 0;
133  for (edm::RefVector<HBHERecHitCollection>::const_iterator it = rechits_.begin(); it != rechits_.end(); ++it) {
134  // Exclude uncollapsed QIE11 channels
137  continue;
138  if ((*it)->eraw() >= threshold)
139  ++count;
140  }
141  return count;
142 }
143 
145  int count = 0;
146  for (edm::RefVector<HBHERecHitCollection>::const_iterator it = rechits_.begin(); it != rechits_.end(); ++it)
147  if ((*it)->flagField(HcalCaloFlagLabels::HBHETS4TS5Noise) && !(*it)->flagField(HcalCaloFlagLabels::HBHEOOTPU))
148  if ((*it)->eraw() >= threshold)
149  ++count;
150  return count;
151 }
152 
154 
155 double HcalNoiseHPD::caloTowerHadE(void) const {
156  double total = 0;
158  total += (*it)->hadEnergy();
159  return total;
160 }
161 
162 double HcalNoiseHPD::caloTowerEmE(void) const {
163  double total = 0;
165  total += (*it)->emEnergy();
166  return total;
167 }
168 
169 double HcalNoiseHPD::caloTowerTotalE(void) const {
170  double total = 0;
172  total += (*it)->emEnergy() + (*it)->hadEnergy();
173  return total;
174 }
175 
177  double h = 0, e = 0;
178  for (edm::RefVector<CaloTowerCollection>::const_iterator it = calotowers_.begin(); it != calotowers_.end(); ++it) {
179  e += (*it)->emEnergy();
180  h += (*it)->hadEnergy();
181  }
182  return (e + h) != 0 ? e / (e + h) : 999.;
183 }
reco::HcalNoiseHPD::HcalNoiseHPD
HcalNoiseHPD()
Definition: HcalNoiseHPD.cc:15
HcalCaloFlagLabels::HBHETS4TS5Noise
Definition: HcalCaloFlagLabels.h:25
HBHERecHitAuxSetter::OFF_COMBINED
static const unsigned OFF_COMBINED
Definition: HBHERecHitAuxSetter.h:41
mps_fire.i
i
Definition: mps_fire.py:428
reco::HcalNoiseHPD::calotowers_
edm::RefVector< CaloTowerCollection > calotowers_
Definition: HcalNoiseHPD.h:148
CastorTowerReco_cfi.mintime
mintime
Definition: CastorTowerReco_cfi.py:7
reco::HcalNoiseHPD::caloTowerEmFraction
double caloTowerEmFraction(void) const
Definition: HcalNoiseHPD.cc:176
reco::HcalNoiseHPD::idnumber_
int idnumber_
Definition: HcalNoiseHPD.h:132
reco::HcalNoiseHPD::maxRecHitTime
float maxRecHitTime(float threshold=10.0) const
Definition: HcalNoiseHPD.cc:119
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
reco::HcalNoiseHPD::minRecHitTime
float minRecHitTime(float threshold=10.0) const
Definition: HcalNoiseHPD.cc:107
protons_cff.time
time
Definition: protons_cff.py:39
reco::HcalNoiseHPD::recHits
const edm::RefVector< HBHERecHitCollection > recHits(void) const
Definition: HcalNoiseHPD.cc:84
HcalNoiseHPD.h
HBHERecHitAuxSetter::OFF_TDC_TIME
static const unsigned OFF_TDC_TIME
Definition: HBHERecHitAuxSetter.h:35
reco::HcalNoiseHPD::big5ChargeHighest3TS
float big5ChargeHighest3TS(unsigned int firstts=4) const
Definition: HcalNoiseHPD.cc:73
edm::RefVector
Definition: EDProductfwd.h:27
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
CastorTowerReco_cfi.maxtime
maxtime
Definition: CastorTowerReco_cfi.py:8
reco::HcalNoiseHPD::recHitEnergyFailR45
float recHitEnergyFailR45(float threshold=1.5) const
Definition: HcalNoiseHPD.cc:96
reco::HcalNoiseHPD::bigChargeHighest2TS
float bigChargeHighest2TS(unsigned int firstts=4) const
Definition: HcalNoiseHPD.cc:42
h
reco::HcalNoiseHPD::caloTowerTotalE
double caloTowerTotalE(void) const
Definition: HcalNoiseHPD.cc:169
reco::HcalNoiseHPD::maxZeros_
int maxZeros_
Definition: HcalNoiseHPD.h:136
reco::HcalNoiseHPD::caloTowers
const edm::RefVector< CaloTowerCollection > caloTowers(void) const
Definition: HcalNoiseHPD.cc:153
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
reco::HcalNoiseHPD::big5Charge_
std::vector< float > big5Charge_
Definition: HcalNoiseHPD.h:138
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
HcalCaloFlagLabels::HBHEOOTPU
Definition: HcalCaloFlagLabels.h:28
reco::HcalNoiseHPD::totalZeros_
int totalZeros_
Definition: HcalNoiseHPD.h:135
reco::HcalNoiseHPD::numRecHits
int numRecHits(float threshold=1.5) const
Definition: HcalNoiseHPD.cc:131
HBHEDataFrame
Definition: HBHEDataFrame.h:14
reco::HcalNoiseHPD::big5ChargeTotal
float big5ChargeTotal(void) const
Definition: HcalNoiseHPD.cc:58
reco::HcalNoiseHPD::caloTowerEmE
double caloTowerEmE(void) const
Definition: HcalNoiseHPD.cc:162
reco::HcalNoiseHPD::big5Charge
const std::vector< float > big5Charge(void) const
Definition: HcalNoiseHPD.cc:56
reco::HcalNoiseHPD::maxZeros
int maxZeros(void) const
Definition: HcalNoiseHPD.cc:82
reco::HcalNoiseHPD::big5ChargeHighest2TS
float big5ChargeHighest2TS(unsigned int firstts=4) const
Definition: HcalNoiseHPD.cc:66
reco::HcalNoiseHPD::totalZeros
int totalZeros(void) const
Definition: HcalNoiseHPD.cc:80
CaloRecHitAuxSetter::getBit
constexpr bool getBit(const uint32_t u, const unsigned bitnum)
Definition: CaloRecHitAuxSetter.h:37
reco::HcalNoiseHPD::rechits_
edm::RefVector< HBHERecHitCollection > rechits_
Definition: HcalNoiseHPD.h:141
reco::HcalNoiseHPD::bigChargeTotal
float bigChargeTotal(void) const
Definition: HcalNoiseHPD.cc:34
reco::HcalNoiseHPD::recHitEnergy
float recHitEnergy(float threshold=1.5) const
Definition: HcalNoiseHPD.cc:86
reco::HcalNoiseHPD::bigChargeHighest3TS
float bigChargeHighest3TS(unsigned int firstts=4) const
Definition: HcalNoiseHPD.cc:49
reco::HcalNoiseHPD::~HcalNoiseHPD
virtual ~HcalNoiseHPD()
Definition: HcalNoiseHPD.cc:27
reco::HcalNoiseHPD::bigCharge
const std::vector< float > bigCharge(void) const
Definition: HcalNoiseHPD.cc:32
edm::RefVectorIterator
Definition: EDProductfwd.h:33
reco::HcalNoiseHPD::bigCharge_
std::vector< float > bigCharge_
Definition: HcalNoiseHPD.h:137
dqmMemoryStats.total
total
Definition: dqmMemoryStats.py:152
reco::HcalNoiseHPD::idnumber
int idnumber(void) const
Definition: HcalNoiseHPD.cc:30
reco::HcalNoiseHPD::caloTowerHadE
double caloTowerHadE(void) const
Definition: HcalNoiseHPD.cc:155
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430
reco::HcalNoiseHPD::numRecHitsFailR45
int numRecHitsFailR45(float threshold=1.5) const
Definition: HcalNoiseHPD.cc:144
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37