Go to the documentation of this file.00001 #ifndef MuonPFAnalyzer_H
00002 #define MuonPFAnalyzer_H
00003
00015
00016 #include "FWCore/Framework/interface/EDAnalyzer.h"
00017
00018 #include "FWCore/Utilities/interface/InputTag.h"
00019 #include "DQMServices/Core/interface/DQMStore.h"
00020 #include "DQMServices/Core/interface/MonitorElement.h"
00021 #include "FWCore/ServiceRegistry/interface/Service.h"
00022
00023
00024 #include "DataFormats/MuonReco/interface/Muon.h"
00025 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00026 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
00027 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00028 #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
00029 #include "DataFormats/VertexReco/interface/Vertex.h"
00030 #include "DataFormats/VertexReco/interface/VertexFwd.h"
00031 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00032
00033 #include <map>
00034 #include <string>
00035
00036 class MuonPFAnalyzer : public edm::EDAnalyzer {
00037
00038 public:
00039
00040 typedef std::pair<const reco::Muon*, const reco::GenParticle*> RecoGenPair;
00041 typedef std::vector<RecoGenPair> RecoGenCollection;
00042
00044 explicit MuonPFAnalyzer(const edm::ParameterSet&);
00045
00047 ~MuonPFAnalyzer();
00048
00050 virtual void beginRun(edm::Run const &, edm::EventSetup const &);
00051
00053 virtual void analyze(const edm::Event&, const edm::EventSetup&);
00054
00055 private:
00056
00057
00058 void bookHistos(const std::string & group);
00059
00060
00061 MonitorElement* getPlot(const std::string & group, const std::string & type);
00062
00063
00064 int muonTrackType(const reco::Muon * muon, bool usePF);
00065
00066
00067 inline float combRelIso(const reco::Muon * muon);
00068
00069
00070 inline float fDeltaPhi(float phi1, float phi2);
00071
00072
00073 void setCodeLabels(MonitorElement *plot, int nAxis);
00074
00075
00076 void fillInRange(MonitorElement *plot, int nAxis, double x, double y = 0);
00077
00078
00079
00080 void recoToGenMatch( edm::Handle<reco::MuonCollection> & reco,
00081 edm::Handle<reco::GenParticleCollection> & gen );
00082
00083 const reco::Vertex getPrimaryVertex( edm::Handle<reco::VertexCollection> &vertex,
00084 edm::Handle<reco::BeamSpot> &beamSpot );
00085
00086
00087 edm::InputTag theGenLabel;
00088 edm::InputTag theRecoLabel;
00089 edm::InputTag theVertexLabel;
00090 edm::InputTag theBeamSpotLabel;
00091
00092 std::vector<std::string> theMuonKinds;
00093
00094 DQMStore *theDbe;
00095
00096 std::map<std::string,std::map<std::string,MonitorElement*> > thePlots;
00097 RecoGenCollection theRecoGen;
00098
00099 double theHighPtTh;
00100 double theRecoGenR;
00101 double theIsoCut;
00102
00103 bool theRunOnMC;
00104
00105 std::string theFolder;
00106
00107 };
00108 #endif
00109
00110