#include <ElectronLikelihood.h>
Public Member Functions | |
ElectronLikelihood () | |
ctor, not used for this algo (need initialization from ES) | |
ElectronLikelihood (const ElectronLikelihoodCalibration *calibration, LikelihoodSwitches eleIDSwitches, std::string signalWeightSplitting, std::string backgroundWeightSplitting, bool splitSignalPdfs, bool splitBackgroundPdfs) | |
ctor | |
float | result (const reco::GsfElectron &electron, EcalClusterLazyTools) const |
get the result of the algorithm | |
void | setup (const edm::ParameterSet &conf) |
not used for this algo | |
virtual | ~ElectronLikelihood () |
dtor | |
Private Member Functions | |
void | getInputVar (const reco::GsfElectron &electron, std::vector< float > &measuremnts, EcalClusterLazyTools) const |
get the input variables from the electron and the e-Setup | |
void | Setup (const ElectronLikelihoodCalibration *calibration, std::string signalWeightSplitting, std::string backgroundWeightSplitting, bool splitSignalPdfs, bool splitBackgroundPdfs) |
Private Attributes | |
LikelihoodPdfProduct * | _EBgt15lh |
likelihood above 15GeV/c | |
LikelihoodPdfProduct * | _EBlt15lh |
likelihood below 15GeV/c | |
LikelihoodPdfProduct * | _EEgt15lh |
LikelihoodPdfProduct * | _EElt15lh |
std::string | m_backgroundWeightSplitting |
LikelihoodSwitches | m_eleIDSwitches |
general parameters of all the ele id algorithms | |
std::string | m_signalWeightSplitting |
splitting rule for PDF's | |
bool | m_splitBackgroundPdfs |
bool | m_splitSignalPdfs |
Definition at line 17 of file ElectronLikelihood.h.
ElectronLikelihood::ElectronLikelihood | ( | ) | [inline] |
ctor, not used for this algo (need initialization from ES)
Definition at line 22 of file ElectronLikelihood.h.
{} ;
ElectronLikelihood::ElectronLikelihood | ( | const ElectronLikelihoodCalibration * | calibration, |
LikelihoodSwitches | eleIDSwitches, | ||
std::string | signalWeightSplitting, | ||
std::string | backgroundWeightSplitting, | ||
bool | splitSignalPdfs, | ||
bool | splitBackgroundPdfs | ||
) |
ctor
Definition at line 8 of file ElectronLikelihood.cc.
References Setup().
: _EBlt15lh (new LikelihoodPdfProduct ("electronID_EB_ptLt15_likelihood",0,0)) , _EElt15lh (new LikelihoodPdfProduct ("electronID_EE_ptLt15_likelihood",1,0)) , _EBgt15lh (new LikelihoodPdfProduct ("electronID_EB_ptGt15_likelihood",0,1)) , _EEgt15lh (new LikelihoodPdfProduct ("electronID_EE_ptGt15_likelihood",1,1)) , m_eleIDSwitches (eleIDSwitches) , m_signalWeightSplitting (signalWeightSplitting), m_backgroundWeightSplitting (backgroundWeightSplitting), m_splitSignalPdfs (splitSignalPdfs), m_splitBackgroundPdfs (splitBackgroundPdfs) { Setup (calibration, signalWeightSplitting, backgroundWeightSplitting, splitSignalPdfs, splitBackgroundPdfs) ; }
ElectronLikelihood::~ElectronLikelihood | ( | ) | [virtual] |
void ElectronLikelihood::getInputVar | ( | const reco::GsfElectron & | electron, |
std::vector< float > & | measuremnts, | ||
EcalClusterLazyTools | myEcalCluster | ||
) | const [private] |
get the input variables from the electron and the e-Setup
Definition at line 224 of file ElectronLikelihood.cc.
References EcalClusterLazyTools::covariances(), reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), reco::GsfElectron::eSuperClusterOverP(), reco::GsfElectron::fbrem(), reco::GsfElectron::hadronicOverEm(), m_eleIDSwitches, LikelihoodSwitches::m_useDeltaEta, LikelihoodSwitches::m_useDeltaPhi, LikelihoodSwitches::m_useEoverP, LikelihoodSwitches::m_useFBrem, LikelihoodSwitches::m_useHoverE, LikelihoodSwitches::m_useSigmaEtaEta, LikelihoodSwitches::m_useSigmaPhiPhi, mathSSE::sqrt(), and reco::GsfElectron::superCluster().
Referenced by result().
{ // the variables entering the likelihood if (m_eleIDSwitches.m_useDeltaPhi) measurements.push_back ( electron.deltaPhiSuperClusterTrackAtVtx () ) ; if (m_eleIDSwitches.m_useDeltaEta) measurements.push_back ( electron.deltaEtaSuperClusterTrackAtVtx () ) ; if (m_eleIDSwitches.m_useEoverP) measurements.push_back ( electron.eSuperClusterOverP () ) ; if (m_eleIDSwitches.m_useHoverE) measurements.push_back ( electron.hadronicOverEm () ) ; std::vector<float> vCov = myEcalCluster.covariances(*(electron.superCluster()->seed())) ; if (m_eleIDSwitches.m_useSigmaEtaEta) measurements.push_back ( sqrt (vCov[0]) ); if (m_eleIDSwitches.m_useSigmaPhiPhi) measurements.push_back ( sqrt (vCov[2]) ); if(m_eleIDSwitches.m_useFBrem) measurements.push_back( electron.fbrem() ); }
float ElectronLikelihood::result | ( | const reco::GsfElectron & | electron, |
EcalClusterLazyTools | myEcalCluster | ||
) | const |
get the result of the algorithm
Definition at line 248 of file ElectronLikelihood.cc.
References _EBgt15lh, _EBlt15lh, _EEgt15lh, _EElt15lh, className(), EcalBarrel, EcalEndcap, Exception, getInputVar(), LikelihoodPdfProduct::getRatio(), m_signalWeightSplitting, reco::GsfElectron::numberOfBrems(), reco::LeafCandidate::pt(), and reco::GsfElectron::superCluster().
{ //======================================================= // used classification: // nbrem clusters = 0 => 0 // nbrem clusters >= 1 => 1 //======================================================= std::vector<float> measurements ; getInputVar (electron, measurements, myEcalCluster) ; // Split using only the number of brem clusters int bitVal=(electron.numberOfBrems()==0) ? 0 : 1 ; char className[20] ; if(m_signalWeightSplitting.compare("class")==0) { sprintf (className,"class%d",bitVal); } else { throw cms::Exception("BadConfig") << "Only class (0 brem clusters / >=1 brem clusters)" << " splitting is implemented right now"; } reco::SuperClusterRef sclusRef = electron.superCluster() ; EcalSubdetector subdet = EcalSubdetector (sclusRef->hitsAndFractions()[0].first.subdetId ()) ; float thisPt = electron.pt(); if (subdet==EcalBarrel && thisPt<15.) return _EBlt15lh->getRatio ("electrons",measurements,std::string (className)) ; else if (subdet==EcalBarrel && thisPt>=15.) return _EBgt15lh->getRatio ("electrons",measurements,std::string (className)) ; else if (subdet==EcalEndcap && thisPt<15.) return _EElt15lh->getRatio ("electrons",measurements,std::string (className)) ; else if (subdet==EcalEndcap && thisPt>=15.) return _EEgt15lh->getRatio ("electrons",measurements,std::string (className)) ; else return -999. ; }
void ElectronLikelihood::Setup | ( | const ElectronLikelihoodCalibration * | calibration, |
std::string | signalWeightSplitting, | ||
std::string | backgroundWeightSplitting, | ||
bool | splitSignalPdfs, | ||
bool | splitBackgroundPdfs | ||
) | [private] |
build the likelihood model from histograms in Barrel file and Endcap file
Definition at line 48 of file ElectronLikelihood.cc.
References _EBgt15lh, _EBlt15lh, _EEgt15lh, _EElt15lh, LikelihoodPdfProduct::addPdf(), LikelihoodPdfProduct::addSpecies(), Exception, LikelihoodPdfProduct::initFromDB(), m_eleIDSwitches, LikelihoodSwitches::m_useDeltaEta, LikelihoodSwitches::m_useDeltaPhi, LikelihoodSwitches::m_useEoverP, LikelihoodSwitches::m_useFBrem, LikelihoodSwitches::m_useHoverE, LikelihoodSwitches::m_useSigmaEtaEta, LikelihoodSwitches::m_useSigmaPhiPhi, and LikelihoodPdfProduct::setSplitFrac().
Referenced by ElectronLikelihood().
{ // ECAL BARREL LIKELIHOOD - Pt < 15 GeV region _EBlt15lh->initFromDB (calibration) ; _EBlt15lh->addSpecies ("electrons") ; _EBlt15lh->addSpecies ("hadrons") ; if(signalWeightSplitting.compare("class")==0) { _EBlt15lh->setSplitFrac ("electrons", "class0") ; _EBlt15lh->setSplitFrac ("electrons", "class1") ; } else { throw cms::Exception("BadConfig") << "Only class (non-showering / showering)" << " and fullclass (golden / bigbrem / narrow / showering)" << " splitting is implemented right now"; } if (m_eleIDSwitches.m_useDeltaPhi) _EBlt15lh->addPdf ("electrons", "dPhi", splitSignalPdfs) ; if (m_eleIDSwitches.m_useDeltaEta) _EBlt15lh->addPdf ("electrons", "dEta", splitSignalPdfs) ; if (m_eleIDSwitches.m_useEoverP) _EBlt15lh->addPdf ("electrons", "EoP", splitSignalPdfs) ; if (m_eleIDSwitches.m_useHoverE) _EBlt15lh->addPdf ("electrons", "HoE", splitSignalPdfs) ; if (m_eleIDSwitches.m_useSigmaEtaEta) _EBlt15lh->addPdf ("electrons", "sigmaIEtaIEta", splitSignalPdfs) ; if (m_eleIDSwitches.m_useSigmaPhiPhi) _EBlt15lh->addPdf ("electrons", "sigmaIPhiIPhi", splitSignalPdfs) ; if (m_eleIDSwitches.m_useFBrem) _EBlt15lh->addPdf ("electrons", "fBrem", splitSignalPdfs) ; if(backgroundWeightSplitting.compare("class")==0) { _EBlt15lh->setSplitFrac ("hadrons", "class0") ; _EBlt15lh->setSplitFrac ("hadrons", "class1") ; } else { throw cms::Exception("BadConfig") << "Only class (0 brem clusters / >=1 brem clusters)" << " splitting is implemented right now"; } if (m_eleIDSwitches.m_useDeltaPhi) _EBlt15lh->addPdf ("hadrons", "dPhi", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useDeltaEta) _EBlt15lh->addPdf ("hadrons", "dEta", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useEoverP) _EBlt15lh->addPdf ("hadrons", "EoP", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useHoverE) _EBlt15lh->addPdf ("hadrons", "HoE", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useSigmaEtaEta) _EBlt15lh->addPdf ("hadrons", "sigmaIEtaIEta", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useSigmaPhiPhi) _EBlt15lh->addPdf ("hadrons", "sigmaIPhiIPhi", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useFBrem) _EBlt15lh->addPdf ("hadrons", "fBrem", splitBackgroundPdfs) ; // ECAL BARREL LIKELIHOOD - Pt >= 15 GeV region _EBgt15lh->initFromDB (calibration) ; _EBgt15lh->addSpecies ("electrons") ; _EBgt15lh->addSpecies ("hadrons") ; if(signalWeightSplitting.compare("class")==0) { _EBgt15lh->setSplitFrac ("electrons", "class0") ; _EBgt15lh->setSplitFrac ("electrons", "class1") ; } else { throw cms::Exception("BadConfig") << "Only class (0 brem clusters / >=1 brem clusters)" << " splitting is implemented right now"; } if (m_eleIDSwitches.m_useDeltaPhi) _EBgt15lh->addPdf ("electrons", "dPhi", splitSignalPdfs) ; if (m_eleIDSwitches.m_useDeltaEta) _EBgt15lh->addPdf ("electrons", "dEta", splitSignalPdfs) ; if (m_eleIDSwitches.m_useEoverP) _EBgt15lh->addPdf ("electrons", "EoP", splitSignalPdfs) ; if (m_eleIDSwitches.m_useHoverE) _EBgt15lh->addPdf ("electrons", "HoE", splitSignalPdfs) ; if (m_eleIDSwitches.m_useSigmaEtaEta) _EBgt15lh->addPdf ("electrons", "sigmaIEtaIEta", splitSignalPdfs) ; if (m_eleIDSwitches.m_useSigmaPhiPhi) _EBgt15lh->addPdf ("electrons", "sigmaIPhiIPhi", splitSignalPdfs) ; if (m_eleIDSwitches.m_useFBrem) _EBgt15lh->addPdf ("electrons", "fBrem", splitSignalPdfs) ; if(backgroundWeightSplitting.compare("class")==0) { _EBgt15lh->setSplitFrac ("hadrons", "class0") ; _EBgt15lh->setSplitFrac ("hadrons", "class1") ; } else { throw cms::Exception("BadConfig") << "Only class (0 brem clusters / >=1 brem clusters)" << " splitting is implemented right now"; } if (m_eleIDSwitches.m_useDeltaPhi) _EBgt15lh->addPdf ("hadrons", "dPhi", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useDeltaEta) _EBgt15lh->addPdf ("hadrons", "dEta", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useEoverP) _EBgt15lh->addPdf ("hadrons", "EoP", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useHoverE) _EBgt15lh->addPdf ("hadrons", "HoE", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useSigmaEtaEta) _EBgt15lh->addPdf ("hadrons", "sigmaIEtaIEta", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useSigmaPhiPhi) _EBgt15lh->addPdf ("hadrons", "sigmaIPhiIPhi", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useFBrem) _EBgt15lh->addPdf ("hadrons", "fBrem", splitBackgroundPdfs) ; // ECAL ENDCAP LIKELIHOOD - Pt < 15 GeV _EElt15lh->initFromDB (calibration) ; _EElt15lh->addSpecies ("electrons") ; _EElt15lh->addSpecies ("hadrons") ; if(signalWeightSplitting.compare("class")==0) { _EElt15lh->setSplitFrac ("electrons", "class0") ; _EElt15lh->setSplitFrac ("electrons", "class1") ; } else { throw cms::Exception("BadConfig") << "Only class (0 brem clusters / >=1 brem clusters)" << " splitting is implemented right now"; } if (m_eleIDSwitches.m_useDeltaPhi) _EElt15lh->addPdf ("electrons", "dPhi", splitSignalPdfs) ; if (m_eleIDSwitches.m_useDeltaEta) _EElt15lh->addPdf ("electrons", "dEta", splitSignalPdfs) ; if (m_eleIDSwitches.m_useEoverP) _EElt15lh->addPdf ("electrons", "EoP", splitSignalPdfs) ; if (m_eleIDSwitches.m_useHoverE) _EElt15lh->addPdf ("electrons", "HoE", splitSignalPdfs) ; if (m_eleIDSwitches.m_useSigmaEtaEta) _EElt15lh->addPdf ("electrons", "sigmaIEtaIEta", splitSignalPdfs) ; if (m_eleIDSwitches.m_useSigmaPhiPhi) _EElt15lh->addPdf ("electrons", "sigmaIPhiIPhi", splitSignalPdfs) ; if (m_eleIDSwitches.m_useFBrem) _EElt15lh->addPdf ("electrons", "fBrem", splitSignalPdfs) ; if(backgroundWeightSplitting.compare("class")==0) { _EElt15lh->setSplitFrac ("hadrons", "class0") ; _EElt15lh->setSplitFrac ("hadrons", "class1") ; } else { throw cms::Exception("BadConfig") << "Only class (0 brem clusters / >=1 brem clusters)" << " splitting is implemented right now"; } if (m_eleIDSwitches.m_useDeltaPhi) _EElt15lh->addPdf ("hadrons", "dPhi", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useDeltaEta) _EElt15lh->addPdf ("hadrons", "dEta", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useEoverP) _EElt15lh->addPdf ("hadrons", "EoP", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useHoverE) _EElt15lh->addPdf ("hadrons", "HoE", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useSigmaEtaEta) _EElt15lh->addPdf ("hadrons", "sigmaIEtaIEta", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useSigmaPhiPhi) _EElt15lh->addPdf ("hadrons", "sigmaIPhiIPhi", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useFBrem) _EElt15lh->addPdf ("hadrons", "fBrem", splitBackgroundPdfs) ; // ECAL ENDCAP LIKELIHOOD - Pt >= 15 GeV _EEgt15lh->initFromDB (calibration) ; _EEgt15lh->addSpecies ("electrons") ; _EEgt15lh->addSpecies ("hadrons") ; if(signalWeightSplitting.compare("class")==0) { _EEgt15lh->setSplitFrac ("electrons", "class0") ; _EEgt15lh->setSplitFrac ("electrons", "class1") ; } else { throw cms::Exception("BadConfig") << "Only class (0 brem clusters / >=1 brem clusters)" << " splitting is implemented right now"; } if (m_eleIDSwitches.m_useDeltaPhi) _EEgt15lh->addPdf ("electrons", "dPhi", splitSignalPdfs) ; if (m_eleIDSwitches.m_useDeltaEta) _EEgt15lh->addPdf ("electrons", "dEta", splitSignalPdfs) ; if (m_eleIDSwitches.m_useEoverP) _EEgt15lh->addPdf ("electrons", "EoP", splitSignalPdfs) ; if (m_eleIDSwitches.m_useHoverE) _EEgt15lh->addPdf ("electrons", "HoE", splitSignalPdfs) ; if (m_eleIDSwitches.m_useSigmaEtaEta) _EEgt15lh->addPdf ("electrons", "sigmaIEtaIEta", splitSignalPdfs) ; if (m_eleIDSwitches.m_useSigmaPhiPhi) _EEgt15lh->addPdf ("electrons", "sigmaIPhiIPhi", splitSignalPdfs) ; if (m_eleIDSwitches.m_useFBrem) _EEgt15lh->addPdf ("electrons", "fBrem", splitSignalPdfs) ; if(backgroundWeightSplitting.compare("class")==0) { _EEgt15lh->setSplitFrac ("hadrons", "class0") ; _EEgt15lh->setSplitFrac ("hadrons", "class1") ; } else { throw cms::Exception("BadConfig") << "Only class (0 brem clusters / >=1 brem clusters)" << " splitting is implemented right now"; } if (m_eleIDSwitches.m_useDeltaPhi) _EEgt15lh->addPdf ("hadrons", "dPhi", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useDeltaEta) _EEgt15lh->addPdf ("hadrons", "dEta", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useEoverP) _EEgt15lh->addPdf ("hadrons", "EoP", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useHoverE) _EEgt15lh->addPdf ("hadrons", "HoE", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useSigmaEtaEta) _EEgt15lh->addPdf ("hadrons", "sigmaIEtaIEta", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useSigmaPhiPhi) _EEgt15lh->addPdf ("hadrons", "sigmaIPhiIPhi", splitBackgroundPdfs) ; if (m_eleIDSwitches.m_useFBrem) _EEgt15lh->addPdf ("hadrons", "fBrem", splitBackgroundPdfs) ; }
void ElectronLikelihood::setup | ( | const edm::ParameterSet & | conf | ) | [inline] |
likelihood above 15GeV/c
Definition at line 61 of file ElectronLikelihood.h.
Referenced by result(), Setup(), and ~ElectronLikelihood().
likelihood below 15GeV/c
Definition at line 59 of file ElectronLikelihood.h.
Referenced by result(), Setup(), and ~ElectronLikelihood().
LikelihoodPdfProduct * ElectronLikelihood::_EEgt15lh [private] |
Definition at line 61 of file ElectronLikelihood.h.
Referenced by result(), Setup(), and ~ElectronLikelihood().
LikelihoodPdfProduct * ElectronLikelihood::_EElt15lh [private] |
Definition at line 59 of file ElectronLikelihood.h.
Referenced by result(), Setup(), and ~ElectronLikelihood().
std::string ElectronLikelihood::m_backgroundWeightSplitting [private] |
Definition at line 68 of file ElectronLikelihood.h.
general parameters of all the ele id algorithms
Definition at line 64 of file ElectronLikelihood.h.
Referenced by getInputVar(), and Setup().
std::string ElectronLikelihood::m_signalWeightSplitting [private] |
splitting rule for PDF's
Definition at line 67 of file ElectronLikelihood.h.
Referenced by result().
bool ElectronLikelihood::m_splitBackgroundPdfs [private] |
Definition at line 70 of file ElectronLikelihood.h.
bool ElectronLikelihood::m_splitSignalPdfs [private] |
Definition at line 69 of file ElectronLikelihood.h.