CMS 3D CMS Logo

List of all members | Public Member Functions
reco::HcalNoiseRBXArray Class Reference

#include <HcalNoiseRBXArray.h>

Inheritance diagram for reco::HcalNoiseRBXArray:

Public Member Functions

std::vector< HcalNoiseHPD >::iterator endHPD (void)
 
std::vector< HcalNoiseHPD >::const_iterator endHPD (void) const
 
HcalNoiseRBXArray::iterator endRBX (void)
 
HcalNoiseRBXArray::const_iterator endRBX (void) const
 
void findHPD (const CaloTower &, std::vector< std::vector< HcalNoiseHPD >::const_iterator > &) const
 
void findHPD (const CaloTower &, std::vector< std::vector< HcalNoiseHPD >::iterator > &)
 
std::vector< HcalNoiseHPD >::iterator findHPD (const HBHEDataFrame &)
 
std::vector< HcalNoiseHPD >::const_iterator findHPD (const HBHEDataFrame &) const
 
std::vector< HcalNoiseHPD >::iterator findHPD (const HBHERecHit &)
 
std::vector< HcalNoiseHPD >::const_iterator findHPD (const HBHERecHit &) const
 
std::vector< HcalNoiseHPD >::iterator findHPD (const HcalDetId &)
 
std::vector< HcalNoiseHPD >::const_iterator findHPD (const HcalDetId &) const
 
std::vector< HcalNoiseHPD >::iterator findHPD (int hpdindex)
 
std::vector< HcalNoiseHPD >::const_iterator findHPD (int hpdindex) const
 
void findRBX (const CaloTower &, std::vector< HcalNoiseRBXArray::const_iterator > &) const
 
void findRBX (const CaloTower &, std::vector< HcalNoiseRBXArray::iterator > &)
 
HcalNoiseRBXArray::iterator findRBX (const HBHEDataFrame &)
 
HcalNoiseRBXArray::const_iterator findRBX (const HBHEDataFrame &) const
 
HcalNoiseRBXArray::iterator findRBX (const HBHERecHit &)
 
HcalNoiseRBXArray::const_iterator findRBX (const HBHERecHit &) const
 
HcalNoiseRBXArray::iterator findRBX (const HcalDetId &)
 
HcalNoiseRBXArray::const_iterator findRBX (const HcalDetId &) const
 
HcalNoiseRBXArray::iterator findRBX (int rbxindex)
 
HcalNoiseRBXArray::const_iterator findRBX (int rbxindex) const
 
 HcalNoiseRBXArray ()
 
virtual ~HcalNoiseRBXArray ()
 

Detailed Description

Definition at line 27 of file HcalNoiseRBXArray.h.

Constructor & Destructor Documentation

◆ HcalNoiseRBXArray()

HcalNoiseRBXArray::HcalNoiseRBXArray ( )

Definition at line 15 of file HcalNoiseRBXArray.cc.

15  {
16  for (unsigned int i = 0; i < size(); i++) {
17  HcalNoiseRBX& rbx = at(i);
18 
19  // set the rbxnumber here
20  rbx.idnumber_ = i;
21 
22  // set the hpdnumber here
23  std::array<int, HcalHPDRBXMap::NUM_HPDS_PER_RBX> hpdindices;
25  for (int j = 0; j < HcalHPDRBXMap::NUM_HPDS_PER_RBX; j++) {
26  rbx.hpds_[j].idnumber_ = hpdindices[j];
27  }
28  }
29 }

References reco::HcalNoiseRBX::hpds_, mps_fire::i, reco::HcalNoiseRBX::idnumber_, HcalHPDRBXMap::indicesHPDfromRBX(), dqmiolumiharvest::j, HcalHPDRBXMap::NUM_HPDS_PER_RBX, and findQualityFiles::size.

◆ ~HcalNoiseRBXArray()

HcalNoiseRBXArray::~HcalNoiseRBXArray ( )
virtual

Definition at line 31 of file HcalNoiseRBXArray.cc.

31 {}

Member Function Documentation

◆ endHPD() [1/2]

