ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/MuonIDMod.h
Revision: 1.46
Committed: Fri May 4 21:47:03 2012 UTC (13 years ago) by ceballos
Content type: text/plain
Branch: MAIN
Changes since 1.45: +6 -2 lines
Log Message:
new dr iso

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 ceballos 1.46 // $Id: MuonIDMod.h,v 1.45 2012/05/04 16:36:39 ceballos Exp $
3 loizides 1.1 //
4     // MuonIDMod
5     //
6 loizides 1.6 // This module applies muon identification criteria and exports a pointer to a collection
7 loizides 1.7 // of "good muons" according to the specified ID scheme.
8 loizides 1.1 //
9 loizides 1.16 // 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 ceballos 1.15 // Authors: S.Xie
13 loizides 1.1 //--------------------------------------------------------------------------------------------------
14    
15 loizides 1.6 #ifndef MITPHYSICS_MODS_MUONIDMOD_H
16     #define MITPHYSICS_MODS_MUONIDMOD_H
17 loizides 1.1
18     #include "MitAna/TreeMod/interface/BaseMod.h"
19 loizides 1.22 #include "MitAna/DataTree/interface/MuonFwd.h"
20     #include "MitAna/DataTree/interface/VertexFwd.h"
21 ceballos 1.28 #include "MitAna/DataTree/interface/TrackFwd.h"
22     #include "MitAna/DataTree/interface/PFCandidateFwd.h"
23 ceballos 1.5 #include "MitPhysics/Utils/interface/MuonTools.h"
24 sixie 1.38 #include "MitPhysics/Utils/interface/MuonIDMVA.h"
25 ceballos 1.28 #include "MitPhysics/Utils/interface/IsolationTools.h"
26 ceballos 1.31 #include "MitAna/DataTree/interface/PileupEnergyDensityCol.h"
27 loizides 1.1
28 fabstoec 1.43 #include "MitPhysics/Utils/interface/RhoUtilities.h"
29    
30 loizides 1.1 namespace mithep
31     {
32     class MuonIDMod : public BaseMod
33     {
34     public:
35     MuonIDMod(const char *name="MuonIDMod",
36 loizides 1.6 const char *title="Muon identification module");
37    
38 loizides 1.11 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 ceballos 1.24 Double_t GetPtMin() const { return fMuonPtMin; }
48 loizides 1.11 Double_t GetTrackIsoCut() const { return fTrackIsolationCut; }
49 sixie 1.38 Bool_t PassMuonMVA_BDTG_IdIso(const Muon *mu, const Vertex *vertex,
50 sixie 1.39 const PileupEnergyDensityCol *PileupEnergyDensity) const;
51 ceballos 1.45 Bool_t PassMuonIsoRingsV0_BDTG_Iso(const Muon *mu, const Vertex *vertex,
52     const PileupEnergyDensityCol *PileupEnergyDensity) const;
53 ceballos 1.46 Bool_t PassMuonIsoDeltaR(const Muon *mu, const Vertex *vertex,
54     const PileupEnergyDensityCol *PileupEnergyDensity) const;
55 sixie 1.41 void SetPrintMVADebugInfo(Bool_t b) { fPrintMVADebugInfo = b; }
56 loizides 1.20 void SetApplyD0Cut(Bool_t b) { fApplyD0Cut = b; }
57 ceballos 1.32 void SetApplyDZCut(Bool_t b) { fApplyDZCut = b; }
58 loizides 1.11 void SetCaloIsoCut(Double_t cut) { fCaloIsolationCut = cut; }
59     void SetClassType(const char *type) { fMuonClassType = type; }
60 loizides 1.18 void SetCleanMuonsName(const char *name) { fCleanMuonsName = name; }
61 sixie 1.35 void SetOldMuonsName(const char *n) { fNonIsolatedMuonsName = n; }
62     void SetOldElectronsName(const char *n) { fNonIsolatedElectronsName = n; }
63 loizides 1.11 void SetCleanName(const char *name) { SetCleanMuonsName(name); }
64 loizides 1.18 void SetCombIsoCut(Double_t cut) { fCombIsolationCut = cut; }
65 sixie 1.35 void SetCombRelativeIsoCut(Double_t cut) { fCombRelativeIsolationCut = cut; }
66     void SetPFIsoCut(Double_t cut) { fPFIsolationCut = cut; }
67 loizides 1.20 void SetD0Cut(Double_t cut) { fD0Cut = cut; }
68 ceballos 1.32 void SetDZCut(Double_t cut) { fDZCut = cut; }
69     void SetWhichVertex(Int_t d) { fWhichVertex = d; }
70 ceballos 1.25 void SetEtaCut(Double_t cut) { fEtaCut = cut; }
71 loizides 1.11 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 ceballos 1.36 void SetIntRadius(Double_t dr) { fIntRadius = dr; }
78 sixie 1.38 void SetMuonMVAWeightsSubdet0Pt10To14p5(TString s)
79     { fMuonMVAWeights_Subdet0Pt10To14p5 = s; }
80     void SetMuonMVAWeightsSubdet1Pt10To14p5(TString s)
81     { fMuonMVAWeights_Subdet1Pt10To14p5 = s; }
82     void SetMuonMVAWeightsSubdet0Pt14p5To20(TString s)
83     { fMuonMVAWeights_Subdet0Pt14p5To20 = s; }
84     void SetMuonMVAWeightsSubdet1Pt14p5To20(TString s)
85     { fMuonMVAWeights_Subdet1Pt14p5To20 = s; }
86     void SetMuonMVAWeightsSubdet0Pt20ToInf(TString s)
87     { fMuonMVAWeights_Subdet0Pt20ToInf = s; }
88     void SetMuonMVAWeightsSubdet1Pt20ToInf(TString s)
89     { fMuonMVAWeights_Subdet1Pt20ToInf = s; }
90 loizides 1.6
91 fabstoec 1.43 void SetRhoType(RhoUtilities::RhoType type)
92     { fTheRhoType = type; };
93    
94 fabstoec 1.44 void SetVertexName(const char* name) { fVertexName = name; }
95    
96 loizides 1.6 enum EMuIdType {
97     kIdUndef = 0, //not defined
98 ceballos 1.26 kWMuId, //"WMuId"
99     kZMuId, //"ZMuId"
100 loizides 1.6 kTight, //"Tight"
101     kLoose, //"Loose"
102 ceballos 1.34 kWWMuIdV1, //"WWMuIdV1"
103     kWWMuIdV2, //"WWMuIdV2"
104 ceballos 1.37 kWWMuIdV3, //"WWMuIdV3"
105 sixie 1.38 kNoId, //"NoId"
106     kCustomId, //"Custom"
107     kMVAID_BDTG_IDIso //"BDTG ID + Iso03, Iso04 Combined"
108 loizides 1.6 };
109     enum EMuIsoType {
110 sixie 1.35 kIsoUndef = 0, //"not defined"
111     kTrackCalo, //"TrackCalo"
112     kTrackCaloCombined, //"TrackCaloCombined"
113     kTrackCaloSliding, //"TrackCaloSliding"
114     kTrackCaloSlidingNoCorrection, //"TrackCaloSlidingNoCorrection"
115     kCombinedRelativeConeAreaCorrected, //"CombinedRelativeConeAreaCorrected"
116 sixie 1.40 kCombinedRelativeEffectiveAreaCorrected,
117 sixie 1.35 kCustomIso, //"Custom"
118     kPFIso, //"PFIso"
119 ceballos 1.42 kPFRadialIso, //"PFRadialIso"
120 sixie 1.38 kPFIsoEffectiveAreaCorrected, //"PFIso with EffectiveArea Pileup Correction"
121 sixie 1.35 kPFIsoNoL, //"PFIsoNoL"
122 sixie 1.38 kNoIso, //"NoIso"
123 ceballos 1.45 kMVAIso_BDTG_IDIso, //"BDTG ID + Iso03, Iso04 Combined"
124 ceballos 1.46 kIsoRingsV0_BDTG_Iso, //"BDTG Iso Rings"
125     kIsoDeltaR //"BGDT Iso dR"
126 loizides 1.6 };
127     enum EMuClassType {
128     kClassUndef = 0, //not defined
129     kAll, //"All"
130     kGlobal, //"Global"
131 ceballos 1.34 kGlobalTracker, //"GlobalTracker"
132 loizides 1.6 kSta, //"Standalone"
133 loizides 1.23 kTrackerMuon, //"TrackerMuon"
134     kCaloMuon, //"CaloMuon"
135     kTrackerBased //"TrackerMuon or CaloMuon"
136 sixie 1.38
137 loizides 1.6 };
138    
139 loizides 1.1 protected:
140 loizides 1.11 void Process();
141     void SlaveBegin();
142 ceballos 1.46 void Terminate();
143 loizides 1.10
144 sixie 1.41 Bool_t fPrintMVADebugInfo; //print MVA debug information
145 loizides 1.11 TString fMuonBranchName; //name of muon collection (input)
146     TString fCleanMuonsName; //name of exported "good muon" collection
147 ceballos 1.29 TString fNonIsolatedMuonsName; //name of imported "old muon" collection
148     TString fNonIsolatedElectronsName;//name of imported "old electron" collection
149 ceballos 1.15 TString fVertexName; //name of vertex collection
150 ceballos 1.32 TString fBeamSpotName; //name of beamspot collection
151 ceballos 1.28 TString fTrackName; //name of track collection
152     TString fPFCandidatesName; //name of pfcandidates collection
153 loizides 1.11 TString fMuonIDType; //type of muon id scheme we impose
154     TString fMuonIsoType; //type of muon isolations scheme we impose
155     TString fMuonClassType; //type of muon class we impose
156     Double_t fTrackIsolationCut; //cut value for track isolation
157     Double_t fCaloIsolationCut; //cut value for calo isolation
158     Double_t fCombIsolationCut; //cut value for combined isolation
159 sixie 1.35 Double_t fCombRelativeIsolationCut; //cut value for combined relative isolation
160     Double_t fPFIsolationCut; //cut value for combined isolation
161 loizides 1.11 Double_t fMuonPtMin; //min muon pt
162 loizides 1.20 Bool_t fApplyD0Cut; //=true then apply d0 cut (def=1)
163 ceballos 1.32 Bool_t fApplyDZCut; //=true then apply dz cut (def=1)
164 loizides 1.16 Double_t fD0Cut; //max d0
165 ceballos 1.32 Double_t fDZCut; //max dz
166     Int_t fWhichVertex; //vertex to use (-2: beamspot, -1: closest in Z)
167 ceballos 1.25 Double_t fEtaCut; //max eta, absolute value
168 loizides 1.11 EMuIdType fMuIDType; //!muon id type (imposed)
169     EMuIsoType fMuIsoType; //!muon iso type (imposed)
170     EMuClassType fMuClassType; //!muon class type (imposed)
171 loizides 1.16 const MuonCol *fMuons; //!muon collection
172     const VertexCol *fVertices; //!vertices branch
173 ceballos 1.32 const BeamSpotCol *fBeamSpot; //!beamspot branch
174 ceballos 1.28 const TrackCol *fTracks; //!track branch
175     const PFCandidateCol *fPFCandidates; //!pfcandidate branch
176 ceballos 1.42 const PFCandidateCol *fPFNoPileUpCands; //!pfnpu collection
177 ceballos 1.36 Double_t fIntRadius; //!min IntRadius cut in pf isolation
178 ceballos 1.29 MuonCol *fNonIsolatedMuons; //!pointer to old muon collection
179     ElectronCol *fNonIsolatedElectrons;//!pointer to old electron collection
180 ceballos 1.31 TString fPileupEnergyDensityName;
181     const PileupEnergyDensityCol *fPileupEnergyDensity;
182 sixie 1.38 MuonTools *fMuonTools; // interface to tools for muon ID
183     MuonIDMVA *fMuonIDMVA; // helper class for MuonMVA
184     TString fMuonMVAWeights_Subdet0Pt10To14p5;
185     TString fMuonMVAWeights_Subdet1Pt10To14p5;
186     TString fMuonMVAWeights_Subdet0Pt14p5To20;
187     TString fMuonMVAWeights_Subdet1Pt14p5To20;
188     TString fMuonMVAWeights_Subdet0Pt20ToInf;
189     TString fMuonMVAWeights_Subdet1Pt20ToInf;
190 ceballos 1.28
191 fabstoec 1.43 RhoUtilities::RhoType fTheRhoType;
192    
193 loizides 1.11 ClassDef(MuonIDMod, 1) // Muon identification module
194 loizides 1.1 };
195     }
196     #endif