CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
HLTMuonValidator Class Reference

#include <HLTMuonValidator.h>

Inheritance diagram for HLTMuonValidator:
edm::EDAnalyzer edm::EDAnalyzer

Classes

struct  matchesByDescendingPt
 
struct  MatchStruct
 

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
 HLTMuonValidator (const edm::ParameterSet &)
 
 HLTMuonValidator (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
void analyzePath (const edm::Event &, const std::string &, const std::string &, const std::vector< MatchStruct >, edm::Handle< trigger::TriggerEventWithRefs >)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
void bookHist (std::string, std::string, std::string, std::string)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
void findMatches (std::vector< MatchStruct > &, std::vector< l1extra::L1MuonParticleRef >, std::vector< std::vector< const reco::RecoChargedCandidate * > >)
 
void initializeHists ()
 
std::vector< std::string > moduleLabels (std::string)
 
std::vector< std::string > stepLabels (std::vector< std::string >)
 

Private Attributes

std::vector< HLTMuonPlotteranalyzers_
 
double cutMaxEta_
 
unsigned int cutMotherId_
 
std::vector< double > cutsDr_
 
std::map< std::string, double > cutsMinPt_
 
DQMStoredbe_
 
std::map< std::string,
MonitorElement * > 
elements_
 
std::map< std::string,
std::vector< std::string > > 
filterLabels_
 
std::string genMuonCut_
 
StringCutObjectSelector
< reco::GenParticle > * 
genMuonSelector_
 
std::string genParticleLabel_
 
HLTConfigProvider hltConfig_
 
std::set< std::string > hltPaths_
 
std::vector< std::string > hltPathsToCheck_
 
std::string hltProcessName_
 
std::string l1CandLabel_
 
L1MuonMatcherAlgo l1Matcher_
 
std::string l2CandLabel_
 
std::string l3CandLabel_
 
std::vector< double > parametersEta_
 
std::vector< double > parametersPhi_
 
std::vector< double > parametersTurnOn_
 
edm::ParameterSet pset_
 
std::string recMuonCut_
 
std::string recMuonLabel_
 
StringCutObjectSelector
< reco::Muon > * 
recMuonSelector_
 
std::map< std::string,
std::vector< std::string > > 
stepLabels_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Generate histograms for muon trigger efficiencies Documentation available on the CMS TWiki: https://twiki.cern.ch/twiki/bin/view/CMS/MuonHLTOfflinePerformance

Date:
2011/04/29 21:41:56
Revision:
1.12
Author
J. Klukas, M. Vander Donckt, J. Alcaraz

Definition at line 60 of file HLTMuonValidator.h.

Constructor & Destructor Documentation

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

Definition at line 91 of file HLTMuonValidator.cc.

91  :
92  pset_(pset),
93  hltProcessName_(pset.getParameter<string>("hltProcessName")),
94  hltPathsToCheck_(pset.getParameter<vstring>("hltPathsToCheck"))
95 {
96 }
T getParameter(std::string const &) const
edm::ParameterSet pset_
std::string hltProcessName_
std::vector< std::string > vstring
std::vector< std::string > hltPathsToCheck_
HLTMuonValidator::HLTMuonValidator ( const edm::ParameterSet )
explicit

Member Function Documentation

virtual void HLTMuonValidator::analyze ( const edm::Event ,
const edm::EventSetup  
)
privatevirtual

Implements edm::EDAnalyzer.

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

Implements edm::EDAnalyzer.

Definition at line 190 of file HLTMuonValidator.cc.

References analyzers_.

192 {
193 
194  vector<HLTMuonPlotter>::iterator iter;
195  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
196  iter->analyze(iEvent, iSetup);
197  }
198 
199 }
std::vector< HLTMuonPlotter > analyzers_
void HLTMuonValidator::analyzePath ( const edm::Event ,
const std::string &  ,
const std::string &  ,
const std::vector< MatchStruct ,
edm::Handle< trigger::TriggerEventWithRefs  
)
private
virtual void HLTMuonValidator::beginJob ( )
privatevirtual

Reimplemented from edm::EDAnalyzer.

void HLTMuonValidator::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 204 of file HLTMuonValidator.cc.

