11 #include "TMVA/MethodBDT.h" 15 tag_(conf.getParameter<
std::
string>(
"mvaTag")),
16 MethodName_(
"BDTG method"),
17 beamSpotLabel_(conf.getParameter<
edm::InputTag>(
"beamSpot")),
18 conversionsLabelAOD_(conf.getParameter<
edm::InputTag>(
"conversionsAOD")),
19 conversionsLabelMiniAOD_(conf.getParameter<
edm::InputTag>(
"conversionsMiniAOD")) {
22 = conf.
getParameter<std::vector<std::string> >(
"weightFileNames");
23 init(weightFileNames);
29 <<
"wrong number of weightfiles" << std::endl;
98 mvaValue(
const int iCategory,
const std::vector<float> & vars)
const {
101 const bool debug =
false;
105 <<
" fbrem " << vars[11]
106 <<
" kfchi2 " << vars[9]
107 <<
" mykfhits " << vars[8]
108 <<
" gsfchi2 " << vars[10]
109 <<
" deta " << vars[18]
110 <<
" dphi " << vars[19]
111 <<
" detacalo " << vars[20]
112 <<
" see " << vars[0]
113 <<
" spp " << vars[1]
114 <<
" etawidth " << vars[4]
115 <<
" phiwidth " << vars[5]
116 <<
" OneMinusE1x5E5x5 " << vars[2]
118 <<
" HoE " << vars[6]
119 <<
" EoP " << vars[15]
120 <<
" IoEmIoP " << vars[17]
121 <<
" eleEoPout " << vars[16]
122 <<
" eta " << vars[24]
123 <<
" pt " << vars[21] << std::endl;
124 std::cout <<
" ### MVA " << result << std::endl;
137 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
138 <<
" but appears to be neither" << std::endl;
201 <<
"Failed to retrieve event content needed for this MVA" 203 <<
"Check python MVA configuration file." 211 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
212 <<
" but appears to be neither" << std::endl;
233 allMVAVars.
etawidth = superCluster->etaWidth();
234 allMVAVars.
phiwidth = superCluster->phiWidth();
237 allMVAVars.
PreShowerOverRaw = superCluster->preshowerEnergy() / superCluster->rawEnergy();
247 if( elePatPtr !=
nullptr )
252 allMVAVars.
kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
253 allMVAVars.
kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0;
259 allMVAVars.
gsfhits = eleRecoPtr->
gsfTrack()->hitPattern().trackerLayersWithMeasurement();
266 double vertexFitProbability = -1.;
269 vertexFitProbability = TMath::Prob( vtx.
chi2(), vtx.
ndof());
285 allMVAVars.
pt = eleRecoPtr->
pt();
286 float scEta = superCluster->eta();
290 allMVAVars.
SCeta = scEta;
291 allMVAVars.
pt = eleRecoPtr->
pt();
295 std::vector<float> vars;
360 if(allMVAVars.
fbrem < -1.)
361 allMVAVars.
fbrem = -1.;
363 allMVAVars.
deta = fabs(allMVAVars.
deta);
364 if(allMVAVars.
deta > 0.06)
365 allMVAVars.
deta = 0.06;
368 allMVAVars.
dphi = fabs(allMVAVars.
dphi);
369 if(allMVAVars.
dphi > 0.6)
370 allMVAVars.
dphi = 0.6;
373 if(allMVAVars.
EoP > 20.)
374 allMVAVars.
EoP = 20.;
391 if(allMVAVars.
R9 > 5)
398 if(allMVAVars.
kfchi2 > 10.)
const edm::InputTag conversionsLabelMiniAOD_
T getParameter(std::string const &) const
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
void init(const std::vector< std::string > weightFileNames)
virtual TrackRef closestCtfTrackRef() const
bool isNonnull() const
Checks for non-null.
float eSuperClusterOverP() const
float full5x5_e5x5() const
float full5x5_e1x5() const
T const * get() const
Returns C++ pointer to the item.
bool isValid() const
Tells whether the vertex is valid.
math::XYZVectorF trackMomentumAtVtx() const
float full5x5_sigmaIphiIphi() const
std::vector< std::unique_ptr< const GBRForest > > gbrForest_s
double pt() const final
transverse momentum
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
float full5x5_sigmaIetaIeta() const
std::vector< float > packMVAVariables(const Args...args) const
float deltaEtaSuperClusterTrackAtVtx() const
const edm::InputTag conversionsLabelAOD_
float deltaPhiSuperClusterTrackAtVtx() const
float mvaValue(const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override
void setConsumes(edm::ConsumesCollector &&) const final
Abs< T >::type abs(const T &t)
double chi2() const
chi-squares
ElectronMVAEstimatorRun2Spring16GeneralPurpose()
float eEleClusterOverPout() const
T const * get() const
Returns C++ pointer to the item.
std::vector< float > fillMVAVariables(const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override
int findCategory(const edm::Ptr< reco::Candidate > &particle) const override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool isEndcap(GeomDetEnumerators::SubDetector m)
bool isNull() const
Checks for null.
const std::string MethodName_
void constrainMVAVariables(AllVariables &) const
T const * product() const
~ElectronMVAEstimatorRun2Spring16GeneralPurpose() override
float full5x5_hcalOverEcal() const
Analysis-level electron class.
reco::TrackRef closestCtfTrackRef() const override
override the reco::GsfElectron::closestCtfTrackRef method, to access the internal storage of the trac...
float convVtxFitProbability
const edm::InputTag beamSpotLabel_
float deltaEtaSeedClusterTrackAtCalo() const
bool getByLabel(InputTag const &, Handle< T > &) const
bool isEndcapCategory(int category) const
float expectedMissingInnerHits
SuperClusterRef superCluster() const override
reference to a SuperCluster
const Point & position() const
position