34 produces<edm::ValueMap<reco::GsfElectronRef> >();
49 auto valMap_p = std::make_unique<edm::ValueMap<reco::GsfElectronRef>>();
65 <<
" cannot get PFCandidates! ";
69 reco::PFCandidateCollection::const_iterator it = pfCandidates->begin();
70 reco::PFCandidateCollection::const_iterator itend = pfCandidates->end() ;
71 std::vector<reco::GsfElectronRef>
values;
73 for ( ; it != itend ; ++it) {
76 if( it->gsfTrackRef().isNonnull()) {
79 [it](
const auto& ele) {
return (ele.gsfTrack() == it->gsfTrackRef());} );
85 values.push_back(myRef);
87 filler.
insert(pfCandidates,values.begin(),values.end());
105 <<
" cannot get PFCandidates! ";
109 reco::PFCandidateCollection::const_iterator it = pfCandidates->begin();
110 reco::PFCandidateCollection::const_iterator itend = pfCandidates->end() ;
112 for ( ; it != itend ; ++it) {
115 if( it->gsfTrackRef().isNonnull()) {
119 myMvaOutput.
status = it->egammaExtraRef()->electronStatus() ;
126 myMvaInput.
sigmaEtaEta = it->egammaExtraRef()->sigmaEtaEta();
127 myMvaInput.
hadEnergy = it->egammaExtraRef()->hadEnergy();
136 const std::map<reco::GsfTrackRef, reco::GsfElectron::MvaOutput>& mvaOutputs,
139 for (
auto el = electrons.begin(); el != electrons.end(); el++) {
143 mvaOutput.
mva_e_pi = mva_NIso_Value;
145 el->setMvaOutput(mvaOutput);
void matchWithPFCandidates(edm::Event &event)
std::unique_ptr< const SoftElectronMVAEstimator > sElectronMVAEstimator
void insert(const H &h, I begin, I end)
def setup(process, global_tag, zero_tesla=False)
std::vector< Vertex > VertexCollection
collection of Vertex objects
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
void fillEvent(reco::GsfElectronCollection &electrons, edm::Event &event)
void completeElectrons(reco::GsfElectronCollection &electrons, edm::Event const &event, edm::EventSetup const &eventSetup, const gsfAlgoHelpers::HeavyObjectCache *hoc)
U second(std::pair< T, U > const &p)
GsfElectronAlgo::InputTagsConfiguration inputCfg_
bool get(ProductID const &oid, Handle< PROD > &result) const
edm::EDGetTokenT< reco::PFCandidateCollection > egmPFCandidateCollection_
edm::Ref< GsfElectronCollection > GsfElectronRef
reference to an object in a collection of GsfElectron objects
void fillGsfElectronValueMap(edm::Event &event, edm::ValueMap< reco::GsfElectronRef >::Filler &filler)
const edm::OrphanHandle< reco::GsfElectronCollection > & orphanHandle() const
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
GEDGsfElectronProducer(const edm::ParameterSet &, const gsfAlgoHelpers::HeavyObjectCache *)
void setMVAOutputs(reco::GsfElectronCollection &electrons, const gsfAlgoHelpers::HeavyObjectCache *, const std::map< reco::GsfTrackRef, reco::GsfElectron::MvaOutput > &mvaOutputs, reco::VertexCollection const &vertices) const
std::map< reco::GsfTrackRef, reco::GsfElectron::MvaOutput > gsfMVAOutputMap_
std::unique_ptr< const ElectronMVAEstimator > iElectronMVAEstimator
std::map< reco::GsfTrackRef, reco::GsfElectron::MvaInput > gsfMVAInputMap_