0321b05e |
1 | // |
2 | // This macro is a part of "Alice PPR fast flow analysis package" |
3 | // |
4 | // The macro Draw event plane resolution and V2 resolution |
5 | // for a given multiplicity in function of V2 |
6 | // |
7 | // INPUT PARAMETERS |
8 | // type: |
9 | // 0 - event plane resolution |
10 | // 1 - V2 reslution |
11 | // |
12 | // Sylwester Radomski, GSI |
13 | // mail: S.Radomski@gsi.de |
14 | // 31 Oct 2002 |
15 | // |
16 | |
17 | AliFlowDrawV2(int type, const char *fileName = 0) { |
18 | |
19 | gROOT->SetStyle("Plain"); |
20 | |
21 | if (type > 2) { |
22 | ::Error("AliFLowDrawV2", "Wrong Type [0-1]: %d ", type); |
23 | return; |
24 | } |
25 | |
26 | const char *dataName = "flowPicoEvent.root"; |
27 | TFile *dataFile = new TFile(dataName,"UPDATE"); |
28 | TNtuple *data = (TNtuple *) dataFile->Get("flowData"); |
29 | |
30 | TGraphErrors *g = new TGraphErrors(); |
31 | TH1D *h; |
32 | |
33 | const char* patt = "Mult == %d && trueV2 > %f && trueV2 < %f"; |
34 | const char* varName[2] = {"Psi - truePsi >> htemp(90, -90, 90)", |
35 | "100 * (trueV2-V2)/trueV2 >> htemp(100,-200,200)"}; |
36 | |
37 | const char* xTitle = "V_{2}"; |
38 | const char* yTitle[2] = {"Event Plane Resolution [deg]", |
39 | "V_{2} Resolution [%]"}; |
40 | |
41 | char buff[100]; |
42 | |
43 | Int_t mult = 1000; |
44 | const Int_t nV2Point = 5; |
45 | const Double_t v2Points[nV2Point] = {0.02, 0.04, 0.06, 0.08, 0.1}; |
46 | |
47 | TCanvas *c = new TCanvas(); |
48 | c->SetFillColor(10); |
49 | c->SetTicks(1,1); |
50 | |
51 | TCanvas *d = new TCanvas(); |
52 | |
53 | for(Int_t i=0; i<nV2Point; i++) { |
54 | |
55 | Double_t totalV2 = v2Points[i]; |
56 | |
57 | sprintf(buff, patt, mult, totalV2-0.001, totalV2+0.001); |
58 | data->Draw(varName[type], buff); |
59 | h = (TH1D*)gPad->GetPrimitive("htemp"); |
60 | |
61 | ::Info("AliFlowDrawV2",buff); |
62 | |
63 | g->SetPoint(i, v2Points[i], h->GetRMS()); |
64 | g->SetPointError(i, 0, h->GetRMS()/20. ); |
65 | } |
66 | |
67 | g->SetMinimum(0); |
68 | g->SetMarkerSize(1); |
69 | g->SetMarkerStyle(21); |
70 | |
71 | c->cd(); |
72 | g->Draw("APL"); |
73 | g->GetHistogram()->SetXTitle(xTitle); |
74 | g->GetHistogram()->SetYTitle(yTitle[type]); |
75 | |
76 | c->Modified(); |
77 | c->Update(); |
78 | |
79 | if (fileName) { |
80 | |
81 | char buffer[60]; |
82 | sprintf(buffer, "plots/%s.eps", fileName); |
83 | c->Print(buffer, "eps"); |
84 | |
85 | sprintf(buffer, "plots/%s.gif", fileName); |
86 | c->Print(buffer, "gif"); |
87 | } |
88 | } |