ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/interface/MuonIDMod.h
Revision: 1.44
Committed: Thu May 3 08:45:30 2012 UTC (13 years ago) by fabstoec
Content type: text/plain
Branch: MAIN
Changes since 1.43: +3 -1 lines
Log Message:
small update on RhoUtilities (changed default from NONE to DEFAULT)

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: MuonIDMod.h,v 1.43 2012/05/02 16:33:50 fabstoec 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 void SetPrintMVADebugInfo(Bool_t b) { fPrintMVADebugInfo = b; }
52 void SetApplyD0Cut(Bool_t b) { fApplyD0Cut = b; }
53 void SetApplyDZCut(Bool_t b) { fApplyDZCut = b; }
54 void SetCaloIsoCut(Double_t cut) { fCaloIsolationCut = cut; }
55 void SetClassType(const char *type) { fMuonClassType = type; }
56 void SetCleanMuonsName(const char *name) { fCleanMuonsName = name; }
57 void SetOldMuonsName(const char *n) { fNonIsolatedMuonsName = n; }
58 void SetOldElectronsName(const char *n) { fNonIsolatedElectronsName = n; }
59 void SetCleanName(const char *name) { SetCleanMuonsName(name); }
60 void SetCombIsoCut(Double_t cut) { fCombIsolationCut = cut; }
61 void SetCombRelativeIsoCut(Double_t cut) { fCombRelativeIsolationCut = cut; }
62 void SetPFIsoCut(Double_t cut) { fPFIsolationCut = cut; }
63 void SetD0Cut(Double_t cut) { fD0Cut = cut; }
64 void SetDZCut(Double_t cut) { fDZCut = cut; }
65 void SetWhichVertex(Int_t d) { fWhichVertex = d; }
66 void SetEtaCut(Double_t cut) { fEtaCut = cut; }
67 void SetIDType(const char *type) { fMuonIDType = type; }
68 void SetInputName(const char *name) { fMuonBranchName = name; }
69 void SetIsoType(const char *type) { fMuonIsoType = type; }
70 void SetOutputName(const char *name) { SetCleanMuonsName(name); }
71 void SetPtMin(Double_t pt) { fMuonPtMin = pt; }
72 void SetTrackIsoCut(Double_t cut) { fTrackIsolationCut = cut; }
73 void SetIntRadius(Double_t dr) { fIntRadius = dr; }
74 void SetMuonMVAWeightsSubdet0Pt10To14p5(TString s)
75 { fMuonMVAWeights_Subdet0Pt10To14p5 = s; }
76 void SetMuonMVAWeightsSubdet1Pt10To14p5(TString s)
77 { fMuonMVAWeights_Subdet1Pt10To14p5 = s; }
78 void SetMuonMVAWeightsSubdet0Pt14p5To20(TString s)
79 { fMuonMVAWeights_Subdet0Pt14p5To20 = s; }
80 void SetMuonMVAWeightsSubdet1Pt14p5To20(TString s)
81 { fMuonMVAWeights_Subdet1Pt14p5To20 = s; }
82 void SetMuonMVAWeightsSubdet0Pt20ToInf(TString s)
83 { fMuonMVAWeights_Subdet0Pt20ToInf = s; }
84 void SetMuonMVAWeightsSubdet1Pt20ToInf(TString s)
85 { fMuonMVAWeights_Subdet1Pt20ToInf = s; }
86
87 void SetRhoType(RhoUtilities::RhoType type)
88 { fTheRhoType = type; };
89
90 void SetVertexName(const char* name) { fVertexName = name; }
91
92 enum EMuIdType {
93 kIdUndef = 0, //not defined
94 kWMuId, //"WMuId"
95 kZMuId, //"ZMuId"
96 kTight, //"Tight"
97 kLoose, //"Loose"
98 kWWMuIdV1, //"WWMuIdV1"
99 kWWMuIdV2, //"WWMuIdV2"
100 kWWMuIdV3, //"WWMuIdV3"
101 kNoId, //"NoId"
102 kCustomId, //"Custom"
103 kMVAID_BDTG_IDIso //"BDTG ID + Iso03, Iso04 Combined"
104 };
105 enum EMuIsoType {
106 kIsoUndef = 0, //"not defined"
107 kTrackCalo, //"TrackCalo"
108 kTrackCaloCombined, //"TrackCaloCombined"
109 kTrackCaloSliding, //"TrackCaloSliding"
110 kTrackCaloSlidingNoCorrection, //"TrackCaloSlidingNoCorrection"
111 kCombinedRelativeConeAreaCorrected, //"CombinedRelativeConeAreaCorrected"
112 kCombinedRelativeEffectiveAreaCorrected,
113 kCustomIso, //"Custom"
114 kPFIso, //"PFIso"
115 kPFRadialIso, //"PFRadialIso"
116 kPFIsoEffectiveAreaCorrected, //"PFIso with EffectiveArea Pileup Correction"
117 kPFIsoNoL, //"PFIsoNoL"
118 kNoIso, //"NoIso"
119 kMVAIso_BDTG_IDIso //"BDTG ID + Iso03, Iso04 Combined"
120 };
121 enum EMuClassType {
122 kClassUndef = 0, //not defined
123 kAll, //"All"
124 kGlobal, //"Global"
125 kGlobalTracker, //"GlobalTracker"
126 kSta, //"Standalone"
127 kTrackerMuon, //"TrackerMuon"
128 kCaloMuon, //"CaloMuon"
129 kTrackerBased //"TrackerMuon or CaloMuon"
130
131 };
132
133 protected:
134 void Process();
135 void SlaveBegin();
136
137 Bool_t fPrintMVADebugInfo; //print MVA debug information
138 TString fMuonBranchName; //name of muon collection (input)
139 TString fCleanMuonsName; //name of exported "good muon" collection
140 TString fNonIsolatedMuonsName; //name of imported "old muon" collection
141 TString fNonIsolatedElectronsName;//name of imported "old electron" collection
142 TString fVertexName; //name of vertex collection
143 TString fBeamSpotName; //name of beamspot collection
144 TString fTrackName; //name of track collection
145 TString fPFCandidatesName; //name of pfcandidates collection
146 TString fMuonIDType; //type of muon id scheme we impose
147 TString fMuonIsoType; //type of muon isolations scheme we impose
148 TString fMuonClassType; //type of muon class we impose
149 Double_t fTrackIsolationCut; //cut value for track isolation
150 Double_t fCaloIsolationCut; //cut value for calo isolation
151 Double_t fCombIsolationCut; //cut value for combined isolation
152 Double_t fCombRelativeIsolationCut; //cut value for combined relative isolation
153 Double_t fPFIsolationCut; //cut value for combined isolation
154 Double_t fMuonPtMin; //min muon pt
155 Bool_t fApplyD0Cut; //=true then apply d0 cut (def=1)
156 Bool_t fApplyDZCut; //=true then apply dz cut (def=1)
157 Double_t fD0Cut; //max d0
158 Double_t fDZCut; //max dz
159 Int_t fWhichVertex; //vertex to use (-2: beamspot, -1: closest in Z)
160 Double_t fEtaCut; //max eta, absolute value
161 EMuIdType fMuIDType; //!muon id type (imposed)
162 EMuIsoType fMuIsoType; //!muon iso type (imposed)
163 EMuClassType fMuClassType; //!muon class type (imposed)
164 const MuonCol *fMuons; //!muon collection
165 const VertexCol *fVertices; //!vertices branch
166 const BeamSpotCol *fBeamSpot; //!beamspot branch
167 const TrackCol *fTracks; //!track branch
168 const PFCandidateCol *fPFCandidates; //!pfcandidate branch
169 const PFCandidateCol *fPFNoPileUpCands; //!pfnpu collection
170 Double_t fIntRadius; //!min IntRadius cut in pf isolation
171 MuonCol *fNonIsolatedMuons; //!pointer to old muon collection
172 ElectronCol *fNonIsolatedElectrons;//!pointer to old electron collection
173 TString fPileupEnergyDensityName;
174 const PileupEnergyDensityCol *fPileupEnergyDensity;
175 MuonTools *fMuonTools; // interface to tools for muon ID
176 MuonIDMVA *fMuonIDMVA; // helper class for MuonMVA
177 TString fMuonMVAWeights_Subdet0Pt10To14p5;
178 TString fMuonMVAWeights_Subdet1Pt10To14p5;
179 TString fMuonMVAWeights_Subdet0Pt14p5To20;
180 TString fMuonMVAWeights_Subdet1Pt14p5To20;
181 TString fMuonMVAWeights_Subdet0Pt20ToInf;
182 TString fMuonMVAWeights_Subdet1Pt20ToInf;
183
184 RhoUtilities::RhoType fTheRhoType;
185
186 ClassDef(MuonIDMod, 1) // Muon identification module
187 };
188 }
189 #endif