50 dropSuperClusters_(iConfig.getParameter<std::
string>(
"dropSuperCluster")),
51 dropBasicClusters_(iConfig.getParameter<std::
string>(
"dropBasicClusters")),
52 dropPFlowClusters_(iConfig.getParameter<std::
string>(
"dropPFlowClusters")),
53 dropPreshowerClusters_(iConfig.getParameter<std::
string>(
"dropPreshowerClusters")),
54 dropSeedCluster_(iConfig.getParameter<std::
string>(
"dropSeedCluster")),
55 dropRecHits_(iConfig.getParameter<std::
string>(
"dropRecHits")),
56 dropCorrections_(iConfig.getParameter<std::
string>(
"dropCorrections")),
57 dropIsolations_(iConfig.getParameter<std::
string>(
"dropIsolations")),
58 dropShapes_(iConfig.getParameter<std::
string>(
"dropShapes")),
59 dropExtrapolations_(iConfig.getParameter<std::
string>(
"dropExtrapolations")),
60 dropClassifications_(iConfig.getParameter<std::
string>(
"dropClassifications")),
61 linkToPackedPF_(iConfig.getParameter<bool>(
"linkToPackedPFCandidates")),
62 saveNonZSClusterShapes_(iConfig.getParameter<std::
string>(
"saveNonZSClusterShapes")),
63 reducedBarrelRecHitCollectionToken_(consumes<
EcalRecHitCollection>(iConfig.getParameter<edm::
InputTag>(
"reducedBarrelRecHitCollection"))),
64 reducedEndcapRecHitCollectionToken_(consumes<
EcalRecHitCollection>(iConfig.getParameter<edm::
InputTag>(
"reducedEndcapRecHitCollection")))
66 produces<std::vector<pat::Electron> >();
72 mayConsume<EcalRecHitCollection>(
edm::InputTag(
"reducedEcalRecHitsEB"));
73 mayConsume<EcalRecHitCollection>(
edm::InputTag(
"reducedEcalRecHitsEE"));
87 if (linkToPackedPF_) {
92 noZS::EcalClusterLazyTools lazyToolsNoZS(iEvent, iSetup, reducedBarrelRecHitCollectionToken_, reducedEndcapRecHitCollectionToken_);
94 auto_ptr<vector<pat::Electron> >
out(
new vector<pat::Electron>());
95 out->reserve(
src->size());
97 std::vector<unsigned int>
keys;
102 if (dropBasicClusters_(electron)) { electron.
basicClusters_.clear(); }
104 if (dropBasicClusters_(electron) || dropPFlowClusters_(electron)) { electron.
pflowBasicClusters_.clear(); }
106 if (dropPreshowerClusters_(electron) || dropPFlowClusters_(electron)) { electron.
pflowPreshowerClusters_.clear(); }
114 if (linkToPackedPF_) {
117 for(
auto const& pf: (*reco2pf)[electron.
refToOrig_]) {
118 if( pf2pc->contains(pf.id()) ) {
119 keys.push_back( (*pf2pc)[pf].
key());
126 if (
keys.size() == 1) {
132 if (saveNonZSClusterShapes_(electron)) {
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)
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.
edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > reco2pf_
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.
bool embeddedSeedCluster_
True if seed cluster is stored internally.
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.