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;
82 
83  double theHighPtTh;
84  double theRecoGenR;
85  double theIsoCut;
86 
87  bool theRunOnMC;
88 
90 };
91 #endif
dqm::impl::MonitorElement
Definition: MonitorElement.h:99
DDAxes::y
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
Muon.h
MuonPFAnalyzer
Definition: MuonPFAnalyzer.h:30
MuonPFAnalyzer::theHighPtTh
double theHighPtTh
Definition: MuonPFAnalyzer.h:83
muon
Definition: MuonCocktails.h:17
MuonPFAnalyzer::theGenLabel_
edm::EDGetTokenT< reco::GenParticleCollection > theGenLabel_
Definition: MuonPFAnalyzer.h:73
edm::Run
Definition: Run.h:45
edm::EDGetTokenT< reco::GenParticleCollection >
DQMStore.h
DDAxes::x
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
MuonPFAnalyzer::fillInRange
void fillInRange(MonitorElement *plot, int nAxis, double x, double y=0)
Definition: MuonPFAnalyzer.cc:328
MuonPFAnalyzer::RecoGenPair
std::pair< const reco::Muon *, const reco::GenParticle * > RecoGenPair
Definition: MuonPFAnalyzer.h:32
edm::Handle< reco::MuonCollection >
plotFactory.plot
plot
Definition: plotFactory.py:109
reco::Muon
Definition: Muon.h:27
MuonPFAnalyzer::fDeltaPhi
float fDeltaPhi(float phi1, float phi2)
Definition: MuonPFAnalyzer.cc:299
GenParticle.h
MuonPFAnalyzer::recoToGenMatch
void recoToGenMatch(edm::Handle< reco::MuonCollection > &reco, edm::Handle< reco::GenParticleCollection > &gen)
Definition: MuonPFAnalyzer.cc:378
MuonPFAnalyzer::theIsoCut
double theIsoCut
Definition: MuonPFAnalyzer.h:85
MuonPFAnalyzer::getPrimaryVertex
const reco::Vertex getPrimaryVertex(edm::Handle< reco::VertexCollection > &vertex, edm::Handle< reco::BeamSpot > &beamSpot)
Definition: MuonPFAnalyzer.cc:416
BeamSpot.h
Service.h
MuonFwd.h
GenParticleFwd.h
MuonPFAnalyzer::theMuonKinds
std::vector< std::string > theMuonKinds
Definition: MuonPFAnalyzer.h:78
MuonPFAnalyzer::theFolder
std::string theFolder
Definition: MuonPFAnalyzer.h:89
MuonPFAnalyzer::MuonPFAnalyzer
MuonPFAnalyzer(const edm::ParameterSet &)
Constructor.
Definition: MuonPFAnalyzer.cc:39
gen
Definition: PythiaDecays.h:13
MuonPFAnalyzer::thePlots
std::map< std::string, std::map< std::string, MonitorElement * > > thePlots
Definition: MuonPFAnalyzer.h:80
DQMEDAnalyzer.h
MuonPFAnalyzer::theRecoGen
RecoGenCollection theRecoGen
Definition: MuonPFAnalyzer.h:81
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
edm::ParameterSet
Definition: ParameterSet.h:47
MuonPFAnalyzer::getPlot
MonitorElement * getPlot(const std::string &group, const std::string &type)
Definition: MuonPFAnalyzer.cc:275
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
MuonPFAnalyzer::theRecoGenR
double theRecoGenR
Definition: MuonPFAnalyzer.h:84
edm::EventSetup
Definition: EventSetup.h:58
MuonPFAnalyzer::bookHistos
void bookHistos(DQMStore::IBooker &, const std::string &)
Definition: MuonPFAnalyzer.cc:216
MuonPFAnalyzer::muonTrackType
int muonTrackType(const reco::Muon *muon, bool usePF)
Definition: MuonPFAnalyzer.cc:357
MuonPFAnalyzer::RecoGenCollection
std::vector< RecoGenPair > RecoGenCollection
Definition: MuonPFAnalyzer.h:33
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
InputTag.h
VertexFwd.h
MuonPFAnalyzer::theVertexLabel_
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_
Definition: MuonPFAnalyzer.h:75
Vertex.h
MuonPFAnalyzer::theRunOnMC
bool theRunOnMC
Definition: MuonPFAnalyzer.h:87
MuonPFAnalyzer::~MuonPFAnalyzer
~MuonPFAnalyzer() override
Destructor.
Definition: MuonPFAnalyzer.cc:59
MuonPFAnalyzer::combRelIso
float combRelIso(const reco::Muon *muon)
Definition: MuonPFAnalyzer.cc:292
MuonPFAnalyzer::theRecoLabel_
edm::EDGetTokenT< reco::MuonCollection > theRecoLabel_
Definition: MuonPFAnalyzer.h:74
dqm::implementation::IBooker
Definition: DQMStore.h:43
MuonPFAnalyzer::theBeamSpotLabel_
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
Definition: MuonPFAnalyzer.h:76
MuonPFAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: MuonPFAnalyzer.cc:77
HepMCProduct.h
edm::Event
Definition: Event.h:73
MuonPFAnalyzer::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: MuonPFAnalyzer.cc:62
reco::Vertex
Definition: Vertex.h:35
MuonPFAnalyzer::setCodeLabels
void setCodeLabels(MonitorElement *plot, int nAxis)
Definition: MuonPFAnalyzer.cc:304
watchdog.group
group
Definition: watchdog.py:82