53 auto outputElectrons_p = std::make_unique<reco::GsfElectronCollection>();
69 std::vector<edm::Handle<edm::ValueMap<float> > > isolationValueMaps(
nDeps_);
76 std::map<reco::GsfTrackRef, const reco::PFCandidate*> gsfPFMap;
77 reco::PFCandidateCollection::const_iterator it = pfCandidateHandle->begin();
78 reco::PFCandidateCollection::const_iterator itend = pfCandidateHandle->end();
79 for (; it != itend; ++it) {
81 if (it->gsfTrackRef().isNonnull()) {
82 if (
abs(it->pdgId()) == 11)
83 gsfPFMap[it->gsfTrackRef()] = &(*it);
88 unsigned nele = gedElectronHandle->size();
89 for (
unsigned iele = 0; iele < nele; ++iele) {
95 isoVariables.
sumPhotonEt = (*(isolationValueMaps)[1])[myElectronRef];
97 isoVariables.
sumPUPt = (*(isolationValueMaps)[3])[myElectronRef];
101 newElectron.setPfIsolationVariables(isoVariables);
105 if (newElectron.mvaOutput().status <= 0) {
106 std::map<reco::GsfTrackRef, const reco::PFCandidate*>::const_iterator itcheck =
107 gsfPFMap.find(newElectron.gsfTrack());
109 if (itcheck != gsfPFMap.end()) {
113 newElectron.setPassPflowPreselection(
true);
115 myMvaOutput.status = 4;
117 newElectron.setPassPflowPreselection(
false);
119 newElectron.setMvaOutput(myMvaOutput);
125 outputElectrons_p->push_back(newElectron);
edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons_
std::unique_ptr< ModifyObjectValueBase > gedRegression_
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > tokenElectronIsoVals_
std::string outputCollectionLabel_
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Abs< T >::type abs(const T &t)
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
edm::EDGetTokenT< reco::PFCandidateCollection > pfCandidates_
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;