Dear VMC group,
I suppose that VMC interface to G3, G4 via root also assumes that a user
can
desire to use root visualization of both the detector and the tracks
produced. If
this is correct than I think that TGeoTrack is a tool created for
visualization of tracks.
I am trying to use it like:
MCApplication::PreTrack()
Int_t id = fStack->GetCurrentTrackNumber();
Int_t pdgcode = gMC->TrackPid();
TLorentzVector position;
gMC->TrackPosition(position);
fStack->PreTrack(id, pdgcode, position);
and in
void MCStack::PreTrack(Int_t id, Int_t pdgcode, TLorentzVector position) {
//
//
//
if (!gGeoManager) Fatal("PreTrack","No gGeoManager");
gGeoManager->AddTrack(id,pdgcode);
TGeoTrack *newtrack = (TGeoTrack*)gGeoManager->GetTrackOfId(id);
newtrack->AddPoint(position.X(),position.Y(),position.Z(),position.T());
<skip>
Also to update I refer to the track via its Uid. In principle it works
but there are however
some things where I am not sure if I use them propely:
This forces me to use gGeoManager->GetTrackOfId(id) which is quite time consuming.
gGeoManager->GetTrack(id) works only for G4 and make crash for G3 because of
difference in the tracking sequence.
2. When the tracks are drawn I obviuosly need to reset them for the next event. This I do with:
gGeoManager->ClearTracks();
This method deletes all objects from gGeoManager::fTracks For energies
of 1 TeV and with hadronic switch on
(in g4config.in /mcPhysics/setHadron 1 if I am not mistaken here) it
takes quite a lot of time
to remove all tracks from gGeoManager. Is it an expected behaviour?
Thank you in advance,
Dmitry
Received on Wed Jun 01 2005 - 12:55:38 MEST
This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:55:21 MET