57 dropSuperClusters_(iConfig.getParameter<
std::
string>(
"dropSuperCluster")),
58 dropBasicClusters_(iConfig.getParameter<
std::
string>(
"dropBasicClusters")),
59 dropPreshowerClusters_(iConfig.getParameter<
std::
string>(
"dropPreshowerClusters")),
60 dropSeedCluster_(iConfig.getParameter<
std::
string>(
"dropSeedCluster")),
61 dropRecHits_(iConfig.getParameter<
std::
string>(
"dropRecHits")),
62 dropSaturation_(iConfig.getParameter<
std::
string>(
"dropSaturation")),
63 dropRegressionData_(iConfig.getParameter<
std::
string>(
"dropRegressionData")),
65 iConfig.getParameter<
edm::
InputTag>(
"recoToPFMap"))),
67 iConfig.getParameter<
edm::
InputTag>(
"packedPFCandidates"))),
69 linkToPackedPF_(iConfig.getParameter<
bool>(
"linkToPackedPFCandidates")),
70 saveNonZSClusterShapes_(iConfig.getParameter<
std::
string>(
"saveNonZSClusterShapes")),
71 reducedBarrelRecHitCollectionToken_(
73 reducedEndcapRecHitCollectionToken_(
75 modifyPhoton_(iConfig.getParameter<
bool>(
"modifyPhotons")) {
78 photonModifier_ = std::make_unique<pat::ObjectModifier<pat::Photon>>(mod_config, consumesCollector());
81 mayConsume<EcalRecHitCollection>(
edm::InputTag(
"reducedEcalRecHitsEB"));
82 mayConsume<EcalRecHitCollection>(
edm::InputTag(
"reducedEcalRecHitsEE"));
84 produces<std::vector<pat::Photon>>();
99 if (linkToPackedPF_) {
100 iEvent.getByToken(reco2pf_, reco2pf);
101 iEvent.getByToken(pf2pc_, pf2pc);
102 iEvent.getByToken(pc_, pc);
105 iEvent, iSetup, reducedBarrelRecHitCollectionToken_, reducedEndcapRecHitCollectionToken_);
107 auto out = std::make_unique<std::vector<pat::Photon>>();
108 out->reserve(
src->size());
111 photonModifier_->setEvent(
iEvent);
114 photonModifier_->setEventContent(iSetup);
116 std::vector<unsigned int>
keys;
122 photonModifier_->modify(
photon);
125 if (dropSuperClusters_(
photon)) {
126 photon.superCluster_.clear();
127 photon.embeddedSuperCluster_ =
false;
129 if (dropBasicClusters_(
photon)) {
130 photon.basicClusters_.clear();
132 if (dropPreshowerClusters_(
photon)) {
133 photon.preshowerClusters_.clear();
135 if (dropSeedCluster_(
photon)) {
136 photon.seedCluster_.clear();
137 photon.embeddedSeedCluster_ =
false;
139 if (dropRecHits_(
photon)) {
141 photon.embeddedRecHits_ =
false;
143 if (dropSaturation_(
photon)) {
146 if (dropRegressionData_(
photon)) {
160 photon.setMaxDRRawEnergy(0);
161 photon.setSubClusRawE1(0);
162 photon.setSubClusRawE2(0);
163 photon.setSubClusRawE3(0);
164 photon.setSubClusDPhi1(0);
165 photon.setSubClusDPhi2(0);
166 photon.setSubClusDPhi3(0);
167 photon.setSubClusDEta1(0);
168 photon.setSubClusDEta2(0);
169 photon.setSubClusDEta3(0);
176 if (linkToPackedPF_) {
179 for (
auto const&
pf : (*reco2pf)[
photon.refToOrig_]) {
180 if (pf2pc->contains(
pf.id())) {
184 photon.setAssociatedPackedPFCandidates(
188 if (
keys.size() == 1) {
194 if (saveNonZSClusterShapes_(
photon)) {
196 float r9 = lazyToolsNoZS.
e3x3(*(
photon.superCluster()->seed())) /
photon.superCluster()->rawEnergy();
198 float sigmaIetaIphi = vCov[1];
201 lazyToolsNoZS.
e1x5(*(
photon.superCluster()->seed())) / lazyToolsNoZS.
e5x5(*(
photon.superCluster()->seed()));
202 photon.addUserFloat(
"sigmaIetaIeta_NoZS", sigmaIetaIeta);
203 photon.addUserFloat(
"sigmaIetaIphi_NoZS", sigmaIetaIphi);
204 photon.addUserFloat(
"sigmaIphiIphi_NoZS", sigmaIphiIphi);
206 photon.addUserFloat(
"e1x5_over_e5x5_NoZS", e15o55);