#include <RecoTauTag/RecoTau/interface/PFRecoTauDiscriminationAgainstElectron.h>
Public Member Functions | |
PFRecoTauDiscriminationAgainstElectron (const ParameterSet &iConfig) | |
virtual void | produce (Event &, const EventSetup &) |
~PFRecoTauDiscriminationAgainstElectron () | |
Private Member Functions | |
bool | isInEcalCrack (double) const |
Private Attributes | |
bool | applyCut_bremsRecoveryEOverPLead_ |
bool | applyCut_ecalCrack_ |
bool | applyCut_electronPreID_ |
bool | applyCut_electronPreID_2D_ |
bool | applyCut_emFraction_ |
bool | applyCut_EOverPLead_ |
bool | applyCut_hcal3x3OverPLead_ |
bool | applyCut_hcalMaxOverPLead_ |
bool | applyCut_hcalTotOverPLead_ |
double | bremsRecoveryEOverPLead_maxValue_ |
double | bremsRecoveryEOverPLead_minValue_ |
double | elecPreID0_EOverPLead_maxValue |
double | elecPreID0_HOverPLead_minValue |
double | elecPreID1_EOverPLead_maxValue |
double | elecPreID1_HOverPLead_minValue |
double | emFraction_maxValue_ |
double | EOverPLead_maxValue_ |
double | EOverPLead_minValue_ |
double | hcal3x3OverPLead_minValue_ |
double | hcalMaxOverPLead_minValue_ |
double | hcalTotOverPLead_minValue_ |
InputTag | PFTauProducer_ |
Definition at line 27 of file PFRecoTauDiscriminationAgainstElectron.h.
PFRecoTauDiscriminationAgainstElectron::PFRecoTauDiscriminationAgainstElectron | ( | const ParameterSet & | iConfig | ) | [inline, explicit] |
Definition at line 29 of file PFRecoTauDiscriminationAgainstElectron.h.
References applyCut_bremsRecoveryEOverPLead_, applyCut_ecalCrack_, applyCut_electronPreID_, applyCut_electronPreID_2D_, applyCut_emFraction_, applyCut_EOverPLead_, applyCut_hcal3x3OverPLead_, applyCut_hcalMaxOverPLead_, applyCut_hcalTotOverPLead_, bremsRecoveryEOverPLead_maxValue_, bremsRecoveryEOverPLead_minValue_, elecPreID0_EOverPLead_maxValue, elecPreID0_HOverPLead_minValue, elecPreID1_EOverPLead_maxValue, elecPreID1_HOverPLead_minValue, emFraction_maxValue_, EOverPLead_maxValue_, EOverPLead_minValue_, edm::ParameterSet::getParameter(), hcal3x3OverPLead_minValue_, hcalMaxOverPLead_minValue_, hcalTotOverPLead_minValue_, and PFTauProducer_.
00029 { 00030 PFTauProducer_ = iConfig.getParameter<InputTag>("PFTauProducer"); 00031 emFraction_maxValue_ = iConfig.getParameter<double>("EmFraction_maxValue"); 00032 applyCut_emFraction_ = iConfig.getParameter<bool>("ApplyCut_EmFraction"); 00033 hcalTotOverPLead_minValue_ = iConfig.getParameter<double>("HcalTotOverPLead_minValue"); 00034 applyCut_hcalTotOverPLead_ = iConfig.getParameter<bool>("ApplyCut_HcalTotOverPLead"); 00035 hcalMaxOverPLead_minValue_ = iConfig.getParameter<double>("HcalMaxOverPLead_minValue"); 00036 applyCut_hcalMaxOverPLead_ = iConfig.getParameter<bool>("ApplyCut_HcalMaxOverPLead"); 00037 hcal3x3OverPLead_minValue_ = iConfig.getParameter<double>("Hcal3x3OverPLead_minValue"); 00038 00039 applyCut_hcal3x3OverPLead_ = iConfig.getParameter<bool>("ApplyCut_Hcal3x3OverPLead"); 00040 EOverPLead_minValue_ = iConfig.getParameter<double>("EOverPLead_minValue"); 00041 EOverPLead_maxValue_ = iConfig.getParameter<double>("EOverPLead_maxValue"); 00042 applyCut_EOverPLead_ = iConfig.getParameter<bool>("ApplyCut_EOverPLead"); 00043 bremsRecoveryEOverPLead_minValue_ = iConfig.getParameter<double>("BremsRecoveryEOverPLead_minValue"); 00044 bremsRecoveryEOverPLead_maxValue_ = iConfig.getParameter<double>("BremsRecoveryEOverPLead_maxValue"); 00045 00046 applyCut_bremsRecoveryEOverPLead_ = iConfig.getParameter<bool>("ApplyCut_BremsRecoveryEOverPLead"); 00047 00048 applyCut_electronPreID_ = iConfig.getParameter<bool>("ApplyCut_ElectronPreID"); 00049 00050 applyCut_electronPreID_2D_ = iConfig.getParameter<bool>("ApplyCut_ElectronPreID_2D"); 00051 00052 elecPreID0_EOverPLead_maxValue = iConfig.getParameter<double>("ElecPreID0_EOverPLead_maxValue"); 00053 elecPreID0_HOverPLead_minValue = iConfig.getParameter<double>("ElecPreID0_HOverPLead_minValue"); 00054 elecPreID1_EOverPLead_maxValue = iConfig.getParameter<double>("ElecPreID1_EOverPLead_maxValue"); 00055 elecPreID1_HOverPLead_minValue = iConfig.getParameter<double>("ElecPreID1_HOverPLead_minValue"); 00056 00057 applyCut_ecalCrack_ = iConfig.getParameter<bool>("ApplyCut_EcalCrackCut"); 00058 00059 produces<PFTauDiscriminator>(); 00060 }
PFRecoTauDiscriminationAgainstElectron::~PFRecoTauDiscriminationAgainstElectron | ( | ) | [inline] |
bool PFRecoTauDiscriminationAgainstElectron::isInEcalCrack | ( | double | eta | ) | const [private] |
void PFRecoTauDiscriminationAgainstElectron::produce | ( | Event & | iEvent, | |
const EventSetup & | iEventSetup | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 3 of file PFRecoTauDiscriminationAgainstElectron.cc.
References funct::abs(), applyCut_bremsRecoveryEOverPLead_, applyCut_ecalCrack_, applyCut_electronPreID_, applyCut_electronPreID_2D_, applyCut_emFraction_, applyCut_EOverPLead_, applyCut_hcal3x3OverPLead_, applyCut_hcalMaxOverPLead_, applyCut_hcalTotOverPLead_, bremsRecoveryEOverPLead_maxValue_, bremsRecoveryEOverPLead_minValue_, elecPreID0_EOverPLead_maxValue, elecPreID0_HOverPLead_minValue, elecPreID1_EOverPLead_maxValue, elecPreID1_HOverPLead_minValue, emFraction_maxValue_, EOverPLead_maxValue_, EOverPLead_minValue_, edm::Event::getByLabel(), hcal3x3OverPLead_minValue_, hcalMaxOverPLead_minValue_, hcalTotOverPLead_minValue_, isInEcalCrack(), edm::Ref< C, T, F >::isNonnull(), PFTauProducer_, and edm::Event::put().
00003 { 00004 Handle<PFTauCollection> thePFTauCollection; 00005 iEvent.getByLabel(PFTauProducer_,thePFTauCollection); 00006 00007 // fill the AssociationVector object 00008 auto_ptr<PFTauDiscriminator> thePFTauDiscriminatorAgainstElectron(new PFTauDiscriminator(PFTauRefProd(thePFTauCollection))); 00009 00010 for(size_t iPFTau=0;iPFTau<thePFTauCollection->size();++iPFTau) { 00011 PFTauRef thePFTauRef(thePFTauCollection,iPFTau); 00012 00013 // Check if track goes to Ecal crack 00014 TrackRef myleadTk; 00015 if((*thePFTauRef).leadPFChargedHadrCand().isNonnull()){ 00016 myleadTk=(*thePFTauRef).leadPFChargedHadrCand()->trackRef(); 00017 math::XYZPointF myleadTkEcalPos = (*thePFTauRef).leadPFChargedHadrCand()->positionAtECALEntrance(); 00018 00019 if(myleadTk.isNonnull()){ 00020 if (applyCut_ecalCrack_ && isInEcalCrack(abs((double)myleadTkEcalPos.eta()))) { 00021 thePFTauDiscriminatorAgainstElectron->setValue(iPFTau,0); 00022 continue; 00023 } 00024 } 00025 } 00026 00027 bool decision = false; 00028 bool emfPass = true, htotPass = true, hmaxPass = true; 00029 bool h3x3Pass = true, estripPass = true, erecovPass = true; 00030 bool epreidPass = true, epreid2DPass = true; 00031 00032 if (applyCut_emFraction_) { 00033 if ((*thePFTauRef).emFraction() > emFraction_maxValue_) { 00034 emfPass = false; 00035 } 00036 } 00037 if (applyCut_hcalTotOverPLead_) { 00038 if ((*thePFTauRef).hcalTotOverPLead() < hcalTotOverPLead_minValue_) { 00039 htotPass = false; 00040 } 00041 } 00042 if (applyCut_hcalMaxOverPLead_) { 00043 if ((*thePFTauRef).hcalMaxOverPLead() < hcalMaxOverPLead_minValue_) { 00044 hmaxPass = false; 00045 } 00046 } 00047 if (applyCut_hcal3x3OverPLead_) { 00048 if ((*thePFTauRef).hcal3x3OverPLead() < hcal3x3OverPLead_minValue_) { 00049 h3x3Pass = false; 00050 } 00051 } 00052 if (applyCut_EOverPLead_) { 00053 if ((*thePFTauRef).ecalStripSumEOverPLead() > EOverPLead_minValue_ && 00054 (*thePFTauRef).ecalStripSumEOverPLead() < EOverPLead_maxValue_) { 00055 estripPass = false; 00056 } else { 00057 estripPass = true; 00058 } 00059 } 00060 if (applyCut_bremsRecoveryEOverPLead_) { 00061 if ((*thePFTauRef).bremsRecoveryEOverPLead() > bremsRecoveryEOverPLead_minValue_ && 00062 (*thePFTauRef).bremsRecoveryEOverPLead() < bremsRecoveryEOverPLead_maxValue_) { 00063 erecovPass = false; 00064 } else { 00065 erecovPass = true; 00066 } 00067 } 00068 if (applyCut_electronPreID_) { 00069 if ((*thePFTauRef).electronPreIDDecision()) { 00070 epreidPass = false; 00071 } else { 00072 epreidPass = true; 00073 } 00074 } 00075 00076 if (applyCut_electronPreID_2D_) { 00077 if ( 00078 ((*thePFTauRef).electronPreIDDecision() && 00079 ((*thePFTauRef).ecalStripSumEOverPLead() < elecPreID1_EOverPLead_maxValue || 00080 (*thePFTauRef).hcal3x3OverPLead() > elecPreID1_HOverPLead_minValue)) 00081 || 00082 (!(*thePFTauRef).electronPreIDDecision() && 00083 ((*thePFTauRef).ecalStripSumEOverPLead() < elecPreID0_EOverPLead_maxValue || 00084 (*thePFTauRef).hcal3x3OverPLead() > elecPreID0_HOverPLead_minValue)) 00085 ){ 00086 epreid2DPass = true; 00087 } else { 00088 epreid2DPass = false; 00089 } 00090 } 00091 00092 decision = emfPass && htotPass && hmaxPass && 00093 h3x3Pass && estripPass && erecovPass && epreidPass && epreid2DPass; 00094 if (decision) { 00095 thePFTauDiscriminatorAgainstElectron->setValue(iPFTau,1); 00096 } else { 00097 thePFTauDiscriminatorAgainstElectron->setValue(iPFTau,0); 00098 } 00099 } 00100 00101 00102 iEvent.put(thePFTauDiscriminatorAgainstElectron); 00103 }
Definition at line 78 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 90 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 82 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 84 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 66 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 75 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 72 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 70 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 68 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 80 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 79 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 85 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 86 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 87 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 88 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
double PFRecoTauDiscriminationAgainstElectron::emFraction_maxValue_ [private] |
Definition at line 67 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
double PFRecoTauDiscriminationAgainstElectron::EOverPLead_maxValue_ [private] |
Definition at line 77 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
double PFRecoTauDiscriminationAgainstElectron::EOverPLead_minValue_ [private] |
Definition at line 76 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
double PFRecoTauDiscriminationAgainstElectron::hcal3x3OverPLead_minValue_ [private] |
Definition at line 73 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
double PFRecoTauDiscriminationAgainstElectron::hcalMaxOverPLead_minValue_ [private] |
Definition at line 71 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
double PFRecoTauDiscriminationAgainstElectron::hcalTotOverPLead_minValue_ [private] |
Definition at line 69 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().
Definition at line 65 of file PFRecoTauDiscriminationAgainstElectron.h.
Referenced by PFRecoTauDiscriminationAgainstElectron(), and produce().