Go to the documentation of this file.00001 #ifndef HLTriggerOffline_Muon_HLTMuonPlotter_H
00002 #define HLTriggerOffline_Muon_HLTMuonPlotter_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 HLTMuonPlotter {
00061
00062 public:
00063 HLTMuonPlotter(const edm::ParameterSet &, std::string,
00064 std::vector<std::string>, std::vector<std::string>);
00065 void beginJob();
00066 void beginRun(const edm::Run &, const edm::EventSetup &);
00067 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 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 hltPath_;
00108 std::string hltProcessName_;
00109
00110 std::vector<std::string> moduleLabels_;
00111 std::vector<std::string> stepLabels_;
00112
00113 std::string genParticleLabel_;
00114 std::string recMuonLabel_;
00115
00116 std::vector<double> parametersEta_;
00117 std::vector<double> parametersPhi_;
00118 std::vector<double> parametersTurnOn_;
00119
00120 double cutMinPt_;
00121 double cutMaxEta_;
00122 unsigned int cutMotherId_;
00123 std::vector<double> cutsDr_;
00124 std::string genMuonCut_;
00125 std::string recMuonCut_;
00126
00127 StringCutObjectSelector<reco::GenParticle> * genMuonSelector_;
00128 StringCutObjectSelector<reco::Muon > * recMuonSelector_;
00129
00130 HLTConfigProvider hltConfig_;
00131
00132 L1MuonMatcherAlgo l1Matcher_;
00133
00134 DQMStore* dbe_;
00135 std::map<std::string, MonitorElement *> elements_;
00136
00137 };
00138
00139 #endif