No histo plot

Hi all,
my first thread to which I could not find help in the previous thread.
I’m using ROOT 5.26 for historical reasons.

The histogram are not empty when saved to file. I have only the canvas and two pads.
If you could please help understanding why they are empy and how to fix it.
Thanks a lot.
John Zipulis

void convolvehisto(Int_t nrespar, Double_t *ccc) {
    Int_t i;

//                              name  title
    TCanvas *c11 = new TCanvas("c11","canvas",1);
// make it 2 x n     
// [1] [2]
// .......
// [n] [2n]
    c11->Divide(2,nset);
    for (i=0; i<nset; i++) {
        c11->cd(2*i+1);
        h_simu_ch=Ecal_1D(h_simu[i],param); /*E to CH but no rebin*/
        h_simu_ch->GetXaxis()->SetRange(3,h_simu_ch->GetNbinsX());
        h_simu_ch->SetLineColor(kBlue);
        h_simu_ch->Draw("HIST");
        if (doconv[i] == 1) 
            h_conv = convolve(h_simu_ch, nrespar, ccc);
        else
            h_conv = h_simu_ch;
        c11->cd(2*i+2);
        h_conv->GetXaxis()->SetRange(3,h_conv->GetNbinsX());
        h_conv->SetLineColor(kRed);
        h_conv->Draw("HIST");
        
        delete h_simu_ch;
        delete h_conv;
        
    }

}

Try to use “DrawCopy” instead of “Draw”.

And, you should have:
if (h_conv != h_simu_ch) delete h_conv;
delete h_simu_ch;

Thanks, that worked!