CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HLTMuonValidator Class Reference
Inheritance diagram for HLTMuonValidator:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 HLTMuonValidator (const edm::ParameterSet &)
 
- 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
 
 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
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
void fillLabels (std::string const &path, std::vector< std::string > &moduleLabels, std::vector< std::string > &stepLabels) const
 
std::string stepLabel (std::string const &moduleLabel) const
 

Private Attributes

std::vector< HLTMuonPlotteranalyzers_
 
edm::EDGetTokenT< reco::GenParticleCollection > const genParticlesToken_
 
HLTConfigProvider hltConfig_
 
std::vector< std::string > hltPathsToCheck_
 
std::string hltProcessName_
 
HLTMuonPlotter::L1MuonMatcherAlgoForDQM const l1tMuonMatcherAlgo_
 
edm::ParameterSet pset_
 
edm::EDGetTokenT< reco::MuonCollection > const recoMuonsToken_
 
edm::EDGetTokenT< trigger::TriggerEventWithRefs > const triggerEventToken_
 

Additional Inherited Members

- 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
 
- 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 22 of file HLTMuonValidator.cc.

Constructor & Destructor Documentation

◆ HLTMuonValidator()

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

Definition at line 54 of file HLTMuonValidator.cc.

55  : pset_(pset),
56  hltProcessName_(pset.getParameter<std::string>("hltProcessName")),
57  hltPathsToCheck_(pset.getParameter<std::vector<std::string>>("hltPathsToCheck")),
58  triggerEventToken_(consumes(edm::InputTag("hltTriggerSummaryRAW"))),
59  genParticlesToken_(consumes(pset.getParameter<std::string>("genParticleLabel"))),
60  recoMuonsToken_(consumes(pset.getParameter<std::string>("recMuonLabel"))),
61  l1tMuonMatcherAlgo_(pset, consumesCollector()) {}
edm::EDGetTokenT< reco::MuonCollection > const recoMuonsToken_
HLTMuonPlotter::L1MuonMatcherAlgoForDQM const l1tMuonMatcherAlgo_
edm::ParameterSet pset_
std::vector< std::string > hltPathsToCheck_
edm::EDGetTokenT< trigger::TriggerEventWithRefs > const triggerEventToken_
edm::EDGetTokenT< reco::GenParticleCollection > const genParticlesToken_
std::string hltProcessName_

Member Function Documentation

◆ analyze()

void HLTMuonValidator::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 175 of file HLTMuonValidator.cc.

References analyzers_, and iEvent.

175  {
176  for (auto &analyzer : analyzers_) {
177  analyzer.analyze(iEvent, iSetup);
178  }
179 }
std::vector< HLTMuonPlotter > analyzers_
int iEvent
Definition: GenABIO.cc:224

◆ bookHistograms()

void HLTMuonValidator::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 168 of file HLTMuonValidator.cc.

References analyzers_.

168  {
169  // Call the beginRun (which books all the histograms)
170  for (auto &analyzer : analyzers_) {
171  analyzer.beginRun(iBooker, iRun, iSetup);
172  }
173 }
std::vector< HLTMuonPlotter > analyzers_

◆ dqmBeginRun()

void HLTMuonValidator::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 130 of file HLTMuonValidator.cc.

References ramdisk_dqm_sourceclient-live_cfg::analyzer, analyzers_, fillLabels(), genParticlesToken_, hltConfig_, HLTSiStripMonitoring_cff::hltPaths, hltPathsToCheck_, hltProcessName_, mps_fire::i, HLTConfigProvider::init(), dqmiolumiharvest::j, l1tMuonMatcherAlgo_, SummaryClient_cfi::labels, castor_dqm_sourceclient_file_cfg::path, topSingleLeptonDQM_PU_cfi::pattern, pset_, recoMuonsToken_, customisers::steps, AlCaHLTBitMon_QueryRunRegistry::string, triggerEventToken_, and HLTConfigProvider::triggerNames().

130  {
131  // Initialize hltConfig
132  bool changedConfig;
133  if (!hltConfig_.init(iRun, iSetup, hltProcessName_, changedConfig)) {
134  edm::LogError("HLTMuonVal") << "Initialization of HLTConfigProvider failed!!";
135  return;
136  }
137 
138  // Get the set of trigger paths we want to make plots for
139  std::set<std::string> hltPaths;
140  for (size_t i = 0; i < hltPathsToCheck_.size(); i++) {
141  TPRegexp pattern(hltPathsToCheck_[i]);
142  for (size_t j = 0; j < hltConfig_.triggerNames().size(); j++)
143  if (TString(hltConfig_.triggerNames()[j]).Contains(pattern))
144  hltPaths.insert(hltConfig_.triggerNames()[j]);
145  }
146 
147  // Initialize the analyzers
148  analyzers_.clear();
149  std::set<std::string>::iterator iPath;
150  for (iPath = hltPaths.begin(); iPath != hltPaths.end(); iPath++) {
151  const std::string &path = *iPath;
152  std::string shortpath = path;
153  if (path.rfind("_v") < path.length())
154  shortpath = path.substr(0, path.rfind("_v"));
155 
156  std::vector<std::string> labels;
157  std::vector<std::string> steps;
159 
160  if (!labels.empty() && !steps.empty()) {
163  analyzers_.push_back(analyzer);
164  }
165  }
166 }
void fillLabels(std::string const &path, std::vector< std::string > &moduleLabels, std::vector< std::string > &stepLabels) const
edm::EDGetTokenT< reco::MuonCollection > const recoMuonsToken_
HLTMuonPlotter::L1MuonMatcherAlgoForDQM const l1tMuonMatcherAlgo_
std::vector< HLTMuonPlotter > analyzers_
edm::ParameterSet pset_
Log< level::Error, false > LogError
std::vector< std::string > hltPathsToCheck_
edm::EDGetTokenT< trigger::TriggerEventWithRefs > const triggerEventToken_
HLTConfigProvider hltConfig_
edm::EDGetTokenT< reco::GenParticleCollection > const genParticlesToken_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::string hltProcessName_