std::vector< HcalNoiseHPD >::iterator HcalNoiseRBXArray::endHPD ( void  )

Definition at line 40 of file HcalNoiseRBXArray.cc.

40  {
41  // the choice of which rbx to use is arbitrary,
42  // as long as we're consistent
43  return at(0).hpds_.end();
44 }

Referenced by findHPD().

◆ endHPD() [2/2]

std::vector< HcalNoiseHPD >::const_iterator HcalNoiseRBXArray::endHPD ( void  ) const

Definition at line 33 of file HcalNoiseRBXArray.cc.

33  {
34  // the choice of which rbx to use is arbitrary,
35  // as long as we're consistent
36  return at(0).hpds_.end();
37 }

◆ endRBX() [1/2]

HcalNoiseRBXArray::iterator reco::HcalNoiseRBXArray::endRBX ( void  )
inline

Definition at line 41 of file HcalNoiseRBXArray.h.

41 { return end(); }

References mps_fire::end.

Referenced by findRBX().

◆ endRBX() [2/2]

HcalNoiseRBXArray::const_iterator reco::HcalNoiseRBXArray::endRBX ( void  ) const
inline

Definition at line 42 of file HcalNoiseRBXArray.h.

42 { return end(); }

References mps_fire::end.

◆ findHPD() [1/10]

void HcalNoiseRBXArray::findHPD ( const CaloTower tower,
std::vector< std::vector< HcalNoiseHPD >::const_iterator > &  vec 
) const

Definition at line 143 of file HcalNoiseRBXArray.cc.

144  {
145  // clear the vector
146  vec.clear();
147 
148  // check if the tower corresponds to a valid HPD/RBX
149  if (!HcalHPDRBXMap::isValid(tower.ieta(), tower.iphi()))
150  return;
151 
152  // find the HPD indices
153  std::vector<int> hpdindices;
154  HcalHPDRBXMap::indexHPDfromEtaPhi(tower.ieta(), tower.iphi(), hpdindices);
155  for (std::vector<int>::const_iterator it = hpdindices.begin(); it != hpdindices.end(); ++it)
156  vec.push_back(findHPD(*it));
157 
158  return;
159 }

References findHPD(), HcalHPDRBXMap::indexHPDfromEtaPhi(), HcalHPDRBXMap::isValid(), and hgcalTowerProducer_cfi::tower.

◆ findHPD() [2/10]

void HcalNoiseRBXArray::findHPD ( const CaloTower tower,
std::vector< std::vector< HcalNoiseHPD >::iterator > &  vec 
)

Definition at line 161 of file HcalNoiseRBXArray.cc.

161  {
162  // clear the vector
163  vec.clear();
164 
165  // check if the tower corresponds to a valid HPD/RBX
166  if (!HcalHPDRBXMap::isValid(tower.ieta(), tower.iphi()))
167  return;
168 
169  // find the HPD indices
170  std::vector<int> hpdindices;
171  HcalHPDRBXMap::indexHPDfromEtaPhi(tower.ieta(), tower.iphi(), hpdindices);
172  for (std::vector<int>::const_iterator it = hpdindices.begin(); it != hpdindices.end(); ++it)
173  vec.push_back(findHPD(*it));
174 
175  return;
176 }

References findHPD(), HcalHPDRBXMap::indexHPDfromEtaPhi(), HcalHPDRBXMap::isValid(), and hgcalTowerProducer_cfi::tower.

◆ findHPD() [3/10]

std::vector< HcalNoiseHPD >::iterator HcalNoiseRBXArray::findHPD ( const HBHEDataFrame f)

Definition at line 123 of file HcalNoiseRBXArray.cc.

123 { return findHPD(f.id()); }

References f, and findHPD().

◆ findHPD() [4/10]

std::vector< HcalNoiseHPD >::const_iterator HcalNoiseRBXArray::findHPD ( const HBHEDataFrame f) const

Definition at line 125 of file HcalNoiseRBXArray.cc.

125  {
126  return findHPD(f.id());
127 }

References f, and findHPD().

◆ findHPD() [5/10]

std::vector< HcalNoiseHPD >::iterator HcalNoiseRBXArray::findHPD ( const HBHERecHit h)

