CMS 3D CMS Logo

CutBasedPhotonIDAlgo.cc
Go to the documentation of this file.
1 #include "CutBasedPhotonIDAlgo.h"
4 
6  //Decision cuts
7  dophotonEcalRecHitIsolationCut_ = conf.getParameter<bool>("DoEcalRecHitIsolationCut");
8  dophotonHcalTowerIsolationCut_ = conf.getParameter<bool>("DoHcalTowerIsolationCut");
9  dophotonHCTrkIsolationCut_ = conf.getParameter<bool>("DoHollowConeTrackIsolationCut");
10  dophotonSCTrkIsolationCut_ = conf.getParameter<bool>("DoSolidConeTrackIsolationCut");
11  dophotonHCNTrkCut_ = conf.getParameter<bool>("DoHollowConeNTrkCut");
12  dophotonSCNTrkCut_ = conf.getParameter<bool>("DoSolidConeNTrkCut");
13  dophotonHadOverEMCut_ = conf.getParameter<bool>("DoHadOverEMCut");
14  dophotonsigmaeeCut_ = conf.getParameter<bool>("DoEtaWidthCut");
15  dophotonR9Cut_ = conf.getParameter<bool>("DoR9Cut");
16  dorequireFiducial_ = conf.getParameter<bool>("RequireFiducial");
17 
18  looseEMEcalIsoRelativeCutSlopeEB_ = conf.getParameter<double>("LooseEMEcalIsoRelativeCutSlopeEB");
19  looseEMEcalIsoRelativeCutOffsetEB_ = conf.getParameter<double>("LooseEMEcalIsoRelativeCutOffsetEB");
20  looseEMHcalTowerIsolationCutSlopeEB_ = conf.getParameter<double>("LooseEMHcalTowerIsoSlopeEB");
21  looseEMHcalTowerIsolationCutOffsetEB_ = conf.getParameter<double>("LooseEMHcalTowerIsoOffsetEB");
22  looseEMHollowConeTrkIsolationSlopeEB_ = conf.getParameter<double>("LooseEMHollowTrkSlopeEB");
23  looseEMHollowConeTrkIsolationOffsetEB_ = conf.getParameter<double>("LooseEMHollowTrkOffsetEB");
24  looseEMSolidConeTrkIsolationSlopeEB_ = conf.getParameter<double>("LooseEMSolidTrkSlopeEB");
25  looseEMSolidConeTrkIsolationOffsetEB_ = conf.getParameter<double>("LooseEMSolidTrkOffsetEB");
26  looseEMSolidConeTrkIsolationCutEB_ = conf.getParameter<double>("LooseEMSolidTrkEB");
27  looseEMSolidConeNTrkCutEB_ = conf.getParameter<int>("LooseEMSolidNTrkEB");
28  looseEMHollowConeNTrkCutEB_ = conf.getParameter<int>("LooseEMHollowNTrkEB");
29  looseEMEtaWidthCutEB_ = conf.getParameter<double>("LooseEMEtaWidthEB");
30  looseEMHadOverEMCutEB_ = conf.getParameter<double>("LooseEMHadOverEMEB");
31  looseEMR9CutEB_ = conf.getParameter<double>("LooseEMR9CutEB");
32 
33  loosephotonEcalIsoRelativeCutSlopeEB_ = conf.getParameter<double>("LoosePhotonEcalIsoRelativeCutSlopeEB");
34  loosephotonEcalIsoRelativeCutOffsetEB_ = conf.getParameter<double>("LoosePhotonEcalIsoRelativeCutOffsetEB");
35  loosephotonHcalTowerIsolationCutSlopeEB_ = conf.getParameter<double>("LoosePhotonHcalTowerIsoSlopeEB");
36  loosephotonHcalTowerIsolationCutOffsetEB_ = conf.getParameter<double>("LoosePhotonHcalTowerIsoOffsetEB");
37  loosephotonHollowConeTrkIsolationSlopeEB_ = conf.getParameter<double>("LoosePhotonHollowTrkSlopeEB");
38  loosephotonHollowConeTrkIsolationOffsetEB_ = conf.getParameter<double>("LoosePhotonHollowTrkOffsetEB");
39  loosephotonSolidConeTrkIsolationSlopeEB_ = conf.getParameter<double>("LoosePhotonSolidTrkSlopeEB");
40  loosephotonSolidConeTrkIsolationOffsetEB_ = conf.getParameter<double>("LoosePhotonSolidTrkOffsetEB");
41  loosephotonSolidConeTrkIsolationCutEB_ = conf.getParameter<double>("LoosePhotonSolidTrkEB");
42  loosephotonSolidConeNTrkCutEB_ = conf.getParameter<int>("LoosePhotonSolidNTrkEB");
43  loosephotonHollowConeNTrkCutEB_ = conf.getParameter<int>("LoosePhotonHollowNTrkEB");
44  loosephotonEtaWidthCutEB_ = conf.getParameter<double>("LoosePhotonEtaWidthEB");
45  loosephotonHadOverEMCutEB_ = conf.getParameter<double>("LoosePhotonHadOverEMEB");
46  loosephotonR9CutEB_ = conf.getParameter<double>("LoosePhotonR9CutEB");
47 
48  tightphotonEcalIsoRelativeCutSlopeEB_ = conf.getParameter<double>("TightPhotonEcalIsoRelativeCutSlopeEB");
49  tightphotonEcalIsoRelativeCutOffsetEB_ = conf.getParameter<double>("TightPhotonEcalIsoRelativeCutOffsetEB");
50  tightphotonHcalTowerIsolationCutSlopeEB_ = conf.getParameter<double>("TightPhotonHcalTowerIsoSlopeEB");
51  tightphotonHcalTowerIsolationCutOffsetEB_ = conf.getParameter<double>("TightPhotonHcalTowerIsoOffsetEB");
52  tightphotonHollowConeTrkIsolationSlopeEB_ = conf.getParameter<double>("TightPhotonHollowTrkSlopeEB");
53  tightphotonHollowConeTrkIsolationOffsetEB_ = conf.getParameter<double>("TightPhotonHollowTrkOffsetEB");
54  tightphotonSolidConeTrkIsolationSlopeEB_ = conf.getParameter<double>("TightPhotonSolidTrkSlopeEB");
55  tightphotonSolidConeTrkIsolationOffsetEB_ = conf.getParameter<double>("TightPhotonSolidTrkOffsetEB");
56  tightphotonSolidConeNTrkCutEB_ = conf.getParameter<int>("TightPhotonSolidNTrkEB");
57  tightphotonHollowConeNTrkCutEB_ = conf.getParameter<int>("TightPhotonHollowNTrkEB");
58  tightphotonEtaWidthCutEB_ = conf.getParameter<double>("TightPhotonEtaWidthEB");
59  tightphotonHadOverEMCutEB_ = conf.getParameter<double>("TightPhotonHadOverEMEB");
60  tightphotonR9CutEB_ = conf.getParameter<double>("TightPhotonR9CutEB");
61 
62  //get cuts here EE
63 
64  looseEMEcalIsoRelativeCutSlopeEE_ = conf.getParameter<double>("LooseEMEcalIsoRelativeCutSlopeEE");
65  looseEMEcalIsoRelativeCutOffsetEE_ = conf.getParameter<double>("LooseEMEcalIsoRelativeCutOffsetEE");
66  looseEMHcalTowerIsolationCutSlopeEE_ = conf.getParameter<double>("LooseEMHcalTowerIsoSlopeEE");
67  looseEMHcalTowerIsolationCutOffsetEE_ = conf.getParameter<double>("LooseEMHcalTowerIsoOffsetEE");
68  looseEMHollowConeTrkIsolationSlopeEE_ = conf.getParameter<double>("LooseEMHollowTrkSlopeEE");
69  looseEMHollowConeTrkIsolationOffsetEE_ = conf.getParameter<double>("LooseEMHollowTrkOffsetEE");
70  looseEMSolidConeTrkIsolationSlopeEE_ = conf.getParameter<double>("LooseEMSolidTrkSlopeEE");
71  looseEMSolidConeTrkIsolationOffsetEE_ = conf.getParameter<double>("LooseEMSolidTrkOffsetEE");
72  looseEMSolidConeTrkIsolationCutEE_ = conf.getParameter<double>("LooseEMSolidTrkEE");
73  looseEMSolidConeNTrkCutEE_ = conf.getParameter<int>("LooseEMSolidNTrkEE");
74  looseEMHollowConeNTrkCutEE_ = conf.getParameter<int>("LooseEMHollowNTrkEE");
75  looseEMEtaWidthCutEE_ = conf.getParameter<double>("LooseEMEtaWidthEE");
76  looseEMHadOverEMCutEE_ = conf.getParameter<double>("LooseEMHadOverEMEE");
77  looseEMR9CutEE_ = conf.getParameter<double>("LooseEMR9CutEE");
78 
79  loosephotonEcalIsoRelativeCutSlopeEE_ = conf.getParameter<double>("LoosePhotonEcalIsoRelativeCutSlopeEE");
80  loosephotonEcalIsoRelativeCutOffsetEE_ = conf.getParameter<double>("LoosePhotonEcalIsoRelativeCutOffsetEE");
81  loosephotonHcalTowerIsolationCutSlopeEE_ = conf.getParameter<double>("LoosePhotonHcalTowerIsoSlopeEE");
82  loosephotonHcalTowerIsolationCutOffsetEE_ = conf.getParameter<double>("LoosePhotonHcalTowerIsoOffsetEE");
83  loosephotonHollowConeTrkIsolationSlopeEE_ = conf.getParameter<double>("LoosePhotonHollowTrkSlopeEE");
84  loosephotonHollowConeTrkIsolationOffsetEE_ = conf.getParameter<double>("LoosePhotonHollowTrkOffsetEE");
85  loosephotonSolidConeTrkIsolationSlopeEE_ = conf.getParameter<double>("LoosePhotonSolidTrkSlopeEE");
86  loosephotonSolidConeTrkIsolationOffsetEE_ = conf.getParameter<double>("LoosePhotonSolidTrkOffsetEE");
87  loosephotonSolidConeTrkIsolationCutEE_ = conf.getParameter<double>("LoosePhotonSolidTrkEE");
88  loosephotonSolidConeNTrkCutEE_ = conf.getParameter<int>("LoosePhotonSolidNTrkEE");
89  loosephotonHollowConeNTrkCutEE_ = conf.getParameter<int>("LoosePhotonHollowNTrkEE");
90  loosephotonEtaWidthCutEE_ = conf.getParameter<double>("LoosePhotonEtaWidthEE");
91  loosephotonHadOverEMCutEE_ = conf.getParameter<double>("LoosePhotonHadOverEMEE");
92  loosephotonR9CutEE_ = conf.getParameter<double>("LoosePhotonR9CutEE");
93 
94  tightphotonEcalIsoRelativeCutSlopeEE_ = conf.getParameter<double>("TightPhotonEcalIsoRelativeCutSlopeEE");
95  tightphotonEcalIsoRelativeCutOffsetEE_ = conf.getParameter<double>("TightPhotonEcalIsoRelativeCutOffsetEE");
96  tightphotonHcalTowerIsolationCutSlopeEE_ = conf.getParameter<double>("TightPhotonHcalTowerIsoSlopeEE");
97  tightphotonHcalTowerIsolationCutOffsetEE_ = conf.getParameter<double>("TightPhotonHcalTowerIsoOffsetEE");
98  tightphotonHollowConeTrkIsolationSlopeEE_ = conf.getParameter<double>("TightPhotonHollowTrkSlopeEE");
99  tightphotonHollowConeTrkIsolationOffsetEE_ = conf.getParameter<double>("TightPhotonHollowTrkOffsetEE");
100  tightphotonSolidConeTrkIsolationSlopeEE_ = conf.getParameter<double>("TightPhotonSolidTrkSlopeEE");
101  tightphotonSolidConeTrkIsolationOffsetEE_ = conf.getParameter<double>("TightPhotonSolidTrkOffsetEE");
102  tightphotonSolidConeNTrkCutEE_ = conf.getParameter<int>("TightPhotonSolidNTrkEE");
103  tightphotonHollowConeNTrkCutEE_ = conf.getParameter<int>("TightPhotonHollowNTrkEE");
104  tightphotonEtaWidthCutEE_ = conf.getParameter<double>("TightPhotonEtaWidthEE");
105  tightphotonHadOverEMCutEE_ = conf.getParameter<double>("TightPhotonHadOverEMEE");
106  tightphotonR9CutEE_ = conf.getParameter<double>("TightPhotonR9CutEE");
107 }
108 
109 void CutBasedPhotonIDAlgo::decideEB(const reco::Photon *pho, bool &LooseEM, bool &LoosePhoton, bool &TightPhoton) {
111  //If one has selected to apply fiducial cuts, they will be
112  //applied for all loosePhoton, tightPhoton.
113  //Consider yourself warned!
115 
116  //Require supercluster is within fiducial volume.
117  if (dorequireFiducial_) {
118  if (pho->isEBEEGap()) {
119  LooseEM = false;
120  LoosePhoton = false;
121  TightPhoton = false;
122  return;
123  }
124  if (pho->isEBEtaGap() || pho->isEBPhiGap()) {
125  LooseEM = false;
126  LoosePhoton = false;
127  TightPhoton = false;
128  return;
129  }
130  if (pho->isEERingGap() || pho->isEEDeeGap()) {
131  LooseEM = false;
132  LoosePhoton = false;
133  TightPhoton = false;
134  return;
135  }
136  }
138  //Done with fiducial cuts.
140 
141  //first do looseEM selection, if Photon is not LooseEM,
142  //by definition it is also not LoosePhoton or TightPhoton
143 
144  //Cut on the sum of ecal rec hits in a cone
147  if (pho->ecalRecHitSumEtConeDR04() > cutvalue) {
148  LooseEM = false;
149  LoosePhoton = false;
150  TightPhoton = false;
151  return;
152  }
153  }
154 
155  //Cut on the sum of hcal rec hits in a cone (HBHE)
158  if (pho->hcalTowerSumEtConeDR04() > cutvalue) {
159  LooseEM = false;
160  LoosePhoton = false;
161  TightPhoton = false;
162  return;
163  }
164  }
165 
166  //Cut on number of tracks within the solid cone.
167  if (dophotonSCNTrkCut_) {
169  LooseEM = false;
170  LoosePhoton = false;
171  TightPhoton = false;
172  return;
173  }
174  }
175 
176  //Cut on number of tracks within the hollow cone.
177  if (dophotonHCNTrkCut_) {
179  LooseEM = false;
180  LoosePhoton = false;
181  TightPhoton = false;
182  return;
183  }
184  }
185 
186  //Cut on the sum of tracks within a solid cone
189  if (pho->trkSumPtSolidConeDR04() > cutvalue) {
190  LooseEM = false;
191  LoosePhoton = false;
192  TightPhoton = false;
193  return;
194  }
195  }
196 
197  //Cut on the sum of tracks within a hollow cone
200  if (pho->trkSumPtHollowConeDR04() > cutvalue) {
201  LooseEM = false;
202  LoosePhoton = false;
203  TightPhoton = false;
204  return;
205  }
206  }
207 
208  //HadoverEM cut
209  if (dophotonHadOverEMCut_) {
210  float hadoverE = pho->hadronicOverEm();
211  if (hadoverE > looseEMHadOverEMCutEB_) {
212  LooseEM = false;
213  LoosePhoton = false;
214  TightPhoton = false;
215  return;
216  }
217  }
218 
219  //eta width
220 
221  if (dophotonsigmaeeCut_) {
222  double sigmaee = pho->sigmaIetaIeta();
223  if (sigmaee > looseEMEtaWidthCutEB_) {
224  LooseEM = false;
225  LoosePhoton = false;
226  TightPhoton = false;
227  return;
228  }
229  }
230  //R9 cut
231  if (dophotonR9Cut_) {
232  if (pho->r9() < looseEMR9CutEB_) {
233  LooseEM = false;
234  LoosePhoton = false;
235  TightPhoton = false;
236  return;
237  }
238  }
239  LooseEM = true;
240 
242  //Next do loosephoton selection.
243  //If an object is not LoosePhoton, it is also not
244  //TightPhoton!
246  //Cut on the sum of ecal rec hits in a cone
249  if (pho->ecalRecHitSumEtConeDR04() > cutvalue) {
250  LoosePhoton = false;
251  TightPhoton = false;
252  return;
253  }
254  }
255 
256  //Cut on the sum of hcal rec hits in a cone (HBHE)
259  if (pho->hcalTowerSumEtConeDR04() > cutvalue) {
260  LoosePhoton = false;
261  TightPhoton = false;
262  return;
263  }
264  }
265 
266  //Cut on number of tracks within the solid cone.
267  if (dophotonSCNTrkCut_) {
269  LoosePhoton = false;
270  TightPhoton = false;
271  return;
272  }
273  }
274 
275  //Cut on number of tracks within the hollow cone.
276  if (dophotonHCNTrkCut_) {
278  LoosePhoton = false;
279  TightPhoton = false;
280  return;
281  }
282  }
283 
284  //Cut on the sum of tracks within a solid cone
287  if (pho->trkSumPtSolidConeDR04() > cutvalue) {
288  LoosePhoton = false;
289  TightPhoton = false;
290  return;
291  }
292  }
293 
294  //Cut on the sum of tracks within a hollow cone
296  double cutvalue =
298  if (pho->trkSumPtHollowConeDR04() > cutvalue) {
299  LoosePhoton = false;
300  TightPhoton = false;
301  return;
302  }
303  }
304 
305  //HadoverEM cut
306  if (dophotonHadOverEMCut_) {
307  float hadoverE = pho->hadronicOverEm();
308  if (hadoverE > loosephotonHadOverEMCutEB_) {
309  LoosePhoton = false;
310  TightPhoton = false;
311  return;
312  }
313  }
314 
315  //eta width
316 
317  if (dophotonsigmaeeCut_) {
318  double sigmaee = pho->sigmaIetaIeta();
319  if (sigmaee > loosephotonEtaWidthCutEB_) {
320  LoosePhoton = false;
321  TightPhoton = false;
322  return;
323  }
324  }
325  //R9 cut
326  if (dophotonR9Cut_) {
327  if (pho->r9() < loosephotonR9CutEB_) {
328  LoosePhoton = false;
329  TightPhoton = false;
330  return;
331  }
332  }
333  //If one reaches this point, the decision has been made that this object,
334  //is indeed loosePhoton.
335  LoosePhoton = true;
336 
338  //Next do tightphoton selection.
339  //This is the tightest critieria,
340  //and once more one assumes that these criteria are
341  //tighter than loose.
343  //Cut on the sum of ecal rec hits in a cone
346  if (pho->ecalRecHitSumEtConeDR04() > cutvalue) {
347  LoosePhoton = true;
348  TightPhoton = false;
349  return;
350  }
351  }
352 
353  //Cut on the sum of hcal rec hits in a cone (HBHE)
356  if (pho->hcalTowerSumEtConeDR04() > cutvalue) {
357  LoosePhoton = true;
358  TightPhoton = false;
359  return;
360  }
361  }
362 
363  //Cut on number of tracks within the solid cone.
364  if (dophotonSCNTrkCut_) {
366  LoosePhoton = true;
367  TightPhoton = false;
368  return;
369  }
370  }
371 
372  //Cut on number of tracks within the hollow cone.
373  if (dophotonHCNTrkCut_) {
375  LoosePhoton = true;
376  TightPhoton = false;
377  return;
378  }
379  }
380 
381  //Cut on the sum of tracks within a solid cone
384  if (pho->trkSumPtSolidConeDR04() > cutvalue) {
385  LoosePhoton = true;
386  TightPhoton = false;
387  return;
388  }
389  }
390 
391  //Cut on the sum of tracks within a hollow cone
393  double cutvalue =
395  if (pho->trkSumPtHollowConeDR04() > cutvalue) {
396  LoosePhoton = true;
397  TightPhoton = false;
398  return;
399  }
400  }
401 
402  //HadoverEM cut
403  if (dophotonHadOverEMCut_) {
404  float hadoverE = pho->hadronicOverEm();
405  if (hadoverE > tightphotonHadOverEMCutEB_) {
406  LoosePhoton = true;
407  TightPhoton = false;
408  return;
409  }
410  }
411 
412  //eta width
413 
414  if (dophotonsigmaeeCut_) {
415  double sigmaee = pho->sigmaIetaIeta();
416  if (sigmaee > tightphotonEtaWidthCutEB_) {
417  LoosePhoton = true;
418  TightPhoton = false;
419  return;
420  }
421  }
422  //R9 cut
423  if (dophotonR9Cut_) {
424  if (pho->r9() < tightphotonR9CutEB_) {
425  LoosePhoton = true;
426  TightPhoton = false;
427  return;
428  }
429  }
430 
431  //if you got here, you must have passed all cuts!
432  TightPhoton = true;
433 }
434 
435 void CutBasedPhotonIDAlgo::decideEE(const reco::Photon *pho, bool &LooseEM, bool &LoosePhoton, bool &TightPhoton) {
437  //If one has selected to apply fiducial cuts, they will be
438  //applied for all , loosePhoton, tightPhoton.
439  //Consider yourself warned!
441 
442  //Require supercluster is within fiducial volume.
443  if (dorequireFiducial_) {
444  if (pho->isEBEEGap()) {
445  LooseEM = false;
446  LoosePhoton = false;
447  TightPhoton = false;
448 
449  return;
450  }
451  if (pho->isEBEtaGap() || pho->isEBPhiGap()) {
452  LooseEM = false;
453  LoosePhoton = false;
454  TightPhoton = false;
455  return;
456  }
457  if (pho->isEERingGap() || pho->isEEDeeGap()) {
458  LooseEM = false;
459  LoosePhoton = false;
460  TightPhoton = false;
461  return;
462  }
463  }
465  //Done with fiducial cuts.
467  //Do LooseEM selection. By definition, if a photon does not pass LooseEM, it does not pass LoosePhoton or TightPhoton!
470  if (pho->ecalRecHitSumEtConeDR04() > cutvalue) {
471  LooseEM = false;
472  LoosePhoton = false;
473  TightPhoton = false;
474  return;
475  }
476  }
477 
478  //Cut on the sum of hcal towers in a cone (HBHE)
481  if (pho->hcalTowerSumEtConeDR04() > cutvalue) {
482  LooseEM = false;
483  LoosePhoton = false;
484  TightPhoton = false;
485  return;
486  }
487  }
488 
489  //Cut on number of tracks within the solid cone.
490  if (dophotonSCNTrkCut_) {
492  LooseEM = false;
493  LoosePhoton = false;
494  TightPhoton = false;
495  return;
496  }
497  }
498 
499  //Cut on number of tracks within the hollow cone.
500  if (dophotonHCNTrkCut_) {
502  LooseEM = false;
503  LoosePhoton = false;
504  TightPhoton = false;
505  return;
506  }
507  }
508 
509  //Cut on the sum of tracks within a solid cone
512  if (pho->trkSumPtSolidConeDR04() > cutvalue) {
513  LooseEM = false;
514  LoosePhoton = false;
515  TightPhoton = false;
516  return;
517  }
518  }
519 
520  //Cut on the sum of tracks within a hollow cone
523  if (pho->trkSumPtHollowConeDR04() > cutvalue) {
524  LooseEM = false;
525  LoosePhoton = false;
526  TightPhoton = false;
527  return;
528  }
529  }
530 
531  //HadoverEM cut
532  if (dophotonHadOverEMCut_) {
533  float hadoverE = pho->hadronicOverEm();
534  if (hadoverE > looseEMHadOverEMCutEE_) {
535  LooseEM = false;
536  LoosePhoton = false;
537  TightPhoton = false;
538  return;
539  }
540  }
541 
542  //eta width
543 
544  if (dophotonsigmaeeCut_) {
545  double sigmaee = pho->sigmaIetaIeta();
546 
547  if (sigmaee > looseEMEtaWidthCutEE_) {
548  LooseEM = false;
549  LoosePhoton = false;
550  TightPhoton = false;
551  return;
552  }
553  }
554  //R9 cut
555  if (dophotonR9Cut_) {
556  if (pho->r9() < looseEMR9CutEE_) {
557  LooseEM = false;
558  LoosePhoton = false;
559  TightPhoton = false;
560  return;
561  }
562  }
563  LooseEM = true;
565  //Next do loosephoton selection.
566  //If an object is not LoosePhoton, it is also not
567  //TightPhoton!
569 
572  if (pho->ecalRecHitSumEtConeDR04() > cutvalue) {
573  LoosePhoton = false;
574  TightPhoton = false;
575  return;
576  }
577  }
578 
579  //Cut on the sum of hcal rec hits in a cone (HBHE)
582  if (pho->hcalTowerSumEtConeDR04() > cutvalue) {
583  LoosePhoton = false;
584  TightPhoton = false;
585  return;
586  }
587  }
588 
589  //Cut on number of tracks within the solid cone.
590  if (dophotonSCNTrkCut_) {
592  LoosePhoton = false;
593  TightPhoton = false;
594  return;
595  }
596  }
597 
598  //Cut on number of tracks within the hollow cone.
599  if (dophotonHCNTrkCut_) {
601  LoosePhoton = false;
602  TightPhoton = false;
603  return;
604  }
605  }
606 
607  //Cut on the sum of tracks within a solid cone
610  if (pho->trkSumPtSolidConeDR04() > cutvalue) {
611  LoosePhoton = false;
612  TightPhoton = false;
613  return;
614  }
615  }
616 
617  //Cut on the sum of tracks within a hollow cone
619  double cutvalue =
621  if (pho->trkSumPtHollowConeDR04() > cutvalue) {
622  LoosePhoton = false;
623  TightPhoton = false;
624  return;
625  }
626  }
627 
628  //HadoverEM cut
629  if (dophotonHadOverEMCut_) {
630  float hadoverE = pho->hadronicOverEm();
631  if (hadoverE > loosephotonHadOverEMCutEE_) {
632  LoosePhoton = false;
633  TightPhoton = false;
634  return;
635  }
636  }
637 
638  //eta width
639 
640  if (dophotonsigmaeeCut_) {
641  double sigmaee = pho->sigmaIetaIeta();
642 
643  if (sigmaee > loosephotonEtaWidthCutEE_) {
644  LoosePhoton = false;
645  TightPhoton = false;
646  return;
647  }
648  }
649  //R9 cut
650  if (dophotonR9Cut_) {
651  if (pho->r9() < loosephotonR9CutEE_) {
652  LoosePhoton = false;
653  TightPhoton = false;
654  return;
655  }
656  }
657  //If one reaches this point, the decision has been made that this object,
658  //is indeed loosePhoton.
659  LoosePhoton = true;
661  //Next do tightphoton selection.
662  //This is the tightest critieria,
663  //and once more one assumes that these criteria are
664  //tighter than loose.
668  if (pho->ecalRecHitSumEtConeDR04() > cutvalue) {
669  LoosePhoton = true;
670  TightPhoton = false;
671  return;
672  }
673  }
674 
675  //Cut on the sum of hcal rec hits in a cone (HBHE)
678  if (pho->hcalTowerSumEtConeDR04() > cutvalue) {
679  LoosePhoton = true;
680  TightPhoton = false;
681  return;
682  }
683  }
684 
685  //Cut on number of tracks within the solid cone.
686  if (dophotonSCNTrkCut_) {
688  LoosePhoton = true;
689  TightPhoton = false;
690  return;
691  }
692  }
693 
694  //Cut on number of tracks within the hollow cone.
695  if (dophotonHCNTrkCut_) {
697  LoosePhoton = true;
698  TightPhoton = false;
699  return;
700  }
701  }
702 
703  //Cut on the sum of tracks within a solid cone
706  if (pho->trkSumPtSolidConeDR04() > cutvalue) {
707  LoosePhoton = true;
708  TightPhoton = false;
709  return;
710  }
711  }
712 
713  //Cut on the sum of tracks within a hollow cone
715  double cutvalue =
717  if (pho->trkSumPtHollowConeDR04() > cutvalue) {
718  LoosePhoton = true;
719  TightPhoton = false;
720  return;
721  }
722  }
723 
724  //HadoverEM cut
725  if (dophotonHadOverEMCut_) {
726  float hadoverE = pho->hadronicOverEm();
727  if (hadoverE > tightphotonHadOverEMCutEE_) {
728  LoosePhoton = true;
729  TightPhoton = false;
730  return;
731  }
732  }
733 
734  //eta width
735 
736  if (dophotonsigmaeeCut_) {
737  double sigmaee = pho->sigmaIetaIeta();
738 
739  if (sigmaee > tightphotonEtaWidthCutEE_) {
740  LoosePhoton = true;
741  TightPhoton = false;
742  return;
743  }
744  }
745  //R9 cut
746  if (dophotonR9Cut_) {
747  if (pho->r9() < tightphotonR9CutEE_) {
748  LoosePhoton = true;
749  TightPhoton = false;
750  return;
751  }
752  }
753 
754  //if you got here, you must have passed all cuts!
755  TightPhoton = true;
756 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void decideEE(const reco::Photon *pho, bool &LooseEM, bool &LoosePhoton, bool &TightPhoton)
bool isEBPhiGap() const
Definition: Photon.h:132
double pt() const final
transverse momentum
double loosephotonEcalIsoRelativeCutOffsetEE_
bool isEEDeeGap() const
Definition: Photon.h:136
double loosephotonSolidConeTrkIsolationOffsetEB_
float ecalRecHitSumEtConeDR04() const
Definition: Photon.h:460
double looseEMSolidConeTrkIsolationOffsetEE_
double loosephotonHcalTowerIsolationCutOffsetEB_
double tightphotonSolidConeTrkIsolationOffsetEB_
double loosephotonEcalIsoRelativeCutOffsetEB_
double tightphotonHollowConeTrkIsolationSlopeEE_
double loosephotonSolidConeTrkIsolationOffsetEE_
double looseEMHollowConeTrkIsolationSlopeEB_
void setup(const edm::ParameterSet &conf)
float trkSumPtSolidConeDR04() const
Definition: Photon.h:498
void decideEB(const reco::Photon *pho, bool &LooseEM, bool &LoosePhoton, bool &TightPhoton)
double loosephotonSolidConeTrkIsolationCutEB_
double looseEMHcalTowerIsolationCutOffsetEE_
float hcalTowerSumEtConeDR04(int depth=0) const
Definition: Photon.h:478
float sigmaIetaIeta() const
Definition: Photon.h:276
bool isEERingGap() const
Definition: Photon.h:135
double tightphotonHcalTowerIsolationCutSlopeEE_
double looseEMHollowConeTrkIsolationOffsetEE_
bool isEBEtaGap() const
Definition: Photon.h:131
double loosephotonHcalTowerIsolationCutSlopeEE_
double tightphotonHollowConeTrkIsolationOffsetEB_
double loosephotonHcalTowerIsolationCutOffsetEE_
double loosephotonEcalIsoRelativeCutSlopeEB_
double looseEMHollowConeTrkIsolationSlopeEE_
double tightphotonHcalTowerIsolationCutOffsetEE_
double loosephotonHollowConeTrkIsolationOffsetEB_
double looseEMSolidConeTrkIsolationOffsetEB_
double loosephotonHollowConeTrkIsolationSlopeEE_
double tightphotonSolidConeTrkIsolationOffsetEE_
int nTrkSolidConeDR04() const
Definition: Photon.h:502
float trkSumPtHollowConeDR04() const
Definition: Photon.h:500
float hadronicOverEm(int depth=0) const
Definition: Photon.h:239
double tightphotonEcalIsoRelativeCutSlopeEB_
double loosephotonEcalIsoRelativeCutSlopeEE_
double tightphotonHcalTowerIsolationCutOffsetEB_
double loosephotonSolidConeTrkIsolationSlopeEE_
double loosephotonHcalTowerIsolationCutSlopeEB_
double tightphotonHollowConeTrkIsolationSlopeEB_
float r9() const
Definition: Photon.h:279
double looseEMHollowConeTrkIsolationOffsetEB_
double loosephotonHollowConeTrkIsolationSlopeEB_
double tightphotonSolidConeTrkIsolationSlopeEB_
double tightphotonEcalIsoRelativeCutOffsetEB_
double loosephotonSolidConeTrkIsolationSlopeEB_
double tightphotonSolidConeTrkIsolationSlopeEE_
double tightphotonHollowConeTrkIsolationOffsetEE_
int nTrkHollowConeDR04() const
Definition: Photon.h:504
double looseEMHcalTowerIsolationCutOffsetEB_
double loosephotonHollowConeTrkIsolationOffsetEE_
bool isEBEEGap() const
true if photon is in boundary between EB and EE
Definition: Photon.h:138
double tightphotonHcalTowerIsolationCutSlopeEB_