◆ fillLabels()

void HLTMuonValidator::fillLabels ( std::string const &  path,
std::vector< std::string > &  moduleLabels,
std::vector< std::string > &  stepLabels 
) const
private

Definition at line 63 of file HLTMuonValidator.cc.

References spr::find(), custom_jme_cff::foo, hltConfig_, or, castor_dqm_sourceclient_file_cfg::path, HLTConfigProvider::saveTagsModules(), and stepLabel().

Referenced by dqmBeginRun().

65  {
66  auto const &hltFilters = hltConfig_.saveTagsModules(path);
67 
68  moduleLabels.clear();
69  moduleLabels.reserve(hltFilters.size());
70 
71  stepLabels.clear();
72  stepLabels.reserve(hltFilters.size() + 1);
73 
74  for (auto const &module : hltFilters) {
75  if (module.find("Filtered") == std::string::npos)
76  continue;
77 
78  auto const step_label = stepLabel(module);
79  if (step_label.empty() or std::find(stepLabels.begin(), stepLabels.end(), step_label) != stepLabels.end())
80  continue;
81 
82  moduleLabels.emplace_back(module);
83  stepLabels.emplace_back(step_label);
84  }
85 
86  if (stepLabels.empty()) {
87  return;
88  }
89 
90  if (stepLabels[0] != "L1" and std::find(stepLabels.begin(), stepLabels.end(), "L1") != stepLabels.end()) {
91  edm::LogWarning wrn("HLTMuonValidator");
92  wrn << "Unsupported list of 'step' labels (the label 'L1' is present, but is not the first one): stepLabels=(";
93  for (auto const &foo : stepLabels)
94  wrn << " " << foo;
95  wrn << " )";
96 
97  moduleLabels.clear();
98  stepLabels.clear();
99  return;
100  }
101 
102  stepLabels.insert(stepLabels.begin(), "All");
103 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::string stepLabel(std::string const &moduleLabel) const
HLTConfigProvider hltConfig_
const std::vector< std::string > & saveTagsModules(unsigned int trigger) const

◆ stepLabel()

std::string HLTMuonValidator::stepLabel ( std::string const &  moduleLabel) const
private

Definition at line 105 of file HLTMuonValidator.cc.

Referenced by fillLabels().

105  {
106  if (module.find("IsoFiltered") != std::string::npos) {
107  return (module.find("L3") != std::string::npos) ? "L3TkIso" : "L2Iso";
108  } else if (module.find("pfecalIsoRhoFiltered") != std::string::npos) {
109  if (module.find("L3") != std::string::npos)
110  return "L3EcalIso";
111  else if (module.find("TkFiltered") != std::string::npos)
112  return "TkEcalIso";
113  } else if (module.find("pfhcalIsoRhoFiltered") != std::string::npos) {
114  if (module.find("L3") != std::string::npos)
115  return "L3HcalIso";
116  else if (module.find("TkFiltered") != std::string::npos)
117  return "TkHcalIso";
118  } else if (module.find("TkFiltered") != std::string::npos)
119  return "Tk";
120  else if (module.find("L3") != std::string::npos)
121  return "L3";
122  else if (module.find("L2") != std::string::npos)
123  return "L2";
124  else if (module.find("L1") != std::string::npos)
125  return "L1";
126 
127  return "";
128 }

Member Data Documentation

◆ analyzers_

std::vector<HLTMuonPlotter> HLTMuonValidator::analyzers_
private

◆ genParticlesToken_

edm::EDGetTokenT<reco::GenParticleCollection> const HLTMuonValidator::genParticlesToken_
private

Definition at line 48 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ hltConfig_

HLTConfigProvider HLTMuonValidator::hltConfig_
private

Definition at line 45 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and fillLabels().

◆ hltPathsToCheck_

std::vector<std::string> HLTMuonValidator::hltPathsToCheck_
private

Definition at line 41 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ hltProcessName_

std::string HLTMuonValidator::hltProcessName_
private

Definition at line 40 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ l1tMuonMatcherAlgo_

HLTMuonPlotter::L1MuonMatcherAlgoForDQM const HLTMuonValidator::l1tMuonMatcherAlgo_
private

Definition at line 51 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ pset_

edm::ParameterSet HLTMuonValidator::pset_
private

Definition at line 39 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ recoMuonsToken_

edm::EDGetTokenT<reco::MuonCollection> const HLTMuonValidator::recoMuonsToken_
private

Definition at line 49 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ triggerEventToken_

edm::EDGetTokenT<trigger::TriggerEventWithRefs> const HLTMuonValidator::triggerEventToken_
private

Definition at line 47 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().