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
00058
00059
00060 class HLTMuonValidator : public edm::EDAnalyzer {
00061
00062 public:
00063 HLTMuonValidator(const edm::ParameterSet &);
00064 virtual void beginJob();
00065 virtual void beginRun(const edm::Run &, const edm::EventSetup &);
00066 virtual void analyze(const edm::Event &, const edm::EventSetup &);
00067
00068 private:
00069
00070 struct MatchStruct {
00071 const reco::Candidate * candBase;
00072 const l1extra::L1MuonParticle * candL1;
00073 std::vector<const reco::RecoChargedCandidate *> candHlt;
00074 MatchStruct() {
00075 candBase = 0;
00076 candL1 = 0;
00077 }
00078 MatchStruct(const reco::Candidate * cand) {
00079 candBase = cand;
00080 candL1 = 0;
00081 }
00082 bool operator<(MatchStruct match) {
00083 return candBase->pt() < match.candBase->pt();
00084 }
00085 bool operator>(MatchStruct match) {
00086 return candBase->pt() > match.candBase->pt();
00087 }
00088 };
00089 struct matchesByDescendingPt {
00090 bool operator() (MatchStruct a, MatchStruct b) {
00091 return a.candBase->pt() > b.candBase->pt();
00092 }
00093 };
00094
00095 void initializeHists();
00096 void analyzePath(const edm::Event &,
00097 const std::string &, const std::string &,
00098 const std::vector<MatchStruct>,
00099 edm::Handle<trigger::TriggerEventWithRefs>);
00100 void findMatches(
00101 std::vector<MatchStruct> &,
00102 std::vector<l1extra::L1MuonParticleRef>,
00103 std::vector< std::vector< const reco::RecoChargedCandidate *> >
00104 );
00105 void bookHist(std::string, std::string, std::string, std::string);
00106
00107 std::string hltProcessName_;
00108
00109 std::vector<std::string> hltPathsToCheck_;
00110 std::set <std::string> hltPaths_;
00111 std::map <std::string, std::vector<std::string> > filterLabels_;
00112
00113 std::string genParticleLabel_;
00114 std::string recMuonLabel_;
00115 std::string l1CandLabel_;
00116 std::string l2CandLabel_;
00117 std::string l3CandLabel_;
00118
00119 std::vector<double> parametersEta_;
00120 std::vector<double> parametersPhi_;
00121 std::vector<double> parametersTurnOn_;
00122
00123 std::map<std::string, double> cutsMinPt_;
00124
00125 double cutMaxEta_;
00126 unsigned int cutMotherId_;
00127 std::vector<double> cutsDr_;
00128 std::string genMuonCut_;
00129 std::string recMuonCut_;
00130
00131 StringCutObjectSelector<reco::GenParticle> * genMuonSelector_;
00132 StringCutObjectSelector<reco::Muon > * recMuonSelector_;
00133
00134 HLTConfigProvider hltConfig_;
00135
00136 L1MuonMatcherAlgo l1Matcher_;
00137
00138 DQMStore* dbe_;
00139 std::map<std::string, MonitorElement *> elements_;
00140 std::map<std::string, std::vector<std::string> > stepLabels_;
00141
00142 };
00143
00144 #endif