CMS 3D CMS Logo

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("Superchamber / Chamber", 1);
56  for (const GEMSuperChamber* superchamber : station->superChambers()) {
57  const int num_chambers = superchamber->nChambers();
58 
59  for (const GEMChamber* chamber : superchamber->chambers()) {
60  const int sc = chamber->id().chamber();
61  const int ch = chamber->id().layer();
62  const int xbin = getDetOccXBin(sc, ch, num_chambers);
63  const char* label = Form("%d/%d", sc, ch);
64  me->setBinLabel(xbin, label, 1);
65  }
66  }
67 
68  const int num_etas = getNumEtaPartitions(station);
69  me->setAxisTitle("i#eta", 2);
70  for (int ieta = 1; ieta <= num_etas; ieta++) {
71  const std::string&& label = std::to_string(ieta);
72  me->setBinLabel(ieta, label, 2);
73  }
74 }
75 
77  const auto&& superchambers = station->superChambers();
78  if (not checkRefs(superchambers)) {
79  edm::LogError(log_category_) << "failed to get a valid vector of GEMSuperChamber ptrs" << std::endl;
80  return 0;
81  }
82 
83  const auto& chambers = superchambers.front()->chambers();
84  if (not checkRefs(chambers)) {
85  edm::LogError(log_category_) << "failed to get a valid vector of GEMChamber ptrs" << std::endl;
86  return 0;
87  }
88 
89  return chambers.front()->nEtaPartitions();
90 }
91 
92 void GEMOfflineDQMBase::fillME(MEMap& me_map, const GEMDetId& key, const float x) {
93  if UNLIKELY (me_map.find(key) == me_map.end()) {
94  const std::string hint = !me_map.empty() ? me_map.begin()->second->getName() : "empty";
95 
96  edm::LogError(log_category_) << "got invalid key: " << key << ", hint=" << hint << std::endl;
97 
98  } else {
99  me_map[key]->Fill(x);
100  }
101 }
102 
103 void GEMOfflineDQMBase::fillME(MEMap& me_map, const GEMDetId& key, const float x, const float y) {
104  if UNLIKELY (me_map.find(key) == me_map.end()) {
105  edm::LogError(log_category_) << "got invalid key: " << key << std::endl;
106 
107  } else {
108  me_map[key]->Fill(x, y);
109  }
110 }
Likely.h
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
DDAxes::y
GEMSuperChamber
Definition: GEMSuperChamber.h:19
GEMDetId::layer
constexpr int layer() const
Definition: GEMDetId.h:187
relativeConstraints.station
station
Definition: relativeConstraints.py:67
GEMSuperChamber::nChambers
int nChambers() const
Return numbers of chambers.
Definition: GEMSuperChamber.cc:25
GEMOfflineDQMBase::GEMOfflineDQMBase
GEMOfflineDQMBase(const edm::ParameterSet &)
Definition: GEMOfflineDQMBase.cc:4
DDAxes::x
GEMOfflineDQMBase::getMaxVFAT
int getMaxVFAT(const int)
Definition: GEMOfflineDQMBase.h:54
GEMOfflineDQMBase::getVFATNumber
int getVFATNumber(const int, const int, const int)
Definition: GEMOfflineDQMBase.h:65
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
GEMOfflineDQMBase::log_category_
std::string log_category_
Definition: GEMOfflineDQMBase.h:51
GEMOfflineDQMBase::setDetLabelsEta
void setDetLabelsEta(MonitorElement *, const GEMStation *)
Definition: GEMOfflineDQMBase.cc:49
GEMOfflineDQMBase::getNumEtaPartitions
int getNumEtaPartitions(const GEMStation *)
Definition: GEMOfflineDQMBase.cc:76
GEMStation
Definition: GEMStation.h:19
edm::ESHandle< GEMGeometry >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GEMOfflineDQMBase::MEMap
std::map< GEMDetId, dqm::impl::MonitorElement * > MEMap
Definition: GEMOfflineDQMBase.h:13
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
GEMDetId::chamber
constexpr int chamber() const
Definition: GEMDetId.h:180
edm::ParameterSet
Definition: ParameterSet.h:47
GEMOfflineDQMBase::checkRefs
bool checkRefs(const std::vector< T * > &)
Definition: GEMOfflineDQMBase.h:80
GEMDetId
Definition: GEMDetId.h:18
chambers
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
GEMOfflineDQMBase::setDetLabelsVFAT
void setDetLabelsVFAT(MonitorElement *, const GEMStation *)
Definition: GEMOfflineDQMBase.cc:14
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
gem
Definition: AMC13Event.h:6
GEMChamber
Definition: GEMChamber.h:19
GEMOfflineDQMBase.h
GEMOfflineDQMBase::fillME
void fillME(MEMap &me_map, const GEMDetId &key, const float x)
Definition: GEMOfflineDQMBase.cc:92
genVertex_cff.x
x
Definition: genVertex_cff.py:12
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
crabWrapper.key
key
Definition: crabWrapper.py:19
label
const char * label
Definition: PFTauDecayModeTools.cc:11
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
GEMOfflineDQMBase::getDetOccXBin
int getDetOccXBin(const int, const int, const int)
Definition: GEMOfflineDQMBase.h:75