Message: Re: information on secondaries Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: information on secondaries 

Forum: Event and Track Management
Re: Question information on secondaries (David Barton)
Re: None Re: information on secondaries (michel maire)
Date: 23 Sep, 2010
From: Pedro Arce <Pedro Arce>

Sorry to correct you Michel, but the class you mention is using

  G4TrackVector* secondary = fpSteppingManager->GetSecondary();

and this gives you the list of all secondaries created from the beginning of the track, not only those created in the current step (what in your example does not matter, as you kill the event after the first interaction).

To get the list of secondaries created in one step one has to do something a bit more complicated:

  // number of secondaries in current step
  unsigned int nSecoStep = fpSteppingManager->GetfN2ndariesAtRestDoIt() + fpSteppingManager->GetfN2ndariesAlongStepDoIt() + fpSteppingManager->GetfN2ndariesPostStepDoIt();
  // list of secondaries since the beginning of track 
  G4TrackVector* secondaryTracks = fpSteppingManager->GetSecondary();
  unsigned int nSecoTrack = secondaryTracks->size();
  // extract the last stepNseco tracks from the list 
  for( unsigned int ii = nSecoTrack-1; ii <= nSecoTrack-nSecoStep; ii++ ){
    G4Track* secoTrack = (*secondaryTracks)[ii];
  }

Pedro

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

1 None: Re: information on secondaries   (michel maire - 23 Sep, 2010)
2 None: Re: information on secondaries   (David Barton - 23 Sep, 2010)
1 None: Re: information on secondaries   (Pedro Arce - 23 Sep, 2010)
 Add Message Add Message
to: "Re: information on secondaries"

 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 ]