205 {
206 }
virtual void HLTMuonValidator::beginRun ( const edm::Run ,
const edm::EventSetup  
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

void HLTMuonValidator::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 143 of file HLTMuonValidator.cc.

References analyzers_, hltConfig_, CreateSqliteForCondDB_cfg::hltPaths, hltPathsToCheck_, hltProcessName_, i, HLTConfigProvider::init(), j, reco_calib_source_client_cfg::labels, moduleLabels(), scaleCards::path, listBenchmarks::pattern, pset_, stepLabels(), relval_steps::steps, and HLTConfigProvider::triggerNames().

144  {
145 
146  // Initialize hltConfig
147  bool changedConfig;
148  if (!hltConfig_.init(iRun, iSetup, hltProcessName_, changedConfig)) {
149  LogError("HLTMuonVal") << "Initialization of HLTConfigProvider failed!!";
150  return;
151  }
152 
153  // Get the set of trigger paths we want to make plots for
154  set<string> hltPaths;
155  for (size_t i = 0; i < hltPathsToCheck_.size(); i++) {
156  TPRegexp pattern(hltPathsToCheck_[i]);
157  for (size_t j = 0; j < hltConfig_.triggerNames().size(); j++)
158  if (TString(hltConfig_.triggerNames()[j]).Contains(pattern))
159  hltPaths.insert(hltConfig_.triggerNames()[j]);
160  }
161 
162  // Initialize the analyzers
163  analyzers_.clear();
164  set<string>::iterator iPath;
165  for (iPath = hltPaths.begin(); iPath != hltPaths.end(); iPath++) {
166 
167  string path = * iPath;
168  string shortpath = path;
169  if (path.rfind("_v") < path.length())
170  shortpath = path.substr(0, path.rfind("_v"));
171 
172  vector<string> labels = moduleLabels(path);
173  vector<string> steps = stepLabels(labels);
174 
175  if (labels.size() > 0 && steps.size() > 0) {
176  HLTMuonPlotter analyzer(pset_, shortpath, labels, steps);
177  analyzers_.push_back(analyzer);
178  }
179  }
180 
181  // Call the beginRun (which books all the histograms)
182  vector<HLTMuonPlotter>::iterator iter;
183  for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
184  iter->beginRun(iRun, iSetup);
185  }
186 
187 }
int i
Definition: DBlmapReader.cc:9
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< HLTMuonPlotter > analyzers_
edm::ParameterSet pset_
list path
Definition: scaleCards.py:51
int j
Definition: DBlmapReader.cc:9
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_
std::vector< std::string > stepLabels(std::vector< std::string >)
std::vector< std::string > hltPathsToCheck_
void HLTMuonValidator::bookHist ( std::string  ,
std::string  ,
std::string  ,
std::string   
)
private
void HLTMuonValidator::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 225 of file HLTMuonValidator.cc.

226 {
227 }
void HLTMuonValidator::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 211 of file HLTMuonValidator.cc.

213 {
214 
215  // vector<HLTMuonPlotter>::iterator iter;
216  // for (iter = analyzers_.begin(); iter != analyzers_.end(); ++iter) {
217  // iter->endRun(iRun, iSetup);
218  // }
219 
220 }
void HLTMuonValidator::findMatches ( std::vector< MatchStruct > &  ,
std::vector< l1extra::L1MuonParticleRef ,
std::vector< std::vector< const reco::RecoChargedCandidate * > >   
)
private
void HLTMuonValidator::initializeHists ( )
private
vector< string > HLTMuonValidator::moduleLabels ( std::string  )
private

Definition at line 101 of file HLTMuonValidator.cc.

References hltConfig_, and HLTConfigProvider::moduleLabels().

Referenced by beginRun().

101  {
102 
103  vector<string> modules = hltConfig_.moduleLabels(path);
104  vector<string>::iterator iter = modules.begin();
105 
106  while (iter != modules.end())
107  if (iter->find("Filtered") == string::npos)
108  iter = modules.erase(iter);
109  else
110  ++iter;
111 
112  return modules;
113 
114 }
list path
Definition: scaleCards.py:51
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 ( std::vector< std::string >  )
private

Definition at line 117 of file HLTMuonValidator.cc.

References spr::find(), i, and relval_steps::steps.

