#include <ElectronMVAEstimatorRun2Spring16GeneralPurpose.h>
Classes | |
struct | AllVariables |
Public Types | |
enum | mvaCategories { UNDEFINED = -1, CAT_EB1_PT10plus = 0, CAT_EB2_PT10plus = 1, CAT_EE_PT10plus = 2 } |
Public Member Functions | |
void | constrainMVAVariables (AllVariables &) const |
std::unique_ptr< const GBRForest > | createSingleReader (const int iCategory, const edm::FileInPath &weightFile) |
ElectronMVAEstimatorRun2Spring16GeneralPurpose (const edm::ParameterSet &conf) | |
ElectronMVAEstimatorRun2Spring16GeneralPurpose () | |
ElectronMVAEstimatorRun2Spring16GeneralPurpose (const std::string &mvaTag, const std::string &conversionsTag="reducedEgamma:reducedConversions", const std::string &beamspotTag="offlineBeamSpot") | |
std::vector< float > | fillMVAVariables (const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override |
std::vector< float > | fillMVAVariables (const reco::GsfElectron *particle, const edm::Handle< reco::ConversionCollection > conversions, const reco::BeamSpot *beamSpot) const |
int | findCategory (const edm::Ptr< reco::Candidate > &particle) const override |
int | findCategory (const reco::GsfElectron *particle) const |
virtual const std::string & | getName () const override final |
virtual int | getNCategories () const override |
virtual const std::string & | getTag () const override final |
void | init (const std::vector< std::string > weightFileNames) |
bool | isEndcapCategory (int category) const |
float | mvaValue (const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override |
float | mvaValue (const reco::GsfElectron *particle, const edm::EventBase &) const |
float | mvaValue (const int iCategory, const std::vector< float > &vars) const |
void | setConsumes (edm::ConsumesCollector &&) const override final |
~ElectronMVAEstimatorRun2Spring16GeneralPurpose () | |
Public Member Functions inherited from AnyMVAEstimatorRun2Base | |
AnyMVAEstimatorRun2Base (const edm::ParameterSet &conf) | |
virtual void | getEventContent (const edm::Event &iEvent) const final |
template<typename... Args> | |
std::vector< float > | packMVAVariables (const Args...args) const |
virtual | ~AnyMVAEstimatorRun2Base () |
Public Attributes | |
const int | nCategories = 3 |
Public Attributes inherited from AnyMVAEstimatorRun2Base | |
const edm::ParameterSet | _conf |
Private Attributes | |
AllVariables | allMVAVars_ |
const edm::InputTag | beamSpotLabel_ |
const edm::InputTag | conversionsLabelAOD_ |
const edm::InputTag | conversionsLabelMiniAOD_ |
std::vector< std::unique_ptr< const GBRForest > > | gbrForest_s |
const std::string | MethodName_ |
const std::string | name_ = "ElectronMVAEstimatorRun2Spring16GeneralPurpose" |
const std::string | tag_ |
Definition at line 22 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Enumerator | |
---|---|
UNDEFINED | |
CAT_EB1_PT10plus | |
CAT_EB2_PT10plus | |
CAT_EE_PT10plus |
Definition at line 29 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
ElectronMVAEstimatorRun2Spring16GeneralPurpose::ElectronMVAEstimatorRun2Spring16GeneralPurpose | ( | const edm::ParameterSet & | conf | ) |
Definition at line 13 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References edm::ParameterSet::getParameter(), init(), and mvaElectronID_PHYS14_PU20bx25_nonTrig_V1_cff::weightFileNames.
ElectronMVAEstimatorRun2Spring16GeneralPurpose::ElectronMVAEstimatorRun2Spring16GeneralPurpose | ( | ) |
Definition at line 45 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
ElectronMVAEstimatorRun2Spring16GeneralPurpose::ElectronMVAEstimatorRun2Spring16GeneralPurpose | ( | const std::string & | mvaTag, |
const std::string & | conversionsTag = "reducedEgamma:reducedConversions" , |
||
const std::string & | beamspotTag = "offlineBeamSpot" |
||
) |
Definition at line 48 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References ~ElectronMVAEstimatorRun2Spring16GeneralPurpose().
ElectronMVAEstimatorRun2Spring16GeneralPurpose::~ElectronMVAEstimatorRun2Spring16GeneralPurpose | ( | ) |
Definition at line 60 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
Referenced by ElectronMVAEstimatorRun2Spring16GeneralPurpose().
void ElectronMVAEstimatorRun2Spring16GeneralPurpose::constrainMVAVariables | ( | AllVariables & | allMVAVars | ) | const |
Definition at line 416 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::deta, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::detacalo, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::dphi, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::eleEoPout, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::EoP, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::fbrem, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::gsfchi2, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::kfchi2, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::OneMinusE1x5E5x5, and ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::R9.
Referenced by fillMVAVariables(), and getTag().
std::unique_ptr< const GBRForest > ElectronMVAEstimatorRun2Spring16GeneralPurpose::createSingleReader | ( | const int | iCategory, |
const edm::FileInPath & | weightFile | ||
) |
Definition at line 177 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References allMVAVars_, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::convVtxFitProbability, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::deta, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::detacalo, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::dphi, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::eleEoPout, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::EoP, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::etawidth, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::expectedMissingInnerHits, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::fbrem, fillMVAVariables(), edm::FileInPath::fullPath(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::gsfchi2, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::gsfhits, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::HoE, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::IoEmIoP, isEndcapCategory(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::kfchi2, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::kfhits, MethodName_, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::OneMinusE1x5E5x5, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::phiwidth, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::PreShowerOverRaw, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::pt, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::R9, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::SCeta, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::see, and ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::spp.
Referenced by init(), and isEndcapCategory().
|
overridevirtual |
Implements AnyMVAEstimatorRun2Base.
Definition at line 236 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References beamSpotLabel_, conversions_cfi::conversions, conversionsLabelAOD_, conversionsLabelMiniAOD_, Exception, edm::Ptr< T >::get(), edm::Event::getByLabel(), edm::HandleBase::isValid(), NULL, and edm::Handle< T >::product().
Referenced by createSingleReader(), getTag(), and mvaValue().
std::vector< float > ElectronMVAEstimatorRun2Spring16GeneralPurpose::fillMVAVariables | ( | const reco::GsfElectron * | particle, |
const edm::Handle< reco::ConversionCollection > | conversions, | ||
const reco::BeamSpot * | beamSpot | ||
) | const |
Definition at line 276 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References funct::abs(), reco::Vertex::chi2(), pat::Electron::closestCtfTrackRef(), reco::GsfElectron::closestCtfTrackRef(), constexpr, constrainMVAVariables(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::convVtxFitProbability, reco::GsfElectron::deltaEtaSeedClusterTrackAtCalo(), reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::deta, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::detacalo, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::dphi, reco::GsfElectron::ecalEnergy(), reco::GsfElectron::eEleClusterOverPout(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::eleEoPout, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::EoP, reco::GsfElectron::eSuperClusterOverP(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::etawidth, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::expectedMissingInnerHits, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::fbrem, reco::GsfElectron::fbrem(), findCategory(), reco::GsfElectron::full5x5_e1x5(), reco::GsfElectron::full5x5_e5x5(), reco::GsfElectron::full5x5_hcalOverEcal(), reco::GsfElectron::full5x5_r9(), reco::GsfElectron::full5x5_sigmaIetaIeta(), reco::GsfElectron::full5x5_sigmaIphiIphi(), edm::Ref< C, T, F >::get(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::gsfchi2, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::gsfhits, reco::GsfElectron::gsfTrack(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::HoE, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::IoEmIoP, edm::Ref< C, T, F >::isAvailable(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::isBarrel, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::isEndcap, isEndcapCategory(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::isNull(), reco::Vertex::isValid(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::kfchi2, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::kfhits, ConversionTools::matchedConversion(), reco::HitPattern::MISSING_INNER_HITS, eostools::move(), reco::Vertex::ndof(), NULL, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::OneMinusE1x5E5x5, AnyMVAEstimatorRun2Base::packMVAVariables(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::phiwidth, reco::BeamSpot::position(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::PreShowerOverRaw, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::pt, reco::LeafCandidate::pt(), ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::R9, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::SCeta, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::see, ElectronMVAEstimatorRun2Spring16GeneralPurpose::AllVariables::spp, reco::GsfElectron::superCluster(), reco::GsfElectron::trackMomentumAtVtx(), and badGlobalMuonTaggersAOD_cff::vtx.
|
overridevirtual |
Implements AnyMVAEstimatorRun2Base.
Definition at line 130 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References edm::Ptr< T >::get(), and NULL.
Referenced by fillMVAVariables(), getTag(), and mvaValue().
int ElectronMVAEstimatorRun2Spring16GeneralPurpose::findCategory | ( | const reco::GsfElectron * | particle | ) | const |
Definition at line 142 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References funct::abs(), CAT_EB1_PT10plus, CAT_EB2_PT10plus, CAT_EE_PT10plus, stringResolutionProvider_cfi::eta, isEndcapCategory(), reco::GsfElectron::superCluster(), and UNDEFINED.
|
inlinefinaloverridevirtual |
Implements AnyMVAEstimatorRun2Base.
Definition at line 105 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
References name_.
Referenced by plotting.Plot::draw().
|
inlineoverridevirtual |
Implements AnyMVAEstimatorRun2Base.
Definition at line 103 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
References python.rootplot.argparse::category, isEndcapCategory(), and nCategories.
|
inlinefinaloverridevirtual |
Implements AnyMVAEstimatorRun2Base.
Definition at line 106 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
References ecalDrivenElectronSeedsParameters_cff::beamSpot, constrainMVAVariables(), conversions_cfi::conversions, fillMVAVariables(), findCategory(), setConsumes(), and tag_.
void ElectronMVAEstimatorRun2Spring16GeneralPurpose::init | ( | const std::vector< std::string > | weightFileNames | ) |
Definition at line 26 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References createSingleReader(), Exception, gbrForest_s, mps_fire::i, nCategories, and candidateChargeBTagComputer_cfi::weightFile.
Referenced by ElectronMVAEstimatorRun2Spring16GeneralPurpose().
bool ElectronMVAEstimatorRun2Spring16GeneralPurpose::isEndcapCategory | ( | int | category | ) | const |
Definition at line 166 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References CAT_EE_PT10plus, createSingleReader(), and GeomDetEnumerators::isEndcap().
Referenced by createSingleReader(), fillMVAVariables(), findCategory(), and getNCategories().
|
overridevirtual |
Implements AnyMVAEstimatorRun2Base.
Definition at line 79 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References fillMVAVariables(), findCategory(), and eostools::move().
Referenced by mvaValue(), and setConsumes().
float ElectronMVAEstimatorRun2Spring16GeneralPurpose::mvaValue | ( | const reco::GsfElectron * | particle, |
const edm::EventBase & | iEvent | ||
) | const |
Definition at line 87 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References ecalDrivenElectronSeedsParameters_cff::beamSpot, beamSpotLabel_, conversions_cfi::conversions, conversionsLabelAOD_, fillMVAVariables(), findCategory(), edm::EventBase::getByLabel(), eostools::move(), mvaValue(), and edm::Handle< T >::product().
float ElectronMVAEstimatorRun2Spring16GeneralPurpose::mvaValue | ( | const int | iCategory, |
const std::vector< float > & | vars | ||
) | const |
Definition at line 98 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References gather_cfg::cout, debug, gbrForest_s, MethodName_, and mps_fire::result.
|
finaloverridevirtual |
Reimplemented from AnyMVAEstimatorRun2Base.
Definition at line 64 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References beamSpotLabel_, conversionsLabelAOD_, conversionsLabelMiniAOD_, and mvaValue().
Referenced by getTag().
|
private |
Definition at line 140 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by createSingleReader().
|
private |
Definition at line 146 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by fillMVAVariables(), mvaValue(), and setConsumes().
|
private |
Definition at line 148 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by fillMVAVariables(), mvaValue(), and setConsumes().
|
private |
Definition at line 149 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by fillMVAVariables(), and setConsumes().
|
private |
Definition at line 136 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by init(), and mvaValue().
|
private |
Definition at line 139 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by createSingleReader(), and mvaValue().
|
private |
Definition at line 129 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by getName().
const int ElectronMVAEstimatorRun2Spring16GeneralPurpose::nCategories = 3 |
Definition at line 28 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by getNCategories(), and init().
|
private |
Definition at line 133 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by getTag().