CMS 3D CMS Logo

DetectorQuantity.cc
Go to the documentation of this file.
1 
3 
4 namespace hcaldqm {
5  namespace quantity {
6  int getValue_iphi(HcalDetId const &did) { return did.iphi(); }
7 
8  int getValue_ieta(HcalDetId const &did) {
9  int x = did.ieta();
10  if (x < 0)
11  x = did.subdet() == HcalForward ? x + 41 : x + 42;
12  else
13  x = did.subdet() == HcalForward ? x + 42 : x + 41;
14  return x;
15  }
16 
17  int getValue_depth(HcalDetId const &did) { return did.depth(); }
18 
19  int getValue_Subdet(HcalDetId const &did) { return did.subdet() - 1; }
20 
21  int getValue_SubdetPM(HcalDetId const &did) {
22  return did.ieta() < 0 ? 2 * (did.subdet() - 1) : 2 * (did.subdet() - 1) + 1;
23  }
24 
25  uint32_t getBin_iphi(HcalDetId const &did) { return (uint32_t)(did.iphi()); }
26 
27  uint32_t getBin_ieta(HcalDetId const &did) { return (uint32_t)(getValue_ieta(did) + 1); }
28 
29  uint32_t getBin_depth(HcalDetId const &did) { //return (uint32_t)(did.depth());}
30  return (uint32_t)(did.subdet() == HcalOuter ? 7 : did.depth());
31  }
32 
33  uint32_t getBin_Subdet(HcalDetId const &did) { return (uint32_t)(did.subdet()); }
34 
35  uint32_t getBin_SubdetPM(HcalDetId const &did) { return (uint32_t)(getValue_SubdetPM(did) + 1); }
36 
37  HcalDetId getDid_iphi(int v) { return HcalDetId(HcalBarrel, v, 1, 1); }
38 
40  return HcalDetId(HcalBarrel, v <= 41 ? (v <= 12 ? v - 41 : v - 42) : (v >= 71 ? v - 42 : v - 41), 1, 1);
41  }
42 
43  HcalDetId getDid_depth(int v) { return HcalDetId(HcalBarrel, 1, 1, v); }
44 
45  HcalDetId getDid_Subdet(int v) { return HcalDetId((HcalSubdetector)(v + 1), 1, 1, 1); }
46 
47  HcalDetId getDid_SubdetPM(int v) { return HcalDetId((HcalSubdetector)(v / 2 + 1), v % 2 == 0 ? 1 : -1, 1, 1); }
48 
49  std::vector<std::string> getLabels_iphi() { return std::vector<std::string>(); }
50 
51  std::vector<std::string> getLabels_ieta() {
52  std::vector<std::string> labels;
53  char name[10];
54  for (int i = 0; i < 84; i++) {
55  sprintf(name, "%d", getDid_ieta(i).ieta());
56  labels.push_back(std::string(name));
57  }
58  return labels;
59  }
60 
61  std::vector<std::string> getLabels_depth() { return std::vector<std::string>(); }
62 
63  std::vector<std::string> getLabels_Subdet() {
64  std::vector<std::string> labels;
65  for (int i = 0; i < 4; i++)
66  labels.push_back(constants::SUBDET_NAME[i]);
67  return labels;
68  }
69 
70  std::vector<std::string> getLabels_SubdetPM() {
71  std::vector<std::string> labels;
72  for (int i = 0; i < 8; i++)
73  labels.push_back(constants::SUBDETPM_NAME[i]);
74  return labels;
75  }
76  } // namespace quantity
77 } // namespace hcaldqm
HcalDetId getDid_ieta(int)
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:146
uint32_t getBin_iphi(HcalDetId const &)
std::vector< std::string > getLabels_SubdetPM()
std::vector< std::string > getLabels_ieta()
HcalDetId getDid_depth(int)
uint32_t getBin_SubdetPM(HcalDetId const &)
int getValue_ieta(HcalDetId const &)
uint32_t getBin_ieta(HcalDetId const &)
uint32_t getBin_Subdet(HcalDetId const &)
std::vector< std::string > getLabels_Subdet()
int depth() const
get the tower depth
Definition: HcalDetId.h:166
std::string const SUBDET_NAME[SUBDET_NUM]
Definition: Constants.h:154
int ieta() const
get the cell ieta
Definition: HcalDetId.h:159
std::string const SUBDETPM_NAME[2 *SUBDET_NUM]
Definition: Constants.h:155
HcalSubdetector
Definition: HcalAssistant.h:31
int iphi() const
get the cell iphi
Definition: HcalDetId.h:161
HcalDetId getDid_iphi(int)
HcalDetId getDid_SubdetPM(int)
uint32_t getBin_depth(HcalDetId const &)
std::vector< std::string > getLabels_depth()
int getValue_iphi(HcalDetId const &)
HcalDetId getDid_Subdet(int)
std::vector< std::string > getLabels_iphi()
int getValue_SubdetPM(HcalDetId const &)
int getValue_depth(HcalDetId const &)
int getValue_Subdet(HcalDetId const &)