Definition at line 133 of file HcalNoiseRBXArray.cc.

133 { return findHPD(h.id()); }

References findHPD().

◆ findHPD() [6/10]

std::vector< HcalNoiseHPD >::const_iterator HcalNoiseRBXArray::findHPD ( const HBHERecHit h) const

Definition at line 135 of file HcalNoiseRBXArray.cc.

135  {
136  return findHPD(h.id());
137 }

References findHPD().

◆ findHPD() [7/10]

std::vector< HcalNoiseHPD >::iterator HcalNoiseRBXArray::findHPD ( const HcalDetId id)

Definition at line 99 of file HcalNoiseRBXArray.cc.

99  {
100  if (!HcalHPDRBXMap::isValid(id))
101  return endHPD();
102  return findHPD(HcalHPDRBXMap::indexHPD(id));
103 }

References endHPD(), findHPD(), HcalHPDRBXMap::indexHPD(), and HcalHPDRBXMap::isValid().

◆ findHPD() [8/10]

std::vector< HcalNoiseHPD >::const_iterator HcalNoiseRBXArray::findHPD ( const HcalDetId id) const

Definition at line 105 of file HcalNoiseRBXArray.cc.

105  {
106  if (!HcalHPDRBXMap::isValid(id))
107  return endHPD();
108  return findHPD(HcalHPDRBXMap::indexHPD(id));
109 }

References endHPD(), findHPD(), HcalHPDRBXMap::indexHPD(), and HcalHPDRBXMap::isValid().

◆ findHPD() [9/10]

std::vector< HcalNoiseHPD >::iterator HcalNoiseRBXArray::findHPD ( int  hpdindex)

Definition at line 46 of file HcalNoiseRBXArray.cc.

46  {
47  // if the hpdindex is invalid
48  if (!HcalHPDRBXMap::isValidHPD(hpdindex))
49  return endHPD();
50 
51  int rbxindex = HcalHPDRBXMap::indexRBXfromHPD(hpdindex);
52 
53  // find the HPD in the RBX
54  HcalNoiseRBX& rbx = at(rbxindex);
55  for (std::vector<HcalNoiseHPD>::iterator it = rbx.hpds_.begin(); it != rbx.hpds_.end(); ++it) {
56  if (it->idnumber_ == hpdindex)
57  return it;
58  }
59 
60  // if we're here, this is a bug
62  << "Could not find hpdindex " << hpdindex << " in HcalNoiseRBXArray::findHPDfromDetID(). This is a bug.\n";
63  return endHPD();
64 }

References endHPD(), Exception, reco::HcalNoiseRBX::hpds_, HcalHPDRBXMap::indexRBXfromHPD(), HcalHPDRBXMap::isValidHPD(), and edm::errors::LogicError.

Referenced by findHPD().

◆ findHPD() [10/10]

std::vector< HcalNoiseHPD >::const_iterator HcalNoiseRBXArray::findHPD ( int  hpdindex) const

Definition at line 67 of file HcalNoiseRBXArray.cc.

67  {
68  // if the hpdindex is invalid
69  if (!HcalHPDRBXMap::isValidHPD(hpdindex))
70  return endHPD();
71 
72  int rbxindex = HcalHPDRBXMap::indexRBXfromHPD(hpdindex);
73 
74  // find the HPD in the RBX
75  const HcalNoiseRBX& rbx = at(rbxindex);
76  for (std::vector<HcalNoiseHPD>::const_iterator it = rbx.hpds_.begin(); it != rbx.hpds_.end(); ++it) {
77  if (it->idnumber_ == hpdindex)
78  return it;
79  }
80 
81  // if we're here, this is a bug
83  << "Could not find hpdindex " << hpdindex << " in HcalNoiseRBXArray::findHPDfromDetID(). This is a bug.\n";
84  return endHPD();
85 }

References endHPD(), Exception, reco::HcalNoiseRBX::hpds_, HcalHPDRBXMap::indexRBXfromHPD(), HcalHPDRBXMap::isValidHPD(), and edm::errors::LogicError.

