ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/LeptonSelection/interface/IsolationSelection.h
Revision: 1.16
Committed: Tue Jun 5 19:35:47 2012 UTC (12 years, 11 months ago) by khahn
Content type: text/plain
Branch: MAIN
CVS Tags: synced_FSR_2, synced_FSR
Changes since 1.15: +16 -17 lines
Log Message:
final sync for FSR

File Contents

# User Rev Content
1 khahn 1.15 #include "Array.h"
2 khahn 1.4 #include "Electron.h"
3     #include "Muon.h"
4     #include "Vertex.h"
5     #include "PFCandidate.h"
6     #include "PFCandidateCol.h"
7     #include "PileupEnergyDensity.h"
8    
9 khahn 1.15 #include "TLorentzVector.h"
10    
11 khahn 1.4 #include "MuonTools.h"
12     #include "ElectronTools.h"
13 khahn 1.1
14     #include "ParseArgs.h"
15     #include "SelectionStatus.h"
16 khahn 1.2 #include "SimpleLepton.h"
17 khahn 1.1
18 khahn 1.4 #define MUON_ISOMVA_CUT_BIN0 -0.615
19 khahn 1.5 #define MUON_ISOMVA_CUT_BIN1 0.235
20     #define MUON_ISOMVA_CUT_BIN2 -0.825
21     #define MUON_ISOMVA_CUT_BIN3 0.155
22     #define MUON_ISOMVA_CUT_BIN4 -0.965
23     #define MUON_ISOMVA_CUT_BIN5 -0.989
24 khahn 1.4
25 khahn 1.6 #define MUON_ISOMVA_FORPFID_CUT_BIN0 -0.5934
26     #define MUON_ISOMVA_FORPFID_CUT_BIN1 0.3374
27     #define MUON_ISOMVA_FORPFID_CUT_BIN2 -0.7666
28     #define MUON_ISOMVA_FORPFID_CUT_BIN3 0.4102
29     #define MUON_ISOMVA_FORPFID_CUT_BIN4 -0.989
30     #define MUON_ISOMVA_FORPFID_CUT_BIN5 -0.9946
31    
32 khahn 1.7 #define MUON_ISOMVA_LOOSE_FORPFID_CUT_BIN0 -0.5934
33     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_BIN1 0.3374
34     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_BIN2 -0.7666
35     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_BIN3 0.4102
36     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_BIN4 -0.989
37     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_BIN5 -0.9946
38    
39     #define MUON_ISOMVA_TIGHT_FORPFID_CUT_BIN0 -0.5934
40     #define MUON_ISOMVA_TIGHT_FORPFID_CUT_BIN1 0.3374
41     #define MUON_ISOMVA_TIGHT_FORPFID_CUT_BIN2 -0.7666
42     #define MUON_ISOMVA_TIGHT_FORPFID_CUT_BIN3 0.4102
43     #define MUON_ISOMVA_TIGHT_FORPFID_CUT_BIN4 -0.989
44     #define MUON_ISOMVA_TIGHT_FORPFID_CUT_BIN5 -0.9946
45    
46     #define ELECTRON_LOOSE_ISOMVA_CUT_BIN0 0.385
47     #define ELECTRON_LOOSE_ISOMVA_CUT_BIN1 -0.083
48     #define ELECTRON_LOOSE_ISOMVA_CUT_BIN2 -0.573
49     #define ELECTRON_LOOSE_ISOMVA_CUT_BIN3 0.413
50     #define ELECTRON_LOOSE_ISOMVA_CUT_BIN4 0.271
51     #define ELECTRON_LOOSE_ISOMVA_CUT_BIN5 0.135
52    
53     #define ELECTRON_TIGHT_ISOMVA_CUT_BIN0 0.533
54     #define ELECTRON_TIGHT_ISOMVA_CUT_BIN1 -0.237
55     #define ELECTRON_TIGHT_ISOMVA_CUT_BIN2 -0.573
56     #define ELECTRON_TIGHT_ISOMVA_CUT_BIN3 0.521
57     #define ELECTRON_TIGHT_ISOMVA_CUT_BIN4 0.531
58     #define ELECTRON_TIGHT_ISOMVA_CUT_BIN5 0.493
59    
60 khahn 1.11
61     //
62     // optimization test
63     //
64     #define ELECTRON_LOOSE_ISOMVA_CUT_OPT_BIN0 0.385
65     #define ELECTRON_LOOSE_ISOMVA_CUT_OPT_BIN1 -0.083
66     #define ELECTRON_LOOSE_ISOMVA_CUT_OPT_BIN2 -0.573
67     #define ELECTRON_LOOSE_ISOMVA_CUT_OPT_BIN3 0.413
68     #define ELECTRON_LOOSE_ISOMVA_CUT_OPT_BIN4 0.271
69     #define ELECTRON_LOOSE_ISOMVA_CUT_OPT_BIN5 0.135
70    
71     #ifdef MUONISO_WP0
72     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0 0.03735
73     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1 0.86195
74     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2 -0.15025
75     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3 0.87945
76     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4 -0.88455
77     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5 -0.90835
78     #elif MUONISO_WP1
79     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0 -0.19505
80     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1 0.77445
81     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2 -0.46945
82     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3 0.64635
83     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4 -0.93635
84     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5 -0.96505
85     #elif MUONISO_WP2
86     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0 -0.33995
87     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1 0.60785
88     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2 -0.52125
89     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3 0.54135
90     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4 -0.97765
91     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5 -0.97485
92     #elif MUONISO_WP3
93     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0 -0.42045
94     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1 0.37195
95     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2 -0.59335
96     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3 0.41045
97     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4 -0.98465
98     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5 -0.98185
99     #elif MUONISO_WP4
100     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0 -0.48065
101     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1 0.26765
102     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2 -0.64095
103     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3 0.14865
104     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4 -0.98675
105     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5 -0.98815
106     #elif MUONISO_WP5
107     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0 -0.52195
108     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1 0.12905
109     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2 -0.68715
110     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3 0.00305
111     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4 -0.99165
112     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5 -0.99235
113     #elif MUONISO_WP6
114     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0 -0.60315
115     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1 -0.13415
116     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2 -0.75855
117     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3 -0.18805
118     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4 -0.99235
119     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5 -0.99445
120     #elif MUONISO_WP7
121     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0 -0.65565
122     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1 -0.34345
123     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2 -0.79985
124     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3 -0.31475
125     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4 -0.99445
126     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5 -0.99655
127     #elif MUONISO_WP8
128     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0 -0.70535
129     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1 -0.39945
130     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2 -0.82645
131     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3 -0.64865
132     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4 -0.99515
133     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5 -0.99795
134     #elif MUONISO_WP9
135     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0 -0.79145
136     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1 -0.74245
137     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2 -0.89085
138     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3 -0.78585
139     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4 -0.99725
140     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5 -0.99865
141 khahn 1.12 #else
142     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0 -0.5934
143     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1 0.3374
144     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2 -0.7666
145     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3 0.4102
146     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4 -0.989
147     #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5 -0.9946
148 khahn 1.11 #endif
149    
150 anlevin 1.14 /* #define ELECTRON_REFERENCE_PFISO_CUT 0.25 */
151     /* #define MUON_REFERENCE_PFISO_CUT 0.25 */
152     #define ELECTRON_REFERENCE_PFISO_CUT 0.4
153     #define MUON_REFERENCE_PFISO_CUT 0.4
154 khahn 1.4
155     Float_t computePFMuonIso(const mithep::Muon *muon,
156 anlevin 1.14 const mithep::Vertex * vtx,
157 khahn 1.4 const mithep::Array<mithep::PFCandidate> * fPFCandidates,
158     const Double_t dRMax);
159    
160     Float_t computePFEleIso(const mithep::Electron *electron,
161 anlevin 1.14 const mithep::Vertex * fVertex,
162 khahn 1.4 const mithep::Array<mithep::PFCandidate> * fPFCandidates,
163     const Double_t dRMax);
164    
165     SelectionStatus electronIsoSelection(ControlFlags &, const mithep::Electron *, const mithep::Vertex &, const mithep::Array<mithep::PFCandidate> * fPFCandidateCol );
166 anlevin 1.14 SelectionStatus muonIsoSelection(ControlFlags &, const mithep::Muon *, const mithep::Vertex *, const mithep::Array<mithep::PFCandidate> * fPFCandidateCol );
167 khahn 1.2 bool pairwiseIsoSelection( ControlFlags &, vector<SimpleLepton> &, float rho );
168 anlevin 1.3 bool noIso(ControlFlags &, vector<SimpleLepton> &, float rho);
169 khahn 1.4
170     void initMuonIsoMVA();
171     SelectionStatus muonIsoMVASelection(ControlFlags &ctrl,
172     const mithep::Muon * mu,
173 anlevin 1.14 const mithep::Vertex * vtx,
174 khahn 1.4 const mithep::Array<mithep::PFCandidate> * fPFCandidates,
175     const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
176     mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
177     vector<const mithep::Muon*> muonsToVeto,
178     vector<const mithep::Electron*> electronsToVeto);
179 khahn 1.10 //hacked version
180     SelectionStatus muonIsoMVASelection(ControlFlags &ctrl,
181     const mithep::Muon * mu,
182 anlevin 1.14 const mithep::Vertex * vtx,
183 khahn 1.10 const mithep::Array<mithep::PFCandidate> * fPFCandidates,
184     float rho,
185     mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
186     vector<const mithep::Muon*> muonsToVeto,
187     vector<const mithep::Electron*> electronsToVeto);
188 khahn 1.7 double muonPFIso04(ControlFlags &ctrl,
189     const mithep::Muon * mu,
190 anlevin 1.14 const mithep::Vertex * vtx,
191 khahn 1.7 const mithep::Array<mithep::PFCandidate> * fPFCandidates,
192     const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
193     mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
194 khahn 1.16 vector<const mithep::PFCandidate*> photonsToVeto);
195    
196 khahn 1.9 // hacked version
197     double muonPFIso04(ControlFlags &ctrl,
198     const mithep::Muon * mu,
199 anlevin 1.14 const mithep::Vertex * vtx,
200 khahn 1.9 const mithep::Array<mithep::PFCandidate> * fPFCandidates,
201     float rho, // the hack
202     mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
203     vector<const mithep::Muon*> muonsToVeto,
204     vector<const mithep::Electron*> electronsToVeto);
205     //
206 khahn 1.8 SelectionStatus muonReferenceIsoSelection(ControlFlags &ctrl,
207 khahn 1.7 const mithep::Muon * mu,
208 anlevin 1.14 const mithep::Vertex * vtx,
209 khahn 1.7 const mithep::Array<mithep::PFCandidate> * fPFCandidates,
210     const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
211     mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
212 khahn 1.16 vector<const mithep::PFCandidate*> photonsToVeto);
213 khahn 1.9 // hacked version
214     SelectionStatus muonReferenceIsoSelection(ControlFlags &ctrl,
215     const mithep::Muon * mu,
216 anlevin 1.14 const mithep::Vertex * vtx,
217 khahn 1.9 const mithep::Array<mithep::PFCandidate> * fPFCandidates,
218     float,
219     mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
220     vector<const mithep::Muon*> muonsToVeto,
221     vector<const mithep::Electron*> electronsToVeto);
222 khahn 1.4
223     void initElectronIsoMVA();
224     SelectionStatus electronIsoMVASelection(ControlFlags &ctrl,
225     const mithep::Electron * ele,
226 anlevin 1.14 const mithep::Vertex * vtx,
227 khahn 1.4 const mithep::Array<mithep::PFCandidate> * fPFCandidates,
228     const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
229     mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
230     vector<const mithep::Muon*> muonsToVeto,
231     vector<const mithep::Electron*> electronsToVeto);
232 khahn 1.10 //hacked version
233     SelectionStatus electronIsoMVASelection(ControlFlags &ctrl,
234     const mithep::Electron * ele,
235 anlevin 1.14 const mithep::Vertex * vtx,
236 khahn 1.10 const mithep::Array<mithep::PFCandidate> * fPFCandidates,
237     float rho,
238     mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
239     vector<const mithep::Muon*> muonsToVeto,
240     vector<const mithep::Electron*> electronsToVeto);
241 khahn 1.7 float electronPFIso04(ControlFlags &ctrl,
242     const mithep::Electron * ele,
243     const mithep::Vertex & vtx,
244     const mithep::Array<mithep::PFCandidate> * fPFCandidates,
245     const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
246     mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
247 khahn 1.16 vector<const mithep::PFCandidate*> photonsToVeto);
248    
249 khahn 1.9 // hacked version
250     float electronPFIso04(ControlFlags &ctrl,
251     const mithep::Electron * ele,
252 anlevin 1.14 const mithep::Vertex * vtx,
253 khahn 1.9 const mithep::Array<mithep::PFCandidate> * fPFCandidates,
254     float rho, // the hack
255     mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
256     vector<const mithep::Muon*> muonsToVeto,
257     vector<const mithep::Electron*> electronsToVeto) ;
258     //
259 khahn 1.8 SelectionStatus electronReferenceIsoSelection(ControlFlags &ctrl,
260 khahn 1.7 const mithep::Electron * ele,
261 anlevin 1.14 const mithep::Vertex * vtx,
262 khahn 1.7 const mithep::Array<mithep::PFCandidate> * fPFCandidates,
263     const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
264     mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
265 khahn 1.16 vector<const mithep::PFCandidate*> photonsToVeto);
266 khahn 1.9 // hacked version
267     SelectionStatus electronReferenceIsoSelection(ControlFlags &ctrl,
268     const mithep::Electron * ele,
269 anlevin 1.14 const mithep::Vertex * vtx,
270 khahn 1.9 const mithep::Array<mithep::PFCandidate> * fPFCandidates,
271     float,
272     mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
273     vector<const mithep::Muon*> muonsToVeto,
274     vector<const mithep::Electron*> electronsToVeto);
275 khahn 1.15
276     double dbetaCorrectedIsoDr03(ControlFlags & ctrl,
277     const mithep::PFCandidate * photon,
278     const mithep::Muon * mu, // need to veto
279     const mithep::Array<mithep::PFCandidate> * fPFCandidates);
280    
281     double dbetaCorrectedIsoDr03(ControlFlags & ctrl,
282     const mithep::PFCandidate * photon,
283     const mithep::Electron * el, // need to veto
284     const mithep::Array<mithep::PFCandidate> * fPFCandidates);
285    
286 khahn 1.16 double nonCorrectedIsoDr03(ControlFlags & ctrl,
287     const mithep::PFCandidate * photon,
288     const mithep::Muon * mu, // need to veto
289     const mithep::Array<mithep::PFCandidate> * fPFCandidates);
290    
291     double nonCorrectedIsoDr03(ControlFlags & ctrl,
292     const mithep::PFCandidate * photon,
293     const mithep::Electron * el, // need to veto
294     const mithep::Array<mithep::PFCandidate> * fPFCandidates);
295