CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonPFAnalyzer.h
Go to the documentation of this file.
1 #ifndef MuonPFAnalyzer_H
2 #define MuonPFAnalyzer_H
3 
13 //Base class
15 
20 
21 
30 
31 #include <map>
32 #include <string>
33 
35 
36 public:
37 
38  typedef std::pair<const reco::Muon*, const reco::GenParticle*> RecoGenPair;
39  typedef std::vector<RecoGenPair> RecoGenCollection;
40 
42  explicit MuonPFAnalyzer(const edm::ParameterSet&);
43 
46 
48  virtual void beginRun(edm::Run const &, edm::EventSetup const &);
49 
51  virtual void analyze(const edm::Event&, const edm::EventSetup&);
52 
53 private:
54 
55  // Book histos for a given group of plots (e.g. for Tight TUNEP muons)
56  void bookHistos(const std::string & group);
57 
58  // Get a specific plot for a given group
59  MonitorElement* getPlot(const std::string & group, const std::string & type);
60 
61  // Algorithm to identify muon pt track type
62  int muonTrackType(const reco::Muon * muon, bool usePF);
63 
64  // Compute comb. rel. iso. (RECO based) for a given muon
65  inline float combRelIso(const reco::Muon * muon);
66 
67  // Compute delta phi taking into account overflows
68  inline float fDeltaPhi(float phi1, float phi2);
69 
70  // Set labels for code plots
71  void setCodeLabels(MonitorElement *plot, int nAxis);
72 
73  // Fill plot within its range limits
74  void fillInRange(MonitorElement *plot, int nAxis, double x, double y = 0);
75 
76  // Perform reco-gen geometrical matching on a best effort basis
77  // (if runOnMC == false or no matched gen particles are available gen is set to 0 in theRecoGen)
80 
83 
84 
89 
90  std::vector<std::string> theMuonKinds;
91 
93 
94  std::map<std::string,std::map<std::string,MonitorElement*> > thePlots;
96 
97  double theHighPtTh;
98  double theRecoGenR;
99  double theIsoCut;
100 
102 
104 
105 };
106 #endif
107 
108 
int muonTrackType(const reco::Muon *muon, bool usePF)
type
Definition: HCALResponse.h:21
const reco::Vertex getPrimaryVertex(edm::Handle< reco::VertexCollection > &vertex, edm::Handle< reco::BeamSpot > &beamSpot)
~MuonPFAnalyzer()
Destructor.
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_
DQMStore * theDbe
std::vector< RecoGenPair > RecoGenCollection
edm::EDGetTokenT< reco::MuonCollection > theRecoLabel_
void setCodeLabels(MonitorElement *plot, int nAxis)
RecoGenCollection theRecoGen
edm::EDGetTokenT< reco::GenParticleCollection > theGenLabel_
MonitorElement * getPlot(const std::string &group, const std::string &type)
std::vector< std::string > theMuonKinds
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Perform the PF - TUNEP muon analysis.
void fillInRange(MonitorElement *plot, int nAxis, double x, double y=0)
float combRelIso(const reco::Muon *muon)
void bookHistos(const std::string &group)
std::map< std::string, std::map< std::string, MonitorElement * > > thePlots
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
float fDeltaPhi(float phi1, float phi2)
std::string theFolder
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Initialize an book plots.
void recoToGenMatch(edm::Handle< reco::MuonCollection > &reco, edm::Handle< reco::GenParticleCollection > &gen)
std::pair< const reco::Muon *, const reco::GenParticle * > RecoGenPair
Definition: DDAxes.h:10
MuonPFAnalyzer(const edm::ParameterSet &)
Constructor.
Definition: Run.h:41