4 #include <unordered_set> 56 doPreshowerEcalHits_(!config.getParameter<
edm::InputTag>(
"preshowerEcalHits").
label().
empty()),
58 photonPfCandMapT_(consumes<
edm::ValueMap<
std::vector<
reco::
PFCandidateRef> > >(config.getParameter<
edm::InputTag>(
"photonsPFValMap"))),
59 gsfElectronPfCandMapT_(consumes<
edm::ValueMap<
std::vector<
reco::
PFCandidateRef> > >(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 outPhotonPfCandMap_(
"reducedPhotonPfCandMap"),
85 outGsfElectronPfCandMap_(
"reducedGsfElectronPfCandMap"),
86 outPhotonIds_(config.getParameter<
std::vector<
std::
string> >(
"photonIDOutput")),
87 outGsfElectronIds_(config.getParameter<
std::vector<
std::
string> >(
"gsfElectronIDOutput")),
88 outPhotonFloatValueMaps_(config.getParameter<
std::vector<
std::
string> >(
"photonFloatValueMapOutput")),
89 outOOTPhotonFloatValueMaps_(config.getParameter<
std::vector<
std::
string> >(
"ootPhotonFloatValueMapOutput")),
90 outGsfElectronFloatValueMaps_(config.getParameter<
std::vector<
std::
string> >(
"gsfElectronFloatValueMapOutput")),
91 keepPhotonSel_(config.getParameter<
std::
string>(
"keepPhotons")),
92 slimRelinkPhotonSel_(config.getParameter<
std::
string>(
"slimRelinkPhotons")),
93 relinkPhotonSel_(config.getParameter<
std::
string>(
"relinkPhotons")),
94 keepOOTPhotonSel_(config.getParameter<
std::
string>(
"keepOOTPhotons")),
95 slimRelinkOOTPhotonSel_(config.getParameter<
std::
string>(
"slimRelinkOOTPhotons")),
96 relinkOOTPhotonSel_(config.getParameter<
std::
string>(
"relinkOOTPhotons")),
97 keepGsfElectronSel_(config.getParameter<
std::
string>(
"keepGsfElectrons")),
98 slimRelinkGsfElectronSel_(config.getParameter<
std::
string>(
"slimRelinkGsfElectrons")),
99 relinkGsfElectronSel_(config.getParameter<
std::
string>(
"relinkGsfElectrons"))
101 const std::vector<edm::InputTag>& photonidinputs =
102 config.
getParameter<std::vector<edm::InputTag> >(
"photonIDSources");
107 const std::vector<edm::InputTag>& gsfelectronidinputs =
108 config.
getParameter<std::vector<edm::InputTag> >(
"gsfElectronIDSources");
113 const std::vector<edm::InputTag>& photonpfclusterisoinputs =
114 config.
getParameter<std::vector<edm::InputTag> >(
"photonFloatValueMapSources");
119 const std::vector<edm::InputTag>& ootphotonpfclusterisoinputs =
120 config.
getParameter<std::vector<edm::InputTag> >(
"ootPhotonFloatValueMapSources");
125 const std::vector<edm::InputTag>& gsfelectronpfclusterisoinputs =
126 config.
getParameter<std::vector<edm::InputTag> >(
"gsfElectronFloatValueMapSources");
163 produces< edm::ValueMap<bool> >(outid);
166 produces< edm::ValueMap<float> >(outid);
169 produces< edm::ValueMap<float> >(outid);
172 produces< edm::ValueMap<float> >(outid);
175 produces< edm::ValueMap<float> >(outid);
221 std::vector<edm::Handle<edm::ValueMap<bool> > > photonIdHandles(
photonIdTs_.size());
224 theEvent.
getByToken(photonIdT,photonIdHandles[index++]);
227 std::vector<edm::Handle<edm::ValueMap<float> > > gsfElectronIdHandles(
gsfElectronIdTs_.size());
230 theEvent.
getByToken(gsfElectronIdT,gsfElectronIdHandles[index++]);
233 std::vector<edm::Handle<edm::ValueMap<float> > > photonFloatValueMapHandles(
photonFloatValueMapTs_.size());
236 theEvent.
getByToken(photonFloatValueMapT,photonFloatValueMapHandles[index++]);
242 theEvent.
getByToken(ootPhotonFloatValueMapT,ootPhotonFloatValueMapHandles[index++]);
248 theEvent.
getByToken(gsfElectronFloatValueMapT,gsfElectronFloatValueMapHandles[index++]);
271 const CaloTopology *caloTopology = & (*theCaloTopology);
274 auto photons = std::make_unique<reco::PhotonCollection>();
275 auto photonCores = std::make_unique<reco::PhotonCoreCollection>();
276 auto ootPhotons = std::make_unique<reco::PhotonCollection>();
277 auto ootPhotonCores = std::make_unique<reco::PhotonCoreCollection>();
278 auto gsfElectrons = std::make_unique<reco::GsfElectronCollection>();
279 auto gsfElectronCores = std::make_unique<reco::GsfElectronCoreCollection>();
280 auto gsfTracks = std::make_unique<reco::GsfTrackCollection>();
281 auto conversions = std::make_unique<reco::ConversionCollection>();
283 auto superClusters = std::make_unique<reco::SuperClusterCollection>();
284 auto ebeeClusters = std::make_unique<reco::CaloClusterCollection>();
285 auto esClusters = std::make_unique<reco::CaloClusterCollection>();
286 auto ootSuperClusters = std::make_unique<reco::SuperClusterCollection>();
287 auto ootEbeeClusters = std::make_unique<reco::CaloClusterCollection>();
288 auto ootEsClusters = std::make_unique<reco::CaloClusterCollection>();
289 auto ebRecHits = std::make_unique<EcalRecHitCollection>();
290 auto eeRecHits = std::make_unique<EcalRecHitCollection>();
291 auto esRecHits = std::make_unique<EcalRecHitCollection>();
292 auto photonPfCandMap = std::make_unique<edm::ValueMap<std::vector<reco::PFCandidateRef>>>();
293 auto gsfElectronPfCandMap = std::make_unique<edm::ValueMap<std::vector<reco::PFCandidateRef>>>();
296 std::map<reco::PhotonCoreRef, unsigned int> photonCoreMap;
297 std::map<reco::PhotonCoreRef, unsigned int> ootPhotonCoreMap;
298 std::map<reco::GsfElectronCoreRef, unsigned int> gsfElectronCoreMap;
299 std::map<reco::GsfTrackRef, unsigned int> gsfTrackMap;
300 std::map<reco::ConversionRef, unsigned int> conversionMap;
301 std::map<reco::ConversionRef, unsigned int> singleConversionMap;
302 std::map<reco::SuperClusterRef, unsigned int> superClusterMap;
303 std::map<reco::CaloClusterPtr, unsigned int> ebeeClusterMap;
304 std::map<reco::CaloClusterPtr, unsigned int> esClusterMap;
305 std::map<reco::SuperClusterRef, unsigned int> ootSuperClusterMap;
306 std::map<reco::CaloClusterPtr, unsigned int> ootEbeeClusterMap;
307 std::map<reco::CaloClusterPtr, unsigned int> ootEsClusterMap;
308 std::unordered_set<DetId> rechitMap;
310 std::unordered_set<unsigned int> superClusterFullRelinkMap;
311 std::unordered_set<unsigned int> ootSuperClusterFullRelinkMap;
314 std::vector<std::vector<reco::PFCandidateRef> > pfCandIsoPairVecPho;
315 std::vector<std::vector<reco::PFCandidateRef> > pfCandIsoPairVecEle;
318 std::vector<std::vector<bool> > photonIdVals(photonIdHandles.size());
319 std::vector<std::vector<float> > gsfElectronIdVals(gsfElectronIdHandles.size());
320 std::vector<std::vector<float> > photonFloatValueMapVals(photonFloatValueMapHandles.size());
321 std::vector<std::vector<float> > ootPhotonFloatValueMapVals(ootPhotonFloatValueMapHandles.size());
322 std::vector<std::vector<float> > gsfElectronFloatValueMapVals(gsfElectronFloatValueMapHandles.size());
326 for (
const auto&
photon : *photonHandle) {
331 auto& newPhoton =
photons->back();
336 *photonCalibEnergyHandle,*photonCalibEnergyErrHandle);
347 pfCandIsoPairVecPho.push_back((*photonPfCandMapHandle)[photonref]);
351 for (
const auto& photonIdHandle : photonIdHandles) {
352 photonIdVals[subindex++].push_back((*photonIdHandle)[photonref]);
356 for (
const auto& photonFloatValueMapHandle : photonFloatValueMapHandles) {
357 photonFloatValueMapVals[subindex++].push_back((*photonFloatValueMapHandle)[photonref]);
362 linkCore(photonCore, *photonCores, photonCoreMap);
366 if (!slimRelink)
continue;
372 linkSuperCluster(superCluster, superClusterMap, *superClusters, relink, superClusterFullRelinkMap);
375 if (!relink)
continue;
382 linkConversions(singleconvrefs, *singleConversions, singleConversionMap);
390 for (
const auto& ootPhoton : *ootPhotonHandle) {
398 ootPhotons->push_back(ootPhoton);
402 for (
const auto& ootPhotonFloatValueMapHandle : ootPhotonFloatValueMapHandles) {
403 ootPhotonFloatValueMapVals[subindex++].push_back((*ootPhotonFloatValueMapHandle)[ootPhotonref]);
408 linkCore(ootPhotonCore, *ootPhotonCores, ootPhotonCoreMap);
412 if (!slimRelink)
continue;
417 linkSuperCluster(ootSuperCluster, ootSuperClusterMap, *ootSuperClusters, relink, ootSuperClusterFullRelinkMap);
422 for (
const auto& gsfElectron : *gsfElectronHandle) {
426 gsfElectrons->push_back(gsfElectron);
427 auto& newGsfElectron = gsfElectrons->back();
431 *gsfElectronCalibEnergyHandle,*gsfElectronCalibEnergyErrHandle,
432 *gsfElectronCalibEcalEnergyHandle,*gsfElectronCalibEcalEnergyErrHandle);
438 gsfElectrons->pop_back();
442 pfCandIsoPairVecEle.push_back((*gsfElectronPfCandMapHandle)[gsfElectronref]);
446 for (
const auto& gsfElectronIdHandle : gsfElectronIdHandles) {
447 gsfElectronIdVals[subindex++].push_back((*gsfElectronIdHandle)[gsfElectronref]);
451 for (
const auto& gsfElectronFloatValueMapHandle : gsfElectronFloatValueMapHandles) {
452 gsfElectronFloatValueMapVals[subindex++].push_back((*gsfElectronFloatValueMapHandle)[gsfElectronref]);
456 linkCore(gsfElectronCore, *gsfElectronCores, gsfElectronCoreMap);
461 if (!gsfTrackMap.count(gsfTrack)) {
462 gsfTracks->push_back(*gsfTrack);
463 gsfTrackMap[gsfTrack] = gsfTracks->size() - 1;
469 if (!gsfTrackMap.count(ambigGsfTrack)) {
470 gsfTracks->push_back(*ambigGsfTrack);
471 gsfTrackMap[ambigGsfTrack] = gsfTracks->size() - 1;
477 if (!slimRelink)
continue;
482 linkSuperCluster(superCluster, superClusterMap, *superClusters, relink, superClusterFullRelinkMap);
485 if (!relink)
continue;
492 linkConversions(singleconvrefs, *singleConversions, singleConversionMap);
503 for (
auto& superCluster : *superClusters) {
510 bool fullrelink = superClusterFullRelinkMap.count(index++);
513 superCluster.clearHitsAndFractions();
518 linkCaloClusters(superCluster, *ebeeClusters, ebeeClusterMap, rechitMap, barrelHitHandle, endcapHitHandle, caloTopology, *esClusters, esClusterMap);
529 for (
auto& ootSuperCluster : *ootSuperClusters) {
536 bool fullrelink = ootSuperClusterFullRelinkMap.count(index++);
539 ootSuperCluster.clearHitsAndFractions();
544 linkCaloClusters(ootSuperCluster, *ootEbeeClusters, ootEbeeClusterMap, rechitMap, barrelHitHandle, endcapHitHandle, caloTopology, *ootEsClusters, ootEsClusterMap);
550 for (
const EcalRecHit &rechit : *barrelHitHandle) {
551 if (rechitMap.count(rechit.detid())) {
552 ebRecHits->push_back(rechit);
556 for (
const EcalRecHit &rechit : *endcapHitHandle) {
557 if (rechitMap.count(rechit.detid())) {
558 eeRecHits->push_back(rechit);
566 for (
const EcalRecHit &rechit : *preshowerHitHandle) {
567 if (rechitMap.count(rechit.detid())) {
568 esRecHits->push_back(rechit);
581 relinkCaloClusters(superCluster, ebeeClusterMap, esClusterMap, outEBEEClusterHandle, outESClusterHandle);
591 relinkCaloClusters(ootSuperCluster, ootEbeeClusterMap, ootEsClusterMap, outOOTEBEEClusterHandle, outOOTESClusterHandle);
647 std::vector<reco::GsfTrackRef> ambigTracksInThisElectron;
650 ambigTracksInThisElectron.push_back(*igsf);
654 gsfElectron.clearAmbiguousGsfTracks();
657 for (
const auto &it : ambigTracksInThisElectron) {
658 const auto &gsftkmapped = gsfTrackMap.find(it);
660 if (gsftkmapped != gsfTrackMap.end()) {
662 gsfElectron.addAmbiguousGsfTrack(gsftkref);
665 throw cms::Exception(
"There must be a problem with linking and mapping of ambiguous gsf tracks...");
668 if (gsfElectron.ambiguousGsfTracksSize() > 0)
669 gsfElectron.setAmbiguous(
true);
671 ambigTracksInThisElectron.clear();
684 fillerPhotons.insert(outPhotonHandle,pfCandIsoPairVecPho.begin(),pfCandIsoPairVecPho.end());
685 fillerPhotons.fill();
689 fillerGsfElectrons.insert(outGsfElectronHandle,pfCandIsoPairVecEle.begin(),pfCandIsoPairVecEle.end());
690 fillerGsfElectrons.fill();
697 auto oMap = std::make_unique<MapType>();
699 typename MapType::Filler
filler(*oMap);
700 filler.insert(refH, vec.begin(), vec.end());
708 for (
auto const&
vals : photonIdVals){
714 for (
auto const&
vals : gsfElectronIdVals){
720 for (
auto const&
vals : photonFloatValueMapVals){
726 for (
auto const&
vals : ootPhotonFloatValueMapVals){
732 for (
auto const&
vals : gsfElectronFloatValueMapVals){
737 template <
typename T,
typename U>
740 if (!coreMap.count(core)) {
741 cores.push_back(*core);
742 coreMap[core] = cores.size() - 1;
747 std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
750 std::unordered_set<unsigned int>& superClusterFullRelinkMap)
752 const auto &mappedsc = superClusterMap.find(superCluster);
755 unsigned int mappedscidx = 0;
756 if (mappedsc==superClusterMap.end()) {
757 superClusters.push_back(*superCluster);
758 mappedscidx = superClusters.size() - 1;
759 superClusterMap[superCluster] = mappedscidx;
762 mappedscidx = mappedsc->second;
766 if (relink) superClusterFullRelinkMap.insert(mappedscidx);
771 std::map<reco::ConversionRef, unsigned int>& conversionMap)
773 for (
const auto& convref : convrefs) {
781 std::map<reco::ConversionRef, unsigned int>& conversionMap)
784 for (
const auto&
conversion : *conversionHandle) {
789 if (!matched)
continue;
798 std::map<reco::ConversionRef, unsigned int>& conversionMap)
801 for (
const auto&
conversion : *conversionHandle) {
806 if (!matched)
continue;
814 std::map<reco::ConversionRef, unsigned int>& conversionMap)
816 if (!conversionMap.count(convref)) {
817 conversions.push_back(*convref);
818 conversionMap[convref] = conversions.size() - 1;
824 std::map<reco::CaloClusterPtr, unsigned int>& caloClusterMap)
826 if (!caloClusterMap.count(caloCluster)) {
827 caloClusters.push_back(*caloCluster);
828 caloClusterMap[caloCluster] = caloClusters.size() - 1;
834 std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
835 std::unordered_set<DetId>& rechitMap,
840 std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap)
842 for (
const auto& cluster : superCluster.
clusters()) {
845 for (
const auto& hitfrac : cluster->hitsAndFractions()) {
846 rechitMap.insert(hitfrac.first);
849 bool barrel = cluster->hitsAndFractions().front().first.subdetId()==
EcalBarrel;
851 DetId seed = EcalClusterTools::getMaximum(*cluster, rhcol).first;
854 for (
const auto& detid : dets5x5) {
855 rechitMap.insert(detid);
861 for (
const auto& hitfrac : cluster->hitsAndFractions()) {
862 rechitMap.insert(hitfrac.first);
869 const std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
870 const std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap,
875 const auto &seedmapped = ebeeClusterMap.find(superCluster.
seed());
876 if (seedmapped != ebeeClusterMap.end()) {
884 for (
const auto &cluster : superCluster.
clusters()) {
885 const auto &clustermapped = ebeeClusterMap.find(cluster);
886 if (clustermapped != ebeeClusterMap.end()) {
897 if (!clusters.
empty()) {
904 const auto &clustermapped = esClusterMap.find(cluster);
905 if (clustermapped != esClusterMap.end()) {
916 if (!esclusters.
empty()) {
921 template <
typename T>
923 const std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
926 const auto &scmapped = superClusterMap.find(core.superCluster());
927 if (scmapped != superClusterMap.end()) {
930 core.setSuperCluster(scref);
935 const std::map<reco::GsfTrackRef, unsigned int>& gsfTrackMap,
938 const auto &gsftkmapped = gsfTrackMap.find(gsfElectronCore.
gsfTrack());
939 if (gsftkmapped != gsfTrackMap.end()) {
947 const std::map<reco::ConversionRef, unsigned int>& conversionMap,
951 for (
const auto& convref : convrefs) {
952 const auto &convmapped = conversionMap.find(convref);
953 if (convmapped != conversionMap.end()) {
963 if (!outconvrefs.
empty()) {
969 const std::map<reco::PhotonCoreRef, unsigned int>& photonCoreMap,
972 const auto &coremapped = photonCoreMap.find(photon.
photonCore());
973 if (coremapped != photonCoreMap.end()) {
981 const std::map<reco::GsfElectronCoreRef, unsigned int>& gsfElectronCoreMap,
984 const auto &coremapped = gsfElectronCoreMap.find(gsfElectron.
core());
985 if (coremapped != gsfElectronCoreMap.end()) {
997 float newEnergy = energyMap[oldPhoRef];
998 float newEnergyErr = energyErrMap[oldPhoRef];
999 photon.
setCorrectedEnergy(reco::Photon::P4type::regression2, newEnergy, newEnergyErr,
true);
1010 const float newEnergy = energyMap[oldEleRef];
1011 const float newEnergyErr = energyErrMap[oldEleRef];
1012 const float newEcalEnergy = ecalEnergyMap[oldEleRef];
1013 const float newEcalEnergyErr = ecalEnergyErrMap[oldEleRef];
1017 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_
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)
const StringCutObjectSelector< reco::GsfElectron > keepGsfElectronSel_
const std::string outOOTPhotons_
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_
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)
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 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_
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_
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< reco::PhotonCollection > ootPhotonT_
const edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
const bool applyGsfElectronCalibOnMC_
ReducedEGProducer(const edm::ParameterSet &ps)
const edm::EDGetTokenT< reco::ConversionCollection > conversionT_