4 #include <unordered_set> 52 preshowerEcalHits_(doPreshowerEcalHits_
57 config.getParameter<
edm::
InputTag>(
"photonsPFValMap"))),
59 config.getParameter<
edm::
InputTag>(
"gsfElectronsPFValMap"))),
61 applyPhotonCalibOnData_(config.getParameter<
bool>(
"applyPhotonCalibOnData")),
62 applyPhotonCalibOnMC_(config.getParameter<
bool>(
"applyPhotonCalibOnMC")),
63 applyGsfElectronCalibOnData_(config.getParameter<
bool>(
"applyGsfElectronCalibOnData")),
64 applyGsfElectronCalibOnMC_(config.getParameter<
bool>(
"applyGsfElectronCalibOnMC")),
66 outPhotons_(
"reducedGedPhotons"),
67 outPhotonCores_(
"reducedGedPhotonCores"),
68 outOOTPhotons_(
"reducedOOTPhotons"),
69 outOOTPhotonCores_(
"reducedOOTPhotonCores"),
70 outGsfElectrons_(
"reducedGedGsfElectrons"),
71 outGsfElectronCores_(
"reducedGedGsfElectronCores"),
72 outGsfTracks_(
"reducedGsfTracks"),
73 outConversions_(
"reducedConversions"),
74 outSingleConversions_(
"reducedSingleLegConversions"),
75 outSuperClusters_(
"reducedSuperClusters"),
76 outEBEEClusters_(
"reducedEBEEClusters"),
77 outESClusters_(
"reducedESClusters"),
78 outOOTSuperClusters_(
"reducedOOTSuperClusters"),
79 outOOTEBEEClusters_(
"reducedOOTEBEEClusters"),
80 outOOTESClusters_(
"reducedOOTESClusters"),
81 outEBRecHits_(
"reducedEBRecHits"),
82 outEERecHits_(
"reducedEERecHits"),
83 outESRecHits_(
"reducedESRecHits"),
84 outHBHERecHits_(
"reducedHBHEHits"),
85 outPhotonPfCandMap_(
"reducedPhotonPfCandMap"),
86 outGsfElectronPfCandMap_(
"reducedGsfElectronPfCandMap"),
87 outPhotonIds_(config.getParameter<
std::vector<
std::
string>>(
"photonIDOutput")),
88 outGsfElectronIds_(config.getParameter<
std::vector<
std::
string>>(
"gsfElectronIDOutput")),
89 outPhotonFloatValueMaps_(config.getParameter<
std::vector<
std::
string>>(
"photonFloatValueMapOutput")),
90 outOOTPhotonFloatValueMaps_(config.getParameter<
std::vector<
std::
string>>(
"ootPhotonFloatValueMapOutput")),
91 outGsfElectronFloatValueMaps_(config.getParameter<
std::vector<
std::
string>>(
"gsfElectronFloatValueMapOutput")),
92 keepPhotonSel_(config.getParameter<
std::
string>(
"keepPhotons")),
93 slimRelinkPhotonSel_(config.getParameter<
std::
string>(
"slimRelinkPhotons")),
94 relinkPhotonSel_(config.getParameter<
std::
string>(
"relinkPhotons")),
95 keepOOTPhotonSel_(config.getParameter<
std::
string>(
"keepOOTPhotons")),
96 slimRelinkOOTPhotonSel_(config.getParameter<
std::
string>(
"slimRelinkOOTPhotons")),
97 relinkOOTPhotonSel_(config.getParameter<
std::
string>(
"relinkOOTPhotons")),
98 keepGsfElectronSel_(config.getParameter<
std::
string>(
"keepGsfElectrons")),
99 slimRelinkGsfElectronSel_(config.getParameter<
std::
string>(
"slimRelinkGsfElectrons")),
100 relinkGsfElectronSel_(config.getParameter<
std::
string>(
"relinkGsfElectrons")),
103 if (not aTag.
label().empty())
104 ootPhotonT_ = consumes<reco::PhotonCollection>(aTag);
106 const std::vector<edm::InputTag>& photonidinputs = config.
getParameter<std::vector<edm::InputTag>>(
"photonIDSources");
111 const std::vector<edm::InputTag>& gsfelectronidinputs =
112 config.
getParameter<std::vector<edm::InputTag>>(
"gsfElectronIDSources");
117 const std::vector<edm::InputTag>& photonpfclusterisoinputs =
118 config.
getParameter<std::vector<edm::InputTag>>(
"photonFloatValueMapSources");
123 const std::vector<edm::InputTag>& ootphotonpfclusterisoinputs =
124 config.
getParameter<std::vector<edm::InputTag>>(
"ootPhotonFloatValueMapSources");
129 const std::vector<edm::InputTag>& gsfelectronpfclusterisoinputs =
130 config.
getParameter<std::vector<edm::InputTag>>(
"gsfElectronFloatValueMapSources");
173 produces<edm::ValueMap<bool>>(outid);
176 produces<edm::ValueMap<float>>(outid);
179 produces<edm::ValueMap<float>>(outid);
183 produces<edm::ValueMap<float>>(outid);
187 produces<edm::ValueMap<float>>(outid);
236 std::vector<edm::Handle<edm::ValueMap<bool>>> photonIdHandles(
photonIdTs_.size());
239 theEvent.
getByToken(photonIdT, photonIdHandles[index++]);
242 std::vector<edm::Handle<edm::ValueMap<float>>> gsfElectronIdHandles(
gsfElectronIdTs_.size());
245 theEvent.
getByToken(gsfElectronIdT, gsfElectronIdHandles[index++]);
251 theEvent.
getByToken(photonFloatValueMapT, photonFloatValueMapHandles[index++]);
258 theEvent.
getByToken(ootPhotonFloatValueMapT, ootPhotonFloatValueMapHandles[index++]);
265 theEvent.
getByToken(gsfElectronFloatValueMapT, gsfElectronFloatValueMapHandles[index++]);
290 auto photons = std::make_unique<reco::PhotonCollection>();
291 auto photonCores = std::make_unique<reco::PhotonCoreCollection>();
292 auto ootPhotons = std::make_unique<reco::PhotonCollection>();
293 auto ootPhotonCores = std::make_unique<reco::PhotonCoreCollection>();
294 auto gsfElectrons = std::make_unique<reco::GsfElectronCollection>();
295 auto gsfElectronCores = std::make_unique<reco::GsfElectronCoreCollection>();
296 auto gsfTracks = std::make_unique<reco::GsfTrackCollection>();
297 auto conversions = std::make_unique<reco::ConversionCollection>();
299 auto superClusters = std::make_unique<reco::SuperClusterCollection>();
300 auto ebeeClusters = std::make_unique<reco::CaloClusterCollection>();
301 auto esClusters = std::make_unique<reco::CaloClusterCollection>();
302 auto ootSuperClusters = std::make_unique<reco::SuperClusterCollection>();
303 auto ootEbeeClusters = std::make_unique<reco::CaloClusterCollection>();
304 auto ootEsClusters = std::make_unique<reco::CaloClusterCollection>();
305 auto ebRecHits = std::make_unique<EcalRecHitCollection>();
306 auto eeRecHits = std::make_unique<EcalRecHitCollection>();
307 auto esRecHits = std::make_unique<EcalRecHitCollection>();
308 auto hbheRecHits = std::make_unique<HBHERecHitCollection>();
309 auto photonPfCandMap = std::make_unique<edm::ValueMap<std::vector<reco::PFCandidateRef>>>();
310 auto gsfElectronPfCandMap = std::make_unique<edm::ValueMap<std::vector<reco::PFCandidateRef>>>();
313 std::map<reco::PhotonCoreRef, unsigned int> photonCoreMap;
314 std::map<reco::PhotonCoreRef, unsigned int> ootPhotonCoreMap;
315 std::map<reco::GsfElectronCoreRef, unsigned int> gsfElectronCoreMap;
316 std::map<reco::GsfTrackRef, unsigned int> gsfTrackMap;
317 std::map<reco::ConversionRef, unsigned int> conversionMap;
318 std::map<reco::ConversionRef, unsigned int> singleConversionMap;
319 std::map<reco::SuperClusterRef, unsigned int> superClusterMap;
320 std::map<reco::CaloClusterPtr, unsigned int> ebeeClusterMap;
321 std::map<reco::CaloClusterPtr, unsigned int> esClusterMap;
322 std::map<reco::SuperClusterRef, unsigned int> ootSuperClusterMap;
323 std::map<reco::CaloClusterPtr, unsigned int> ootEbeeClusterMap;
324 std::map<reco::CaloClusterPtr, unsigned int> ootEsClusterMap;
325 std::unordered_set<DetId> rechitMap;
326 std::unordered_set<DetId> hcalRechitMap;
328 std::unordered_set<unsigned int> superClusterFullRelinkMap;
329 std::unordered_set<unsigned int> ootSuperClusterFullRelinkMap;
332 std::vector<std::vector<reco::PFCandidateRef>> pfCandIsoPairVecPho;
333 std::vector<std::vector<reco::PFCandidateRef>> pfCandIsoPairVecEle;
336 std::vector<std::vector<bool>> photonIdVals(photonIdHandles.size());
337 std::vector<std::vector<float>> gsfElectronIdVals(gsfElectronIdHandles.size());
338 std::vector<std::vector<float>> photonFloatValueMapVals(photonFloatValueMapHandles.size());
339 std::vector<std::vector<float>> ootPhotonFloatValueMapVals(ootPhotonFloatValueMapHandles.size());
340 std::vector<std::vector<float>> gsfElectronFloatValueMapVals(gsfElectronFloatValueMapHandles.size());
344 for (
const auto&
photon : *photonHandle) {
349 auto& newPhoton =
photons->back();
352 calibratePhoton(newPhoton, photonref, *photonCalibEnergyHandle, *photonCalibEnergyErrHandle);
363 pfCandIsoPairVecPho.push_back((*photonPfCandMapHandle)[photonref]);
367 for (
const auto& photonIdHandle : photonIdHandles) {
368 photonIdVals[subindex++].push_back((*photonIdHandle)[photonref]);
372 for (
const auto& photonFloatValueMapHandle : photonFloatValueMapHandles) {
373 photonFloatValueMapVals[subindex++].push_back((*photonFloatValueMapHandle)[photonref]);
378 linkCore(photonCore, *photonCores, photonCoreMap);
389 linkSuperCluster(superCluster, superClusterMap, *superClusters, relink, superClusterFullRelinkMap);
400 linkConversions(singleconvrefs, *singleConversions, singleConversionMap);
412 for (
const auto& ootPhoton : *ootPhotonHandle) {
421 ootPhotons->push_back(ootPhoton);
425 for (
const auto& ootPhotonFloatValueMapHandle : ootPhotonFloatValueMapHandles) {
426 ootPhotonFloatValueMapVals[subindex++].push_back((*ootPhotonFloatValueMapHandle)[ootPhotonref]);
431 linkCore(ootPhotonCore, *ootPhotonCores, ootPhotonCoreMap);
441 linkSuperCluster(ootSuperCluster, ootSuperClusterMap, *ootSuperClusters, relink, ootSuperClusterFullRelinkMap);
443 linkHcalHits(*ootPhoton.superCluster(), *hbheHitHandle, hcalRechitMap);
449 for (
const auto& gsfElectron : *gsfElectronHandle) {
453 gsfElectrons->push_back(gsfElectron);
454 auto& newGsfElectron = gsfElectrons->back();
459 *gsfElectronCalibEnergyHandle,
460 *gsfElectronCalibEnergyErrHandle,
461 *gsfElectronCalibEcalEnergyHandle,
462 *gsfElectronCalibEcalEnergyErrHandle);
467 gsfElectrons->pop_back();
471 pfCandIsoPairVecEle.push_back((*gsfElectronPfCandMapHandle)[gsfElectronref]);
475 for (
const auto& gsfElectronIdHandle : gsfElectronIdHandles) {
476 gsfElectronIdVals[subindex++].push_back((*gsfElectronIdHandle)[gsfElectronref]);
480 for (
const auto& gsfElectronFloatValueMapHandle : gsfElectronFloatValueMapHandles) {
481 gsfElectronFloatValueMapVals[subindex++].push_back((*gsfElectronFloatValueMapHandle)[gsfElectronref]);
485 linkCore(gsfElectronCore, *gsfElectronCores, gsfElectronCoreMap);
490 if (!gsfTrackMap.count(gsfTrack)) {
491 gsfTracks->push_back(*gsfTrack);
492 gsfTrackMap[gsfTrack] = gsfTracks->size() - 1;
497 igsf != gsfElectron.ambiguousGsfTracksEnd();
500 if (!gsfTrackMap.count(ambigGsfTrack)) {
501 gsfTracks->push_back(*ambigGsfTrack);
502 gsfTrackMap[ambigGsfTrack] = gsfTracks->size() - 1;
514 linkSuperCluster(superCluster, superClusterMap, *superClusters, relink, superClusterFullRelinkMap);
525 linkConversions(singleconvrefs, *singleConversions, singleConversionMap);
534 linkHcalHits(*gsfElectron.superCluster(), *hbheHitHandle, hcalRechitMap);
539 for (
auto& superCluster : *superClusters) {
545 bool fullrelink = superClusterFullRelinkMap.count(index++);
548 superCluster.clearHitsAndFractions();
573 for (
auto& ootSuperCluster : *ootSuperClusters) {
579 bool fullrelink = ootSuperClusterFullRelinkMap.count(index++);
582 ootSuperCluster.clearHitsAndFractions();
601 for (
const EcalRecHit& rechit : *barrelHitHandle) {
602 if (rechitMap.count(rechit.detid())) {
603 ebRecHits->push_back(rechit);
607 for (
const EcalRecHit& rechit : *endcapHitHandle) {
608 if (rechitMap.count(rechit.detid())) {
609 eeRecHits->push_back(rechit);
617 for (
const EcalRecHit& rechit : *preshowerHitHandle) {
618 if (rechitMap.count(rechit.detid())) {
619 esRecHits->push_back(rechit);
625 for (
const HBHERecHit& rechit : *hbheHitHandle) {
626 if (hcalRechitMap.count(rechit.detid())) {
627 hbheRecHits->push_back(rechit);
642 relinkCaloClusters(superCluster, ebeeClusterMap, esClusterMap, outEBEEClusterHandle, outESClusterHandle);
655 ootSuperCluster, ootEbeeClusterMap, ootEsClusterMap, outOOTEBEEClusterHandle, outOOTESClusterHandle);
723 std::vector<reco::GsfTrackRef> ambigTracksInThisElectron;
726 igsf != gsfElectron.ambiguousGsfTracksEnd();
728 ambigTracksInThisElectron.push_back(*igsf);
732 gsfElectron.clearAmbiguousGsfTracks();
735 for (
const auto& it : ambigTracksInThisElectron) {
736 const auto& gsftkmapped = gsfTrackMap.find(it);
738 if (gsftkmapped != gsfTrackMap.end()) {
740 gsfElectron.addAmbiguousGsfTrack(gsftkref);
742 throw cms::Exception(
"There must be a problem with linking and mapping of ambiguous gsf tracks...");
745 if (gsfElectron.ambiguousGsfTracksSize() > 0)
746 gsfElectron.setAmbiguous(
true);
748 ambigTracksInThisElectron.clear();
763 fillerPhotons.insert(outPhotonHandle, pfCandIsoPairVecPho.begin(), pfCandIsoPairVecPho.end());
764 fillerPhotons.fill();
768 fillerGsfElectrons.insert(outGsfElectronHandle, pfCandIsoPairVecEle.begin(), pfCandIsoPairVecEle.end());
769 fillerGsfElectrons.fill();
776 auto oMap = std::make_unique<MapType>();
778 typename MapType::Filler
filler(*oMap);
779 filler.insert(refH, vec.begin(), vec.end());
787 for (
auto const& vals : photonIdVals) {
788 fillMap(outPhotonHandle, vals, theEvent,
outPhotonIds_[index++]);
793 for (
auto const& vals : gsfElectronIdVals) {
799 for (
auto const& vals : photonFloatValueMapVals) {
806 for (
auto const& vals : ootPhotonFloatValueMapVals) {
813 for (
auto const& vals : gsfElectronFloatValueMapVals) {
818 template <
typename T,
typename U>
820 if (!coreMap.count(core)) {
821 cores.push_back(*core);
822 coreMap[core] = cores.size() - 1;
827 std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
830 std::unordered_set<unsigned int>& superClusterFullRelinkMap) {
831 const auto& mappedsc = superClusterMap.find(superCluster);
834 unsigned int mappedscidx = 0;
835 if (mappedsc == superClusterMap.end()) {
836 superClusters.push_back(*superCluster);
837 mappedscidx = superClusters.size() - 1;
838 superClusterMap[superCluster] = mappedscidx;
840 mappedscidx = mappedsc->second;
845 superClusterFullRelinkMap.insert(mappedscidx);
850 std::map<reco::ConversionRef, unsigned int>& conversionMap) {
851 for (
const auto& convref : convrefs) {
859 std::map<reco::ConversionRef, unsigned int>& conversionMap) {
861 for (
const auto&
conversion : *conversionHandle) {
875 std::map<reco::ConversionRef, unsigned int>& conversionMap) {
877 for (
const auto&
conversion : *conversionHandle) {
890 std::map<reco::ConversionRef, unsigned int>& conversionMap) {
891 if (!conversionMap.count(convref)) {
892 conversions.push_back(*convref);
893 conversionMap[convref] = conversions.size() - 1;
899 std::map<reco::CaloClusterPtr, unsigned int>& caloClusterMap) {
900 if (!caloClusterMap.count(caloCluster)) {
901 caloClusters.push_back(*caloCluster);
902 caloClusterMap[caloCluster] = caloClusters.size() - 1;
908 std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
909 std::unordered_set<DetId>& rechitMap,
914 std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap) {
915 for (
const auto& cluster : superCluster.
clusters()) {
918 for (
const auto& hitfrac : cluster->hitsAndFractions()) {
919 rechitMap.insert(hitfrac.first);
922 bool barrel = cluster->hitsAndFractions().front().first.subdetId() ==
EcalBarrel;
924 DetId seed = EcalClusterTools::getMaximum(*cluster, rhcol).first;
926 std::vector<DetId> dets5x5 =
928 for (
const auto& detid : dets5x5) {
929 rechitMap.insert(detid);
935 for (
const auto& hitfrac : cluster->hitsAndFractions()) {
936 rechitMap.insert(hitfrac.first);
943 std::unordered_set<DetId>& hcalDetIds) {
948 const std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
949 const std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap,
953 const auto& seedmapped = ebeeClusterMap.find(superCluster.
seed());
954 if (seedmapped != ebeeClusterMap.end()) {
962 for (
const auto& cluster : superCluster.
clusters()) {
963 const auto& clustermapped = ebeeClusterMap.find(cluster);
964 if (clustermapped != ebeeClusterMap.end()) {
974 if (!clusters.
empty()) {
981 const auto& clustermapped = esClusterMap.find(cluster);
982 if (clustermapped != esClusterMap.end()) {
992 if (!esclusters.
empty()) {
997 template <
typename T>
1000 const std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
1002 const auto& scmapped = superClusterMap.find(core.superCluster());
1003 if (scmapped != superClusterMap.end()) {
1006 core.setSuperCluster(scref);
1011 const std::map<reco::GsfTrackRef, unsigned int>& gsfTrackMap,
1013 const auto& gsftkmapped = gsfTrackMap.find(gsfElectronCore.
gsfTrack());
1014 if (gsftkmapped != gsfTrackMap.end()) {
1022 const std::map<reco::ConversionRef, unsigned int>& conversionMap,
1025 for (
const auto& convref : convrefs) {
1026 const auto& convmapped = conversionMap.find(convref);
1027 if (convmapped != conversionMap.end()) {
1032 outconvrefs.
clear();
1036 if (!outconvrefs.
empty()) {
1042 const std::map<reco::PhotonCoreRef, unsigned int>& photonCoreMap,
1044 const auto& coremapped = photonCoreMap.find(photon.
photonCore());
1045 if (coremapped != photonCoreMap.end()) {
1054 const std::map<reco::GsfElectronCoreRef, unsigned int>& gsfElectronCoreMap,
1056 const auto& coremapped = gsfElectronCoreMap.find(gsfElectron.
core());
1057 if (coremapped != gsfElectronCoreMap.end()) {
1068 float newEnergy = energyMap[oldPhoRef];
1069 float newEnergyErr = energyErrMap[oldPhoRef];
1070 photon.
setCorrectedEnergy(reco::Photon::P4type::regression2, newEnergy, newEnergyErr,
true);
1079 const float newEnergy = energyMap[oldEleRef];
1080 const float newEnergyErr = energyErrMap[oldEleRef];
1081 const float newEcalEnergy = ecalEnergyMap[oldEleRef];
1082 const float newEcalEnergyErr = ecalEnergyErrMap[oldEleRef];
1086 const float corr = newEnergy / oldP4.E();
const bool doPreshowerEcalHits_
void setPreshowerClusters(const CaloClusterPtrVector &clusters)
void linkCaloClusters(const reco::SuperCluster &superCluster, reco::CaloClusterCollection &ebeeClusters, std::map< reco::CaloClusterPtr, unsigned int > &ebeeClusterMap, std::unordered_set< DetId > &rechitMap, const edm::Handle< EcalRecHitCollection > &barrelHitHandle, const edm::Handle< EcalRecHitCollection > &endcapHitHandle, const CaloTopology *caloTopology, reco::CaloClusterCollection &esClusters, std::map< reco::CaloClusterPtr, unsigned int > &esClusterMap)
void relinkGsfTrack(reco::GsfElectronCore &electroncore, const std::map< reco::GsfTrackRef, unsigned int > &gsfTrackMap, const edm::OrphanHandle< reco::GsfTrackCollection > &outGsfTrackHandle)
T getParameter(std::string const &) const
const StringCutObjectSelector< reco::Photon > relinkOOTPhotonSel_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< reco::GsfElectronCollection > gsfElectronT_
float trackMomentumError() const
void setCore(const reco::GsfElectronCoreRef &core)
const bool applyPhotonCalibOnData_
const edm::EDGetTokenT< reco::GsfTrackCollection > gsfTrackT_
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEnergyT_
const StringCutObjectSelector< reco::Photon > slimRelinkPhotonSel_
void setGsfTrack(const GsfTrackRef &gsfTrack)
const edm::EDGetTokenT< reco::ConversionCollection > singleConversionT_
const LorentzVector & p4(P4Kind kind) const
const std::vector< std::string > outPhotonIds_
void setCorrectedEnergy(P4type type, float E, float dE, bool toCand=true)
~ReducedEGProducer() override
const std::vector< std::string > outOOTPhotonFloatValueMaps_
EGHcalRecHitSelector hcalHitSel_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static void calibratePhoton(reco::Photon &photon, const reco::PhotonRef &oldPhoRef, const edm::ValueMap< float > &energyMap, const edm::ValueMap< float > &energyErrMap)
void push_back(Ptr< T > const &iPtr)
edm::EDGetTokenT< edm::ValueMap< float > > photonCalibEnergyT_
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
const std::vector< std::string > outPhotonFloatValueMaps_
bool empty() const
Is the RefVector empty.
const GsfTrackRef & gsfTrack() const
const std::string outGsfTracks_
void setToken(edm::EDGetTokenT< T > &token, const edm::ParameterSet &config, const std::string &name)
void setup(const edm::EventSetup &iSetup)
const StringCutObjectSelector< reco::GsfElectron > keepGsfElectronSel_
void linkHcalHits(const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, std::unordered_set< DetId > &hcalDetIds)
const std::string outOOTPhotons_
void beginRun(edm::Run const &, const edm::EventSetup &) final
const std::string outEBEEClusters_
void setSeed(const CaloClusterPtr &r)
list of used xtals by DetId // now inherited by CaloCluster
const StringCutObjectSelector< reco::Photon > keepPhotonSel_
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > photonPfCandMapT_
const bool applyGsfElectronCalibOnData_
const CaloClusterPtrVector & clusters() const
const access to the cluster list itself
bool empty() const
Is the RefVector empty.
edm::EDGetTokenT< edm::ValueMap< float > > photonCalibEnergyErrT_
const std::string outHBHERecHits_
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
const StringCutObjectSelector< reco::GsfElectron > relinkGsfElectronSel_
void setClusters(const CaloClusterPtrVector &clusters)
void linkConversion(const reco::ConversionRef &convref, reco::ConversionCollection &conversions, std::map< reco::ConversionRef, unsigned int > &conversionMap)
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > gsfElectronPfCandMapT_
const std::string outEBRecHits_
const std::string outESRecHits_
void relinkConversions(reco::PhotonCore &photonCore, const reco::ConversionRefVector &convrefs, const std::map< reco::ConversionRef, unsigned int > &conversionMap, const edm::OrphanHandle< reco::ConversionCollection > &outConversionHandle)
const edm::EDGetTokenT< EcalRecHitCollection > preshowerEcalHits_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void linkConversions(const reco::ConversionRefVector &convrefs, reco::ConversionCollection &conversions, std::map< reco::ConversionRef, unsigned int > &conversionMap)
reco::PhotonCoreRef photonCore() const
returns a reference to the core photon object
const std::vector< std::string > outGsfElectronIds_
void setCorrectedEcalEnergyError(float newEnergyError)
void setPhotonCore(const reco::PhotonCoreRef &photonCore)
const std::string outSingleConversions_
const std::string outESClusters_
const std::string outOOTSuperClusters_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
const StringCutObjectSelector< reco::Photon > keepOOTPhotonSel_
const std::string outOOTESClusters_
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
static void calibrateElectron(reco::GsfElectron &gsfElectron, const reco::GsfElectronRef &oldEleRef, const edm::ValueMap< float > &energyMap, const edm::ValueMap< float > &energyErrMap, const edm::ValueMap< float > &ecalEnergyMap, const edm::ValueMap< float > &ecalEnergyErrMap)
void relinkGsfElectronCore(reco::GsfElectron &gsfElectron, const std::map< reco::GsfElectronCoreRef, unsigned int > &gsfElectronCoreMap, const edm::OrphanHandle< reco::GsfElectronCoreCollection > &outGsfElectronCoreHandle)
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > gsfElectronFloatValueMapTs_
void linkConversionsByTrackRef(const edm::Handle< reco::ConversionCollection > &conversionHandle, const reco::GsfElectron &gsfElectron, reco::ConversionCollection &conversions, std::map< reco::ConversionRef, unsigned int > &conversionMap)
edm::EDGetTokenT< reco::PhotonCollection > ootPhotonT_
void setConversions(const reco::ConversionRefVector &conversions)
const std::string outOOTEBEEClusters_
std::vector< CaloCluster > CaloClusterCollection
collection of CaloCluster objects
void linkSuperCluster(const reco::SuperClusterRef &superCluster, std::map< reco::SuperClusterRef, unsigned int > &superClusterMap, reco::SuperClusterCollection &superClusters, const bool relink, std::unordered_set< unsigned int > &superClusterFullRelinkMap)
void linkCore(const T &core, U &cores, std::map< T, unsigned int > &coreMap)
const StringCutObjectSelector< reco::Photon > relinkPhotonSel_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > gsfElectronIdTs_
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEnergyErrT_
edm::Ref< PFCandidateCollection > PFCandidateRef
persistent reference to a PFCandidate
const CaloClusterPtrVector & preshowerClusters() const
const access to the preshower cluster list itself
const edm::EDGetTokenT< HBHERecHitCollection > hbheHits_
const bool applyPhotonCalibOnMC_
void relinkCaloClusters(reco::SuperCluster &superCluster, const std::map< reco::CaloClusterPtr, unsigned int > &ebeeClusterMap, const std::map< reco::CaloClusterPtr, unsigned int > &esClusterMap, const edm::OrphanHandle< reco::CaloClusterCollection > &outEBEEClusterHandle, const edm::OrphanHandle< reco::CaloClusterCollection > &outESClusterHandle)
const std::string outPhotons_
const std::string outGsfElectronPfCandMap_
void relinkSuperCluster(T &core, const std::map< reco::SuperClusterRef, unsigned int > &superClusterMap, const edm::OrphanHandle< reco::SuperClusterCollection > &outSuperClusterHandle)
const std::string outGsfElectronCores_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > photonFloatValueMapTs_
const edm::EDGetTokenT< reco::PhotonCollection > photonT_
void relinkPhotonCore(reco::Photon &photon, const std::map< reco::PhotonCoreRef, unsigned int > &photonCoreMap, const edm::OrphanHandle< reco::PhotonCoreCollection > &outPhotonCoreHandle)
void conversion(EventAux const &from, EventAuxiliary &to)
const std::string outSuperClusters_
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
const std::string outConversions_
T const * product() const
void clear()
Clear the vector.
std::vector< Photon > PhotonCollection
collectin of Photon objects
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > ootPhotonFloatValueMapTs_
const std::string outGsfElectrons_
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
const StringCutObjectSelector< reco::GsfElectron > slimRelinkGsfElectronSel_
void addDetIds(const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, CollType &detIdsToStore) const
virtual GsfElectronCoreRef core() const
const std::string outPhotonCores_
void setCorrectedEcalEnergy(float newEnergy)
void clear()
Clear the PtrVector.
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEcalEnergyErrT_
void linkCaloCluster(const reco::CaloClusterPtr &caloCluster, reco::CaloClusterCollection &caloClusters, std::map< reco::CaloClusterPtr, unsigned int > &caloClusterMap)
const std::string outEERecHits_
const StringCutObjectSelector< reco::Photon > slimRelinkOOTPhotonSel_
void produce(edm::Event &evt, const edm::EventSetup &es) final
const std::vector< std::string > outGsfElectronFloatValueMaps_
const std::string outPhotonPfCandMap_
const edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
bool isUninitialized() const
const CaloClusterPtr & seed() const
seed BasicCluster
std::vector< edm::EDGetTokenT< edm::ValueMap< bool > > > photonIdTs_
const std::string outOOTPhotonCores_
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEcalEnergyT_
const edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
const bool applyGsfElectronCalibOnMC_
ReducedEGProducer(const edm::ParameterSet &ps)
const edm::EDGetTokenT< reco::ConversionCollection > conversionT_