CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
GEMOfflineMonitor Class Reference

#include <GEMOfflineMonitor.h>

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

Public Member Functions

 GEMOfflineMonitor (const edm::ParameterSet &)
 
 ~GEMOfflineMonitor () override
 
- Public Member Functions inherited from GEMOfflineDQMBase
template<typename T >
bool checkRefs (const std::vector< T * > &)
 
template<typename AnyKey >
TString convertKeyToStr (const AnyKey &key)
 
template<typename AnyKey >
void fillME (std::map< AnyKey, MonitorElement * > &, const AnyKey &, const float)
 
template<typename AnyKey >
void fillME (std::map< AnyKey, MonitorElement * > &, const AnyKey &, const float, const float y)
 
 GEMOfflineDQMBase (const edm::ParameterSet &)
 
int getDetOccXBin (const GEMDetId &, const edm::ESHandle< GEMGeometry > &)
 
int getDetOccXBin (const int, const int, const int)
 
int getMaxVFAT (const int)
 
int getNumEtaPartitions (const GEMStation *)
 
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
 
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 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 hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- 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

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Member Functions

void bookDetectorOccupancy (DQMStore::IBooker &, const GEMStation *, const MEMapKey1 &, const TString &, const TString &)
 

Private Attributes

edm::EDGetTokenT< GEMDigiCollectiondigi_token_
 
std::string log_category_
 
MEMap1 me_digi_det_
 
MEMap1 me_hit_det_
 
edm::EDGetTokenT< GEMRecHitCollectionrechit_token_
 

Additional Inherited Members

- Public Types inherited from GEMOfflineDQMBase
typedef std::map< MEMapKey1, MonitorElement * > MEMap1
 
typedef std::map< MEMapKey2, MonitorElement * > MEMap2
 
typedef std::map< MEMapKey3, MonitorElement * > MEMap3
 
typedef std::tuple< int, int > MEMapKey1
 
typedef std::tuple< int, int, bool > MEMapKey2
 
typedef std::tuple< int, int, bool, int > MEMapKey3
 
- 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 Attributes inherited from GEMOfflineDQMBase
std::string log_category_
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 11 of file GEMOfflineMonitor.h.

Constructor & Destructor Documentation

◆ GEMOfflineMonitor()

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

Definition at line 9 of file GEMOfflineMonitor.cc.

10  digi_token_ = consumes<GEMDigiCollection>(pset.getParameter<edm::InputTag>("digiTag"));
11  rechit_token_ = consumes<GEMRecHitCollection>(pset.getParameter<edm::InputTag>("recHitTag"));
12 }

References digi_token_, muonDTDigis_cfi::pset, and rechit_token_.

◆ ~GEMOfflineMonitor()

GEMOfflineMonitor::~GEMOfflineMonitor ( )
override

Definition at line 14 of file GEMOfflineMonitor.cc.

14 {}

Member Function Documentation

◆ analyze()

void GEMOfflineMonitor::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 82 of file GEMOfflineMonitor.cc.

82  {
83  edm::Handle<GEMDigiCollection> digi_collection;
84  event.getByToken(digi_token_, digi_collection);
85  if (not digi_collection.isValid()) {
86  edm::LogError(log_category_) << "GEMDigiCollection is invalid!" << std::endl;
87  return;
88  }
89 
90  edm::Handle<GEMRecHitCollection> rechit_collection;
91  event.getByToken(rechit_token_, rechit_collection);
92  if (not rechit_collection.isValid()) {
93  edm::LogError(log_category_) << "GEMRecHitCollection is invalid" << std::endl;
94  return;
95  }
96 
99  if (not gem.isValid()) {
100  edm::LogError(log_category_) << "GEMGeometry is invalid" << std::endl;
101  return;
102  }
103 
104  // GEMDigi
105  for (auto range_iter = digi_collection->begin(); range_iter != digi_collection->end(); range_iter++) {
106  const GEMDetId& gem_id = (*range_iter).first;
107  const GEMDigiCollection::Range& range = (*range_iter).second;
108 
109  const MEMapKey1 det_key{gem_id.region(), gem_id.station()};
110  for (auto digi = range.first; digi != range.second; ++digi) {
111  const int chamber_bin = getDetOccXBin(gem_id, gem);
112  const int vfat_number = getVFATNumberByStrip(gem_id.station(), gem_id.roll(), digi->strip());
113 
114  fillME(me_digi_det_, det_key, chamber_bin, vfat_number);
115  }
116  }
117 
118  // GEMRecHit
119  for (auto hit = rechit_collection->begin(); hit != rechit_collection->end(); hit++) {
120  const GEMDetId&& gem_id = hit->gemId();
121  const MEMapKey1 det_key{gem_id.region(), gem_id.station()};
122 
123  const int chamber_bin = getDetOccXBin(gem_id, gem);
124  fillME(me_hit_det_, det_key, chamber_bin, gem_id.roll());
125  }
126 }

