ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/LeptonSelection/interface/IsolationSelection.h
Revision: 1.14
Committed: Tue May 22 22:31:17 2012 UTC (12 years, 11 months ago) by anlevin
Content type: text/plain
Branch: MAIN
CVS Tags: synched2
Changes since 1.13: +18 -18 lines
Log Message:
made changes for new round of synchronization

File Contents

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