ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/MuonIDMod.h
Revision: 1.56
Committed: Wed Aug 14 20:22:23 2013 UTC (11 years, 8 months ago) by mdecross
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.55: +3 -2 lines
Log Message:
Generator-level lepton info and tight muon tagging added for monojets 8TeV

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: MuonIDMod.h,v 1.55 2013/02/23 14:52:11 mingyang Exp $
3 //
4 // MuonIDMod
5 //
6 // This module applies muon identification criteria and exports a pointer to a collection
7 // of "good muons" according to the specified ID scheme.
8 //
9 // See http://indico.cern.ch/contributionDisplay.py?contribId=1&confId=45945
10 // See http://indico.cern.ch/getFile.py/access?contribId=1&resId=0&materialId=slides&confId=42229
11 //
12 // Authors: S.Xie
13 //--------------------------------------------------------------------------------------------------
14
15 #ifndef MITPHYSICS_MODS_MUONIDMOD_H
16 #define MITPHYSICS_MODS_MUONIDMOD_H
17
18 #include "MitAna/TreeMod/interface/BaseMod.h"
19 #include "MitAna/DataTree/interface/MuonFwd.h"
20 #include "MitAna/DataTree/interface/VertexFwd.h"
21 #include "MitAna/DataTree/interface/TrackFwd.h"
22 #include "MitAna/DataTree/interface/PFCandidateFwd.h"
23 #include "MitPhysics/Utils/interface/MuonTools.h"
24 #include "MitPhysics/Utils/interface/MuonIDMVA.h"
25 #include "MitPhysics/Utils/interface/IsolationTools.h"
26 #include "MitAna/DataTree/interface/PileupEnergyDensityCol.h"
27
28 #include "MitPhysics/Utils/interface/RhoUtilities.h"
29
30 namespace mithep
31 {
32 class MuonIDMod : public BaseMod
33 {
34 public:
35 MuonIDMod(const char *name="MuonIDMod",
36 const char *title="Muon identification module");
37
38 Double_t GetCaloIsoCut() const { return fCaloIsolationCut; }
39 const char *GetClassType() const { return fMuonClassType; }
40 const char *GetCleanName() const { return GetCleanMuonsName(); }
41 const char *GetCleanMuonsName() const { return fCleanMuonsName; }
42 Double_t GetCombIsoCut() const { return fCombIsolationCut; }
43 const char *GetIDType() const { return fMuonIDType; }
44 const char *GetInputName() const { return fMuonBranchName; }
45 const char *GetIsoType() const { return fMuonIsoType; }
46 const char *GetOutputName() const { return GetCleanMuonsName(); }
47 Double_t GetPtMin() const { return fMuonPtMin; }
48 Double_t GetTrackIsoCut() const { return fTrackIsolationCut; }
49 Bool_t PassMuonMVA_BDTG_IdIso(const Muon *mu, const Vertex *vertex,
50 const PileupEnergyDensityCol *PileupEnergyDensity) const;
51 Bool_t PassMuonIsoRingsV0_BDTG_Iso(const Muon *mu, const Vertex *vertex,
52 const PileupEnergyDensityCol *PileupEnergyDensity) const;
53 Bool_t PassMuonIsoDeltaR(const Muon *mu, const Vertex *vertex,
54 const PileupEnergyDensityCol *PileupEnergyDensity) const;
55 void SetPrintMVADebugInfo(Bool_t b) { fPrintMVADebugInfo = b; }
56 void SetApplyD0Cut(Bool_t b) { fApplyD0Cut = b; }
57 void SetApplyDZCut(Bool_t b) { fApplyDZCut = b; }
58 void SetCaloIsoCut(Double_t cut) { fCaloIsolationCut = cut; }
59 void SetClassType(const char *type) { fMuonClassType = type; }
60 void SetCleanMuonsName(const char *name) { fCleanMuonsName = name; }
61 void SetOldMuonsName(const char *n) { fNonIsolatedMuonsName = n; }
62 void SetOldElectronsName(const char *n) { fNonIsolatedElectronsName = n; }
63 void SetCleanName(const char *name) { SetCleanMuonsName(name); }
64 void SetCombIsoCut(Double_t cut) { fCombIsolationCut = cut; }
65 void SetCombRelativeIsoCut(Double_t cut) { fCombRelativeIsolationCut = cut; }
66 void SetPFIsoCut(Double_t cut) { fPFIsolationCut = cut; }
67 void SetD0Cut(Double_t cut) { fD0Cut = cut; }
68 void SetDZCut(Double_t cut) { fDZCut = cut; }
69 void SetWhichVertex(Int_t d) { fWhichVertex = d; }
70 void SetEtaCut(Double_t cut) { fEtaCut = cut; }
71 void SetIDType(const char *type) { fMuonIDType = type; }
72 void SetInputName(const char *name) { fMuonBranchName = name; }
73 void SetIsoType(const char *type) { fMuonIsoType = type; }
74 void SetOutputName(const char *name) { SetCleanMuonsName(name); }
75 void SetPtMin(Double_t pt) { fMuonPtMin = pt; }
76 void SetTrackIsoCut(Double_t cut) { fTrackIsolationCut = cut; }
77 void SetIntRadius(Double_t dr) { fIntRadius = dr; }
78 void SetPFNoPileUpName(const char *n) { fPFNoPileUpName = n; }
79 void SetPFPileUpName(const char *n) { fPFPileUpName = n; }
80 void SetRhoType(RhoUtilities::RhoType type)
81 { fTheRhoType = type; };
82
83 void SetVertexName(const char* name) { fVertexName = name; }
84 void SetPVName(const char *n) { fPVName = n; }
85
86 enum EMuIdType {
87 kIdUndef = 0, //not defined
88 kWMuId, //"WMuId"
89 kZMuId, //"ZMuId"
90 kTight, //"Tight"
91 kmuonPOG2012CutBasedIDTight, //"muonPOG2012CutBasedIDTight"
92 kLoose, //"Loose"
93 kWWMuIdV1, //"WWMuIdV1"
94 kWWMuIdV2, //"WWMuIdV2"
95 kWWMuIdV3, //"WWMuIdV3"
96 kWWMuIdV4, //"WWMuIdV4"
97 kNoId, //"NoId"
98 kCustomId, //"Custom"
99 kMVAID_BDTG_IDIso //"BDTG ID + Iso03, Iso04 Combined"
100 };
101 enum EMuIsoType {
102 kIsoUndef = 0, //"not defined"
103 kTrackCalo, //"TrackCalo"
104 kTrackCaloCombined, //"TrackCaloCombined"
105 kTrackCaloSliding, //"TrackCaloSliding"
106 kTrackCaloSlidingNoCorrection, //"TrackCaloSlidingNoCorrection"
107 kCombinedRelativeConeAreaCorrected, //"CombinedRelativeConeAreaCorrected"
108 kCombinedRelativeEffectiveAreaCorrected,
109 kCustomIso, //"Custom"
110 kPFIso, //"PFIso"
111 kPFRadialIso, //"PFRadialIso"
112 kPFIsoBetaPUCorrected, //"PFISo with PUcorrection using delta Beta
113 kPFIsoEffectiveAreaCorrected, //"PFIso with EffectiveArea Pileup Correction"
114 kPFIsoNoL, //"PFIsoNoL"
115 kNoIso, //"NoIso"
116 kMVAIso_BDTG_IDIso, //"BDTG ID + Iso03, Iso04 Combined"
117 kIsoRingsV0_BDTG_Iso, //"BDTG Iso Rings"
118 kIsoDeltaR //"BGDT Iso dR"
119 };
120 enum EMuClassType {
121 kClassUndef = 0, //not defined
122 kAll, //"All"
123 kGlobal, //"Global"
124 kGlobalorTracker, //"Global or Tracker Muon"
125 kGlobalTracker, //"GlobalTracker"
126 kSta, //"Standalone"
127 kTrackerMuon, //"TrackerMuon"
128 kCaloMuon, //"CaloMuon"
129 kTrackerBased, //"TrackerMuon or CaloMuon"
130 kGlobalOnly //"GlobalOnly"
131 };
132
133 protected:
134 void Process();
135 void SlaveBegin();
136 void Terminate();
137
138 Bool_t fPrintMVADebugInfo; //print MVA debug information
139 TString fMuonBranchName; //name of muon collection (input)
140 TString fCleanMuonsName; //name of exported "good muon" collection
141 TString fNonIsolatedMuonsName; //name of imported "old muon" collection
142 TString fNonIsolatedElectronsName;//name of imported "old electron" collection
143 TString fVertexName; //name of vertex collection
144 TString fBeamSpotName; //name of beamspot collection
145 TString fTrackName; //name of track collection
146 TString fPFCandidatesName; //name of pfcandidates collection
147 TString fPFNoPileUpName; //name of pfnpu collection
148 TString fPFPileUpName; //name of pfpu collection
149 TString fMuonIDType; //type of muon id scheme we impose
150 TString fMuonIsoType; //type of muon isolations scheme we impose
151 TString fMuonClassType; //type of muon class we impose
152 Double_t fTrackIsolationCut; //cut value for track isolation
153 Double_t fCaloIsolationCut; //cut value for calo isolation
154 Double_t fCombIsolationCut; //cut value for combined isolation
155 Double_t fCombRelativeIsolationCut; //cut value for combined relative isolation
156 Double_t fPFIsolationCut; //cut value for combined isolation
157 Double_t fMuonPtMin; //min muon pt
158 Bool_t fApplyD0Cut; //=true then apply d0 cut (def=1)
159 Bool_t fApplyDZCut; //=true then apply dz cut (def=1)
160 Double_t fD0Cut; //max d0
161 Double_t fDZCut; //max dz
162 Int_t fWhichVertex; //vertex to use (-2: beamspot, -1: closest in Z)
163 Double_t fEtaCut; //max eta, absolute value
164 EMuIdType fMuIDType; //!muon id type (imposed)
165 EMuIsoType fMuIsoType; //!muon iso type (imposed)
166 EMuClassType fMuClassType; //!muon class type (imposed)
167 const MuonCol *fMuons; //!muon collection
168 const VertexCol *fVertices; //!vertices branch
169 const BeamSpotCol *fBeamSpot; //!beamspot branch
170 const TrackCol *fTracks; //!track branch
171 const PFCandidateCol *fPFCandidates; //!pfcandidate branch
172 const PFCandidateCol *fPFNoPileUpCands; //!pfnpu collection
173 const PFCandidateCol *fPFPileUpCands; //!pfpu collection
174 Double_t fIntRadius; //!min IntRadius cut in pf isolation
175 MuonCol *fNonIsolatedMuons; //!pointer to old muon collection
176 ElectronCol *fNonIsolatedElectrons;//!pointer to old electron collection
177 TString fPileupEnergyDensityName;
178 const PileupEnergyDensityCol *fPileupEnergyDensity;
179 MuonTools *fMuonTools; // interface to tools for muon ID
180 MuonIDMVA *fMuonIDMVA; // helper class for MuonMVA
181 TString fPVName;
182
183 RhoUtilities::RhoType fTheRhoType;
184
185 ClassDef(MuonIDMod, 1) // Muon identification module
186 };
187 }
188 #endif