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;
143 float pt = eleRecoPtr->
pt();
154 if (pt < ptSplit &&
std::abs(eta) < ebSplit)
160 if (pt < ptSplit &&
std::abs(eta) >= ebeeSplit)
163 if (pt >= ptSplit &&
std::abs(eta) < ebSplit)
169 if (pt >= ptSplit &&
std::abs(eta) >= ebeeSplit)
210 <<
"Failed to retrieve event content needed for this MVA" 212 <<
"Check python MVA configuration file." 220 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
221 <<
" but appears to be neither" << std::endl;
242 allMVAVars.
etawidth = superCluster->etaWidth();
243 allMVAVars.
phiwidth = superCluster->phiWidth();
246 allMVAVars.
PreShowerOverRaw = superCluster->preshowerEnergy() / superCluster->rawEnergy();
256 if( elePatPtr !=
nullptr )
261 allMVAVars.
kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
262 allMVAVars.
kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0;
268 allMVAVars.
gsfhits = eleRecoPtr->
gsfTrack()->hitPattern().trackerLayersWithMeasurement();
275 double vertexFitProbability = -1.;
278 vertexFitProbability = TMath::Prob( vtx.
chi2(), vtx.
ndof());
294 allMVAVars.
pt = eleRecoPtr->
pt();
295 float scEta = superCluster->eta();
299 allMVAVars.
SCeta = scEta;
306 allMVAVars.
eClass = nines;
315 std::vector<float> vars;
398 if(allMVAVars.
fbrem < -1.)
399 allMVAVars.
fbrem = -1.;
401 allMVAVars.
deta = fabs(allMVAVars.
deta);
402 if(allMVAVars.
deta > 0.06)
403 allMVAVars.
deta = 0.06;
406 allMVAVars.
dphi = fabs(allMVAVars.
dphi);
407 if(allMVAVars.
dphi > 0.6)
408 allMVAVars.
dphi = 0.6;
411 if(allMVAVars.
EoP > 20.)
412 allMVAVars.
EoP = 20.;
430 if(allMVAVars.
R9 > 5)
437 if(allMVAVars.
kfchi2 > 10.)
T getParameter(std::string const &) const
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
virtual TrackRef closestCtfTrackRef() const
bool isNonnull() const
Checks for non-null.
std::vector< std::unique_ptr< const GBRForest > > gbrForest_s
void setConsumes(edm::ConsumesCollector &&) const final
const std::string MethodName_
float eSuperClusterOverP() const
const edm::InputTag conversionsLabelAOD_
float full5x5_e5x5() const
float expectedMissingInnerHits
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
double pt() const final
transverse momentum
const edm::InputTag beamSpotLabel_
float mcCBmatchingCategory
const edm::InputTag conversionsLabelMiniAOD_
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
ElectronMVAEstimatorRun2Spring16HZZ()
float full5x5_sigmaIetaIeta() const
std::vector< float > packMVAVariables(const Args...args) const
float deltaEtaSuperClusterTrackAtVtx() const
float convVtxFitProbability
float deltaPhiSuperClusterTrackAtVtx() const
bool isEndcapCategory(int category) 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.
std::vector< float > fillMVAVariables(const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool isEndcap(GeomDetEnumerators::SubDetector m)
bool isNull() const
Checks for null.
~ElectronMVAEstimatorRun2Spring16HZZ() override
float mvaValue(const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override
T const * product() const
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 deltaEtaSeedClusterTrackAtCalo() const
bool getByLabel(InputTag const &, Handle< T > &) const
int findCategory(const edm::Ptr< reco::Candidate > &particle) const override
void constrainMVAVariables(AllVariables &) const
SuperClusterRef superCluster() const override
reference to a SuperCluster
void init(const std::vector< std::string > weightFileNames)
const Point & position() const
position
float mvaValue(const reco::GsfElectron *particle, const edm::EventBase &) const