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
 
void endRun (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_
 
HLTConfigProvider hltConfig_
 
std::vector< std::string > hltPathsToCheck_
 
std::string hltProcessName_
 
boost::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > myTokens_
 
edm::ParameterSet pset_
 

Detailed Description

Definition at line 42 of file HLTMuonValidator.cc.

Constructor & Destructor Documentation

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

Definition at line 92 of file HLTMuonValidator.cc.

References HLTMuonPlotter::getTokens(), myTokens_, and pset_.

92  :
93  pset_(pset),
94  hltProcessName_(pset.getParameter<string>("hltProcessName")),
95  hltPathsToCheck_(pset.getParameter<vstring>("hltPathsToCheck"))
96 {
97 
98  myTokens_ = HLTMuonPlotter::getTokens(pset_, consumesCollector());
99 
100 }
T getParameter(std::string const &) const
vector< string > vstring
Definition: ExoticaDQM.cc:8
edm::ParameterSet pset_
std::vector< std::string > hltPathsToCheck_
boost::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > myTokens_
static boost::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > getTokens(const edm::ParameterSet &, edm::ConsumesCollector &&)
std::string hltProcessName_

Member Function Documentation

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

Definition at line 224 of file HLTMuonValidator.cc.

References analyzers_.

226 {
227 
228  vector<HLTMuonPlotter>::iterator iter;
229  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
230  iter->analyze(iEvent, iSetup);
231  }
232 
233 }
std::vector< HLTMuonPlotter > analyzers_
void HLTMuonValidator::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 208 of file HLTMuonValidator.cc.

References analyzers_.

211 {
212 
213  // Call the beginRun (which books all the histograms)
214  vector<HLTMuonPlotter>::iterator iter;
215  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
216  iter->beginRun(iBooker, iRun, iSetup);
217  }
218 
219 }
std::vector< HLTMuonPlotter > analyzers_
void HLTMuonValidator::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 166 of file HLTMuonValidator.cc.

References analyzers_, hltConfig_, DQMSequences_cfi::hltPaths, hltPathsToCheck_, hltProcessName_, mps_fire::i, HLTConfigProvider::init(), tablePrinter::labels, moduleLabels(), myTokens_, callgraph::path, listBenchmarks::pattern, pset_, stepLabels(), customisers::steps, and HLTConfigProvider::triggerNames().

168 {
169  // Initialize hltConfig
170  bool changedConfig;
171  if (!hltConfig_.init(iRun, iSetup, hltProcessName_, changedConfig)) {
172  LogError("HLTMuonVal") << "Initialization of HLTConfigProvider failed!!";
173  return;
174  }
175 
176  // Get the set of trigger paths we want to make plots for
177  set<string> hltPaths;
178  for (size_t i = 0; i < hltPathsToCheck_.size(); i++) {
179  TPRegexp pattern(hltPathsToCheck_[i]);
180  for (size_t j = 0; j < hltConfig_.triggerNames().size(); j++)
181  if (TString(hltConfig_.triggerNames()[j]).Contains(pattern))
182  hltPaths.insert(hltConfig_.triggerNames()[j]);
183  }
184 
185  // Initialize the analyzers
186  analyzers_.clear();
187  set<string>::iterator iPath;
188  for (iPath = hltPaths.begin(); iPath != hltPaths.end(); iPath++) {
189 
190  string path = * iPath;
191  string shortpath = path;
192  if (path.rfind("_v") < path.length())
193  shortpath = path.substr(0, path.rfind("_v"));
194 
195  vector<string> labels = moduleLabels(path);
196  vector<string> steps = stepLabels(labels);
197 
198  if (!labels.empty() && !steps.empty()) {
199  HLTMuonPlotter analyzer(pset_, shortpath, labels, steps, myTokens_);
200  analyzers_.push_back(analyzer);
201  }
202  }
203 
204 }
std::vector< std::string > stepLabels(const std::vector< std::string > &)
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< HLTMuonPlotter > analyzers_
edm::ParameterSet pset_
std::vector< std::string > hltPathsToCheck_
boost::tuple< edm::EDGetTokenT< trigger::TriggerEventWithRefs >, edm::EDGetTokenT< reco::GenParticleCollection >, edm::EDGetTokenT< reco::MuonCollection > > myTokens_
std::vector< std::string > moduleLabels(std::string)
HLTConfigProvider hltConfig_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
std::string hltProcessName_
void HLTMuonValidator::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 239 of file HLTMuonValidator.cc.

References DEFINE_FWK_MODULE.

241 {
242 
243  // vector<HLTMuonPlotter>::iterator iter;
244  // for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
245  // iter->endRun(iRun, iSetup);
246  // }
247 
248 }
vector< string > HLTMuonValidator::moduleLabels ( std::string  )
private

Definition at line 105 of file HLTMuonValidator.cc.

References hltConfig_, HLTConfigProvider::moduleLabels(), and electrons_cff::modules.

Referenced by dqmBeginRun().

105  {
106 
107  vector<string> modules = hltConfig_.moduleLabels(path);
108  vector<string>::iterator iter = modules.begin();
109 
110  while (iter != modules.end())
111  if (iter->find("Filtered") == string::npos)
112  iter = modules.erase(iter);
113  else
114  ++iter;
115 
116  return modules;
117 
118 }
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
HLTConfigProvider hltConfig_
vector< string > HLTMuonValidator::stepLabels ( const std::vector< std::string > &  )
private

Definition at line 123 of file HLTMuonValidator.cc.

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

Referenced by dqmBeginRun().

123  {
124  vector<string> steps(1, "All");
125  for (size_t i = 0; i < modules.size(); i++) {
126  if ((modules[i].find("IsoFiltered") != string::npos)){
127  if (modules[i].find("L3") != string::npos)
128  steps.push_back("L3TkIso");
129  else
130  steps.push_back("L2Iso");
131  }
132  else if ((modules[i].find("pfecalIsoRhoFiltered") != string::npos)) {
133  if (modules[i].find("L3") != string::npos)
134  steps.push_back("L3EcalIso");
135  else if (modules[i].find("TkFiltered") != string::npos)
136  steps.push_back("TkEcalIso");
137  }
138  else if ((modules[i].find("pfhcalIsoRhoFiltered") != string::npos)) {
139  if (modules[i].find("L3") != string::npos)
140  steps.push_back("L3HcalIso");
141  else if (modules[i].find("TkFiltered") != string::npos)
142  steps.push_back("TkHcalIso");
143  }
144  else if (modules[i].find("TkFiltered") != string::npos){
145  steps.push_back("Tk");
146  }
147  else if (modules[i].find("L3") != string::npos)
148  steps.push_back("L3");
149  else if (modules[i].find("L2") != string::npos)
150  steps.push_back("L2");
151  else if (modules[i].find("L1") != string::npos)
152  steps.push_back("L1");
153  else
154  return vector<string>();
155  }
156 
157  if (steps.size() < 2 || ((steps[1] != "L1")&&(steps[1] != "Tk")))
158  return vector<string>();
159  return steps;
160 
161 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20

Member Data Documentation

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

Definition at line 67 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and moduleLabels().

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

Definition at line 63 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

std::string HLTMuonValidator::hltProcessName_
private

Definition at line 62 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun().

Definition at line 71 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and HLTMuonValidator().

edm::ParameterSet HLTMuonValidator::pset_
private

Definition at line 61 of file HLTMuonValidator.cc.

Referenced by dqmBeginRun(), and HLTMuonValidator().