CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
std::vector< HcalNoiseHPD >
::iterator 
findHPD (int hpdindex)
 
std::vector< HcalNoiseHPD >
::const_iterator 
findHPD (int hpdindex) const
 
std::vector< HcalNoiseHPD >
::iterator 
findHPD (const HcalDetId &)
 
std::vector< HcalNoiseHPD >
::const_iterator 
findHPD (const HcalDetId &) const
 
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
 
void findHPD (const CaloTower &, std::vector< std::vector< HcalNoiseHPD >::iterator > &)
 
void findHPD (const CaloTower &, std::vector< std::vector< HcalNoiseHPD >::const_iterator > &) const
 
HcalNoiseRBXArray::iterator findRBX (int rbxindex)
 
HcalNoiseRBXArray::const_iterator findRBX (int rbxindex) const
 
HcalNoiseRBXArray::iterator findRBX (const HcalDetId &)
 
HcalNoiseRBXArray::const_iterator findRBX (const HcalDetId &) const
 
HcalNoiseRBXArray::iterator findRBX (const HBHEDataFrame &)
 
HcalNoiseRBXArray::const_iterator findRBX (const HBHEDataFrame &) const
 
HcalNoiseRBXArray::iterator findRBX (const HBHERecHit &)
 
HcalNoiseRBXArray::const_iterator findRBX (const HBHERecHit &) const
 
void findRBX (const CaloTower &, std::vector< HcalNoiseRBXArray::iterator > &)
 
void findRBX (const CaloTower &, std::vector< HcalNoiseRBXArray::const_iterator > &) const
 
 HcalNoiseRBXArray ()
 
virtual ~HcalNoiseRBXArray ()
 

Detailed Description

Definition at line 27 of file HcalNoiseRBXArray.h.

Constructor & Destructor Documentation

HcalNoiseRBXArray::HcalNoiseRBXArray ( )

Definition at line 15 of file HcalNoiseRBXArray.cc.

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

16 {
17  for(unsigned int i=0; i<size(); i++) {
18  HcalNoiseRBX& rbx=at(i);
19 
20  // set the rbxnumber here
21  rbx.idnumber_=i;
22 
23  // set the hpdnumber here
24  boost::array<int, HcalHPDRBXMap::NUM_HPDS_PER_RBX> hpdindices;
26  for(int j=0; j<HcalHPDRBXMap::NUM_HPDS_PER_RBX; j++) {
27  rbx.hpds_[j].idnumber_=hpdindices[j];
28  }
29  }
30 }
static const int NUM_HPDS_PER_RBX
Definition: HcalHPDRBXMap.h:33
int i
Definition: DBlmapReader.cc:9
std::vector< HcalNoiseHPD > hpds_
Definition: HcalNoiseRBX.h:102
int j
Definition: DBlmapReader.cc:9
static void indicesHPDfromRBX(int rbxindex, boost::array< int, NUM_HPDS_PER_RBX > &hpdindices)
tuple size
Write out results.
list at
Definition: asciidump.py:428
HcalNoiseRBXArray::~HcalNoiseRBXArray ( )
virtual

Definition at line 32 of file HcalNoiseRBXArray.cc.

33 {
34 }

Member Function Documentation

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

Definition at line 44 of file HcalNoiseRBXArray.cc.

References asciidump::at.

Referenced by findHPD().

45 {
46  // the choice of which rbx to use is arbitrary,
47  // as long as we're consistent
48  return at(0).hpds_.end();
49 }
list at
Definition: asciidump.py:428
std::vector< HcalNoiseHPD >::const_iterator HcalNoiseRBXArray::endHPD ( void  ) const

Definition at line 36 of file HcalNoiseRBXArray.cc.

References asciidump::at.

37 {
38  // the choice of which rbx to use is arbitrary,
39  // as long as we're consistent
40  return at(0).hpds_.end();
41 }
list at
Definition: asciidump.py:428
HcalNoiseRBXArray::iterator reco::HcalNoiseRBXArray::endRBX ( void  )
inline

Definition at line 42 of file HcalNoiseRBXArray.h.

References end.

Referenced by findRBX().

42 { return end(); }
#define end
Definition: vmac.h:38
HcalNoiseRBXArray::const_iterator reco::HcalNoiseRBXArray::endRBX ( void  ) const
inline

Definition at line 43 of file HcalNoiseRBXArray.h.

References end.

43 { return end(); }
#define end
Definition: vmac.h:38
std::vector< HcalNoiseHPD >::iterator HcalNoiseRBXArray::findHPD ( int  hpdindex)

Definition at line 51 of file HcalNoiseRBXArray.cc.

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

Referenced by reco::HcalNoiseInfoProducer::fillcalotwrs(), reco::HcalNoiseInfoProducer::filldigis(), reco::HcalNoiseInfoProducer::fillrechits(), and findHPD().

