4 #include <unordered_set> 55 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 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")),
105 if (not aTag.
label().empty())
ootPhotonT_ = consumes<reco::PhotonCollection>(aTag);
107 const std::vector<edm::InputTag>& photonidinputs =
108 config.
getParameter<std::vector<edm::InputTag> >(
"photonIDSources");
113 const std::vector<edm::InputTag>& gsfelectronidinputs =
114 config.
getParameter<std::vector<edm::InputTag> >(
"gsfElectronIDSources");
119 const std::vector<edm::InputTag>& photonpfclusterisoinputs =
120 config.
getParameter<std::vector<edm::InputTag> >(
"photonFloatValueMapSources");
125 const std::vector<edm::InputTag>& ootphotonpfclusterisoinputs =
126 config.
getParameter<std::vector<edm::InputTag> >(
"ootPhotonFloatValueMapSources");
131 const std::vector<edm::InputTag>& gsfelectronpfclusterisoinputs =
132 config.
getParameter<std::vector<edm::InputTag> >(
"gsfElectronFloatValueMapSources");
174 produces< edm::ValueMap<bool> >(outid);
177 produces< edm::ValueMap<float> >(outid);
180 produces< edm::ValueMap<float> >(outid);
184 produces< edm::ValueMap<float> >(outid);
188 produces< edm::ValueMap<float> >(outid);
242 std::vector<edm::Handle<edm::ValueMap<bool> > > photonIdHandles(
photonIdTs_.size());
245 theEvent.
getByToken(photonIdT,photonIdHandles[index++]);
248 std::vector<edm::Handle<edm::ValueMap<float> > > gsfElectronIdHandles(
gsfElectronIdTs_.size());
251 theEvent.
getByToken(gsfElectronIdT,gsfElectronIdHandles[index++]);
254 std::vector<edm::Handle<edm::ValueMap<float> > > photonFloatValueMapHandles(
photonFloatValueMapTs_.size());
257 theEvent.
getByToken(photonFloatValueMapT,photonFloatValueMapHandles[index++]);
264 theEvent.
getByToken(ootPhotonFloatValueMapT,ootPhotonFloatValueMapHandles[index++]);
271 theEvent.
getByToken(gsfElectronFloatValueMapT,gsfElectronFloatValueMapHandles[index++]);
294 const CaloTopology *caloTopology = & (*theCaloTopology);
297 auto photons = std::make_unique<reco::PhotonCollection>();
298 auto photonCores = std::make_unique<reco::PhotonCoreCollection>();
299 auto ootPhotons = std::make_unique<reco::PhotonCollection>();
300 auto ootPhotonCores = std::make_unique<reco::PhotonCoreCollection>();
301 auto gsfElectrons = std::make_unique<reco::GsfElectronCollection>();
302 auto gsfElectronCores = std::make_unique<reco::GsfElectronCoreCollection>();
303 auto gsfTracks = std::make_unique<reco::GsfTrackCollection>();
304 auto conversions = std::make_unique<reco::ConversionCollection>();
306 auto superClusters = std::make_unique<reco::SuperClusterCollection>();
307 auto ebeeClusters = std::make_unique<reco::CaloClusterCollection>();
308 auto esClusters = std::make_unique<reco::CaloClusterCollection>();
309 auto ootSuperClusters = std::make_unique<reco::SuperClusterCollection>();
310 auto ootEbeeClusters = std::make_unique<reco::CaloClusterCollection>();
311 auto ootEsClusters = std::make_unique<reco::CaloClusterCollection>();
312 auto ebRecHits = std::make_unique<EcalRecHitCollection>();
313 auto eeRecHits = std::make_unique<EcalRecHitCollection>();
314 auto esRecHits = std::make_unique<EcalRecHitCollection>();
315 auto hbheRecHits = std::make_unique<HBHERecHitCollection>();
316 auto photonPfCandMap = std::make_unique<edm::ValueMap<std::vector<reco::PFCandidateRef>>>();
317 auto gsfElectronPfCandMap = std::make_unique<edm::ValueMap<std::vector<reco::PFCandidateRef>>>();
320 std::map<reco::PhotonCoreRef, unsigned int> photonCoreMap;
321 std::map<reco::PhotonCoreRef, unsigned int> ootPhotonCoreMap;
322 std::map<reco::GsfElectronCoreRef, unsigned int> gsfElectronCoreMap;
323 std::map<reco::GsfTrackRef, unsigned int> gsfTrackMap;
324 std::map<reco::ConversionRef, unsigned int> conversionMap;
325 std::map<reco::ConversionRef, unsigned int> singleConversionMap;
326 std::map<reco::SuperClusterRef, unsigned int> superClusterMap;
327 std::map<reco::CaloClusterPtr, unsigned int> ebeeClusterMap;
328 std::map<reco::CaloClusterPtr, unsigned int> esClusterMap;
329 std::map<reco::SuperClusterRef, unsigned int> ootSuperClusterMap;
330 std::map<reco::CaloClusterPtr, unsigned int> ootEbeeClusterMap;
331 std::map<reco::CaloClusterPtr, unsigned int> ootEsClusterMap;
332 std::unordered_set<DetId> rechitMap;
333 std::unordered_set<DetId> hcalRechitMap;
335 std::unordered_set<unsigned int> superClusterFullRelinkMap;
336 std::unordered_set<unsigned int> ootSuperClusterFullRelinkMap;
339 std::vector<std::vector<reco::PFCandidateRef> > pfCandIsoPairVecPho;
340 std::vector<std::vector<reco::PFCandidateRef> > pfCandIsoPairVecEle;
343 std::vector<std::vector<bool> > photonIdVals(photonIdHandles.size());
344 std::vector<std::vector<float> > gsfElectronIdVals(gsfElectronIdHandles.size());
345 std::vector<std::vector<float> > photonFloatValueMapVals(photonFloatValueMapHandles.size());
346 std::vector<std::vector<float> > ootPhotonFloatValueMapVals(ootPhotonFloatValueMapHandles.size());
347 std::vector<std::vector<float> > gsfElectronFloatValueMapVals(gsfElectronFloatValueMapHandles.size());
351 for (
const auto&
photon : *photonHandle) {
356 auto& newPhoton =
photons->back();
361 *photonCalibEnergyHandle,*photonCalibEnergyErrHandle);
372 pfCandIsoPairVecPho.push_back((*photonPfCandMapHandle)[photonref]);
376 for (
const auto& photonIdHandle : photonIdHandles) {
377 photonIdVals[subindex++].push_back((*photonIdHandle)[photonref]);
381 for (
const auto& photonFloatValueMapHandle : photonFloatValueMapHandles) {
382 photonFloatValueMapVals[subindex++].push_back((*photonFloatValueMapHandle)[photonref]);
387 linkCore(photonCore, *photonCores, photonCoreMap);
391 if (!slimRelink)
continue;
397 linkSuperCluster(superCluster, superClusterMap, *superClusters, relink, superClusterFullRelinkMap);
400 if (!relink)
continue;
407 linkConversions(singleconvrefs, *singleConversions, singleConversionMap);
420 for (
const auto& ootPhoton : *ootPhotonHandle) {
428 ootPhotons->push_back(ootPhoton);
432 for (
const auto& ootPhotonFloatValueMapHandle : ootPhotonFloatValueMapHandles) {
433 ootPhotonFloatValueMapVals[subindex++].push_back((*ootPhotonFloatValueMapHandle)[ootPhotonref]);
438 linkCore(ootPhotonCore, *ootPhotonCores, ootPhotonCoreMap);
442 if (!slimRelink)
continue;
447 linkSuperCluster(ootSuperCluster, ootSuperClusterMap, *ootSuperClusters, relink, ootSuperClusterFullRelinkMap);
449 linkHcalHits(*ootPhoton.superCluster(),*hbheHitHandle,hcalRechitMap);
456 for (
const auto& gsfElectron : *gsfElectronHandle) {
460 gsfElectrons->push_back(gsfElectron);
461 auto& newGsfElectron = gsfElectrons->back();
465 *gsfElectronCalibEnergyHandle,*gsfElectronCalibEnergyErrHandle,
466 *gsfElectronCalibEcalEnergyHandle,*gsfElectronCalibEcalEnergyErrHandle);
472 gsfElectrons->pop_back();
476 pfCandIsoPairVecEle.push_back((*gsfElectronPfCandMapHandle)[gsfElectronref]);
480 for (
const auto& gsfElectronIdHandle : gsfElectronIdHandles) {
481 gsfElectronIdVals[subindex++].push_back((*gsfElectronIdHandle)[gsfElectronref]);
485 for (
const auto& gsfElectronFloatValueMapHandle : gsfElectronFloatValueMapHandles) {
486 gsfElectronFloatValueMapVals[subindex++].push_back((*gsfElectronFloatValueMapHandle)[gsfElectronref]);
490 linkCore(gsfElectronCore, *gsfElectronCores, gsfElectronCoreMap);
495 if (!gsfTrackMap.count(gsfTrack)) {
496 gsfTracks->push_back(*gsfTrack);
497 gsfTrackMap[gsfTrack] = gsfTracks->size() - 1;
503 if (!gsfTrackMap.count(ambigGsfTrack)) {
504 gsfTracks->push_back(*ambigGsfTrack);
505 gsfTrackMap[ambigGsfTrack] = gsfTracks->size() - 1;
511 if (!slimRelink)
continue;
516 linkSuperCluster(superCluster, superClusterMap, *superClusters, relink, superClusterFullRelinkMap);
519 if (!relink)
continue;
526 linkConversions(singleconvrefs, *singleConversions, singleConversionMap);
535 linkHcalHits(*gsfElectron.superCluster(),*hbheHitHandle,hcalRechitMap);
541 for (
auto& superCluster : *superClusters) {
548 bool fullrelink = superClusterFullRelinkMap.count(index++);
551 superCluster.clearHitsAndFractions();
556 linkCaloClusters(superCluster, *ebeeClusters, ebeeClusterMap, rechitMap, barrelHitHandle, endcapHitHandle, caloTopology, *esClusters, esClusterMap);
568 for (
auto& ootSuperCluster : *ootSuperClusters) {
575 bool fullrelink = ootSuperClusterFullRelinkMap.count(index++);
578 ootSuperCluster.clearHitsAndFractions();
583 linkCaloClusters(ootSuperCluster, *ootEbeeClusters, ootEbeeClusterMap, rechitMap, barrelHitHandle, endcapHitHandle, caloTopology, *ootEsClusters, ootEsClusterMap);
589 for (
const EcalRecHit &rechit : *barrelHitHandle) {
590 if (rechitMap.count(rechit.detid())) {
591 ebRecHits->push_back(rechit);
595 for (
const EcalRecHit &rechit : *endcapHitHandle) {
596 if (rechitMap.count(rechit.detid())) {
597 eeRecHits->push_back(rechit);
605 for (
const EcalRecHit &rechit : *preshowerHitHandle) {
606 if (rechitMap.count(rechit.detid())) {
607 esRecHits->push_back(rechit);
613 for (
const HBHERecHit &rechit : *hbheHitHandle) {
614 if (hcalRechitMap.count(rechit.detid())) {
615 hbheRecHits->push_back(rechit);
627 relinkCaloClusters(superCluster, ebeeClusterMap, esClusterMap, outEBEEClusterHandle, outESClusterHandle);
639 relinkCaloClusters(ootSuperCluster, ootEbeeClusterMap, ootEsClusterMap, outOOTEBEEClusterHandle, outOOTESClusterHandle);
699 std::vector<reco::GsfTrackRef> ambigTracksInThisElectron;
702 ambigTracksInThisElectron.push_back(*igsf);
706 gsfElectron.clearAmbiguousGsfTracks();
709 for (
const auto &it : ambigTracksInThisElectron) {
710 const auto &gsftkmapped = gsfTrackMap.find(it);
712 if (gsftkmapped != gsfTrackMap.end()) {
714 gsfElectron.addAmbiguousGsfTrack(gsftkref);
717 throw cms::Exception(
"There must be a problem with linking and mapping of ambiguous gsf tracks...");
720 if (gsfElectron.ambiguousGsfTracksSize() > 0)
721 gsfElectron.setAmbiguous(
true);
723 ambigTracksInThisElectron.clear();
737 fillerPhotons.insert(outPhotonHandle,pfCandIsoPairVecPho.begin(),pfCandIsoPairVecPho.end());
738 fillerPhotons.fill();
742 fillerGsfElectrons.insert(outGsfElectronHandle,pfCandIsoPairVecEle.begin(),pfCandIsoPairVecEle.end());
743 fillerGsfElectrons.fill();
750 auto oMap = std::make_unique<MapType>();
752 typename MapType::Filler
filler(*oMap);
753 filler.insert(refH, vec.begin(), vec.end());
761 for (
auto const&
vals : photonIdVals){
767 for (
auto const&
vals : gsfElectronIdVals){
773 for (
auto const&
vals : photonFloatValueMapVals){
780 for (
auto const&
vals : ootPhotonFloatValueMapVals){
787 for (
auto const&
vals : gsfElectronFloatValueMapVals){
792 template <
typename T,
typename U>
795 if (!coreMap.count(core)) {
796 cores.push_back(*core);
797 coreMap[core] = cores.size() - 1;
802 std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
805 std::unordered_set<unsigned int>& superClusterFullRelinkMap)
807 const auto &mappedsc = superClusterMap.find(superCluster);
810 unsigned int mappedscidx = 0;
811 if (mappedsc==superClusterMap.end()) {
812 superClusters.push_back(*superCluster);
813 mappedscidx = superClusters.size() - 1;
814 superClusterMap[superCluster] = mappedscidx;
817 mappedscidx = mappedsc->second;
821 if (relink) superClusterFullRelinkMap.insert(mappedscidx);
826 std::map<reco::ConversionRef, unsigned int>& conversionMap)
828 for (
const auto& convref : convrefs) {
836 std::map<reco::ConversionRef, unsigned int>& conversionMap)
839 for (
const auto&
conversion : *conversionHandle) {
844 if (!matched)
continue;
853 std::map<reco::ConversionRef, unsigned int>& conversionMap)
856 for (
const auto&
conversion : *conversionHandle) {
861 if (!matched)
continue;
869 std::map<reco::ConversionRef, unsigned int>& conversionMap)
871 if (!conversionMap.count(convref)) {
872 conversions.push_back(*convref);
873 conversionMap[convref] = conversions.size() - 1;
879 std::map<reco::CaloClusterPtr, unsigned int>& caloClusterMap)
881 if (!caloClusterMap.count(caloCluster)) {
882 caloClusters.push_back(*caloCluster);
883 caloClusterMap[caloCluster] = caloClusters.size() - 1;
889 std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
890 std::unordered_set<DetId>& rechitMap,
895 std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap)
897 for (
const auto& cluster : superCluster.
clusters()) {
900 for (
const auto& hitfrac : cluster->hitsAndFractions()) {
901 rechitMap.insert(hitfrac.first);
904 bool barrel = cluster->hitsAndFractions().front().first.subdetId()==
EcalBarrel;
906 DetId seed = EcalClusterTools::getMaximum(*cluster, rhcol).first;
909 for (
const auto& detid : dets5x5) {
910 rechitMap.insert(detid);
916 for (
const auto& hitfrac : cluster->hitsAndFractions()) {
917 rechitMap.insert(hitfrac.first);
924 std::unordered_set<DetId>& hcalDetIds)
930 const std::map<reco::CaloClusterPtr, unsigned int>& ebeeClusterMap,
931 const std::map<reco::CaloClusterPtr, unsigned int>& esClusterMap,
936 const auto &seedmapped = ebeeClusterMap.find(superCluster.
seed());
937 if (seedmapped != ebeeClusterMap.end()) {
945 for (
const auto &cluster : superCluster.
clusters()) {
946 const auto &clustermapped = ebeeClusterMap.find(cluster);
947 if (clustermapped != ebeeClusterMap.end()) {
958 if (!clusters.
empty()) {
965 const auto &clustermapped = esClusterMap.find(cluster);
966 if (clustermapped != esClusterMap.end()) {
977 if (!esclusters.
empty()) {
982 template <
typename T>
984 const std::map<reco::SuperClusterRef, unsigned int>& superClusterMap,
987 const auto &scmapped = superClusterMap.find(core.superCluster());
988 if (scmapped != superClusterMap.end()) {
991 core.setSuperCluster(scref);
996 const std::map<reco::GsfTrackRef, unsigned int>& gsfTrackMap,
999 const auto &gsftkmapped = gsfTrackMap.find(gsfElectronCore.
gsfTrack());
1000 if (gsftkmapped != gsfTrackMap.end()) {
1008 const std::map<reco::ConversionRef, unsigned int>& conversionMap,
1012 for (
const auto& convref : convrefs) {
1013 const auto &convmapped = conversionMap.find(convref);
1014 if (convmapped != conversionMap.end()) {
1020 outconvrefs.
clear();
1024 if (!outconvrefs.
empty()) {
1030 const std::map<reco::PhotonCoreRef, unsigned int>& photonCoreMap,
1033 const auto &coremapped = photonCoreMap.find(photon.
photonCore());
1034 if (coremapped != photonCoreMap.end()) {
1042 const std::map<reco::GsfElectronCoreRef, unsigned int>& gsfElectronCoreMap,
1045 const auto &coremapped = gsfElectronCoreMap.find(gsfElectron.
core());
1046 if (coremapped != gsfElectronCoreMap.end()) {
1059 float newEnergy = energyMap[oldPhoRef];
1060 float newEnergyErr = energyErrMap[oldPhoRef];
1061 photon.
setCorrectedEnergy(reco::Photon::P4type::regression2, newEnergy, newEnergyErr,
true);
1072 const float newEnergy = energyMap[oldEleRef];
1073 const float newEnergyErr = energyErrMap[oldEleRef];
1074 const float newEcalEnergy = ecalEnergyMap[oldEleRef];
1075 const float newEcalEnergyErr = ecalEnergyErrMap[oldEleRef];
1079 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_