1 double chi2Eval(TH2D* h, TH2D*
data,
float beta,
float sf,
int rscale){
12 for(
int ix=13;ix<=h->GetNbinsX();ix++){
13 for(
int iy=13;iy<=h->GetNbinsY();iy++){
14 if(data->GetBinContent(ix,iy)<1)
continue;
15 double testVal=(double)h->GetBinContent(ix,iy);
16 double testErr=fabs((
double)h->GetBinError(ix,iy));
17 if(testErr==0.)
continue;
18 double val=testVal/testErr;
32 for(
int ix=5;ix<=h->GetNbinsX();ix++){
33 for(
int iy=ix+1;iy<=h->GetNbinsY();iy++){
34 if(data->GetBinContent(ix,iy)<1)
continue;
35 double testVal=(double)h->GetBinContent(ix,iy);
36 double testErr=fabs((
double)h->GetBinError(ix,iy));
37 if(testErr==0.)
continue;
38 double val=testVal/testErr;
51 if(numPos>0.)posVal=(posVal/numPos);
52 if(numNeg>0.)negVal=(1.+beta)*(negVal/numNeg);
59 float* runChi2Min_SFEval(
const char* dirName,
float beta,
int itype,
const char* cmult=NULL,
int rscale=1){
69 const char* spaceName[]={
"NSYtDYt",
"NYtYt"};
71 TString dirname(dirName);
78 gSystem->Load(
"StEStructPoolSupport.so");
79 gROOT->LoadMacro(
"radialScaling.C");
87 const char* cname[]={
"all",
"nearside",
"awayside"};
89 TString fname(cname[itype]);
91 TString infile(dirname.Data());
95 cout<<
"Attempting fits from file = "<<infile.Data()<<
" with beta="<<beta<<endl;
96 TFile* tf=
new TFile(infile.Data());
100 TString ppName(
"Sibpp"); ppName+=spaceName[rscale];
101 TString mmName(
"Sibmm"); mmName+=spaceName[rscale];
102 TString mpName(
"Sibmp"); mpName+=spaceName[rscale];
103 TString pmName(
"Sibpm"); pmName+=spaceName[rscale];
105 TH2D* ssdata=(TH2D*)(tf->Get(ppName.Data())->Clone());
106 TH2D* mmdata=(TH2D*)tf->Get(mmName.Data());
109 TH2D* usdata=(TH2D*)tf->Get(mpName.Data());
110 TH2D* mpdata=(TH2D*)tf->Get(pmName.Data());
113 cout<<
" Npairs:: LS="<<ssdata->Integral();
114 cout<<
" US="<<usdata->Integral()<<endl;
116 for(
int is=0;is<20;is++){
117 float fnval=0.9+is*0.005;
122 TH2D** localHists=(TH2D**)ehelp.buildChargeTypes(spaceName[rscale],1,sf);
124 radialScaling(localHists[0]);
125 radialScaling(localHists[1]);
127 double lval=chi2Eval(localHists[0],ssdata,beta,sf[0],rscale);
128 double uval=chi2Eval(localHists[1],usdata,beta,sf[1],rscale);
143 cout<<
" found lsmin="<<lsscale<<
" usscale="<<usscale<<endl;
144 float* retVal =
new float[2];