CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Attributes
HcalHPDRBXMap Class Reference

#include <HcalHPDRBXMap.h>

Static Public Member Functions

static int indexHPD (const HcalDetId &)
 
static void indexHPDfromEtaPhi (int ieta, int iphi, std::vector< int > &hpdindices)
 
static int indexRBX (const HcalDetId &)
 
static void indexRBXfromEtaPhi (int ieta, int iphi, std::vector< int > &rbxindices)
 
static int indexRBXfromHPD (int hpdindex)
 
static void indicesHPDfromRBX (int rbxindex, boost::array< int, NUM_HPDS_PER_RBX > &hpdindices)
 
static int iphihiHPD (int index)
 
static int iphihiRBX (int index)
 
static int iphiloHPD (int index)
 
static int iphiloRBX (int index)
 
static bool isValid (const HcalDetId &)
 
static bool isValid (int ieta, int iphi)
 
static bool isValidHPD (int index)
 
static bool isValidRBX (int index)
 
static int numHPDs (void)
 
static int numHPDsPerRBX (void)
 
static int numHPDsPerSubdet (void)
 
static int numRBXs (void)
 
static int numRBXsPerSubdet (void)
 
static HcalSubdetector subdetHPD (int index)
 
static HcalSubdetector subdetRBX (int index)
 
static int zsideHPD (int index)
 
static int zsideRBX (int index)
 

Static Public Attributes

static const int NUM_HPDS =288
 
static const int NUM_HPDS_PER_RBX = 4
 
static const int NUM_HPDS_PER_SUBDET =72
 
static const int NUM_RBXS =72
 
static const int NUM_RBXS_PER_SUBDET =18
 

Private Member Functions

 HcalHPDRBXMap ()
 
 ~HcalHPDRBXMap ()
 

Static Private Attributes

static HcalTopology theTopology_
 

Detailed Description

Definition at line 24 of file HcalHPDRBXMap.h.

Constructor & Destructor Documentation

HcalHPDRBXMap::HcalHPDRBXMap ( )
private

Definition at line 18 of file HcalHPDRBXMap.cc.

18 {}
HcalHPDRBXMap::~HcalHPDRBXMap ( )
private

Definition at line 19 of file HcalHPDRBXMap.cc.

19 {}

Member Function Documentation

int HcalHPDRBXMap::indexHPD ( const HcalDetId id)
static

Definition at line 192 of file HcalHPDRBXMap.cc.

References abs, edm::hlt::Exception, HcalBarrel, HcalEndcap, getHLTprescales::index, isValid(), edm::errors::LogicError, and NUM_HPDS_PER_SUBDET.

Referenced by HBHEIsolatedNoiseReflagger::DumpHBHEHitMap(), reco::HcalNoiseRBXArray::findHPD(), HBHEHitMapOrganizer::getHPDNeighbors(), HBHEHitMapOrganizer::HBHEHitMapOrganizer(), indexHPDfromEtaPhi(), and indexRBX().

193 {
194  // return bad index if subdetector is invalid
195  if(!isValid(id)) {
197  << " HcalDetId " << id << " is invalid in HcalHPDRBXMap::indexHPD().\n";
198  }
199 
200  // specify the readout module (subdet and number)
201  int subdet=-1;
202  if(id.subdet()==HcalBarrel && id.zside()==1) subdet=0;
203  if(id.subdet()==HcalBarrel && id.zside()==-1) subdet=1;
204  if(id.subdet()==HcalEndcap && id.zside()==1) subdet=2;
205  if(id.subdet()==HcalEndcap && id.zside()==-1) subdet=3;
206 
207  int iphi=id.iphi();
208  int absieta=abs(id.ieta());
209 
210  // adjust for offset between iphi and the HPD index
211  // index-->iphi
212  // 0-->71, 1-->72, 2-->1, 3-->2, 4-->3, ..., 70-->69, 71-->70
213  int index=iphi+1;
214  if(index>=NUM_HPDS_PER_SUBDET) index-=NUM_HPDS_PER_SUBDET;
215  index+=subdet*NUM_HPDS_PER_SUBDET;
216 
217  // modify the index in the HE
218  if((subdet==2 || subdet==3) && absieta>=21 && absieta<=29) {
219  if(iphi%4==3 && absieta%2==1 && absieta!=29) index++;
220  if(iphi%4==3 && absieta==29 && id.depth()==2) index++;
221  if(iphi%4==1 && absieta%2==0 && absieta!=29) index++;
222  if(iphi%4==1 && absieta==29 && id.depth()==1) index++;
223  }
224  return index;
225 }
#define abs(x)
Definition: mlp_lapack.h:159
static const int NUM_HPDS_PER_SUBDET
Definition: HcalHPDRBXMap.h:31
static bool isValid(const HcalDetId &)
void HcalHPDRBXMap::indexHPDfromEtaPhi ( int  ieta,
int  iphi,
std::vector< int > &  hpdindices 
)
static

