Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • nptool nptool
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • np
  • nptoolnptool
  • Issues
  • #55
Closed
Open
Issue created Nov 27, 2018 by Greg Christian@gchristianDeveloper

Problem with Short-Lifetime Decays

I've discovered a problem with the new way that decays are handled in nptool simulations. The mother nucleus for decays with a short lifetime ends up having a kinetic energy that is far below what it should be.

Within the file Process/Decay.cc, we have the following lines:

  double energy = PrimaryTrack->GetKineticEnergy();
  double time = PrimaryTrack->GetGlobalTime();

  // Randomize within the step
  // Assume energy loss is linear within the step
  // Assume no scattering
  double rand =  G4RandFlat::shoot(); 
  double length = rand*(m_PreviousLength); 
  energy += (1-rand)*(m_PreviousEnergy-energy); 

The intent is that the initial kinetic energy for the decay process is chosen randomly from within the step where the decay is supposed to happen. However, this causes a problem for very short lifetime decays, where the decay happens in the first step following the reaction that proceeds the decay.

When this happens, PreviousEnergy is equal to zero, and so the generated energy ends up being randomly distributed between 0 and the correct energy.

The easiest way I can think of to fix this is to have a check if(PreviousEnergy > 0) before doing the randomization (otherwise just leave energy = PrimaryTrack->GetKineticEnergy();). But maybe there is a more robust way, for example checking the step number or something like that.

Assignee
Assign to
Time tracking