Referenced by beginRun().

117  {
118  vector<string> steps(1, "All");
119  for (size_t i = 0; i < modules.size(); i++) {
120  if (modules[i].find("IsoFiltered") != string::npos) {
121  if (modules[i].find("L3") != string::npos)
122  steps.push_back("L3Iso");
123  else
124  steps.push_back("L2Iso");
125  }
126  else if (modules[i].find("L3") != string::npos)
127  steps.push_back("L3");
128  else if (modules[i].find("L2") != string::npos)
129  steps.push_back("L2");
130  else if (modules[i].find("L1") != string::npos)
131  steps.push_back("L1");
132  else
133  return vector<string>();
134  }
135  if (steps.size() < 2 || steps[1] != "L1")
136  return vector<string>();
137  return steps;
138 
139 }
int i
Definition: DBlmapReader.cc:9
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7

Member Data Documentation

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

Definition at line 125 of file HLTMuonValidator.h.

unsigned int HLTMuonValidator::cutMotherId_
private

Definition at line 126 of file HLTMuonValidator.h.

std::vector<double> HLTMuonValidator::cutsDr_
private

Definition at line 127 of file HLTMuonValidator.h.

std::map<std::string, double> HLTMuonValidator::cutsMinPt_
private

Definition at line 123 of file HLTMuonValidator.h.

DQMStore * HLTMuonValidator::dbe_
private

Definition at line 138 of file HLTMuonValidator.h.

std::map<std::string, MonitorElement *> HLTMuonValidator::elements_
private

Definition at line 139 of file HLTMuonValidator.h.

std::map<std::string, std::vector<std::string> > HLTMuonValidator::filterLabels_
private

Definition at line 111 of file HLTMuonValidator.h.

std::string HLTMuonValidator::genMuonCut_
private

Definition at line 128 of file HLTMuonValidator.h.

StringCutObjectSelector<reco::GenParticle>* HLTMuonValidator::genMuonSelector_
private

Definition at line 131 of file HLTMuonValidator.h.

std::string HLTMuonValidator::genParticleLabel_
private

Definition at line 113 of file HLTMuonValidator.h.

HLTConfigProvider HLTMuonValidator::hltConfig_
private

Definition at line 134 of file HLTMuonValidator.h.

Referenced by beginRun(), and moduleLabels().

std::set<std::string> HLTMuonValidator::hltPaths_
private

Definition at line 110 of file HLTMuonValidator.h.

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

Definition at line 109 of file HLTMuonValidator.h.

Referenced by beginRun().

std::string HLTMuonValidator::hltProcessName_
private

Definition at line 107 of file HLTMuonValidator.h.

Referenced by beginRun().

std::string HLTMuonValidator::l1CandLabel_
private

Definition at line 115 of file HLTMuonValidator.h.

L1MuonMatcherAlgo HLTMuonValidator::l1Matcher_
private

Definition at line 136 of file HLTMuonValidator.h.

std::string HLTMuonValidator::l2CandLabel_
private

Definition at line 116 of file HLTMuonValidator.h.

std::string HLTMuonValidator::l3CandLabel_
private

Definition at line 117 of file HLTMuonValidator.h.

std::vector<double> HLTMuonValidator::parametersEta_
private

Definition at line 119 of file HLTMuonValidator.h.

std::vector<double> HLTMuonValidator::parametersPhi_
private

Definition at line 120 of file HLTMuonValidator.h.

std::vector<double> HLTMuonValidator::parametersTurnOn_
private

Definition at line 121 of file HLTMuonValidator.h.

edm::ParameterSet HLTMuonValidator::pset_
private

Definition at line 61 of file HLTMuonValidator.cc.

Referenced by beginRun().

std::string HLTMuonValidator::recMuonCut_
private

Definition at line 129 of file HLTMuonValidator.h.

std::string HLTMuonValidator::recMuonLabel_
private

Definition at line 114 of file HLTMuonValidator.h.

StringCutObjectSelector<reco::Muon >* HLTMuonValidator::recMuonSelector_
private

Definition at line 132 of file HLTMuonValidator.h.

std::map<std::string, std::vector<std::string> > HLTMuonValidator::stepLabels_
private

Definition at line 140 of file HLTMuonValidator.h.