◆ findRBX() [1/10]

void HcalNoiseRBXArray::findRBX ( const CaloTower tower,
std::vector< HcalNoiseRBXArray::const_iterator > &  vec 
) const

Definition at line 195 of file HcalNoiseRBXArray.cc.

195  {
196  // clear the vector
197  vec.clear();
198 
199  // check if the tower corresponds to a valid HPD/RBX
200  if (!HcalHPDRBXMap::isValid(tower.ieta(), tower.iphi()))
201  return;
202 
203  // find the RBX indices
204  std::vector<int> rbxindices;
205  HcalHPDRBXMap::indexRBXfromEtaPhi(tower.ieta(), tower.iphi(), rbxindices);
206  for (std::vector<int>::const_iterator it = rbxindices.begin(); it != rbxindices.end(); ++it)
207  vec.push_back(findRBX(*it));
208 
209  return;
210 }

References findRBX(), HcalHPDRBXMap::indexRBXfromEtaPhi(), HcalHPDRBXMap::isValid(), and hgcalTowerProducer_cfi::tower.

◆ findRBX() [2/10]

void HcalNoiseRBXArray::findRBX ( const CaloTower tower,
std::vector< HcalNoiseRBXArray::iterator > &  vec 
)

Definition at line 178 of file HcalNoiseRBXArray.cc.

178  {
179  // clear the vector
180  vec.clear();
181 
182  // check if the tower corresponds to a valid HPD/RBX
183  if (!HcalHPDRBXMap::isValid(tower.ieta(), tower.iphi()))
184  return;
185 
186  // find the RBX indices
187  std::vector<int> rbxindices;
188  HcalHPDRBXMap::indexRBXfromEtaPhi(tower.ieta(), tower.iphi(), rbxindices);
189  for (std::vector<int>::const_iterator it = rbxindices.begin(); it != rbxindices.end(); ++it)
190  vec.push_back(findRBX(*it));
191 
192  return;
193 }

References findRBX(), HcalHPDRBXMap::indexRBXfromEtaPhi(), HcalHPDRBXMap::isValid(), and hgcalTowerProducer_cfi::tower.

◆ findRBX() [3/10]

HcalNoiseRBXArray::iterator HcalNoiseRBXArray::findRBX ( const HBHEDataFrame f)

Definition at line 129 of file HcalNoiseRBXArray.cc.

129 { return findRBX(f.id()); }

References f, and findRBX().

◆ findRBX() [4/10]

HcalNoiseRBXArray::const_iterator HcalNoiseRBXArray::findRBX ( const HBHEDataFrame f) const

Definition at line 131 of file HcalNoiseRBXArray.cc.

131 { return findRBX(f.id()); }

References f, and findRBX().

◆ findRBX() [5/10]

HcalNoiseRBXArray::iterator HcalNoiseRBXArray::findRBX ( const HBHERecHit h)

Definition at line 139 of file HcalNoiseRBXArray.cc.

139 { return findRBX(h.id()); }

References findRBX().

◆ findRBX() [6/10]

HcalNoiseRBXArray::const_iterator HcalNoiseRBXArray::findRBX ( const HBHERecHit h) const

Definition at line 141 of file HcalNoiseRBXArray.cc.

141 { return findRBX(h.id()); }

References findRBX().

◆ findRBX() [7/10]

HcalNoiseRBXArray::iterator HcalNoiseRBXArray::findRBX ( const HcalDetId id)

Definition at line 111 of file HcalNoiseRBXArray.cc.

111  {
112  if (!HcalHPDRBXMap::isValid(id))
113  return endRBX();
114  return findRBX(HcalHPDRBXMap::indexRBX(id));
115 }

References endRBX(), findRBX(), HcalHPDRBXMap::indexRBX(), and HcalHPDRBXMap::isValid().

◆ findRBX() [8/10]

HcalNoiseRBXArray::const_iterator HcalNoiseRBXArray::findRBX ( const HcalDetId id) const

Definition at line 117 of file HcalNoiseRBXArray.cc.

