53 src_(consumes<edm::
View<pat::
Electron> >(iConfig.getParameter<edm::InputTag>(
"src"))),
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"))
68 produces<std::vector<pat::Electron> >();
74 mayConsume<EcalRecHitCollection>(
edm::InputTag(
"reducedEcalRecHitsEB"));
75 mayConsume<EcalRecHitCollection>(
edm::InputTag(
"reducedEcalRecHitsEE"));
89 if (linkToPackedPF_) {
94 edm::InputTag reducedBarrelRecHitCollection(
"reducedEcalRecHitsEB");
95 edm::InputTag reducedEndcapRecHitCollection(
"reducedEcalRecHitsEE");
98 auto_ptr<vector<pat::Electron> >
out(
new vector<pat::Electron>());
99 out->reserve(
src->size());
105 if (dropBasicClusters_(electron)) { electron.
basicClusters_.clear(); }
107 if (dropBasicClusters_(electron) || dropPFlowClusters_(electron)) { electron.
pflowBasicClusters_.clear(); }
109 if (dropPreshowerClusters_(electron) || dropPFlowClusters_(electron)) { electron.
pflowPreshowerClusters_.clear(); }
117 if (linkToPackedPF_) {
122 if (pf2pc->contains(pf.id())) {
129 if (origs.
size() == 1) {
135 if (saveNonZSClusterShapes_(electron)) {
137 const auto & seedCluster = *electron.
superCluster()->seed();
139 std::vector<float> Cov = lazyToolsNoZS.
covariances(seedCluster);
143 float sigmaIetaIphi = vCov[1];
145 ss.
e1x5 = lazyToolsNoZS.
e1x5(seedCluster);
147 ss.
e5x5 = lazyToolsNoZS.
e5x5(seedCluster);
edm::EDGetTokenT< pat::PackedCandidateCollection > pc_
void setDr04Isolation(const IsolationVariables &dr04)
T getParameter(std::string const &) const
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
StringCutObjectSelector< pat::Electron > dropPFlowClusters_
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > pf2pc_
edm::EDGetTokenT< edm::View< pat::Electron > > src_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
reco::SuperClusterRef superCluster() const
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
StringCutObjectSelector< pat::Electron > dropIsolations_
void setAssociatedPackedPFCandidates(const edm::RefVector< pat::PackedCandidateCollection > &refvector)
References to PFCandidates linked to this object (e.g. for isolation vetos or masking before jet recl...
void full5x5_setSigmaIetaIphi(float sigmaIetaIphi)
void setShowerShape(const ShowerShape &s)
std::vector< reco::SuperCluster > superCluster_
Place to store electron's supercluster internally.
Matcher of reconstructed objects to L1 Muons.
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_
void full5x5_setShowerShape(const ShowerShape &s)
std::vector< reco::CaloCluster > basicClusters_
Place to store electron's basic clusters internally.
StringCutObjectSelector< pat::Electron > dropExtrapolations_
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_
void setPfShowerShape(const ShowerShape &shape)
EcalRecHitCollection recHits_
Place to store electron's RecHits internally (5x5 around seed+ all RecHits)
void setPackedPFCandidateCollection(const edm::RefProd< pat::PackedCandidateCollection > &refprod)
References to PFCandidates (e.g. to recompute isolation)
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 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)
std::vector< reco::CaloCluster > pflowPreshowerClusters_
Place to store electron's pflow preshower clusters internally.
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
size_type size() const
Size of the RefVector.
void setCorrections(const Corrections &c)
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.