CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes
GEMOfflineDQMBase Class Reference

#include <GEMOfflineDQMBase.h>

Inheritance diagram for GEMOfflineDQMBase:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator > GEMEfficiencyAnalyzer GEMOfflineMonitor

Public Types

using MEMap = std::map< GEMDetId, dqm::impl::MonitorElement * >
 
- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Public Member Functions

template<typename T >
bool checkRefs (const std::vector< T * > &)
 
void fillME (MEMap &me_map, const GEMDetId &key, const float x)
 
void fillME (MEMap &me_map, const GEMDetId &key, const float x, const float y)
 
 GEMOfflineDQMBase (const edm::ParameterSet &)
 
int getDetOccXBin (const GEMDetId &, const edm::ESHandle< GEMGeometry > &)
 
int getDetOccXBin (const int, const int, const int)
 
GEMDetId getKey (const GEMDetId &)
 
int getMaxVFAT (const int)
 
int getNumEtaPartitions (const GEMStation *)
 
GEMDetId getReStEtKey (const GEMDetId &)
 
GEMDetId getReStKey (const GEMDetId &)
 
GEMDetId getReStKey (const int, const int)
 
GEMDetId getReStLaChKey (const GEMDetId &)
 
GEMDetId getReStLaKey (const GEMDetId &)
 
int getVFATNumber (const int, const int, const int)
 
int getVFATNumberByStrip (const int, const int, const int)
 
void setDetLabelsEta (MonitorElement *, const GEMStation *)
 
void setDetLabelsVFAT (MonitorElement *, const GEMStation *)
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Public Attributes

std::string log_category_
 

Additional Inherited Members

- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 11 of file GEMOfflineDQMBase.h.

Member Typedef Documentation

◆ MEMap

Definition at line 13 of file GEMOfflineDQMBase.h.

Constructor & Destructor Documentation

◆ GEMOfflineDQMBase()

GEMOfflineDQMBase::GEMOfflineDQMBase ( const edm::ParameterSet pset)
explicit

Definition at line 4 of file GEMOfflineDQMBase.cc.

4 {}

Member Function Documentation

◆ checkRefs()

template<typename T >
bool GEMOfflineDQMBase::checkRefs ( const std::vector< T * > &  refs)
inline

◆ fillME() [1/2]

void GEMOfflineDQMBase::fillME ( MEMap me_map,
const GEMDetId key,
const float  x 
)

Definition at line 92 of file GEMOfflineDQMBase.cc.

92  {
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 }

References crabWrapper::key, log_category_, AlCaHLTBitMon_QueryRunRegistry::string, UNLIKELY, and x.

Referenced by GEMEfficiencyAnalyzer::analyze(), GEMOfflineMonitor::doDigiOccupancy(), and GEMOfflineMonitor::doHitOccupancy().

◆ fillME() [2/2]

void GEMOfflineDQMBase::fillME ( MEMap me_map,
const GEMDetId key,
const float  x,
const float  y 
)

Definition at line 103 of file GEMOfflineDQMBase.cc.

103  {
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 }

References crabWrapper::key, log_category_, UNLIKELY, x, and y.

◆ getDetOccXBin() [1/2]

int GEMOfflineDQMBase::getDetOccXBin ( const GEMDetId gem_id,
const edm::ESHandle< GEMGeometry > &  gem 
)

Definition at line 6 of file GEMOfflineDQMBase.cc.

6  {
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 }

References GEMDetId::chamber(), getDetOccXBin(), GEMDetId::layer(), and GEMSuperChamber::nChambers().

◆ getDetOccXBin() [2/2]

int GEMOfflineDQMBase::getDetOccXBin ( const int  chamber,
const int  layer,
const int  n_chambers 
)
inline

◆ getKey()

GEMDetId GEMOfflineDQMBase::getKey ( const GEMDetId id)
inline

Definition at line 97 of file GEMOfflineDQMBase.h.

97  {
98  return GEMDetId{id.region(), 1, id.station(), id.layer(), id.chamber() % 2, id.roll()};
99 }

References GEMDetId::region().

◆ getMaxVFAT()

int GEMOfflineDQMBase::getMaxVFAT ( const int  station)
inline

Definition at line 44 of file GEMOfflineDQMBase.h.

44  {
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 }

References GEMeMap::maxVFatGE0_, GEMeMap::maxVFatGE11_, GEMeMap::maxVFatGE21_, and relativeConstraints::station.

Referenced by GEMOfflineMonitor::bookDigiOccupancy(), getVFATNumber(), and setDetLabelsVFAT().

◆ getNumEtaPartitions()

int GEMOfflineDQMBase::getNumEtaPartitions ( const GEMStation station)

Definition at line 76 of file GEMOfflineDQMBase.cc.

76  {
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 }

References chambers, checkRefs(), log_category_, and relativeConstraints::station.

Referenced by GEMOfflineMonitor::bookDigiOccupancy(), GEMEfficiencyAnalyzer::bookEfficiencyEtaPartition(), GEMOfflineMonitor::bookHitOccupancy(), setDetLabelsEta(), and setDetLabelsVFAT().

◆ getReStEtKey()

