My method reads:
void Load_Data_Files::DrawPolFile()
{
//
// Plot polarisation file;
// Create one pad/polar
//
Int_t w = 100;
Int_t h = 100;
Int_t wid = fEcanvas->GetCanvasWindowId();
TCanvas *c1 = new TCanvas(“c”, w, h,wid);
c1->Clear();
int nr_col_pads = (int)hist_stack_channels.size()/2 + (int)fmod(hist_stack_channels.size(),2);
c1->Divide(2,nr_col_pads);
fEcanvas->AdoptCanvas(c1);
gr_err.resize((int)hist_stack_channels.size());
for (int i = 0; i < (int)hist_stack_channels.size(); ++i)
{
c1->cd(i+1);
// use TGraphErrors class to Draw
gr_err[i] = new TGraphErrors(hist_stack_channels[i]);
gr_err[i]->Draw(“AP”);
gr_err[i]->SetTitle(tasp_par.fName_selected);
TAxis *tmpaxis = gr_err[i]->GetXaxis();
tmpaxis->SetTitle(tasp_par.ScanVarLabel);
}
c1->Modified();
c1->Update();
}
The problem does not seem to happen if there is only one pad on the canvas so I suspect that the
crash is due to
hist_stack_channels
which are defined as :
std::vector<TH1F*> hist_stack_channels;
in the header file.
I have root5.26. I can attach the core file if it helps.
I attached the program as I do not know how to extract the part that causes the trouble quickly. I hope
it will be easy to install it. There is a Makefile. Please do first make NFitDict.cxx (the Makefile
does not compile the dictionary itself…). You should get a program called Nfit in the …/bin directory.
If you run it you will have in tab bar a “file” menu. The first item is “LoadFile”, with which you should be
able to load the data file ‘tasp2010n004629.dat’. Please select it and then click on the “Load File” button.
Then 6 histograms should be plotted on 6 pads. Trying to open the fit panel will make the program
crash. I think this does not happen with Root5.26.
I’ll try to debug it as soon as I manage to compile it (there are plenty of errors)…
And BTW, how did you manage to get a Makefile of more than 2000 lines?
OK thanks. So I confirm that it works with the svn trunk version of ROOT. Can you switch to another version of ROOT, or do you have to use 5.22.00? Since 5.22.00 is quite old (there were quite some changes) and debugging this kind of problem could take some time…
Cheers, Bertrand.