18 void plotLYZ(TString fileName =
"flow.hist.root", Bool_t firstPass = kFALSE,
char* ext =
"") {
20 Bool_t mevSim, FTPC = kFALSE;
24 gROOT->SetStyle(
"Pub");
25 gStyle->SetFrameLineWidth(2);
26 gStyle->SetLineWidth(2);
27 gStyle->SetLineColor(kBlue);
28 gStyle->SetHistLineWidth(1);
29 gStyle->SetFuncWidth(2);
35 TFile *file =
new TFile(fileName,
"READ");
40 float ptMax = mevSim ? 2. : 6.;
46 TString histNameNtheta(
"FlowLYZ_r0theta_Sel1_Har2");
47 TH1D* histNtheta =
new TH1D;
48 histNtheta = (TH1D*)file->Get(histNameNtheta);
50 cout <<
"### Can't find file " << histNameNtheta << endl;
53 int maxTheta = histNtheta->GetNbinsX();
54 cout <<
"maxTheta = " << maxTheta << endl << endl;
55 if (maxTheta > 5) maxTheta = 5;
59 TCanvas *canMult =
new TCanvas(
"MeanMultiplicity",
"MeanMultiplicity");
60 TPaveLabel* run =
new TPaveLabel(0.1,0.01,0.2,0.03,fileName.Data());
63 TPaveLabel* date =
new TPaveLabel(0.7,0.01,0.9,0.03,now.AsString());
65 TPad* graphPad =
new TPad(
"Graphs",
"Graphs",0.01,0.05,0.97,0.95);
68 TCanvas *canGtheta =
new TCanvas(
"Gtheta",
"Gtheta", 700, 900);
69 canGtheta->Divide(maxHarPlot*maxSel, maxTheta);
71 TCanvas *canGthetaZoom =
new TCanvas(
"Gtheta_Zoom",
"Gtheta_Zoom", 700, 900);
72 canGthetaZoom->Divide(maxHarPlot*maxSel, maxTheta);
74 TCanvas *can_r0theta =
new TCanvas(
"r0",
"r0");
75 can_r0theta->Divide(maxSel, maxHarPlot);
77 TCanvas *can_vEta =
new TCanvas(
"v(eta)",
"v(eta)", 700, 900);
78 can_vEta->Divide(maxSel, maxHar);
80 TCanvas *can_vPt =
new TCanvas(
"v(pt)",
"v(pt)", 700, 900);
81 can_vPt->Divide(maxSel, maxHar);
83 TCanvas *can_vr0 =
new TCanvas(
"vr0",
"vr0");
84 can_vr0->Divide(maxSel);
86 TCanvas *can_v =
new TCanvas(
"v",
"v");
87 can_v->Divide(maxSel);
89 TCanvas *can_centX =
new TCanvas(
"centX",
"centX");
90 can_centX->Divide(maxSel, maxHarPlot);
92 TCanvas *can_centY =
new TCanvas(
"centY",
"centY");
93 can_centY->Divide(maxSel, maxHarPlot);
95 TCanvas *can_centQ =
new TCanvas(
"centQ",
"centQ");
96 can_centQ->Divide(maxSel, maxHarPlot);
99 TH1D *histMult =
new TH1D;
100 TH1F **hist_v =
new TH1F*[maxSel];
101 TH1F **hist_vr0 =
new TH1F*[maxSel];
102 TH1F **hist_v =
new TH1F*[maxSel];
103 TH1F **hist_vEta =
new TH1F*[maxSel*maxHar];
104 TH1F **hist_vPt =
new TH1F*[maxSel*maxHar];
105 TH1D **hist_r0th =
new TH1D*[maxSel*maxHarPlot];
106 TH1F **histG =
new TH1F*[maxSel*maxHarPlot*maxTheta];
107 TH1F **histGZoom =
new TH1F*[maxSel*maxHarPlot*maxTheta];
108 TH1D **hist_centX =
new TH1D*[maxSel*maxHarPlot];
109 TH1D **hist_centY =
new TH1D*[maxSel*maxHarPlot];
110 TH1D **hist_centQ =
new TH1D*[maxSel*maxHarPlot];
112 TLine **r0Line =
new TLine*[maxSel*maxHarPlot*maxTheta];
113 TLine **r0LineZoom =
new TLine*[maxSel*maxHarPlot*maxTheta];
114 TLine *ptZeroLine =
new TLine(0., 0., ptMax, 0.);
115 TLine *pt5Line =
new TLine(0., 5., 2., 5.);
116 TLine *ptV1Line =
new TLine(0., v1, 2., v1);
117 TLine *etaZeroLine =
new TLine(-1.5, 0., 1.5, 0.);
118 TLine *etaZeroLineFTPC =
new TLine(-4.5, 0., 4.5, 0.);
119 TLine *GZeroLine =
new TLine(0., 0., 0.35, 0.);
120 TLine *eta5Line =
new TLine(-4.5, 5., 4.5, 5.);
121 TLine *etaV1LinePos =
new TLine(0., v1, 4.5, v1);
122 TLine *etaV1LineNeg =
new TLine(-4.5, -v1, 0., -v1);
123 TLine *vLine =
new TLine(0.5, 0., maxHar+0.5, 0.);
124 TLine *recentZeroLine =
new TLine(0.5, 0., 3.5, 0.);
125 TLine *recentedZeroLine =
new TLine(0.5, 0., 2.5, 0.);
128 TString histName(
"FlowLYZ_Mult");
129 cout << histName << endl;
131 histMult = (TH1D*)file->Get(histName);
132 if (!mevSim) { histMult->Fit(
"gaus"); }
134 Double_t entries = histMult->GetEntries();
135 TString* entriesChar =
new TString(
"entries= ");
136 *entriesChar += (int)entries;
140 l.DrawLatex(0.65,0.8,entriesChar->Data());
143 for (Int_t sel = 0; sel < maxSel; sel++) {
146 TString histName(
"FlowLYZ_v_Sel");
148 cout << histName << endl;
149 hist_v[sel] = (TH1F*)file->Get(histName);
151 hist_v[sel]->SetMinimum(0.);
154 for (
int j=1; j<=maxHar; j++) {
155 _v = hist_v[sel]->GetBinContent(j);
156 vErr = hist_v[sel]->GetBinError(j);
157 cout << setprecision(3) <<
"Sel = " << sel+1 <<
": v" << j <<
" from pt = (" << _v <<
158 " +/- " << vErr <<
") %" << endl;
162 TString histName(
"FlowLYZ_vr0_Sel");
164 cout << histName << endl;
165 hist_vr0[sel] = (TH1F*)file->Get(histName);
167 hist_vr0[sel]->SetMinimum(0.);
168 hist_vr0[sel]->Draw();
169 for (
int j=1; j<=maxHar; j++) {
170 _v = hist_vr0[sel]->GetBinContent(j);
171 vErr = hist_vr0[sel]->GetBinError(j);
172 cout << setprecision(3) <<
"Sel= " << sel+1 <<
": v" << j <<
" from r0 = (" << _v <<
173 " +/- " << vErr <<
") %" << endl;
176 for (Int_t har = 0; har < maxHarPlot; har++) {
179 TString histName(
"FlowLYZ_r0theta_Sel");
183 cout << histName << endl;
184 hist_r0th[n] = (TH1D*)file->Get(histName);
185 can_r0theta->cd(1+sel+har*maxSel);
187 hist_r0th[n]->SetMinimum(0.);
188 hist_r0th[n]->Draw();
189 for (
int th=1; th<=maxTheta; th++) {
190 _v = hist_r0th[n]->GetBinContent(th);
191 vErr = hist_r0th[n]->GetBinError(th);
192 if (TMath::IsNaN(vErr)) {
194 hist_r0th[n]->SetBinError(th, 0.);
196 cout << setprecision(3) <<
"Sel=" << sel+1 <<
", Har=" << har+1 <<
": r0" << th <<
" = "
197 << _v <<
" +/- " << vErr << endl;
201 TString histName(
"FlowCentX_Sel");
205 hist_centX[n] = (TH1D*)file->Get(histName);
207 cout << histName << endl;
208 can_centX->cd(1+sel+har*maxSel);
209 hist_centX[n]->Draw();
210 recentZeroLine->Draw();
213 TString histName(
"FlowCentY_Sel");
217 hist_centY[n] = (TH1D*)file->Get(histName);
219 cout << histName << endl;
220 can_centY->cd(1+sel+har*maxSel);
221 hist_centY[n]->Draw();
222 recentZeroLine->Draw();
226 TString histName(
"FlowQCent_Sel");
230 hist_centQ[n] = (TH1D*)file->Get(histName);
232 cout << histName << endl;
233 can_centQ->cd(1+sel+har*maxSel);
234 hist_centQ[n]->Draw();
235 recentedZeroLine->Draw();
240 for (Int_t theta = 0; theta < maxTheta; theta++) {
241 TString histName(
"FlowLYZ_Gtheta");
247 cout << histName << endl;
248 histG[theta] = (TH1F*)file->Get(histName);
249 canGtheta->cd(1+har+sel*maxHarPlot+theta*maxSel*maxHarPlot);
250 TVirtualPad::Pad()->SetLogy();
251 histG[theta]->SetMinimum(min);
252 histG[theta]->DrawCopy(
"PH");
253 r0 = hist_r0th[n]->GetBinContent(theta+1);
254 r0Line[theta] =
new TLine(r0, 0., r0, 1.);
255 r0Line[theta]->Draw();
259 histGZoom[theta] = (TH1F*)file->Get(histName);
260 canGthetaZoom->cd(1+har+sel*maxHarPlot+theta*maxSel*maxHarPlot);
261 TVirtualPad::Pad()->SetLogy();
262 histGZoom[theta]->SetMaximum(max);
263 histGZoom[theta]->SetMinimum(min);
264 histGZoom[theta]->SetAxisRange(r0/expan, r0*expan,
"X");
265 histGZoom[theta]->Draw(
"PH");
266 r0LineZoom[theta] =
new TLine(r0, 0., r0, max);
267 r0LineZoom[theta]->Draw();
273 for (Int_t har = 0; har < maxHar; har++) {
276 TString histName(
"FlowLYZ_vEta_Sel");
280 cout << histName << endl;
281 hist_vEta[n] = (TH1D*)file->Get(histName);
282 can_vEta->cd(sel+1+har*maxSel);
283 hist_vEta[n]->SetMaximum(10.);
284 hist_vEta[n]->SetMinimum(-10.);
285 hist_vEta[n]->Draw(
"E");
286 if (FTPC) { etaZeroLineFTPC->Draw(); }
287 else { etaZeroLine->Draw(); }
292 etaV1LinePos->Draw();
293 etaV1LineNeg->Draw();
297 TString histName(
"FlowLYZ_vPt_Sel");
301 cout << histName << endl;
302 hist_vPt[n] = (TH1D*)file->Get(histName);
303 can_vPt->cd(sel+1+har*maxSel);
305 hist_vPt[n]->SetMaximum(10.);
306 hist_vPt[n]->SetMinimum(-10.);
308 hist_vPt[n]->SetMaximum(20.);
309 hist_vPt[n]->SetMinimum(-20.);
311 hist_vPt[n]->Draw(
"E");
324 if (strstr(ext,
"ps")) {
325 canGtheta->SaveAs(
"FlowLYZ_Gtheta.ps");
326 canGthetaZoom->SaveAs(
"FlowLYZ_GthetaZoom.ps");
327 can_r0theta->SaveAs(
"FlowLYZ_r0.ps");
328 canMult->SaveAs(
"FlowLYZ_Mult.ps");
329 can_vEta->SaveAs(
"FlowLYZ_vEta.ps");
330 can_vPt->SaveAs(
"FlowLYZ_vPt.ps");
331 can_vr0->SaveAs(
"FlowLYZ_vro.ps");
332 can_v->SaveAs(
"FlowLYZ_v.ps");
333 can_centX->SaveAs(
"FlowCentX.ps");
334 can_centY->SaveAs(
"FlowCentY.ps");
335 can_centQ->SaveAs(
"FlowCentQ.ps");
336 }
else if (strstr(ext,
"gif")) {
337 canGtheta->SaveAs(
"FlowLYZ_Gtheta.gif");
338 canGthetaZoom->SaveAs(
"FlowLYZ_GthetaZoom.gif");
339 can_r0theta->SaveAs(
"FlowLYZ_r0.gif");
340 canMult->SaveAs(
"FlowLYZ_Mult.gif");
341 can_vEta->SaveAs(
"FlowLYZ_vEta.gif");
342 can_vPt->SaveAs(
"FlowLYZ_vPt.gif");
343 can_vr0->SaveAs(
"FlowLYZ_vro.gif");
344 can_v->SaveAs(
"FlowLYZ_v.gif");