CMS 3D CMS Logo

HcalNoiseRBX.cc
Go to the documentation of this file.
1 //
2 // HcalNoiseRBX.cc
3 //
4 // description: container class of RBX information for studying the HCAL Noise
5 //
6 // author: J.P. Chou, Brown
7 //
8 //
9 
11 
12 using namespace reco;
13 
14 // default constructor
15 HcalNoiseRBX::HcalNoiseRBX() : idnumber_(0), hpds_(4), allCharge_(HBHEDataFrame::MAXSAMPLES, 0.0) {}
16 
17 // destructor
19 
20 // accessors
21 int HcalNoiseRBX::idnumber(void) const { return idnumber_; }
22 
23 const std::vector<HcalNoiseHPD> HcalNoiseRBX::HPDs(void) const { return hpds_; }
24 
25 std::vector<HcalNoiseHPD>::const_iterator HcalNoiseRBX::maxHPD(double threshold) const {
26  std::vector<HcalNoiseHPD>::const_iterator maxit = hpds_.end();
27  double maxenergy = -99999999.;
28  for (std::vector<HcalNoiseHPD>::const_iterator it = hpds_.begin(); it != hpds_.end(); ++it) {
29  double tempenergy = it->recHitEnergy();
30  if (tempenergy > maxenergy) {
31  maxenergy = tempenergy;
32  maxit = it;
33  }
34  }
35  return maxit;
36 }
37 
38 const std::vector<float> HcalNoiseRBX::allCharge(void) const { return allCharge_; }
39 
40 float HcalNoiseRBX::allChargeTotal(void) const {
41  float total = 0;
42  for (unsigned int i = 0; i < allCharge_.size(); i++)
43  total += allCharge_[i];
44  return total;
45 }
46 
47 float HcalNoiseRBX::allChargeHighest2TS(unsigned int firstts) const {
48  float total = 0;
49  for (unsigned int i = firstts; i < firstts + 2 && !allCharge_.empty(); i++)
50  total += allCharge_[i];
51  return total;
52 }
53 
54 float HcalNoiseRBX::allChargeHighest3TS(unsigned int firstts) const {
55  float total = 0;
56  for (unsigned int i = firstts; i < firstts + 3 && !allCharge_.empty(); i++)
57  total += allCharge_[i];
58  return total;
59 }
60 
61 int HcalNoiseRBX::totalZeros(void) const {
62  int tot = 0;
63  for (unsigned int i = 0; i < hpds_.size(); i++)
64  tot += hpds_[i].totalZeros();
65  return tot;
66 }
67 
68 int HcalNoiseRBX::maxZeros(void) const {
69  int max = 0;
70  for (unsigned int i = 0; i < hpds_.size(); i++)
71  if (hpds_[i].maxZeros() > max)
72  max = hpds_[i].maxZeros();
73  return max;
74 }
75 
76 double HcalNoiseRBX::recHitEnergy(double threshold) const {
77  double total = 0;
78  for (unsigned int i = 0; i < hpds_.size(); i++)
80  return total;
81 }
82 
84  double total = 0;
85  for (unsigned int i = 0; i < hpds_.size(); i++)
87  return total;
88 }
89 
90 double HcalNoiseRBX::minRecHitTime(double threshold) const {
91  double mintime = 9999999.;
92  for (unsigned int i = 0; i < hpds_.size(); i++) {
93  double temptime = hpds_[i].minRecHitTime(threshold);
94  if (temptime < mintime)
95  mintime = temptime;
96  }
97  return mintime;
98 }
99 
101  double maxtime = -9999999.;
102  for (unsigned int i = 0; i < hpds_.size(); i++) {
103  double temptime = hpds_[i].maxRecHitTime(threshold);
104  if (temptime > maxtime)
105  maxtime = temptime;
106  }
107  return maxtime;
108 }
109 
111  int total = 0;
112  for (unsigned int i = 0; i < hpds_.size(); i++)
114  return total;
115 }
116 
118  int total = 0;
119  for (unsigned int i = 0; i < hpds_.size(); i++)
121  return total;
122 }
123 
124 double HcalNoiseRBX::caloTowerHadE(void) const {
125  double h = 0;
126  towerset_t twrs;
127  uniqueTowers(twrs);
128  for (towerset_t::const_iterator it = twrs.begin(); it != twrs.end(); ++it) {
129  h += it->hadEnergy();
130  }
131  return h;
132 }
133 
134 double HcalNoiseRBX::caloTowerEmE(void) const {
135  double e = 0;
136  towerset_t twrs;
137  uniqueTowers(twrs);
138  for (towerset_t::const_iterator it = twrs.begin(); it != twrs.end(); ++it) {
139  e += it->emEnergy();
140  }
141  return e;
142 }
143 
144 double HcalNoiseRBX::caloTowerTotalE(void) const {
145  double e = 0;
146  towerset_t twrs;
147  uniqueTowers(twrs);
148  for (towerset_t::const_iterator it = twrs.begin(); it != twrs.end(); ++it) {
149  e += it->hadEnergy() + it->emEnergy();
150  }
151  return e;
152 }
153 
155  double e = 0, h = 0;
156  towerset_t twrs;
157  uniqueTowers(twrs);
158  for (towerset_t::const_iterator it = twrs.begin(); it != twrs.end(); ++it) {
159  h += it->hadEnergy();
160  e += it->emEnergy();
161  }
162  return (e + h) == 0 ? 999 : e / (e + h);
163 }
164 
166  twrs_.clear();
167  for (std::vector<HcalNoiseHPD>::const_iterator it1 = hpds_.begin(); it1 != hpds_.end(); ++it1) {
168  edm::RefVector<CaloTowerCollection> twrsref = it1->caloTowers();
169  for (edm::RefVector<CaloTowerCollection>::const_iterator it2 = twrsref.begin(); it2 != twrsref.end(); ++it2) {
170  CaloTower twr = **it2;
171  twrs_.insert(twr);
172  }
173  }
174  return;
175 }
reco::HcalNoiseRBX::caloTowerEmFraction
double caloTowerEmFraction(void) const
Definition: HcalNoiseRBX.cc:154
reco::HcalNoiseRBX::totalZeros
int totalZeros(void) const
Definition: HcalNoiseRBX.cc:61
mps_fire.i
i
Definition: mps_fire.py:428
HcalNoiseRBX.h
CastorTowerReco_cfi.mintime
mintime
Definition: CastorTowerReco_cfi.py:7
reco::HcalNoiseRBX::numRecHits
int numRecHits(double threshold=1.5) const
Definition: HcalNoiseRBX.cc:110
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
reco::HcalNoiseRBX::allChargeHighest2TS
float allChargeHighest2TS(unsigned int firstts=4) const
Definition: HcalNoiseRBX.cc:47
edm::RefVector::begin
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:223
reco::HcalNoiseRBX::idnumber_
int idnumber_
Definition: HcalNoiseRBX.h:102
reco::HcalNoiseRBX::allChargeTotal
float allChargeTotal(void) const
Definition: HcalNoiseRBX.cc:40
edm::RefVector
Definition: EDProductfwd.h:27
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::HcalNoiseRBX::recHitEnergyFailR45
double recHitEnergyFailR45(double threshold=1.5) const
Definition: HcalNoiseRBX.cc:83
CastorTowerReco_cfi.maxtime
maxtime
Definition: CastorTowerReco_cfi.py:8
reco::HcalNoiseRBX::allCharge
const std::vector< float > allCharge(void) const
Definition: HcalNoiseRBX.cc:38
edm::RefVector::end
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:228
h
reco::HcalNoiseRBX::hpds_
std::vector< HcalNoiseHPD > hpds_
Definition: HcalNoiseRBX.h:105
reco::HcalNoiseRBX::caloTowerEmE
double caloTowerEmE(void) const
Definition: HcalNoiseRBX.cc:134
reco::HcalNoiseRBX::HPDs
const std::vector< HcalNoiseHPD > HPDs(void) const
Definition: HcalNoiseRBX.cc:23
HBHEDataFrame
Definition: HBHEDataFrame.h:14
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
reco::HcalNoiseRBX::caloTowerTotalE
double caloTowerTotalE(void) const
Definition: HcalNoiseRBX.cc:144
reco::HcalNoiseRBX::caloTowerHadE
double caloTowerHadE(void) const
Definition: HcalNoiseRBX.cc:124
CaloTower
Definition: CaloTower.h:26
reco::HcalNoiseRBX::maxZeros
int maxZeros(void) const
Definition: HcalNoiseRBX.cc:68
reco::HcalNoiseRBX::allChargeHighest3TS
float allChargeHighest3TS(unsigned int firstts=4) const
Definition: HcalNoiseRBX.cc:54
reco::HcalNoiseRBX::allCharge_
std::vector< float > allCharge_
Definition: HcalNoiseRBX.h:108
reco::HcalNoiseRBX::numRecHitsFailR45
int numRecHitsFailR45(double threshold=1.5) const
Definition: HcalNoiseRBX.cc:117
reco::HcalNoiseRBX::minRecHitTime
double minRecHitTime(double threshold=20.0) const
Definition: HcalNoiseRBX.cc:90
edm::RefVectorIterator
Definition: EDProductfwd.h:33
reco::HcalNoiseRBX::maxRecHitTime
double maxRecHitTime(double threshold=20.0) const
Definition: HcalNoiseRBX.cc:100
reco::HcalNoiseRBX::~HcalNoiseRBX
~HcalNoiseRBX()
Definition: HcalNoiseRBX.cc:18
reco::HcalNoiseRBX::uniqueTowers
void uniqueTowers(towerset_t &twrs_) const
Definition: HcalNoiseRBX.cc:165
dqmMemoryStats.total
total
Definition: dqmMemoryStats.py:152
reco::HcalNoiseRBX::HcalNoiseRBX
HcalNoiseRBX()
Definition: HcalNoiseRBX.cc:15
reco::HcalNoiseRBX::maxHPD
std::vector< HcalNoiseHPD >::const_iterator maxHPD(double threshold=1.5) const
Definition: HcalNoiseRBX.cc:25
reco::HcalNoiseRBX::recHitEnergy
double recHitEnergy(double theshold=1.5) const
Definition: HcalNoiseRBX.cc:76
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430
reco::HcalNoiseRBX::idnumber
int idnumber(void) const
Definition: HcalNoiseRBX.cc:21
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
reco::HcalNoiseRBX::towerset_t
std::set< CaloTower, twrcomp > towerset_t
Definition: HcalNoiseRBX.h:98