Visualizatio of particle track

Hellow,
I want to visualize the tracks. Duo to this I add the following portion to my sim.C file to generate GeoTracks
[color=#FF0000]"…

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

The I write the following macro to have the visualization
[color=#FF0000]"gSystem->Load(“libGeom.so”);
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”);
TCanvas
c1 = new TCanvas(“c1”, “”, 100, 100, 800, 800);

geoMan->GetVolume(“magnet”)->Draw(“same”);
TGeoTrack *tr;

for (Int_t j=0; j< t->GetEntriesFast(); j++) {
t->GetEntry(j);
for (Int_t i=0; iGetEntriesFast(); i++) {
tr=(TGeoTrack *)fT->At(i);
tr->Draw(“same”);
}

}[/color]
"

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

Can anyone help me…[/color]

Regards
Kalyan

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.

f->ls()