52 {
53  // if the hpdindex is invalid
54  if(!HcalHPDRBXMap::isValidHPD(hpdindex)) return endHPD();
55 
56  int rbxindex=HcalHPDRBXMap::indexRBXfromHPD(hpdindex);
57 
58  // find the HPD in the RBX
59  HcalNoiseRBX& rbx=at(rbxindex);
60  for(std::vector<HcalNoiseHPD>::iterator it=rbx.hpds_.begin(); it!=rbx.hpds_.end(); ++it) {
61  if(it->idnumber_==hpdindex) return it;
62  }
63 
64  // if we're here, this is a bug
66  << "Could not find hpdindex " << hpdindex << " in HcalNoiseRBXArray::findHPDfromDetID(). This is a bug.\n";
67  return endHPD();
68 }
static int indexRBXfromHPD(int hpdindex)
std::vector< HcalNoiseHPD >::iterator endHPD(void)
static bool isValidHPD(int index)
std::vector< HcalNoiseHPD > hpds_
Definition: HcalNoiseRBX.h:102
list at
Definition: asciidump.py:428
std::vector< HcalNoiseHPD >::const_iterator HcalNoiseRBXArray::findHPD ( int  hpdindex) const

Definition at line 71 of file HcalNoiseRBXArray.cc.

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

72 {
73  // if the hpdindex is invalid
74  if(!HcalHPDRBXMap::isValidHPD(hpdindex)) return endHPD();
75 
76  int rbxindex=HcalHPDRBXMap::indexRBXfromHPD(hpdindex);
77 
78  // find the HPD in the RBX
79  const HcalNoiseRBX& rbx=at(rbxindex);
80  for(std::vector<HcalNoiseHPD>::const_iterator it=rbx.hpds_.begin(); it!=rbx.hpds_.end(); ++it) {
81  if(it->idnumber_==hpdindex) return it;
82  }
83 
84  // if we're here, this is a bug
86  << "Could not find hpdindex " << hpdindex << " in HcalNoiseRBXArray::findHPDfromDetID(). This is a bug.\n";
87  return endHPD();
88 }
static int indexRBXfromHPD(int hpdindex)
std::vector< HcalNoiseHPD >::iterator endHPD(void)
static bool isValidHPD(int index)
std::vector< HcalNoiseHPD > hpds_
Definition: HcalNoiseRBX.h:102
list at
Definition: asciidump.py:428
std::vector< HcalNoiseHPD >::iterator HcalNoiseRBXArray::findHPD ( const HcalDetId id)

Definition at line 105 of file HcalNoiseRBXArray.cc.

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

106 {
107  if(!HcalHPDRBXMap::isValid(id)) return endHPD();
108  return findHPD(HcalHPDRBXMap::indexHPD(id));
109 }
std::vector< HcalNoiseHPD >::iterator endHPD(void)
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
static bool isValid(const HcalDetId &)
static int indexHPD(const HcalDetId &)
std::vector< HcalNoiseHPD >::const_iterator HcalNoiseRBXArray::findHPD ( const HcalDetId id) const

Definition at line 112 of file HcalNoiseRBXArray.cc.

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

113 {
114  if(!HcalHPDRBXMap::isValid(id)) return endHPD();
115  return findHPD(HcalHPDRBXMap::indexHPD(id));
116 }
std::vector< HcalNoiseHPD >::iterator endHPD(void)
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
static bool isValid(const HcalDetId &)
static int indexHPD(const HcalDetId &)
std::vector< HcalNoiseHPD >::iterator HcalNoiseRBXArray::findHPD ( const HBHEDataFrame f)

Definition at line 133 of file HcalNoiseRBXArray.cc.

References findHPD(), and HBHEDataFrame::id().

134 { return findHPD(f.id()); }
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
const HcalDetId & id() const
Definition: HBHEDataFrame.h:22
std::vector< HcalNoiseHPD >::const_iterator HcalNoiseRBXArray::findHPD ( const HBHEDataFrame f) const

Definition at line 137 of file HcalNoiseRBXArray.cc.

References findHPD(), and HBHEDataFrame::id().

138 { return findHPD(f.id()); }
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
const HcalDetId & id() const
Definition: HBHEDataFrame.h:22
std::vector< HcalNoiseHPD >::iterator HcalNoiseRBXArray::findHPD ( const HBHERecHit h)

Definition at line 149 of file HcalNoiseRBXArray.cc.

References findHPD(), and HBHERecHit::id().

150 { return findHPD(h.id()); }
HcalDetId id() const
get the id
Definition: HBHERecHit.h:21
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
std::vector< HcalNoiseHPD >::const_iterator HcalNoiseRBXArray::findHPD ( const HBHERecHit h) const

