56 auto outputElectrons_p = std::make_unique<reco::GsfElectronCollection>();
72 std::vector< edm::Handle< edm::ValueMap<float> > > isolationValueMaps(
nDeps_);
79 std::map<reco::GsfTrackRef, const reco::PFCandidate* > gsfPFMap;
80 reco::PFCandidateCollection::const_iterator it = pfCandidateHandle->begin();
81 reco::PFCandidateCollection::const_iterator itend = pfCandidateHandle->end() ;
82 for(;it!=itend;++it) {
84 if( it->gsfTrackRef().isNonnull()) {
85 if(
abs(it->pdgId())==11)
86 gsfPFMap[it->gsfTrackRef()]=&(*it);
92 unsigned nele=gedElectronHandle->size();
93 for(
unsigned iele=0; iele<nele;++iele) {
99 isoVariables.
sumPhotonEt = (*(isolationValueMaps)[1])[myElectronRef];
101 isoVariables.
sumPUPt = (*(isolationValueMaps)[3])[myElectronRef];
105 newElectron.setPfIsolationVariables(isoVariables);
109 if(newElectron.mvaOutput().status<=0) {
110 std::map<reco::GsfTrackRef, const reco::PFCandidate * >::const_iterator itcheck=gsfPFMap.find(newElectron.gsfTrack());
112 if(itcheck!=gsfPFMap.end()) {
115 newElectron.setPassPflowPreselection(
true);
118 myMvaOutput.status = 4 ;
119 newElectron.setPassPflowPreselection(
false);
121 newElectron.setMvaOutput(myMvaOutput);
127 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 ;