CMS 3D CMS Logo

DetectorQuantity.cc
Go to the documentation of this file.
1 
3 
4 namespace hcaldqm
5 {
6  namespace quantity
7  {
8  int getValue_iphi(HcalDetId const& did)
9  {
10  return did.iphi();
11  }
12 
13  int getValue_ieta(HcalDetId const& did)
14  {
15  int x = did.ieta();
16  if (x<0)
17  x = did.subdet()==HcalForward ? x+41 : x+42;
18  else
19  x = did.subdet()==HcalForward ? x+42 : x+41;
20  return x;
21  }
22 
23  int getValue_depth(HcalDetId const& did)
24  {
25  return did.depth();
26  }
27 
28  int getValue_Subdet(HcalDetId const& did)
29  {
30  return did.subdet()-1;
31  }
32 
33  int getValue_SubdetPM(HcalDetId const& did)
34  {
35  return did.ieta()<0 ? 2*(did.subdet()-1) :
36  2*(did.subdet()-1)+1;
37  }
38 
39  uint32_t getBin_iphi(HcalDetId const& did)
40  {
41  return (uint32_t)(did.iphi());
42  }
43 
44  uint32_t getBin_ieta(HcalDetId const& did)
45  {
46  return (uint32_t)(getValue_ieta(did)+1);
47  }
48 
49  uint32_t getBin_depth(HcalDetId const& did)
50  {
51  return (uint32_t)(did.depth());
52  }
53 
54  uint32_t getBin_Subdet(HcalDetId const& did)
55  {
56  return (uint32_t)(did.subdet());
57  }
58 
59  uint32_t getBin_SubdetPM(HcalDetId const& did)
60  {
61  return ( uint32_t)(getValue_SubdetPM(did)+1);
62  }
63 
65  {
66  return HcalDetId(HcalBarrel, v, 1, 1);
67  }
68 
70  {
71  return HcalDetId(HcalBarrel,
72  v<=41?(v<=12?v-41:v-42):(v>=71?v-42:v-41), 1, 1);
73  }
74 
76  {
77  return HcalDetId(HcalBarrel, 1, 1, v);
78  }
79 
81  {
82  return HcalDetId((HcalSubdetector)(v+1), 1, 1, 1);
83  }
84 
86  {
87  return HcalDetId((HcalSubdetector)(v/2+1), v%2==0?1:-1, 1, 1);
88  }
89 
90  std::vector<std::string> getLabels_iphi()
91  {
92  return std::vector<std::string>();
93  }
94 
95  std::vector<std::string> getLabels_ieta()
96  {
97  std::vector<std::string> labels;
98  char name[10];
99  for (int i=0; i<84; i++)
100  {
101  sprintf(name, "%d", getDid_ieta(i).ieta());
102  labels.push_back(std::string(name));
103  }
104  return labels;
105  }
106 
107  std::vector<std::string> getLabels_depth()
108  {
109  return std::vector<std::string>();
110  }
111 
112  std::vector<std::string> getLabels_Subdet()
113  {
114  std::vector<std::string> labels;
115  for (int i=0; i<4; i++)
116  labels.push_back(constants::SUBDET_NAME[i]);
117  return labels;
118  }
119 
120  std::vector<std::string> getLabels_SubdetPM()
121  {
122  std::vector<std::string> labels;
123  for (int i=0; i<8; i++)
124  labels.push_back(constants::SUBDETPM_NAME[i]);
125  return labels;
126  }
127  }
128 }
HcalDetId getDid_ieta(int)
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
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()
T x() const
Cartesian x coordinate.
int depth() const
get the tower depth
Definition: HcalDetId.cc:108
std::string const SUBDET_NAME[SUBDET_NUM]
Definition: Constants.h:184
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
std::string const SUBDETPM_NAME[2 *SUBDET_NUM]
Definition: Constants.h:185
HcalSubdetector
Definition: HcalAssistant.h:31
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:103
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 &)