Message: Re: Please help me to write Track ID and KE to a file Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Please help me to write Track ID and KE to a file 

Forum: Event and Track Management
Re: Question Please help me to write Track ID and KE to a file
Date: 10 Dec, 2006
From: Anton <Anton>

Dear, Pushpa,

> Please help me to write "TrackID" and "Kinetic Energy" of created particles into a file.
The best way to save information about just created particles is to
implement your own G4UserStackingAction (please, read careful topic
[6.2 Optional User Actions] in Geant4 User's Guide: For Application
Developers).

In your own implementation you only need to redefine
ClassifyNewTrack() method, for example:


G4ClassificationOfNewTrack StackingAction::ClassifyNewTrack(const G4Track* aTrack)
{
  G4String  name = aTrack->GetDefinition()->GetParticleName();
  G4int  trackid = aTrack->GetTrackID();
  G4double kinen = aTrack->GetKineticEnergy();

  cout << name << trackid << kinen << endl;

  return fWaiting;
}


-- 
Best regards,
 Anton                            mailto:tosha_korneev@tut.by

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

 Add Message Add Message
to: "Re: Please help me to write Track ID and KE to a file"

 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 ]