Go to the documentation of this file.00001 #ifndef HLTriggerOffline_Muon_HLTMuonValidator_H
00002 #define HLTriggerOffline_Muon_HLTMuonValidator_H
00003
00014 #include "HLTriggerOffline/Muon/interface/L1MuonMatcherAlgo.h"
00015
00016 #include "FWCore/Framework/interface/EDAnalyzer.h"
00017 #include "FWCore/Framework/interface/Frameworkfwd.h"
00018 #include "FWCore/Framework/interface/Event.h"
00019 #include "FWCore/Framework/interface/MakerMacros.h"
00020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00021 #include "FWCore/Utilities/interface/InputTag.h"
00022
00023 #include "DataFormats/Common/interface/RefToBase.h"
00024 #include "DataFormats/TrackReco/interface/Track.h"
00025 #include "DataFormats/Candidate/interface/Particle.h"
00026 #include "DataFormats/Candidate/interface/Candidate.h"
00027 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00028 #include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
00029 #include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h"
00030 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
00031 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h"
00032 #include "DataFormats/HLTReco/interface/TriggerEventWithRefs.h"
00033 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
00034 #include "DataFormats/MuonReco/interface/Muon.h"
00035 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00036
00037 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
00038
00039 #include "CommonTools/Utils/interface/StringCutObjectSelector.h"
00040
00041 #include "DQMServices/Core/interface/DQMStore.h"
00042 #include "DQMServices/Core/interface/MonitorElement.h"
00043
00044
00045 #include <vector>
00046 #include <set>
00047 #include <map>
00048 #include <iostream>
00049 #include <algorithm>
00050 #include <cctype>
00051
00052 #include "TPRegexp.h"
00053
00054
00055
00056 const unsigned int kNull = (unsigned int) -1;
00057 TPRegexp kLooseL1Requirement("HLT_Mu3|Double|NoFilters");
00058
00059
00060
00061 class HLTMuonValidator : public edm::EDAnalyzer {
00062
00063 public:
00064 HLTMuonValidator(const edm::ParameterSet &);
00065 virtual void beginJob();
00066 virtual void beginRun(const edm::Run &, const edm::EventSetup &);
00067 virtual void analyze(const edm::Event &, const edm::EventSetup &);
00068
00069 private:
00070
00071 struct MatchStruct {
00072 const reco::Candidate * candBase;
00073 const l1extra::L1MuonParticle * candL1;
00074 std::vector<const reco::RecoChargedCandidate *> candHlt;
00075 MatchStruct() {
00076 candBase = 0;
00077 candL1 = 0;
00078 }
00079 MatchStruct(const reco::Candidate * cand) {
00080 candBase = cand;
00081 candL1 = 0;
00082 }
00083 bool operator<(MatchStruct match) {
00084 return candBase->pt() < match.candBase->pt();
00085 }
00086 bool operator>(MatchStruct match) {
00087 return candBase->pt() > match.candBase->pt();
00088 }
00089 };
00090 struct matchesByDescendingPt {
00091 bool operator() (MatchStruct a, MatchStruct b) {
00092 return a.candBase->pt() > b.candBase->pt();
00093 }
00094 };
00095
00096 void initializeHists();
00097 void analyzePath(const edm::Event &,
00098 const std::string &, const std::string &,
00099 const std::vector<MatchStruct>,
00100 edm::Handle<trigger::TriggerEventWithRefs>);
00101 void findMatches(
00102 std::vector<MatchStruct> &,
00103 std::vector<l1extra::L1MuonParticleRef>,
00104 std::vector< std::vector< const reco::RecoChargedCandidate *> >
00105 );
00106 void bookHist(std::string, std::string, std::string, std::string);
00107
00108 std::string hltProcessName_;
00109
00110 std::vector<std::string> hltPathsToCheck_;
00111 std::set <std::string> hltPaths_;
00112 std::map <std::string, std::vector<std::string> > filterLabels_;
00113
00114 std::string genParticleLabel_;
00115 std::string recMuonLabel_;
00116 std::string l1CandLabel_;
00117 std::string l2CandLabel_;
00118 std::string l3CandLabel_;
00119
00120 std::vector<double> parametersEta_;
00121 std::vector<double> parametersPhi_;
00122 std::vector<double> parametersTurnOn_;
00123
00124 std::map<std::string, double> cutsMinPt_;
00125
00126 double cutMaxEta_;
00127 unsigned int cutMotherId_;
00128 std::vector<double> cutsDr_;
00129 std::string genMuonCut_;
00130 std::string recMuonCut_;
00131
00132 StringCutObjectSelector<reco::GenParticle> * genMuonSelector_;
00133 StringCutObjectSelector<reco::Muon > * recMuonSelector_;
00134
00135 HLTConfigProvider hltConfig_;
00136
00137 L1MuonMatcherAlgo l1Matcher_;
00138
00139 DQMStore* dbe_;
00140 std::map<std::string, MonitorElement *> elements_;
00141 std::map<std::string, std::vector<std::string> > stepLabels_;
00142
00143 };
00144
00145 #endif