00001 TFile *outH;
00002 TH1F *hs[6];
00003
00004
00005 evalFills(char *fillL="F2201", TString wrkDir="./") {
00006 wrkDir="/star/data04/sim/balewski/LcpRun2/maxEta1.4/";
00007
00008
00009 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";
00010
00011 gStyle->SetPalette(1,0);
00012 gStyle->SetOptStat(1000110);
00013 gROOT->LoadMacro("getPol.C");
00014
00015 createHist("asyVer1.hist.root");
00016
00017 outH->ls();
00018
00019 char *fill=strtok(fillL," ");
00020 int nFill=0;
00021 do {
00022 printf("\n\n process fill %02d '%s' \n",nFill,fill);
00023 int xFill=atoi(fill+1);
00024 assert(xFill);
00025 if(xFill<2189) continue;
00026
00027
00028 TString fname=wrkDir+"r"+fill+".hist.root";
00029 TFile * inpH=new TFile(fname);
00030 assert(inpH->IsOpen());
00031 if(!inpH->IsOpen()) {
00032 printf("#fail %s does not open, skip\n",fname.Data());
00033 continue;
00034 }
00035
00036 nFill++;
00037 projectYield(inpH,xFill);
00038 inpH->Close();
00039
00040 }while(fill=strtok(0," "));
00041
00042 char *cut="evalFill";
00043 c=new TCanvas(cut,cut,400,500);
00044
00045 c->Divide(1,3);
00046
00047 c->cd(1);
00048 plotPair(hs[1],hs[0]);
00049
00050
00051 c->cd(2);
00052 plotPair(hs[3],hs[2]);
00053
00054 c->cd(3);
00055 plotPair(hs[5],hs[4]);
00056
00057
00058
00059
00060
00061 return;
00062 }
00063
00064
00065
00066
00067 void projectYield(TFile *inp,int xFill){
00068 assert(inp->IsOpen());
00069
00070 float P,Q,eP,eQ;
00071 getPol(xFill,P,Q,eP,eQ);
00072 float PQ, ePQ;
00073 PQ=P*Q;
00074 ePQ=PQ*sqrt(eP*eP/P/P +eQ*eQ/Q/Q);
00075 printf("%d--> P*Q=%f /- %f\n",xFill,PQ,ePQ);
00076
00077 TH1F * h=(TH1F *)inp->Get("r1*All");
00078 assert(h);
00079
00080 char *tit=h->GetTitle();
00081 int nEve=atoi(strstr(tit,"Neve=")+5);
00082 printf("tit='%s' %d\n",tit,nEve);
00083
00084
00085 P=fabs(P);
00086 Q=fabs(Q);
00087 PQ=fabs(PQ);
00088
00089 hs[0]->Fill(P,nEve);
00090 hs[1]->Fill(P,nEve*P*P);
00091
00092 hs[2]->Fill(Q,nEve);
00093 hs[3]->Fill(Q,nEve*Q*Q);
00094
00095 hs[4]->Fill(PQ,nEve);
00096 hs[5]->Fill(PQ,nEve*PQ*PQ);
00097
00098 float minPol=0.07, minPol2=0.01;
00099
00100 printf("#fill F%d %d %d %d %d\n",xFill,nEve, P>minPol, Q>minPol,PQ>minPol2);
00101 }
00102
00103
00104
00105
00106 void createHist(TString fname) {
00107 outH=new TFile(fname,"RECREATE");
00108 assert(outH->IsOpen());
00109 printf("save outH -->%s\n", fname.Data());
00110
00111
00112 hs[0]=new TH1F("NvP","yiled vs. P",30,0,0.3);
00113 hs[0]->SetLineColor(kBlue);
00114 hs[0]->SetLineStyle(2);
00115
00116 hs[1]=new TH1F("NPPvP","",30,0,0.3);
00117 hs[1]->SetXTitle("Magnitude of Polarization in Blue");
00118 hs[1]->SetYTitle("FOM = LCP yield * P * P");
00119
00120
00121 hs[2]=new TH1F("NvQ","yield vs. Q",30,0,0.3);
00122 hs[2]->SetLineColor(kMagenta);
00123 hs[2]->SetLineStyle(2);
00124
00125 hs[3]=new TH1F("NQQvQ","",30,0,0.3);
00126 hs[3]->SetXTitle("Magnitude of Polarization in Yellow");
00127 hs[3]->SetYTitle("FOM = LCP yield * Q * Q");
00128
00129
00130 hs[4]=new TH1F("NvPQ","yield vs. P*Q",30,0,0.06);
00131 hs[4]->SetLineColor(kGreen);
00132 hs[4]->SetLineStyle(2);
00133
00134 hs[5]=new TH1F("NPPQQvPQ","",30,0,0.06);
00135 hs[5]->SetXTitle("Magnitude of Polarization Product Blue*Yellow");
00136 hs[5]->SetYTitle("FOM = LCP yield * P * P * Q * Q");
00137 }
00138
00139
00140
00141
00142 void plotPair(TH1F *h1,TH1F *h0 ) {
00143 h1->Draw();
00144
00145
00146 TAxis *ax =h1->GetYaxis();
00147 float ss=ax->GetTitleSize();
00148
00149 ax->SetTitleSize(2*ss);
00150 ax->SetTitleOffset(0.5);
00151 ax =h1->GetXaxis();
00152 ax->SetTitleSize(1.5*ss);
00153 ax->SetLabelSize(1.5*ss);
00154 ax->SetTitleOffset(0.7);
00155
00156
00157
00158
00159
00160
00161 gPad->Update();
00162
00163 Float_t rightmax = 1.1*h0->GetMaximum();
00164 Float_t scale = gPad->GetUymax()/rightmax;
00165 h0->Scale(scale);
00166 h0->Draw("same");
00167
00168
00169 TGaxis *axis = new TGaxis(gPad->GetUxmax(),gPad->GetUymin(),
00170 gPad->GetUxmax(), gPad->GetUymax(),0,rightmax,510,"-R");
00171 int col=h0->GetLineColor();
00172 axis->SetLineColor(col);
00173
00174 axis->SetTextColor(col);
00175 axis->SetLabelColor(col);
00176 axis ->SetTitle("LCP yield");
00177 axis->SetTitleSize(2*ss);
00178 axis->SetTitleOffset(.5);
00179
00180 axis->Draw();
00181
00182
00183 TPaveStats *st =( TPaveStats *)gPad->GetPrimitive("stats");
00184 st->SetX1NDC(0.35);
00185 st->SetX2NDC(0.5);
00186 st->SetY1NDC(0.7);
00187 st->SetY2NDC(1.);
00188 }
00189
00190
00191
00192
00193