]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FLOW/AliFlowDrawSummary.C
No return in void function (Alpha)
[u/mrichter/AliRoot.git] / FLOW / AliFlowDrawSummary.C
CommitLineData
0321b05e 1//
2// This macro is a part of "Alice PPR fast flow analysis package"
3//
4// The macro draws event plane resolution and V2 resolution in function
5// of V2 and multiplicity
6//
7// IMPUT PARAMETERS
8// type:
9// 0 - event plane resolution
10// 1 - V2 resolution
11//
12// desc 0/1 - draw Graph descriptions
13//
14// Sylwester Radomski, GSI
15// mail: S.Radomski@gsi.de
16// Oct 31, 2002
17//
18
19AliFlowDrawSummary(int type = 0, int desc = 0, const char* fileName = 0) {
20
21 gROOT->SetStyle("Plain");
22
23 if (type > 1) {
24 ::Error("AliFlowDrawSummary","Wrong Type [0-1] : %d", type);
25 return;
26 }
27
28 const Int_t startMarker = 21;
29 const char *dataName = "flowPicoEvent.root";
30 TFile *dataFile = new TFile(dataName,"UPDATE");
31 TNtuple *data = (TNtuple *) dataFile->Get("flowData");
32
33 TGraphErrors *g;
34 TH1D *h;
35
36 const char* patt = "Mult == %d && trueV2 > %f && trueV2 < %f";
37
38 const char* varName[2] = {"Psi - truePsi >> htemp(90, -90, 90) ",
39 "100 * (trueV2-V2)/trueV2 >> htemp(100,-200,200)"};
40
41 const char* yTitle[2] = {"Event Plane Resolution [deg]",
42 "V_{2} Resolution [%]"};
43
44 char buff[100];
45
46 Double_t v2 = 0.02;
47
48 const Int_t nMultPoint = 11;
49 const Int_t nV2Point = 4;
50
51 const Int_t multPoints[nMultPoint] = {200, 400, 600, 800, 1000, 1500, 2000, 2500, 3000,
52 4000, 5000};// 6000, 8000, 10000};
53
54 const Double_t v2Points[nV2Point] = {0.04, 0.06, 0.08, 0.1};
55 //const Double_t v2Points[nV2Point] = {0.06};
56
57 TCanvas *c = new TCanvas();
58 c->SetFillColor(10);
59 c->SetTicks(1,1);
60
61 TCanvas *d = new TCanvas();
62
63 for (Int_t j=0; j<nV2Point; j++) {
64
65 g = new TGraphErrors();
66 g->SetMarkerStyle(18+j);
67
68 for(Int_t i=0; i<nMultPoint; i++) {
69
70 Int_t totalMult = multPoints[i];
71 Double_t totalV2 = v2Points[j];
72
73 sprintf(buff, patt, totalMult, totalV2-0.001, totalV2+0.001);
74 data->Draw(varName[type], buff);
75 h = (TH1D*)gPad->GetPrimitive("htemp");
76
77 ::Info("AliFlowDrawSummary", buff);
78
79 g->SetPoint(i, multPoints[i], h->GetRMS());
80 g->SetPointError(i, 0, h->GetRMS() / TMath::Sqrt(h->GetEntries()));
81 }
82
83 g->SetMinimum(0);
84 g->SetMarkerSize(1);
85 g->SetMarkerStyle(startMarker+j);
86
87 c->cd();
88 if (j==0) {
89 g->Draw("APL");
90 g->GetHistogram()->SetXTitle("Number of Good Tracks");
91 g->GetHistogram()->SetYTitle(yTitle[type]);
92 }
93 else g->Draw("PL");
94 d->cd();
95 }
96
97 if (desc) {
98
99 TText *text;
100 TMarker *marker;
101 c->cd();
102
103 const char* info = "v2 = %.2f";
104
105 for (Int_t j=0; j<nV2Point; j++) {
106
107 Double_t y;
108 if (type == 0) y = 30 - 3*y;
109 else y = 70 - 5*j;
110
111 marker = new TMarker(3000, y+1, startMarker+j);
112 marker->Draw("a");
113 marker->ls();
114
115 sprintf(buff, info, v2Points[j]);
116 text = new TText(3100, y, buff);
117 //text->SetTextColor(j-1);
118 text->Draw();
119 }
120 }
121
122 if (fileName) {
123
124 char buffer[60];
125 sprintf(buffer, "plots/%s.eps", fileName);
126 c->Print(buffer, "eps");
127
128 sprintf(buffer, "plots/%s.gif", fileName);
129 c->Print(buffer, "gif");
130 }
131}