]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/EBYE/macros/drawBalanceFunctionPsi.C
Adapting BF drawing macros for event classes (multiplicity, centrality, event plane)
[u/mrichter/AliRoot.git] / PWGCF / EBYE / macros / drawBalanceFunctionPsi.C
CommitLineData
211b716d 1const Int_t numberOfCentralityBins = 11;
2TString centralityArray[numberOfCentralityBins] = {"0-10","10-20","20-30","30-40","40-50","50-60","60-70","70-80","0-1","1-2","0-100"};
a38fd7f3 3
a38fd7f3 4void drawBalanceFunctionPsi(const char* filename = "AnalysisResultsPsi.root",
eb63b883 5 Int_t gCentrality = 1,
6 Int_t gDeltaEtaDeltaPhi = 2,
5de9ad1a 7 Int_t gBit = -1,
8 const char* gCentralityEstimator = 0x0,
6acdbcb2 9 Double_t psiMin = -0.5, Double_t psiMax = 0.5,
10 Double_t ptTriggerMin = -1.,
11 Double_t ptTriggerMax = -1.,
12 Double_t ptAssociatedMin = -1.,
f0c5040c 13 Double_t ptAssociatedMax = -1.,
bfb625e3 14 Bool_t k2pMethod = kFALSE,
d67eae53 15 Bool_t k2pMethod2D = kFALSE,
16 TString eventClass = "EventPlane") //Can be "EventPlane", "Centrality", "Multiplicity"
17{
a38fd7f3 18 //Macro that draws the BF distributions for each centrality bin
19 //for reaction plane dependent analysis
20 //Author: Panos.Christakoglou@nikhef.nl
21 //Load the PWG2ebye library
22 gSystem->Load("libANALYSIS.so");
23 gSystem->Load("libANALYSISalice.so");
24 gSystem->Load("libEventMixing.so");
25 gSystem->Load("libCORRFW.so");
26 gSystem->Load("libPWGTools.so");
27 gSystem->Load("libPWGCFebye.so");
28
d67eae53 29 //correction method check
30 if(k2pMethod2D&&!k2pMethod){
31 Printf("Chosen 2D 2particle correction method w/o 2particle correction --> not possible");
32 return;
33 }
34
a38fd7f3 35 //Prepare the objects and return them
5de9ad1a 36 TList *listBF = GetListOfObjects(filename,gCentrality,gBit,gCentralityEstimator,0);
37 TList *listBFShuffled = GetListOfObjects(filename,gCentrality,gBit,gCentralityEstimator,1);
38 TList *listBFMixed = GetListOfObjects(filename,gCentrality,gBit,gCentralityEstimator,2);
a38fd7f3 39 if(!listBF) {
40 Printf("The TList object was not created");
41 return;
42 }
43 else
eb63b883 44 draw(listBF,listBFShuffled,listBFMixed,
45 gCentrality,gDeltaEtaDeltaPhi,
46 psiMin,psiMax,
f0c5040c 47 ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,
d67eae53 48 k2pMethod,k2pMethod2D,eventClass);
a38fd7f3 49}
50
51//______________________________________________________//
5365d1d7 52TList *GetListOfObjects(const char* filename,
53 Int_t gCentrality,
5de9ad1a 54 Int_t gBit,
5365d1d7 55 const char *gCentralityEstimator,
5de9ad1a 56 Int_t kData = 1) {
a38fd7f3 57 //Get the TList objects (QA, bf, bf shuffled)
a38fd7f3 58 TList *listBF = 0x0;
a38fd7f3 59
60 //Open the file
5365d1d7 61 TFile *f = TFile::Open(filename,"UPDATE");
a38fd7f3 62 if((!f)||(!f->IsOpen())) {
63 Printf("The file %s is not found. Aborting...",filename);
64 return listBF;
65 }
5365d1d7 66 //f->ls();
a38fd7f3 67
6acdbcb2 68 TDirectoryFile *dir = dynamic_cast<TDirectoryFile *>(f->Get("PWGCFEbyE.outputBalanceFunctionPsiAnalysis"));
a38fd7f3 69 if(!dir) {
70 Printf("The TDirectoryFile is not found. Aborting...",filename);
71 return listBF;
72 }
5365d1d7 73 //dir->ls();
a38fd7f3 74
75 TString listBFName;
eb63b883 76 if(kData == 0) {
77 //cout<<"no shuffling - no mixing"<<endl;
78 listBFName = "listBFPsi_";
79 }
80 else if(kData == 1) {
81 //cout<<"shuffling - no mixing"<<endl;
82 listBFName = "listBFPsiShuffled_";
83 }
84 else if(kData == 2) {
85 //cout<<"no shuffling - mixing"<<endl;
86 listBFName = "listBFPsiMixed_";
87 }
88 listBFName += centralityArray[gCentrality-1];
5de9ad1a 89 if(gBit > -1) {
90 listBFName += "_Bit"; listBFName += gBit; }
91 if(gCentralityEstimator) {
92 listBFName += "_"; listBFName += gCentralityEstimator;}
a38fd7f3 93
5365d1d7 94 // histograms were already retrieved (in first iteration)
95 if(dir->Get(Form("%s_histograms",listBFName.Data()))){
96 listBF = dynamic_cast<TList *>(dir->Get(Form("%s_histograms",listBFName.Data())));
a38fd7f3 97 }
a38fd7f3 98
5365d1d7 99 // histograms were not yet retrieved (this is the first iteration)
100 else{
101
102 listBF = dynamic_cast<TList *>(dir->Get(listBFName.Data()));
103 cout<<"======================================================="<<endl;
bfb625e3 104 cout<<"List name (check): "<<listBFName.Data()<<endl;
5365d1d7 105 cout<<"List name: "<<listBF->GetName()<<endl;
106 //listBF->ls();
a38fd7f3 107
5365d1d7 108 //Get the histograms
109 TString histoName;
110 if(kData == 0)
111 histoName = "fHistPV0M";
112 else if(kData == 1)
113 histoName = "fHistP_shuffleV0M";
114 else if(kData == 2)
115 histoName = "fHistPV0M";
116 AliTHn *fHistP = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));
117 if(!fHistP) {
118 Printf("fHistP %s not found!!!",histoName.Data());
119 break;
120 }
121 fHistP->FillParent(); fHistP->DeleteContainers();
122
123 if(kData == 0)
124 histoName = "fHistNV0M";
125 if(kData == 1)
126 histoName = "fHistN_shuffleV0M";
127 if(kData == 2)
128 histoName = "fHistNV0M";
129 AliTHn *fHistN = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));
130 if(!fHistN) {
131 Printf("fHistN %s not found!!!",histoName.Data());
132 break;
133 }
134 fHistN->FillParent(); fHistN->DeleteContainers();
135
136 if(kData == 0)
137 histoName = "fHistPNV0M";
138 if(kData == 1)
139 histoName = "fHistPN_shuffleV0M";
140 if(kData == 2)
141 histoName = "fHistPNV0M";
142 AliTHn *fHistPN = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));
143 if(!fHistPN) {
144 Printf("fHistPN %s not found!!!",histoName.Data());
145 break;
146 }
147 fHistPN->FillParent(); fHistPN->DeleteContainers();
148
149 if(kData == 0)
150 histoName = "fHistNPV0M";
151 if(kData == 1)
152 histoName = "fHistNP_shuffleV0M";
153 if(kData == 2)
154 histoName = "fHistNPV0M";
155 AliTHn *fHistNP = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));
156 if(!fHistNP) {
157 Printf("fHistNP %s not found!!!",histoName.Data());
158 break;
159 }
160 fHistNP->FillParent(); fHistNP->DeleteContainers();
161
162 if(kData == 0)
163 histoName = "fHistPPV0M";
164 if(kData == 1)
165 histoName = "fHistPP_shuffleV0M";
166 if(kData == 2)
167 histoName = "fHistPPV0M";
168 AliTHn *fHistPP = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));
169 if(!fHistPP) {
170 Printf("fHistPP %s not found!!!",histoName.Data());
171 break;
172 }
173 fHistPP->FillParent(); fHistPP->DeleteContainers();
174
175 if(kData == 0)
176 histoName = "fHistNNV0M";
177 if(kData == 1)
178 histoName = "fHistNN_shuffleV0M";
179 if(kData == 2)
180 histoName = "fHistNNV0M";
181 AliTHn *fHistNN = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));
182 if(!fHistNN) {
183 Printf("fHistNN %s not found!!!",histoName.Data());
184 break;
185 }
186 fHistNN->FillParent(); fHistNN->DeleteContainers();
187
188 dir->cd();
189 listBF->Write(Form("%s_histograms",listBFName.Data()), TObject::kSingleKey);
190
191 }// first iteration
a38fd7f3 192
5365d1d7 193 f->Close();
a38fd7f3 194
195 return listBF;
196}
197
198//______________________________________________________//
eb63b883 199void draw(TList *listBF, TList *listBFShuffled, TList *listBFMixed,
200 Int_t gCentrality, Int_t gDeltaEtaDeltaPhi,
6acdbcb2 201 Double_t psiMin, Double_t psiMax,
202 Double_t ptTriggerMin, Double_t ptTriggerMax,
f0c5040c 203 Double_t ptAssociatedMin, Double_t ptAssociatedMax,
d67eae53 204 Bool_t k2pMethod = kFALSE,Bool_t k2pMethod2D = kFALSE, TString eventClass="EventPlane") {
a38fd7f3 205 gROOT->LoadMacro("~/SetPlotStyle.C");
206 SetPlotStyle();
207 gStyle->SetPalette(1,0);
208
eb63b883 209 const Int_t gRebin = gDeltaEtaDeltaPhi; //rebin by 2 the Delta phi projection
210
a38fd7f3 211 //balance function
212 AliTHn *hP = NULL;
213 AliTHn *hN = NULL;
214 AliTHn *hPN = NULL;
215 AliTHn *hNP = NULL;
216 AliTHn *hPP = NULL;
217 AliTHn *hNN = NULL;
218 //listBF->ls();
219 //Printf("=================");
220 hP = (AliTHn*) listBF->FindObject("fHistPV0M");
221 hN = (AliTHn*) listBF->FindObject("fHistNV0M");
222 hPN = (AliTHn*) listBF->FindObject("fHistPNV0M");
223 hNP = (AliTHn*) listBF->FindObject("fHistNPV0M");
224 hPP = (AliTHn*) listBF->FindObject("fHistPPV0M");
225 hNN = (AliTHn*) listBF->FindObject("fHistNNV0M");
226
227 AliBalancePsi *b = new AliBalancePsi();
d67eae53 228 b->SetEventClass(eventClass);
a38fd7f3 229 b->SetHistNp(hP);
230 b->SetHistNn(hN);
231 b->SetHistNpn(hPN);
232 b->SetHistNnp(hNP);
233 b->SetHistNpp(hPP);
234 b->SetHistNnn(hNN);
235
236 //balance function shuffling
237 AliTHn *hPShuffled = NULL;
238 AliTHn *hNShuffled = NULL;
239 AliTHn *hPNShuffled = NULL;
240 AliTHn *hNPShuffled = NULL;
241 AliTHn *hPPShuffled = NULL;
242 AliTHn *hNNShuffled = NULL;
243 //listBFShuffled->ls();
244 hPShuffled = (AliTHn*) listBFShuffled->FindObject("fHistP_shuffleV0M");
245 hNShuffled = (AliTHn*) listBFShuffled->FindObject("fHistN_shuffleV0M");
246 hPNShuffled = (AliTHn*) listBFShuffled->FindObject("fHistPN_shuffleV0M");
247 hNPShuffled = (AliTHn*) listBFShuffled->FindObject("fHistNP_shuffleV0M");
248 hPPShuffled = (AliTHn*) listBFShuffled->FindObject("fHistPP_shuffleV0M");
249 hNNShuffled = (AliTHn*) listBFShuffled->FindObject("fHistNN_shuffleV0M");
250
251 AliBalancePsi *bShuffled = new AliBalancePsi();
d67eae53 252 bShuffled->SetEventClass(eventClass);
a38fd7f3 253 bShuffled->SetHistNp(hPShuffled);
254 bShuffled->SetHistNn(hNShuffled);
255 bShuffled->SetHistNpn(hPNShuffled);
256 bShuffled->SetHistNnp(hNPShuffled);
257 bShuffled->SetHistNpp(hPPShuffled);
258 bShuffled->SetHistNnn(hNNShuffled);
259
eb63b883 260 //balance function mixing
261 AliTHn *hPMixed = NULL;
262 AliTHn *hNMixed = NULL;
263 AliTHn *hPNMixed = NULL;
264 AliTHn *hNPMixed = NULL;
265 AliTHn *hPPMixed = NULL;
266 AliTHn *hNNMixed = NULL;
267 //listBFMixed->ls();
268 hPMixed = (AliTHn*) listBFMixed->FindObject("fHistPV0M");
269 hNMixed = (AliTHn*) listBFMixed->FindObject("fHistNV0M");
270 hPNMixed = (AliTHn*) listBFMixed->FindObject("fHistPNV0M");
271 hNPMixed = (AliTHn*) listBFMixed->FindObject("fHistNPV0M");
272 hPPMixed = (AliTHn*) listBFMixed->FindObject("fHistPPV0M");
273 hNNMixed = (AliTHn*) listBFMixed->FindObject("fHistNNV0M");
274
275 AliBalancePsi *bMixed = new AliBalancePsi();
d67eae53 276 bMixed->SetEventClass(eventClass);
eb63b883 277 bMixed->SetHistNp(hPMixed);
278 bMixed->SetHistNn(hNMixed);
279 bMixed->SetHistNpn(hPNMixed);
280 bMixed->SetHistNnp(hNPMixed);
281 bMixed->SetHistNpp(hPPMixed);
282 bMixed->SetHistNnn(hNNMixed);
283
6acdbcb2 284 TH1D *gHistBalanceFunction;
285 TH1D *gHistBalanceFunctionShuffled;
eb63b883 286 TH1D *gHistBalanceFunctionMixed;
287 TH1D *gHistBalanceFunctionSubtracted;
a38fd7f3 288 TString histoTitle, pngName;
6acdbcb2 289 TLegend *legend;
a38fd7f3 290
d67eae53 291 if(eventClass == "Centrality"){
292 histoTitle = "Centrality: ";
293 histoTitle += psiMin;
294 histoTitle += " - ";
295 histoTitle += psiMax;
296 histoTitle += " % ";
297 histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})";
298 }
299 else if(eventClass == "Multiplicity"){
300 histoTitle = "Multiplicity: ";
301 histoTitle += psiMin;
302 histoTitle += " - ";
303 histoTitle += psiMax;
304 histoTitle += " tracks";
305 histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})";
306 }
307 else{ // "EventPlane" (default)
308 histoTitle = "Centrality: ";
309 histoTitle += centralityArray[gCentrality-1];
310 histoTitle += "%";
311 if((psiMin == -0.5)&&(psiMax == 0.5))
312 histoTitle += " (-7.5^{o} < #varphi - #Psi_{2} < 7.5^{o})";
313 else if((psiMin == 0.5)&&(psiMax == 1.5))
314 histoTitle += " (37.5^{o} < #varphi - #Psi_{2} < 52.5^{o})";
315 else if((psiMin == 1.5)&&(psiMax == 2.5))
316 histoTitle += " (82.5^{o} < #varphi - #Psi_{2} < 97.5^{o})";
317 else
318 histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})";
319 }
bfb625e3 320
eb63b883 321 //Raw balance function
bfb625e3 322 if(k2pMethod){
323 if(bMixed){
f0c5040c 324 gHistBalanceFunction = b->GetBalanceFunctionHistogram2pMethod(0,gDeltaEtaDeltaPhi,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed);
bfb625e3 325 }
f0c5040c 326 else{
bfb625e3 327 cerr<<"RAW: NO MIXED BF BUT REQUESTED CORRECTING WITH IT! --> FAIL"<<endl;
f0c5040c 328 return;
329 }
bfb625e3 330 }
331 else if(k2pMethod2D){
332 if(bMixed){
333 if(gDeltaEtaDeltaPhi==1) //Delta eta
334 gHistBalanceFunction = b->GetBalanceFunction1DFrom2D2pMethod(0,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed);
335 else //Delta phi
336 gHistBalanceFunction = b->GetBalanceFunction1DFrom2D2pMethod(1,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed);
337 }
338 else{
339 cerr<<"RAW: NO MIXED BF BUT REQUESTED CORRECTING WITH IT! --> FAIL"<<endl;
340 return;
341 }
342 }
f0c5040c 343 else
344 gHistBalanceFunction = b->GetBalanceFunctionHistogram(0,gDeltaEtaDeltaPhi,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax);
6acdbcb2 345 gHistBalanceFunction->SetMarkerStyle(20);
346 gHistBalanceFunction->SetTitle(histoTitle.Data());
347 gHistBalanceFunction->GetYaxis()->SetTitleOffset(1.3);
eb63b883 348 gHistBalanceFunction->SetName("gHistBalanceFunction");
6acdbcb2 349
eb63b883 350 //Shuffled balance function
bfb625e3 351 if(k2pMethod){
f0c5040c 352 if(bMixed)
353 gHistBalanceFunctionShuffled = bShuffled->GetBalanceFunctionHistogram2pMethod(0,gDeltaEtaDeltaPhi,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed);
354 else{
bfb625e3 355 cerr<<"SHUFFLE: NO MIXED BF BUT REQUESTED CORRECTING WITH IT! --> FAIL"<<endl;
356 return;
357 }
358 }
359 else if(k2pMethod2D){
360 if(bMixed){
361 if(gDeltaEtaDeltaPhi==1) //Delta eta
362 gHistBalanceFunctionShuffled = bShuffled->GetBalanceFunction1DFrom2D2pMethod(0,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed);
363 else //Delta phi
364 gHistBalanceFunctionShuffled = bShuffled->GetBalanceFunction1DFrom2D2pMethod(1,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed);
365 }
366 else{
367 cerr<<"SHUFFLE: NO MIXED BF BUT REQUESTED CORRECTING WITH IT! --> FAIL"<<endl;
f0c5040c 368 return;
369 }
bfb625e3 370 }
f0c5040c 371 else
372 gHistBalanceFunctionShuffled = bShuffled->GetBalanceFunctionHistogram(0,gDeltaEtaDeltaPhi,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax);
6acdbcb2 373 gHistBalanceFunctionShuffled->SetMarkerStyle(24);
eb63b883 374 gHistBalanceFunctionShuffled->SetName("gHistBalanceFunctionShuffled");
375
376 //Mixed balance function
bfb625e3 377 if(k2pMethod){
f0c5040c 378 if(bMixed)
379 gHistBalanceFunctionMixed = bMixed->GetBalanceFunctionHistogram2pMethod(0,gDeltaEtaDeltaPhi,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed);
380 else{
bfb625e3 381 cerr<<"MIXED: NO MIXED BF BUT REQUESTED CORRECTING WITH IT! --> FAIL"<<endl;
f0c5040c 382 return;
383 }
bfb625e3 384 }
385 else if(k2pMethod2D){
386 if(bMixed){
387 if(gDeltaEtaDeltaPhi==1) //Delta eta
388 gHistBalanceFunctionMixed = bMixed->GetBalanceFunction1DFrom2D2pMethod(0,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed);
389 else //Delta phi
390 gHistBalanceFunctionMixed = bMixed->GetBalanceFunction1DFrom2D2pMethod(1,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed);
391 }
392 else{
393 cerr<<"MIXED: NO MIXED BF BUT REQUESTED CORRECTING WITH IT! --> FAIL"<<endl;
394 return;
395 }
396 }
f0c5040c 397 else
398 gHistBalanceFunctionMixed = bMixed->GetBalanceFunctionHistogram(0,gDeltaEtaDeltaPhi,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax);
eb63b883 399 gHistBalanceFunctionMixed->SetMarkerStyle(25);
400 gHistBalanceFunctionMixed->SetName("gHistBalanceFunctionMixed");
6acdbcb2 401
eb63b883 402 //Subtracted balance function
403 gHistBalanceFunctionSubtracted = dynamic_cast<TH1D *>(gHistBalanceFunction->Clone());
404 gHistBalanceFunctionSubtracted->Add(gHistBalanceFunctionMixed,-1);
405 gHistBalanceFunctionSubtracted->Rebin(gRebin);
406 gHistBalanceFunctionSubtracted->SetMarkerStyle(20);
407 gHistBalanceFunctionSubtracted->SetTitle(histoTitle.Data());
408 gHistBalanceFunctionSubtracted->GetYaxis()->SetTitleOffset(1.3);
409 gHistBalanceFunctionSubtracted->SetName("gHistBalanceFunctionSubtracted");
410
411 TCanvas *c1 = new TCanvas("c1","",0,0,600,500);
6acdbcb2 412 c1->SetFillColor(10);
413 c1->SetHighLightColor(10);
414 c1->SetLeftMargin(0.15);
415 gHistBalanceFunction->DrawCopy("E");
416 gHistBalanceFunctionShuffled->DrawCopy("ESAME");
eb63b883 417 gHistBalanceFunctionMixed->DrawCopy("ESAME");
6acdbcb2 418
eb63b883 419 legend = new TLegend(0.18,0.62,0.45,0.82,"","brNDC");
6acdbcb2 420 legend->SetTextSize(0.045);
421 legend->SetTextFont(42);
422 legend->SetBorderSize(0);
423 legend->SetFillStyle(0);
424 legend->SetFillColor(10);
425 legend->SetMargin(0.25);
426 legend->SetShadowColor(10);
427 legend->AddEntry(gHistBalanceFunction,"Data","lp");
428 legend->AddEntry(gHistBalanceFunctionShuffled,"Shuffled data","lp");
eb63b883 429 legend->AddEntry(gHistBalanceFunctionMixed,"Mixed data","lp");
6acdbcb2 430 legend->Draw();
431
d67eae53 432 pngName = "BalanceFunction.";
433 if(eventClass == "Centrality"){
434 pngName += Form("Centrality%.1fTo%.1f",psiMin,psiMax);
435 if(gDeltaEtaDeltaPhi == 1) pngName += ".InDeltaEta.PsiAll.PttFrom";
436 else if(gDeltaEtaDeltaPhi == 2) pngName += ".InDeltaPhi.PsiAll.PttFrom";
437 }
438 else if(eventClass == "Multiplicity"){
439 pngName += Form("Multiplicity%.0fTo%.0f",psiMin,psiMax);
440 if(gDeltaEtaDeltaPhi == 1) pngName += ".InDeltaEta.PsiAll.PttFrom";
441 else if(gDeltaEtaDeltaPhi == 2) pngName += ".InDeltaPhi.PsiAll.PttFrom";
442 }
443 else{ // "EventPlane" (default)
444 pngName += "Centrality";
445 pngName += gCentrality;
446 if(gDeltaEtaDeltaPhi == 1) pngName += ".InDeltaEta.Psi";
447 else if(gDeltaEtaDeltaPhi == 2) pngName += ".InDeltaPhi.Psi";
448 if((psiMin == -0.5)&&(psiMax == 0.5)) pngName += "InPlane.Ptt";
449 else if((psiMin == 0.5)&&(psiMax == 1.5)) pngName += "Intermediate.Ptt";
450 else if((psiMin == 1.5)&&(psiMax == 2.5)) pngName += "OutOfPlane.Ptt";
451 else if((psiMin == 2.5)&&(psiMax == 3.5)) pngName += "Rest.PttFrom";
452 else pngName += "All.PttFrom";
453 }
454 pngName += Form("%.1f",ptTriggerMin); pngName += "To";
455 pngName += Form("%.1f",ptTriggerMax); pngName += "PtaFrom";
456 pngName += Form("%.1f",ptAssociatedMin); pngName += "To";
457 pngName += Form("%.1f",ptAssociatedMax);
458 if(k2pMethod2D) pngName += "_2pMethod2D";
459 else if(k2pMethod) pngName += "_2pMethod";
6acdbcb2 460 pngName += ".png";
d67eae53 461
6acdbcb2 462 c1->SaveAs(pngName.Data());
463
464 GetWeightedMean(gHistBalanceFunction);
465 GetWeightedMean(gHistBalanceFunctionShuffled);
466
467 TString meanLatex, rmsLatex, skewnessLatex, kurtosisLatex;
468 meanLatex = "#mu = ";
eb63b883 469 meanLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetMean());
6acdbcb2 470 meanLatex += " #pm ";
eb63b883 471 meanLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetMeanError());
6acdbcb2 472
473 rmsLatex = "#sigma = ";
eb63b883 474 rmsLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetRMS());
6acdbcb2 475 rmsLatex += " #pm ";
eb63b883 476 rmsLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetRMSError());
6acdbcb2 477
478 skewnessLatex = "S = ";
eb63b883 479 skewnessLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetSkewness(1));
6acdbcb2 480 skewnessLatex += " #pm ";
eb63b883 481 skewnessLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetSkewness(11));
6acdbcb2 482
483 kurtosisLatex = "K = ";
eb63b883 484 kurtosisLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetKurtosis(1));
6acdbcb2 485 kurtosisLatex += " #pm ";
eb63b883 486 kurtosisLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetKurtosis(11));
487 Printf("Mean: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetMean(),gHistBalanceFunctionSubtracted->GetMeanError());
488 Printf("RMS: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetRMS(),gHistBalanceFunctionSubtracted->GetRMSError());
489 Printf("Skeweness: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetSkewness(1),gHistBalanceFunctionSubtracted->GetSkewness(11));
490 Printf("Kurtosis: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetKurtosis(1),gHistBalanceFunctionSubtracted->GetKurtosis(11));
491
492 TCanvas *c2 = new TCanvas("c2","",600,0,600,500);
493 c2->SetFillColor(10);
494 c2->SetHighLightColor(10);
495 c2->SetLeftMargin(0.15);
496 gHistBalanceFunctionSubtracted->DrawCopy("E");
6acdbcb2 497
498 TLatex *latex = new TLatex();
499 latex->SetNDC();
500 latex->SetTextSize(0.035);
501 latex->SetTextColor(1);
502 latex->DrawLatex(0.64,0.85,meanLatex.Data());
503 latex->DrawLatex(0.64,0.81,rmsLatex.Data());
504 latex->DrawLatex(0.64,0.77,skewnessLatex.Data());
505 latex->DrawLatex(0.64,0.73,kurtosisLatex.Data());
eb63b883 506
d67eae53 507 TString newFileName = "balanceFunction.";
508 if(eventClass == "Centrality"){
509 newFileName += Form("Centrality%.1fTo%.1f",psiMin,psiMax);
510 if(gDeltaEtaDeltaPhi == 1) newFileName += ".InDeltaEta.PsiAll.PttFrom";
511 else if(gDeltaEtaDeltaPhi == 2) newFileName += ".InDeltaPhi.PsiAll.PttFrom";
512 }
513 else if(eventClass == "Multiplicity"){
514 newFileName += Form("Multiplicity%.0fTo%.0f",psiMin,psiMax);
515 if(gDeltaEtaDeltaPhi == 1) newFileName += ".InDeltaEta.PsiAll.PttFrom";
516 else if(gDeltaEtaDeltaPhi == 2) newFileName += ".InDeltaPhi.PsiAll.PttFrom";
517 }
518 else{ // "EventPlane" (default)
519 newFileName += "Centrality";
520 newFileName += gCentrality;
521 if(gDeltaEtaDeltaPhi == 1) newFileName += ".InDeltaEta.Psi";
522 else if(gDeltaEtaDeltaPhi == 2) newFileName += ".InDeltaPhi.Psi";
523 if((psiMin == -0.5)&&(psiMax == 0.5)) newFileName += "InPlane.Ptt";
524 else if((psiMin == 0.5)&&(psiMax == 1.5)) newFileName += "Intermediate.Ptt";
525 else if((psiMin == 1.5)&&(psiMax == 2.5)) newFileName += "OutOfPlane.Ptt";
526 else if((psiMin == 2.5)&&(psiMax == 3.5)) newFileName += "Rest.PttFrom";
527 else newFileName += "All.PttFrom";
528 }
648f1a5a 529 newFileName += Form("%.1f",ptTriggerMin); newFileName += "To";
530 newFileName += Form("%.1f",ptTriggerMax); newFileName += "PtaFrom";
531 newFileName += Form("%.1f",ptAssociatedMin); newFileName += "To";
532 newFileName += Form("%.1f",ptAssociatedMax);
d67eae53 533 if(k2pMethod2D) newFileName += "_2pMethod2D";
534 else if(k2pMethod) newFileName += "_2pMethod";
648f1a5a 535 newFileName += ".root";
eb63b883 536
537 TFile *fOutput = new TFile(newFileName.Data(),"recreate");
538 fOutput->cd();
539 gHistBalanceFunction->Write();
540 gHistBalanceFunctionShuffled->Write();
541 gHistBalanceFunctionMixed->Write();
542 gHistBalanceFunctionSubtracted->Write();
543 fOutput->Close();
a38fd7f3 544}
545
546//____________________________________________________________________//
547void GetWeightedMean(TH1D *gHistBalance, Int_t fStartBin = 1) {
548 //Prints the calculated width of the BF and its error
549 Double_t gSumXi = 0.0, gSumBi = 0.0, gSumBiXi = 0.0;
550 Double_t gSumBiXi2 = 0.0, gSumBi2Xi2 = 0.0;
551 Double_t gSumDeltaBi2 = 0.0, gSumXi2DeltaBi2 = 0.0;
552 Double_t deltaBalP2 = 0.0, integral = 0.0;
553 Double_t deltaErrorNew = 0.0;
554
555 //Retrieve this variables from Histogram
556 Int_t fNumberOfBins = gHistBalance->GetNbinsX();
557 Double_t fP2Step = gHistBalance->GetBinWidth(1); // assume equal binning!
558
bfb625e3 559 //cout<<"=================================================="<<endl;
560 //cout<<"RECALCULATION OF BF WIDTH (StartBin = "<<fStartBin<<")"<<endl;
561 //cout<<"HISTOGRAM has "<<fNumberOfBins<<" bins with bin size of "<<fP2Step<<endl;
562 //cout<<"=================================================="<<endl;
a38fd7f3 563 for(Int_t i = 1; i <= fNumberOfBins; i++) {
a38fd7f3 564 // this is to simulate |Delta eta| or |Delta phi|
565 if(fNumberOfBins/2 - fStartBin + 1 < i && i < fNumberOfBins/2 + fStartBin ) continue;
566
bfb625e3 567 //cout<<"B: "<<gHistBalance->GetBinContent(i)<<"\t Error: "<<gHistBalance->GetBinError(i)<<"\t bin: "<<TMath::Abs(gHistBalance->GetBinCenter(i))<<endl;
a38fd7f3 568
569 gSumXi += TMath::Abs(gHistBalance->GetBinCenter(i)); // this is to simulate |Delta eta| or |Delta phi|
570 gSumBi += gHistBalance->GetBinContent(i);
571 gSumBiXi += gHistBalance->GetBinContent(i)*TMath::Abs(gHistBalance->GetBinCenter(i));
572 gSumBiXi2 += gHistBalance->GetBinContent(i)*TMath::Power(TMath::Abs(gHistBalance->GetBinCenter(i)),2);
573 gSumBi2Xi2 += TMath::Power(gHistBalance->GetBinContent(i),2)*TMath::Power(TMath::Abs(gHistBalance->GetBinCenter(i)),2);
574 gSumDeltaBi2 += TMath::Power(gHistBalance->GetBinError(i),2);
575 gSumXi2DeltaBi2 += TMath::Power(TMath::Abs(gHistBalance->GetBinCenter(i)),2) * TMath::Power(gHistBalance->GetBinError(i),2);
576
577 deltaBalP2 += fP2Step*TMath::Power(gHistBalance->GetBinError(i),2);
578 integral += fP2Step*gHistBalance->GetBinContent(i);
579 }
580 for(Int_t i = fStartBin; i < fNumberOfBins; i++)
581 deltaErrorNew += gHistBalance->GetBinError(i)*(TMath::Abs(gHistBalance->GetBinCenter(i))*gSumBi - gSumBiXi)/TMath::Power(gSumBi,2);
582
583 Double_t integralError = TMath::Sqrt(deltaBalP2);
584
585 Double_t delta = gSumBiXi / gSumBi;
586 Double_t deltaError = (gSumBiXi / gSumBi) * TMath::Sqrt(TMath::Power((TMath::Sqrt(gSumXi2DeltaBi2)/gSumBiXi),2) + TMath::Power((gSumDeltaBi2/gSumBi),2) );
587 cout<<"=================================================="<<endl;
588 cout<<"Width: "<<delta<<"\t Error: "<<deltaError<<endl;
589 cout<<"New error: "<<deltaErrorNew<<endl;
590 cout<<"Integral: "<<integral<<"\t Error: "<<integralError<<endl;
591 cout<<"=================================================="<<endl;
592 cout<<endl;
593}
eb63b883 594
648f1a5a 595//______________________________________________________//
596void drawBFPsi(const char* lhcPeriod = "LHC10h",
597 Int_t gCentrality = 1,
eb63b883 598 Int_t gDeltaEtaDeltaPhi = 2,
599 Double_t psiMin = -0.5, Double_t psiMax = 0.5,
600 Double_t ptTriggerMin = -1.,
601 Double_t ptTriggerMax = -1.,
602 Double_t ptAssociatedMin = -1.,
603 Double_t ptAssociatedMax = -1.) {
604 //Macro that draws the BF distributions for each centrality bin
605 //for reaction plane dependent analysis
606 //Author: Panos.Christakoglou@nikhef.nl
607 gROOT->LoadMacro("~/SetPlotStyle.C");
608 SetPlotStyle();
609
610 //Get the input file
648f1a5a 611 TString filename = lhcPeriod; filename +="/PttFrom";
db7174c0 612 filename += Form("%.1f",ptTriggerMin); filename += "To";
613 filename += Form("%.1f",ptTriggerMax); filename += "PtaFrom";
614 filename += Form("%.1f",ptAssociatedMin); filename += "To";
615 filename += Form("%.1f",ptAssociatedMax);
616 filename += "/balanceFunction.Centrality";
eb63b883 617 filename += gCentrality; filename += ".In";
618 if(gDeltaEtaDeltaPhi == 1) filename += "DeltaEta.Psi";
619 else if(gDeltaEtaDeltaPhi == 2) filename += "DeltaPhi.Psi";
620 if((psiMin == -0.5)&&(psiMax == 0.5)) filename += "InPlane.Ptt";
621 else if((psiMin == 0.5)&&(psiMax == 1.5)) filename += "Intermediate.Ptt";
622 else if((psiMin == 1.5)&&(psiMax == 2.5)) filename += "OutOfPlane.Ptt";
648f1a5a 623 else if((psiMin == 2.5)&&(psiMax == 3.5)) filename += "Rest.Ptt";
624 else filename += "All.PttFrom";
db7174c0 625 filename += Form("%.1f",ptTriggerMin); filename += "To";
626 filename += Form("%.1f",ptTriggerMax); filename += "PtaFrom";
627 filename += Form("%.1f",ptAssociatedMin); filename += "To";
628 filename += Form("%.1f",ptAssociatedMax); filename += ".root";
eb63b883 629
630 //Open the file
631 TFile *f = TFile::Open(filename.Data());
632 if((!f)||(!f->IsOpen())) {
633 Printf("The file %s is not found. Aborting...",filename);
634 return listBF;
635 }
636 //f->ls();
637
638 //Raw balance function
639 TH1D *gHistBalanceFunction = dynamic_cast<TH1D *>(f->Get("gHistBalanceFunction"));
640 gHistBalanceFunction->SetStats(kFALSE);
641 gHistBalanceFunction->SetMarkerStyle(20);
642 gHistBalanceFunction->GetYaxis()->SetTitleOffset(1.3);
643 if(gDeltaEtaDeltaPhi == 2) {
644 gHistBalanceFunction->GetYaxis()->SetTitle("B(#Delta #varphi)");
645 gHistBalanceFunction->GetXaxis()->SetTitle("#Delta #varphi (deg.)");
646 }
647
648 //Shuffled balance function
649 TH1D *gHistBalanceFunctionShuffled = dynamic_cast<TH1D *>(f->Get("gHistBalanceFunctionShuffled"));
650 gHistBalanceFunction->SetStats(kFALSE);
651 gHistBalanceFunctionShuffled->SetMarkerStyle(24);
652
653 //Mixed balance function
654 TH1D *gHistBalanceFunctionMixed = dynamic_cast<TH1D *>(f->Get("gHistBalanceFunctionMixed"));
655 gHistBalanceFunction->SetStats(kFALSE);
656 gHistBalanceFunctionMixed->SetMarkerStyle(25);
657
658 //Subtracted balance function
659 TH1D *gHistBalanceFunctionSubtracted = dynamic_cast<TH1D *>(f->Get("gHistBalanceFunctionSubtracted"));
660 gHistBalanceFunctionSubtracted->SetStats(kFALSE);
661 gHistBalanceFunctionSubtracted->SetMarkerStyle(20);
662 gHistBalanceFunctionSubtracted->GetYaxis()->SetTitleOffset(1.3);
663 if(gDeltaEtaDeltaPhi == 2) {
664 gHistBalanceFunctionSubtracted->GetYaxis()->SetTitle("B(#Delta #varphi)");
665 gHistBalanceFunctionSubtracted->GetXaxis()->SetTitle("#Delta #varphi (deg.)");
666 }
667
668 TString pngName;
669 TLegend *legend;
670
671 TString centralityLatex = "Centrality: ";
672 centralityLatex += centralityArray[gCentrality-1];
673 centralityLatex += "%";
674
675 TString psiLatex;
676 if((psiMin == -0.5)&&(psiMax == 0.5))
677 psiLatex = " -7.5^{o} < #varphi - #Psi_{2} < 7.5^{o}";
678 else if((psiMin == 0.5)&&(psiMax == 1.5))
679 psiLatex = " 37.5^{o} < #varphi - #Psi_{2} < 52.5^{o}";
680 else if((psiMin == 1.5)&&(psiMax == 2.5))
681 psiLatex = " 82.5^{o} < #varphi - #Psi_{2} < 97.5^{o}";
682 else
683 psiLatex = " 0^{o} < #varphi - #Psi_{2} < 180^{o}";
684
685 TString pttLatex = Form("%.1f",ptTriggerMin);
686 pttLatex += " < p_{T}^{t} < "; pttLatex += Form("%.1f",ptTriggerMax);
687 pttLatex += " GeV/c";
688
689 TString ptaLatex = Form("%.1f",ptAssociatedMin);
690 ptaLatex += " < p_{T}^{a} < "; ptaLatex += Form("%.1f",ptAssociatedMax);
691 ptaLatex += " GeV/c";
692
693 //Draw the results
694 TCanvas *c1 = new TCanvas("c1","",0,0,600,500);
695 c1->SetFillColor(10); c1->SetHighLightColor(10);
696 c1->SetLeftMargin(0.17); c1->SetTopMargin(0.05);
697 gHistBalanceFunction->SetTitle("");
698 gHistBalanceFunction->GetYaxis()->SetTitleOffset(1.4);
699 gHistBalanceFunction->GetYaxis()->SetNdivisions(10);
700 gHistBalanceFunction->GetXaxis()->SetNdivisions(10);
701 gHistBalanceFunction->DrawCopy("E");
702 gHistBalanceFunctionShuffled->DrawCopy("ESAME");
703 gHistBalanceFunctionMixed->DrawCopy("ESAME");
704
705 legend = new TLegend(0.2,0.72,0.45,0.92,"","brNDC");
706 legend->SetTextSize(0.05);
707 legend->SetTextFont(42);
708 legend->SetBorderSize(0);
709 legend->SetFillStyle(0);
710 legend->SetFillColor(10);
711 legend->SetMargin(0.25);
712 legend->SetShadowColor(10);
713 legend->AddEntry(gHistBalanceFunction,"Data","lp");
714 legend->AddEntry(gHistBalanceFunctionShuffled,"Shuffled data","lp");
715 legend->AddEntry(gHistBalanceFunctionMixed,"Mixed data","lp");
716 legend->Draw();
717
718 TLatex *latexInfo1 = new TLatex();
719 latexInfo1->SetNDC();
720 latexInfo1->SetTextSize(0.04);
721 latexInfo1->SetTextColor(1);
722 latexInfo1->DrawLatex(0.58,0.88,centralityLatex.Data());
723 latexInfo1->DrawLatex(0.58,0.82,psiLatex.Data());
724 latexInfo1->DrawLatex(0.58,0.76,pttLatex.Data());
725 latexInfo1->DrawLatex(0.58,0.70,ptaLatex.Data());
726
727 //pngName = "BalanceFunctionDeltaEta.Centrality";
728 //pngName += centralityArray[gCentrality-1];
729 //pngName += ".Psi"; //pngName += psiMin; pngName += "To"; pngName += psiMax;
730 //pngName += ".png";
731 //c1->SaveAs(pngName.Data());
732
733 TCanvas *c2 = new TCanvas("c2","",600,0,600,500);
734 c2->SetFillColor(10); c2->SetHighLightColor(10);
735 c2->SetLeftMargin(0.17); c2->SetTopMargin(0.05);
736 gHistBalanceFunctionSubtracted->SetTitle("");
737 gHistBalanceFunctionSubtracted->GetYaxis()->SetTitleOffset(1.4);
738 gHistBalanceFunctionSubtracted->GetYaxis()->SetNdivisions(10);
739 gHistBalanceFunctionSubtracted->GetXaxis()->SetNdivisions(10);
740 gHistBalanceFunctionSubtracted->DrawCopy("E");
741
db7174c0 742 //Opening the output ascii files
743 TString filenameMean = "meanIn";
744 TString filenameSigma = "sigmaIn";
745 TString filenameSkewness = "skewnessIn";
746 TString filenameKurtosis = "kurtosisIn";
747 if(gDeltaEtaDeltaPhi == 1) {
748 filenameMean += "DeltaEta.Psi"; filenameSigma += "DeltaEta.Psi";
749 filenameSkewness += "DeltaEta.Psi"; filenameKurtosis += "DeltaEta.Psi";
750 }
751 else if(gDeltaEtaDeltaPhi == 2) {
752 filenameMean += "DeltaPhi.Psi"; filenameSigma += "DeltaPhi.Psi";
753 filenameSkewness += "DeltaPhi.Psi"; filenameKurtosis += "DeltaPhi.Psi";
754 }
755 if((psiMin == -0.5)&&(psiMax == 0.5)) {
756 filenameMean += "InPlane.Ptt"; filenameSigma += "InPlane.Ptt";
757 filenameSkewness += "InPlane.Ptt"; filenameKurtosis += "InPlane.Ptt";
758 }
759 else if((psiMin == 0.5)&&(psiMax == 1.5)) {
760 filenameMean += "Intermediate.Ptt"; filenameSigma += "Intermediate.Ptt";
761 filenameSkewness += "Intermediate.Ptt";
762 filenameKurtosis += "Intermediate.Ptt";
763 }
764 else if((psiMin == 1.5)&&(psiMax == 2.5)) {
765 filenameMean += "OutOfPlane.Ptt"; filenameSigma += "OutOfPlane.Ptt";
766 filenameSkewness += "OutOfPlane.Ptt";
767 filenameKurtosis += "OutOfPlane.Ptt";
768 }
769 else if((psiMin == 2.5)&&(psiMax == 3.5)) {
770 filenameMean += "Rest.Ptt"; filenameSigma += "Rest.Ptt";
771 filenameSkewness += "Rest.Ptt"; filenameKurtosis += "Rest.Ptt";
772 }
773 else {
774 filenameMean += "All.Ptt"; filenameSigma += "All.Ptt";
775 filenameSkewness += "All.Ptt"; filenameKurtosis += "All.Ptt";
776 }
777 filenameMean += Form("%.1f",ptTriggerMin); filenameMean += "To";
778 filenameMean += Form("%.1f",ptTriggerMax); filenameMean += "PtaFrom";
779 filenameMean += Form("%.1f",ptAssociatedMin); filenameMean += "To";
780 filenameMean += Form("%.1f",ptAssociatedMax); filenameMean += ".txt";
781 filenameSigma += Form("%.1f",ptTriggerMin); filenameSigma += "To";
782 filenameSigma += Form("%.1f",ptTriggerMax); filenameSigma += "PtaFrom";
783 filenameSigma += Form("%.1f",ptAssociatedMin); filenameSigma += "To";
784 filenameSigma += Form("%.1f",ptAssociatedMax); filenameSigma += ".txt";
785 filenameSkewness += Form("%.1f",ptTriggerMin); filenameSkewness += "To";
786 filenameSkewness += Form("%.1f",ptTriggerMax); filenameSkewness += "PtaFrom";
787 filenameSkewness += Form("%.1f",ptAssociatedMin); filenameSkewness += "To";
788 filenameSkewness += Form("%.1f",ptAssociatedMax);
789 filenameSkewness += ".txt";
790 filenameKurtosis += Form("%.1f",ptTriggerMin); filenameKurtosis += "To";
791 filenameKurtosis += Form("%.1f",ptTriggerMax); filenameKurtosis += "PtaFrom";
792 filenameKurtosis += Form("%.1f",ptAssociatedMin); filenameKurtosis += "To";
793 filenameKurtosis += Form("%.1f",ptAssociatedMax);
794 filenameKurtosis += ".txt";
795
eb63b883 796 TString meanLatex, rmsLatex, skewnessLatex, kurtosisLatex;
797 meanLatex = "#mu = ";
798 meanLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetMean());
799 meanLatex += " #pm ";
800 meanLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetMeanError());
db7174c0 801 ofstream fileMean(filenameMean.Data(),ios::app);
802 fileMean << gCentrality << " " << gHistBalanceFunctionSubtracted->GetMean() << " " <<gHistBalanceFunctionSubtracted->GetMeanError()<<endl;
803 fileMean.close();
804
eb63b883 805 rmsLatex = "#sigma = ";
806 rmsLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetRMS());
807 rmsLatex += " #pm ";
808 rmsLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetRMSError());
db7174c0 809 ofstream fileSigma(filenameSigma.Data(),ios::app);
810 fileSigma << gCentrality << " " << gHistBalanceFunctionSubtracted->GetRMS() << " " <<gHistBalanceFunctionSubtracted->GetRMSError()<<endl;
811 fileSigma.close();
eb63b883 812
813 skewnessLatex = "S = ";
814 skewnessLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetSkewness(1));
815 skewnessLatex += " #pm ";
816 skewnessLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetSkewness(11));
db7174c0 817 ofstream fileSkewness(filenameSkewness.Data(),ios::app);
818 fileSkewness << gCentrality << " " << gHistBalanceFunctionSubtracted->GetSkewness(1) << " " <<gHistBalanceFunctionSubtracted->GetSkewness(11)<<endl;
819 fileSkewness.close();
820
eb63b883 821 kurtosisLatex = "K = ";
822 kurtosisLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetKurtosis(1));
823 kurtosisLatex += " #pm ";
824 kurtosisLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetKurtosis(11));
db7174c0 825 ofstream fileKurtosis(filenameKurtosis.Data(),ios::app);
826 fileKurtosis << gCentrality << " " << gHistBalanceFunctionSubtracted->GetKurtosis(1) << " " <<gHistBalanceFunctionSubtracted->GetKurtosis(11)<<endl;
827 fileKurtosis.close();
828
eb63b883 829 Printf("Mean: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetMean(),gHistBalanceFunctionSubtracted->GetMeanError());
830 Printf("RMS: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetRMS(),gHistBalanceFunctionSubtracted->GetRMSError());
831 Printf("Skeweness: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetSkewness(1),gHistBalanceFunctionSubtracted->GetSkewness(11));
832 Printf("Kurtosis: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetKurtosis(1),gHistBalanceFunctionSubtracted->GetKurtosis(11));
833
834 latexInfo1->DrawLatex(0.18,0.88,centralityLatex.Data());
835 latexInfo1->DrawLatex(0.18,0.82,psiLatex.Data());
836 latexInfo1->DrawLatex(0.18,0.76,pttLatex.Data());
837 latexInfo1->DrawLatex(0.18,0.70,ptaLatex.Data());
838
839 TLatex *latexResults = new TLatex();
840 latexResults->SetNDC();
841 latexResults->SetTextSize(0.04);
842 latexResults->SetTextColor(1);
843 latexResults->DrawLatex(0.6,0.88,meanLatex.Data());
844 latexResults->DrawLatex(0.6,0.82,rmsLatex.Data());
845 latexResults->DrawLatex(0.6,0.76,skewnessLatex.Data());
846 latexResults->DrawLatex(0.6,0.70,kurtosisLatex.Data());
847
848}