Definition at line 232 of file HcalHPDRBXMap.cc.

References abs, HcalBarrel, HcalEndcap, and indexHPD().

Referenced by reco::HcalNoiseRBXArray::findHPD().

233 {
234  // clear the vector
235  hpdindices.clear();
236  int absieta=abs(ieta);
237 
238  if(absieta<=15) { // HB only, depth doesn't matter
239  hpdindices.push_back(indexHPD(HcalDetId(HcalBarrel, ieta, iphi, 1)));
240  } else if(absieta==16) { // HB and HE, depth doesn't matter
241  hpdindices.push_back(indexHPD(HcalDetId(HcalBarrel, ieta, iphi, 1)));
242  hpdindices.push_back(indexHPD(HcalDetId(HcalEndcap, ieta, iphi, 3)));
243  } else if(absieta<29) { // HE only, depth doesn't matter
244  hpdindices.push_back(indexHPD(HcalDetId(HcalEndcap, ieta, iphi, 1)));
245  } else { // HE only, but depth matters
246  hpdindices.push_back(indexHPD(HcalDetId(HcalEndcap, ieta, iphi, 1)));
247  hpdindices.push_back(indexHPD(HcalDetId(HcalEndcap, ieta, iphi, 2)));
248  }
249 
250  return;
251 }
#define abs(x)
Definition: mlp_lapack.h:159
static int indexHPD(const HcalDetId &)
int HcalHPDRBXMap::indexRBX ( const HcalDetId id)
static

Definition at line 227 of file HcalHPDRBXMap.cc.

References indexHPD(), and indexRBXfromHPD().

Referenced by HBHEIsolatedNoiseReflagger::DumpHBHEHitMap(), reco::HcalNoiseRBXArray::findRBX(), HBHEHitMapOrganizer::HBHEHitMapOrganizer(), and indexRBXfromEtaPhi().

228 {
229  return indexRBXfromHPD(indexHPD(id));
230 }
static int indexRBXfromHPD(int hpdindex)
static int indexHPD(const HcalDetId &)
void HcalHPDRBXMap::indexRBXfromEtaPhi ( int  ieta,
int  iphi,
std::vector< int > &  rbxindices 
)
static

Definition at line 253 of file HcalHPDRBXMap.cc.

References abs, HcalBarrel, HcalEndcap, and indexRBX().

Referenced by reco::HcalNoiseRBXArray::findRBX().

254 {
255  // clear the vector
256  rbxindices.clear();
257  int absieta=abs(ieta);
258 
259  if(absieta<=15) { // HB only
260  rbxindices.push_back(indexRBX(HcalDetId(HcalBarrel, ieta, iphi, 1)));
261  } else if(absieta==16) { // HB and HE
262  rbxindices.push_back(indexRBX(HcalDetId(HcalBarrel, ieta, iphi, 1)));
263  rbxindices.push_back(indexRBX(HcalDetId(HcalEndcap, ieta, iphi, 3)));
264  } else { // HE only
265  rbxindices.push_back(indexRBX(HcalDetId(HcalEndcap, ieta, iphi, 1)));
266  }
267 
268  return;
269 }
static int indexRBX(const HcalDetId &)
#define abs(x)
Definition: mlp_lapack.h:159
int HcalHPDRBXMap::indexRBXfromHPD ( int  hpdindex)
static

Definition at line 181 of file HcalHPDRBXMap.cc.

References edm::hlt::Exception, isValidHPD(), edm::errors::LogicError, and NUM_HPDS_PER_RBX.

Referenced by reco::HcalNoiseRBXArray::findHPD(), and indexRBX().

182 {
183  if(!isValidHPD(hpdindex))
185  << " HPD index " << hpdindex << " is invalid in HcalHPDRBXMap::indexRBX().\n";
186 
187  return hpdindex/NUM_HPDS_PER_RBX;
188 }
static const int NUM_HPDS_PER_RBX
Definition: HcalHPDRBXMap.h:33
static bool isValidHPD(int index)
void HcalHPDRBXMap::indicesHPDfromRBX ( int  rbxindex,
boost::array< int, NUM_HPDS_PER_RBX > &  hpdindices 
)
static

