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 |
|
{ |
45 |
|
const char *GetIsoType() const { return fMuonIsoType; } |
46 |
|
const char *GetOutputName() const { return GetCleanMuonsName(); } |
47 |
|
Double_t GetPtMin() const { return fMuonPtMin; } |
41 |
– |
Bool_t GetReverseIsoCut() const { return fReverseIsoCut; } |
42 |
– |
Bool_t GetReverseD0Cut() const { return fReverseD0Cut; } |
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; } |
57 |
– |
void SetReverseIsoCut(Bool_t b) { fReverseIsoCut = b; } |
58 |
– |
void SetReverseD0Cut(Bool_t b) { fReverseD0Cut = b; } |
76 |
|
void SetTrackIsoCut(Double_t cut) { fTrackIsolationCut = cut; } |
77 |
+ |
void SetIntRadius(Double_t dr) { fIntRadius = dr; } |
78 |
+ |
|
79 |
+ |
void SetRhoType(RhoUtilities::RhoType type) |
80 |
+ |
{ fTheRhoType = type; }; |
81 |
|
|
82 |
+ |
void SetVertexName(const char* name) { fVertexName = name; } |
83 |
+ |
|
84 |
|
enum EMuIdType { |
85 |
|
kIdUndef = 0, //not defined |
86 |
|
kWMuId, //"WMuId" |
87 |
|
kZMuId, //"ZMuId" |
88 |
|
kTight, //"Tight" |
89 |
|
kLoose, //"Loose" |
90 |
< |
kMinimal, //"Minimal" |
91 |
< |
kNoId, //"NoId" |
92 |
< |
kCustomId //"Custom" |
90 |
> |
kWWMuIdV1, //"WWMuIdV1" |
91 |
> |
kWWMuIdV2, //"WWMuIdV2" |
92 |
> |
kWWMuIdV3, //"WWMuIdV3" |
93 |
> |
kNoId, //"NoId" |
94 |
> |
kCustomId, //"Custom" |
95 |
> |
kMVAID_BDTG_IDIso //"BDTG ID + Iso03, Iso04 Combined" |
96 |
|
}; |
97 |
|
enum EMuIsoType { |
98 |
< |
kIsoUndef = 0, //not defined |
99 |
< |
kTrackCalo, //"TrackCalo" |
100 |
< |
kTrackCaloCombined, //"TrackCaloCombined" |
101 |
< |
kTrackCaloSliding, //"TrackCaloSliding" |
102 |
< |
kCustomIso, //"Custom" |
103 |
< |
kNoIso //"NoIso" |
98 |
> |
kIsoUndef = 0, //"not defined" |
99 |
> |
kTrackCalo, //"TrackCalo" |
100 |
> |
kTrackCaloCombined, //"TrackCaloCombined" |
101 |
> |
kTrackCaloSliding, //"TrackCaloSliding" |
102 |
> |
kTrackCaloSlidingNoCorrection, //"TrackCaloSlidingNoCorrection" |
103 |
> |
kCombinedRelativeConeAreaCorrected, //"CombinedRelativeConeAreaCorrected" |
104 |
> |
kCombinedRelativeEffectiveAreaCorrected, |
105 |
> |
kCustomIso, //"Custom" |
106 |
> |
kPFIso, //"PFIso" |
107 |
> |
kPFRadialIso, //"PFRadialIso" |
108 |
> |
kPFIsoEffectiveAreaCorrected, //"PFIso with EffectiveArea Pileup Correction" |
109 |
> |
kPFIsoNoL, //"PFIsoNoL" |
110 |
> |
kNoIso, //"NoIso" |
111 |
> |
kMVAIso_BDTG_IDIso, //"BDTG ID + Iso03, Iso04 Combined" |
112 |
> |
kIsoRingsV0_BDTG_Iso, //"BDTG Iso Rings" |
113 |
> |
kIsoDeltaR //"BGDT Iso dR" |
114 |
|
}; |
115 |
|
enum EMuClassType { |
116 |
|
kClassUndef = 0, //not defined |
117 |
|
kAll, //"All" |
118 |
|
kGlobal, //"Global" |
119 |
+ |
kGlobalTracker, //"GlobalTracker" |
120 |
|
kSta, //"Standalone" |
121 |
|
kTrackerMuon, //"TrackerMuon" |
122 |
|
kCaloMuon, //"CaloMuon" |
123 |
|
kTrackerBased //"TrackerMuon or CaloMuon" |
124 |
+ |
|
125 |
|
}; |
126 |
|
|
127 |
|
protected: |
128 |
|
void Process(); |
129 |
|
void SlaveBegin(); |
130 |
+ |
void Terminate(); |
131 |
|
|
132 |
+ |
Bool_t fPrintMVADebugInfo; //print MVA debug information |
133 |
|
TString fMuonBranchName; //name of muon collection (input) |
134 |
|
TString fCleanMuonsName; //name of exported "good muon" collection |
135 |
+ |
TString fNonIsolatedMuonsName; //name of imported "old muon" collection |
136 |
+ |
TString fNonIsolatedElectronsName;//name of imported "old electron" collection |
137 |
|
TString fVertexName; //name of vertex collection |
138 |
+ |
TString fBeamSpotName; //name of beamspot collection |
139 |
+ |
TString fTrackName; //name of track collection |
140 |
+ |
TString fPFCandidatesName; //name of pfcandidates collection |
141 |
|
TString fMuonIDType; //type of muon id scheme we impose |
142 |
|
TString fMuonIsoType; //type of muon isolations scheme we impose |
143 |
|
TString fMuonClassType; //type of muon class we impose |
144 |
|
Double_t fTrackIsolationCut; //cut value for track isolation |
145 |
|
Double_t fCaloIsolationCut; //cut value for calo isolation |
146 |
|
Double_t fCombIsolationCut; //cut value for combined isolation |
147 |
+ |
Double_t fCombRelativeIsolationCut; //cut value for combined relative isolation |
148 |
+ |
Double_t fPFIsolationCut; //cut value for combined isolation |
149 |
|
Double_t fMuonPtMin; //min muon pt |
150 |
|
Bool_t fApplyD0Cut; //=true then apply d0 cut (def=1) |
151 |
+ |
Bool_t fApplyDZCut; //=true then apply dz cut (def=1) |
152 |
|
Double_t fD0Cut; //max d0 |
153 |
+ |
Double_t fDZCut; //max dz |
154 |
+ |
Int_t fWhichVertex; //vertex to use (-2: beamspot, -1: closest in Z) |
155 |
|
Double_t fEtaCut; //max eta, absolute value |
106 |
– |
Bool_t fReverseIsoCut; //apply reversion iso cut (default=0) |
107 |
– |
Bool_t fReverseD0Cut; //apply reversion d0 cut (default=0) |
156 |
|
EMuIdType fMuIDType; //!muon id type (imposed) |
157 |
|
EMuIsoType fMuIsoType; //!muon iso type (imposed) |
158 |
|
EMuClassType fMuClassType; //!muon class type (imposed) |
159 |
|
const MuonCol *fMuons; //!muon collection |
160 |
|
const VertexCol *fVertices; //!vertices branch |
161 |
< |
MuonTools *fMuonTools; //!muon tool |
162 |
< |
|
161 |
> |
const BeamSpotCol *fBeamSpot; //!beamspot branch |
162 |
> |
const TrackCol *fTracks; //!track branch |
163 |
> |
const PFCandidateCol *fPFCandidates; //!pfcandidate branch |
164 |
> |
const PFCandidateCol *fPFNoPileUpCands; //!pfnpu collection |
165 |
> |
Double_t fIntRadius; //!min IntRadius cut in pf isolation |
166 |
> |
MuonCol *fNonIsolatedMuons; //!pointer to old muon collection |
167 |
> |
ElectronCol *fNonIsolatedElectrons;//!pointer to old electron collection |
168 |
> |
TString fPileupEnergyDensityName; |
169 |
> |
const PileupEnergyDensityCol *fPileupEnergyDensity; |
170 |
> |
MuonTools *fMuonTools; // interface to tools for muon ID |
171 |
> |
MuonIDMVA *fMuonIDMVA; // helper class for MuonMVA |
172 |
> |
|
173 |
> |
RhoUtilities::RhoType fTheRhoType; |
174 |
> |
|
175 |
|
ClassDef(MuonIDMod, 1) // Muon identification module |
176 |
|
}; |
177 |
|
} |