From 5d1f8a16993aa11249d6d3aa0844d3ddbc3ab58c Mon Sep 17 00:00:00 2001 From: reza goldouzian Date: Fri, 4 Feb 2022 12:15:31 -0500 Subject: [PATCH 1/3] ele/ph mass fix --- RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc | 1 + RecoEgamma/EgammaElectronAlgos/src/RegressionHelper.cc | 1 + .../EgammaPhotonProducers/src/GEDPhotonProducer.cc | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc b/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc index 7613eb063fd9f..38db772240f06 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc @@ -1067,6 +1067,7 @@ void GsfElectronAlgo::createElectron(reco::GsfElectronCollection& electrons, // Will be overwritten later in the case of the regression ele.setCorrectedEcalEnergyError(egamma::ecalClusterEnergyUncertaintyElectronSpecific(*(ele.superCluster()))); ele.setP4(GsfElectron::P4_FROM_SUPER_CLUSTER, momentum, 0, true); + ele.setMass(0.00050); //==================================================== // brems fractions diff --git a/RecoEgamma/EgammaElectronAlgos/src/RegressionHelper.cc b/RecoEgamma/EgammaElectronAlgos/src/RegressionHelper.cc index 93f505a9a3758..8692586b20385 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/RegressionHelper.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/RegressionHelper.cc @@ -194,5 +194,6 @@ void RegressionHelper::applyCombinationRegression(reco::GsfElectron& ele) const combinedMomentum); ele.setP4(reco::GsfElectron::P4_COMBINATION, newMomentum, combinedMomentumError, true); + ele.setMass(0.00050); } } diff --git a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc index 337cea3032416..c9d4a0ca7e64e 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc @@ -946,20 +946,25 @@ void GEDPhotonProducer::fillPhotonCollection(edm::Event& evt, if (candidateP4type_ == "fromEcalEnergy") { newCandidate.setP4(newCandidate.p4(reco::Photon::ecal_photons)); newCandidate.setCandidateP4type(reco::Photon::ecal_photons); + newCandidate.setMass(0); } else if (candidateP4type_ == "fromRegression1") { newCandidate.setP4(newCandidate.p4(reco::Photon::regression1)); newCandidate.setCandidateP4type(reco::Photon::regression1); + newCandidate.setMass(0); } else if (candidateP4type_ == "fromRegression2") { newCandidate.setP4(newCandidate.p4(reco::Photon::regression2)); newCandidate.setCandidateP4type(reco::Photon::regression2); + newCandidate.setMass(0); } else if (candidateP4type_ == "fromRefinedSCRegression") { newCandidate.setP4(newCandidate.p4(reco::Photon::regression2)); newCandidate.setCandidateP4type(reco::Photon::regression2); + newCandidate.setMass(0); } } else { math::XYZVector gamma_momentum = direction.unit() * scRef->energy(); math::XYZTLorentzVectorD p4(gamma_momentum.x(), gamma_momentum.y(), gamma_momentum.z(), scRef->energy()); newCandidate.setP4(p4); + newCandidate.setMass(0); newCandidate.setCandidateP4type(reco::Photon::ecal_photons); // Make it an EE photon reco::Photon::FiducialFlags fiducialFlags; @@ -1084,15 +1089,19 @@ void GEDPhotonProducer::fillPhotonCollection(edm::Event& evt, if (candidateP4type_ == "fromEcalEnergy") { newCandidate.setP4(newCandidate.p4(reco::Photon::ecal_photons)); newCandidate.setCandidateP4type(reco::Photon::ecal_photons); + newCandidate.setMass(0); } else if (candidateP4type_ == "fromRegression1") { newCandidate.setP4(newCandidate.p4(reco::Photon::regression1)); newCandidate.setCandidateP4type(reco::Photon::regression1); + newCandidate.setMass(0); } else if (candidateP4type_ == "fromRegression2") { newCandidate.setP4(newCandidate.p4(reco::Photon::regression2)); newCandidate.setCandidateP4type(reco::Photon::regression2); + newCandidate.setMass(0); } else if (candidateP4type_ == "fromRefinedSCRegression") { newCandidate.setP4(newCandidate.p4(reco::Photon::regression2)); newCandidate.setCandidateP4type(reco::Photon::regression2); + newCandidate.setMass(0); } outputPhotonCollection.push_back(newCandidate); From ad3c65e5aa1afcb3646913bfe9e006d4e45e2841 Mon Sep 17 00:00:00 2001 From: reza goldouzian Date: Tue, 8 Feb 2022 07:35:52 -0500 Subject: [PATCH 2/3] electron mass set to zero --- RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc b/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc index 38db772240f06..be35acc3f749a 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc @@ -1067,7 +1067,7 @@ void GsfElectronAlgo::createElectron(reco::GsfElectronCollection& electrons, // Will be overwritten later in the case of the regression ele.setCorrectedEcalEnergyError(egamma::ecalClusterEnergyUncertaintyElectronSpecific(*(ele.superCluster()))); ele.setP4(GsfElectron::P4_FROM_SUPER_CLUSTER, momentum, 0, true); - ele.setMass(0.00050); + ele.setMass(0.0); //==================================================== // brems fractions From c401a228569e9e8abaf72d79666073c514b145f4 Mon Sep 17 00:00:00 2001 From: reza goldouzian Date: Tue, 8 Feb 2022 07:56:33 -0500 Subject: [PATCH 3/3] electron mass set to zero --- .../src/RegressionHelper.cc | 2 +- .../src/GEDPhotonProducer.cc | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/RecoEgamma/EgammaElectronAlgos/src/RegressionHelper.cc b/RecoEgamma/EgammaElectronAlgos/src/RegressionHelper.cc index 8692586b20385..51606efb40851 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/RegressionHelper.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/RegressionHelper.cc @@ -194,6 +194,6 @@ void RegressionHelper::applyCombinationRegression(reco::GsfElectron& ele) const combinedMomentum); ele.setP4(reco::GsfElectron::P4_COMBINATION, newMomentum, combinedMomentumError, true); - ele.setMass(0.00050); + ele.setMass(0.0); } } diff --git a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc index c9d4a0ca7e64e..a360023117184 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc @@ -946,25 +946,25 @@ void GEDPhotonProducer::fillPhotonCollection(edm::Event& evt, if (candidateP4type_ == "fromEcalEnergy") { newCandidate.setP4(newCandidate.p4(reco::Photon::ecal_photons)); newCandidate.setCandidateP4type(reco::Photon::ecal_photons); - newCandidate.setMass(0); + newCandidate.setMass(0.0); } else if (candidateP4type_ == "fromRegression1") { newCandidate.setP4(newCandidate.p4(reco::Photon::regression1)); newCandidate.setCandidateP4type(reco::Photon::regression1); - newCandidate.setMass(0); + newCandidate.setMass(0.0); } else if (candidateP4type_ == "fromRegression2") { newCandidate.setP4(newCandidate.p4(reco::Photon::regression2)); newCandidate.setCandidateP4type(reco::Photon::regression2); - newCandidate.setMass(0); + newCandidate.setMass(0.0); } else if (candidateP4type_ == "fromRefinedSCRegression") { newCandidate.setP4(newCandidate.p4(reco::Photon::regression2)); newCandidate.setCandidateP4type(reco::Photon::regression2); - newCandidate.setMass(0); + newCandidate.setMass(0.0); } } else { math::XYZVector gamma_momentum = direction.unit() * scRef->energy(); math::XYZTLorentzVectorD p4(gamma_momentum.x(), gamma_momentum.y(), gamma_momentum.z(), scRef->energy()); newCandidate.setP4(p4); - newCandidate.setMass(0); + newCandidate.setMass(0.0); newCandidate.setCandidateP4type(reco::Photon::ecal_photons); // Make it an EE photon reco::Photon::FiducialFlags fiducialFlags; @@ -1089,19 +1089,19 @@ void GEDPhotonProducer::fillPhotonCollection(edm::Event& evt, if (candidateP4type_ == "fromEcalEnergy") { newCandidate.setP4(newCandidate.p4(reco::Photon::ecal_photons)); newCandidate.setCandidateP4type(reco::Photon::ecal_photons); - newCandidate.setMass(0); + newCandidate.setMass(0.0); } else if (candidateP4type_ == "fromRegression1") { newCandidate.setP4(newCandidate.p4(reco::Photon::regression1)); newCandidate.setCandidateP4type(reco::Photon::regression1); - newCandidate.setMass(0); + newCandidate.setMass(0.0); } else if (candidateP4type_ == "fromRegression2") { newCandidate.setP4(newCandidate.p4(reco::Photon::regression2)); newCandidate.setCandidateP4type(reco::Photon::regression2); - newCandidate.setMass(0); + newCandidate.setMass(0.0); } else if (candidateP4type_ == "fromRefinedSCRegression") { newCandidate.setP4(newCandidate.p4(reco::Photon::regression2)); newCandidate.setCandidateP4type(reco::Photon::regression2); - newCandidate.setMass(0); + newCandidate.setMass(0.0); } outputPhotonCollection.push_back(newCandidate);