CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
electronSelectionsParameters.cc
Go to the documentation of this file.
1 #include <iostream>
4 
5 namespace HWWFunctions {
6 
7  void eidGetWP2012(const wp2012_tightness tightness, std::vector<double> &cutdeta, std::vector<double> &cutdphi, std::vector<double> &cuthoe, std::vector<double> &cutsee, std::vector<double> &cutooemoop, std::vector<double> &cutd0vtx, std::vector<double> &cutdzvtx, std::vector<bool> &cutvtxfit, std::vector<int> &cutmhit, std::vector<double> &cutrelisohighpt, std::vector<double> &cutrelisolowpt)
8  {
9 
10  switch (tightness) {
11  case VETO:
12  {
13  double dEtaIn_tmp[2] = {0.007, 0.010};
14  double dPhiIn_tmp[2] = {0.800, 0.700};
15  double sigmaIEtaIEta_tmp[2] = {0.010, 0.030};
16  double hoe_tmp[2] = {0.150, 999.9};
17  double ooemoop_tmp[2] = {999.9, 999.9};
18  double d0Vtx_tmp[2] = {0.040, 0.040};
19  double dzVtx_tmp[2] = {0.200, 0.200};
20  bool vtxFit_tmp[2] = {false, false};
21  int mHits_tmp[2] = {999, 999};
22  double isoHi_tmp[2] = {0.150, 0.150};
23  double isoLo_tmp[2] = {0.150, 0.150};
24  eidAssign(cutdeta, dEtaIn_tmp, 2);
25  eidAssign(cutdphi, dPhiIn_tmp, 2);
26  eidAssign(cutsee, sigmaIEtaIEta_tmp, 2);
27  eidAssign(cuthoe, hoe_tmp, 2);
28  eidAssign(cutooemoop, ooemoop_tmp, 2);
29  eidAssign(cutd0vtx, d0Vtx_tmp, 2);
30  eidAssign(cutdzvtx, dzVtx_tmp, 2);
31  eidAssign(cutvtxfit, vtxFit_tmp, 2);
32  eidAssign(cutmhit, mHits_tmp, 2);
33  eidAssign(cutrelisohighpt, isoHi_tmp, 2);
34  eidAssign(cutrelisolowpt, isoLo_tmp, 2);
35  return;
36  }
37  case LOOSE:
38  {
39  double dEtaIn_tmp[2] = {0.007, 0.009};
40  double dPhiIn_tmp[2] = {0.150, 0.100};
41  double sigmaIEtaIEta_tmp[2] = {0.010, 0.030};
42  double hoe_tmp[2] = {0.120, 0.100};
43  double ooemoop_tmp[2] = {0.050, 0.050};
44  double d0Vtx_tmp[2] = {0.020, 0.020};
45  double dzVtx_tmp[2] = {0.200, 0.200};
46  bool vtxFit_tmp[2] = {true, true};
47  int mHits_tmp[2] = {1, 1};
48  double isoHi_tmp[2] = {0.150, 0.150};
49  double isoLo_tmp[2] = {0.150, 0.100};
50  eidAssign(cutdeta, dEtaIn_tmp, 2);
51  eidAssign(cutdphi, dPhiIn_tmp, 2);
52  eidAssign(cutsee, sigmaIEtaIEta_tmp, 2);
53  eidAssign(cuthoe, hoe_tmp, 2);
54  eidAssign(cutooemoop, ooemoop_tmp, 2);
55  eidAssign(cutd0vtx, d0Vtx_tmp, 2);
56  eidAssign(cutdzvtx, dzVtx_tmp, 2);
57  eidAssign(cutvtxfit, vtxFit_tmp, 2);
58  eidAssign(cutmhit, mHits_tmp, 2);
59  eidAssign(cutrelisohighpt, isoHi_tmp, 2);
60  eidAssign(cutrelisolowpt, isoLo_tmp, 2);
61  return;
62  }
63  case MEDIUM:
64  {
65  double dEtaIn_tmp[2] = {0.004, 0.007};
66  double dPhiIn_tmp[2] = {0.060, 0.030};
67  double sigmaIEtaIEta_tmp[2] = {0.010, 0.030};
68  double hoe_tmp[2] = {0.120, 0.100};
69  double ooemoop_tmp[2] = {0.050, 0.050};
70  double d0Vtx_tmp[2] = {0.020, 0.020};
71  double dzVtx_tmp[2] = {0.100, 0.100};
72  bool vtxFit_tmp[2] = {true, true};
73  int mHits_tmp[2] = {1, 1};
74  double isoHi_tmp[2] = {0.150, 0.150};
75  double isoLo_tmp[2] = {0.150, 0.100};
76  eidAssign(cutdeta, dEtaIn_tmp, 2);
77  eidAssign(cutdphi, dPhiIn_tmp, 2);
78  eidAssign(cutsee, sigmaIEtaIEta_tmp, 2);
79  eidAssign(cuthoe, hoe_tmp, 2);
80  eidAssign(cutooemoop, ooemoop_tmp, 2);
81  eidAssign(cutd0vtx, d0Vtx_tmp, 2);
82  eidAssign(cutdzvtx, dzVtx_tmp, 2);
83  eidAssign(cutvtxfit, vtxFit_tmp, 2);
84  eidAssign(cutmhit, mHits_tmp, 2);
85  eidAssign(cutrelisohighpt, isoHi_tmp, 2);
86  eidAssign(cutrelisolowpt, isoLo_tmp, 2);
87  return;
88  }
89  case TIGHT:
90  {
91  double dEtaIn_tmp[2] = {0.004, 0.005};
92  double dPhiIn_tmp[2] = {0.030, 0.020};
93  double sigmaIEtaIEta_tmp[2] = {0.010, 0.030};
94  double hoe_tmp[2] = {0.120, 0.100};
95  double ooemoop_tmp[2] = {0.050, 0.050};
96  double d0Vtx_tmp[2] = {0.020, 0.020};
97  double dzVtx_tmp[2] = {0.100, 0.100};
98  bool vtxFit_tmp[2] = {true, true};
99  int mHits_tmp[2] = {0, 0};
100  double isoHi_tmp[2] = {0.100, 0.100};
101  double isoLo_tmp[2] = {0.100, 0.070};
102  eidAssign(cutdeta, dEtaIn_tmp, 2);
103  eidAssign(cutdphi, dPhiIn_tmp, 2);
104  eidAssign(cutsee, sigmaIEtaIEta_tmp, 2);
105  eidAssign(cuthoe, hoe_tmp, 2);
106  eidAssign(cutooemoop, ooemoop_tmp, 2);
107  eidAssign(cutd0vtx, d0Vtx_tmp, 2);
108  eidAssign(cutdzvtx, dzVtx_tmp, 2);
109  eidAssign(cutvtxfit, vtxFit_tmp, 2);
110  eidAssign(cutmhit, mHits_tmp, 2);
111  eidAssign(cutrelisohighpt, isoHi_tmp, 2);
112  eidAssign(cutrelisolowpt, isoLo_tmp, 2);
113  return;
114  }
115 
116  default:
117  edm::LogError("InvalidInput") << "[eidGetWP2012] ERROR! Invalid tightness level";
118 
119  }
120 
121  return;
122 
123  }
124 
125  void eidGetVBTF(const vbtf_tightness tightness, std::vector<double> &cutdeta, std::vector<double> &cutdphi, std::vector<double> &cuthoe, std::vector<double> &cutsee, std::vector<double> &cutreliso)
126  {
127 
128  switch (tightness) {
129  case VBTF_35X_95:
130  {
131  double isoThresholds_tmp[2] = {0.15, 0.1};
132  double sigmaIEtaIEtaThresholds_tmp[2] = {0.01, 0.03};
133  double dPhiInThresholds_tmp[2] = {0.8, 0.7};
134  double dEtaInThresholds_tmp[2] = {0.007, 0.01};
135  double hoeThresholds_tmp[2] = {0.5, 0.07};
136  eidAssign(cutreliso, isoThresholds_tmp, 2);
137  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
138  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
139  eidAssign(cuthoe, hoeThresholds_tmp, 2);
140  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
141  return;
142  }
143 
144  case VBTF_35X_90:
145  {
146  double isoThresholds_tmp[2] = {0.1, 0.07};
147  double sigmaIEtaIEtaThresholds_tmp[2] = {0.01, 0.03};
148  double dPhiInThresholds_tmp[2] = {0.8, 0.7};
149  double dEtaInThresholds_tmp[2] = {0.007, 0.009};
150  double hoeThresholds_tmp[2] = {0.12, 0.05};
151  eidAssign(cutreliso, isoThresholds_tmp, 2);
152  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
153  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
154  eidAssign(cuthoe, hoeThresholds_tmp, 2);
155  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
156  return;
157  }
158 
159  case VBTF_35X_85:
160  {
161  double isoThresholds_tmp[2] = {0.09, 0.06};
162  double sigmaIEtaIEtaThresholds_tmp[2] = {0.01, 0.03};
163  double dPhiInThresholds_tmp[2] = {0.06, 0.04};
164  double dEtaInThresholds_tmp[2] = {0.006, 0.007};
165  double hoeThresholds_tmp[2] = {0.04, 0.025};
166  eidAssign(cutreliso, isoThresholds_tmp, 2);
167  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
168  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
169  eidAssign(cuthoe, hoeThresholds_tmp, 2);
170  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
171  return;
172  }
173 
174  case VBTF_35X_80:
175  {
176  double isoThresholds_tmp[2] = {0.07, 0.06};
177  double sigmaIEtaIEtaThresholds_tmp[2] = {0.01, 0.03};
178  double dPhiInThresholds_tmp[2] = {0.06, 0.03};
179  double dEtaInThresholds_tmp[2] = {0.004, 0.007};
180  double hoeThresholds_tmp[2] = {0.04, 0.025};
181  eidAssign(cutreliso, isoThresholds_tmp, 2);
182  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
183  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
184  eidAssign(cuthoe, hoeThresholds_tmp, 2);
185  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
186  return;
187  }
188 
189  case VBTF_35X_70:
190  {
191  double isoThresholds_tmp[2] = {0.05, 0.04};
192  double sigmaIEtaIEtaThresholds_tmp[2] = {0.01, 0.03};
193  double dPhiInThresholds_tmp[2] = {0.03, 0.02};
194  double dEtaInThresholds_tmp[2] = {0.003, 0.005};
195  double hoeThresholds_tmp[2] = {0.025, 0.012};
196  eidAssign(cutreliso, isoThresholds_tmp, 2);
197  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
198  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
199  eidAssign(cuthoe, hoeThresholds_tmp, 2);
200  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
201  return;
202  }
203 
204  case VBTF_35X_60:
205  {
206  double isoThresholds_tmp[2] = {0.04, 0.03};
207  double sigmaIEtaIEtaThresholds_tmp[2] = {0.01, 0.03};
208  double dPhiInThresholds_tmp[2] = {0.02, 0.02};
209  double dEtaInThresholds_tmp[2] = {0.0025, 0.003};
210  double hoeThresholds_tmp[2] = {0.025, 0.009};
211  eidAssign(cutreliso, isoThresholds_tmp, 2);
212  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
213  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
214  eidAssign(cuthoe, hoeThresholds_tmp, 2);
215  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
216  return;
217  }
218 
219  case VBTF_35Xr2_70:
220  {
221  double isoThresholds_tmp[2] = {0.04, 0.03};
222  double sigmaIEtaIEtaThresholds_tmp[2] = {0.01, 0.03};
223  double dPhiInThresholds_tmp[2] = {0.03, 0.02};
224  double dEtaInThresholds_tmp[2] = {0.004, 0.005};
225  double hoeThresholds_tmp[2] = {0.025, 0.025};
226  eidAssign(cutreliso, isoThresholds_tmp, 2);
227  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
228  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
229  eidAssign(cuthoe, hoeThresholds_tmp, 2);
230  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
231  return;
232  }
233 
234  case VBTF_35Xr2_60:
235  {
236  double isoThresholds_tmp[2] = {0.03, 0.02};
237  double sigmaIEtaIEtaThresholds_tmp[2] = {0.01, 0.03};
238  double dPhiInThresholds_tmp[2] = {0.025, 0.02};
239  double dEtaInThresholds_tmp[2] = {0.004, 0.005};
240  double hoeThresholds_tmp[2] = {0.025, 0.025};
241  eidAssign(cutreliso, isoThresholds_tmp, 2);
242  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
243  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
244  eidAssign(cuthoe, hoeThresholds_tmp, 2);
245  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
246  return;
247  }
248 
249  case VBTF_80_NOHOEEND:
250  {
251  double isoThresholds_tmp[2] = {0.07, 0.06};
252  double sigmaIEtaIEtaThresholds_tmp[2] = {0.01, 0.03};
253  double dPhiInThresholds_tmp[2] = {0.06, 0.03};
254  double dEtaInThresholds_tmp[2] = {0.004, 0.007};
255  double hoeThresholds_tmp[2] = {0.04, 9999.};
256  eidAssign(cutreliso, isoThresholds_tmp, 2);
257  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
258  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
259  eidAssign(cuthoe, hoeThresholds_tmp, 2);
260  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
261  return;
262  }
263 
264  case VBTF_85_NOHOEEND:
265  {
266  double isoThresholds_tmp[2] = { 0.09 , 0.06 };
267  double sigmaIEtaIEtaThresholds_tmp[2] = { 0.01 , 0.03 };
268  double dPhiInThresholds_tmp[2] = { 0.06 , 0.04 };
269  double dEtaInThresholds_tmp[2] = { 0.006 , 0.007 };
270  double hoeThresholds_tmp[2] = { 0.04 , 9999. };
271  eidAssign(cutreliso, isoThresholds_tmp, 2);
272  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
273  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
274  eidAssign(cuthoe, hoeThresholds_tmp, 2);
275  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
276  return;
277  }
278 
279  case VBTF_85:
280  {
281  double isoThresholds_tmp[2] = { 0.09 , 0.06 };
282  double sigmaIEtaIEtaThresholds_tmp[2] = { 0.01 , 0.03 };
283  double dPhiInThresholds_tmp[2] = { 0.06 , 0.04 };
284  double dEtaInThresholds_tmp[2] = { 0.006 , 0.007 };
285  double hoeThresholds_tmp[2] = { 0.04 , 0.025 };
286  eidAssign(cutreliso, isoThresholds_tmp, 2);
287  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
288  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
289  eidAssign(cuthoe, hoeThresholds_tmp, 2);
290  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
291  return;
292  }
293 
294  case VBTF_70_NOHOEEND:
295  {
296  double isoThresholds_tmp[2] = {0.04, 0.03};
297  double sigmaIEtaIEtaThresholds_tmp[2] = {0.01, 0.03};
298  double dPhiInThresholds_tmp[2] = {0.03, 0.02};
299  double dEtaInThresholds_tmp[2] = {0.004, 0.005};
300  double hoeThresholds_tmp[2] = {0.025, 9999.};
301  eidAssign(cutreliso, isoThresholds_tmp, 2);
302  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
303  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
304  eidAssign(cuthoe, hoeThresholds_tmp, 2);
305  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
306  return;
307  }
308  case VBTF_90_HLT:
309  {
310  double isoThresholds_tmp[2] = {0.1, 0.07};
311  double sigmaIEtaIEtaThresholds_tmp[2] = {0.01, 0.03};
312  double dPhiInThresholds_tmp[2] = {0.15, 0.10};
313  double dEtaInThresholds_tmp[2] = {0.007, 0.009};
314  double hoeThresholds_tmp[2] = {0.12, 0.10};
315  eidAssign(cutreliso, isoThresholds_tmp, 2);
316  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
317  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
318  eidAssign(cuthoe, hoeThresholds_tmp, 2);
319  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
320  return;
321  }
322 
324  {
325  double isoThresholds_tmp[2] = {0.1, 0.07};
326  double sigmaIEtaIEtaThresholds_tmp[2] = {0.01, 0.03};
327  double dPhiInThresholds_tmp[2] = {0.15, 0.10};
328  double dEtaInThresholds_tmp[2] = {0.007, 0.009};
329  double hoeThresholds_tmp[2] = {0.10, 0.075};
330  eidAssign(cutreliso, isoThresholds_tmp, 2);
331  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
332  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
333  eidAssign(cuthoe, hoeThresholds_tmp, 2);
334  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
335  return;
336  }
337 
338  case VBTF_95_NOHOEEND:
339  {
340  double isoThresholds_tmp[2] = {0.15, 0.10};
341  double sigmaIEtaIEtaThresholds_tmp[2] = {0.01, 0.03};
342  double dPhiInThresholds_tmp[2] = {0.80, 0.70};
343  double dEtaInThresholds_tmp[2] = {0.007, 0.01};
344  double hoeThresholds_tmp[2] = {0.15, 999.};
345  eidAssign(cutreliso, isoThresholds_tmp, 2);
346  eidAssign(cutdeta, dEtaInThresholds_tmp, 2);
347  eidAssign(cutdphi, dPhiInThresholds_tmp, 2);
348  eidAssign(cuthoe, hoeThresholds_tmp, 2);
349  eidAssign(cutsee, sigmaIEtaIEtaThresholds_tmp, 2);
350  return;
351  }
352 
353  default:
354  edm::LogError("InvalidInput") << "[eidGetVBTF] ERROR! Invalid tightness level";
355  }
356 
357  return;
358  }
359 
360  void eidAssign(std::vector<double> &cutarr, double cutvals[], unsigned int size)
361  {
362  cutarr.clear();
363  for (unsigned int i = 0; i < size; ++i) {
364  cutarr.push_back(cutvals[i]);
365  }
366  }
367 
368 
369  void eidAssign(std::vector<bool> &cutarr, bool cutvals[], unsigned int size)
370  {
371  cutarr.clear();
372  for (unsigned int i = 0; i < size; ++i) {
373  cutarr.push_back(cutvals[i]);
374  }
375  }
376 
377  void eidAssign(std::vector<int> &cutarr, int cutvals[], unsigned int size)
378  {
379  cutarr.clear();
380  for (unsigned int i = 0; i < size; ++i) {
381  cutarr.push_back(cutvals[i]);
382  }
383  }
384 
385 }
int i
Definition: DBlmapReader.cc:9
void eidGetVBTF(const vbtf_tightness tightness, std::vector< double > &cutdeta, std::vector< double > &cutdphi, std::vector< double > &cuthoe, std::vector< double > &cutsee, std::vector< double > &cutreliso)
void eidAssign(std::vector< double > &cutarr, double cutvals[], unsigned int size)
void eidGetWP2012(const wp2012_tightness tightness, std::vector< double > &cutdeta, std::vector< double > &cutdphi, std::vector< double > &cuthoe, std::vector< double > &cutsee, std::vector< double > &cutooemoop, std::vector< double > &cutd0vtx, std::vector< double > &cutdzvtx, std::vector< bool > &cutvtxfit, std::vector< int > &cutmhit, std::vector< double > &cutrelisohighpt, std::vector< double > &cutrelisolowpt)
tuple size
Write out results.