117  {
118  if (!HcalHPDRBXMap::isValid(id))
119  return endRBX();
120  return findRBX(HcalHPDRBXMap::indexRBX(id));
121 }

References endRBX(), findRBX(), HcalHPDRBXMap::indexRBX(), and HcalHPDRBXMap::isValid().

◆ findRBX() [9/10]

HcalNoiseRBXArray::iterator HcalNoiseRBXArray::findRBX ( int  rbxindex)

Definition at line 87 of file HcalNoiseRBXArray.cc.

87  {
88  if (!HcalHPDRBXMap::isValidRBX(rbxindex))
89  return endRBX();
90  return begin() + rbxindex;
91 }

References endRBX(), and HcalHPDRBXMap::isValidRBX().

Referenced by findRBX().

◆ findRBX() [10/10]

HcalNoiseRBXArray::const_iterator HcalNoiseRBXArray::findRBX ( int  rbxindex) const

Definition at line 93 of file HcalNoiseRBXArray.cc.

93  {
94  if (!HcalHPDRBXMap::isValidRBX(rbxindex))
95  return endRBX();
96  return begin() + rbxindex;
97 }

References endRBX(), and HcalHPDRBXMap::isValidRBX().

HcalHPDRBXMap::indicesHPDfromRBX
static void indicesHPDfromRBX(int rbxindex, std::array< int, NUM_HPDS_PER_RBX > &hpdindices)
Definition: HcalHPDRBXMap.cc:165
mps_fire.i
i
Definition: mps_fire.py:428
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
edm::errors::LogicError
Definition: EDMException.h:37
HcalHPDRBXMap::NUM_HPDS_PER_RBX
const static int NUM_HPDS_PER_RBX
Definition: HcalHPDRBXMap.h:30
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:4
reco::HcalNoiseRBX::idnumber_
int idnumber_
Definition: HcalNoiseRBX.h:102
reco::HcalNoiseRBXArray::findRBX
HcalNoiseRBXArray::iterator findRBX(int rbxindex)
Definition: HcalNoiseRBXArray.cc:87
h
HcalHPDRBXMap::isValidHPD
static bool isValidHPD(int index)
Definition: HcalHPDRBXMap.cc:18
reco::HcalNoiseRBX::hpds_
std::vector< HcalNoiseHPD > hpds_
Definition: HcalNoiseRBX.h:105
mps_fire.end
end
Definition: mps_fire.py:242
reco::HcalNoiseRBXArray::findHPD
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
Definition: HcalNoiseRBXArray.cc:46
HcalHPDRBXMap::indexRBX
static int indexRBX(const HcalDetId &)
Definition: HcalHPDRBXMap.cc:229
HcalHPDRBXMap::indexRBXfromEtaPhi
static void indexRBXfromEtaPhi(int ieta, int iphi, std::vector< int > &rbxindices)
Definition: HcalHPDRBXMap.cc:251
HcalHPDRBXMap::indexHPDfromEtaPhi
static void indexHPDfromEtaPhi(int ieta, int iphi, std::vector< int > &hpdindices)
Definition: HcalHPDRBXMap.cc:231
reco::HcalNoiseRBXArray::endHPD
std::vector< HcalNoiseHPD >::iterator endHPD(void)
Definition: HcalNoiseRBXArray.cc:40
reco::HcalNoiseRBXArray::endRBX
HcalNoiseRBXArray::iterator endRBX(void)
Definition: HcalNoiseRBXArray.h:41
HcalHPDRBXMap::isValid
static bool isValid(const HcalDetId &)
Definition: HcalHPDRBXMap.cc:23
reco::HcalNoiseRBX
Definition: HcalNoiseRBX.h:32
Exception
Definition: hltDiff.cc:246
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
HcalHPDRBXMap::indexRBXfromHPD
static int indexRBXfromHPD(int hpdindex)
Definition: HcalHPDRBXMap.cc:177
HcalHPDRBXMap::isValidRBX
static bool isValidRBX(int index)
Definition: HcalHPDRBXMap.cc:21
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
HcalHPDRBXMap::indexHPD
static int indexHPD(const HcalDetId &)
Definition: HcalHPDRBXMap.cc:186