CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 int, const int, const int)
 
int getDetOccXBin (const GEMDetId &, const edm::ESHandle< GEMGeometry > &)
 
GEMDetId getKey (const GEMDetId &)
 
int getMaxVFAT (const int)
 
int getNumEtaPartitions (const GEMStation *)
 
GEMDetId getReStEtKey (const GEMDetId &)
 
GEMDetId getReStKey (const int, const int)
 
GEMDetId getReStKey (const GEMDetId &)
 
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
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (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

Definition at line 13 of file GEMOfflineDQMBase.h.

Constructor & Destructor Documentation

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

Definition at line 4 of file GEMOfflineDQMBase.cc.

4 {}

Member Function Documentation

template<typename T >
bool GEMOfflineDQMBase::checkRefs ( const std::vector< T * > &  refs)
inline
void GEMOfflineDQMBase::fillME ( MEMap me_map,
const GEMDetId key,
const float  x 
)

Definition at line 86 of file GEMOfflineDQMBase.cc.

References submitPVResolutionJobs::key, log_category_, AlCaHLTBitMon_QueryRunRegistry::string, and UNLIKELY.

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

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 }
Log< level::Error, false > LogError
std::string log_category_
tuple key
prepare the HTCondor submission files and eventually submit them
#define UNLIKELY(x)
Definition: Likely.h:21
void GEMOfflineDQMBase::fillME ( MEMap me_map,
const GEMDetId key,
const float  x,
const float  y 
)

Definition at line 96 of file GEMOfflineDQMBase.cc.

References submitPVResolutionJobs::key, log_category_, AlCaHLTBitMon_QueryRunRegistry::string, and UNLIKELY.

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 }
Log< level::Error, false > LogError
std::string log_category_
tuple key
prepare the HTCondor submission files and eventually submit them
#define UNLIKELY(x)
Definition: Likely.h:21
int GEMOfflineDQMBase::getDetOccXBin ( const int  chamber,
const int  layer,
const int  n_chambers 
)
inline

Definition at line 65 of file GEMOfflineDQMBase.h.

Referenced by GEMOfflineMonitor::doDigiOccupancy(), GEMOfflineMonitor::doHitOccupancy(), getDetOccXBin(), and setDetLabelsVFAT().

65  {
66  return n_chambers * (chamber - 1) + layer;
67 }
constexpr std::array< uint8_t, layerIndexSize > layer
int GEMOfflineDQMBase::getDetOccXBin ( const GEMDetId gem_id,
const edm::ESHandle< GEMGeometry > &  gem 
)

Definition at line 6 of file GEMOfflineDQMBase.cc.

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

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 }
int getDetOccXBin(const int, const int, const int)
constexpr int chamber() const
Definition: GEMDetId.h:183
constexpr int layer() const
Definition: GEMDetId.h:190
int nChambers() const
Return numbers of chambers.
GEMDetId GEMOfflineDQMBase::getKey ( const GEMDetId id)
inline

Definition at line 97 of file GEMOfflineDQMBase.h.

References GEMDetId::region().

97  {
98  return GEMDetId{id.region(), 1, id.station(), id.layer(), id.chamber() % 2, id.roll()};
99 }
constexpr int region() const
Definition: GEMDetId.h:171
int GEMOfflineDQMBase::getMaxVFAT ( const int  station)
inline

Definition at line 44 of file GEMOfflineDQMBase.h.

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

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

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 }
static const int maxVFatGE0_
Definition: GEMeMap.h:66
static const int maxVFatGE21_
Definition: GEMeMap.h:68
static const int maxVFatGE11_
Definition: GEMeMap.h:67
int GEMOfflineDQMBase::getNumEtaPartitions ( const GEMStation station)

Definition at line 70 of file GEMOfflineDQMBase.cc.

References chambers, checkRefs(), log_category_, and GEMStation::superChambers().

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

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 }
Log< level::Error, false > LogError
std::string log_category_
std::vector< const GEMSuperChamber * > superChambers() const
Return the super chambers in the region.
Definition: GEMStation.cc:44
bool checkRefs(const std::vector< T * > &)
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
GEMDetId GEMOfflineDQMBase::getReStEtKey ( const GEMDetId id)
inline

Definition at line 89 of file GEMOfflineDQMBase.h.

