TPaveLabel problem

Hi all,

I can’t display a TPaveLabel on an external C++ program linked with ROOT libraries.
I searched a very long time where could be located my error but I can’t find it.

Can anybody help me ?

Here is the script:

[code]
#include <analyse.h>

void histos_sat(const char *path)
{
unsigned short flag = 0;
long int i = 0;
char *output;
const char *ext = “.histos_sat.root”;
DAQMess_t d1, d2;
char content[2][2][32];
TCanvas *canvas = new TCanvas(“histo”, “Canvas”);
TH1I *h = new TH1I(“h1”, “histo nr: 1”, 100, -50, 50);
TPaveText *TPT = new TPaveText(0.6, 0.3, 0.9, 0.80, “NDC”);
TFile *f = new TFile((const char *) path, “READ”);
TTree *t = (TTree *) f->Get(“T”);
long int nentries = t->GetEntries();

t->SetBranchAddress("Detector1", &d1);
t->SetBranchAddress("Detector2", &d2);

t->GetEntry(0);

sprintf (content[0][0],"%s %i", "svid_h1: ", (int)d1.svid_h);
sprintf (content[0][1],"%s %i", "svid_l1: ", (int)d1.svid_l);
sprintf (content[1][0],"%s %i", "svid_h2: ", (int)d2.svid_h);
sprintf (content[1][1],"%s %i", "svid_l2: ", (int)d2.svid_l);
TPT -> AddText((const char*)content[0][0]);
TPT -> Draw();

h->Fill(diff_daq_mess(d1, d2));
for (i = 1; i < nentries; i++) {
    t->GetEntry(i);
    h->Fill(diff_daq_mess(d1, d2));
}
h->SetFillColor(42);
h->Fit("gaus");

}[/code]

And the histogram looks like this:

And the TPaveText isn’t displayed…

Thank you,

Arnaud.

Move the statement
TPT->Draw();
after
h->Fit(“gaus”); //this statemnt clears the pad

Rene

Indeed :wink:

Thank you !

Arnaud.