Skip to content
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
8 changes: 6 additions & 2 deletions converter/src/DelphesEDM4HepConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,12 @@ void DelphesEDM4HepConverter::processTracks(const TClonesArray* delphesCollectio
auto cand = particleCollection->create();
cand.setCharge(delphesCand->Charge);
const auto momentum = delphesCand->P4();
cand.setEnergy(momentum.E());
cand.setMomentum({(float)momentum.Px(), (float)momentum.Py(), (float)momentum.Pz()});

//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.
cand.setMass(trackMass);
Expand Down
Loading