(sorry if this is a multiple post, I sent it to roottalk but did not recieve yet a confirmation that it reached the list)
Dear rooters,
could you please advise me how to use TGeoManager::AnimateTracks() properly? It does not look to be working as expected.
At astronu.jinr.ru/wiki/upload/5/5e/Test.tgz one could find both macro and the root file with tracks.
If I run it with gGeoManager->AnimateTracks(tmin,tmax); (see this line in code please)
it draws me immediately only one track (neutron) with a grey blob at the end and does not draw other tracks while their
end times are smaller than tmax (driven by neutron indeed)
If I try to use a piece of code below:
// or try this below
int nframes = 1;
// cout<< gGeoManager->GetNtracks()<< " "<< tmin<< " "<< tmax<<
endl;
for (int i=0; i<nframes; i++) {
double dt = (tmax-tmin)/nframes;
for (int j=0; j< gGeoManager->GetNtracks(); j++) {
TVirtualGeoTrack track = gGeoManager->GetTrack(j);
double x,y,z,t;
int k = track->GetNpoints()-1;
track->GetPoint(k,x,y,z,t);
if (t< tmin+dt(i+1)) cout<< "track : "<< j<< " "<<
track->GetPDG()<< " "<< t<< " "<< tmin+dt*(i+1)<< endl;
}
gGeoManager->SetTminTmax(tmin, tmin+dt*(i+1));
// gGeoManager->SetTminTmax(tmin, 999.);
gGeoManager->DrawTracks();
gPad->Modified();
gPad->Update();
gSystem->Sleep(1000/nframes);
}
it does not work either. It seems that SetTminTmax cuts tracks with their end times smaller than tmax. Is this expected? If so, how can I make a drawing as a time sequence?
Thank you, Dmitry