CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 reco::HcalNoiseRBX::hpds_, mps_fire::i, reco::HcalNoiseRBX::idnumber_, HcalHPDRBXMap::indicesHPDfromRBX(), dqmiolumiharvest::j, HcalHPDRBXMap::NUM_HPDS_PER_RBX, and findQualityFiles::size.

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 }
static const int NUM_HPDS_PER_RBX
Definition: HcalHPDRBXMap.h:30
static void indicesHPDfromRBX(int rbxindex, std::array< int, NUM_HPDS_PER_RBX > &hpdindices)
std::vector< HcalNoiseHPD > hpds_
Definition: HcalNoiseRBX.h:105
tuple size
Write out results.
HcalNoiseRBXArray::~HcalNoiseRBXArray ( )
virtual

Definition at line 31 of file HcalNoiseRBXArray.cc.

31 {}

Member Function Documentation

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

Definition at line 40 of file HcalNoiseRBXArray.cc.

Referenced by findHPD().

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 }
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 }
HcalNoiseRBXArray::iterator reco::HcalNoiseRBXArray::endRBX ( void  )
inline

Definition at line 41 of file HcalNoiseRBXArray.h.

References dataset::end.

Referenced by findRBX().

41 { return end(); }
string end
Definition: dataset.py:937
HcalNoiseRBXArray::const_iterator reco::HcalNoiseRBXArray::endRBX ( void  ) const
inline

Definition at line 42 of file HcalNoiseRBXArray.h.

References dataset::end.

42 { return end(); }
string end
Definition: dataset.py:937
std::vector< HcalNoiseHPD >::iterator HcalNoiseRBXArray::findHPD ( int  hpdindex)

Definition at line 46 of file HcalNoiseRBXArray.cc.

References endHPD(), 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().

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 }
static int indexRBXfromHPD(int hpdindex)
std::vector< HcalNoiseHPD >::iterator endHPD(void)
static bool isValidHPD(int index)
std::vector< HcalNoiseHPD > hpds_
Definition: HcalNoiseRBX.h:105
std::vector< HcalNoiseHPD >::const_iterator HcalNoiseRBXArray::findHPD ( int  hpdindex) const

Definition at line 67 of file HcalNoiseRBXArray.cc.

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

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 }
static int indexRBXfromHPD(int hpdindex)
std::vector< HcalNoiseHPD >::iterator endHPD(void)
static bool isValidHPD(int index)
std::vector< HcalNoiseHPD > hpds_
Definition: HcalNoiseRBX.h:105
std::vector< HcalNoiseHPD >::iterator HcalNoiseRBXArray::findHPD ( const HcalDetId id)

Definition at line 99 of file HcalNoiseRBXArray.cc.

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

99  {
100  if (!HcalHPDRBXMap::isValid(id))
101  return endHPD();
102  return findHPD(HcalHPDRBXMap::indexHPD(id));
103 }
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 105 of file HcalNoiseRBXArray.cc.

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

105  {
106  if (!HcalHPDRBXMap::isValid(id))
107  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 >::iterator HcalNoiseRBXArray::findHPD ( const HBHEDataFrame f)

Definition at line 123 of file HcalNoiseRBXArray.cc.

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

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

Definition at line 125 of file HcalNoiseRBXArray.cc.

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

125  {
126  return findHPD(f.id());
127 }
constexpr const HcalDetId & id() const
Definition: HBHEDataFrame.h:23
std::vector< HcalNoiseHPD >::iterator findHPD(int hpdindex)
std::vector< HcalNoiseHPD >::iterator HcalNoiseRBXArray::findHPD ( const HBHERecHit h)

Definition at line 133 of file HcalNoiseRBXArray.cc.

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

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

Definition at line 135 of file HcalNoiseRBXArray.cc.

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

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

Definition at line 161 of file HcalNoiseRBXArray.cc.

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

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 }
int ieta() const
Definition: CaloTower.h:200
int iphi() const
Definition: CaloTower.h:202
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 143 of file HcalNoiseRBXArray.cc.

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

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 }
int ieta() const
Definition: CaloTower.h:200
int iphi() const
Definition: CaloTower.h:202
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 87 of file HcalNoiseRBXArray.cc.

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

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

87  {
88  if (!HcalHPDRBXMap::isValidRBX(rbxindex))
89  return endRBX();
90  return begin() + rbxindex;
91 }
static bool isValidRBX(int index)
HcalNoiseRBXArray::iterator endRBX(void)
HcalNoiseRBXArray::const_iterator HcalNoiseRBXArray::findRBX ( int  rbxindex) const

Definition at line 93 of file HcalNoiseRBXArray.cc.

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

93  {
94  if (!HcalHPDRBXMap::isValidRBX(rbxindex))
95  return endRBX();
96  return begin() + rbxindex;
97 }
static bool isValidRBX(int index)
HcalNoiseRBXArray::iterator endRBX(void)
HcalNoiseRBXArray::iterator HcalNoiseRBXArray::findRBX ( const HcalDetId id)

Definition at line 111 of file HcalNoiseRBXArray.cc.

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

111  {
112  if (!HcalHPDRBXMap::isValid(id))
113  return endRBX();
114  return findRBX(HcalHPDRBXMap::indexRBX(id));
115 }
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 117 of file HcalNoiseRBXArray.cc.

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

117  {
118  if (!HcalHPDRBXMap::isValid(id))
119  return endRBX();
120  return findRBX(HcalHPDRBXMap::indexRBX(id));
121 }
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 129 of file HcalNoiseRBXArray.cc.

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

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

Definition at line 131 of file HcalNoiseRBXArray.cc.

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

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

Definition at line 139 of file HcalNoiseRBXArray.cc.

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

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

Definition at line 141 of file HcalNoiseRBXArray.cc.

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

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

Definition at line 178 of file HcalNoiseRBXArray.cc.

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

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 }
int ieta() const
Definition: CaloTower.h:200
int iphi() const
Definition: CaloTower.h:202
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 195 of file HcalNoiseRBXArray.cc.

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

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 }
int ieta() const
Definition: CaloTower.h:200
int iphi() const
Definition: CaloTower.h:202
HcalNoiseRBXArray::iterator findRBX(int rbxindex)
static void indexRBXfromEtaPhi(int ieta, int iphi, std::vector< int > &rbxindices)
static bool isValid(const HcalDetId &)