Visualizatio of particle track

I want to visualize the tracks. Duo to this I add the following portion to my sim.C file to generate GeoTracks

CbmTrajFilter *trajFilter = CbmTrajFilter::Instance();
trajFilter->SetStepSizeCut(1.); // 1 cm
trajFilter->SetEnergyCut(1.); // Etot > 1 GeV
} [/color]
My sim.C runs successfully and generate GeoTracks

The I write the following macro to have the visualization
TFile* f = new TFile(“auaumbias.root”);
TTree *t=f->Get(“cbmsim”) ;

TClonesArray fT=new TClonesArray(“TGeoTrack”);
t->SetBranchAddress(“GeoTracks”,&fT) ;
TGeoManager geoMan = (TGeoManager) f->Get(“CBMGeom”);
c1 = new TCanvas(“c1”, “”, 100, 100, 800, 800);

TGeoTrack *tr;

for (Int_t j=0; j< t->GetEntriesFast(); j++) {
for (Int_t i=0; iGetEntriesFast(); i++) {
tr=(TGeoTrack *)fT->At(i);


But on running this, the following error comes-----
[color=#0000FF]====================Error massage====================
Error:illegal pointer to class object geoMan 0x0 1145
*** Interpreter error recovered ***

Can anyone help me…[/color]


How can we help you?

You are trying to read an object from “auaumbias.root”, and the pointer is 0. Is “auaumbias.root” something well-known to everybody?

P.S. If you got null from f->Get("…, your file does not have such an object.

Thanks for your nice comment…

It’s really nice indeed, since the description of your problem is not very informative.
You tried to read an object from your file and got null-pointer. So you have to check your file - for example, as soon as I know nothing about this file (who created it, what was written into this file, etc.), I have no idea why it does not contain geomanager.

You can, for example, start from very simple thing: call ls() for your file and show it’s output.