Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix energy #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion converter/src/DelphesEDM4HepConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ void DelphesEDM4HepConverter::processTracks(const TClonesArray* delphesCollectio
auto cand = particleCollection->create();
cand.setCharge(delphesCand->Charge);
const auto momentum = delphesCand->P4();
cand.setEnergy(momentum.E());
//Particle masses in Delphes are 0, so the energy should be recalculated if ones sets the mass to something else
//cand.setEnergy(momentum.E());
cand.setEnergy(sqrt(momentum.Px()*momentum.Px() + momentum.Py()*momentum.Py() + momentum.Pz()*momentum.Pz()) + trackMass*trackMass);
cand.setMomentum({(float) momentum.Px(), (float) momentum.Py(), (float) momentum.Pz()});
// At this point indiscriminantly set the mass for each track. If this is a
// muon or an electron, the mass will be set to the appropriate value later.
Expand Down