44 #include <unordered_set>
56 std::vector<edm::EDPutTokenT<T>>
vproduces(std::vector<std::string>
const&
labels) {
57 std::vector<edm::EDPutTokenT<T>> putTokens{};
58 putTokens.reserve(labels.size());
59 for (
const auto&
label : labels) {
60 putTokens.push_back(produces<T>(
label));
65 template <
typename T,
typename U>
66 void linkCore(
const T& core, U&
cores, std::map<T, unsigned int>& coreMap);
69 std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
72 std::unordered_set<unsigned int>& superClusterFullRelinkMap);
76 std::map<reco::ConversionRef, unsigned int>& conversionMap);
81 std::map<reco::ConversionRef, unsigned int>& conversionMap);
86 std::map<reco::ConversionRef, unsigned int>& conversionMap);
90 std::map<reco::ConversionRef, unsigned int>& conversionMap);
94 std::map<reco::CaloClusterPtr, unsigned int>& caloClusterMap);
98 std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
99 std::unordered_set<DetId>& rechitMap,
104 std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap);
108 std::unordered_set<DetId>& hcalDetIds);
111 const std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
112 const std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap,
116 template <
typename T>
118 const std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
122 const std::map<reco::GsfTrackRef, unsigned int>& gsfTrackMap,
127 const std::map<reco::ConversionRef, unsigned int>& conversionMap,
131 const std::map<reco::PhotonCoreRef, unsigned int>& photonCoreMap,
135 const std::map<reco::GsfElectronCoreRef, unsigned int>& gsfElectronCoreMap,
150 template <
typename T>
241 std::vector<edm::Handle<T>>
handles(tokens.size());
243 for (
const auto&
token : tokens) {
249 template <
class Handle,
class T>
251 std::vector<T>
const&
values,
257 typename MapType::Filler filler(oMap);
258 filler.insert(handle, values.begin(), values.end());
266 : photonT_(consumes(config.getParameter<edm::
InputTag>(
"photons"))),
267 gsfElectronT_(consumes(config.getParameter<edm::
InputTag>(
"gsfElectrons"))),
268 conversionT_(consumes(config.getParameter<edm::
InputTag>(
"conversions"))),
269 singleConversionT_(consumes(config.getParameter<edm::
InputTag>(
"singleConversions"))),
270 barrelEcalHits_(consumes(config.getParameter<edm::
InputTag>(
"barrelEcalHits"))),
271 endcapEcalHits_(consumes(config.getParameter<edm::
InputTag>(
"endcapEcalHits"))),
272 doPreshowerEcalHits_(!config.getParameter<edm::
InputTag>(
"preshowerEcalHits").
label().
empty()),
273 preshowerEcalHits_(doPreshowerEcalHits_
277 photonPfCandMapT_(consumes(config.getParameter<edm::
InputTag>(
"photonsPFValMap"))),
278 gsfElectronPfCandMapT_(consumes(config.getParameter<edm::
InputTag>(
"gsfElectronsPFValMap"))),
279 recoHIPhotonIsolationMapInputToken_{
289 outPhotons_{produces<reco::PhotonCollection>(
"reducedGedPhotons")},
302 outPhotonPfCandMap_{produces<edm::ValueMap<std::vector<reco::PFCandidateRef>>>(
"reducedPhotonPfCandMap")},
303 outGsfElectronPfCandMap_{
304 produces<edm::ValueMap<std::vector<reco::PFCandidateRef>>>(
"reducedGsfElectronPfCandMap")},
305 outPhotonIds_{vproduces<edm::ValueMap<bool>>(
config.getParameter<std::vector<std::string>>(
"photonIDOutput"))},
307 vproduces<edm::ValueMap<float>>(
config.getParameter<std::vector<std::string>>(
"gsfElectronIDOutput"))},
308 outPhotonFloatValueMaps_{
309 vproduces<edm::ValueMap<float>>(
config.getParameter<std::vector<std::string>>(
"photonFloatValueMapOutput"))},
310 outGsfElectronFloatValueMaps_{vproduces<edm::ValueMap<float>>(
311 config.getParameter<std::vector<std::string>>(
"gsfElectronFloatValueMapOutput"))},
316 slimRelinkOOTPhotonSel_(
config.getParameter<
std::string>(
"slimRelinkOOTPhotons")),
319 slimRelinkGsfElectronSel_(
config.getParameter<
std::string>(
"slimRelinkGsfElectrons")),
324 if (not aTag.label().empty())
325 ootPhotonT_ = consumes<reco::PhotonCollection>(aTag);
331 for (
const edm::InputTag&
tag :
config.getParameter<std::vector<edm::InputTag>>(
"gsfElectronIDSources")) {
335 for (
const edm::InputTag&
tag :
config.getParameter<std::vector<edm::InputTag>>(
"photonFloatValueMapSources")) {
339 for (
const edm::InputTag&
tag :
config.getParameter<std::vector<edm::InputTag>>(
"ootPhotonFloatValueMapSources")) {
343 for (
const edm::InputTag&
tag :
config.getParameter<std::vector<edm::InputTag>>(
"gsfElectronFloatValueMapSources")) {
348 setToken(photonCalibEnergyT_,
config,
"photonCalibEnergySource");
349 setToken(photonCalibEnergyErrT_,
config,
"photonCalibEnergyErrSource");
352 setToken(gsfElectronCalibEnergyT_,
config,
"gsfElectronCalibEnergySource");
353 setToken(gsfElectronCalibEnergyErrT_,
config,
"gsfElectronCalibEnergyErrSource");
354 setToken(gsfElectronCalibEcalEnergyT_,
config,
"gsfElectronCalibEcalEnergySource");
355 setToken(gsfElectronCalibEcalEnergyErrT_,
config,
"gsfElectronCalibEcalEnergyErrSource");
358 if (!ootPhotonT_.isUninitialized()) {
359 outOOTPhotons_ = produces<reco::PhotonCollection>(
"reducedOOTPhotons");
360 outOOTPhotonCores_ = produces<reco::PhotonCoreCollection>(
"reducedOOTPhotonCores");
361 outOOTSuperClusters_ = produces<reco::SuperClusterCollection>(
"reducedOOTSuperClusters");
362 outOOTEBEEClusters_ = produces<reco::CaloClusterCollection>(
"reducedOOTEBEEClusters");
363 outOOTESClusters_ = produces<reco::CaloClusterCollection>(
"reducedOOTESClusters");
365 if (doPreshowerEcalHits_) {
366 outESRecHits_ = produces<EcalRecHitCollection>(
"reducedESRecHits");
368 if (!ootPhotonT_.isUninitialized()) {
369 outOOTPhotonFloatValueMaps_ =
370 vproduces<edm::ValueMap<float>>(
config.getParameter<std::vector<std::string>>(
"ootPhotonFloatValueMapOutput"));
372 if (!recoHIPhotonIsolationMapInputToken_.isUninitialized()) {
373 recoHIPhotonIsolationMapOutputName_ =
374 produces<reco::HIPhotonIsolationMap>(
config.getParameter<
std::string>(
"hiPhotonIsolationMapOutput"));
383 auto photonHandle =
event.getHandle(
photonT_);
385 auto ootPhotonHandle =
394 auto preshowerHitHandle =
397 auto hbheHitHandle =
event.getHandle(
hbheHits_);
401 auto photonIdHandles = getHandles(event,
photonIdTs_);
407 : std::vector<edm::Handle<edm::ValueMap<float>>>{};
454 std::map<reco::PhotonCoreRef, unsigned int> photonCoreMap;
455 std::map<reco::PhotonCoreRef, unsigned int> ootPhotonCoreMap;
456 std::map<reco::GsfElectronCoreRef, unsigned int> gsfElectronCoreMap;
457 std::map<reco::GsfTrackRef, unsigned int> gsfTrackMap;
458 std::map<reco::ConversionRef, unsigned int> conversionMap;
459 std::map<reco::ConversionRef, unsigned int> singleConversionMap;
460 std::map<reco::SuperClusterRef, unsigned int> superClusterMap;
461 std::map<reco::CaloClusterPtr, unsigned int> ebeeClusterMap;
462 std::map<reco::CaloClusterPtr, unsigned int> esClusterMap;
463 std::map<reco::SuperClusterRef, unsigned int> ootSuperClusterMap;
464 std::map<reco::CaloClusterPtr, unsigned int> ootEbeeClusterMap;
465 std::map<reco::CaloClusterPtr, unsigned int> ootEsClusterMap;
466 std::unordered_set<DetId> rechitMap;
467 std::unordered_set<DetId> hcalRechitMap;
469 std::unordered_set<unsigned int> superClusterFullRelinkMap;
470 std::unordered_set<unsigned int> ootSuperClusterFullRelinkMap;
473 std::vector<std::vector<reco::PFCandidateRef>> pfCandIsoPairVecPho;
474 std::vector<std::vector<reco::PFCandidateRef>> pfCandIsoPairVecEle;
477 std::vector<std::vector<bool>> photonIdVals(photonIdHandles.size());
478 std::vector<std::vector<float>> gsfElectronIdVals(gsfElectronIdHandles.size());
479 std::vector<std::vector<float>> photonFloatValueMapVals(photonFloatValueMapHandles.size());
480 std::vector<std::vector<float>> ootPhotonFloatValueMapVals(ootPhotonFloatValueMapHandles.size());
481 std::vector<std::vector<float>> gsfElectronFloatValueMapVals(gsfElectronFloatValueMapHandles.size());
487 std::vector<reco::HIPhotonIsolation> recoHIPhotonIsolationMapInputVals;
491 for (
const auto& photon : *photonHandle) {
495 photons.push_back(photon);
496 auto& newPhoton = photons.back();
499 calibratePhoton(newPhoton, photonref, *photonCalibEnergyHandle, *photonCalibEnergyErrHandle);
510 pfCandIsoPairVecPho.push_back((*photonPfCandMapHandle)[photonref]);
514 for (
const auto& photonIdHandle : photonIdHandles) {
515 photonIdVals[subindex++].push_back((*photonIdHandle)[photonref]);
519 for (
const auto& photonFloatValueMapHandle : photonFloatValueMapHandles) {
520 photonFloatValueMapVals[subindex++].push_back((*photonFloatValueMapHandle)[photonref]);
525 recoHIPhotonIsolationMapInputVals.push_back((*recoHIPhotonIsolationMapInputValueMap)[photonref]);
530 linkCore(photonCore, photonCores, photonCoreMap);
541 linkSuperCluster(superCluster, superClusterMap, superClusters, relink, superClusterFullRelinkMap);
552 linkConversions(singleconvrefs, singleConversions, singleConversionMap);
555 linkHcalHits(*photon.superCluster(), *hbheHitHandle, hcalRechitMap);
564 for (
const auto& ootPhoton : *ootPhotonHandle) {
573 ootPhotons.push_back(ootPhoton);
577 for (
const auto& ootPhotonFloatValueMapHandle : ootPhotonFloatValueMapHandles) {
578 ootPhotonFloatValueMapVals[subindex++].push_back((*ootPhotonFloatValueMapHandle)[ootPhotonref]);
583 linkCore(ootPhotonCore, ootPhotonCores, ootPhotonCoreMap);
593 linkSuperCluster(ootSuperCluster, ootSuperClusterMap, ootSuperClusters, relink, ootSuperClusterFullRelinkMap);
595 linkHcalHits(*ootPhoton.superCluster(), *hbheHitHandle, hcalRechitMap);
601 for (
const auto& gsfElectron : *gsfElectronHandle) {
605 gsfElectrons.push_back(gsfElectron);
606 auto& newGsfElectron = gsfElectrons.back();
610 *gsfElectronCalibEnergyHandle,
611 *gsfElectronCalibEnergyErrHandle,
612 *gsfElectronCalibEcalEnergyHandle,
613 *gsfElectronCalibEcalEnergyErrHandle);
618 gsfElectrons.pop_back();
622 pfCandIsoPairVecEle.push_back((*gsfElectronPfCandMapHandle)[gsfElectronref]);
626 for (
const auto& gsfElectronIdHandle : gsfElectronIdHandles) {
627 gsfElectronIdVals[subindex++].push_back((*gsfElectronIdHandle)[gsfElectronref]);
631 for (
const auto& gsfElectronFloatValueMapHandle : gsfElectronFloatValueMapHandles) {
632 gsfElectronFloatValueMapVals[subindex++].push_back((*gsfElectronFloatValueMapHandle)[gsfElectronref]);
636 linkCore(gsfElectronCore, gsfElectronCores, gsfElectronCoreMap);
641 if (!gsfTrackMap.count(gsfTrack)) {
642 gsfTracks.push_back(*gsfTrack);
643 gsfTrackMap[gsfTrack] = gsfTracks.size() - 1;
647 for (
auto const& ambigGsfTrack : gsfElectron.ambiguousGsfTracks()) {
648 if (!gsfTrackMap.count(ambigGsfTrack)) {
649 gsfTracks.push_back(*ambigGsfTrack);
650 gsfTrackMap[ambigGsfTrack] = gsfTracks.size() - 1;
662 linkSuperCluster(superCluster, superClusterMap, superClusters, relink, superClusterFullRelinkMap);
673 linkConversions(singleconvrefs, singleConversions, singleConversionMap);
682 linkHcalHits(*gsfElectron.superCluster(), *hbheHitHandle, hcalRechitMap);
687 for (
auto& superCluster : superClusters) {
693 bool fullrelink = superClusterFullRelinkMap.count(index++);
696 superCluster.clearHitsAndFractions();
721 for (
auto& ootSuperCluster : ootSuperClusters) {
727 bool fullrelink = ootSuperClusterFullRelinkMap.count(index++);
730 ootSuperCluster.clearHitsAndFractions();
749 for (
const EcalRecHit& rechit : *barrelHitHandle) {
750 if (rechitMap.count(rechit.detid())) {
755 for (
const EcalRecHit& rechit : *endcapHitHandle) {
756 if (rechitMap.count(rechit.detid())) {
765 for (
const EcalRecHit& rechit : *preshowerHitHandle) {
766 if (rechitMap.count(rechit.detid())) {
773 for (
const HBHERecHit& rechit : *hbheHitHandle) {
774 if (hcalRechitMap.count(rechit.detid())) {
788 relinkCaloClusters(superCluster, ebeeClusterMap, esClusterMap, outEBEEClusterHandle, outESClusterHandle);
801 ootSuperCluster, ootEbeeClusterMap, ootEsClusterMap, outOOTEBEEClusterHandle, outOOTESClusterHandle);
863 std::vector<reco::GsfTrackRef> ambigTracksInThisElectron;
865 for (
auto const& igsf : gsfElectron.ambiguousGsfTracks()) {
866 ambigTracksInThisElectron.push_back(igsf);
870 gsfElectron.clearAmbiguousGsfTracks();
873 for (
const auto& it : ambigTracksInThisElectron) {
874 const auto& gsftkmapped = gsfTrackMap.find(it);
876 if (gsftkmapped != gsfTrackMap.end()) {
878 gsfElectron.addAmbiguousGsfTrack(gsftkref);
880 throw cms::Exception(
"There must be a problem with linking and mapping of ambiguous gsf tracks...");
883 if (gsfElectron.ambiguousGsfTracksSize() > 0)
884 gsfElectron.setAmbiguous(
true);
886 ambigTracksInThisElectron.clear();
900 fillerPhotons.insert(outPhotonHandle, pfCandIsoPairVecPho.begin(), pfCandIsoPairVecPho.end());
901 fillerPhotons.fill();
905 fillerGsfElectrons.insert(outGsfElectronHandle, pfCandIsoPairVecEle.begin(), pfCandIsoPairVecEle.end());
906 fillerGsfElectrons.fill();
913 for (
auto const& vals : photonIdVals) {
914 emplaceValueMap(outPhotonHandle, vals, event,
outPhotonIds_[index++]);
919 for (
auto const& vals : gsfElectronIdVals) {
925 for (
auto const& vals : photonFloatValueMapVals) {
932 for (
auto const& vals : ootPhotonFloatValueMapVals) {
944 for (
auto const& vals : gsfElectronFloatValueMapVals) {
949 template <
typename T,
typename U>
951 if (!coreMap.count(core)) {
952 cores.push_back(*core);
953 coreMap[core] = cores.size() - 1;
958 std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
961 std::unordered_set<unsigned int>& superClusterFullRelinkMap) {
962 const auto& mappedsc = superClusterMap.find(superCluster);
965 unsigned int mappedscidx = 0;
966 if (mappedsc == superClusterMap.end()) {
967 superClusters.push_back(*superCluster);
968 mappedscidx = superClusters.size() - 1;
969 superClusterMap[superCluster] = mappedscidx;
971 mappedscidx = mappedsc->second;
976 superClusterFullRelinkMap.insert(mappedscidx);
981 std::map<reco::ConversionRef, unsigned int>& conversionMap) {
982 for (
const auto& convref : convrefs) {
990 std::map<reco::ConversionRef, unsigned int>& conversionMap) {
992 for (
const auto&
conversion : *conversionHandle) {
1006 std::map<reco::ConversionRef, unsigned int>& conversionMap) {
1008 for (
const auto&
conversion : *conversionHandle) {
1021 std::map<reco::ConversionRef, unsigned int>& conversionMap) {
1022 if (!conversionMap.count(convref)) {
1023 conversions.push_back(*convref);
1024 conversionMap[convref] = conversions.size() - 1;
1030 std::map<reco::CaloClusterPtr, unsigned int>& caloClusterMap) {
1031 if (!caloClusterMap.count(caloCluster)) {
1032 caloClusters.push_back(*caloCluster);
1033 caloClusterMap[caloCluster] = caloClusters.size() - 1;
1039 std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
1040 std::unordered_set<DetId>& rechitMap,
1045 std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap) {
1046 for (
const auto& cluster : superCluster.
clusters()) {
1049 for (
const auto& hitfrac : cluster->hitsAndFractions()) {
1050 rechitMap.insert(hitfrac.first);
1053 bool barrel = cluster->hitsAndFractions().front().first.subdetId() ==
EcalBarrel;
1055 DetId seed = EcalClusterTools::getMaximum(*cluster, rhcol).first;
1057 std::vector<DetId> dets5x5 =
1059 for (
const auto& detid : dets5x5) {
1060 rechitMap.insert(detid);
1066 for (
const auto& hitfrac : cluster->hitsAndFractions()) {
1067 rechitMap.insert(hitfrac.first);
1074 std::unordered_set<DetId>& hcalDetIds) {
1079 const std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
1080 const std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap,
1084 const auto& seedmapped = ebeeClusterMap.find(superCluster.
seed());
1085 if (seedmapped != ebeeClusterMap.end()) {
1088 superCluster.
setSeed(clusptr);
1093 for (
const auto& cluster : superCluster.
clusters()) {
1094 const auto& clustermapped = ebeeClusterMap.find(cluster);
1095 if (clustermapped != ebeeClusterMap.end()) {
1105 if (!clusters.
empty()) {
1112 const auto& clustermapped = esClusterMap.find(cluster);
1113 if (clustermapped != esClusterMap.end()) {
1123 if (!esclusters.
empty()) {
1128 template <
typename T>
1131 const std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
1133 const auto& scmapped = superClusterMap.find(core.superCluster());
1134 if (scmapped != superClusterMap.end()) {
1137 core.setSuperCluster(scref);
1142 const std::map<reco::GsfTrackRef, unsigned int>& gsfTrackMap,
1144 const auto& gsftkmapped = gsfTrackMap.find(gsfElectronCore.
gsfTrack());
1145 if (gsftkmapped != gsfTrackMap.end()) {
1153 const std::map<reco::ConversionRef, unsigned int>& conversionMap,
1156 for (
const auto& convref : convrefs) {
1157 const auto& convmapped = conversionMap.find(convref);
1158 if (convmapped != conversionMap.end()) {
1163 outconvrefs.
clear();
1167 if (!outconvrefs.
empty()) {
1173 const std::map<reco::PhotonCoreRef, unsigned int>& photonCoreMap,
1175 const auto& coremapped = photonCoreMap.find(photon.
photonCore());
1176 if (coremapped != photonCoreMap.end()) {
1185 const std::map<reco::GsfElectronCoreRef, unsigned int>& gsfElectronCoreMap,
1187 const auto& coremapped = gsfElectronCoreMap.find(gsfElectron.
core());
1188 if (coremapped != gsfElectronCoreMap.end()) {
1199 float newEnergy = energyMap[oldPhoRef];
1200 float newEnergyErr = energyErrMap[oldPhoRef];
1201 photon.
setCorrectedEnergy(reco::Photon::P4type::regression2, newEnergy, newEnergyErr,
true);
1210 const float newEnergy = energyMap[oldEleRef];
1211 const float newEnergyErr = energyErrMap[oldEleRef];
1212 const float newEcalEnergy = ecalEnergyMap[oldEleRef];
1213 const float newEcalEnergyErr = ecalEnergyErrMap[oldEleRef];
1217 const float corr = newEnergy / oldP4.E();
const bool doPreshowerEcalHits_
void setPreshowerClusters(const CaloClusterPtrVector &clusters)
edm::EDPutTokenT< EcalRecHitCollection > outESRecHits_
void relinkGsfTrack(reco::GsfElectronCore &electroncore, const std::map< reco::GsfTrackRef, unsigned int > &gsfTrackMap, const edm::OrphanHandle< reco::GsfTrackCollection > &outGsfTrackHandle)
const StringCutObjectSelector< reco::Photon > relinkOOTPhotonSel_
edm::EDPutTokenT< reco::PhotonCollection > outOOTPhotons_
const edm::EDGetTokenT< reco::HIPhotonIsolationMap > recoHIPhotonIsolationMapInputToken_
applyGsfElectronCalibOnData_(config.getParameter< bool >("applyGsfElectronCalibOnData"))
const edm::EDGetTokenT< reco::GsfElectronCollection > gsfElectronT_
const edm::EDPutTokenT< EcalRecHitCollection > outEERecHits_
const edm::EDPutTokenT< EcalRecHitCollection > outEBRecHits_
float trackMomentumError() const
void setCore(const reco::GsfElectronCoreRef &core)
const bool applyPhotonCalibOnData_
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEnergyT_
const edm::EDPutTokenT< reco::GsfTrackCollection > outGsfTracks_
const StringCutObjectSelector< reco::Photon > slimRelinkPhotonSel_
void setGsfTrack(const GsfTrackRef &gsfTrack)
const edm::EDGetTokenT< reco::ConversionCollection > singleConversionT_
const LorentzVector & p4(P4Kind kind) const
void setCorrectedEnergy(P4type type, float E, float dE, bool toCand=true)
EGHcalRecHitSelector hcalHitSel_
const std::vector< edm::EDPutTokenT< edm::ValueMap< float > > > outGsfElectronFloatValueMaps_
edm::EDPutTokenT< reco::PhotonCoreCollection > outOOTPhotonCores_
#define DEFINE_FWK_MODULE(type)
void push_back(Ptr< T > const &iPtr)
applyPhotonCalibOnData_(config.getParameter< bool >("applyPhotonCalibOnData"))
edm::EDGetTokenT< edm::ValueMap< float > > photonCalibEnergyT_
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
const std::vector< edm::EDPutTokenT< edm::ValueMap< bool > > > outPhotonIds_
bool empty() const
Is the RefVector empty.
const GsfTrackRef & gsfTrack() const
constexpr bool isUninitialized() const noexcept
void setToken(edm::EDGetTokenT< T > &token, const edm::ParameterSet &config, const std::string &name)
const edm::EDPutTokenT< reco::ConversionCollection > outConversions_
void setup(const edm::EventSetup &iSetup)
void push_back(T const &t)
const StringCutObjectSelector< reco::GsfElectron > keepGsfElectronSel_
void linkHcalHits(const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, std::unordered_set< DetId > &hcalDetIds)
void beginRun(edm::Run const &, const edm::EventSetup &) final
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_
edm::EDPutTokenT< reco::SuperClusterCollection > outOOTSuperClusters_
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_
void relinkConversions(reco::PhotonCore &photonCore, const reco::ConversionRefVector &convrefs, const std::map< reco::ConversionRef, unsigned int > &conversionMap, const edm::OrphanHandle< reco::ConversionCollection > &outConversionHandle)
bool getData(T &iHolder) const
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
edm::EDPutTokenT< reco::CaloClusterCollection > outOOTESClusters_
void setCorrectedEcalEnergyError(float newEnergyError)
const edm::EDPutTokenT< reco::GsfElectronCollection > outGsfElectrons_
void setPhotonCore(const reco::PhotonCoreRef &photonCore)
const edm::EDPutTokenT< reco::CaloClusterCollection > outEBEEClusters_
std::vector< BaseVolumeHandle * > handles
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
const StringCutObjectSelector< reco::Photon > keepOOTPhotonSel_
edm::EDPutTokenT< reco::CaloClusterCollection > outOOTEBEEClusters_
const edm::EDPutTokenT< reco::CaloClusterCollection > outESClusters_
const edm::EDPutTokenT< reco::GsfElectronCoreCollection > outGsfElectronCores_
const edm::EDPutTokenT< reco::PhotonCoreCollection > outPhotonCores_
std::vector< GsfElectronCore > GsfElectronCoreCollection
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
const edm::EDPutTokenT< HBHERecHitCollection > outHBHERecHits_
std::vector< edm::EDPutTokenT< edm::ValueMap< float > > > outOOTPhotonFloatValueMaps_
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)
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)
static void calibratePhoton(reco::Photon &photon, const reco::PhotonRef &oldPhoRef, const edm::ValueMap< float > &energyMap, const edm::ValueMap< float > &energyErrMap)
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_
const edm::EDPutTokenT< reco::SuperClusterCollection > outSuperClusters_
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::vector< edm::EDPutTokenT< edm::ValueMap< float > > > outGsfElectronIds_
std::vector< edm::EDPutTokenT< T > > vproduces(std::vector< std::string > const &labels)
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 relinkSuperCluster(T &core, const std::map< reco::SuperClusterRef, unsigned int > &superClusterMap, const edm::OrphanHandle< reco::SuperClusterCollection > &outSuperClusterHandle)
const edm::EDPutTokenT< reco::PhotonCollection > outPhotons_
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)
applyPhotonCalibOnMC_(config.getParameter< bool >("applyPhotonCalibOnMC"))
void conversion(EventAux const &from, EventAuxiliary &to)
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
T const * product() const
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
void clear()
Clear the vector.
applyGsfElectronCalibOnMC_(config.getParameter< bool >("applyGsfElectronCalibOnMC"))
std::vector< Photon > PhotonCollection
collectin of Photon objects
const edm::EDPutTokenT< reco::ConversionCollection > outSingleConversions_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > ootPhotonFloatValueMapTs_
T getParameter(std::string const &) const
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
const edm::EDPutTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > outGsfElectronPfCandMap_
virtual GsfElectronCoreRef core() const
edm::EDPutTokenT< reco::HIPhotonIsolationMap > recoHIPhotonIsolationMapOutputName_
std::vector< PhotonCore > PhotonCoreCollection
collectin of PhotonCore objects
void setCorrectedEcalEnergy(float newEnergy)
tuple config
parse the configuration file
void clear()
Clear the PtrVector.
const std::vector< edm::EDPutTokenT< edm::ValueMap< float > > > outPhotonFloatValueMaps_
edm::EDGetTokenT< edm::ValueMap< float > > gsfElectronCalibEcalEnergyErrT_
void linkCaloCluster(const reco::CaloClusterPtr &caloCluster, reco::CaloClusterCollection &caloClusters, std::map< reco::CaloClusterPtr, unsigned int > &caloClusterMap)
const StringCutObjectSelector< reco::Photon > slimRelinkOOTPhotonSel_
void produce(edm::Event &evt, const edm::EventSetup &es) final
const edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
const CaloClusterPtr & seed() const
seed BasicCluster
std::vector< edm::EDGetTokenT< edm::ValueMap< bool > > > photonIdTs_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopology_
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_
const edm::EDPutTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > outPhotonPfCandMap_
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, CaloTopology const &caloTopology, reco::CaloClusterCollection &esClusters, std::map< reco::CaloClusterPtr, unsigned int > &esClusterMap)