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");
26 <<
"wrong number of weightfiles" << std::endl;
68 const bool debug =
false;
72 <<
" fbrem " << vars[11]
73 <<
" kfchi2 " << vars[9]
74 <<
" mykfhits " << vars[8]
75 <<
" gsfchi2 " << vars[10]
76 <<
" deta " << vars[18]
77 <<
" dphi " << vars[19]
78 <<
" detacalo " << vars[20]
81 <<
" etawidth " << vars[4]
82 <<
" phiwidth " << vars[5]
83 <<
" OneMinusE1x5E5x5 " << vars[2]
86 <<
" EoP " << vars[15]
87 <<
" IoEmIoP " << vars[17]
88 <<
" eleEoPout " << vars[16]
89 <<
" eta " << vars[22]
90 <<
" pt " << vars[21] << std::endl;
91 std::cout <<
" ### MVA " << result << std::endl;
104 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
105 <<
" but appears to be neither" << std::endl;
163 <<
"Failed to retrieve event content needed for this MVA" 165 <<
"Check python MVA configuration file." 173 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
174 <<
" but appears to be neither" << std::endl;
187 allMVAVars.
etawidth = superCluster->etaWidth();
188 allMVAVars.
phiwidth = superCluster->phiWidth();
191 allMVAVars.
PreShowerOverRaw = superCluster->preshowerEnergy() / superCluster->rawEnergy();
206 allMVAVars.
kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
207 allMVAVars.
kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0;
213 allMVAVars.
gsfhits = eleRecoPtr->
gsfTrack()->hitPattern().trackerLayersWithMeasurement();
220 double vertexFitProbability = -1.;
223 vertexFitProbability = TMath::Prob( vtx.
chi2(), vtx.
ndof());
239 allMVAVars.
pt = eleRecoPtr->
pt();
240 float scEta = superCluster->eta();
241 allMVAVars.
SCeta = scEta;
245 std::vector<float> vars;
311 if(allMVAVars.
fbrem < -1.)
312 allMVAVars.
fbrem = -1.;
314 allMVAVars.
deta = fabs(allMVAVars.
deta);
315 if(allMVAVars.
deta > 0.06)
316 allMVAVars.
deta = 0.06;
319 allMVAVars.
dphi = fabs(allMVAVars.
dphi);
320 if(allMVAVars.
dphi > 0.6)
321 allMVAVars.
dphi = 0.6;
324 if(allMVAVars.
EoP > 20.)
325 allMVAVars.
EoP = 20.;
343 if(allMVAVars.
R9 > 5)
350 if(allMVAVars.
kfchi2 > 10.)
358 "ElectronMVAEstimatorRun2Spring15Trig");
T getParameter(std::string const &) const
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
std::vector< float > fillMVAVariables(const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override
virtual TrackRef closestCtfTrackRef() const
bool isNonnull() const
Checks for non-null.
std::vector< std::unique_ptr< const GBRForest > > _gbrForests
float eSuperClusterOverP() const
float full5x5_e5x5() const
void setConsumes(edm::ConsumesCollector &&) const final
float full5x5_e1x5() const
const edm::InputTag _conversionsLabelAOD
T const * get() const
Returns C++ pointer to the item.
bool isValid() const
Tells whether the vertex is valid.
math::XYZVectorF trackMomentumAtVtx() const
float expectedMissingInnerHits
float full5x5_sigmaIphiIphi() const
double pt() const final
transverse momentum
const edm::InputTag _conversionsLabelMiniAOD
float mvaValue(const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
float full5x5_sigmaIetaIeta() const
std::vector< float > packMVAVariables(const Args...args) const
float deltaEtaSuperClusterTrackAtVtx() const
float hadronicOverEm() const
~ElectronMVAEstimatorRun2Spring15Trig() override
float deltaPhiSuperClusterTrackAtVtx() const
void constrainMVAVariables(AllVariables &) const
Abs< T >::type abs(const T &t)
double chi2() const
chi-squares
float eEleClusterOverPout() const
T const * get() const
Returns C++ pointer to the item.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool isEndcap(GeomDetEnumerators::SubDetector m)
bool isNull() const
Checks for null.
ElectronMVAEstimatorRun2Spring15Trig(const edm::ParameterSet &conf)
reco::TrackRef closestCtfTrackRef() const override
override the reco::GsfElectron::closestCtfTrackRef method, to access the internal storage of the trac...
float deltaEtaSeedClusterTrackAtCalo() const
SuperClusterRef superCluster() const override
reference to a SuperCluster
#define DEFINE_EDM_PLUGIN(factory, type, name)
const Point & position() const
position
const edm::InputTag _beamSpotLabel
int findCategory(const edm::Ptr< reco::Candidate > &particle) const override
const std::string _MethodName
float convVtxFitProbability
bool isEndcapCategory(int category) const