#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 |
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 |
const std::string & | getName () const final |
int | getNCategories () const override |
const std::string & | getTag () const 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 final |
~ElectronMVAEstimatorRun2Spring16GeneralPurpose () override | |
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 18 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Enumerator | |
---|---|
UNDEFINED | |
CAT_EB1_PT10plus | |
CAT_EB2_PT10plus | |
CAT_EE_PT10plus |
Definition at line 25 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_Fall17_iso_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().
|
override |
Definition at line 60 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
Referenced by ElectronMVAEstimatorRun2Spring16GeneralPurpose().
void ElectronMVAEstimatorRun2Spring16GeneralPurpose::constrainMVAVariables | ( | AllVariables & | allMVAVars | ) | const |
Definition at line 356 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().
|
overridevirtual |
Implements AnyMVAEstimatorRun2Base.
Definition at line 178 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References beamSpotLabel_, conversions_cfi::conversions, conversionsLabelAOD_, conversionsLabelMiniAOD_, Exception, edm::Ptr< T >::get(), edm::Event::getByLabel(), edm::HandleBase::isValid(), nullptr, and edm::Handle< T >::product().
Referenced by getTag(), isEndcapCategory(), 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 218 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, mvaElectronID_Fall17_iso_V1_cff::ebeeSplit, 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, reco::Vertex::ndof(), 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 nullptr.
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, mvaElectronID_Fall17_iso_V1_cff::ebeeSplit, mvaElectronID_Fall17_iso_V1_cff::ebSplit, PVValHelper::eta, isEndcapCategory(), reco::GsfElectron::superCluster(), and UNDEFINED.
|
inlinefinalvirtual |
Implements AnyMVAEstimatorRun2Base.
Definition at line 98 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
References name_.
Referenced by plotting.Plot::draw().
|
inlineoverridevirtual |
Implements AnyMVAEstimatorRun2Base.
Definition at line 96 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
References taus_updatedMVAIds_cff::category, isEndcapCategory(), and nCategories.
|
inlinefinalvirtual |
Implements AnyMVAEstimatorRun2Base.
Definition at line 99 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 GBRForestTools::createGBRForest(), Exception, gbrForest_s, mps_fire::i, nCategories, and electrons_cff::weightFile.
Referenced by ElectronMVAEstimatorRun2Spring16GeneralPurpose().
bool ElectronMVAEstimatorRun2Spring16GeneralPurpose::isEndcapCategory | ( | int | category | ) | const |
Definition at line 166 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References CAT_EE_PT10plus, fillMVAVariables(), and GeomDetEnumerators::isEndcap().
Referenced by fillMVAVariables(), findCategory(), and getNCategories().
|
overridevirtual |
Implements AnyMVAEstimatorRun2Base.
Definition at line 79 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References fillMVAVariables(), and findCategory().
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(), 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.
|
finalvirtual |
Reimplemented from AnyMVAEstimatorRun2Base.
Definition at line 64 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.cc.
References beamSpotLabel_, conversionsLabelAOD_, conversionsLabelMiniAOD_, and mvaValue().
Referenced by getTag().
|
private |
Definition at line 133 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
|
private |
Definition at line 139 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by fillMVAVariables(), mvaValue(), and setConsumes().
|
private |
Definition at line 141 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by fillMVAVariables(), mvaValue(), and setConsumes().
|
private |
Definition at line 142 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by fillMVAVariables(), and setConsumes().
|
private |
Definition at line 129 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by init(), and mvaValue().
|
private |
Definition at line 132 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by mvaValue().
|
private |
Definition at line 122 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by getName().
const int ElectronMVAEstimatorRun2Spring16GeneralPurpose::nCategories = 3 |
Definition at line 24 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by getNCategories(), and init().
|
private |
Definition at line 126 of file ElectronMVAEstimatorRun2Spring16GeneralPurpose.h.
Referenced by getTag().