Skip to content

Commit

Permalink
Fix: Convert half life to life time in GenericSource
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrah committed Aug 15, 2023
1 parent 33321de commit 9eb5bf0
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions core/opengate_core/opengate_lib/GateGenericSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,15 +481,19 @@ void GateGenericSource::InitializeEnergy(py::dict puser_info) {

void GateGenericSource::InitializeHalfTime(G4ParticleDefinition *p) {
// Set lifetime to value retrieved from user option
p->SetPDGLifeTime(fHalfLife);

// FIXME: is this correct? The code below simply retrieves the
// the value that has been set above...
// Special case to retrieve the PDGLife Time
// However, for F18, the LifeTime is 9501.88 not 6586.26 ?
// So we don't use this for the moment
if (fHalfLife == -2) {
fHalfLife = p->GetPDGLifeTime();
fLambda = log(2) / fHalfLife;
}
// if the user set a valid (positive) half life
// might need reviewing of user_info handling on python side
if (fHalfLife > 0) {
p->SetPDGLifeTime(fHalfLife / 0.69314); // life_time = half_life / ln(2)
}

// // FIXME: is this correct? The code below simply retrieves the
// // the value that has been set above...
// // Special case to retrieve the PDGLife Time
// // However, for F18, the LifeTime is 9501.88 not 6586.26 ?
// // So we don't use this for the moment
// if (fHalfLife == -2) {
// fHalfLife = p->GetPDGLifeTime();
// fLambda = log(2) / fHalfLife;
// }
}

0 comments on commit 9eb5bf0

Please sign in to comment.