Skip to content

Compute particle energy is negative value passed to AddTrack#3711

Merged
sawenzel merged 2 commits into
AliceO2Group:devfrom
preghenella:rdev-addtrack-fix-energy
Jun 4, 2020
Merged

Compute particle energy is negative value passed to AddTrack#3711
sawenzel merged 2 commits into
AliceO2Group:devfrom
preghenella:rdev-addtrack-fix-energy

Conversation

@preghenella

Copy link
Copy Markdown
Collaborator

This commit fixes a issue that could happen in case of user-defined event generators that attempt to directly add tracks via the

virtual void AddTrack(Int_t pdgid, Double_t px, Double_t py, Double_t pz,
                        Double_t vx, Double_t vy, Double_t vz,
                        Int_t parent = -1, Bool_t wanttracking = true,
                        Double_t e = -9e9, Double_t tof = 0.,
                        Double_t weight = 0., TMCProcess proc = kPPrimary);

method and do not specify a valid energy, that is they use the default.

For the cases where a negative energy is passed, a protection must be taken in the method to convert the negative value to a reasonable value. If the particle PDG id is known, than the mass is retrieved and the energy computed. Otherwise zero mass is assumed.

@preghenella preghenella requested a review from sawenzel as a code owner June 4, 2020 13:01
@sawenzel sawenzel merged commit 35f4265 into AliceO2Group:dev Jun 4, 2020
@preghenella preghenella deleted the rdev-addtrack-fix-energy branch June 16, 2020 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants