5 tag_(conf.getParameter<
std::
string>(
"mvaTag")),
6 name_(conf.getParameter<
std::
string>(
"mvaName")),
7 methodName_(
"BDTG method"),
8 beamSpotLabel_ (conf.getParameter<
edm::InputTag> (
"beamSpot")),
9 conversionsLabelAOD_ (conf.getParameter<
edm::InputTag> (
"conversionsAOD")),
10 conversionsLabelMiniAOD_(conf.getParameter<
edm::InputTag> (
"conversionsMiniAOD")),
11 rhoLabel_ (
edm::InputTag (
"fixedGridRhoFastjetAll")),
12 ptSplit_ (conf.getParameter<double> (
"ptSplit")),
13 ebSplit_ (conf.getParameter<double> (
"ebSplit")),
14 ebeeSplit_ (conf.getParameter<double> (
"ebeeSplit")),
15 varNames_ (conf.getParameter<
std::vector<
std::
string>>(
"varNames")),
16 absTrackClusterMatching_(tag_ ==
"V2")
20 = conf.
getParameter<std::vector<std::string> >(
"weightFileNames");
22 std::vector<double> clipsLowerValues = conf.
getParameter<std::vector<double>>(
"clipLower");
23 std::vector<double> clipsUpperValues = conf.
getParameter<std::vector<double>>(
"clipUpper");
26 init(weightFileNames);
27 setClips(clipsLowerValues, clipsUpperValues);
64 <<
"wrong number of weightfiles" << std::endl;
84 for(
auto const&
value: clipsLowerValues) {
93 for(
auto const&
value: clipsUpperValues) {
136 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
137 <<
" but appears to be neither" << std::endl;
159 mvaValue(
const int iCategory,
const std::vector<float> & vars)
const {
164 std::cout <<
" bin " << iCategory << std::endl
165 <<
" see " << vars[0] << std::endl
166 <<
" spp " << vars[1] << std::endl
167 <<
" circularity " << vars[2] << std::endl
168 <<
" r9 " << vars[3] << std::endl
169 <<
" etawidth " << vars[4] << std::endl
170 <<
" phiwidth " << vars[5] << std::endl
171 <<
" hoe " << vars[6] << std::endl
172 <<
" kfhits " << vars[7] << std::endl
173 <<
" kfchi2 " << vars[8] << std::endl
174 <<
" gsfchi2 " << vars[9] << std::endl
175 <<
" fbrem " << vars[10] << std::endl
176 <<
" gsfhits " << vars[11] << std::endl
177 <<
" expectedMissingInnerHits " << vars[12] << std::endl
178 <<
" convVtxFitProbability " << vars[13] << std::endl
179 <<
" eop " << vars[14] << std::endl
180 <<
" eleeopout " << vars[15] << std::endl
181 <<
" oneOverEminusOneOverP " << vars[16] << std::endl
182 <<
" deta " << vars[17] << std::endl
183 <<
" dphi " << vars[18] << std::endl
184 <<
" detacalo " << vars[19] << std::endl;
186 std::cout <<
" ele_pfPhotonIso " << vars[20] << std::endl
187 <<
" ele_pfChargedHadIso " << vars[21] << std::endl
188 <<
" ele_pfNeutralHadIso " << vars[22] << std::endl
189 <<
" rho " << vars[23] << std::endl
190 <<
" preShowerOverRaw " << vars[24] << std::endl;
193 std::cout <<
" rho " << vars[20] << std::endl
194 <<
" preShowerOverRaw " << vars[21] << std::endl;
196 std::cout <<
" ### MVA " << result << std::endl << std::endl;
209 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
210 <<
" but appears to be neither" << std::endl;
216 float pt = eleRecoPtr->
pt();
233 else if (pt < ptSplit_ && absEta >=
ebeeSplit_) {
280 <<
"Failed to retrieve event content needed for this MVA" 282 <<
"Check python MVA configuration file." 291 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
292 <<
" but appears to be neither" << std::endl;
313 float etawidth = superCluster->etaWidth();
314 float phiwidth = superCluster->phiWidth();
317 float preShowerOverRaw = superCluster->preshowerEnergy() / superCluster->rawEnergy();
327 if( elePatPtr !=
nullptr ) {
333 float kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
334 float kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0;
335 float gsfchi2 = eleRecoPtr->
gsfTrack()->normalizedChi2();
338 float fbrem = eleRecoPtr->
fbrem();
340 float gsfhits = eleRecoPtr->
gsfTrack()->hitPattern().trackerLayersWithMeasurement();
341 float expectedMissingInnerHits = eleRecoPtr->
gsfTrack()
347 float convVtxFitProbability = -1.;
351 convVtxFitProbability = (
float)TMath::Prob( vtx.
chi2(), vtx.
ndof());
358 float oneOverEminusOneOverP = (1.0/eleRecoPtr->
ecalEnergy()) - (1.0 / pAtVertex );
380 if ((iCategory + 1) % 3 == 0) {
396 expectedMissingInnerHits,
397 convVtxFitProbability,
400 oneOverEminusOneOverP,
432 expectedMissingInnerHits,
433 convVtxFitProbability,
436 oneOverEminusOneOverP,
480 expectedMissingInnerHits,
481 convVtxFitProbability,
484 oneOverEminusOneOverP,
528 expectedMissingInnerHits,
529 convVtxFitProbability,
532 oneOverEminusOneOverP,
551 if ( vars[
clip.varIdx] <
clip.value ) {
557 if ( vars[
clip.varIdx] >
clip.value ) {
const PflowIsolationVariables & pfIsolationVariables() const
T getParameter(std::string const &) const
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
T getUntrackedParameter(std::string const &, T const &) const
void setClips(const std::vector< double > &clipsLowerValues, const std::vector< double > &clipsUpperValues)
virtual TrackRef closestCtfTrackRef() const
bool isNonnull() const
Checks for non-null.
float eSuperClusterOverP() const
T clip(const T &n, const T &lower, const T &upper)
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
std::vector< Clip > clipsUpper_
float full5x5_sigmaIphiIphi() const
~ElectronMVAEstimatorRun2Fall17() override
double pt() const final
transverse momentum
const bool absTrackClusterMatching_
void init(const std::vector< std::string > &weightFileNames)
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
const edm::InputTag conversionsLabelAOD_
float full5x5_sigmaIetaIeta() const
std::vector< float > packMVAVariables(const Args...args) const
float deltaEtaSuperClusterTrackAtVtx() const
float deltaPhiSuperClusterTrackAtVtx() const
Abs< T >::type abs(const T &t)
double chi2() const
chi-squares
float eEleClusterOverPout() const
std::vector< std::unique_ptr< const GBRForest > > gbrForests_
T const * get() const
Returns C++ pointer to the item.
const std::string methodName_
ElectronMVAEstimatorRun2Fall17(const edm::ParameterSet &conf, bool withIso)
const edm::InputTag conversionsLabelMiniAOD_
void constrainMVAVariables(std::vector< float > &) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool isNull() const
Checks for null.
const edm::InputTag rhoLabel_
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...
const edm::InputTag beamSpotLabel_
float deltaEtaSeedClusterTrackAtCalo() const
bool getByLabel(InputTag const &, Handle< T > &) const
SuperClusterRef superCluster() const override
reference to a SuperCluster
int findCategory(const edm::Ptr< reco::Candidate > &particle) const override
const Point & position() const
position
std::vector< float > fillMVAVariables(const edm::Ptr< reco::Candidate > &particle, const edm::Event &) const override
std::vector< Clip > clipsLower_
void setConsumes(edm::ConsumesCollector &&) const final