54 dropSuperClusters_(iConfig.getParameter<std::
string>("dropSuperCluster")),
55 dropBasicClusters_(iConfig.getParameter<std::
string>("dropBasicClusters")),
56 dropPFlowClusters_(iConfig.getParameter<std::
string>("dropPFlowClusters")),
57 dropPreshowerClusters_(iConfig.getParameter<std::
string>("dropPreshowerClusters")),
58 dropSeedCluster_(iConfig.getParameter<std::
string>("dropSeedCluster")),
59 dropRecHits_(iConfig.getParameter<std::
string>("dropRecHits")),
60 dropCorrections_(iConfig.getParameter<std::
string>("dropCorrections")),
61 dropIsolations_(iConfig.getParameter<std::
string>("dropIsolations")),
62 dropShapes_(iConfig.getParameter<std::
string>("dropShapes")),
63 dropExtrapolations_(iConfig.getParameter<std::
string>("dropExtrapolations")),
64 dropClassifications_(iConfig.getParameter<std::
string>("dropClassifications")),
65 linkToPackedPF_(iConfig.getParameter<
bool>("linkToPackedPFCandidates")),
66 saveNonZSClusterShapes_(iConfig.getParameter<std::
string>("saveNonZSClusterShapes")),
69 modifyElectron_(iConfig.getParameter<
bool>("modifyElectrons"))
72 if( modifyElectron_ ) {
75 electronModifier_->setConsumes(sumes);
77 electronModifier_.reset(
nullptr);
80 produces<std::vector<pat::Electron> >();
81 if (linkToPackedPF_) {
82 reco2pf_ = consumes<edm::ValueMap<std::vector<reco::PFCandidateRef>>>(iConfig.
getParameter<
edm::InputTag>(
"recoToPFMap"));
83 pf2pc_ = consumes<edm::Association<pat::PackedCandidateCollection>>(iConfig.
getParameter<
edm::InputTag>(
"packedPFCandidates"));
86 mayConsume<EcalRecHitCollection>(
edm::InputTag(
"reducedEcalRecHitsEB"));
87 mayConsume<EcalRecHitCollection>(
edm::InputTag(
"reducedEcalRecHitsEE"));
113 auto_ptr<vector<pat::Electron> >
out(
new vector<pat::Electron>());
114 out->reserve(
src->size());
118 std::vector<unsigned int>
keys;
141 for(
auto const& pf: (*reco2pf)[electron.
refToOrig_]) {
142 if( pf2pc->contains(pf.id()) ) {
143 keys.push_back( (*pf2pc)[pf].
key());
150 if (
keys.size() == 1) {
edm::EDGetTokenT< pat::PackedCandidateCollection > pc_
void setDr04Isolation(const IsolationVariables &dr04)
T getParameter(std::string const &) const
StringCutObjectSelector< pat::Electron > dropPFlowClusters_
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > pf2pc_
edm::EDGetTokenT< edm::View< pat::Electron > > src_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< EcalRecHitCollection > reducedEndcapRecHitCollectionToken_
#define DEFINE_FWK_MODULE(type)
std::vector< pat::PackedCandidate > PackedCandidateCollection
StringCutObjectSelector< pat::Electron > dropIsolations_
void full5x5_setSigmaIetaIphi(float sigmaIetaIphi)
void setShowerShape(const ShowerShape &s)
std::vector< reco::SuperCluster > superCluster_
Place to store electron's supercluster internally.
Slimmer of PAT Electrons.
void setHcalPFClusterIso(float hcalPFClus)
StringCutObjectSelector< pat::Electron > dropBasicClusters_
void setPfIsolationVariables(const PflowIsolationVariables &iso)
void setDr03Isolation(const IsolationVariables &dr03)
std::vector< reco::CaloCluster > pflowBasicClusters_
Place to store electron's pflow basic clusters internally.
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::unique_ptr< pat::ObjectModifier< pat::Electron > > electronModifier_
edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > reco2pf_
virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) overridefinal
std::vector< reco::CaloCluster > basicClusters_
Place to store electron's basic clusters internally.
StringCutObjectSelector< pat::Electron > dropExtrapolations_
reco::SuperClusterRef superCluster() const
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
edm::EDGetTokenT< EcalRecHitCollection > reducedBarrelRecHitCollectionToken_
std::vector< reco::CaloCluster > preshowerClusters_
Place to store electron's preshower clusters internally.
PATElectronSlimmer(const edm::ParameterSet &iConfig)
bool embeddedRecHits_
True if RecHits stored internally.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
bool embeddedSeedCluster_
True if seed cluster is stored internally.
edm::Ref< PFCandidateCollection > PFCandidateRef
persistent reference to a PFCandidate
StringCutObjectSelector< pat::Electron > dropShapes_
EcalRecHitCollection recHits_
Place to store electron's RecHits internally (5x5 around seed+ all RecHits)
StringCutObjectSelector< pat::Electron > dropSuperClusters_
StringCutObjectSelector< pat::Electron > dropSeedCluster_
StringCutObjectSelector< pat::Electron > dropRecHits_
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
void setEcalPFClusterIso(float ecalPFClus)
void setClassification(Classification myclass)
StringCutObjectSelector< pat::Electron > dropClassifications_
bool embeddedPflowSuperCluster_
True if electron's pflowsupercluster is stored internally.
Analysis-level electron class.
StringCutObjectSelector< pat::Electron > dropCorrections_
bool embeddedSuperCluster_
True if electron's supercluster is stored internally.
StringCutObjectSelector< pat::Electron > dropPreshowerClusters_
void setTrackExtrapolations(const TrackExtrapolations &te)
reco::CandidatePtr sourceCandidatePtr(size_type i) const
get the source candidate pointer with index i
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
std::vector< reco::CaloCluster > pflowPreshowerClusters_
Place to store electron's pflow preshower clusters internally.
void setCorrections(const Corrections &c)
void setAssociatedPackedPFCandidates(const edm::RefProd< pat::PackedCandidateCollection > &refprod, T beginIndexItr, T endIndexItr)
References to PFCandidates linked to this object (e.g. for isolation vetos or masking before jet recl...
void setClassificationVariables(const ClassificationVariables &cv)
StringCutObjectSelector< pat::Electron > saveNonZSClusterShapes_
edm::Ptr< reco::Candidate > refToOrig_
virtual ~PATElectronSlimmer()
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
std::vector< reco::SuperCluster > pflowSuperCluster_
Place to store electron's pflow supercluster internally.
edm::SortedCollection< EcalRecHit > EcalRecHitCollection
std::vector< reco::CaloCluster > seedCluster_
Place to store electron's seed cluster internally.