CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/RecoParticleFlow/PFProducer/src/PhotonSelectorAlgo.cc

Go to the documentation of this file.
00001 // 
00002 // Original Authors: Nicholas Wardle, Florian Beaudette
00003 //
00004 #include "RecoParticleFlow/PFProducer/interface/PhotonSelectorAlgo.h"
00005 
00006 PhotonSelectorAlgo::PhotonSelectorAlgo(
00007                                        float choice,
00008                                        float c_Et,
00009                                        float c_iso_track_a, float c_iso_track_b,
00010                                        float c_iso_ecal_a, float c_iso_ecal_b,
00011                                        float c_iso_hcal_a, float c_iso_hcal_b,
00012                                        float c_hoe,
00013                                        float comb_iso,
00014                                        float loose_hoe
00015                                        ):
00016   choice_(choice),
00017   c_Et_(c_Et),
00018   c_iso_track_a_(c_iso_track_a),  c_iso_track_b_(c_iso_track_b),
00019   c_iso_ecal_a_(c_iso_ecal_a),  c_iso_ecal_b_(c_iso_ecal_b),
00020   c_iso_hcal_a_(c_iso_hcal_a), c_iso_hcal_b_(c_iso_hcal_b),
00021   c_hoe_(c_hoe),
00022   comb_iso_(comb_iso),
00023   loose_hoe_(loose_hoe)
00024 {
00025   ;
00026 }
00027 
00028 bool PhotonSelectorAlgo::passPhotonSelection(const reco::Photon & photon) const {
00029 
00030   // Photon ET
00031   float photonPt=photon.pt();
00032   if( photonPt < c_Et_ ) return false;
00033   if(choice_<0.1) //EGM Loose
00034     {
00035       //std::cout<<"Cuts:"<<c_Et_<<" H/E "<<c_hoe_<<"ECal Iso "<<c_iso_ecal_a_<<"HCal Iso "<<c_iso_hcal_a_<<"Track Iso "<<c_iso_track_a_<<std::endl;
00036       // HoE
00037       if (photon.hadronicOverEm() > c_hoe_ ) return false;
00038       
00039       // Track iso
00040       if( photon.trkSumPtHollowConeDR04() > c_iso_track_a_ + c_iso_track_b_*photonPt) return false;
00041       
00042       // ECAL iso
00043       if (photon.ecalRecHitSumEtConeDR04() > c_iso_ecal_a_ + c_iso_ecal_b_*photonPt) return false;
00044       
00045       // HCAL iso
00046       if (photon.hcalTowerSumEtConeDR04() > c_iso_hcal_a_ + c_iso_hcal_b_*photonPt) return false ;
00047     }
00048   if(choice_>0.99)
00049     {
00050       
00051       //std::cout<<"Cuts "<<comb_iso_<<" H/E "<<loose_hoe_<<std::endl;
00052       if (photon.hadronicOverEm() >loose_hoe_ ) return false;
00053       //Isolation variables in 0.3 cone combined
00054         if(photon.trkSumPtHollowConeDR03()+photon.ecalRecHitSumEtConeDR03()+photon.hcalTowerSumEtConeDR03()>comb_iso_)return false;             
00055     }
00056 
00057   return true;
00058 }