5 evalFills(
char *fillL=
"F2201", TString wrkDir=
"./") {
6 wrkDir=
"/star/data04/sim/balewski/LcpRun2/maxEta1.4/";
9 fillL=
" F2053 F2075 F2076 F2083 F2095 F2102 F2105 F2110 F2116 F2127 F2132 F2134 F2135 F2136 F2147 F2153 F2161 F2162 F2175 F2178 F2181 F2185 F2187 F2192 F2193 F2196 F2201 F2207 F2208 F2212 F2216 F2222 F2235 F2246 F2251 F2257 F2258 F2266 F2269 F2275 F2277 F2281 F2289 F2290 F2301 F2303 F2304";
11 gStyle->SetPalette(1,0);
12 gStyle->SetOptStat(1000110);
13 gROOT->LoadMacro(
"getPol.C");
15 createHist(
"asyVer1.hist.root");
19 char *fill=strtok(fillL,
" ");
22 printf(
"\n\n process fill %02d '%s' \n",nFill,fill);
23 int xFill=atoi(fill+1);
25 if(xFill<2189)
continue;
28 TString fname=wrkDir+
"r"+fill+
".hist.root";
29 TFile * inpH=
new TFile(fname);
30 assert(inpH->IsOpen());
32 printf(
"#fail %s does not open, skip\n",fname.Data());
37 projectYield(inpH,xFill);
40 }
while(fill=strtok(0,
" "));
43 c=
new TCanvas(cut,cut,400,500);
48 plotPair(hs[1],hs[0]);
52 plotPair(hs[3],hs[2]);
55 plotPair(hs[5],hs[4]);
67 void projectYield(TFile *inp,
int xFill){
68 assert(inp->IsOpen());
71 getPol(xFill,P,Q,eP,eQ);
74 ePQ=PQ*sqrt(eP*eP/P/P +eQ*eQ/Q/Q);
75 printf(
"%d--> P*Q=%f /- %f\n",xFill,PQ,ePQ);
77 TH1F * h=(TH1F *)inp->Get(
"r1*All");
80 char *tit=h->GetTitle();
81 int nEve=atoi(strstr(tit,
"Neve=")+5);
82 printf(
"tit='%s' %d\n",tit,nEve);
90 hs[1]->Fill(P,nEve*P*P);
93 hs[3]->Fill(Q,nEve*Q*Q);
96 hs[5]->Fill(PQ,nEve*PQ*PQ);
98 float minPol=0.07, minPol2=0.01;
100 printf(
"#fill F%d %d %d %d %d\n",xFill,nEve, P>minPol, Q>minPol,PQ>minPol2);
106 void createHist(TString fname) {
107 outH=
new TFile(fname,
"RECREATE");
108 assert(outH->IsOpen());
109 printf(
"save outH -->%s\n", fname.Data());
112 hs[0]=
new TH1F(
"NvP",
"yiled vs. P",30,0,0.3);
113 hs[0]->SetLineColor(kBlue);
114 hs[0]->SetLineStyle(2);
116 hs[1]=
new TH1F(
"NPPvP",
"",30,0,0.3);
117 hs[1]->SetXTitle(
"Magnitude of Polarization in Blue");
118 hs[1]->SetYTitle(
"FOM = LCP yield * P * P");
121 hs[2]=
new TH1F(
"NvQ",
"yield vs. Q",30,0,0.3);
122 hs[2]->SetLineColor(kMagenta);
123 hs[2]->SetLineStyle(2);
125 hs[3]=
new TH1F(
"NQQvQ",
"",30,0,0.3);
126 hs[3]->SetXTitle(
"Magnitude of Polarization in Yellow");
127 hs[3]->SetYTitle(
"FOM = LCP yield * Q * Q");
130 hs[4]=
new TH1F(
"NvPQ",
"yield vs. P*Q",30,0,0.06);
131 hs[4]->SetLineColor(kGreen);
132 hs[4]->SetLineStyle(2);
134 hs[5]=
new TH1F(
"NPPQQvPQ",
"",30,0,0.06);
135 hs[5]->SetXTitle(
"Magnitude of Polarization Product Blue*Yellow");
136 hs[5]->SetYTitle(
"FOM = LCP yield * P * P * Q * Q");
142 void plotPair(TH1F *h1,TH1F *h0 ) {
146 TAxis *ax =h1->GetYaxis();
147 float ss=ax->GetTitleSize();
149 ax->SetTitleSize(2*ss);
150 ax->SetTitleOffset(0.5);
152 ax->SetTitleSize(1.5*ss);
153 ax->SetLabelSize(1.5*ss);
154 ax->SetTitleOffset(0.7);
163 Float_t rightmax = 1.1*h0->GetMaximum();
164 Float_t scale = gPad->GetUymax()/rightmax;
169 TGaxis *axis =
new TGaxis(gPad->GetUxmax(),gPad->GetUymin(),
170 gPad->GetUxmax(), gPad->GetUymax(),0,rightmax,510,
"-R");
171 int col=h0->GetLineColor();
172 axis->SetLineColor(col);
174 axis->SetTextColor(col);
175 axis->SetLabelColor(col);
176 axis ->SetTitle(
"LCP yield");
177 axis->SetTitleSize(2*ss);
178 axis->SetTitleOffset(.5);
183 TPaveStats *st =( TPaveStats *)gPad->GetPrimitive(
"stats");