Unfortunatelly there is no example like rootgeom.C for drawing tracks. I’ve created this feature some time ago because there were no other tools to inspect by eye the results of tracking. The TGeoTrack objects are however limited to the pad (no 3D viewer) and hopefully all their functionality will be very soon implemented in the TViewer3D API. Anyway, an example of their usage can be found in the geant3 module from ROOT CVS, namely in: geant3/TGeant3/TGeant3gu.cxx::gustep() inside the block : #if defined(COLLECT_TRACKS)
[quote]1) I’m assuming that you initialize and add tracks after you close a geometry. Is this correct?
[/quote]
Yes
[quote]2) Should all tracks be added using TGeoManager::AddTrack?
[/quote]
No, only primaries. For secondaries you have to call the AddTrack method of some primary.
[quote]
3) What is the difference between CreateTrack and AddTrack? [/quote]
MakeTrack creates a track while AddTrack creates a primary track (adds the track to the list of primaries of TGeoManager)
The particle input is optional and can be used as a hook to your real track object.