2 // This macro is a part of "Alice PPR fast flow analysis package"
4 // The macro Draw event plane resolution and V2 resolution
5 // for a given multiplicity in function of V2
9 // 0 - event plane resolution
12 // Sylwester Radomski, GSI
13 // mail: S.Radomski@gsi.de
17 AliFlowDrawV2(int type, const char *fileName = 0) {
19 gROOT->SetStyle("Plain");
22 ::Error("AliFLowDrawV2", "Wrong Type [0-1]: %d ", type);
26 const char *dataName = "flowPicoEvent.root";
27 TFile *dataFile = new TFile(dataName,"UPDATE");
28 TNtuple *data = (TNtuple *) dataFile->Get("flowData");
30 TGraphErrors *g = new TGraphErrors();
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)"};
37 const char* xTitle = "V_{2}";
38 const char* yTitle[2] = {"Event Plane Resolution [deg]",
39 "V_{2} Resolution [%]"};
44 const Int_t nV2Point = 5;
45 const Double_t v2Points[nV2Point] = {0.02, 0.04, 0.06, 0.08, 0.1};
47 TCanvas *c = new TCanvas();
51 TCanvas *d = new TCanvas();
53 for(Int_t i=0; i<nV2Point; i++) {
55 Double_t totalV2 = v2Points[i];
57 sprintf(buff, patt, mult, totalV2-0.001, totalV2+0.001);
58 data->Draw(varName[type], buff);
59 h = (TH1D*)gPad->GetPrimitive("htemp");
61 ::Info("AliFlowDrawV2",buff);
63 g->SetPoint(i, v2Points[i], h->GetRMS());
64 g->SetPointError(i, 0, h->GetRMS()/20. );
69 g->SetMarkerStyle(21);
73 g->GetHistogram()->SetXTitle(xTitle);
74 g->GetHistogram()->SetYTitle(yTitle[type]);
82 sprintf(buffer, "plots/%s.eps", fileName);
83 c->Print(buffer, "eps");
85 sprintf(buffer, "plots/%s.gif", fileName);
86 c->Print(buffer, "gif");