// $Id: surface.cc,v 1.2 2008-05-09 16:16:33 halo Exp $ // Author: Thomas.Eberl@ph.tum.de, last modified : 2005-11-08 14:34:49 // /************************************************************************* Purpose: calculate the hypersurface theta, delta_theta, z Input: pad table histograms All coordinates are given in meters **************************************************************************/ #ifndef __CINT__ #include #include #include #include #include "TMath.h" #include "TH2.h" #include "TH3.h" #include "TFile.h" #include "TObjArray.h" #include "TString.h" #include "TGraph.h" using namespace std; Double_t* getPolarAngleAveragedShift(const TH2D* h, const TH2D* hdef) { const Int_t iThetaBins = 79; Double_t* arr = new Double_t[iThetaBins]; for (Int_t iTheta = 0; iTheta < iThetaBins; iTheta++) { Double_t dThetaCurr = iTheta + 10.; Double_t dThetaSum = 0.; Int_t iThetaSumCnt = 0; for (Int_t i = 1; i < 96; i++) { for (Int_t j = 1; j < 96; j++) { if (hdef->GetBinContent(hdef->GetBin(i,j)) > dThetaCurr && hdef->GetBinContent(hdef->GetBin(i,j)) < dThetaCurr+1.) { dThetaSum += (h->GetBinContent(h->GetBin(i,j)) - hdef->GetBinContent(hdef->GetBin(i,j))); iThetaSumCnt++; } } } arr[iTheta] = dThetaSum / (Double_t) iThetaSumCnt; } // for (Int_t i=0; iGetBinContent(hphi->GetBin(i,j)) > dAzimCurr && hphi->GetBinContent(hphi->GetBin(i,j)) < dAzimCurr+1.) { dAzimSum += (h->GetBinContent(h->GetBin(i,j)) - hdef->GetBinContent(hdef->GetBin(i,j))); iAzimSumCnt++; } } } arr[iAzim] = dAzimSum / (Double_t) iAzimSumCnt; // arith mean of polar shifts } // for (Int_t i=2; iAdd(h); } TFile phiin("/home/teberl/d/RICH/mapping/Tables_y_z/phiref.root"); TH2D* hphi = (TH2D*) phiin.Get("phi"); fStartZ= fStartZ*1000. - 73.; fBinningZ = fBinningZ*1000.; TH2D hsurf("hsurf","hsurf",n_vertices,fStartZ,fStartZ+n_vertices*fBinningZ, iThetaBins,10.,89.); TH2D hsurfphi("hsurfphi","hsurfphi",n_vertices,fStartZ,fStartZ+n_vertices*fBinningZ, iAzimBins,3.,58.); hsurf.Print(); // Double_t* arr = 0; // Double_t* arrp = 0; for (Int_t table=0; table<(t->GetLast()+1); table++) { Double_t* arr = getPolarAngleAveragedShift( (TH2D*)(*t)[table], hdefault ); Double_t* arrp = getAzimuthalAngleAveragedShift( (TH2D*)(*t)[table], hdefault, hphi ); TString hn(((TH2D*)(*t)[table])->GetName()); hn.Remove(0,hn.Length()-5); Float_t z = (atof(hn.Data()) - 0.073) * 1000.; // cout<