CMS 3D CMS Logo

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