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 |
|
|
16 |
|
#define MITPHYSICS_MODS_MUONIDMOD_H |
17 |
|
|
18 |
|
#include "MitAna/TreeMod/interface/BaseMod.h" |
19 |
< |
#include "MitAna/DataTree/interface/Collections.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 |
|
namespace mithep |
29 |
|
{ |
32 |
|
public: |
33 |
|
MuonIDMod(const char *name="MuonIDMod", |
34 |
|
const char *title="Muon identification module"); |
26 |
– |
~MuonIDMod() {} |
35 |
|
|
36 |
< |
const char *GetMuonBranchName(const char *name) const { return fMuonBranchName; } |
37 |
< |
const char *GetCleanMuonsName(const char *name) const { return fCleanMuonsName; } |
38 |
< |
const char *GetMuonIDType(const char *type) const { return fMuonIDType; } |
39 |
< |
const char *GetMuonIsoType(const char *type) const { return fMuonIsoType; } |
40 |
< |
const char *GetMuonClassType(const char *type) const { return fMuonClassType; } |
41 |
< |
Double_t GetTrackIsolationCut(Double_t cut) const { return fTrackIsolationCut; } |
42 |
< |
Double_t GetCaloIsolationCut(Double_t cut) const { return fCaloIsolationCut; } |
43 |
< |
Double_t GetCombIsolationCut(Double_t cut) const { return fCombIsolationCut; } |
44 |
< |
Double_t GetMuonPtMin(Double_t pt) const { return fMuonPtMin; } |
45 |
< |
void SetMuonBranchName(const char *name) { fMuonBranchName = name; } |
46 |
< |
void SetCleanMuonsName(const char *name) { fCleanMuonsName = name; } |
47 |
< |
void SetMuonIDType(const char *type) { fMuonIDType = type; } |
48 |
< |
void SetMuonIsoType(const char *type) { fMuonIsoType = type; } |
49 |
< |
void SetMuonClassType(const char *type) { fMuonClassType = type; } |
50 |
< |
void SetTrackIsolationCut(Double_t cut) { fTrackIsolationCut = cut; } |
51 |
< |
void SetCaloIsolationCut(Double_t cut) { fCaloIsolationCut = cut; } |
52 |
< |
void SetCombIsolationCut(Double_t cut) { fCombIsolationCut = cut; } |
53 |
< |
void SetMuonPtMin(Double_t pt) { fMuonPtMin = pt; } |
36 |
> |
Double_t GetCaloIsoCut() const { return fCaloIsolationCut; } |
37 |
> |
const char *GetClassType() const { return fMuonClassType; } |
38 |
> |
const char *GetCleanName() const { return GetCleanMuonsName(); } |
39 |
> |
const char *GetCleanMuonsName() const { return fCleanMuonsName; } |
40 |
> |
Double_t GetCombIsoCut() const { return fCombIsolationCut; } |
41 |
> |
const char *GetIDType() const { return fMuonIDType; } |
42 |
> |
const char *GetInputName() const { return fMuonBranchName; } |
43 |
> |
const char *GetIsoType() const { return fMuonIsoType; } |
44 |
> |
const char *GetOutputName() const { return GetCleanMuonsName(); } |
45 |
> |
Double_t GetPtMin() const { return fMuonPtMin; } |
46 |
> |
Double_t GetTrackIsoCut() const { return fTrackIsolationCut; } |
47 |
> |
Bool_t PassMuonMVA_BDTG_IdIso(const Muon *mu, const Vertex *vertex, |
48 |
> |
const PileupEnergyDensityCol *PileupEnergyDensity) const; |
49 |
> |
void SetPrintMVADebugInfo(Bool_t b) { fPrintMVADebugInfo = b; } |
50 |
> |
void SetApplyD0Cut(Bool_t b) { fApplyD0Cut = b; } |
51 |
> |
void SetApplyDZCut(Bool_t b) { fApplyDZCut = b; } |
52 |
> |
void SetCaloIsoCut(Double_t cut) { fCaloIsolationCut = cut; } |
53 |
> |
void SetClassType(const char *type) { fMuonClassType = type; } |
54 |
> |
void SetCleanMuonsName(const char *name) { fCleanMuonsName = name; } |
55 |
> |
void SetOldMuonsName(const char *n) { fNonIsolatedMuonsName = n; } |
56 |
> |
void SetOldElectronsName(const char *n) { fNonIsolatedElectronsName = n; } |
57 |
> |
void SetCleanName(const char *name) { SetCleanMuonsName(name); } |
58 |
> |
void SetCombIsoCut(Double_t cut) { fCombIsolationCut = cut; } |
59 |
> |
void SetCombRelativeIsoCut(Double_t cut) { fCombRelativeIsolationCut = cut; } |
60 |
> |
void SetPFIsoCut(Double_t cut) { fPFIsolationCut = cut; } |
61 |
> |
void SetD0Cut(Double_t cut) { fD0Cut = cut; } |
62 |
> |
void SetDZCut(Double_t cut) { fDZCut = cut; } |
63 |
> |
void SetWhichVertex(Int_t d) { fWhichVertex = d; } |
64 |
> |
void SetEtaCut(Double_t cut) { fEtaCut = cut; } |
65 |
> |
void SetIDType(const char *type) { fMuonIDType = type; } |
66 |
> |
void SetInputName(const char *name) { fMuonBranchName = name; } |
67 |
> |
void SetIsoType(const char *type) { fMuonIsoType = type; } |
68 |
> |
void SetOutputName(const char *name) { SetCleanMuonsName(name); } |
69 |
> |
void SetPtMin(Double_t pt) { fMuonPtMin = pt; } |
70 |
> |
void SetTrackIsoCut(Double_t cut) { fTrackIsolationCut = cut; } |
71 |
> |
void SetIntRadius(Double_t dr) { fIntRadius = dr; } |
72 |
> |
void SetMuonMVAWeightsSubdet0Pt10To14p5(TString s) |
73 |
> |
{ fMuonMVAWeights_Subdet0Pt10To14p5 = s; } |
74 |
> |
void SetMuonMVAWeightsSubdet1Pt10To14p5(TString s) |
75 |
> |
{ fMuonMVAWeights_Subdet1Pt10To14p5 = s; } |
76 |
> |
void SetMuonMVAWeightsSubdet0Pt14p5To20(TString s) |
77 |
> |
{ fMuonMVAWeights_Subdet0Pt14p5To20 = s; } |
78 |
> |
void SetMuonMVAWeightsSubdet1Pt14p5To20(TString s) |
79 |
> |
{ fMuonMVAWeights_Subdet1Pt14p5To20 = s; } |
80 |
> |
void SetMuonMVAWeightsSubdet0Pt20ToInf(TString s) |
81 |
> |
{ fMuonMVAWeights_Subdet0Pt20ToInf = s; } |
82 |
> |
void SetMuonMVAWeightsSubdet1Pt20ToInf(TString s) |
83 |
> |
{ fMuonMVAWeights_Subdet1Pt20ToInf = s; } |
84 |
|
|
85 |
|
enum EMuIdType { |
86 |
|
kIdUndef = 0, //not defined |
87 |
+ |
kWMuId, //"WMuId" |
88 |
+ |
kZMuId, //"ZMuId" |
89 |
|
kTight, //"Tight" |
90 |
|
kLoose, //"Loose" |
91 |
< |
kCustomId //"Custom" |
91 |
> |
kWWMuIdV1, //"WWMuIdV1" |
92 |
> |
kWWMuIdV2, //"WWMuIdV2" |
93 |
> |
kWWMuIdV3, //"WWMuIdV3" |
94 |
> |
kNoId, //"NoId" |
95 |
> |
kCustomId, //"Custom" |
96 |
> |
kMVAID_BDTG_IDIso //"BDTG ID + Iso03, Iso04 Combined" |
97 |
|
}; |
98 |
|
enum EMuIsoType { |
99 |
< |
kIsoUndef = 0, //not defined |
100 |
< |
kTrackCalo, //"TrackCalo" |
101 |
< |
kTrackCaloCombined, //"TrackCaloCombined" |
102 |
< |
kTrackCaloSliding, //"TrackCaloSliding" |
103 |
< |
kCustomIso, //"Custom" |
104 |
< |
kNoIso //"NoIso" |
99 |
> |
kIsoUndef = 0, //"not defined" |
100 |
> |
kTrackCalo, //"TrackCalo" |
101 |
> |
kTrackCaloCombined, //"TrackCaloCombined" |
102 |
> |
kTrackCaloSliding, //"TrackCaloSliding" |
103 |
> |
kTrackCaloSlidingNoCorrection, //"TrackCaloSlidingNoCorrection" |
104 |
> |
kCombinedRelativeConeAreaCorrected, //"CombinedRelativeConeAreaCorrected" |
105 |
> |
kCombinedRelativeEffectiveAreaCorrected, |
106 |
> |
kCustomIso, //"Custom" |
107 |
> |
kPFIso, //"PFIso" |
108 |
> |
kPFIsoEffectiveAreaCorrected, //"PFIso with EffectiveArea Pileup Correction" |
109 |
> |
kPFIsoNoL, //"PFIsoNoL" |
110 |
> |
kNoIso, //"NoIso" |
111 |
> |
kMVAIso_BDTG_IDIso //"BDTG ID + Iso03, Iso04 Combined" |
112 |
|
}; |
113 |
|
enum EMuClassType { |
114 |
|
kClassUndef = 0, //not defined |
115 |
|
kAll, //"All" |
116 |
|
kGlobal, //"Global" |
117 |
+ |
kGlobalTracker, //"GlobalTracker" |
118 |
|
kSta, //"Standalone" |
119 |
< |
kTrackerOnly //"TrackerOnly" |
119 |
> |
kTrackerMuon, //"TrackerMuon" |
120 |
> |
kCaloMuon, //"CaloMuon" |
121 |
> |
kTrackerBased //"TrackerMuon or CaloMuon" |
122 |
> |
|
123 |
|
}; |
124 |
|
|
125 |
|
protected: |
126 |
< |
void Process(); |
127 |
< |
void SlaveBegin(); |
126 |
> |
void Process(); |
127 |
> |
void SlaveBegin(); |
128 |
> |
|
129 |
> |
Bool_t fPrintMVADebugInfo; //print MVA debug information |
130 |
> |
TString fMuonBranchName; //name of muon collection (input) |
131 |
> |
TString fCleanMuonsName; //name of exported "good muon" collection |
132 |
> |
TString fNonIsolatedMuonsName; //name of imported "old muon" collection |
133 |
> |
TString fNonIsolatedElectronsName;//name of imported "old electron" collection |
134 |
> |
TString fVertexName; //name of vertex collection |
135 |
> |
TString fBeamSpotName; //name of beamspot collection |
136 |
> |
TString fTrackName; //name of track collection |
137 |
> |
TString fPFCandidatesName; //name of pfcandidates collection |
138 |
> |
TString fMuonIDType; //type of muon id scheme we impose |
139 |
> |
TString fMuonIsoType; //type of muon isolations scheme we impose |
140 |
> |
TString fMuonClassType; //type of muon class we impose |
141 |
> |
Double_t fTrackIsolationCut; //cut value for track isolation |
142 |
> |
Double_t fCaloIsolationCut; //cut value for calo isolation |
143 |
> |
Double_t fCombIsolationCut; //cut value for combined isolation |
144 |
> |
Double_t fCombRelativeIsolationCut; //cut value for combined relative isolation |
145 |
> |
Double_t fPFIsolationCut; //cut value for combined isolation |
146 |
> |
Double_t fMuonPtMin; //min muon pt |
147 |
> |
Bool_t fApplyD0Cut; //=true then apply d0 cut (def=1) |
148 |
> |
Bool_t fApplyDZCut; //=true then apply dz cut (def=1) |
149 |
> |
Double_t fD0Cut; //max d0 |
150 |
> |
Double_t fDZCut; //max dz |
151 |
> |
Int_t fWhichVertex; //vertex to use (-2: beamspot, -1: closest in Z) |
152 |
> |
Double_t fEtaCut; //max eta, absolute value |
153 |
> |
EMuIdType fMuIDType; //!muon id type (imposed) |
154 |
> |
EMuIsoType fMuIsoType; //!muon iso type (imposed) |
155 |
> |
EMuClassType fMuClassType; //!muon class type (imposed) |
156 |
> |
const MuonCol *fMuons; //!muon collection |
157 |
> |
const VertexCol *fVertices; //!vertices branch |
158 |
> |
const BeamSpotCol *fBeamSpot; //!beamspot branch |
159 |
> |
const TrackCol *fTracks; //!track branch |
160 |
> |
const PFCandidateCol *fPFCandidates; //!pfcandidate branch |
161 |
> |
Double_t fIntRadius; //!min IntRadius cut in pf isolation |
162 |
> |
MuonCol *fNonIsolatedMuons; //!pointer to old muon collection |
163 |
> |
ElectronCol *fNonIsolatedElectrons;//!pointer to old electron collection |
164 |
> |
TString fPileupEnergyDensityName; |
165 |
> |
const PileupEnergyDensityCol *fPileupEnergyDensity; |
166 |
> |
MuonTools *fMuonTools; // interface to tools for muon ID |
167 |
> |
MuonIDMVA *fMuonIDMVA; // helper class for MuonMVA |
168 |
> |
TString fMuonMVAWeights_Subdet0Pt10To14p5; |
169 |
> |
TString fMuonMVAWeights_Subdet1Pt10To14p5; |
170 |
> |
TString fMuonMVAWeights_Subdet0Pt14p5To20; |
171 |
> |
TString fMuonMVAWeights_Subdet1Pt14p5To20; |
172 |
> |
TString fMuonMVAWeights_Subdet0Pt20ToInf; |
173 |
> |
TString fMuonMVAWeights_Subdet1Pt20ToInf; |
174 |
|
|
175 |
< |
TString fMuonBranchName; //name of muon collection (in branch) |
74 |
< |
TString fCleanMuonsName; //name of exported "good muon" collection |
75 |
< |
TString fMuonIDType; //type of muon id scheme we impose |
76 |
< |
TString fMuonIsoType; //type of muon isolations scheme we impose |
77 |
< |
TString fMuonClassType; //type of muon class we impose |
78 |
< |
Double_t fTrackIsolationCut; //cut value for track isolation |
79 |
< |
Double_t fCaloIsolationCut; //cut value for calo isolation |
80 |
< |
Double_t fCombIsolationCut; //cut value for combined isolation |
81 |
< |
Double_t fMuonPtMin; //min muon pt |
82 |
< |
const MuonCol *fMuons; //!muon branch |
83 |
< |
MuonTools *fMuonTools; //!muon tool |
84 |
< |
EMuIdType fMuIDType; //!muon id type (imposed) |
85 |
< |
EMuIsoType fMuIsoType; //!muon iso type (imposed) |
86 |
< |
EMuClassType fMuClassType; //!muon class type (imposed) |
87 |
< |
|
88 |
< |
ClassDef(MuonIDMod,1) // Muon identification module |
175 |
> |
ClassDef(MuonIDMod, 1) // Muon identification module |
176 |
|
}; |
177 |
|
} |
178 |
|
#endif |