57 dropSuperClusters_(iConfig.getParameter<
std::
string>(
"dropSuperCluster")),
58 dropBasicClusters_(iConfig.getParameter<
std::
string>(
"dropBasicClusters")),
59 dropPFlowClusters_(iConfig.getParameter<
std::
string>(
"dropPFlowClusters")),
60 dropPreshowerClusters_(iConfig.getParameter<
std::
string>(
"dropPreshowerClusters")),
61 dropSeedCluster_(iConfig.getParameter<
std::
string>(
"dropSeedCluster")),
62 dropRecHits_(iConfig.getParameter<
std::
string>(
"dropRecHits")),
63 dropCorrections_(iConfig.getParameter<
std::
string>(
"dropCorrections")),
64 dropIsolations_(iConfig.getParameter<
std::
string>(
"dropIsolations")),
65 dropShapes_(iConfig.getParameter<
std::
string>(
"dropShapes")),
66 dropSaturation_(iConfig.getParameter<
std::
string>(
"dropSaturation")),
67 dropExtrapolations_(iConfig.getParameter<
std::
string>(
"dropExtrapolations")),
68 dropClassifications_(iConfig.getParameter<
std::
string>(
"dropClassifications")),
70 iConfig.getParameter<
edm::
InputTag>(
"recoToPFMap"))),
72 iConfig.getParameter<
edm::
InputTag>(
"packedPFCandidates"))),
74 linkToPackedPF_(iConfig.getParameter<
bool>(
"linkToPackedPFCandidates")),
75 saveNonZSClusterShapes_(iConfig.getParameter<
std::
string>(
"saveNonZSClusterShapes")),
76 reducedBarrelRecHitCollectionToken_(
78 reducedEndcapRecHitCollectionToken_(
80 modifyElectron_(iConfig.getParameter<
bool>(
"modifyElectrons")) {
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>>();
104 if (linkToPackedPF_) {
105 iEvent.getByToken(reco2pf_, reco2pf);
106 iEvent.getByToken(pf2pc_, pf2pc);
107 iEvent.getByToken(pc_, pc);
110 iEvent, iSetup, reducedBarrelRecHitCollectionToken_, 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)) {
199 electron.full5x5_setSigmaIetaIphi(vCov[1]);