test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalHPDRBXMap.h
Go to the documentation of this file.
1 #ifndef _RECOMET_METALGORITHMS_HCALHPDRBXMAP_H_
2 #define _RECOMET_METALGORITHMS_HCALHPDRBXMAP_H_
3 
4 
5 //
6 // HcalHPDRBXMap.h
7 //
8 // description: Algorithm which isomorphically maps HPD/RBX locations to
9 // integers ranging from 0 to NUM_HPDS-1/NUM_RBXS-1. The HPDs/RBXs
10 // are ordered from lowest to highest: HB+, HB-, HE+, HE-.
11 // This is used extensively by the various HcalNoise container
12 // classes. The constructor and destructor are hidden, since
13 // the only methods of interest are static. All the methods
14 // here are O(1).
15 //
16 // author: J.P. Chou, Brown
17 //
18 
19 #include "boost/array.hpp"
21 #include <vector>
22 
24  public:
25 
26  // "magic numbers"
27  // total number of HPDs in the HB and HE
28  const static int NUM_HPDS=288;
29  // total number of HPDs per subdetector (HB+, HB-, HE+, HE-)
30  const static int NUM_HPDS_PER_SUBDET=72;
31  // number of HPDs per RBX
32  const static int NUM_HPDS_PER_RBX = 4;
33  // total number of RBXs in the HB and HE
34  const static int NUM_RBXS=72;
35  // total number of RBXs per subdetector (e.g. HB+, HB-, HE+, HE-)
36  const static int NUM_RBXS_PER_SUBDET=18;
37 
38  // access magic numbers by inline function
39  inline int static numHPDs(void) { return NUM_HPDS; }
40  inline int static numHPDsPerSubdet(void) { return NUM_HPDS_PER_SUBDET; }
41  inline int static numHPDsPerRBX(void) { return NUM_HPDS_PER_RBX; }
42  inline int static numRBXs(void) { return NUM_RBXS; }
43  inline int static numRBXsPerSubdet(void) { return NUM_RBXS_PER_SUBDET; }
44 
45  // determines whether an HPD or RBX index is valid
46  // HPDs run from [0,NUM_HPDS-1], and RBXs run from [0,NUM_RBXS-1]
47  bool static isValidHPD(int index);
48  bool static isValidRBX(int index);
49 
50  // determines whether a HcalDetId corresponds to a valid HPD/RBX
51  // this requires that the HcalDetId be in the HB or HE, does not check depth
52  bool static isValid(const HcalDetId&);
53 
54  // determines whether the ieta, iphi coordinate corresponds to a valid HPD/RBX
55  bool static isValid(int ieta, int iphi);
56 
57  // location of the HPD/RBX in the detector based on the HPD/RBX index
58  // exception is thrown if index is invalid
59  HcalSubdetector static subdetHPD(int index);
60  HcalSubdetector static subdetRBX(int index);
61  int static zsideHPD(int index);
62  int static zsideRBX(int index);
63  int static iphiloHPD(int index);
64  int static iphiloRBX(int index);
65  int static iphihiHPD(int index);
66  int static iphihiRBX(int index);
67 
68  // returns a list of HPD indices found in a given RBX
69  // exception is thrown if rbxindex is invalid
70  // HPD indices are ordered in phi-space
71  void static indicesHPDfromRBX(int rbxindex, boost::array<int, NUM_HPDS_PER_RBX>& hpdindices);
72 
73  // returns the RBX index given an HPD index
74  // exception is thrown if hpdindex is invalid
75  int static indexRBXfromHPD(int hpdindex);
76 
77  // get the HPD/RBX index from an HcalDetector id
78  // throws an exception if the HcalDetID does not correspond to a valid HPD/RBX
79  int static indexHPD(const HcalDetId&);
80  int static indexRBX(const HcalDetId&);
81 
82  // get the HPD/RBX indices corresponding to an ieta, iphi coordinate
83  // throws an exception if the ieta and iphi do not correspond to a valid HPD/RBX
84  void static indexHPDfromEtaPhi(int ieta, int iphi, std::vector<int>& hpdindices);
85  void static indexRBXfromEtaPhi(int ieta, int iphi, std::vector<int>& rbxindices);
86 
87  private:
88  HcalHPDRBXMap();
90 
91 };
92 
93 #endif
static const int NUM_HPDS_PER_RBX
Definition: HcalHPDRBXMap.h:32
static int indexRBXfromHPD(int hpdindex)
static int numRBXsPerSubdet(void)
Definition: HcalHPDRBXMap.h:43
static int numHPDsPerRBX(void)
Definition: HcalHPDRBXMap.h:41
static int indexRBX(const HcalDetId &)
static HcalSubdetector subdetHPD(int index)
static void indexHPDfromEtaPhi(int ieta, int iphi, std::vector< int > &hpdindices)
static int numHPDsPerSubdet(void)
Definition: HcalHPDRBXMap.h:40
static const int NUM_HPDS_PER_SUBDET
Definition: HcalHPDRBXMap.h:30
static int iphiloRBX(int index)
static const int NUM_RBXS
Definition: HcalHPDRBXMap.h:34
static const int NUM_HPDS
Definition: HcalHPDRBXMap.h:28
static int iphiloHPD(int index)
static bool isValidRBX(int index)
static int numRBXs(void)
Definition: HcalHPDRBXMap.h:42
static const int NUM_RBXS_PER_SUBDET
Definition: HcalHPDRBXMap.h:36
static void indexRBXfromEtaPhi(int ieta, int iphi, std::vector< int > &rbxindices)
static bool isValidHPD(int index)
static int numHPDs(void)
Definition: HcalHPDRBXMap.h:39
static int zsideHPD(int index)
HcalSubdetector
Definition: HcalAssistant.h:31
static bool isValid(const HcalDetId &)
static int iphihiRBX(int index)
static void indicesHPDfromRBX(int rbxindex, boost::array< int, NUM_HPDS_PER_RBX > &hpdindices)
static HcalSubdetector subdetRBX(int index)
static int indexHPD(const HcalDetId &)
static int iphihiHPD(int index)
static int zsideRBX(int index)