31 if ( useIsolationValues ) {
32 if( ! iConfig.
exists(
"isolationValues") )
34 <<
"Missing ParameterSet isolationValues" ;
69 produces<edm::ValueMap<reco::SuperClusterRef> >(
PFSCValueMap_);
77 auto gsfElectronCores_p = std::make_unique<reco::GsfElectronCoreCollection>();
79 auto gsfElectrons_p = std::make_unique<reco::GsfElectronCollection>();
81 auto superClusters_p = std::make_unique<reco::SuperClusterCollection>();
83 auto basicClusters_p = std::make_unique<reco::BasicClusterCollection>();
85 auto psClusters_p = std::make_unique<reco::PreshowerClusterCollection>();
87 auto mvaMap_p = std::make_unique<edm::ValueMap<float>>();
90 auto scMap_p = std::make_unique<edm::ValueMap<reco::SuperClusterRef>>();
126 unsigned ncand=(
status)?pfCandidates->size():0;
128 for(
unsigned i=0;
i<ncand; ++
i ) {
151 pfClusters_.push_back(std::vector<const reco::PFCluster *>());
161 if(blockRef.
isNull())
continue;
259 std::ostringstream err;
260 err<<
" cannot get PFCandidates: " 274 std::ostringstream err;
275 err<<
" cannot get GSFTracks: " 287 std::vector<const reco::PFCluster *> & pfClusters,
291 if(myPFClusterRef.
isNull())
return;
294 pfClusters.push_back(&myPFCluster);
306 myPFCluster.
seed()));
314 myPFClusterRef->hitsAndFractions(),plane));
320 unsigned basicClusterCounter=0;
323 for(
unsigned iGSF=0;iGSF<
size;++iGSF)
326 for(
unsigned ibc=0;ibc<nbc;++ibc)
331 ++basicClusterCounter;
339 unsigned psClusterCounter=0;
342 for(
unsigned iGSF=0;iGSF<
size;++iGSF)
345 for(
unsigned ibc=0;ibc<nbc;++ibc)
359 for(
unsigned iGSF=0;iGSF<
size;++iGSF)
375 unsigned ncand=(
status)?pfCandidates->size():0;
376 for(
unsigned i=0;
i<ncand; ++
i ) {
389 unsigned ngsf=gsfTracks->size();
390 std::vector<float>
values;
391 for(
unsigned igsf=0;igsf<ngsf;++igsf)
394 std::map<reco::GsfTrackRef,float>::const_iterator itcheck=
gsfMvaMap_.find(theTrackRef);
398 values.push_back(-99.);
404 values.push_back(itcheck->second);
407 filler.
insert(gsfTracks,values.begin(),values.end());
418 unsigned ngsf=gsfTracks->size();
419 std::vector<reco::SuperClusterRef>
values;
420 for(
unsigned igsf=0;igsf<ngsf;++igsf)
423 std::map<reco::GsfTrackRef,reco::SuperClusterRef>::const_iterator itcheck=
scMap_.find(theTrackRef);
431 values.push_back(itcheck->second);
434 filler.
insert(gsfTracks,values.begin(),values.end());
442 for(
unsigned iGSF=0;iGSF<nGSF;++iGSF)
452 for(
unsigned ibc=0;ibc<nbasics;++ibc)
466 edm::LogError(
"PFElectronTranslator") <<
" Major problem in PFElectron Translator" << std::endl;
493 for(
unsigned ibc=0;ibc<nbasics;++ibc)
497 const std::vector< std::pair<DetId, float> > & v1 =
basicClusters_[iGSF][ibc].hitsAndFractions();
499 for( std::vector< std::pair<DetId, float> >::const_iterator diIt = v1.begin();
508 for(
unsigned ips=0;ips<nps;++ips)
523 superClusters.push_back(mySuperCluster);
530 unsigned refindex=pfbe.
index();
535 for(;myDaughterCandidate!=itend;++myDaughterCandidate)
546 return *myPFCandidate;
554 for(
unsigned iGSF=0;iGSF<nGSF;++iGSF)
558 std::map<reco::GsfTrackRef,reco::SuperClusterRef>::const_iterator
562 gsfElectronCores.push_back(myElectronCore);
569 for(
unsigned iGSF=0;iGSF<
size;++iGSF)
578 if(GsfEl==
nullptr)
return;
579 const std::vector<reco::GsfPFRecTrackRef>& ambPFRecTracks(GsfEl->
GsftrackRefPF()->convBremGsfPFRecTrackRef());
580 unsigned ntracks=ambPFRecTracks.size();
581 for(
unsigned it=0;it<ntracks;++it) {
582 tracks.push_back(ambPFRecTracks[it]->gsfTrackRef());
592 for(
unsigned iGSF=0;iGSF<
size;++iGSF)
622 for(
unsigned it=0;it<ntracks;++it) {
627 if( !isolationValues.empty() ) {
636 gsfelectrons.push_back(myElectron);
std::vector< std::vector< const reco::PFCluster * > > pfClusters_
T getParameter(std::string const &) const
std::string PFPreshowerClusterCollection_
Abstract base class for a PFBlock element (track, cluster...)
const math::XYZPoint & position() const
cluster centroid position
void setCtfTrack(const TrackRef &closestCtfTrack, float ctfGsfOverlap)
void setP4(P4Kind kind, const LorentzVector &p4, float p4Error, bool setCandidate)
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::string PFMVAValueMap_
bool fetchCandidateCollection(edm::Handle< reco::PFCandidateCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
double rawEcalEnergy() const
return corrected Ecal energy
void addHitAndFraction(DetId id, float fraction)
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
void produce(edm::Event &, const edm::EventSetup &) override
void createGsfElectronCoreRefs(const edm::OrphanHandle< reco::GsfElectronCoreCollection > &gsfElectronCoreHandle)
virtual const PFClusterRef & clusterRef() const
std::map< reco::GsfTrackRef, float > gsfMvaMap_
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
std::vector< reco::CaloClusterPtrVector > basicClusterPtr_
std::vector< reco::GsfElectronCoreRef > gsfElectronCoreRefs_
double pflowPhiWidth() const
void setMvaInput(const MvaInput &mi)
void insert(const H &h, I begin, I end)
void createBasicClusterPtrs(const edm::OrphanHandle< reco::BasicClusterCollection > &basicClustersHandle)
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
~PFElectronTranslator() override
const GsfPFRecTrackRef & GsftrackRefPF() const
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
void setSeed(const CaloClusterPtr &r)
list of used xtals by DetId // now inherited by CaloCluster
std::string GsfElectronCollection_
void setPfIsolationVariables(const PflowIsolationVariables &iso)
void setPhiWidth(double pw)
void setMvaOutput(const MvaOutput &mo)
double pflowEtaWidth() const
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
void fillSCRefValueMap(edm::Event &iEvent, edm::ValueMap< reco::SuperClusterRef >::Filler &filler) const
reco::TrackRef trackRef() const
AlgoId algo() const
algorithm identifier
void setEtaWidth(double ew)
std::vector< reco::GsfTrackRef > GsfTrackRef_
void fillMVAValueMap(edm::Event &iEvent, edm::ValueMap< float >::Filler &filler)
void setParentSuperCluster(const SuperClusterRef &scl)
const CaloID & caloID() const
const reco::PFCandidate & correspondingDaughterCandidate(const reco::PFCandidate &cand, const reco::PFBlockElement &pfbe) const
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
const_iterator end() const
last daughter const_iterator
std::vector< GsfElectronCore > GsfElectronCoreCollection
std::vector< reco::PreshowerClusterCollection > preshowerClusters_
void createSuperClusterGsfMapRefs(const edm::OrphanHandle< reco::SuperClusterCollection > &superClustersHandle)
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
const LorentzVector & p4() const final
four-momentum Lorentz vector
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
std::vector< int > gsfPFCandidateIndex_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag inputTagPFCandidateElectrons_
bool isNull() const
Checks for null.
std::vector< reco::CandidatePtr > CandidatePtr_
edm::InputTag inputTagPFCandidates_
std::vector< std::vector< reco::GsfTrackRef > > ambiguousGsfTracks_
std::map< reco::GsfTrackRef, reco::SuperClusterRef > scMap_
edm::InputTag inputTagGSFTracks_
float mva_e_pi() const
mva for electron-pion discrimination
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
reco::PFCandidateElectronExtraRef electronExtraRef() const
return a reference to the electron extra
DetId seed() const
return DetId of seed
void fetchGsfCollection(edm::Handle< reco::GsfTrackCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
std::string PFBasicClusterCollection_
void createBasicCluster(const reco::PFBlockElement &, reco::BasicClusterCollection &basicClusters, std::vector< const reco::PFCluster * > &, const reco::PFCandidate &coCandidate) const
std::vector< reco::SuperClusterCollection > superClusters_
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< reco::CaloClusterPtrVector > preshowerClusterPtr_
void createSuperClusters(const reco::PFCandidateCollection &, reco::SuperClusterCollection &superClusters) const
void addPreshowerCluster(const CaloClusterPtr &r)
add reference to constituent BasicCluster
void getAmbiguousGsfTracks(const reco::PFBlockElement &PFBE, std::vector< reco::GsfTrackRef > &) const
std::string GsfElectronCoreCollection_
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
std::vector< edm::InputTag > inputTagIsoVals_
void addCluster(const CaloClusterPtr &r)
add reference to constituent BasicCluster
std::vector< reco::BasicClusterCollection > basicClusters_
Particle reconstructed by the particle flow algorithm.
std::vector< reco::TrackRef > kfTrackRef_
void createPreshowerCluster(const reco::PFBlockElement &PFBE, reco::PreshowerClusterCollection &preshowerClusters, unsigned plane) const
PFElectronTranslator(const edm::ParameterSet &)
reco::GsfTrackRef gsfTrackRef() const
const_iterator begin() const
first daughter const_iterator
std::string PFSCValueMap_
std::string PFSuperClusterCollection_
void createGsfElectronCores(reco::GsfElectronCoreCollection &) const
virtual ParticleType particleId() const
void createGsfElectrons(const reco::PFCandidateCollection &, const IsolationValueMaps &isolationValues, reco::GsfElectronCollection &)
const ElementsInBlocks & elementsInBlocks() const
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
void addAmbiguousGsfTrack(const reco::GsfTrackRef &t)
void createPreshowerClusterPtrs(const edm::OrphanHandle< reco::PreshowerClusterCollection > &preshowerClustersHandle)
double deltaP() const
uncertainty on 3-momentum
void setPreshowerEnergy(double preshowerEnergy)