Definition at line 153 of file HcalNoiseRBXArray.cc.

References findHPD(), and HBHERecHit::id().

154 { return findHPD(h.id()); }
HcalDetId id() const
get the id
Definition: HBHERecHit.h:21
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
void HcalNoiseRBXArray::findHPD ( const CaloTower tower,
std::vector< std::vector< HcalNoiseHPD >::iterator > &  vec 
)

Definition at line 182 of file HcalNoiseRBXArray.cc.

References findHPD(), CaloTower::ieta(), HcalHPDRBXMap::indexHPDfromEtaPhi(), CaloTower::iphi(), and HcalHPDRBXMap::isValid().

183 {
184  // clear the vector
185  vec.clear();
186 
187  // check if the tower corresponds to a valid HPD/RBX
188  if(!HcalHPDRBXMap::isValid(tower.ieta(), tower.iphi())) return;
189 
190  // find the HPD indices
191  std::vector<int> hpdindices;
192  HcalHPDRBXMap::indexHPDfromEtaPhi(tower.ieta(), tower.iphi(), hpdindices);
193  for(std::vector<int>::const_iterator it=hpdindices.begin(); it!=hpdindices.end(); ++it)
194  vec.push_back(findHPD(*it));
195 
196  return;
197 }
int ieta() const
Definition: CaloTower.h:154
int iphi() const
Definition: CaloTower.h:156
static void indexHPDfromEtaPhi(int ieta, int iphi, std::vector< int > &hpdindices)
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
static bool isValid(const HcalDetId &)
void HcalNoiseRBXArray::findHPD ( const CaloTower tower,
std::vector< std::vector< HcalNoiseHPD >::const_iterator > &  vec 
) const

Definition at line 165 of file HcalNoiseRBXArray.cc.

References findHPD(), CaloTower::ieta(), HcalHPDRBXMap::indexHPDfromEtaPhi(), CaloTower::iphi(), and HcalHPDRBXMap::isValid().

166 {
167  // clear the vector
168  vec.clear();
169 
170  // check if the tower corresponds to a valid HPD/RBX
171  if(!HcalHPDRBXMap::isValid(tower.ieta(), tower.iphi())) return;
172 
173  // find the HPD indices
174  std::vector<int> hpdindices;
175  HcalHPDRBXMap::indexHPDfromEtaPhi(tower.ieta(), tower.iphi(), hpdindices);
176  for(std::vector<int>::const_iterator it=hpdindices.begin(); it!=hpdindices.end(); ++it)
177  vec.push_back(findHPD(*it));
178 
179  return;
180 }
int ieta() const
Definition: CaloTower.h:154
int iphi() const
Definition: CaloTower.h:156
static void indexHPDfromEtaPhi(int ieta, int iphi, std::vector< int > &hpdindices)
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
static bool isValid(const HcalDetId &)
HcalNoiseRBXArray::iterator HcalNoiseRBXArray::findRBX ( int  rbxindex)

Definition at line 91 of file HcalNoiseRBXArray.cc.

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

Referenced by reco::HcalNoiseInfoProducer::filldigis(), and findRBX().

92 {
93  if(!HcalHPDRBXMap::isValidRBX(rbxindex)) return endRBX();
94  return begin()+rbxindex;
95 }
static bool isValidRBX(int index)
HcalNoiseRBXArray::iterator endRBX(void)
#define begin
Definition: vmac.h:31
HcalNoiseRBXArray::const_iterator HcalNoiseRBXArray::findRBX ( int  rbxindex) const

Definition at line 98 of file HcalNoiseRBXArray.cc.

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

99 {
100  if(!HcalHPDRBXMap::isValidRBX(rbxindex)) return endRBX();
101  return begin()+rbxindex;
102 }
static bool isValidRBX(int index)
HcalNoiseRBXArray::iterator endRBX(void)
#define begin
Definition: vmac.h:31
HcalNoiseRBXArray::iterator HcalNoiseRBXArray::findRBX ( const HcalDetId id)

Definition at line 119 of file HcalNoiseRBXArray.cc.

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

120 {
121  if(!HcalHPDRBXMap::isValid(id)) return endRBX();
122  return findRBX(HcalHPDRBXMap::indexRBX(id));
123 }
static int indexRBX(const HcalDetId &)
HcalNoiseRBXArray::iterator findRBX(int rbxindex)
HcalNoiseRBXArray::iterator endRBX(void)
static bool isValid(const HcalDetId &)
HcalNoiseRBXArray::const_iterator HcalNoiseRBXArray::findRBX ( const HcalDetId id) const

Definition at line 126 of file HcalNoiseRBXArray.cc.

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

