Message: Classification of new track: How to stop killing tracks? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Classification of new track: How to stop killing tracks? 

Forum: Event and Track Management
Date: 23 Feb, 2017
From: Patrick Asenov <Patrick Asenov>

Greetings, colleagues, comrades and friends!

I've been trying to implement the G4ClassificationOfNewTrack inside my However, whenever I try to visualize the trajectories of secondary particles using OGL, I am not able to see any of them. I believe that this is due to the fact that I delete all the new tracks immediately with the command

return fKill;

while not storing them in any stack.

But what should be returned instead of fKill??? fUrgent, fWaiting, fPostpone?? They all end up in the same warning message: Segmentation fault (core dumped).

Do you have any suggestions? I would be thankful if I were given a helping hand.

Here's my code:

StackingAction::ClassifyNewTrack(const G4Track* track)
  //keep primary particle
  if (track->GetParentID() == 0) return fUrgent;

  //energy spectrum of secondaries
  energy = track->GetKineticEnergy();
  charged = (track->GetDefinition()->GetPDGCharge() != 0.);
  G4VPhysicalVolume* volume = track->GetVolume();

  //kinetic energy of secondaries calculation
  if (volume == fDetectorconstruction->GetDet1()) {
    G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();

    if (charged) {
    } else {


  if (volume == fDetectorconstruction->GetDet2()) {
    G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();

    if (charged) {
    } else {


  return fKill; // This might be the source of all trouble!!

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

1 Feedback: Re: Classification of new track: How to stop killing tracks?   (Gumplinger Peter - 23 Feb, 2017)
(_ Ok: Re: Classification of new track: How to stop killing tracks?   (Patrick Asenov - 24 Feb, 2017)
 Add Message Add Message
to: "Classification of new track: How to stop killing tracks?"

 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 ]