CMS 3D CMS Logo

MuonPFAnalyzer.h
Go to the documentation of this file.
1 #ifndef MuonPFAnalyzer_H
2 #define MuonPFAnalyzer_H
3 
11 //Base class
13 
17 
26 
27 #include <map>
28 #include <string>
29 
30 class MuonPFAnalyzer : public DQMEDAnalyzer {
31 public:
32  typedef std::pair<const reco::Muon *, const reco::GenParticle *> RecoGenPair;
33  typedef std::vector<RecoGenPair> RecoGenCollection;
34 
36  explicit MuonPFAnalyzer(const edm::ParameterSet &);
37 
39  ~MuonPFAnalyzer() override;
40 
41  void analyze(const edm::Event &, const edm::EventSetup &) override;
42  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
43 
44 private:
45  // Book histos for a given group of plots (e.g. for Tight TUNEP muons)
46  void bookHistos(DQMStore::IBooker &, const std::string &);
47 
48  // Get a specific plot for a given group
50 
51  // Algorithm to identify muon pt track type
52  int muonTrackType(const reco::Muon *muon, bool usePF);
53 
54  // Compute comb. rel. iso. (RECO based) for a given muon
55  inline float combRelIso(const reco::Muon *muon);
56 
57  // Compute delta phi taking into account overflows
58  inline float fDeltaPhi(float phi1, float phi2);
59 
60  // Set labels for code plots
61  void setCodeLabels(MonitorElement *plot, int nAxis);
62 
63  // Fill plot within its range limits
64  void fillInRange(MonitorElement *plot, int nAxis, double x, double y = 0);
65 
66  // Perform reco-gen geometrical matching on a best effort basis
67  // (if runOnMC == false or no matched gen particles are available gen is set to 0 in theRecoGen)
69 
72 
77 
78  std::vector<std::string> theMuonKinds;
79 
80  std::map<std::string, std::map<std::string, MonitorElement *> > thePlots;
81  RecoGenCollection theRecoGen;
82 
83  double theHighPtTh;
84  double theRecoGenR;
85  double theIsoCut;
86 
87  bool theRunOnMC;
88 
90 };
91 #endif
int muonTrackType(const reco::Muon *muon, bool usePF)
type
Definition: HCALResponse.h:21
~MuonPFAnalyzer() override
Destructor.
const reco::Vertex getPrimaryVertex(edm::Handle< reco::VertexCollection > &vertex, edm::Handle< reco::BeamSpot > &beamSpot)
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< RecoGenPair > RecoGenCollection
MonitorElement * getPlot(const std::string &group, const std::string &type)
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_
std::vector< std::string > theMuonKinds
void fillInRange(MonitorElement *plot, int nAxis, double x, double y=0)
void analyze(const edm::Event &, const edm::EventSetup &) override
float combRelIso(const reco::Muon *muon)
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
float fDeltaPhi(float phi1, float phi2)
std::string theFolder
std::map< std::string, std::map< std::string, MonitorElement * > > thePlots
fixed size matrix
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:45