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 "CommonTools/Utils/interface/StringCutObjectSelector.h"
00038
00039 #include "DQMServices/Core/interface/DQMStore.h"
00040 #include "DQMServices/Core/interface/MonitorElement.h"
00041
00042
00043 #include <vector>
00044 #include <set>
00045 #include <map>
00046 #include <iostream>
00047 #include <algorithm>
00048 #include <cctype>
00049
00050 #include "TPRegexp.h"
00051
00052
00053
00054 const unsigned int kNull = (unsigned int) -1;
00055
00056
00057
00058 class HLTMuonPlotter {
00059
00060 public:
00061 HLTMuonPlotter(const edm::ParameterSet &, std::string,
00062 std::vector<std::string>, std::vector<std::string>);
00063 void beginJob();
00064 void beginRun(const edm::Run &, const edm::EventSetup &);
00065 void analyze(const edm::Event &, const edm::EventSetup &);
00066
00067 private:
00068
00069 struct MatchStruct {
00070 const reco::Candidate * candBase;
00071 const l1extra::L1MuonParticle * candL1;
00072 std::vector<const reco::RecoChargedCandidate *> candHlt;
00073 MatchStruct() {
00074 candBase = 0;
00075 candL1 = 0;
00076 }
00077 MatchStruct(const reco::Candidate * cand) {
00078 candBase = cand;
00079 candL1 = 0;
00080 }
00081 bool operator<(MatchStruct match) {
00082 return candBase->pt() < match.candBase->pt();
00083 }
00084 bool operator>(MatchStruct match) {
00085 return candBase->pt() > match.candBase->pt();
00086 }
00087 };
00088 struct matchesByDescendingPt {
00089 bool operator() (MatchStruct a, MatchStruct b) {
00090 return a.candBase->pt() > b.candBase->pt();
00091 }
00092 };
00093
00094 void analyzePath(const edm::Event &,
00095 const std::string &, const std::string &,
00096 const std::vector<MatchStruct>,
00097 edm::Handle<trigger::TriggerEventWithRefs>);
00098 void findMatches(
00099 std::vector<MatchStruct> &,
00100 std::vector<l1extra::L1MuonParticleRef>,
00101 std::vector< std::vector< const reco::RecoChargedCandidate *> >
00102 );
00103 void bookHist(std::string, std::string, std::string, std::string);
00104
00105 std::string hltPath_;
00106 std::string hltProcessName_;
00107
00108 std::vector<std::string> moduleLabels_;
00109 std::vector<std::string> stepLabels_;
00110
00111 std::string genParticleLabel_;
00112 std::string recMuonLabel_;
00113
00114 std::vector<double> parametersEta_;
00115 std::vector<double> parametersPhi_;
00116 std::vector<double> parametersTurnOn_;
00117
00118 double cutMinPt_;
00119 double cutMaxEta_;
00120 unsigned int cutMotherId_;
00121 std::vector<double> cutsDr_;
00122 std::string genMuonCut_;
00123 std::string recMuonCut_;
00124
00125 StringCutObjectSelector<reco::GenParticle> * genMuonSelector_;
00126 StringCutObjectSelector<reco::Muon > * recMuonSelector_;
00127
00128 L1MuonMatcherAlgo l1Matcher_;
00129
00130 DQMStore* dbe_;
00131 std::map<std::string, MonitorElement *> elements_;
00132
00133 };
00134
00135 #endif