CMS 3D CMS Logo

TrigTowerQuantity.cc
Go to the documentation of this file.
2 
3 namespace hcaldqm {
4  namespace quantity {
5  int getValue_TTiphi(HcalTrigTowerDetId const &tid) { return tid.iphi(); }
6 
7  int getValue_TTieta(HcalTrigTowerDetId const &tid) { return tid.ieta() < 0 ? tid.ieta() + 41 : tid.ieta() + 40; }
8 
9  int getValue_TTdepth(HcalTrigTowerDetId const &tid) { return tid.depth(); }
10 
11  int getValue_TTSubdet(HcalTrigTowerDetId const &tid) { return tid.ietaAbs() < 29 ? 0 : 1; }
12 
14  int x = tid.ietaAbs() < 29 ? 0 : 2;
15  return tid.ieta() > 0 ? x + 1 : x;
16  }
17 
19  return tid.ieta() < 0 ? tid.ieta() + 32 : tid.ieta() - 29 + 4;
20  }
21 
22  uint32_t getBin_TTiphi(HcalTrigTowerDetId const &tid) { return (uint32_t)(getValue_TTiphi(tid)); }
23 
24  uint32_t getBin_TTieta(HcalTrigTowerDetId const &tid) { return (uint32_t)(getValue_TTieta(tid) + 1); }
25 
26  uint32_t getBin_TTdepth(HcalTrigTowerDetId const &tid) { return (uint32_t)(getValue_TTdepth(tid) + 1); }
27 
28  uint32_t getBin_TTSubdet(HcalTrigTowerDetId const &tid) { return (uint32_t)(getValue_TTSubdet(tid) + 1); }
29 
30  uint32_t getBin_TTSubdetPM(HcalTrigTowerDetId const &tid) { return (uint32_t)(getValue_TTSubdetPM(tid) + 1); }
31 
32  uint32_t getBin_TTieta2x3(HcalTrigTowerDetId const &tid) { return (uint32_t)(getValue_TTieta2x3(tid) + 1); }
33 
35 
36  HcalTrigTowerDetId getTid_TTieta(int v) { return HcalTrigTowerDetId(v < 41 ? v - 41 : v - 40, 1); }
37 
39 
40  HcalTrigTowerDetId getTid_TTSubdet(int v) { return HcalTrigTowerDetId(v == 0 ? 1 : 29, 1); }
41 
43  return HcalTrigTowerDetId(v % 2 == 0 ? -(v >= 2 ? 29 : 1) : (v >= 2 ? 29 : 1), 1);
44  }
45 
47  // since numbering goes as
48  // -32 -29 29 32
49  // 0 3 4 7
50  return HcalTrigTowerDetId(v < 4 ? -(3 - v + 29) : (v - 4) + 29, 1);
51  }
52 
53  std::vector<std::string> getLabels_TTiphi() { return std::vector<std::string>(); }
54  std::vector<std::string> getLabels_TTieta() {
55  char name[10];
56  std::vector<std::string> labels;
57  for (int i = 0; i < 82; i++) {
58  sprintf(name, "%d", getTid_TTieta(i).ieta());
59  labels.push_back(name);
60  }
61  return labels;
62  }
63 
64  std::vector<std::string> getLabels_TTieta2x3() {
65  char name[10];
66  std::vector<std::string> labels;
67  for (int i = 0; i < 8; i++) {
68  sprintf(name, "%d", getTid_TTieta2x3(i).ieta());
69  labels.push_back(name);
70  }
71  return labels;
72  }
73 
74  std::vector<std::string> getLabels_TTdepth() { return std::vector<std::string>(); }
75 
76  std::vector<std::string> getLabels_TTSubdet() {
77  std::vector<std::string> labels;
78  labels.reserve(2);
79  for (int i = 0; i < 2; i++)
80  labels.push_back(constants::TPSUBDET_NAME[getTid_TTSubdet(i).ietaAbs() < 29 ? 0 : 1]);
81  return labels;
82  }
83 
84  std::vector<std::string> getLabels_TTSubdetPM() {
85  std::vector<std::string> labels;
86  for (int i = 0; i < 4; i++) {
88  int x = tid.ietaAbs() < 29 ? 0 : 2;
89  labels.push_back(constants::TPSUBDETPM_NAME[tid.ieta() > 0 ? x + 1 : x]);
90  return labels;
91  }
92  return labels;
93  }
94  } // namespace quantity
95 } // namespace hcaldqm
hcaldqm::quantity::getTid_TTdepth
HcalTrigTowerDetId getTid_TTdepth(int)
Definition: TrigTowerQuantity.cc:38
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
hcaldqm::quantity::getBin_TTSubdetPM
uint32_t getBin_TTSubdetPM(HcalTrigTowerDetId const &)
Definition: TrigTowerQuantity.cc:30
mps_fire.i
i
Definition: mps_fire.py:428
hcaldqm::quantity::getValue_TTieta
int getValue_TTieta(HcalTrigTowerDetId const &)
Definition: TrigTowerQuantity.cc:7
HcalTrigTowerDetId::ieta
int ieta() const
get the tower ieta
Definition: HcalTrigTowerDetId.h:54
hcaldqm::quantity::getLabels_TTieta
std::vector< std::string > getLabels_TTieta()
Definition: TrigTowerQuantity.cc:54
hcaldqm::quantity::getLabels_TTieta2x3
std::vector< std::string > getLabels_TTieta2x3()
Definition: TrigTowerQuantity.cc:64
hcaldqm
Definition: Constants.h:8
hcaldqm::quantity::getTid_TTieta
HcalTrigTowerDetId getTid_TTieta(int)
Definition: TrigTowerQuantity.cc:36
hcaldqm::quantity::getBin_TTieta2x3
uint32_t getBin_TTieta2x3(HcalTrigTowerDetId const &)
Definition: TrigTowerQuantity.cc:32
findQualityFiles.v
v
Definition: findQualityFiles.py:179
HcalTrigTowerDetId::ietaAbs
int ietaAbs() const
get the absolute value of the tower ieta
Definition: HcalTrigTowerDetId.h:52
hcaldqm::quantity::getTid_TTiphi
HcalTrigTowerDetId getTid_TTiphi(int)
Definition: TrigTowerQuantity.cc:34
hcaldqm::quantity::getLabels_TTSubdet
std::vector< std::string > getLabels_TTSubdet()
Definition: TrigTowerQuantity.cc:76
hcaldqm::quantity::getBin_TTieta
uint32_t getBin_TTieta(HcalTrigTowerDetId const &)
Definition: TrigTowerQuantity.cc:24
hcaldqm::quantity::getBin_TTiphi
uint32_t getBin_TTiphi(HcalTrigTowerDetId const &)
Definition: TrigTowerQuantity.cc:22
hcaldqm::quantity::getBin_TTdepth
uint32_t getBin_TTdepth(HcalTrigTowerDetId const &)
Definition: TrigTowerQuantity.cc:26
hcaldqm::quantity::getLabels_TTdepth
std::vector< std::string > getLabels_TTdepth()
Definition: TrigTowerQuantity.cc:74
hcaldqm::quantity::getTid_TTSubdetPM
HcalTrigTowerDetId getTid_TTSubdetPM(int)
Definition: TrigTowerQuantity.cc:42
hcaldqm::quantity::getLabels_TTiphi
std::vector< std::string > getLabels_TTiphi()
Definition: TrigTowerQuantity.cc:53
hcaldqm::constants::TPSUBDETPM_NAME
const std::string TPSUBDETPM_NAME[2 *TPSUBDET_NUM]
Definition: Constants.h:168
MjjMonitor_cfi.quantity
quantity
Definition: MjjMonitor_cfi.py:10
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
hcaldqm::quantity::getValue_TTSubdet
int getValue_TTSubdet(HcalTrigTowerDetId const &)
Definition: TrigTowerQuantity.cc:11
HcalTrigTowerDetId::depth
int depth() const
get the depth (zero for LHC Run 1, may be nonzero for later runs)
Definition: HcalTrigTowerDetId.h:58
hcaldqm::quantity::getValue_TTSubdetPM
int getValue_TTSubdetPM(HcalTrigTowerDetId const &)
Definition: TrigTowerQuantity.cc:13
hcaldqm::quantity::getTid_TTSubdet
HcalTrigTowerDetId getTid_TTSubdet(int)
Definition: TrigTowerQuantity.cc:40
hcaldqm::quantity::getValue_TTiphi
int getValue_TTiphi(HcalTrigTowerDetId const &)
Definition: TrigTowerQuantity.cc:5
hcaldqm::quantity::getValue_TTieta2x3
int getValue_TTieta2x3(HcalTrigTowerDetId const &)
Definition: TrigTowerQuantity.cc:18
hcaldqm::quantity::getBin_TTSubdet
uint32_t getBin_TTSubdet(HcalTrigTowerDetId const &)
Definition: TrigTowerQuantity.cc:28
TrigTowerQuantity.h
HcalTrigTowerDetId::iphi
int iphi() const
get the tower iphi
Definition: HcalTrigTowerDetId.h:56
hcaldqm::quantity::getLabels_TTSubdetPM
std::vector< std::string > getLabels_TTSubdetPM()
Definition: TrigTowerQuantity.cc:84
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
hcaldqm::quantity::getTid_TTieta2x3
HcalTrigTowerDetId getTid_TTieta2x3(int)
Definition: TrigTowerQuantity.cc:46
hcaldqm::quantity::getValue_TTdepth
int getValue_TTdepth(HcalTrigTowerDetId const &)
Definition: TrigTowerQuantity.cc:9
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14
hcaldqm::constants::TPSUBDET_NAME
const std::string TPSUBDET_NAME[TPSUBDET_NUM]
Definition: Constants.h:167