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 >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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 86 of file GEMOfflineDQMBase.cc.

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

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 96 of file GEMOfflineDQMBase.cc.

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

References crabWrapper::key, log_category_, AlCaHLTBitMon_QueryRunRegistry::string, 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 70 of file GEMOfflineDQMBase.cc.

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

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

Referenced by GEMOfflineMonitor::bookDigiOccupancy(), 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

◆ 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("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 }

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

Referenced by GEMEfficiencyAnalyzer::bookEfficiencyDetector(), 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:70
GEMeMap::maxVFatGE11_
static const int maxVFatGE11_
Definition: GEMeMap.h:67
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
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:88286
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
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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:72
GEMOfflineDQMBase::getDetOccXBin
int getDetOccXBin(const int, const int, const int)
Definition: GEMOfflineDQMBase.h:65