9 void plPi0Solo(
int page=1,TString fName=
"R7098001" ) {
13 TString outDir=
"./out1/";
16 gStyle->SetPalette(1,0);
19 TString name2=outDir+fName+
".hist.root";
20 printf(
"opening '%s'\n",name2.Data());
21 TFile *fd=
new TFile(name2);
23 printf(
"NOT found file=%s, STOP\n",hName.Data());
29 float xLo=.05, xHi=.22;
33 TString ctit=
"pi0-"; ctit+=page;
34 if(page==3 || page==6)
35 c=
new TCanvas(ctit,ctit,900,950);
37 c=
new TCanvas(ctit,ctit,900,650);
40 TPad *pad0 =
new TPad(
"pad0",
"apd0",0.0,0.95,1.,1.);
44 TPaveText *pt =
new TPaveText(0,0.,1,1,
"br");
47 TString txt2=fName+
", page="+page+
", ";
54 pad =
new TPad(
"pad1",
"apd1",0.0,0.0,1,.95);
57 gStyle->SetOptStat(11111 );
66 plotMix(
"invm", xLo,xHi, fd);
71 char *name[]={
"ctbSum",
"tE",
"cE",
"cSh",
"sE",
"cN"};
72 int log[]={ 1,1,1,0,1,0};
77 TH1* h= (TH1*)fd->Get(name[i]); assert(h);
79 if(log[i]) gPad->SetLogy();
83 plotMix(
"invm", xLo,xHi, fd);
88 char *name[]={
"xyL",
"xyH",
"0eta",
"eta12",
"0xyH",
"invm",
"0ener",
"0phi",
"0Z"};
93 TH1* h= (TH1*)fd->Get(name[i]); assert(h);
94 if(i<6 && i%3<2 ) { h->Draw(
"colz");
continue; }
95 plotMix(name[i], xLo,xHi, fd);
104 char *namex[]={
"0ener",
"0eta",
"0phi",
"0pt",
"0Z",
"0Ang"};
107 plotMix(namex[i], xLo,xHi, fd);
116 TH1* h= (TH1*)fd->Get(
"ytw"); assert(h);
120 plotMix(
"0ytw", xLo,xHi, fd);
127 gStyle->SetOptStat(1);
128 TGraphErrors* gr1=
new TGraphErrors;
129 gr1->SetMarkerStyle(21);
130 gr1->SetName(ctit+
"eM");
131 gr1->SetTitle(
"Pi0 mass vs. Eta; eta bin; inv mass (MeV);");
133 TGraphErrors* gr2=
new TGraphErrors;
134 gr2->SetMarkerStyle(20);
135 gr2->SetName(ctit+
"eS");
136 gr2->SetTitle(
"Pi0 mass width vs. Eta; eta bin; sigma (MeV);");
138 TGraphErrors* gr3=
new TGraphErrors;
139 gr3->SetMarkerStyle(19);
140 gr3->SetName(ctit+
"eN");
141 gr3->SetTitle(
"Pi0 Yield vs. Eta; eta bin; yield, err=nBckg/10;");
147 sprintf(t1,
"invm%02d",i+1);
149 plotMix(t1, xLo,xHi, fd,gr1,gr2,gr3);
153 c2=
new TCanvas(ctit+
"e",ctit+
"e",400,700);
155 c2->cd(1); gr1->Draw(
"AP");
156 gr1->SetMinimum(100);gr1->SetMaximum(180);
157 TLine *ln=
new TLine(0,135,13,135);
158 ln->SetLineColor(kBlue); ln->Draw();
159 c2->cd(2); gr2->Draw(
"AP");
160 gr2->SetMinimum(20);gr2->SetMaximum(60);
161 c2->cd(3); gr3->Draw(
"AP");
165 default: printf(
"page %d not defined\n",page);
170 TString outF=fName+
"_"+page+
".ps";
174 outF.ReplaceAll(
".ps",
".gif");
186 void printYield(
float xLo,
float xHi) {
188 int bLo=ax->FindBin(xLo);
189 int bHi=ax->FindBin(xHi);
190 int bin1=ax->FindBin(0.6);
191 int bin2=ax->FindBin(1.0);
193 float nReal=invm->Integral(bin1,bin2);
194 float nMix=Xinvm->Integral(bin1,bin2);
196 if(nMix>0) fac=nReal/nMix;
197 printf(
"nReal=%d nMix=%d fac=%f\n",nReal,nMix,fac);
200 float s1=invm->Integral(bLo,bHi);
201 float s2=Xinvm->Integral(bLo,bHi);
203 float ex=sqrt(s1+s2*fac*fac);
204 printf(
"s1=%f s2=%f\n",s1,s2);
206 if(s2>0) s2b=x/s2/fac;
209 if(s1>0 && s2>0 ) es2b=s2b*sqrt(1/s1+1/s2/fac/fac);
210 printf(
" Nrec=%.0f Nmix=%.0f for invm=[%.2f, %.2f] , Npi0=%.0f + / - %.0f \n s2b=%.2f + / - %.3f \n",s1,s2,xLo,xHi, x,ex,s2b,es2b);
211 printf(
"#1 Nrec=%.0f, Nmix=%.0f mixFac=%.3f<br> Npi0=%.0f + / - %.0f <br> s2b=%.2f + / - %.3f \n",s1,s2, fac,x,ex,s2b,es2b);
218 void plotMix(TString hname=
"m1",
float xLo,
float xHi,TFile *fd,
219 TGraphErrors* grM=0, TGraphErrors* grS=0, TGraphErrors* grN=0) {
220 hx= (TH1*)fd->Get(
"invm"); assert(hx);
221 int bin1=hx->FindBin(0.6);
222 int bin2=hx->FindBin(1.0);
223 float nReal=hx->Integral(bin1,bin2);
224 hx= (TH1*)fd->Get(
"Xinvm"); assert(hx);
225 float nMix=hx->Integral(bin1,bin2);
226 float fac=nReal/nMix;
228 printf(
"total: nReal=%d nMix=%d fac=%f \n",nReal,nMix,fac);
231 TH1* hr= (TH1*)fd->Get(hname); assert(hr);
232 TH1* hm= (TH1*)fd->Get(
"X"+hname); assert(hm);
236 hm->SetLineColor(kGreen);
238 TH1F* hD=(TH1F*)hr->Clone();
240 hD->SetTitle(hname+
" Real-Mixed");
242 hD->SetLineColor(kBlue);
244 hD->SetMinimum(-0.2 *hr->GetMaximum());
245 hD->SetMaximum(1.1*hr->GetMaximum());
250 mzer=
new TLine(-10.,0,10,0.);
255 if(strstr(hname.Data(),
"invm")==0)
return;
257 hD->SetTitle(
" Real-Mixed; inv mass GeV");
259 hD->Fit(
"gaus",
"R",
"same",xLo,xHi);
261 mLo=
new TLine(xLo,0,xLo,3500);
262 mLo->SetLineColor(kMagenta);
263 mHi=
new TLine(xHi,0,xHi,3500);
264 mHi->SetLineColor(kMagenta);
268 f=hD->GetFunction(
"gaus");
269 f->SetLineColor(kRed);
272 double *par=f->GetParameters();
273 double *epar=f->GetParErrors();
274 float pi0m=par[1]*1000;
275 float epi0m=epar[1]*1000;
276 float pi0s=par[2]*1000;
277 float epi0s=epar[2]*1000;
279 printf(
"#2 mass/MeV=%.0f + / - %.0f , <br>sig/MeV %.0f + / - %.0f\n",pi0m,epi0m,pi0s,epi0s);
283 int etaB=atoi(hname.Data()+4);
286 grM->SetPoint(n,etaB,pi0m);
287 grM->SetPointError(n,0.5,epi0m);
290 grS->SetPoint(n,etaB,pi0s);
291 grS->SetPointError(n,0.5,epi0s);
294 int bLo=ax->FindBin(xLo);
295 int bHi=ax->FindBin(xHi);
296 float nPi0=hD->Integral(bLo,bHi);
297 float nBckg=hr->Integral(bLo,bHi) - nPi0;
298 printf(
"etaB=%d nPi0=%.1f nBckg=%.1f\n",etaB,nPi0,nBckg);
300 grN->SetPoint(n,etaB,nPi0);
301 grN->SetPointError(n,0.5,0. );