Skip to content

Commit

Permalink
Merge pull request #42250 from sbein/from-CMSSW_13_2_X_2023-07-11-2300
Browse files Browse the repository at this point in the history
Preserve electron mass after FastSim Bremsstrahlung emmision
  • Loading branch information
cmsbuild authored Jul 14, 2023
2 parents 058ca1a + 8cf798e commit 018666c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ void fastsim::Bremsstrahlung::interact(fastsim::Particle& particle,
// Needed to rotate photons to the lab frame
double theta = particle.momentum().Theta();
double phi = particle.momentum().Phi();
double m2dontchange = particle.momentum().mass() * particle.momentum().mass();

// Calculate energy of these photons and add them to the event
for (unsigned int i = 0; i < nPhotons; ++i) {
Expand All @@ -155,6 +156,10 @@ void fastsim::Bremsstrahlung::interact(fastsim::Particle& particle,

// Update the original e+/-
particle.momentum() -= photonMom;
particle.momentum().SetXYZT(particle.momentum().px(),
particle.momentum().py(),
particle.momentum().pz(),
sqrt(pow(particle.momentum().P(), 2) + m2dontchange));
}
}

Expand Down

0 comments on commit 018666c

Please sign in to comment.