Message: Inconsistent number of tracks? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Inconsistent number of tracks? 

Forum: Event and Track Management
Date: 26 Jul, 2007
From: Adam <ax_blais@laurentian.ca>

In the SteppingAction class that is part of example N02, there is the following code that prints the number of trajectories in the event:

 G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
  G4int n_trajectories = 0;
  if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();

 if (event_id < 100 || event_id%100 == 0) {
    G4cout << ">>> Event " << evt->GetEventID() << G4endl;
    G4cout << "    " << n_trajectories 
           << " trajectories stored in this event." << G4endl;
  }

I made my own TrackingAction class, with the simple code of :

void ExN02TrackingAction::PostUserTrackingAction(const G4Track* track)
{
  number_of_tracks++;
}

For the first event, the first method returns 29396 trajectories, and the second method returns 29485 tracks. Why is this different? They should be the same.

In fact, for every event, the second method seems to count more tracks.

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

 Add Message Add Message
to: "Inconsistent number of 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 ]