Definition at line 168 of file HcalHPDRBXMap.cc.

References edm::hlt::Exception, i, isValidRBX(), edm::errors::LogicError, and NUM_HPDS_PER_RBX.

Referenced by reco::HcalNoiseRBXArray::HcalNoiseRBXArray(), iphihiRBX(), and iphiloRBX().

169 {
170  if(!isValidRBX(rbxindex))
172  << " RBX index " << rbxindex << " is invalid in HcalHPDRBXMap::indicesHPD().\n";
173 
174  for(unsigned int i=0; i<hpdindices.size(); i++)
175  hpdindices[i]=rbxindex*NUM_HPDS_PER_RBX+i;
176 
177  return;
178 }
static const int NUM_HPDS_PER_RBX
Definition: HcalHPDRBXMap.h:33
int i
Definition: DBlmapReader.cc:9
static bool isValidRBX(int index)
int HcalHPDRBXMap::iphihiHPD ( int  index)
static

Definition at line 131 of file HcalHPDRBXMap.cc.

References edm::hlt::Exception, HcalBarrel, isValidHPD(), edm::errors::LogicError, NUM_HPDS_PER_SUBDET, and subdetHPD().

Referenced by iphihiRBX().

132 {
133  if(!isValidHPD(index))
135  << " HPD index " << index << " is invalid in HcalHPDRBXMap::iphihiHPD().\n";
136 
137  // adjust for offset between iphi and the HPD index
138  // index-->iphi
139  // 0-->71, 1-->72, 2-->1, 3-->2, 4-->3, ..., 70-->69, 71-->70
140  int iphi=index%NUM_HPDS_PER_SUBDET-1;
141  if(iphi<=0) iphi+=NUM_HPDS_PER_SUBDET;
142 
143  // HB
144  if(subdetHPD(index)==HcalBarrel) return iphi;
145 
146  // HE
147  if(iphi%2==0) return iphi;
148  else return iphi+1;
149 }
static HcalSubdetector subdetHPD(int index)
static const int NUM_HPDS_PER_SUBDET
Definition: HcalHPDRBXMap.h:31
static bool isValidHPD(int index)
int HcalHPDRBXMap::iphihiRBX ( int  index)
static

Definition at line 152 of file HcalHPDRBXMap.cc.

References edm::hlt::Exception, indicesHPDfromRBX(), iphihiHPD(), isValidRBX(), edm::errors::LogicError, and NUM_HPDS_PER_RBX.

153 {
154  if(!isValidRBX(index))
156  << " RBX index " << index << " is invalid in HcalHPDRBXMap::iphihiRBX().\n";
157 
158  // get the list of HPD indices in the RBX
159  boost::array<int, NUM_HPDS_PER_RBX> arr;
160  indicesHPDfromRBX(index, arr);
161 
162  // return the highest iphi of the last HPD
163  return iphihiHPD(arr[NUM_HPDS_PER_RBX-1]);
164 }
static const int NUM_HPDS_PER_RBX
Definition: HcalHPDRBXMap.h:33
static bool isValidRBX(int index)
static void indicesHPDfromRBX(int rbxindex, boost::array< int, NUM_HPDS_PER_RBX > &hpdindices)
static int iphihiHPD(int index)
int HcalHPDRBXMap::iphiloHPD ( int  index)
static

Definition at line 95 of file HcalHPDRBXMap.cc.

References edm::hlt::Exception, HcalBarrel, isValidHPD(), edm::errors::LogicError, NUM_HPDS_PER_SUBDET, and subdetHPD().

Referenced by iphiloRBX().

96 {
97  if(!isValidHPD(index))
99  << " HPD index " << index << " is invalid in HcalHPDRBXMap::iphiloHPD().\n";
100 
101  // adjust for offset between iphi and the HPD index
102  // index-->iphi
103  // 0-->71, 1-->72, 2-->1, 3-->2, 4-->3, ..., 70-->69, 71-->70
104  int iphi=index%NUM_HPDS_PER_SUBDET-1;
105  if(iphi<=0) iphi+=NUM_HPDS_PER_SUBDET;
106 
107  // HB
108  if(subdetHPD(index)==HcalBarrel) return iphi;
109 
110  // HE
111  if(iphi%2==0) return iphi-1;
112  else return iphi;
113 }
static HcalSubdetector subdetHPD(int index)
static const int NUM_HPDS_PER_SUBDET
Definition: HcalHPDRBXMap.h:31
static bool isValidHPD(int index)
int HcalHPDRBXMap::iphiloRBX ( int  index)
static

