diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py b/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py index 97ebc6f0fbc76..cc5bc204f112b 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py @@ -32,3 +32,7 @@ makePatMETsTask ) patCandidates = cms.Sequence(patCandidateSummary, patCandidatesTask) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +pp_on_AA_2018.toReplaceWith(patCandidatesTask, patCandidatesTask.copyAndExclude([makePatOOTPhotonsTask])) +pp_on_AA_2018.toModify(patCandidateSummary.candidates, func = lambda list: list.remove(cms.InputTag("patOOTPhotons")) ) diff --git a/PhysicsTools/PatAlgos/python/selectionLayer1/selectedPatCandidates_cff.py b/PhysicsTools/PatAlgos/python/selectionLayer1/selectedPatCandidates_cff.py index 96b8bab9a0115..3f55a156f50fc 100644 --- a/PhysicsTools/PatAlgos/python/selectionLayer1/selectedPatCandidates_cff.py +++ b/PhysicsTools/PatAlgos/python/selectionLayer1/selectedPatCandidates_cff.py @@ -31,3 +31,7 @@ ) selectedPatCandidates = cms.Sequence(selectedPatCandidateSummary, selectedPatCandidatesTask) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +pp_on_AA_2018.toReplaceWith(selectedPatCandidatesTask, selectedPatCandidatesTask.copyAndExclude([selectedPatOOTPhotons])) +pp_on_AA_2018.toModify(selectedPatCandidateSummary.candidates, func = lambda list: list.remove(cms.InputTag("selectedPatOOTPhotons")) ) diff --git a/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py b/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py index 59f8e4b994bc8..0f680094bad8d 100644 --- a/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/slimming_cff.py @@ -53,3 +53,6 @@ bunchSpacingProducer, oniaPhotonCandidates ) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +pp_on_AA_2018.toReplaceWith(slimmingTask, slimmingTask.copyAndExclude([slimmedOOTPhotons])) diff --git a/RecoEcal/EgammaClusterProducers/python/reducedRecHitsSequence_cff.py b/RecoEcal/EgammaClusterProducers/python/reducedRecHitsSequence_cff.py index 32a726dc90e19..949ee4e8588e8 100644 --- a/RecoEcal/EgammaClusterProducers/python/reducedRecHitsSequence_cff.py +++ b/RecoEcal/EgammaClusterProducers/python/reducedRecHitsSequence_cff.py @@ -143,8 +143,8 @@ cms.InputTag("interestingEcalDetIdOOTPFES"), ), interestingDetIdsNotToClean = cms.VInputTag( - cms.InputTag("interestingGedEgammaIsoESDetId"), - cms.InputTag("interestingOotEgammaIsoESDetId"), + cms.InputTag("interestingGedEgammaIsoESDetId"), + cms.InputTag("interestingOotEgammaIsoESDetId"), ) ) @@ -180,3 +180,18 @@ _fastSim_reducedEcalRecHitsTask = reducedEcalRecHitsTask.copyAndExclude(seldigisTask) from Configuration.Eras.Modifier_fastSim_cff import fastSim fastSim.toReplaceWith( reducedEcalRecHitsTask, _fastSim_reducedEcalRecHitsTask) + +_pp_on_AA_reducedEcalRecHitsTask = reducedEcalRecHitsTask.copy() +_pp_on_AA_reducedEcalRecHitsTask.remove(interestingEcalDetIdOOTPFEB) +_pp_on_AA_reducedEcalRecHitsTask.remove(interestingEcalDetIdOOTPFEE) +_pp_on_AA_reducedEcalRecHitsTask.remove(interestingEcalDetIdOOTPFES) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +pp_on_AA_2018.toReplaceWith(reducedEcalRecHitsTask, _pp_on_AA_reducedEcalRecHitsTask) + +pp_on_AA_2018.toModify(reducedEcalRecHitsEB.interestingDetIdCollections, func = lambda list: list.remove(cms.InputTag("interestingEcalDetIdOOTPFEB")) ) +pp_on_AA_2018.toModify(reducedEcalRecHitsEB.interestingDetIdCollections, func = lambda list: list.remove(cms.InputTag("interestingOotGamIsoDetIdEB")) ) +pp_on_AA_2018.toModify(reducedEcalRecHitsEE.interestingDetIdCollections, func = lambda list: list.remove(cms.InputTag("interestingEcalDetIdOOTPFEE")) ) +pp_on_AA_2018.toModify(reducedEcalRecHitsEE.interestingDetIdCollections, func = lambda list: list.remove(cms.InputTag("interestingOotGamIsoDetIdEE")) ) +pp_on_AA_2018.toModify(reducedEcalRecHitsES.interestingDetIds, func = lambda list: list.remove(cms.InputTag("interestingEcalDetIdOOTPFES")) ) +pp_on_AA_2018.toModify(reducedEcalRecHitsES.interestingDetIdsNotToClean, func = lambda list: list.remove(cms.InputTag("interestingOotEgammaIsoESDetId")) ) diff --git a/RecoEgamma/EgammaIsolationAlgos/python/interestingEgammaIsoDetIdsSequence_cff.py b/RecoEgamma/EgammaIsolationAlgos/python/interestingEgammaIsoDetIdsSequence_cff.py index fff8e1f14a498..11ed6dd9e6cda 100644 --- a/RecoEgamma/EgammaIsolationAlgos/python/interestingEgammaIsoDetIdsSequence_cff.py +++ b/RecoEgamma/EgammaIsolationAlgos/python/interestingEgammaIsoDetIdsSequence_cff.py @@ -122,3 +122,12 @@ interestingOotEgammaIsoESDetId ) interestingEgammaIsoDetIds = cms.Sequence(interestingEgammaIsoDetIdsTask) + +_pp_on_AA_interestingEgammaIsoDetIdsTask = interestingEgammaIsoDetIdsTask.copy() +_pp_on_AA_interestingEgammaIsoDetIdsTask.remove(interestingOotGamIsoDetIdEB) +_pp_on_AA_interestingEgammaIsoDetIdsTask.remove(interestingOotGamIsoDetIdEE) +_pp_on_AA_interestingEgammaIsoDetIdsTask.remove(interestingOotEgammaIsoHCALDetId) +_pp_on_AA_interestingEgammaIsoDetIdsTask.remove(interestingOotEgammaIsoESDetId) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +pp_on_AA_2018.toReplaceWith(interestingEgammaIsoDetIdsTask, _pp_on_AA_interestingEgammaIsoDetIdsTask) diff --git a/RecoEgamma/EgammaPhotonProducers/interface/ReducedEGProducer.h b/RecoEgamma/EgammaPhotonProducers/interface/ReducedEGProducer.h index e0fb20bad6240..df24f8960c312 100644 --- a/RecoEgamma/EgammaPhotonProducers/interface/ReducedEGProducer.h +++ b/RecoEgamma/EgammaPhotonProducers/interface/ReducedEGProducer.h @@ -145,7 +145,7 @@ class ReducedEGProducer : public edm::stream::EDProducer<> { //tokens for input collections const edm::EDGetTokenT photonT_; - const edm::EDGetTokenT ootPhotonT_; + edm::EDGetTokenT ootPhotonT_; const edm::EDGetTokenT gsfElectronT_; const edm::EDGetTokenT gsfTrackT_; const edm::EDGetTokenT conversionT_; diff --git a/RecoEgamma/EgammaPhotonProducers/python/reducedEgamma_cfi.py b/RecoEgamma/EgammaPhotonProducers/python/reducedEgamma_cfi.py index 4fa3aafc9171a..6d5d720b07b94 100644 --- a/RecoEgamma/EgammaPhotonProducers/python/reducedEgamma_cfi.py +++ b/RecoEgamma/EgammaPhotonProducers/python/reducedEgamma_cfi.py @@ -109,3 +109,5 @@ modifyReducedEGammaRun2MiniAOD9XFall17_ = run2_miniAOD_94XFall17.makeProcessModifier(calibrateReducedEgamma) from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy modifyReducedEGammaRun2MiniAOD8XLegacy_ = run2_miniAOD_80XLegacy.makeProcessModifier(calibrateReducedEgamma) +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +pp_on_AA_2018.toModify( reducedEgamma, ootPhotons = cms.InputTag("") ) diff --git a/RecoEgamma/EgammaPhotonProducers/src/ReducedEGProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/ReducedEGProducer.cc index ced16c9dfbc1d..d8ead6c028fd2 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/ReducedEGProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/ReducedEGProducer.cc @@ -46,7 +46,6 @@ ReducedEGProducer::ReducedEGProducer(const edm::ParameterSet& config) : photonT_(consumes(config.getParameter("photons"))), - ootPhotonT_(consumes(config.getParameter("ootPhotons"))), gsfElectronT_(consumes(config.getParameter("gsfElectrons"))), gsfTrackT_(consumes(config.getParameter("gsfTracks"))), conversionT_(consumes(config.getParameter("conversions"))), @@ -98,6 +97,10 @@ ReducedEGProducer::ReducedEGProducer(const edm::ParameterSet& config) : slimRelinkGsfElectronSel_(config.getParameter("slimRelinkGsfElectrons")), relinkGsfElectronSel_(config.getParameter("relinkGsfElectrons")) { + + const edm::InputTag& aTag = config.getParameter("ootPhotons"); + if (not aTag.label().empty()) ootPhotonT_ = consumes(aTag); + const std::vector& photonidinputs = config.getParameter >("photonIDSources"); for (const edm::InputTag &tag : photonidinputs) { @@ -141,8 +144,10 @@ ReducedEGProducer::ReducedEGProducer(const edm::ParameterSet& config) : produces< reco::PhotonCollection >(outPhotons_); produces< reco::PhotonCoreCollection >(outPhotonCores_); - produces< reco::PhotonCollection >(outOOTPhotons_); - produces< reco::PhotonCoreCollection >(outOOTPhotonCores_); + if(!ootPhotonT_.isUninitialized()){ + produces< reco::PhotonCollection >(outOOTPhotons_); + produces< reco::PhotonCoreCollection >(outOOTPhotonCores_); + } produces< reco::GsfElectronCollection >(outGsfElectrons_); produces< reco::GsfElectronCoreCollection >(outGsfElectronCores_); produces< reco::GsfTrackCollection >(outGsfTracks_); @@ -151,9 +156,11 @@ ReducedEGProducer::ReducedEGProducer(const edm::ParameterSet& config) : produces< reco::SuperClusterCollection >(outSuperClusters_); produces< reco::CaloClusterCollection >(outEBEEClusters_); produces< reco::CaloClusterCollection >(outESClusters_); - produces< reco::SuperClusterCollection >(outOOTSuperClusters_); - produces< reco::CaloClusterCollection >(outOOTEBEEClusters_); - produces< reco::CaloClusterCollection >(outOOTESClusters_); + if(!ootPhotonT_.isUninitialized()){ + produces< reco::SuperClusterCollection >(outOOTSuperClusters_); + produces< reco::CaloClusterCollection >(outOOTEBEEClusters_); + produces< reco::CaloClusterCollection >(outOOTESClusters_); + } produces< EcalRecHitCollection >(outEBRecHits_); produces< EcalRecHitCollection >(outEERecHits_); if (doPreshowerEcalHits_) produces< EcalRecHitCollection >(outESRecHits_); @@ -168,8 +175,10 @@ ReducedEGProducer::ReducedEGProducer(const edm::ParameterSet& config) : for (const std::string &outid : outPhotonFloatValueMaps_) { produces< edm::ValueMap >(outid); } - for (const std::string &outid : outOOTPhotonFloatValueMaps_) { - produces< edm::ValueMap >(outid); + if(!ootPhotonT_.isUninitialized()){ + for (const std::string &outid : outOOTPhotonFloatValueMaps_) { + produces< edm::ValueMap >(outid); + } } for (const std::string &outid : outGsfElectronFloatValueMaps_) { produces< edm::ValueMap >(outid); @@ -184,12 +193,11 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the //get input collections - edm::Handle photonHandle; theEvent.getByToken(photonT_, photonHandle); edm::Handle ootPhotonHandle; - theEvent.getByToken(ootPhotonT_, ootPhotonHandle); + if(!ootPhotonT_.isUninitialized())theEvent.getByToken(ootPhotonT_, ootPhotonHandle); edm::Handle gsfElectronHandle; theEvent.getByToken(gsfElectronT_, gsfElectronHandle); @@ -235,12 +243,14 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the for (const auto& photonFloatValueMapT : photonFloatValueMapTs_) { theEvent.getByToken(photonFloatValueMapT,photonFloatValueMapHandles[index++]); } - + std::vector > > ootPhotonFloatValueMapHandles(ootPhotonFloatValueMapTs_.size()); - index = 0; - for (const auto& ootPhotonFloatValueMapT : ootPhotonFloatValueMapTs_) { - theEvent.getByToken(ootPhotonFloatValueMapT,ootPhotonFloatValueMapHandles[index++]); - } + if (!ootPhotonT_.isUninitialized()){ + index = 0; + for (const auto& ootPhotonFloatValueMapT : ootPhotonFloatValueMapTs_) { + theEvent.getByToken(ootPhotonFloatValueMapT,ootPhotonFloatValueMapHandles[index++]); + } + } std::vector > > gsfElectronFloatValueMapHandles(gsfElectronFloatValueMapTs_.size()); index = 0; @@ -269,7 +279,7 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the edm::ESHandle theCaloTopology; theEventSetup.get().get(theCaloTopology); const CaloTopology *caloTopology = & (*theCaloTopology); - + //initialize output collections auto photons = std::make_unique(); auto photonCores = std::make_unique(); @@ -386,37 +396,39 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the //special note1: since not PFCand --> no PF isolation, IDs (but we do have FloatValueMap!) //special note2: conversion sequence not run over bcs from oot phos, so skip relinking of oot phos //special note3: clusters and superclusters in own collections! - index = -1; - for (const auto& ootPhoton : *ootPhotonHandle) { - index++; - - bool keep = keepOOTPhotonSel_(ootPhoton); - if (!keep) continue; - - reco::PhotonRef ootPhotonref(ootPhotonHandle,index); - - ootPhotons->push_back(ootPhoton); - - //fill photon pfclusteriso valuemap vectors - int subindex = 0; - for (const auto& ootPhotonFloatValueMapHandle : ootPhotonFloatValueMapHandles) { - ootPhotonFloatValueMapVals[subindex++].push_back((*ootPhotonFloatValueMapHandle)[ootPhotonref]); - } - - //link photon core - const reco::PhotonCoreRef &ootPhotonCore = ootPhoton.photonCore(); - linkCore(ootPhotonCore, *ootPhotonCores, ootPhotonCoreMap); + if(!ootPhotonT_.isUninitialized()) { + index = -1; + for (const auto& ootPhoton : *ootPhotonHandle) { + index++; + + bool keep = keepOOTPhotonSel_(ootPhoton); + if (!keep) continue; - bool slimRelink = slimRelinkOOTPhotonSel_(ootPhoton); - //no supercluster relinking unless slimRelink selection is satisfied - if (!slimRelink) continue; - - bool relink = relinkOOTPhotonSel_(ootPhoton); - - const reco::SuperClusterRef &ootSuperCluster = ootPhoton.superCluster(); - linkSuperCluster(ootSuperCluster, ootSuperClusterMap, *ootSuperClusters, relink, ootSuperClusterFullRelinkMap); + reco::PhotonRef ootPhotonref(ootPhotonHandle,index); + + ootPhotons->push_back(ootPhoton); + + //fill photon pfclusteriso valuemap vectors + int subindex = 0; + for (const auto& ootPhotonFloatValueMapHandle : ootPhotonFloatValueMapHandles) { + ootPhotonFloatValueMapVals[subindex++].push_back((*ootPhotonFloatValueMapHandle)[ootPhotonref]); + } + + //link photon core + const reco::PhotonCoreRef &ootPhotonCore = ootPhoton.photonCore(); + linkCore(ootPhotonCore, *ootPhotonCores, ootPhotonCoreMap); + + bool slimRelink = slimRelinkOOTPhotonSel_(ootPhoton); + //no supercluster relinking unless slimRelink selection is satisfied + if (!slimRelink) continue; + + bool relink = relinkOOTPhotonSel_(ootPhoton); + + const reco::SuperClusterRef &ootSuperCluster = ootPhoton.superCluster(); + linkSuperCluster(ootSuperCluster, ootSuperClusterMap, *ootSuperClusters, relink, ootSuperClusterFullRelinkMap); + } } - + //loop over electrons and fill maps index = -1; for (const auto& gsfElectron : *gsfElectronHandle) { @@ -525,25 +537,26 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the } //loop over output OOTSuperClusters and fill maps - index = 0; - for (auto& ootSuperCluster : *ootSuperClusters) { - - //link seed cluster no matter what - const reco::CaloClusterPtr &ootSeedCluster = ootSuperCluster.seed(); - linkCaloCluster(ootSeedCluster, *ootEbeeClusters, ootEbeeClusterMap); - - //only proceed if ootSuperCluster is marked for full relinking - bool fullrelink = ootSuperClusterFullRelinkMap.count(index++); - if (!fullrelink) { - //zero detid vector which is anyways not useful without stored rechits - ootSuperCluster.clearHitsAndFractions(); - continue; + if(!ootPhotonT_.isUninitialized()) { + index = 0; + for (auto& ootSuperCluster : *ootSuperClusters) { + + //link seed cluster no matter what + const reco::CaloClusterPtr &ootSeedCluster = ootSuperCluster.seed(); + linkCaloCluster(ootSeedCluster, *ootEbeeClusters, ootEbeeClusterMap); + + //only proceed if ootSuperCluster is marked for full relinking + bool fullrelink = ootSuperClusterFullRelinkMap.count(index++); + if (!fullrelink) { + //zero detid vector which is anyways not useful without stored rechits + ootSuperCluster.clearHitsAndFractions(); + continue; + } + + // link calo clusters + linkCaloClusters(ootSuperCluster, *ootEbeeClusters, ootEbeeClusterMap, rechitMap, barrelHitHandle, endcapHitHandle, caloTopology, *ootEsClusters, ootEsClusterMap); } - - // link calo clusters - linkCaloClusters(ootSuperCluster, *ootEbeeClusters, ootEbeeClusterMap, rechitMap, barrelHitHandle, endcapHitHandle, caloTopology, *ootEsClusters, ootEsClusterMap); } - //now finalize and add to the event collections in "reverse" order //rechits (fill output collections of rechits to be stored) @@ -558,7 +571,7 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the eeRecHits->push_back(rechit); } } - + theEvent.put(std::move(ebRecHits),outEBRecHits_); theEvent.put(std::move(eeRecHits),outEERecHits_); @@ -583,14 +596,16 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the //OOTCaloClusters //put ootcalocluster output collections in event and get orphan handles to create ptrs - const edm::OrphanHandle &outOOTEBEEClusterHandle = theEvent.put(std::move(ootEbeeClusters),outOOTEBEEClusters_); - const edm::OrphanHandle &outOOTESClusterHandle = theEvent.put(std::move(ootEsClusters),outOOTESClusters_);; - + edm::OrphanHandle outOOTEBEEClusterHandle; + edm::OrphanHandle outOOTESClusterHandle; //Loop over OOTSuperClusters and relink OOTPhoton CaloClusters - for (reco::SuperCluster &ootSuperCluster : *ootSuperClusters) { - relinkCaloClusters(ootSuperCluster, ootEbeeClusterMap, ootEsClusterMap, outOOTEBEEClusterHandle, outOOTESClusterHandle); + if(!ootPhotonT_.isUninitialized()) { + outOOTEBEEClusterHandle = theEvent.put(std::move(ootEbeeClusters),outOOTEBEEClusters_); + outOOTESClusterHandle = theEvent.put(std::move(ootEsClusters),outOOTESClusters_); + for (reco::SuperCluster &ootSuperCluster : *ootSuperClusters) { + relinkCaloClusters(ootSuperCluster, ootEbeeClusterMap, ootEsClusterMap, outOOTEBEEClusterHandle, outOOTESClusterHandle); + } } - //put superclusters and conversions in the event const edm::OrphanHandle &outSuperClusterHandle = theEvent.put(std::move(superClusters),outSuperClusters_); const edm::OrphanHandle &outConversionHandle = theEvent.put(std::move(conversions),outConversions_); @@ -616,9 +631,10 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the relinkSuperCluster(gsfElectronCore, superClusterMap, outSuperClusterHandle); relinkGsfTrack(gsfElectronCore, gsfTrackMap, outGsfTrackHandle); } - + //put ootsuperclusters in the event - const edm::OrphanHandle &outOOTSuperClusterHandle = theEvent.put(std::move(ootSuperClusters),outOOTSuperClusters_); + edm::OrphanHandle outOOTSuperClusterHandle; + if(!ootPhotonT_.isUninitialized()) outOOTSuperClusterHandle = theEvent.put(std::move(ootSuperClusters),outOOTSuperClusters_); //Relink OOTPhoton SuperClusters for (reco::PhotonCore &ootPhotonCore : *ootPhotonCores) { @@ -627,16 +643,19 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the //put photoncores and gsfelectroncores into the event const edm::OrphanHandle &outPhotonCoreHandle = theEvent.put(std::move(photonCores),outPhotonCores_); - const edm::OrphanHandle &outOOTPhotonCoreHandle = theEvent.put(std::move(ootPhotonCores),outOOTPhotonCores_); + edm::OrphanHandle outOOTPhotonCoreHandle; + if(!ootPhotonT_.isUninitialized()) outOOTPhotonCoreHandle = theEvent.put(std::move(ootPhotonCores),outOOTPhotonCores_); const edm::OrphanHandle &outgsfElectronCoreHandle = theEvent.put(std::move(gsfElectronCores),outGsfElectronCores_); - + //loop over photons, oot photons, and electrons and relink the cores for (reco::Photon &photon : *photons) { relinkPhotonCore(photon, photonCoreMap, outPhotonCoreHandle); } - for (reco::Photon &ootPhoton : *ootPhotons) { - relinkPhotonCore(ootPhoton, ootPhotonCoreMap, outOOTPhotonCoreHandle); + if(!ootPhotonT_.isUninitialized()) { + for (reco::Photon &ootPhoton : *ootPhotons) { + relinkPhotonCore(ootPhoton, ootPhotonCoreMap, outOOTPhotonCoreHandle); + } } for (reco::GsfElectron &gsfElectron : *gsfElectrons) { @@ -671,10 +690,11 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the ambigTracksInThisElectron.clear(); } - + //(finally) store the output photon and electron collections const edm::OrphanHandle &outPhotonHandle = theEvent.put(std::move(photons),outPhotons_); - const edm::OrphanHandle &outOOTPhotonHandle = theEvent.put(std::move(ootPhotons),outOOTPhotons_); + edm::OrphanHandle outOOTPhotonHandle; + if(!ootPhotonT_.isUninitialized()) outOOTPhotonHandle = theEvent.put(std::move(ootPhotons),outOOTPhotons_); const edm::OrphanHandle &outGsfElectronHandle = theEvent.put(std::move(gsfElectrons),outGsfElectrons_); //still need to output relinked valuemaps @@ -721,10 +741,12 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the fillMap(outPhotonHandle, vals, theEvent, outPhotonFloatValueMaps_[index++]); } - //oot photon iso value maps - index = 0; - for (auto const& vals : ootPhotonFloatValueMapVals){ - fillMap(outOOTPhotonHandle, vals, theEvent, outOOTPhotonFloatValueMaps_[index++]); + if(!ootPhotonT_.isUninitialized()) { + //oot photon iso value maps + index = 0; + for (auto const& vals : ootPhotonFloatValueMapVals){ + fillMap(outOOTPhotonHandle, vals, theEvent, outOOTPhotonFloatValueMaps_[index++]); + } } //electron iso value maps diff --git a/RecoLocalCalo/HcalRecProducers/python/HcalHitSelection_cfi.py b/RecoLocalCalo/HcalRecProducers/python/HcalHitSelection_cfi.py index b867132f261f4..d3a9e55d6d286 100644 --- a/RecoLocalCalo/HcalRecProducers/python/HcalHitSelection_cfi.py +++ b/RecoLocalCalo/HcalRecProducers/python/HcalHitSelection_cfi.py @@ -10,3 +10,6 @@ cms.InputTag("interestingOotEgammaIsoHCALDetId"), ) ) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +pp_on_AA_2018.toModify(reducedHcalRecHits.interestingDetIds, func = lambda list: list.remove(cms.InputTag("interestingOotEgammaIsoHCALDetId")) ) diff --git a/RecoParticleFlow/PFProducer/python/particleFlowEGamma_cff.py b/RecoParticleFlow/PFProducer/python/particleFlowEGamma_cff.py index f41f32ba71889..321a27893af3e 100644 --- a/RecoParticleFlow/PFProducer/python/particleFlowEGamma_cff.py +++ b/RecoParticleFlow/PFProducer/python/particleFlowEGamma_cff.py @@ -56,3 +56,6 @@ particleFlowEGammaFull = cms.Sequence(particleFlowEGamma*gedGsfElectronSequenceTmp*gedPhotonSequenceTmp*ootPhotonSequence) particleFlowEGammaFinal = cms.Sequence(particleBasedIsolationTmp*pfNoPileUpIsoSequence*pfNoPileUpCandidates*pfPileUpAllChargedParticles*\ egmPhotonIsolationCITK*egmElectronIsolationCITK*egmElectronIsolationPileUpCITK*gedPhotonSequence*gedElectronPFIsoSequence) + +from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018 +pp_on_AA_2018.toReplaceWith(particleFlowEGammaFull, particleFlowEGammaFull.copyAndExclude([ootPhotonSequence]))