Dividing TProfile by TH1D

Hii,

I’m unsuccessfully trying to divide a TProfile by a TH1D in the following way:

TFile p1306_ICDcorr(“output/p1306_EM_50_0_hist.root”);
TFile p1306_noICDcorr(“output/p1306_EM_51_0_hist.root”);
TH2F *h1 = (TH2F *) p1306_ICDcorr.Get(“tt1_tauem_pt_icdf”);
TH2F *h2 = (TH2F *) p1306_noICDcorr.Get(“tt1_tauem_pt_icdf”);
h1->ProfileX(“test1”,0,150,“d”);
TProfile *hnew1 = test1->Rebin(5,“hnew1”);
hnew1->SetMinimum(0.);
hnew1->SetMaximum(1.8);
hnew1->Draw();

h2->Draw();
h2->ProfileX(“test2”,0,150,“d”);
TProfile *hnew2 = test2->Rebin(5,“hnew2”);
hnew2->SetMinimum(0.);
hnew2->SetMaximum(1.8);
hnew2->Draw();
TH1D *sum = hnew2.ProjectionX()
hnew1->Divide(sum)

I get the following error message:
Error in TProfile::Divide: Attempt to divide a non-profile object

Any help?

Cheers,
Carsten

Hi Carsten,

In the CVS version, I have implemented the possibility to divide a TProfile by a histogram.

Rene