References chamber_bin(), digi_token_, GEMOfflineDQMBase::fillME(), mixOne_premix_on_sim_cfi::gem, get, GEMOfflineDQMBase::getDetOccXBin(), GEMOfflineDQMBase::getVFATNumberByStrip(), edm::HandleBase::isValid(), log_category_, me_digi_det_, me_hit_det_, FastTimerService_cff::range, rechit_token_, GEMDetId::region(), GEMDetId::roll(), singleTopDQM_cfi::setup, and GEMDetId::station().

◆ bookDetectorOccupancy()

void GEMOfflineMonitor::bookDetectorOccupancy ( DQMStore::IBooker ibooker,
const GEMStation station,
const MEMapKey1 key,
const TString &  name_suffix,
const TString &  title_suffix 
)
private

Definition at line 47 of file GEMOfflineMonitor.cc.

51  {
52  BookingHelper helper(ibooker, name_suffix, title_suffix);
53  const auto&& superchambers = station->superChambers();
54  if (not checkRefs(superchambers)) {
55  edm::LogError(log_category_) << "failed to get a valid vector of GEMSuperChamber ptrs" << std::endl;
56  return;
57  }
58 
59  // per station
60  const int num_superchambers = superchambers.size();
61  const int num_chambers = num_superchambers * superchambers.front()->nChambers();
62  // the numer of VFATs per GEMEtaPartition
63  const int max_vfat = getMaxVFAT(station->station());
64  // the number of eta partitions per GEMChamber
65  const int num_etas = getNumEtaPartitions(station);
66  // the number of VFATs per GEMChamber
67  const int num_vfat = num_etas * max_vfat;
68 
69  // NOTE Digi
70  ibooker.setCurrentFolder("GEM/GEMOfflineMonitor/Digi");
71  me_digi_det_[key] =
72  helper.book2D("digi_det", "Digi Occupancy", num_chambers, 0.5, num_chambers + 0.5, num_vfat, 0.5, num_vfat + 0.5);
74 
75  // NOTE RecHit
76  ibooker.setCurrentFolder("GEM/GEMOfflineMonitor/RecHit");
77  me_hit_det_[key] =
78  helper.book2D("hit_det", "Hit Occupancy", num_chambers, 0.5, num_chambers + 0.5, num_etas, 0.5, num_etas + 0.5);
80 }

References GEMOfflineDQMBase::checkRefs(), GEMOfflineDQMBase::getMaxVFAT(), GEMOfflineDQMBase::getNumEtaPartitions(), crabWrapper::key, log_category_, me_digi_det_, me_hit_det_, dqm::implementation::NavigatorBase::setCurrentFolder(), GEMOfflineDQMBase::setDetLabelsEta(), GEMOfflineDQMBase::setDetLabelsVFAT(), and relativeConstraints::station.

Referenced by bookHistograms().

◆ bookHistograms()

void GEMOfflineMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  isetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 24 of file GEMOfflineMonitor.cc.

24  {
26  isetup.get<MuonGeometryRecord>().get(gem);
27  if (not gem.isValid()) {
28  edm::LogError(log_category_) << "GEMGeometry is invalid" << std::endl;
29  return;
30  }
31 
32  for (const GEMRegion* region : gem->regions()) {
33  const int region_number = region->region();
34  const char* region_sign = region_number > 0 ? "+" : "-";
35 
36  for (const GEMStation* station : region->stations()) {
37  const int station_number = station->station();
38 
39  const MEMapKey1 det_key{region_number, station_number};
40  const auto&& station_name = TString::Format("_ge%s%d1", region_sign, station_number);
41  const auto&& station_title = TString::Format(" : GE %s%d/1", region_sign, station_number);
42  bookDetectorOccupancy(ibooker, station, det_key, station_name, station_title);
43  } // station
44  } // region
45 }

References bookDetectorOccupancy(), mixOne_premix_on_sim_cfi::gem, edm::EventSetup::get(), get, log_category_, HLT_2018_cff::region, and relativeConstraints::station.

◆ fillDescriptions()

void GEMOfflineMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 16 of file GEMOfflineMonitor.cc.

