Skip to content

Commit

Permalink
Merge pull request #36954 from rgoldouz/FixElePhMass
Browse files Browse the repository at this point in the history
Electron and photon masses are set to zero
  • Loading branch information
cmsbuild committed Mar 8, 2022
2 parents 996a3b2 + 8c39182 commit 27a732f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.0);

//====================================================
// brems fractions
Expand Down
1 change: 1 addition & 0 deletions RecoEgamma/EgammaElectronAlgos/src/RegressionHelper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,6 @@ void RegressionHelper::applyCombinationRegression(reco::GsfElectron& ele) const
combinedMomentum);

ele.setP4(reco::GsfElectron::P4_COMBINATION, newMomentum, combinedMomentumError, true);
ele.setMass(0.0);
}
}
10 changes: 9 additions & 1 deletion RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -967,19 +967,23 @@ 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.0);
} else if (candidateP4type_ == "fromRegression1") {
newCandidate.setP4(newCandidate.p4(reco::Photon::regression1));
newCandidate.setCandidateP4type(reco::Photon::regression1);
newCandidate.setMass(0.0);
} else if (candidateP4type_ == "fromRegression2") {
newCandidate.setP4(newCandidate.p4(reco::Photon::regression2));
newCandidate.setCandidateP4type(reco::Photon::regression2);
newCandidate.setMass(0.0);
} else if (candidateP4type_ == "fromRefinedSCRegression") {
newCandidate.setP4(newCandidate.p4(reco::Photon::regression2));
newCandidate.setCandidateP4type(reco::Photon::regression2);
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());
math::PtEtaPhiMLorentzVector p4(gamma_momentum.rho(), gamma_momentum.eta(), gamma_momentum.phi(), 0.0);
newCandidate.setP4(p4);
newCandidate.setCandidateP4type(reco::Photon::ecal_photons);
// Make it an EE photon
Expand Down Expand Up @@ -1110,15 +1114,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.0);
} else if (candidateP4type_ == "fromRegression1") {
newCandidate.setP4(newCandidate.p4(reco::Photon::regression1));
newCandidate.setCandidateP4type(reco::Photon::regression1);
newCandidate.setMass(0.0);
} else if (candidateP4type_ == "fromRegression2") {
newCandidate.setP4(newCandidate.p4(reco::Photon::regression2));
newCandidate.setCandidateP4type(reco::Photon::regression2);
newCandidate.setMass(0.0);
} else if (candidateP4type_ == "fromRefinedSCRegression") {
newCandidate.setP4(newCandidate.p4(reco::Photon::regression2));
newCandidate.setCandidateP4type(reco::Photon::regression2);
newCandidate.setMass(0.0);
}

outputPhotonCollection.push_back(newCandidate);
Expand Down

0 comments on commit 27a732f

Please sign in to comment.