CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GEMOfflineDQMBase.cc
Go to the documentation of this file.
3 
5 
7  const GEMSuperChamber* superchamber = gem->superChamber(gem_id);
8  if (superchamber == nullptr) {
9  return -1;
10  }
11  return getDetOccXBin(gem_id.chamber(), gem_id.layer(), superchamber->nChambers());
12 }
13 
15  if (me == nullptr) {
16  edm::LogError(log_category_) << "MonitorElement* is nullptr" << std::endl;
17  return;
18  }
19 
20  me->setAxisTitle("Superchamber / Chamber", 1);
21  for (const GEMSuperChamber* superchamber : station->superChambers()) {
22  const int num_chambers = superchamber->nChambers();
23  for (const GEMChamber* chamber : superchamber->chambers()) {
24  const int sc = chamber->id().chamber();
25  const int ch = chamber->id().layer();
26  const int xbin = getDetOccXBin(sc, ch, num_chambers);
27  const char* label = Form("%d/%d", sc, ch);
28  me->setBinLabel(xbin, label, 1);
29  }
30  }
31 
32  me->setAxisTitle("VFAT (i#eta)", 2);
33  const int max_vfat = getMaxVFAT(station->station());
34  if (max_vfat < 0) {
35  edm::LogError(log_category_) << "Wrong max VFAT: " << max_vfat << " at Station " << station->station() << std::endl;
36  return;
37  }
38 
39  const int num_etas = getNumEtaPartitions(station);
40  for (int ieta = 1; ieta <= num_etas; ieta++) {
41  for (int vfat_phi = 1; vfat_phi <= max_vfat; vfat_phi++) {
42  const int ybin = getVFATNumber(station->station(), ieta, vfat_phi);
43  const char* label = Form("%d (%d)", ybin, ieta);
44  me->setBinLabel(ybin, label, 2);
45  }
46  }
47 }
48 
50  if (me == nullptr) {
51  edm::LogError(log_category_) << "MonitorElement* is nullptr" << std::endl;
52  return;
53  }
54 
55  me->setAxisTitle("Chamber", 1);
56  for (const GEMSuperChamber* superchamber : station->superChambers()) {
57  const int chamber = superchamber->id().chamber();
58  const std::string&& label = std::to_string(chamber);
59  me->setBinLabel(chamber, label, 1);
60  }
61 
62  const int num_etas = getNumEtaPartitions(station);
63  me->setAxisTitle("i#eta", 2);
64  for (int ieta = 1; ieta <= num_etas; ieta++) {
65  const std::string&& label = std::to_string(ieta);
66  me->setBinLabel(ieta, label, 2);
67  }
68 }
69 
71  const auto&& superchambers = station->superChambers();
72  if (not checkRefs(superchambers)) {
73  edm::LogError(log_category_) << "failed to get a valid vector of GEMSuperChamber ptrs" << std::endl;
74  return 0;
75  }
76 
77  const auto& chambers = superchambers.front()->chambers();
78  if (not checkRefs(chambers)) {
79  edm::LogError(log_category_) << "failed to get a valid vector of GEMChamber ptrs" << std::endl;
80  return 0;
81  }
82 
83  return chambers.front()->nEtaPartitions();
84 }
85 
86 void GEMOfflineDQMBase::fillME(MEMap& me_map, const GEMDetId& key, const float x) {
87  if UNLIKELY (me_map.find(key) == me_map.end()) {
88  const std::string hint = me_map.empty() ? "empty" : me_map.begin()->second->getName();
89  edm::LogError(log_category_) << "got an invalid key: " << key << ", hint=" << hint << std::endl;
90 
91  } else {
92  me_map[key]->Fill(x);
93  }
94 }
95 
96 void GEMOfflineDQMBase::fillME(MEMap& me_map, const GEMDetId& key, const float x, const float y) {
97  if UNLIKELY (me_map.find(key) == me_map.end()) {
98  const std::string hint = me_map.empty() ? "empty" : me_map.begin()->second->getName();
99  edm::LogError(log_category_) << "got an invalid key: " << key << ", hint=" << hint << std::endl;
100 
101  } else {
102  me_map[key]->Fill(x, y);
103  }
104 }
GEMOfflineDQMBase(const edm::ParameterSet &)
int getDetOccXBin(const int, const int, const int)
int station() const
Get the station.
Definition: GEMStation.cc:72
Log< level::Error, false > LogError
int getVFATNumber(const int, const int, const int)
std::string log_category_
void setDetLabelsEta(MonitorElement *, const GEMStation *)
std::vector< const GEMSuperChamber * > superChambers() const
Return the super chambers in the region.
Definition: GEMStation.cc:44
char const * label
bool checkRefs(const std::vector< T * > &)
int getMaxVFAT(const int)
int getNumEtaPartitions(const GEMStation *)
std::map< GEMDetId, dqm::impl::MonitorElement * > MEMap
tuple key
prepare the HTCondor submission files and eventually submit them
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void fillME(MEMap &me_map, const GEMDetId &key, const float x)
constexpr int chamber() const
Definition: GEMDetId.h:183
constexpr int layer() const
Definition: GEMDetId.h:190
int nChambers() const
Return numbers of chambers.
void setDetLabelsVFAT(MonitorElement *, const GEMStation *)
#define UNLIKELY(x)
Definition: Likely.h:21
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)