CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HLTMuonValidator Class Reference
Inheritance diagram for HLTMuonValidator:

Public Member Functions

 HLTMuonValidator (const edm::ParameterSet &)
 

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
 
std::vector< std::string > moduleLabels (std::string)
 
std::vector< std::string > stepLabels (const std::vector< std::string > &)
 

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_
 

Detailed Description

Definition at line 36 of file HLTMuonValidator.cc.

Constructor & Destructor Documentation

◆ HLTMuonValidator()

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

Definition at line 79 of file HLTMuonValidator.cc.

80  : pset_(pset),
81  hltProcessName_(pset.getParameter<string>("hltProcessName")),
82  hltPathsToCheck_(pset.getParameter<vstring>("hltPathsToCheck")),
83  triggerEventToken_(consumes(edm::InputTag("hltTriggerSummaryRAW"))),
84  genParticlesToken_(consumes(pset.getParameter<string>("genParticleLabel"))),
85  recoMuonsToken_(consumes(pset.getParameter<string>("recMuonLabel"))),
86  l1tMuonMatcherAlgo_(pset, consumesCollector()) {}
vector< string > vstring
Definition: ExoticaDQM.cc:8
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 
)
overrideprivate

Definition at line 181 of file HLTMuonValidator.cc.

References analyzers_, and iEvent.

181  {
182  vector<HLTMuonPlotter>::iterator iter;
183  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
184  iter->analyze(iEvent, iSetup);
185  }
186 }
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 
)
overrideprivate

Definition at line 173 of file HLTMuonValidator.cc.

References analyzers_.

173  {
174  // Call the beginRun (which books all the histograms)
175  vector<HLTMuonPlotter>::iterator iter;
176  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
177  iter->beginRun(iBooker, iRun, iSetup);
178  }
179 }
std::vector< HLTMuonPlotter > analyzers_

◆ dqmBeginRun()

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

Definition at line 136 of file HLTMuonValidator.cc.

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

136  {
137  // Initialize hltConfig
138  bool changedConfig;
139  if (!hltConfig_.init(iRun, iSetup, hltProcessName_, changedConfig)) {
140  LogError("HLTMuonVal") << "Initialization of HLTConfigProvider failed!!";
141  return;
142  }
143 
144  // Get the set of trigger paths we want to make plots for
145  set<string> hltPaths;
146  for (size_t i = 0; i < hltPathsToCheck_.size(); i++) {
147  TPRegexp pattern(hltPathsToCheck_[i]);
148  for (size_t j = 0; j < hltConfig_.triggerNames().size(); j++)
149  if (TString(hltConfig_.triggerNames()[j]).Contains(pattern))
150  hltPaths.insert(hltConfig_.triggerNames()[j]);
151  }
152 
153  // Initialize the analyzers
154  analyzers_.clear();
155  set<string>::iterator iPath;
156  for (iPath = hltPaths.begin(); iPath != hltPaths.end(); iPath++) {
157  string path = *iPath;
158  string shortpath = path;
159  if (path.rfind("_v") < path.length())
160  shortpath = path.substr(0, path.rfind("_v"));
161 
162  vector<string> labels = moduleLabels(path);
163  vector<string> steps = stepLabels(labels);
164 
165  if (!labels.empty() && !steps.empty()) {
168  analyzers_.push_back(analyzer);
169  }
170  }
171 }
std::vector< std::string > stepLabels(const std::vector< std::string > &)
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_
std::vector< std::string > moduleLabels(std::string)
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_

◆ moduleLabels()

vector< string > HLTMuonValidator::moduleLabels ( std::string  )
private

Definition at line 88 of file HLTMuonValidator.cc.

References hltConfig_, HLTConfigProvider::moduleLabels(), LogMessageMonitor_cff::modules, and castor_dqm_sourceclient_file_cfg::path.

Referenced by dqmBeginRun().

88  {
89  vector<string> modules = hltConfig_.moduleLabels(path);
90  vector<string>::iterator iter = modules.begin();
91 
92  while (iter != modules.end())
93  if (iter->find("Filtered") == string::npos)
94  iter = modules.erase(iter);
95  else
96  ++iter;
97 
98  return modules;
99 }
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
HLTConfigProvider hltConfig_

◆ stepLabels()

vector< string > HLTMuonValidator::stepLabels ( const std::vector< std::string > &  )
private

Definition at line 101 of file HLTMuonValidator.cc.

References spr::find(), mps_fire::i, and customisers::steps.

Referenced by dqmBeginRun().

101  {
102  vector<string> steps(1, "All");
103  for (size_t i = 0; i < modules.size(); i++) {
104  if ((modules[i].find("IsoFiltered") != string::npos)) {
105  if (modules[i].find("L3") != string::npos)
106  steps.push_back("L3TkIso");
107  else
108  steps.push_back("L2Iso");
109  } else if ((modules[i].find("pfecalIsoRhoFiltered") != string::npos)) {
110  if (modules[i].find("L3") != string::npos)
111  steps.push_back("L3EcalIso");
112  else if (modules[i].find("TkFiltered") != string::npos)
113  steps.push_back("TkEcalIso");
114  } else if ((modules[i].find("pfhcalIsoRhoFiltered") != string::npos)) {
115  if (modules[i].find("L3") != string::npos)
116  steps.push_back("L3HcalIso");
117  else if (modules[i].find("TkFiltered") != string::npos)
118  steps.push_back("TkHcalIso");
119  } else if (modules[i].find("TkFiltered") != string::npos) {
120  steps.push_back("Tk");
121  } else if (modules[i].find("L3") != string::npos)
122  steps.push_back("L3");
123  else if (modules[i].find("L2") != string::npos)
124  steps.push_back("L2");
125  else if (modules[i].find("L1") != string::npos)
126  steps.push_back("L1");
127  else
128  return vector<string>();
129  }
130 
131  if (steps.size() < 2 || ((steps[1] != "L1") && (steps[1] != "Tk")))
132  return vector<string>();
133  return steps;
134 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19

Member Data Documentation

◆ analyzers_

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

◆ genParticlesToken_

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

Definition at line 60 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ hltConfig_

HLTConfigProvider HLTMuonValidator::hltConfig_
private

Definition at line 57 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and moduleLabels().

◆ hltPathsToCheck_

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

Definition at line 53 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ hltProcessName_

std::string HLTMuonValidator::hltProcessName_
private

Definition at line 52 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ l1tMuonMatcherAlgo_

HLTMuonPlotter::L1MuonMatcherAlgoForDQM const HLTMuonValidator::l1tMuonMatcherAlgo_
private

Definition at line 63 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ pset_

edm::ParameterSet HLTMuonValidator::pset_
private

Definition at line 51 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ recoMuonsToken_

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

Definition at line 61 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

◆ triggerEventToken_

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

Definition at line 59 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().