test
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 
34 class MuonPFAnalyzer : public DQMEDAnalyzer {
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 
47  void analyze(const edm::Event&, const edm::EventSetup&);
48  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
49 
50 private:
51 
52  // Book histos for a given group of plots (e.g. for Tight TUNEP muons)
53  void bookHistos(DQMStore::IBooker &, const std::string &);
54 
55  // Get a specific plot for a given group
57 
58  // Algorithm to identify muon pt track type
59  int muonTrackType(const reco::Muon * muon, bool usePF);
60 
61  // Compute comb. rel. iso. (RECO based) for a given muon
62  inline float combRelIso(const reco::Muon * muon);
63 
64  // Compute delta phi taking into account overflows
65  inline float fDeltaPhi(float phi1, float phi2);
66 
67  // Set labels for code plots
68  void setCodeLabels(MonitorElement *plot, int nAxis);
69 
70  // Fill plot within its range limits
71  void fillInRange(MonitorElement *plot, int nAxis, double x, double y = 0);
72 
73  // Perform reco-gen geometrical matching on a best effort basis
74  // (if runOnMC == false or no matched gen particles are available gen is set to 0 in theRecoGen)
77 
80 
81 
86 
87  std::vector<std::string> theMuonKinds;
88 
89 
90  std::map<std::string,std::map<std::string,MonitorElement*> > thePlots;
92 
93  double theHighPtTh;
94  double theRecoGenR;
95  double theIsoCut;
96 
97  bool theRunOnMC;
98 
100 
101 };
102 #endif
103 
104 
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_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< RecoGenPair > RecoGenCollection
edm::EDGetTokenT< reco::MuonCollection > theRecoLabel_
void bookHistos(DQMStore::IBooker &, const std::string &)
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
void analyze(const edm::Event &, const edm::EventSetup &)
void fillInRange(MonitorElement *plot, int nAxis, double x, double y=0)
float combRelIso(const reco::Muon *muon)
std::map< std::string, std::map< std::string, MonitorElement * > > thePlots
tuple group
Definition: watchdog.py:82
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
float fDeltaPhi(float phi1, float phi2)
std::string theFolder
void recoToGenMatch(edm::Handle< reco::MuonCollection > &reco, edm::Handle< reco::GenParticleCollection > &gen)
std::pair< const reco::Muon *, const reco::GenParticle * > RecoGenPair
MuonPFAnalyzer(const edm::ParameterSet &)
Constructor.
Definition: Run.h:43