Skip to content
Snippets Groups Projects
Commit 757e37ca authored by Zach Marshall's avatar Zach Marshall
Browse files

Adding catch for decaying R-Hadrons to be added to track records

This will be useful for short(ish) lifetime simulation, where particles
may decay before coming to rest completely, but still out of time.


Former-commit-id: 23b00419bd4e489bb3f65696b7e18432aadd4cb6
parent ef58c898
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,8 @@
#include "G4Element.hh"
#include "G4SDManager.hh"
#include "G4VSensitiveDetector.hh"
#include "G4VProcess.hh"
#include "G4ProcessType.hh"
#include <cmath>
......@@ -51,9 +53,10 @@ namespace G4UA
void StoppedParticleAction::UserSteppingAction(const G4Step* aStep)
{
// Trigger if the energy is below our threshold or if the time is over 150 ns
// Trigger if the energy is below our threshold or if the R-hadron is decaying
int id = std::abs(aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetPDGEncoding());
// Special treatment for SUSY particles and R-hadrons
if (id>=1000000 && id<=1100000 &&
isSUSYParticle(id)){
......@@ -65,7 +68,12 @@ namespace G4UA
minA=mat->GetElement(i)->GetN();
}
}
if (aStep->GetPostStepPoint()->GetVelocity()>0.15*std::pow(minA,-2./3.)*CLHEP::c_light) return;
// Stopping condition
if (aStep->GetPostStepPoint()->GetVelocity()>0.15*std::pow(minA,-2./3.)*CLHEP::c_light && // Stopping condition or...
( !aStep->GetPostStepPoint()->GetProcessDefinedStep() || // null pointer?
aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessType()!=fDecay) ) // Decaying particle (does not fire for hadronic interactions)
return;
if (!m_init){
m_init = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment