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 16 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.

17 {
18  for(unsigned int i=0; i<size(); i++) {
19  HcalNoiseRBX& rbx=at(i);
20 
21  // set the rbxnumber here
22  rbx.idnumber_=i;
23 
24  // set the hpdnumber here
25  boost::array<int, HcalHPDRBXMap::NUM_HPDS_PER_RBX> hpdindices;
27  for(int j=0; j<HcalHPDRBXMap::NUM_HPDS_PER_RBX; j++) {
28  rbx.hpds_[j].idnumber_=hpdindices[j];
29  }
30  }
31 }
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 33 of file HcalNoiseRBXArray.cc.

34 {
35 }

Member Function Documentation

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

Definition at line 45 of file HcalNoiseRBXArray.cc.

References asciidump::at.

Referenced by findHPD().

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

Definition at line 37 of file HcalNoiseRBXArray.cc.

References asciidump::at.

38 {
39  // the choice of which rbx to use is arbitrary,
40  // as long as we're consistent
41  return at(0).hpds_.end();
42 }
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 52 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().

53 {
54  // if the hpdindex is invalid
55  if(!HcalHPDRBXMap::isValidHPD(hpdindex)) return endHPD();
56 
57  int rbxindex=HcalHPDRBXMap::indexRBXfromHPD(hpdindex);
58 
59  // find the HPD in the RBX
60  HcalNoiseRBX& rbx=at(rbxindex);
61  for(std::vector<HcalNoiseHPD>::iterator it=rbx.hpds_.begin(); it!=rbx.hpds_.end(); ++it) {
62  if(it->idnumber_==hpdindex) return it;
63  }
64 
65  // if we're here, this is a bug
67  << "Could not find hpdindex " << hpdindex << " in HcalNoiseRBXArray::findHPDfromDetID(). This is a bug.\n";
68  return endHPD();
69 }
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 72 of file HcalNoiseRBXArray.cc.

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

73 {
74  // if the hpdindex is invalid
75  if(!HcalHPDRBXMap::isValidHPD(hpdindex)) return endHPD();
76 
77  int rbxindex=HcalHPDRBXMap::indexRBXfromHPD(hpdindex);
78 
79  // find the HPD in the RBX
80  const HcalNoiseRBX& rbx=at(rbxindex);
81  for(std::vector<HcalNoiseHPD>::const_iterator it=rbx.hpds_.begin(); it!=rbx.hpds_.end(); ++it) {
82  if(it->idnumber_==hpdindex) return it;
83  }
84 
85  // if we're here, this is a bug
87  << "Could not find hpdindex " << hpdindex << " in HcalNoiseRBXArray::findHPDfromDetID(). This is a bug.\n";
88  return endHPD();
89 }
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 106 of file HcalNoiseRBXArray.cc.

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

107 {
108  if(!HcalHPDRBXMap::isValid(id)) return endHPD();
109  return findHPD(HcalHPDRBXMap::indexHPD(id));
110 }
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 113 of file HcalNoiseRBXArray.cc.

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

114 {
115  if(!HcalHPDRBXMap::isValid(id)) return endHPD();
116  return findHPD(HcalHPDRBXMap::indexHPD(id));
117 }
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 134 of file HcalNoiseRBXArray.cc.

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

135 { 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 138 of file HcalNoiseRBXArray.cc.

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

139 { 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 150 of file HcalNoiseRBXArray.cc.

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

151 { 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 154 of file HcalNoiseRBXArray.cc.

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

155 { 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 183 of file HcalNoiseRBXArray.cc.

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

184 {
185  // clear the vector
186  vec.clear();
187 
188  // check if the tower corresponds to a valid HPD/RBX
189  if(!HcalHPDRBXMap::isValid(tower.ieta(), tower.iphi())) return;
190 
191  // find the HPD indices
192  std::vector<int> hpdindices;
193  HcalHPDRBXMap::indexHPDfromEtaPhi(tower.ieta(), tower.iphi(), hpdindices);
194  for(std::vector<int>::const_iterator it=hpdindices.begin(); it!=hpdindices.end(); ++it)
195  vec.push_back(findHPD(*it));
196 
197  return;
198 }
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 166 of file HcalNoiseRBXArray.cc.

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

167 {
168  // clear the vector
169  vec.clear();
170 
171  // check if the tower corresponds to a valid HPD/RBX
172  if(!HcalHPDRBXMap::isValid(tower.ieta(), tower.iphi())) return;
173 
174  // find the HPD indices
175  std::vector<int> hpdindices;
176  HcalHPDRBXMap::indexHPDfromEtaPhi(tower.ieta(), tower.iphi(), hpdindices);
177  for(std::vector<int>::const_iterator it=hpdindices.begin(); it!=hpdindices.end(); ++it)
178  vec.push_back(findHPD(*it));
179 
180  return;
181 }
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 92 of file HcalNoiseRBXArray.cc.

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

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

93 {
94  if(!HcalHPDRBXMap::isValidRBX(rbxindex)) return endRBX();
95  return begin()+rbxindex;
96 }
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 99 of file HcalNoiseRBXArray.cc.

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

100 {
101  if(!HcalHPDRBXMap::isValidRBX(rbxindex)) return endRBX();
102  return begin()+rbxindex;
103 }
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 120 of file HcalNoiseRBXArray.cc.

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

121 {
122  if(!HcalHPDRBXMap::isValid(id)) return endRBX();
123  return findRBX(HcalHPDRBXMap::indexRBX(id));
124 }
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 127 of file HcalNoiseRBXArray.cc.

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

128 {
129  if(!HcalHPDRBXMap::isValid(id)) return endRBX();
130  return findRBX(HcalHPDRBXMap::indexRBX(id));
131 }
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 142 of file HcalNoiseRBXArray.cc.

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

143 { 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 146 of file HcalNoiseRBXArray.cc.

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

147 { 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 158 of file HcalNoiseRBXArray.cc.

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

159 { 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 162 of file HcalNoiseRBXArray.cc.

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

163 { 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 200 of file HcalNoiseRBXArray.cc.

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

201 {
202  // clear the vector
203  vec.clear();
204 
205  // check if the tower corresponds to a valid HPD/RBX
206  if(!HcalHPDRBXMap::isValid(tower.ieta(), tower.iphi())) return;
207 
208  // find the RBX indices
209  std::vector<int> rbxindices;
210  HcalHPDRBXMap::indexRBXfromEtaPhi(tower.ieta(), tower.iphi(), rbxindices);
211  for(std::vector<int>::const_iterator it=rbxindices.begin(); it!=rbxindices.end(); ++it)
212  vec.push_back(findRBX(*it));
213 
214  return;
215 }
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 217 of file HcalNoiseRBXArray.cc.

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

218 {
219  // clear the vector
220  vec.clear();
221 
222  // check if the tower corresponds to a valid HPD/RBX
223  if(!HcalHPDRBXMap::isValid(tower.ieta(), tower.iphi())) return;
224 
225  // find the RBX indices
226  std::vector<int> rbxindices;
227  HcalHPDRBXMap::indexRBXfromEtaPhi(tower.ieta(), tower.iphi(), rbxindices);
228  for(std::vector<int>::const_iterator it=rbxindices.begin(); it!=rbxindices.end(); ++it)
229  vec.push_back(findRBX(*it));
230 
231  return;
232 }
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 &)