Hi,
I am trying to visualize tracks in Geant4VMC example3 (macro
run_g4(“g4tgeoConfig.C”)) superimposed over the TGeo geometry (in a Canvas
or better in OpenGL).
Actually the tracks are visualized only in G4visualization mode.
I created the TGeoTrack in Ex03MCApplication::PreTrack() in this way:
Int_t theCurrentTrackId = gMC->GetStack()->GetCurrentTrackNumber();
TParticle* theCurrentParticle=gMC->GetStack()->GetCurrentTrack();
Int_t
theTGeoTrack_index=gGeoManager->AddTrack(theCurrentTrackId,theCurrentParticle->GetPdgCode(),theCurrentParticle);
TVirtualGeoTrack* theTGeoTrack=gGeoManager->GetTrack(theTGeoTrack_index);
Then I have to AddPoints to track and Draw with:
theTGeoTrack->AddPoint(Xtrack,Ytrack,Ztrack,Ttrack);
gGeoManager->DrawTracks("/*");
My question is how can I have access to all points of a track for each step, in order to fill in AddPoint? Should I use
TG4StepManager GetTrack() method, and then G4Track method GetPosition()?
Is my procedure correct?
Could you help me?
Thanks a lot in advance.