References GEMDetId::region().

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

89  {
90  return GEMDetId{id.region(), 1, id.station(), 0, 0, id.roll()};
91 }
constexpr int region() const
Definition: GEMDetId.h:171
GEMDetId GEMOfflineDQMBase::getReStKey ( const int  region,
const int  station 
)
inline
GEMDetId GEMOfflineDQMBase::getReStKey ( const GEMDetId id)
inline

Definition at line 83 of file GEMOfflineDQMBase.h.

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

83 { return getReStKey(id.region(), id.station()); }
GEMDetId getReStKey(const int, const int)
GEMDetId GEMOfflineDQMBase::getReStLaChKey ( const GEMDetId id)
inline

Definition at line 93 of file GEMOfflineDQMBase.h.

References GEMDetId::region().

93  {
94  return GEMDetId{id.region(), 1, id.station(), id.layer(), id.chamber() % 2, 0};
95 }
constexpr int region() const
Definition: GEMDetId.h:171
GEMDetId GEMOfflineDQMBase::getReStLaKey ( const GEMDetId id)
inline

Definition at line 85 of file GEMOfflineDQMBase.h.

References GEMDetId::region().

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

85  {
86  return GEMDetId{id.region(), 1, id.station(), id.layer(), 0, 0};
87 }
constexpr int region() const
Definition: GEMDetId.h:171
int GEMOfflineDQMBase::getVFATNumber ( const int  station,
const int  ieta,
const int  vfat_phi 
)
inline

Definition at line 55 of file GEMOfflineDQMBase.h.

References getMaxVFAT().

Referenced by getVFATNumberByStrip(), and setDetLabelsVFAT().

55  {
56  const int max_vfat = getMaxVFAT(station);
57  return max_vfat * (ieta - 1) + vfat_phi;
58 }
int getMaxVFAT(const int)
int GEMOfflineDQMBase::getVFATNumberByStrip ( const int  station,
const int  ieta,
const int  strip 
)
inline

Definition at line 60 of file GEMOfflineDQMBase.h.

References getVFATNumber(), and GEMeMap::maxChan_.

Referenced by GEMOfflineMonitor::doDigiOccupancy().

60  {
61  const int vfat_phi = (strip % GEMeMap::maxChan_) ? strip / GEMeMap::maxChan_ + 1 : strip / GEMeMap::maxChan_;
62  return getVFATNumber(station, ieta, vfat_phi);
63 }
static const int maxChan_
Definition: GEMeMap.h:72
int getVFATNumber(const int, const int, const int)
void GEMOfflineDQMBase::setDetLabelsEta ( MonitorElement me,
const GEMStation station 
)

Definition at line 49 of file GEMOfflineDQMBase.cc.

References getNumEtaPartitions(), label, log_category_, dqm::impl::MonitorElement::setAxisTitle(), dqm::impl::MonitorElement::setBinLabel(), AlCaHLTBitMon_QueryRunRegistry::string, and GEMStation::superChambers().

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

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 }
Log< level::Error, false > LogError
std::string log_category_
std::vector< const GEMSuperChamber * > superChambers() const
Return the super chambers in the region.
Definition: GEMStation.cc:44
char const * label
int getNumEtaPartitions(const GEMStation *)
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void GEMOfflineDQMBase::setDetLabelsVFAT ( MonitorElement me,
const GEMStation station 
)

Definition at line 14 of file GEMOfflineDQMBase.cc.

References getDetOccXBin(), getMaxVFAT(), getNumEtaPartitions(), getVFATNumber(), label, log_category_, dqm::impl::MonitorElement::setAxisTitle(), dqm::impl::MonitorElement::setBinLabel(), GEMStation::station(), and GEMStation::superChambers().

Referenced by GEMOfflineMonitor::bookDigiOccupancy().

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 }
int getDetOccXBin(const int, const int, const int)
int station() const
Get the station.
Definition: GEMStation.cc:72
Log< level::Error, false > LogError
int getVFATNumber(const int, const int, const int)
std::string log_category_
std::vector< const GEMSuperChamber * > superChambers() const
Return the super chambers in the region.
Definition: GEMStation.cc:44
char const * label
int getMaxVFAT(const int)
int getNumEtaPartitions(const GEMStation *)
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

std::string GEMOfflineDQMBase::log_category_