1 void testInterpolator()
9 Float_t *data0 = new Float_t[npoints*2];
12 data[1] = &data0[npoints];
13 for (Int_t i=0;i<npoints;i++) {
14 data[1][i]= gRandom->Gaus(.5, .1);
15 data[0][i]= gRandom->Gaus(.5, .1);
17 TKDInterpolator *in = new TKDInterpolator(npoints, 2, bsize, data);
19 TH2 *hS = new TH2F("hS", "", 10, .3, .7, 10, .3, .7);
20 TAxis *ax = hS->GetXaxis(), *ay = hS->GetYaxis();
22 for(int ix=1; ix<=ax->GetNbins(); ix++){
23 p[0] = ax->GetBinCenter(ix);
24 for(int iy=1; iy<=ay->GetNbins(); iy++){
25 p[1] = ay->GetBinCenter(iy);
27 //printf("x %f y %f eval %f [%d]\n", p[0], p[1], eval, TMath::IsNaN(eval));
28 if(!TMath::IsNaN(eval)) hS->SetBinContent(ix, iy, eval);