I am using root 4.02/00 on win2k
I have a TF2 function, *f and TProfile2D profile, *p defined over the exact same range of (x,y) and I would like to do
p->Multiply(f,1.)
but a “not implemented” message appeared. So I did something likefor(int ix=1;ix<=p->GetNbinsX();ix++){
double x = p->GetXaxis()->GetBinCenter(ix);
for(int iy=1;iy<=p->GetNbinsY();iy++){
double y = p->GetYaxis()->GetBinCenter(iy);
p->SetBinContent(ix,iy,f->Eval(x,y)*p->GetBinContent(ix,iy))
p->SetBinError(ix,iy,f->Eval(x,y)*p->GetBinError(ix,iy))
}
}
but it does’nt really work as I expected - my function evaluates to 1 (within a few percent), but the resulting p changes my much more than a percent (e.g. changes by factors of hundreds!) What am I failing to do. I suspect my approach would work with a TH2…
Thanks.
Ed Oltman