56 dropSuperClusters_(iConfig.getParameter<
std::
string>(
"dropSuperCluster")),
57 dropBasicClusters_(iConfig.getParameter<
std::
string>(
"dropBasicClusters")),
58 dropPreshowerClusters_(iConfig.getParameter<
std::
string>(
"dropPreshowerClusters")),
59 dropSeedCluster_(iConfig.getParameter<
std::
string>(
"dropSeedCluster")),
60 dropRecHits_(iConfig.getParameter<
std::
string>(
"dropRecHits")),
61 dropSaturation_(iConfig.getParameter<
std::
string>(
"dropSaturation")),
62 dropRegressionData_(iConfig.getParameter<
std::
string>(
"dropRegressionData")),
64 iConfig.getParameter<
edm::
InputTag>(
"recoToPFMap"))),
66 iConfig.getParameter<
edm::
InputTag>(
"packedPFCandidates"))),
68 linkToPackedPF_(iConfig.getParameter<
bool>(
"linkToPackedPFCandidates")),
69 saveNonZSClusterShapes_(iConfig.getParameter<
std::
string>(
"saveNonZSClusterShapes")),
70 reducedBarrelRecHitCollectionToken_(
72 reducedEndcapRecHitCollectionToken_(
74 modifyPhoton_(iConfig.getParameter<
bool>(
"modifyPhotons")),
75 ecalClusterToolsESGetTokens_{consumesCollector()} {
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>>();
97 if (linkToPackedPF_) {
98 iEvent.getByToken(reco2pf_, reco2pf);
99 iEvent.getByToken(pf2pc_, pf2pc);
100 iEvent.getByToken(pc_, pc);
103 ecalClusterToolsESGetTokens_.get(iSetup),
104 reducedBarrelRecHitCollectionToken_,
105 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)) {
195 const auto& vCov = lazyToolsNoZS.localCovariances(*(
photon.superCluster()->seed()));
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()));
203 photon.addUserFloat(
"sigmaIetaIphi_NoZS", sigmaIetaIphi);
204 photon.addUserFloat(
"sigmaIphiIphi_NoZS", sigmaIphiIphi);
206 photon.addUserFloat(
"e1x5_over_e5x5_NoZS", e15o55);
Analysis-level Photon class.
T getParameter(std::string const &) const
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
const edm::EDGetTokenT< EcalRecHitCollection > reducedBarrelRecHitCollectionToken_
constexpr bool isNotFinite(T x)
const bool linkToPackedPF_
std::vector< pat::PackedCandidate > PackedCandidateCollection
const StringCutObjectSelector< pat::Photon > dropSuperClusters_
const StringCutObjectSelector< pat::Photon > saveNonZSClusterShapes_
const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_
const edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > pf2pc_
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > reco2pf_
key
prepare the HTCondor submission files and eventually submit them
#define DEFINE_FWK_MODULE(type)
const edm::EDGetTokenT< edm::View< pat::Photon > > src_
const StringCutObjectSelector< pat::Photon > dropRegressionData_
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
PATPhotonSlimmer(const edm::ParameterSet &iConfig)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
const StringCutObjectSelector< pat::Photon > dropSeedCluster_
const StringCutObjectSelector< pat::Photon > dropRecHits_
std::unique_ptr< pat::ObjectModifier< pat::Photon > > photonModifier_
edm::Ref< l1t::PFCandidateCollection > PFCandidateRef
const StringCutObjectSelector< pat::Photon > dropSaturation_
const edm::EDGetTokenT< EcalRecHitCollection > reducedEndcapRecHitCollectionToken_
const StringCutObjectSelector< pat::Photon > dropBasicClusters_
const StringCutObjectSelector< pat::Photon > dropPreshowerClusters_
edm::SortedCollection< EcalRecHit > EcalRecHitCollection
const edm::EDGetTokenT< pat::PackedCandidateCollection > pc_