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("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 }
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:190
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:44
GEMOfflineDQMBase::getVFATNumber
int getVFATNumber(const int, const int, const int)
Definition: GEMOfflineDQMBase.h:55
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
GEMOfflineDQMBase::log_category_
std::string log_category_
Definition: GEMOfflineDQMBase.h:41
GEMOfflineDQMBase::setDetLabelsEta
void setDetLabelsEta(MonitorElement *, const GEMStation *)
Definition: GEMOfflineDQMBase.cc:49
GEMOfflineDQMBase::getNumEtaPartitions
int getNumEtaPartitions(const GEMStation *)
Definition: GEMOfflineDQMBase.cc:70
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:183
edm::ParameterSet
Definition: ParameterSet.h:47
GEMOfflineDQMBase::checkRefs
bool checkRefs(const std::vector< T * > &)
Definition: GEMOfflineDQMBase.h:70
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:86
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:65