56 dropSuperClusters_(iConfig.getParameter<
std::
string>(
"dropSuperCluster")),
57 dropBasicClusters_(iConfig.getParameter<
std::
string>(
"dropBasicClusters")),
58 dropPFlowClusters_(iConfig.getParameter<
std::
string>(
"dropPFlowClusters")),
59 dropPreshowerClusters_(iConfig.getParameter<
std::
string>(
"dropPreshowerClusters")),
60 dropSeedCluster_(iConfig.getParameter<
std::
string>(
"dropSeedCluster")),
61 dropRecHits_(iConfig.getParameter<
std::
string>(
"dropRecHits")),
62 dropCorrections_(iConfig.getParameter<
std::
string>(
"dropCorrections")),
63 dropIsolations_(iConfig.getParameter<
std::
string>(
"dropIsolations")),
64 dropShapes_(iConfig.getParameter<
std::
string>(
"dropShapes")),
65 dropSaturation_(iConfig.getParameter<
std::
string>(
"dropSaturation")),
66 dropExtrapolations_(iConfig.getParameter<
std::
string>(
"dropExtrapolations")),
67 dropClassifications_(iConfig.getParameter<
std::
string>(
"dropClassifications")),
69 iConfig.getParameter<
edm::
InputTag>(
"recoToPFMap"))),
71 iConfig.getParameter<
edm::
InputTag>(
"packedPFCandidates"))),
73 linkToPackedPF_(iConfig.getParameter<
bool>(
"linkToPackedPFCandidates")),
74 saveNonZSClusterShapes_(iConfig.getParameter<
std::
string>(
"saveNonZSClusterShapes")),
75 reducedBarrelRecHitCollectionToken_(
76 consumes(iConfig.getParameter<
edm::
InputTag>(
"reducedBarrelRecHitCollection"))),
77 reducedEndcapRecHitCollectionToken_(
78 consumes(iConfig.getParameter<
edm::
InputTag>(
"reducedEndcapRecHitCollection"))),
79 ecalClusterToolsESGetTokens_{consumesCollector()},
80 modifyElectron_(iConfig.getParameter<
bool>(
"modifyElectrons")) {
81 if (modifyElectron_) {
83 electronModifier_ = std::make_unique<pat::ObjectModifier<pat::Electron>>(mod_config, consumesCollector());
86 mayConsume<EcalRecHitCollection>(
edm::InputTag(
"reducedEcalRecHitsEB"));
87 mayConsume<EcalRecHitCollection>(
edm::InputTag(
"reducedEcalRecHitsEE"));
89 produces<std::vector<pat::Electron>>();
102 if (linkToPackedPF_) {
103 iEvent.getByToken(reco2pf_, reco2pf);
104 iEvent.getByToken(pf2pc_, pf2pc);
105 iEvent.getByToken(pc_, pc);
108 ecalClusterToolsESGetTokens_.get(iSetup),
109 reducedBarrelRecHitCollectionToken_,
110 reducedEndcapRecHitCollectionToken_);
112 auto out = std::make_unique<std::vector<pat::Electron>>();
113 out->reserve(
src->size());
115 if (modifyElectron_) {
116 electronModifier_->setEvent(
iEvent);
119 electronModifier_->setEventContent(iSetup);
121 std::vector<unsigned int>
keys;
126 if (modifyElectron_) {
127 electronModifier_->modify(
electron);
132 electron.embeddedSuperCluster_ =
false;
138 electron.pflowSuperCluster_.clear();
139 electron.embeddedPflowSuperCluster_ =
false;
142 electron.pflowBasicClusters_.clear();
144 if (dropPreshowerClusters_(
electron)) {
145 electron.preshowerClusters_.clear();
148 electron.pflowPreshowerClusters_.clear();
152 electron.embeddedSeedCluster_ =
false;
172 if (dropExtrapolations_(
electron)) {
175 if (dropClassifications_(
electron)) {
179 if (linkToPackedPF_) {
182 for (
auto const&
pf : (*reco2pf)[
electron.refToOrig_]) {
183 if (pf2pc->contains(
pf.id())) {
187 electron.setAssociatedPackedPFCandidates(
191 if (
keys.size() == 1) {
197 if (saveNonZSClusterShapes_(
electron)) {
198 const auto& vCov = lazyToolsNoZS.localCovariances(*(
electron.superCluster()->seed()));
199 electron.full5x5_setSigmaIetaIphi(vCov[1]);
const edm::EDGetTokenT< EcalRecHitCollection > reducedEndcapRecHitCollectionToken_
const StringCutObjectSelector< pat::Electron > dropRecHits_
T getParameter(std::string const &) const
const StringCutObjectSelector< pat::Electron > dropIsolations_
const bool linkToPackedPF_
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > reco2pf_
const StringCutObjectSelector< pat::Electron > dropSuperClusters_
std::vector< pat::PackedCandidate > PackedCandidateCollection
const StringCutObjectSelector< pat::Electron > dropCorrections_
Slimmer of PAT Electrons.
const edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > pf2pc_
const edm::EDGetTokenT< EcalRecHitCollection > reducedBarrelRecHitCollectionToken_
std::unique_ptr< pat::ObjectModifier< pat::Electron > > electronModifier_
const StringCutObjectSelector< pat::Electron > dropBasicClusters_
PATElectronSlimmer(const edm::ParameterSet &iConfig)
const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_
const StringCutObjectSelector< pat::Electron > dropPreshowerClusters_
const StringCutObjectSelector< pat::Electron > dropClassifications_
const StringCutObjectSelector< pat::Electron > dropShapes_
const StringCutObjectSelector< pat::Electron > dropExtrapolations_
const StringCutObjectSelector< pat::Electron > saveNonZSClusterShapes_
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) final
key
prepare the HTCondor submission files and eventually submit them
#define DEFINE_FWK_MODULE(type)
const StringCutObjectSelector< pat::Electron > dropSeedCluster_
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
const StringCutObjectSelector< pat::Electron > dropPFlowClusters_
Analysis-level electron class.
const StringCutObjectSelector< pat::Electron > dropSaturation_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
edm::Ref< l1t::PFCandidateCollection > PFCandidateRef
const edm::EDGetTokenT< edm::View< pat::Electron > > src_
const edm::EDGetTokenT< pat::PackedCandidateCollection > pc_
const bool modifyElectron_
edm::SortedCollection< EcalRecHit > EcalRecHitCollection