127 {
128  if(!HcalHPDRBXMap::isValid(id)) return endRBX();
129  return findRBX(HcalHPDRBXMap::indexRBX(id));
130 }
static int indexRBX(const HcalDetId &)
HcalNoiseRBXArray::iterator findRBX(int rbxindex)
HcalNoiseRBXArray::iterator endRBX(void)
static bool isValid(const HcalDetId &)
HcalNoiseRBXArray::iterator HcalNoiseRBXArray::findRBX ( const HBHEDataFrame f)

Definition at line 141 of file HcalNoiseRBXArray.cc.

References findRBX(), and HBHEDataFrame::id().

142 { return findRBX(f.id()); }
HcalNoiseRBXArray::iterator findRBX(int rbxindex)
const HcalDetId & id() const
Definition: HBHEDataFrame.h:22
HcalNoiseRBXArray::const_iterator HcalNoiseRBXArray::findRBX ( const HBHEDataFrame f) const

Definition at line 145 of file HcalNoiseRBXArray.cc.

References findRBX(), and HBHEDataFrame::id().

146 { return findRBX(f.id()); }
HcalNoiseRBXArray::iterator findRBX(int rbxindex)
const HcalDetId & id() const
Definition: HBHEDataFrame.h:22
HcalNoiseRBXArray::iterator HcalNoiseRBXArray::findRBX ( const HBHERecHit h)

Definition at line 157 of file HcalNoiseRBXArray.cc.

References findRBX(), and HBHERecHit::id().

158 { return findRBX(h.id()); }
HcalDetId id() const
get the id
Definition: HBHERecHit.h:21
HcalNoiseRBXArray::iterator findRBX(int rbxindex)
HcalNoiseRBXArray::const_iterator HcalNoiseRBXArray::findRBX ( const HBHERecHit h) const

Definition at line 161 of file HcalNoiseRBXArray.cc.

References findRBX(), and HBHERecHit::id().

162 { return findRBX(h.id()); }
HcalDetId id() const
get the id
Definition: HBHERecHit.h:21
HcalNoiseRBXArray::iterator findRBX(int rbxindex)
void HcalNoiseRBXArray::findRBX ( const CaloTower tower,
std::vector< HcalNoiseRBXArray::iterator > &  vec 
)

Definition at line 199 of file HcalNoiseRBXArray.cc.

References findRBX(), CaloTower::ieta(), HcalHPDRBXMap::indexRBXfromEtaPhi(), CaloTower::iphi(), and HcalHPDRBXMap::isValid().

200 {
201  // clear the vector
202  vec.clear();
203 
204  // check if the tower corresponds to a valid HPD/RBX
205  if(!HcalHPDRBXMap::isValid(tower.ieta(), tower.iphi())) return;
206 
207  // find the RBX indices
208  std::vector<int> rbxindices;
209  HcalHPDRBXMap::indexRBXfromEtaPhi(tower.ieta(), tower.iphi(), rbxindices);
210  for(std::vector<int>::const_iterator it=rbxindices.begin(); it!=rbxindices.end(); ++it)
211  vec.push_back(findRBX(*it));
212 
213  return;
214 }
int ieta() const
Definition: CaloTower.h:154
int iphi() const
Definition: CaloTower.h:156
HcalNoiseRBXArray::iterator findRBX(int rbxindex)
static void indexRBXfromEtaPhi(int ieta, int iphi, std::vector< int > &rbxindices)
static bool isValid(const HcalDetId &)
void HcalNoiseRBXArray::findRBX ( const CaloTower tower,
std::vector< HcalNoiseRBXArray::const_iterator > &  vec 
) const

Definition at line 216 of file HcalNoiseRBXArray.cc.

References findRBX(), CaloTower::ieta(), HcalHPDRBXMap::indexRBXfromEtaPhi(), CaloTower::iphi(), and HcalHPDRBXMap::isValid().

217 {
218  // clear the vector
219  vec.clear();
220 
221  // check if the tower corresponds to a valid HPD/RBX
222  if(!HcalHPDRBXMap::isValid(tower.ieta(), tower.iphi())) return;
223 
224  // find the RBX indices
225  std::vector<int> rbxindices;
226  HcalHPDRBXMap::indexRBXfromEtaPhi(tower.ieta(), tower.iphi(), rbxindices);
227  for(std::vector<int>::const_iterator it=rbxindices.begin(); it!=rbxindices.end(); ++it)
228  vec.push_back(findRBX(*it));
229 
230  return;
231 }
int ieta() const
Definition: CaloTower.h:154
int iphi() const
Definition: CaloTower.h:156
HcalNoiseRBXArray::iterator findRBX(int rbxindex)
static void indexRBXfromEtaPhi(int ieta, int iphi, std::vector< int > &rbxindices)
static bool isValid(const HcalDetId &)