CMS 3D CMS Logo

GEMOfflineDQMBase.h
Go to the documentation of this file.
1 #ifndef DQMOffline_Muon_GEMOfflineDQMBase_h
2 #define DQMOffline_Muon_GEMOfflineDQMBase_h
3 
10 
12 public:
13  using MEMap = std::map<GEMDetId, dqm::impl::MonitorElement*>;
14 
15  explicit GEMOfflineDQMBase(const edm::ParameterSet&);
16 
17  inline int getVFATNumber(const int, const int, const int);
18  inline int getVFATNumberByStrip(const int, const int, const int);
19  inline int getMaxVFAT(const int);
20  inline int getDetOccXBin(const int, const int, const int);
21 
22  // Re: region / St: station, La: layer, Ch: chamber parity, Et: eta partition
23  inline GEMDetId getReStKey(const int, const int);
24  inline GEMDetId getReStKey(const GEMDetId&);
25  inline GEMDetId getReStLaKey(const GEMDetId&);
26  inline GEMDetId getReStEtKey(const GEMDetId&);
27  inline GEMDetId getReStLaChKey(const GEMDetId&);
28  inline GEMDetId getKey(const GEMDetId&); // == getReStLaChEtKey
29 
33  int getNumEtaPartitions(const GEMStation*); // the number of eta partitions per GEMChamber
34  void fillME(MEMap& me_map, const GEMDetId& key, const float x);
35  void fillME(MEMap& me_map, const GEMDetId& key, const float x, const float y);
36 
37  template <typename T>
38  inline bool checkRefs(const std::vector<T*>&);
39 
40  //
42 };
43 
44 inline int GEMOfflineDQMBase::getMaxVFAT(const int station) {
45  if (station == 0)
46  return GEMeMap::maxVFatGE0_;
47  else if (station == 1)
48  return GEMeMap::maxVFatGE11_;
49  else if (station == 2)
50  return GEMeMap::maxVFatGE21_;
51  else
52  return -1;
53 }
54 
55 inline int GEMOfflineDQMBase::getVFATNumber(const int station, const int ieta, const int vfat_phi) {
56  const int max_vfat = getMaxVFAT(station);
57  return max_vfat * (ieta - 1) + vfat_phi;
58 }
59 
60 inline int GEMOfflineDQMBase::getVFATNumberByStrip(const int station, const int ieta, const int strip) {
61  const int vfat_phi = (strip % GEMeMap::maxChan_) ? strip / GEMeMap::maxChan_ + 1 : strip / GEMeMap::maxChan_;
62  return getVFATNumber(station, ieta, vfat_phi);
63 }
64 
65 inline int GEMOfflineDQMBase::getDetOccXBin(const int chamber, const int layer, const int n_chambers) {
66  return n_chambers * (chamber - 1) + layer;
67 }
68 
69 template <typename T>
70 inline bool GEMOfflineDQMBase::checkRefs(const std::vector<T*>& refs) {
71  if (refs.empty())
72  return false;
73  if (refs.front() == nullptr)
74  return false;
75  return true;
76 }
77 
78 inline GEMDetId GEMOfflineDQMBase::getReStKey(const int region, const int station) {
79  // region, ring, station, layer, chamber, roll
80  return GEMDetId{region, 1, station, 0, 0, 0};
81 }
82 
83 inline GEMDetId GEMOfflineDQMBase::getReStKey(const GEMDetId& id) { return getReStKey(id.region(), id.station()); }
84 
86  return GEMDetId{id.region(), 1, id.station(), id.layer(), 0, 0};
87 }
88 
90  return GEMDetId{id.region(), 1, id.station(), 0, 0, id.roll()};
91 }
92 
94  return GEMDetId{id.region(), 1, id.station(), id.layer(), id.chamber() % 2, 0};
95 }
96 
98  return GEMDetId{id.region(), 1, id.station(), id.layer(), id.chamber() % 2, id.roll()};
99 }
100 
101 #endif // DQMOffline_Muon_GEMOfflineDQMBase_h
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
DDAxes::y
GEMOfflineDQMBase::getReStLaKey
GEMDetId getReStLaKey(const GEMDetId &)
Definition: GEMOfflineDQMBase.h:85
MessageLogger.h
GEMDetId::region
constexpr int region() const
Definition: GEMDetId.h:171
relativeConstraints.station
station
Definition: relativeConstraints.py:67
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
GEMOfflineDQMBase
Definition: GEMOfflineDQMBase.h:11
GEMOfflineDQMBase::getVFATNumberByStrip
int getVFATNumberByStrip(const int, const int, const int)
Definition: GEMOfflineDQMBase.h:60
DQMStore.h
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
GEMeMap::maxVFatGE21_
static const int maxVFatGE21_
Definition: GEMeMap.h:68
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:76
GEMeMap.h
GEMOfflineDQMBase::getKey
GEMDetId getKey(const GEMDetId &)
Definition: GEMOfflineDQMBase.h:97
GEMOfflineDQMBase::getReStLaChKey
GEMDetId getReStLaChKey(const GEMDetId &)
Definition: GEMOfflineDQMBase.h:93
GEMStation
Definition: GEMStation.h:19
edm::ESHandle< GEMGeometry >
GEMeMap::maxVFatGE11_
static const int maxVFatGE11_
Definition: GEMeMap.h:67
DQMEDAnalyzer.h
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
GEMOfflineDQMBase::MEMap
std::map< GEMDetId, dqm::impl::MonitorElement * > MEMap
Definition: GEMOfflineDQMBase.h:13
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
edm::ParameterSet
Definition: ParameterSet.h:47
GEMOfflineDQMBase::getReStEtKey
GEMDetId getReStEtKey(const GEMDetId &)
Definition: GEMOfflineDQMBase.h:89
GEMOfflineDQMBase::checkRefs
bool checkRefs(const std::vector< T * > &)
Definition: GEMOfflineDQMBase.h:70
GEMDetId
Definition: GEMDetId.h:18
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88267
GEMOfflineDQMBase::setDetLabelsVFAT
void setDetLabelsVFAT(MonitorElement *, const GEMStation *)
Definition: GEMOfflineDQMBase.cc:14
GEMeMap::maxVFatGE0_
static const int maxVFatGE0_
Definition: GEMeMap.h:66
GEMGeometry.h
GEMDetId.h
GEMOfflineDQMBase::getReStKey
GEMDetId getReStKey(const int, const int)
Definition: GEMOfflineDQMBase.h:78
GEMOfflineDQMBase::fillME
void fillME(MEMap &me_map, const GEMDetId &key, const float x)
Definition: GEMOfflineDQMBase.cc:92
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
crabWrapper.key
key
Definition: crabWrapper.py:19
GEMeMap::maxChan_
static const int maxChan_
Definition: GEMeMap.h:69
GEMOfflineDQMBase::getDetOccXBin
int getDetOccXBin(const int, const int, const int)
Definition: GEMOfflineDQMBase.h:65