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"))
19 = conf.
getParameter<std::vector<std::string> >(
"weightFileNames");
21 std::vector<double> clipsLowerValues = conf.
getParameter<std::vector<double>>(
"clipLower");
22 std::vector<double> clipsUpperValues = conf.
getParameter<std::vector<double>>(
"clipUpper");
25 init(weightFileNames);
26 setClips(clipsLowerValues, clipsUpperValues);
62 <<
"wrong number of weightfiles" << std::endl;
82 for(
auto const&
value: clipsLowerValues) {
91 for(
auto const&
value: clipsUpperValues) {
134 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
135 <<
" but appears to be neither" << std::endl;
157 mvaValue(
const int iCategory,
const std::vector<float> & vars)
const {
162 std::cout <<
" bin " << iCategory << std::endl
163 <<
" see " << vars[0] << std::endl
164 <<
" spp " << vars[1] << std::endl
165 <<
" circularity " << vars[2] << std::endl
166 <<
" r9 " << vars[3] << std::endl
167 <<
" etawidth " << vars[4] << std::endl
168 <<
" phiwidth " << vars[5] << std::endl
169 <<
" hoe " << vars[6] << std::endl
170 <<
" kfhits " << vars[7] << std::endl
171 <<
" kfchi2 " << vars[8] << std::endl
172 <<
" gsfchi2 " << vars[9] << std::endl
173 <<
" fbrem " << vars[10] << std::endl
174 <<
" gsfhits " << vars[11] << std::endl
175 <<
" expectedMissingInnerHits " << vars[12] << std::endl
176 <<
" convVtxFitProbability " << vars[13] << std::endl
177 <<
" eop " << vars[14] << std::endl
178 <<
" eleeopout " << vars[15] << std::endl
179 <<
" oneOverEminusOneOverP " << vars[16] << std::endl
180 <<
" deta " << vars[17] << std::endl
181 <<
" dphi " << vars[18] << std::endl
182 <<
" detacalo " << vars[19] << std::endl;
184 std::cout <<
" ele_pfPhotonIso " << vars[20] << std::endl
185 <<
" ele_pfChargedHadIso " << vars[21] << std::endl
186 <<
" ele_pfNeutralHadIso " << vars[22] << std::endl
187 <<
" rho " << vars[23] << std::endl
188 <<
" preShowerOverRaw " << vars[24] << std::endl;
191 std::cout <<
" rho " << vars[20] << std::endl
192 <<
" preShowerOverRaw " << vars[21] << std::endl;
194 std::cout <<
" ### MVA " << result << std::endl << std::endl;
207 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
208 <<
" but appears to be neither" << std::endl;
214 float pt = eleRecoPtr->
pt();
231 else if (pt < ptSplit_ && absEta >=
ebeeSplit_) {
278 <<
"Failed to retrieve event content needed for this MVA" 280 <<
"Check python MVA configuration file." 289 <<
" given particle is expected to be reco::GsfElectron or pat::Electron," << std::endl
290 <<
" but appears to be neither" << std::endl;
310 float etawidth = superCluster->etaWidth();
311 float phiwidth = superCluster->phiWidth();
314 float preShowerOverRaw = superCluster->preshowerEnergy() / superCluster->rawEnergy();
324 if( elePatPtr !=
nullptr ) {
330 float kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
331 float kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0;
332 float gsfchi2 = eleRecoPtr->
gsfTrack()->normalizedChi2();
335 float fbrem = eleRecoPtr->
fbrem();
337 float gsfhits = eleRecoPtr->
gsfTrack()->hitPattern().trackerLayersWithMeasurement();
338 float expectedMissingInnerHits = eleRecoPtr->
gsfTrack()
344 float convVtxFitProbability = -1.;
348 convVtxFitProbability = (
float)TMath::Prob( vtx.
chi2(), vtx.
ndof());
355 float oneOverEminusOneOverP = (1.0/eleRecoPtr->
ecalEnergy()) - (1.0 / pAtVertex );
390 expectedMissingInnerHits,
391 convVtxFitProbability,
394 oneOverEminusOneOverP,
438 expectedMissingInnerHits,
439 convVtxFitProbability,
442 oneOverEminusOneOverP,
461 if ( vars[
clip.varIdx] <
clip.value ) {
467 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
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