#ifndef ETA_INTERPOLATION_POSXY_H #define ETA_INTERPOLATION_POSXY_H //#include "tiffIO.h" #include "etaInterpolationBase.h" #include "eta2InterpolationBase.h" #include "eta3InterpolationBase.h" class etaInterpolationPosXY : public virtual etaInterpolationBase{ public: etaInterpolationPosXY(int nx=400, int ny=400, int ns=25, int nb=-1, double emin=1, double emax=0) : etaInterpolationBase(nx,ny,ns, nb, emin,emax){ // cout << "epxy " << nb << " " << emin << " " << emax << endl; cout << nbeta << " " << etamin << " " << etamax << endl; }; etaInterpolationPosXY(etaInterpolationPosXY *orig): etaInterpolationBase(orig) {}; virtual etaInterpolationPosXY* Clone()=0; /* { */ /* return new etaInterpolationPosXY(this); */ /* }; */ virtual void prepareInterpolation(int &ok) { ok=1; #ifdef MYROOT1 if (hhx) delete hhx; if (hhy) delete hhy; hhx=new TH2D("hhx","hhx",heta->GetNbinsX(),heta->GetXaxis()->GetXmin(),heta->GetXaxis()->GetXmax(), heta->GetNbinsY(),heta->GetYaxis()->GetXmin(),heta->GetYaxis()->GetXmax()); hhy=new TH2D("hhy","hhy",heta->GetNbinsX(),heta->GetXaxis()->GetXmin(),heta->GetXaxis()->GetXmax(), heta->GetNbinsY(),heta->GetYaxis()->GetXmin(),heta->GetYaxis()->GetXmax()); #endif ///*Eta Distribution Rebinning*/// double bsize=1./nSubPixels; //precision // cout<<"nPixelsX = "<=0 && etax<=1) hx[iby]=heta[iby+ib*nbeta]; else { hx[iby]=0; } // tot_eta_x+=hx[iby]; if (etax>=0 && etax<=1) hy[iby]=heta[ib+iby*nbeta]; else hy[iby]=0; // tot_eta_y+=hy[iby]; } hix[0]=hx[0]; hiy[0]=hy[0]; for (int iby=1; iby(ii+1)*tot_eta_x*bsize) { //if (hix[ibx]>tot_eta_x*(ii+1)/nSubPixels) ii++; hhx[ibx+ib*nbeta]=hix[ibx]/tot_eta_x; } } /* if (ii!=(nSubPixels-1)) */ /* cout << ib << " x " << tot_eta_x << " " << (ii+1)*tot_eta_x*bsize << " " << ii << " " << hix[nbeta-1]<< endl; */ ii=0; for (int ibx=0; ibxtot_eta_y*(ii+1)/nSubPixels) ii++; hhy[ib+ibx*nbeta]=hiy[ibx]/tot_eta_y; } } } int ibx, iby, ib; iby=0; while (hhx[iby*nbeta+nbeta/2]<0) iby++; for (ib=0; ib