Problem in drawing canvases

Dear all,
I think I have a silly problem with TCanvas.

Here you have a method I’m using to draw tracks:

void SbtTrackViewer::DrawListOfEvents( std::vector<SbtEvent*> aListOfEvents, int pid ) { for ( Int_t iEvt = 0; iEvt < aListOfEvents.size(); iEvt++ ) { char canvName[100]; sprintf(canvName,"trackViewer_%d",_nCanvases); std::cout << "CanvName = " << canvName << "\n"; TCanvas *c = new TCanvas(canvName,canvName,800,600); c->cd(); std::cout << "Event # " << iEvt << "\n"; SbtEvent* anEvent = aListOfEvents[iEvt]; DrawEvent( anEvent, pid ); c->Modified(); c->Update(); char fileCanvName[100]; sprintf(fileCanvName,"%s/%s.pdf","plots",canvName); std::cout << "fileCanvName = " << fileCanvName << "\n"; gPad->Update(); c->SaveAs(fileCanvName); _theListOfCanvas.push_back( c ); _nCanvases++; } }

The point is that all the Canvas are created, all of them are saved in its own pdf file, but all of them are completely empty (as you can see in attachment)… what’s wrong here?

Many thanks in advance!

Regards,
Marco
trackViewer_0.pdf (11.4 KB)

I created a vector of TCanvas; I filled it with ‘new’ TCanvas.

Sorry for the noise

Marco