GEMDetId GEMOfflineDQMBase::getReStEtKey ( const GEMDetId id)
inline

Definition at line 89 of file GEMOfflineDQMBase.h.

89  {
90  return GEMDetId{id.region(), 1, id.station(), 0, 0, id.roll()};
91 }

References GEMDetId::region().

Referenced by GEMEfficiencyAnalyzer::analyze(), and GEMEfficiencyAnalyzer::bookResolution().

◆ getReStKey() [1/2]

GEMDetId GEMOfflineDQMBase::getReStKey ( const GEMDetId id)
inline

Definition at line 83 of file GEMOfflineDQMBase.h.

83 { return getReStKey(id.region(), id.station()); }

References getReStKey(), HLT_FULL_cff::region, and relativeConstraints::station.

◆ getReStKey() [2/2]

GEMDetId GEMOfflineDQMBase::getReStKey ( const int  region,
const int  station 
)
inline

◆ getReStLaChKey()

GEMDetId GEMOfflineDQMBase::getReStLaChKey ( const GEMDetId id)
inline

Definition at line 93 of file GEMOfflineDQMBase.h.

93  {
94  return GEMDetId{id.region(), 1, id.station(), id.layer(), id.chamber() % 2, 0};
95 }

References GEMDetId::region().

◆ getReStLaKey()

GEMDetId GEMOfflineDQMBase::getReStLaKey ( const GEMDetId id)
inline

Definition at line 85 of file GEMOfflineDQMBase.h.

85  {
86  return GEMDetId{id.region(), 1, id.station(), id.layer(), 0, 0};
87 }

References GEMDetId::region().

Referenced by GEMEfficiencyAnalyzer::analyze(), and GEMEfficiencyAnalyzer::bookEfficiencyChamber().

◆ getVFATNumber()

int GEMOfflineDQMBase::getVFATNumber ( const int  station,
const int  ieta,
const int  vfat_phi 
)
inline

Definition at line 55 of file GEMOfflineDQMBase.h.

55  {
56  const int max_vfat = getMaxVFAT(station);
57  return max_vfat * (ieta - 1) + vfat_phi;
58 }

References getMaxVFAT(), LEDCalibrationChannels::ieta, and relativeConstraints::station.

Referenced by getVFATNumberByStrip(), and setDetLabelsVFAT().

◆ getVFATNumberByStrip()

int GEMOfflineDQMBase::getVFATNumberByStrip ( const int  station,
const int  ieta,
const int  strip 
)
inline

◆ setDetLabelsEta()

void GEMOfflineDQMBase::setDetLabelsEta ( MonitorElement me,
const GEMStation station 
)

Definition at line 49 of file GEMOfflineDQMBase.cc.

49  {
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 }

References relativeConstraints::chamber, getDetOccXBin(), getNumEtaPartitions(), LEDCalibrationChannels::ieta, label, log_category_, hlt_dqm_clientPB-live_cfg::me, relativeConstraints::station, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by GEMEfficiencyAnalyzer::bookEfficiencyEtaPartition(), and GEMOfflineMonitor::bookHitOccupancy().

◆ setDetLabelsVFAT()

void GEMOfflineDQMBase::setDetLabelsVFAT ( MonitorElement me,
const GEMStation station 
)

Definition at line 14 of file GEMOfflineDQMBase.cc.

14  {
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 }

References relativeConstraints::chamber, getDetOccXBin(), getMaxVFAT(), getNumEtaPartitions(), getVFATNumber(), LEDCalibrationChannels::ieta, label, log_category_, hlt_dqm_clientPB-live_cfg::me, and relativeConstraints::station.

Referenced by GEMOfflineMonitor::bookDigiOccupancy().

Member Data Documentation

◆ log_category_

std::string GEMOfflineDQMBase::log_category_
DDAxes::y
GEMSuperChamber
Definition: GEMSuperChamber.h:19
GEMDetId::layer
constexpr int layer() const
Definition: GEMDetId.h:190
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
GEMSuperChamber::nChambers
int nChambers() const
Return numbers of chambers.
Definition: GEMSuperChamber.cc:25
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
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
GEMOfflineDQMBase::log_category_
std::string log_category_
Definition: GEMOfflineDQMBase.h:41
GEMOfflineDQMBase::getNumEtaPartitions
int getNumEtaPartitions(const GEMStation *)
Definition: GEMOfflineDQMBase.cc:76
GEMeMap::maxVFatGE11_
static const int maxVFatGE11_
Definition: GEMeMap.h:67
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
GEMDetId::chamber
constexpr int chamber() const
Definition: GEMDetId.h:183
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
chambers
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
gem
Definition: AMC13Event.h:6
GEMeMap::maxVFatGE0_
static const int maxVFatGE0_
Definition: GEMeMap.h:66
GEMChamber
Definition: GEMChamber.h:19
GEMOfflineDQMBase::getReStKey
GEMDetId getReStKey(const int, const int)
Definition: GEMOfflineDQMBase.h:78
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
GEMeMap::maxChan_
static const int maxChan_
Definition: GEMeMap.h:69
GEMOfflineDQMBase::getDetOccXBin
int getDetOccXBin(const int, const int, const int)
Definition: GEMOfflineDQMBase.h:65