Dear Experts,
I am trying to plot in 16 canvases my 256 histograms which I have already stored in root file , subdirectory.
I am getting first 16 histos in first canvas, then next 15 in second, and then my session crashes like in bottom part of my message.
If I don’t draw the histos , the root allows me to plotthem by hand.
Here is my small macro:
Thanks in advance
Avetik
TFile *f = new TFile("tst337.root");
f.ls();
f.cd("TimetoRefChan");
f->GetListOfKeys()->Print();
//f->cd("subdirectory")
TIter next(gDirectory->GetListOfKeys());
//create windows and fill with histograms, save them if filename is not empty
printf("Drawing histograms...\n");
//AAA f.ls();
char name2[40];
char name[40];
char hname[40];
TCanvas *c1[16];
Double_t s=0;
for(Int_t i=0;i<16;i++)
{
sprintf(name,"overview timeDiff %02d",i);
c1[i]=new TCanvas(name2,name,1000,1000);
c1[i]->Divide(4,4);
for(Int_t j=1;j<=16;j++)
{
c1[i]->cd(j);
sprintf(name2,"TimetoRefChan/TimetoRefChan%02d;1",(j+i*16)-1);
sprintf(hname,"TimetoRefChan%02d",((j+i*16)-1));
printf("Name2 = %\s\n",name2);
printf("hname = %\s\n",hname);
TH1D *hhh; f->GetObject(name2,hhh);
hhh->Draw();
}
}
/////////////////////////////////////////////////////////////////////////////
printf("done...\n");
}
-----------------------output after plotting histo 31-----------------------------
*** Break *** segmentation violation