CMS 3D CMS Logo

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