16  {
18  desc.add<edm::InputTag>("digiTag", edm::InputTag("muonGEMDigis"));
19  desc.add<edm::InputTag>("recHitTag", edm::InputTag("gemRecHits"));
20  desc.addUntracked<std::string>("logCategory", "GEMOfflineMonitor");
21  descriptions.add("gemOfflineMonitor", desc);
22 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

Member Data Documentation

◆ digi_token_

edm::EDGetTokenT<GEMDigiCollection> GEMOfflineMonitor::digi_token_
private

Definition at line 25 of file GEMOfflineMonitor.h.

Referenced by analyze(), and GEMOfflineMonitor().

◆ log_category_

std::string GEMOfflineMonitor::log_category_
private

Definition at line 28 of file GEMOfflineMonitor.h.

Referenced by analyze(), bookDetectorOccupancy(), and bookHistograms().

◆ me_digi_det_

MEMap1 GEMOfflineMonitor::me_digi_det_
private

Definition at line 30 of file GEMOfflineMonitor.h.

Referenced by analyze(), and bookDetectorOccupancy().

◆ me_hit_det_

MEMap1 GEMOfflineMonitor::me_hit_det_
private

Definition at line 31 of file GEMOfflineMonitor.h.

Referenced by analyze(), and bookDetectorOccupancy().

◆ rechit_token_

edm::EDGetTokenT<GEMRecHitCollection> GEMOfflineMonitor::rechit_token_
private

Definition at line 26 of file GEMOfflineMonitor.h.

Referenced by analyze(), and GEMOfflineMonitor().

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
GEMOfflineMonitor::bookDetectorOccupancy
void bookDetectorOccupancy(DQMStore::IBooker &, const GEMStation *, const MEMapKey1 &, const TString &, const TString &)
Definition: GEMOfflineMonitor.cc:47
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
GEMDetId::region
constexpr int region() const
Definition: GEMDetId.h:165
relativeConstraints.station
station
Definition: relativeConstraints.py:67
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
GEMOfflineDQMBase::getVFATNumberByStrip
int getVFATNumberByStrip(const int, const int, const int)
Definition: GEMOfflineDQMBase.h:113
GEMOfflineDQMBase::GEMOfflineDQMBase
GEMOfflineDQMBase(const edm::ParameterSet &)
Definition: GEMOfflineDQMBase.cc:3
GEMOfflineMonitor::log_category_
std::string log_category_
Definition: GEMOfflineMonitor.h:28
edm::Handle< GEMDigiCollection >
GEMOfflineDQMBase::getMaxVFAT
int getMaxVFAT(const int)
Definition: GEMOfflineDQMBase.h:99
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
GEMOfflineDQMBase::setDetLabelsEta
void setDetLabelsEta(MonitorElement *, const GEMStation *)
Definition: GEMOfflineDQMBase.cc:50
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
GEMOfflineDQMBase::getNumEtaPartitions
int getNumEtaPartitions(const GEMStation *)
Definition: GEMOfflineDQMBase.cc:77
GEMStation
Definition: GEMStation.h:19
edm::ESHandle< GEMGeometry >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GEMOfflineDQMBase::fillME
void fillME(std::map< AnyKey, MonitorElement * > &, const AnyKey &, const float)
Definition: GEMOfflineDQMBase.h:155
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::LogError
Definition: MessageLogger.h:183
GEMOfflineDQMBase::MEMapKey1
std::tuple< int, int > MEMapKey1
Definition: GEMOfflineDQMBase.h:15
GEMOfflineDQMBase::checkRefs
bool checkRefs(const std::vector< T * > &)
Definition: GEMOfflineDQMBase.h:123
GEMDetId::roll
constexpr int roll() const
Definition: GEMDetId.h:188
GEMDetId
Definition: GEMDetId.h:17
helper
Definition: helper.py:1
GEMOfflineDQMBase::setDetLabelsVFAT
void setDetLabelsVFAT(MonitorElement *, const GEMStation *)
Definition: GEMOfflineDQMBase.cc:15
GEMOfflineMonitor::rechit_token_
edm::EDGetTokenT< GEMRecHitCollection > rechit_token_
Definition: GEMOfflineMonitor.h:26
get
#define get
gem
Definition: AMC13Event.h:6
GEMOfflineMonitor::digi_token_
edm::EDGetTokenT< GEMDigiCollection > digi_token_
Definition: GEMOfflineMonitor.h:25
GEMOfflineMonitor::me_hit_det_
MEMap1 me_hit_det_
Definition: GEMOfflineMonitor.h:31
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
GEMOfflineMonitor::me_digi_det_
MEMap1 me_digi_det_
Definition: GEMOfflineMonitor.h:30
chamber_bin
int chamber_bin(int station, int ring, int chamber)
Definition: L1TStage2EMTF.cc:468
MuonDigiCollection::Range
std::pair< const_iterator, const_iterator > Range
Definition: MuonDigiCollection.h:95
GEMDetId::station
constexpr int station() const
Definition: GEMDetId.h:173
mixOne_premix_on_sim_cfi.gem
gem
Definition: mixOne_premix_on_sim_cfi.py:194
GEMRegion
Definition: GEMRegion.h:19
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
crabWrapper.key
key
Definition: crabWrapper.py:19
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
GEMOfflineDQMBase::getDetOccXBin
int getDetOccXBin(const int, const int, const int)
Definition: GEMOfflineDQMBase.h:118