Message: Using fStopAndKill in tracking action on secondaries causes segfaults Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Using fStopAndKill in tracking action on secondaries causes segfaults 

Forum: Event and Track Management
Date: 02 Nov, 2018
From: Ron Collins <Ron Collins>

Dear Geant4 developers,

I am working on a Geant4 simulation, where I need to stop and kill all secondary tracks produced by the main particle before they interact. I have done so inside my user tracking action by accessing the secondary tracks and killing them by setting them to fStopAndKill.

This method has worked for me in the past, but recently stopped working and instead causes segmentation faults (there is no direct change to the code or any other code accessing the secondaries, nor does reverting to older version where it used to work help). The seg fault occurs after reaching the end of the user tracking action, so pinpointing when the segfault occurs has been difficult. Any ideas on what may be wrong or where to start looking?

This is the basic code (stripped of anything superfluous) Iím using; the OS is CentOS 7.5.1804 and the Geant4 version is 10.01.p03:

TrackingAction::PostUserTrackingAction(const G4Track* aTrack){

G4TrackVector* secondaries = fpTrackingManager->GimmeSecondaries(); if(secondaries){ size_t n_secondaries = secondaries->size(); if(n_secondaries > 0){ for(size_t i = 0; i<n_secondaries; ++i){ (*secondaries)[i]->SetTrackStatus(fStopAndKill); } } } }

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Using fStopAndKill in tracking action on secondaries causes segfaults   (Makoto Asai - 02 Nov, 2018)
(_ None: Re: Using fStopAndKill in tracking action on secondaries causes segfaults   (Ron Collins - 05 Nov, 2018)
 Add Message Add Message
to: "Using fStopAndKill in tracking action on secondaries causes segfaults"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]