Definition at line 116 of file HcalHPDRBXMap.cc.

References edm::hlt::Exception, indicesHPDfromRBX(), iphiloHPD(), isValidRBX(), and edm::errors::LogicError.

117 {
118  if(!isValidRBX(index))
120  << " RBX index " << index << " is invalid in HcalHPDRBXMap::iphiloRBX().\n";
121 
122  // get the list of HPD indices in the RBX
123  boost::array<int, NUM_HPDS_PER_RBX> arr;
124  indicesHPDfromRBX(index, arr);
125 
126  // return the lowest iphi of the first HPD
127  return iphiloHPD(arr[0]);
128 }
static int iphiloHPD(int index)
static bool isValidRBX(int index)
static void indicesHPDfromRBX(int rbxindex, boost::array< int, NUM_HPDS_PER_RBX > &hpdindices)
bool HcalHPDRBXMap::isValid ( const HcalDetId id)
static

Definition at line 33 of file HcalHPDRBXMap.cc.

References HcalBarrel, HcalEndcap, theTopology_, and HcalTopology::valid().

Referenced by reco::HcalNoiseRBXArray::findHPD(), reco::HcalNoiseRBXArray::findRBX(), and indexHPD().

34 {
35  if(id.subdet()!=HcalBarrel && id.subdet()!=HcalEndcap) return false;
36  if(theTopology_.valid(id)) return true;
37  else return false;
38 }
virtual bool valid(const HcalDetId &id) const
Definition: HcalTopology.cc:32
static HcalTopology theTopology_
Definition: HcalHPDRBXMap.h:93
bool HcalHPDRBXMap::isValid ( int  ieta,
int  iphi 
)
static

Definition at line 40 of file HcalHPDRBXMap.cc.

References abs.

41 {
42  int absieta=abs(ieta);
43  if(absieta<=29 && absieta>=1 && iphi>=1 && iphi<=72) {
44  if(absieta<=20) return true;
45  if(absieta>=21 && iphi%2==1) return true;
46  }
47  return false;
48 }
#define abs(x)
Definition: mlp_lapack.h:159
bool HcalHPDRBXMap::isValidHPD ( int  index)
static

Definition at line 22 of file HcalHPDRBXMap.cc.

References NUM_HPDS.

Referenced by reco::HcalNoiseRBXArray::findHPD(), indexRBXfromHPD(), iphihiHPD(), iphiloHPD(), subdetHPD(), and zsideHPD().

23 {
24  return (index>=0 && index<=NUM_HPDS-1);
25 }
static const int NUM_HPDS
Definition: HcalHPDRBXMap.h:29
bool HcalHPDRBXMap::isValidRBX ( int  index)
static

Definition at line 28 of file HcalHPDRBXMap.cc.

References NUM_RBXS.

Referenced by reco::HcalNoiseRBXArray::findRBX(), indicesHPDfromRBX(), iphihiRBX(), iphiloRBX(), subdetRBX(), and zsideRBX().

29 {
30  return (index>=0 && index<=NUM_RBXS-1);
31 }
static const int NUM_RBXS
Definition: HcalHPDRBXMap.h:35
static int HcalHPDRBXMap::numHPDs ( void  )
inlinestatic

Definition at line 40 of file HcalHPDRBXMap.h.

References NUM_HPDS.

40 { return NUM_HPDS; }
static const int NUM_HPDS
Definition: HcalHPDRBXMap.h:29
static int HcalHPDRBXMap::numHPDsPerRBX ( void  )
inlinestatic

Definition at line 42 of file HcalHPDRBXMap.h.

References NUM_HPDS_PER_RBX.

42 { return NUM_HPDS_PER_RBX; }
static const int NUM_HPDS_PER_RBX
Definition: HcalHPDRBXMap.h:33
static int HcalHPDRBXMap::numHPDsPerSubdet ( void  )
inlinestatic

Definition at line 41 of file HcalHPDRBXMap.h.

References NUM_HPDS_PER_SUBDET.

41 { return NUM_HPDS_PER_SUBDET; }
static const int NUM_HPDS_PER_SUBDET
Definition: HcalHPDRBXMap.h:31
static int HcalHPDRBXMap::numRBXs ( void  )
inlinestatic

Definition at line 43 of file HcalHPDRBXMap.h.

References NUM_RBXS.

43 { return NUM_RBXS; }
static const int NUM_RBXS
Definition: HcalHPDRBXMap.h:35
static int HcalHPDRBXMap::numRBXsPerSubdet ( void  )
inlinestatic

Definition at line 44 of file HcalHPDRBXMap.h.

References NUM_RBXS_PER_SUBDET.

44 { return NUM_RBXS_PER_SUBDET; }
static const int NUM_RBXS_PER_SUBDET
Definition: HcalHPDRBXMap.h:37
HcalSubdetector HcalHPDRBXMap::subdetHPD ( int  index)
static

Definition at line 51 of file HcalHPDRBXMap.cc.

References edm::hlt::Exception, HcalBarrel, HcalEndcap, isValidHPD(), edm::errors::LogicError, and NUM_HPDS_PER_SUBDET.

Referenced by iphihiHPD(), and iphiloHPD().

52 {
53  if(!isValidHPD(index))
55  << " HPD index " << index << " is invalid in HcalHPDRBXMap::subdetHPD().\n";
56 
57  if(index/NUM_HPDS_PER_SUBDET<=1) return HcalBarrel;
58  else return HcalEndcap;
59 }
static const int NUM_HPDS_PER_SUBDET
Definition: HcalHPDRBXMap.h:31
static bool isValidHPD(int index)
HcalSubdetector HcalHPDRBXMap::subdetRBX ( int  index)
static

Definition at line 62 of file HcalHPDRBXMap.cc.

References edm::hlt::Exception, HcalBarrel, HcalEndcap, isValidRBX(), edm::errors::LogicError, and NUM_RBXS_PER_SUBDET.

63 {
64  if(!isValidRBX(index))
66  << " RBX index " << index << " is invalid in HcalHPDRBXMap::subdetRBX().\n";
67 
68  if(index/NUM_RBXS_PER_SUBDET<=1) return HcalBarrel;
69  else return HcalEndcap;
70 }
static bool isValidRBX(int index)
static const int NUM_RBXS_PER_SUBDET
Definition: HcalHPDRBXMap.h:37
int HcalHPDRBXMap::zsideHPD ( int  index)
static

Definition at line 73 of file HcalHPDRBXMap.cc.

References edm::hlt::Exception, isValidHPD(), edm::errors::LogicError, and NUM_HPDS_PER_SUBDET.

74 {
75  if(!isValidHPD(index))
77  << " HPD index " << index << " is invalid in HcalHPDRBXMap::zsideHPD().\n";
78 
79  if(index/NUM_HPDS_PER_SUBDET==0 || index/NUM_HPDS_PER_SUBDET==2) return 1;
80  else return -1;
81 }
static const int NUM_HPDS_PER_SUBDET
Definition: HcalHPDRBXMap.h:31
static bool isValidHPD(int index)
int HcalHPDRBXMap::zsideRBX ( int  index)
static

Definition at line 84 of file HcalHPDRBXMap.cc.

References edm::hlt::Exception, isValidRBX(), edm::errors::LogicError, and NUM_RBXS_PER_SUBDET.

85 {
86  if(!isValidRBX(index))
88  << " RBX index " << index << " is invalid in HcalHPDRBXMap::zsideRBX().\n";
89 
90  if(index/NUM_RBXS_PER_SUBDET==0 || index/NUM_RBXS_PER_SUBDET==2) return 1;
91  else return -1;
92 }
static bool isValidRBX(int index)
static const int NUM_RBXS_PER_SUBDET
Definition: HcalHPDRBXMap.h:37

Member Data Documentation

const int HcalHPDRBXMap::NUM_HPDS =288
static

Definition at line 29 of file HcalHPDRBXMap.h.

Referenced by isValidHPD(), and numHPDs().

const int HcalHPDRBXMap::NUM_HPDS_PER_RBX = 4
static
const int HcalHPDRBXMap::NUM_HPDS_PER_SUBDET =72
static

Definition at line 31 of file HcalHPDRBXMap.h.

Referenced by indexHPD(), iphihiHPD(), iphiloHPD(), numHPDsPerSubdet(), subdetHPD(), and zsideHPD().

const int HcalHPDRBXMap::NUM_RBXS =72
static

Definition at line 35 of file HcalHPDRBXMap.h.

Referenced by isValidRBX(), and numRBXs().

const int HcalHPDRBXMap::NUM_RBXS_PER_SUBDET =18
static

Definition at line 37 of file HcalHPDRBXMap.h.

Referenced by numRBXsPerSubdet(), subdetRBX(), and zsideRBX().

HcalTopology HcalHPDRBXMap::theTopology_
staticprivate

Definition at line 93 of file HcalHPDRBXMap.h.

Referenced by isValid().