|
 |
Go to the documentation of this file.
49 std::vector<const reco::PFCluster*>&,
54 unsigned plane)
const;
129 std::map<reco::GsfTrackRef, reco::SuperClusterRef>
scMap_;
144 if (!iConfig.
exists(
"isolationValues"))
145 throw cms::Exception(
"PFElectronTranslator|InternalError") <<
"Missing ParameterSet isolationValues";
166 if (iConfig.
exists(
"emptyIsOk"))
177 produces<edm::ValueMap<reco::SuperClusterRef>>(
PFSCValueMap_);
183 auto gsfElectronCores_p = std::make_unique<reco::GsfElectronCoreCollection>();
185 auto gsfElectrons_p = std::make_unique<reco::GsfElectronCollection>();
187 auto superClusters_p = std::make_unique<reco::SuperClusterCollection>();
189 auto basicClusters_p = std::make_unique<reco::BasicClusterCollection>();
191 auto psClusters_p = std::make_unique<reco::PreshowerClusterCollection>();
193 auto mvaMap_p = std::make_unique<edm::ValueMap<float>>();
196 auto scMap_p = std::make_unique<edm::ValueMap<reco::SuperClusterRef>>();
229 for (
unsigned i = 0;
i < ncand; ++
i) {
233 if (
cand.gsfTrackRef().isNull())
254 pfClusters_.push_back(std::vector<const reco::PFCluster*>());
258 for (
unsigned iele = 0; iele <
cand.elementsInBlocks().size(); ++iele) {
262 unsigned elementIndex =
cand.elementsInBlocks()[iele].second;
354 std::ostringstream
err;
355 err <<
" cannot get PFCandidates: " <<
tag << std::endl;
367 std::ostringstream
err;
368 err <<
" cannot get GSFTracks: " <<
tag << std::endl;
379 std::vector<const reco::PFCluster*>& pfClusters,
382 if (myPFClusterRef.
isNull())
386 pfClusters.push_back(&myPFCluster);
398 myPFCluster.
seed()));
403 unsigned plane)
const {
406 myPFClusterRef->energy(), myPFClusterRef->position(), myPFClusterRef->hitsAndFractions(), plane));
412 unsigned basicClusterCounter = 0;
415 for (
unsigned iGSF = 0; iGSF <
size; ++iGSF)
418 for (
unsigned ibc = 0; ibc < nbc; ++ibc)
423 ++basicClusterCounter;
431 unsigned psClusterCounter = 0;
434 for (
unsigned iGSF = 0; iGSF <
size; ++iGSF)
437 for (
unsigned ibc = 0; ibc < nbc; ++ibc)
451 for (
unsigned iGSF = 0; iGSF <
size; ++iGSF)
464 for (
unsigned i = 0;
i < ncand; ++
i) {
468 if (
cand.gsfTrackRef().isNull())
477 std::vector<float>
values;
478 for (
unsigned igsf = 0; igsf < ngsf; ++igsf) {
480 std::map<reco::GsfTrackRef, float>::const_iterator itcheck =
gsfMvaMap_.find(theTrackRef);
487 values.push_back(itcheck->second);
498 std::vector<reco::SuperClusterRef>
values;
499 for (
unsigned igsf = 0; igsf < ngsf; ++igsf) {
501 std::map<reco::GsfTrackRef, reco::SuperClusterRef>::const_iterator itcheck =
scMap_.find(theTrackRef);
502 if (itcheck ==
scMap_.end()) {
506 values.push_back(itcheck->second);
515 for (
unsigned iGSF = 0; iGSF < nGSF; ++iGSF) {
517 double sclusterE = 0;
523 for (
unsigned ibc = 0; ibc < nbasics; ++ibc) {
535 edm::LogError(
"PFElectronTranslator") <<
" Major problem in PFElectron Translator" << std::endl;
559 for (
unsigned ibc = 0; ibc < nbasics; ++ibc) {
562 const std::vector<std::pair<DetId, float>>& v1 =
basicClusters_[iGSF][ibc].hitsAndFractions();
564 for (std::vector<std::pair<DetId, float>>::const_iterator diIt = v1.begin(); diIt != v1.end(); ++diIt) {
571 for (
unsigned ips = 0; ips < nps; ++ips) {
590 unsigned refindex = pfbe.
index();
595 for (; myDaughterCandidate != itend; ++myDaughterCandidate) {
603 return *myPFCandidate;
611 for (
unsigned iGSF = 0; iGSF < nGSF; ++iGSF) {
614 std::map<reco::GsfTrackRef, reco::SuperClusterRef>::const_iterator itcheck =
scMap_.find(
GsfTrackRef_[iGSF]);
615 if (itcheck !=
scMap_.end())
617 gsfElectronCores.push_back(myElectronCore);
625 for (
unsigned iGSF = 0; iGSF <
size; ++iGSF)
633 std::vector<reco::GsfTrackRef>&
tracks)
const {
635 if (GsfEl ==
nullptr)
637 const std::vector<reco::GsfPFRecTrackRef>& ambPFRecTracks(GsfEl->
GsftrackRefPF()->convBremGsfPFRecTrackRef());
638 unsigned ntracks = ambPFRecTracks.size();
639 for (
unsigned it = 0; it < ntracks; ++it) {
640 tracks.push_back(ambPFRecTracks[it]->gsfTrackRef());
649 for (
unsigned iGSF = 0; iGSF <
size; ++iGSF)
681 for (
unsigned it = 0; it < ntracks; ++it) {
695 gsfelectrons.push_back(myElectron);
std::vector< reco::TrackRef > kfTrackRef_
double pflowEtaWidth() const
void fillValueMap(edm::Event &iEvent, edm::ValueMap< float >::Filler &filler) const
std::string PFSCValueMap_
bool fetchCandidateCollection(edm::Handle< reco::PFCandidateCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
virtual SuperClusterRef parentSuperCluster() const
float mva_e_pi() const
mva for electron-pion discrimination
bool isNull() const
Checks for null.
std::vector< reco::GsfElectronCoreRef > gsfElectronCoreRefs_
void setEtaWidth(double ew)
std::map< reco::GsfTrackRef, reco::SuperClusterRef > scMap_
std::vector< reco::CandidatePtr > CandidatePtr_
void createGsfElectronCoreRefs(const edm::OrphanHandle< reco::GsfElectronCoreCollection > &gsfElectronCoreHandle)
edm::InputTag inputTagGSFTracks_
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
std::map< reco::GsfTrackRef, float > gsfMvaMap_
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
void setPreshowerEnergy(double preshowerEnergy)
const ElementsInBlocks & elementsInBlocks() const
void createBasicClusterPtrs(const edm::OrphanHandle< reco::BasicClusterCollection > &basicClustersHandle)
std::string PFMVAValueMap_
double pflowPhiWidth() const
void addCluster(const CaloClusterPtr &r)
add reference to constituent BasicCluster
void setSeed(const CaloClusterPtr &r)
list of used xtals by DetId // now inherited by CaloCluster
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
void setP4(P4Kind kind, const LorentzVector &p4, float p4Error, bool setCandidate)
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
double deltaP() const
uncertainty on 3-momentum
std::vector< int > gsfPFCandidateIndex_
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
#define DEFINE_FWK_MODULE(type)
~PFElectronTranslator() override
std::vector< GsfElectronCore > GsfElectronCoreCollection
const reco::PFCandidate & correspondingDaughterCandidate(const reco::PFCandidate &cand, const reco::PFBlockElement &pfbe) const
void getAmbiguousGsfTracks(const reco::PFBlockElement &PFBE, std::vector< reco::GsfTrackRef > &) const
void createGsfElectrons(const reco::PFCandidateCollection &, const IsolationValueMaps &isolationValues, reco::GsfElectronCollection &)
double rawEcalEnergy() const
return corrected Ecal energy
std::string PFBasicClusterCollection_
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
void createBasicCluster(const reco::PFBlockElement &, reco::BasicClusterCollection &basicClusters, std::vector< const reco::PFCluster * > &, const reco::PFCandidate &coCandidate) const
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
void createPreshowerCluster(const reco::PFBlockElement &PFBE, reco::PreshowerClusterCollection &preshowerClusters, unsigned plane) const
std::vector< reco::GsfTrackRef > GsfTrackRef_
void produce(edm::Event &, const edm::EventSetup &) override
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< std::vector< const reco::PFCluster * > > pfClusters_
std::vector< reco::CaloClusterPtrVector > basicClusterPtr_
std::vector< reco::CaloClusterPtrVector > preshowerClusterPtr_
void createSuperClusters(const reco::PFCandidateCollection &, reco::SuperClusterCollection &superClusters) const
void fetchGsfCollection(edm::Handle< reco::GsfTrackCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
XYZPointD XYZPoint
point in space with cartesian internal representation
void createPreshowerClusterPtrs(const edm::OrphanHandle< reco::PreshowerClusterCollection > &preshowerClustersHandle)
std::vector< std::vector< reco::GsfTrackRef > > ambiguousGsfTracks_
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
void setParentSuperCluster(const SuperClusterRef &scl)
void addHitAndFraction(DetId id, float fraction)
void setPfIsolationVariables(const PflowIsolationVariables &iso)
reco::PFCandidateElectronExtraRef electronExtraRef() const
return a reference to the electron extra
void addAmbiguousGsfTrack(const reco::GsfTrackRef &t)
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
const LorentzVector & p4() const final
four-momentum Lorentz vector
void fillSCRefValueMap(edm::Event &iEvent, edm::ValueMap< reco::SuperClusterRef >::Filler &filler) const
void setMvaOutput(const MvaOutput &mo)
std::string GsfElectronCollection_
void addPreshowerCluster(const CaloClusterPtr &r)
add reference to constituent BasicCluster
void setMvaInput(const MvaInput &mi)
DetId seed() const
return DetId of seed
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
Abstract base class for a PFBlock element (track, cluster...)
std::vector< reco::BasicClusterCollection > basicClusters_
const math::XYZPoint & position() const
cluster centroid position
T getParameter(std::string const &) const
void createGsfElectronCores(reco::GsfElectronCoreCollection &) const
PFElectronTranslator(const edm::ParameterSet &)
std::vector< reco::SuperClusterCollection > superClusters_
AlgoId algo() const
algorithm identifier
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
std::string PFSuperClusterCollection_
const CaloID & caloID() const
std::vector< reco::PreshowerClusterCollection > preshowerClusters_
std::string GsfElectronCoreCollection_
void setPhiWidth(double pw)
edm::InputTag inputTagPFCandidates_
const GsfPFRecTrackRef & GsftrackRefPF() const
Particle reconstructed by the particle flow algorithm.
std::string PFPreshowerClusterCollection_
void fillMVAValueMap(edm::Event &iEvent, edm::ValueMap< float >::Filler &filler)
std::vector< edm::InputTag > inputTagIsoVals_
edm::InputTag inputTagPFCandidateElectrons_
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
void setCtfTrack(const TrackRef &closestCtfTrack, float ctfGsfOverlap)
void createSuperClusterGsfMapRefs(const edm::OrphanHandle< reco::SuperClusterCollection > &superClustersHandle)
virtual const PFClusterRef & clusterRef() const