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());
60 putTokens.push_back(produces<T>(
label));
65 template <
typename T,
typename U>
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>
246 std::vector<edm::Handle<T>>
handles(tokens.size());
248 for (
const auto&
token : tokens) {
254 template <
class Handle,
class T>
256 std::vector<T>
const&
values,
262 typename MapType::Filler
filler(oMap);
271 : superclusterT_(consumes(
config.getParameter<
edm::
InputTag>(
"pflowSuperclusters"))),
275 singleConversionT_(consumes(
config.getParameter<
edm::
InputTag>(
"singleConversions"))),
279 preshowerEcalHits_(doPreshowerEcalHits_
283 photonPfCandMapT_(consumes(
config.getParameter<
edm::
InputTag>(
"photonsPFValMap"))),
284 gsfElectronPfCandMapT_(consumes(
config.getParameter<
edm::
InputTag>(
"gsfElectronsPFValMap"))),
285 recoHIPhotonIsolationMapInputToken_{
287 ? consumes<reco::HIPhotonIsolationMap>(
config.getParameter<
edm::InputTag>(
"hiPhotonIsolationMapInput"))
289 scPtMin_(
config.getParameter<
double>(
"keepPfSuperclusterPtMin")),
290 scAbsetaMax_(
config.getParameter<
double>(
"keepPfSuperclusterAbsetaMax")),
291 relinkSuperclusterPtMin_(
config.getParameter<
double>(
"relinkSuperclusterPtMin")),
293 applyPhotonCalibOnData_(
config.getParameter<
bool>(
"applyPhotonCalibOnData")),
294 applyPhotonCalibOnMC_(
config.getParameter<
bool>(
"applyPhotonCalibOnMC")),
295 applyGsfElectronCalibOnData_(
config.getParameter<
bool>(
"applyGsfElectronCalibOnData")),
296 applyGsfElectronCalibOnMC_(
config.getParameter<
bool>(
"applyGsfElectronCalibOnMC")),
298 outPhotons_{produces<reco::PhotonCollection>(
"reducedGedPhotons")},
299 outPhotonCores_{produces<reco::PhotonCoreCollection>(
"reducedGedPhotonCores")},
300 outGsfElectrons_{produces<reco::GsfElectronCollection>(
"reducedGedGsfElectrons")},
301 outGsfElectronCores_{produces<reco::GsfElectronCoreCollection>(
"reducedGedGsfElectronCores")},
302 outGsfTracks_{produces<reco::GsfTrackCollection>(
"reducedGsfTracks")},
303 outConversions_{produces<reco::ConversionCollection>(
"reducedConversions")},
304 outSingleConversions_{produces<reco::ConversionCollection>(
"reducedSingleLegConversions")},
305 outSuperClusters_{produces<reco::SuperClusterCollection>(
"reducedSuperClusters")},
306 outEBEEClusters_{produces<reco::CaloClusterCollection>(
"reducedEBEEClusters")},
307 outESClusters_{produces<reco::CaloClusterCollection>(
"reducedESClusters")},
308 outEBRecHits_{produces<EcalRecHitCollection>(
"reducedEBRecHits")},
309 outEERecHits_{produces<EcalRecHitCollection>(
"reducedEERecHits")},
310 outHBHERecHits_{produces<HBHERecHitCollection>(
"reducedHBHEHits")},
311 outPhotonPfCandMap_{produces<edm::ValueMap<std::vector<reco::PFCandidateRef>>>(
"reducedPhotonPfCandMap")},
312 outGsfElectronPfCandMap_{
313 produces<edm::ValueMap<std::vector<reco::PFCandidateRef>>>(
"reducedGsfElectronPfCandMap")},
314 outPhotonIds_{vproduces<edm::ValueMap<bool>>(
config.getParameter<std::vector<std::string>>(
"photonIDOutput"))},
316 vproduces<edm::ValueMap<float>>(
config.getParameter<std::vector<std::string>>(
"gsfElectronIDOutput"))},
317 outPhotonFloatValueMaps_{
318 vproduces<edm::ValueMap<float>>(
config.getParameter<std::vector<std::string>>(
"photonFloatValueMapOutput"))},
319 outGsfElectronFloatValueMaps_{vproduces<edm::ValueMap<float>>(
320 config.getParameter<std::vector<std::string>>(
"gsfElectronFloatValueMapOutput"))},
325 slimRelinkOOTPhotonSel_(
config.getParameter<
std::string>(
"slimRelinkOOTPhotons")),
328 slimRelinkGsfElectronSel_(
config.getParameter<
std::string>(
"slimRelinkGsfElectrons")),
333 if (not aTag.label().empty())
334 ootPhotonT_ = consumes<reco::PhotonCollection>(aTag);
340 for (
const edm::InputTag&
tag :
config.getParameter<std::vector<edm::InputTag>>(
"gsfElectronIDSources")) {
344 for (
const edm::InputTag&
tag :
config.getParameter<std::vector<edm::InputTag>>(
"photonFloatValueMapSources")) {
348 for (
const edm::InputTag&
tag :
config.getParameter<std::vector<edm::InputTag>>(
"ootPhotonFloatValueMapSources")) {
352 for (
const edm::InputTag&
tag :
config.getParameter<std::vector<edm::InputTag>>(
"gsfElectronFloatValueMapSources")) {
356 if (applyPhotonCalibOnData_ || applyPhotonCalibOnMC_) {
357 setToken(photonCalibEnergyT_,
config,
"photonCalibEnergySource");
358 setToken(photonCalibEnergyErrT_,
config,
"photonCalibEnergyErrSource");
360 if (applyGsfElectronCalibOnData_ || applyGsfElectronCalibOnMC_) {
361 setToken(gsfElectronCalibEnergyT_,
config,
"gsfElectronCalibEnergySource");
362 setToken(gsfElectronCalibEnergyErrT_,
config,
"gsfElectronCalibEnergyErrSource");
363 setToken(gsfElectronCalibEcalEnergyT_,
config,
"gsfElectronCalibEcalEnergySource");
364 setToken(gsfElectronCalibEcalEnergyErrT_,
config,
"gsfElectronCalibEcalEnergyErrSource");
367 if (!ootPhotonT_.isUninitialized()) {
368 outOOTPhotons_ = produces<reco::PhotonCollection>(
"reducedOOTPhotons");
369 outOOTPhotonCores_ = produces<reco::PhotonCoreCollection>(
"reducedOOTPhotonCores");
370 outOOTSuperClusters_ = produces<reco::SuperClusterCollection>(
"reducedOOTSuperClusters");
371 outOOTEBEEClusters_ = produces<reco::CaloClusterCollection>(
"reducedOOTEBEEClusters");
372 outOOTESClusters_ = produces<reco::CaloClusterCollection>(
"reducedOOTESClusters");
374 if (doPreshowerEcalHits_) {
375 outESRecHits_ = produces<EcalRecHitCollection>(
"reducedESRecHits");
377 if (!ootPhotonT_.isUninitialized()) {
378 outOOTPhotonFloatValueMaps_ =
379 vproduces<edm::ValueMap<float>>(
config.getParameter<std::vector<std::string>>(
"ootPhotonFloatValueMapOutput"));
381 if (!recoHIPhotonIsolationMapInputToken_.isUninitialized()) {
382 recoHIPhotonIsolationMapOutputName_ =
383 produces<reco::HIPhotonIsolationMap>(
config.getParameter<
std::string>(
"hiPhotonIsolationMapOutput"));
393 auto photonHandle =
event.getHandle(
photonT_);
395 auto ootPhotonHandle =
404 auto preshowerHitHandle =
407 auto hbheHitHandle =
event.getHandle(
hbheHits_);
417 : std::vector<edm::Handle<edm::ValueMap<float>>>{};
464 std::map<reco::PhotonCoreRef, unsigned int> photonCoreMap;
465 std::map<reco::PhotonCoreRef, unsigned int> ootPhotonCoreMap;
466 std::map<reco::GsfElectronCoreRef, unsigned int> gsfElectronCoreMap;
467 std::map<reco::GsfTrackRef, unsigned int> gsfTrackMap;
468 std::map<reco::ConversionRef, unsigned int> conversionMap;
469 std::map<reco::ConversionRef, unsigned int> singleConversionMap;
470 std::map<reco::SuperClusterRef, unsigned int> superClusterMap;
471 std::map<reco::CaloClusterPtr, unsigned int> ebeeClusterMap;
472 std::map<reco::CaloClusterPtr, unsigned int> esClusterMap;
473 std::map<reco::SuperClusterRef, unsigned int> ootSuperClusterMap;
474 std::map<reco::CaloClusterPtr, unsigned int> ootEbeeClusterMap;
475 std::map<reco::CaloClusterPtr, unsigned int> ootEsClusterMap;
476 std::unordered_set<DetId> rechitMap;
477 std::unordered_set<DetId> hcalRechitMap;
479 std::unordered_set<unsigned int> superClusterFullRelinkMap;
480 std::unordered_set<unsigned int> ootSuperClusterFullRelinkMap;
483 std::vector<std::vector<reco::PFCandidateRef>> pfCandIsoPairVecPho;
484 std::vector<std::vector<reco::PFCandidateRef>> pfCandIsoPairVecEle;
487 std::vector<std::vector<bool>> photonIdVals(photonIdHandles.size());
488 std::vector<std::vector<float>> gsfElectronIdVals(gsfElectronIdHandles.size());
489 std::vector<std::vector<float>> photonFloatValueMapVals(photonFloatValueMapHandles.size());
490 std::vector<std::vector<float>> ootPhotonFloatValueMapVals(ootPhotonFloatValueMapHandles.size());
491 std::vector<std::vector<float>> gsfElectronFloatValueMapVals(gsfElectronFloatValueMapHandles.size());
497 std::vector<reco::HIPhotonIsolation> recoHIPhotonIsolationMapInputVals;
501 for (
const auto&
photon : *photonHandle) {
506 auto& newPhoton =
photons.back();
509 calibratePhoton(newPhoton, photonref, *photonCalibEnergyHandle, *photonCalibEnergyErrHandle);
520 pfCandIsoPairVecPho.push_back((*photonPfCandMapHandle)[photonref]);
524 for (
const auto& photonIdHandle : photonIdHandles) {
525 photonIdVals[subindex++].push_back((*photonIdHandle)[photonref]);
529 for (
const auto& photonFloatValueMapHandle : photonFloatValueMapHandles) {
530 photonFloatValueMapVals[subindex++].push_back((*photonFloatValueMapHandle)[photonref]);
535 recoHIPhotonIsolationMapInputVals.push_back((*recoHIPhotonIsolationMapInputValueMap)[photonref]);
574 for (
const auto& ootPhoton : *ootPhotonHandle) {
587 for (
const auto& ootPhotonFloatValueMapHandle : ootPhotonFloatValueMapHandles) {
588 ootPhotonFloatValueMapVals[subindex++].push_back((*ootPhotonFloatValueMapHandle)[ootPhotonref]);
603 linkSuperCluster(ootSuperCluster, ootSuperClusterMap, ootSuperClusters, relink, ootSuperClusterFullRelinkMap);
605 linkHcalHits(*ootPhoton.superCluster(), *hbheHitHandle, hcalRechitMap);
611 for (
const auto& gsfElectron : *gsfElectronHandle) {
620 *gsfElectronCalibEnergyHandle,
621 *gsfElectronCalibEnergyErrHandle,
622 *gsfElectronCalibEcalEnergyHandle,
623 *gsfElectronCalibEcalEnergyErrHandle);
632 pfCandIsoPairVecEle.push_back((*gsfElectronPfCandMapHandle)[gsfElectronref]);
636 for (
const auto& gsfElectronIdHandle : gsfElectronIdHandles) {
637 gsfElectronIdVals[subindex++].push_back((*gsfElectronIdHandle)[gsfElectronref]);
641 for (
const auto& gsfElectronFloatValueMapHandle : gsfElectronFloatValueMapHandles) {
642 gsfElectronFloatValueMapVals[subindex++].push_back((*gsfElectronFloatValueMapHandle)[gsfElectronref]);
646 linkCore(gsfElectronCore, gsfElectronCores, gsfElectronCoreMap);
651 if (!gsfTrackMap.count(gsfTrack)) {
653 gsfTrackMap[gsfTrack] =
gsfTracks.size() - 1;
657 for (
auto const& ambigGsfTrack : gsfElectron.ambiguousGsfTracks()) {
658 if (!gsfTrackMap.count(ambigGsfTrack)) {
660 gsfTrackMap[ambigGsfTrack] =
gsfTracks.size() - 1;
692 linkHcalHits(*gsfElectron.superCluster(), *hbheHitHandle, hcalRechitMap);
697 for (
const auto& superCluster : *scHandle) {
700 const double superclusPt = superCluster.energy() / std::cosh(superCluster.eta());
722 bool fullrelink = superClusterFullRelinkMap.count(
index++);
725 superCluster.clearHitsAndFractions();
750 for (
auto& ootSuperCluster : ootSuperClusters) {
756 bool fullrelink = ootSuperClusterFullRelinkMap.count(
index++);
759 ootSuperCluster.clearHitsAndFractions();
778 for (
const EcalRecHit& rechit : *barrelHitHandle) {
779 if (rechitMap.count(rechit.detid())) {
784 for (
const EcalRecHit& rechit : *endcapHitHandle) {
785 if (rechitMap.count(rechit.detid())) {
794 for (
const EcalRecHit& rechit : *preshowerHitHandle) {
795 if (rechitMap.count(rechit.detid())) {
802 for (
const HBHERecHit& rechit : *hbheHitHandle) {
803 if (hcalRechitMap.count(rechit.detid())) {
817 relinkCaloClusters(superCluster, ebeeClusterMap, esClusterMap, outEBEEClusterHandle, outESClusterHandle);
830 ootSuperCluster, ootEbeeClusterMap, ootEsClusterMap, outOOTEBEEClusterHandle, outOOTESClusterHandle);
892 std::vector<reco::GsfTrackRef> ambigTracksInThisElectron;
894 for (
auto const& igsf : gsfElectron.ambiguousGsfTracks()) {
895 ambigTracksInThisElectron.push_back(igsf);
899 gsfElectron.clearAmbiguousGsfTracks();
902 for (
const auto&
it : ambigTracksInThisElectron) {
903 const auto& gsftkmapped = gsfTrackMap.find(
it);
905 if (gsftkmapped != gsfTrackMap.end()) {
907 gsfElectron.addAmbiguousGsfTrack(gsftkref);
909 throw cms::Exception(
"There must be a problem with linking and mapping of ambiguous gsf tracks...");
912 if (gsfElectron.ambiguousGsfTracksSize() > 0)
913 gsfElectron.setAmbiguous(
true);
915 ambigTracksInThisElectron.clear();
929 fillerPhotons.insert(outPhotonHandle, pfCandIsoPairVecPho.begin(), pfCandIsoPairVecPho.end());
930 fillerPhotons.fill();
934 fillerGsfElectrons.insert(outGsfElectronHandle, pfCandIsoPairVecEle.begin(), pfCandIsoPairVecEle.end());
935 fillerGsfElectrons.fill();
942 for (
auto const& vals : photonIdVals) {
948 for (
auto const& vals : gsfElectronIdVals) {
954 for (
auto const& vals : photonFloatValueMapVals) {
961 for (
auto const& vals : ootPhotonFloatValueMapVals) {
973 for (
auto const& vals : gsfElectronFloatValueMapVals) {
978 template <
typename T,
typename U>
980 if (!coreMap.count(
core)) {
987 std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
990 std::unordered_set<unsigned int>& superClusterFullRelinkMap) {
991 const auto& mappedsc = superClusterMap.find(superCluster);
994 unsigned int mappedscidx = 0;
995 if (mappedsc == superClusterMap.end()) {
998 superClusterMap[superCluster] = mappedscidx;
1000 mappedscidx = mappedsc->second;
1005 superClusterFullRelinkMap.insert(mappedscidx);
1010 std::map<reco::ConversionRef, unsigned int>& conversionMap) {
1011 for (
const auto& convref : convrefs) {
1019 std::map<reco::ConversionRef, unsigned int>& conversionMap) {
1035 std::map<reco::ConversionRef, unsigned int>& conversionMap) {
1050 std::map<reco::ConversionRef, unsigned int>& conversionMap) {
1051 if (!conversionMap.count(convref)) {
1059 std::map<reco::CaloClusterPtr, unsigned int>& caloClusterMap) {
1060 if (!caloClusterMap.count(caloCluster)) {
1061 caloClusters.push_back(*caloCluster);
1062 caloClusterMap[caloCluster] = caloClusters.size() - 1;
1068 std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
1069 std::unordered_set<DetId>& rechitMap,
1074 std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap) {
1075 for (
const auto& cluster : superCluster.
clusters()) {
1078 for (
const auto& hitfrac : cluster->hitsAndFractions()) {
1079 rechitMap.insert(hitfrac.first);
1082 bool barrel = cluster->hitsAndFractions().front().first.subdetId() ==
EcalBarrel;
1086 std::vector<DetId> dets5x5 =
1088 for (
const auto& detid : dets5x5) {
1089 rechitMap.insert(detid);
1095 for (
const auto& hitfrac : cluster->hitsAndFractions()) {
1096 rechitMap.insert(hitfrac.first);
1103 std::unordered_set<DetId>& hcalDetIds) {
1108 const std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
1109 const std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap,
1113 const auto& seedmapped = ebeeClusterMap.find(superCluster.
seed());
1114 if (seedmapped != ebeeClusterMap.end()) {
1117 superCluster.
setSeed(clusptr);
1122 for (
const auto& cluster : superCluster.
clusters()) {
1123 const auto& clustermapped = ebeeClusterMap.find(cluster);
1124 if (clustermapped != ebeeClusterMap.end()) {
1141 const auto& clustermapped = esClusterMap.find(cluster);
1142 if (clustermapped != esClusterMap.end()) {
1152 if (!esclusters.
empty()) {
1157 template <
typename T>
1160 const std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
1162 const auto& scmapped = superClusterMap.find(
core.superCluster());
1163 if (scmapped != superClusterMap.end()) {
1166 core.setSuperCluster(scref);
1171 const std::map<reco::GsfTrackRef, unsigned int>& gsfTrackMap,
1173 const auto& gsftkmapped = gsfTrackMap.find(gsfElectronCore.
gsfTrack());
1174 if (gsftkmapped != gsfTrackMap.end()) {
1182 const std::map<reco::ConversionRef, unsigned int>& conversionMap,
1185 for (
const auto& convref : convrefs) {
1186 const auto& convmapped = conversionMap.find(convref);
1187 if (convmapped != conversionMap.end()) {
1192 outconvrefs.
clear();
1196 if (!outconvrefs.
empty()) {
1202 const std::map<reco::PhotonCoreRef, unsigned int>& photonCoreMap,
1204 const auto& coremapped = photonCoreMap.find(
photon.photonCore());
1205 if (coremapped != photonCoreMap.end()) {
1208 photon.setPhotonCore(coreref);
1214 const std::map<reco::GsfElectronCoreRef, unsigned int>& gsfElectronCoreMap,
1216 const auto& coremapped = gsfElectronCoreMap.find(gsfElectron.
core());
1217 if (coremapped != gsfElectronCoreMap.end()) {
1228 float newEnergy = energyMap[oldPhoRef];
1229 float newEnergyErr = energyErrMap[oldPhoRef];
1230 photon.setCorrectedEnergy(reco::Photon::P4type::regression2, newEnergy, newEnergyErr,
true);
1239 const float newEnergy = energyMap[oldEleRef];
1240 const float newEnergyErr = energyErrMap[oldEleRef];
1241 const float newEcalEnergy = ecalEnergyMap[oldEleRef];
1242 const float newEcalEnergyErr = ecalEnergyErrMap[oldEleRef];
1246 const float corr = newEnergy / oldP4.E();
1248 electron.setCorrectedEcalEnergy(newEcalEnergy);
1249 electron.setCorrectedEcalEnergyError(newEcalEnergyErr);
1252 electron.correctMomentum(newP4,
electron.trackMomentumError(), newEnergyErr);
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_
bool empty() const
Is the RefVector empty.
edm::EDPutTokenT< reco::PhotonCollection > outOOTPhotons_
const edm::EDGetTokenT< reco::HIPhotonIsolationMap > recoHIPhotonIsolationMapInputToken_
const edm::EDGetTokenT< reco::GsfElectronCollection > gsfElectronT_
const edm::EDPutTokenT< EcalRecHitCollection > outEERecHits_
const edm::EDPutTokenT< EcalRecHitCollection > outEBRecHits_
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_
EGHcalRecHitSelector hcalHitSel_
const std::vector< edm::EDPutTokenT< edm::ValueMap< float > > > outGsfElectronFloatValueMaps_
static void calibratePhoton(reco::Photon &photon, const reco::PhotonRef &oldPhoRef, const edm::ValueMap< float > &energyMap, const edm::ValueMap< float > &energyErrMap)
edm::EDPutTokenT< reco::PhotonCoreCollection > outOOTPhotonCores_
void push_back(Ptr< T > const &iPtr)
edm::EDGetTokenT< edm::ValueMap< float > > photonCalibEnergyT_
const std::vector< edm::EDPutTokenT< edm::ValueMap< bool > > > outPhotonIds_
T const * product() 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 double relinkSuperclusterPtMin_
const StringCutObjectSelector< reco::Photon > keepPhotonSel_
const edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > photonPfCandMapT_
const bool applyGsfElectronCalibOnData_
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_
double getMaximum(TObjArray *array)
bool empty() const
Is the RefVector empty.
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)
const edm::EDGetTokenT< reco::SuperClusterCollection > superclusterT_
edm::EDPutTokenT< reco::CaloClusterCollection > outOOTESClusters_
const edm::EDPutTokenT< reco::GsfElectronCollection > outGsfElectrons_
const edm::EDPutTokenT< reco::CaloClusterCollection > outEBEEClusters_
const CaloClusterPtrVector & preshowerClusters() const
const access to the preshower cluster list itself
std::vector< BaseVolumeHandle * > handles
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
const StringCutObjectSelector< reco::Photon > keepOOTPhotonSel_
edm::EDPutTokenT< reco::CaloClusterCollection > outOOTEBEEClusters_
void addDetIds(const reco::SuperCluster &superClus, const HBHERecHitCollection &recHits, CollType &detIdsToStore) const
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
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)
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_
Abs< T >::type abs(const T &t)
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_
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)
#define DEFINE_FWK_MODULE(type)
void linkCore(const T &core, U &cores, std::map< T, unsigned int > &coreMap)
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
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 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)
virtual GsfElectronCoreRef core() const
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)
void conversion(EventAux const &from, EventAuxiliary &to)
void clear()
Clear the vector.
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
std::vector< Photon > PhotonCollection
collectin of Photon objects
const edm::EDPutTokenT< reco::ConversionCollection > outSingleConversions_
std::vector< edm::EDGetTokenT< edm::ValueMap< float > > > ootPhotonFloatValueMapTs_
const CaloClusterPtrVector & clusters() const
const access to the cluster list itself
const StringCutObjectSelector< reco::GsfElectron > slimRelinkGsfElectronSel_
const edm::EDPutTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > outGsfElectronPfCandMap_
const GsfTrackRef & gsfTrack() const
edm::EDPutTokenT< reco::HIPhotonIsolationMap > recoHIPhotonIsolationMapOutputName_
std::vector< PhotonCore > PhotonCoreCollection
collectin of PhotonCore objects
const double scAbsetaMax_
const CaloClusterPtr & seed() const
seed BasicCluster
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_
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)