1 const Int_t numberOfCentralityBins = 8;
2 TString centralityArray[numberOfCentralityBins] = {"0-10","10-20","20-30","30-40","40-50","50-60","60-70","70-80"};
4 void drawBalanceFunctionPsi(const char* filename = "AnalysisResultsPsi.root",
6 Int_t gDeltaEtaDeltaPhi = 2,
7 Double_t psiMin = -0.5, Double_t psiMax = 0.5,
8 Double_t ptTriggerMin = -1.,
9 Double_t ptTriggerMax = -1.,
10 Double_t ptAssociatedMin = -1.,
11 Double_t ptAssociatedMax = -1.) {
12 //Macro that draws the BF distributions for each centrality bin
13 //for reaction plane dependent analysis
14 //Author: Panos.Christakoglou@nikhef.nl
15 //Load the PWG2ebye library
16 gSystem->Load("libANALYSIS.so");
17 gSystem->Load("libANALYSISalice.so");
18 gSystem->Load("libEventMixing.so");
19 gSystem->Load("libCORRFW.so");
20 gSystem->Load("libPWGTools.so");
21 gSystem->Load("libPWGCFebye.so");
23 //Prepare the objects and return them
24 TList *listBF = GetListOfObjects(filename,gCentrality,0);
25 TList *listBFShuffled = GetListOfObjects(filename,gCentrality,1);
26 TList *listBFMixed = GetListOfObjects(filename,gCentrality,2);
28 Printf("The TList object was not created");
32 draw(listBF,listBFShuffled,listBFMixed,
33 gCentrality,gDeltaEtaDeltaPhi,
35 ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax);
38 //______________________________________________________//
39 TList *GetListOfObjects(const char* filename,
40 Int_t gCentrality, Int_t kData = 1) {
41 //Get the TList objects (QA, bf, bf shuffled)
43 //kData == 1: shuffling
49 TFile *f = TFile::Open(filename);
50 if((!f)||(!f->IsOpen())) {
51 Printf("The file %s is not found. Aborting...",filename);
56 TDirectoryFile *dir = dynamic_cast<TDirectoryFile *>(f->Get("PWGCFEbyE.outputBalanceFunctionPsiAnalysis"));
58 Printf("The TDirectoryFile is not found. Aborting...",filename);
65 //cout<<"no shuffling - no mixing"<<endl;
66 listBFName = "listBFPsi_";
69 //cout<<"shuffling - no mixing"<<endl;
70 listBFName = "listBFPsiShuffled_";
73 //cout<<"no shuffling - mixing"<<endl;
74 listBFName = "listBFPsiMixed_";
76 listBFName += centralityArray[gCentrality-1];
77 listBF = dynamic_cast<TList *>(dir->Get(listBFName.Data()));
78 cout<<"======================================================="<<endl;
79 cout<<"List name: "<<listBF->GetName()<<endl;
85 histoName = "fHistPV0M";
87 histoName = "fHistP_shuffleV0M";
89 histoName = "fHistPV0M";
90 AliTHn *fHistP = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));
92 Printf("fHistP %s not found!!!",histoName.Data());
95 fHistP->FillParent(); fHistP->DeleteContainers();
98 histoName = "fHistNV0M";
100 histoName = "fHistN_shuffleV0M";
102 histoName = "fHistNV0M";
103 AliTHn *fHistN = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));
105 Printf("fHistN %s not found!!!",histoName.Data());
108 fHistN->FillParent(); fHistN->DeleteContainers();
111 histoName = "fHistPNV0M";
113 histoName = "fHistPN_shuffleV0M";
115 histoName = "fHistPNV0M";
116 AliTHn *fHistPN = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));
118 Printf("fHistPN %s not found!!!",histoName.Data());
121 fHistPN->FillParent(); fHistPN->DeleteContainers();
124 histoName = "fHistNPV0M";
126 histoName = "fHistNP_shuffleV0M";
128 histoName = "fHistNPV0M";
129 AliTHn *fHistNP = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));
131 Printf("fHistNP %s not found!!!",histoName.Data());
134 fHistNP->FillParent(); fHistNP->DeleteContainers();
137 histoName = "fHistPPV0M";
139 histoName = "fHistPP_shuffleV0M";
141 histoName = "fHistPPV0M";
142 AliTHn *fHistPP = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));
144 Printf("fHistPP %s not found!!!",histoName.Data());
147 fHistPP->FillParent(); fHistPP->DeleteContainers();
150 histoName = "fHistNNV0M";
152 histoName = "fHistNN_shuffleV0M";
154 histoName = "fHistNNV0M";
155 AliTHn *fHistNN = dynamic_cast<AliTHn *>(listBF->FindObject(histoName.Data()));
157 Printf("fHistNN %s not found!!!",histoName.Data());
160 fHistNN->FillParent(); fHistNN->DeleteContainers();
165 //______________________________________________________//
166 void draw(TList *listBF, TList *listBFShuffled, TList *listBFMixed,
167 Int_t gCentrality, Int_t gDeltaEtaDeltaPhi,
168 Double_t psiMin, Double_t psiMax,
169 Double_t ptTriggerMin, Double_t ptTriggerMax,
170 Double_t ptAssociatedMin, Double_t ptAssociatedMax) {
171 gROOT->LoadMacro("~/SetPlotStyle.C");
173 gStyle->SetPalette(1,0);
175 const Int_t gRebin = gDeltaEtaDeltaPhi; //rebin by 2 the Delta phi projection
185 //Printf("=================");
186 hP = (AliTHn*) listBF->FindObject("fHistPV0M");
187 hN = (AliTHn*) listBF->FindObject("fHistNV0M");
188 hPN = (AliTHn*) listBF->FindObject("fHistPNV0M");
189 hNP = (AliTHn*) listBF->FindObject("fHistNPV0M");
190 hPP = (AliTHn*) listBF->FindObject("fHistPPV0M");
191 hNN = (AliTHn*) listBF->FindObject("fHistNNV0M");
193 AliBalancePsi *b = new AliBalancePsi();
201 //balance function shuffling
202 AliTHn *hPShuffled = NULL;
203 AliTHn *hNShuffled = NULL;
204 AliTHn *hPNShuffled = NULL;
205 AliTHn *hNPShuffled = NULL;
206 AliTHn *hPPShuffled = NULL;
207 AliTHn *hNNShuffled = NULL;
208 //listBFShuffled->ls();
209 hPShuffled = (AliTHn*) listBFShuffled->FindObject("fHistP_shuffleV0M");
210 hNShuffled = (AliTHn*) listBFShuffled->FindObject("fHistN_shuffleV0M");
211 hPNShuffled = (AliTHn*) listBFShuffled->FindObject("fHistPN_shuffleV0M");
212 hNPShuffled = (AliTHn*) listBFShuffled->FindObject("fHistNP_shuffleV0M");
213 hPPShuffled = (AliTHn*) listBFShuffled->FindObject("fHistPP_shuffleV0M");
214 hNNShuffled = (AliTHn*) listBFShuffled->FindObject("fHistNN_shuffleV0M");
216 AliBalancePsi *bShuffled = new AliBalancePsi();
217 bShuffled->SetHistNp(hPShuffled);
218 bShuffled->SetHistNn(hNShuffled);
219 bShuffled->SetHistNpn(hPNShuffled);
220 bShuffled->SetHistNnp(hNPShuffled);
221 bShuffled->SetHistNpp(hPPShuffled);
222 bShuffled->SetHistNnn(hNNShuffled);
224 //balance function mixing
225 AliTHn *hPMixed = NULL;
226 AliTHn *hNMixed = NULL;
227 AliTHn *hPNMixed = NULL;
228 AliTHn *hNPMixed = NULL;
229 AliTHn *hPPMixed = NULL;
230 AliTHn *hNNMixed = NULL;
232 hPMixed = (AliTHn*) listBFMixed->FindObject("fHistPV0M");
233 hNMixed = (AliTHn*) listBFMixed->FindObject("fHistNV0M");
234 hPNMixed = (AliTHn*) listBFMixed->FindObject("fHistPNV0M");
235 hNPMixed = (AliTHn*) listBFMixed->FindObject("fHistNPV0M");
236 hPPMixed = (AliTHn*) listBFMixed->FindObject("fHistPPV0M");
237 hNNMixed = (AliTHn*) listBFMixed->FindObject("fHistNNV0M");
239 AliBalancePsi *bMixed = new AliBalancePsi();
240 bMixed->SetHistNp(hPMixed);
241 bMixed->SetHistNn(hNMixed);
242 bMixed->SetHistNpn(hPNMixed);
243 bMixed->SetHistNnp(hNPMixed);
244 bMixed->SetHistNpp(hPPMixed);
245 bMixed->SetHistNnn(hNNMixed);
247 TH1D *gHistBalanceFunction;
248 TH1D *gHistBalanceFunctionShuffled;
249 TH1D *gHistBalanceFunctionMixed;
250 TH1D *gHistBalanceFunctionSubtracted;
251 TString histoTitle, pngName;
254 histoTitle = "Centrality: ";
255 histoTitle += centralityArray[gCentrality-1];
257 if((psiMin == -0.5)&&(psiMax == 0.5))
258 histoTitle += " (-7.5^{o} < #phi - #Psi_{2} < 7.5^{o})";
259 else if((psiMin == 0.5)&&(psiMax == 1.5))
260 histoTitle += " (37.5^{o} < #phi - #Psi_{2} < 52.5^{o})";
261 else if((psiMin == 1.5)&&(psiMax == 2.5))
262 histoTitle += " (82.5^{o} < #phi - #Psi_{2} < 97.5^{o})";
264 histoTitle += " (0^{o} < #phi - #Psi_{2} < 180^{o})";
266 //Raw balance function
267 gHistBalanceFunction = b->GetBalanceFunctionHistogram(0,gDeltaEtaDeltaPhi,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax);
268 gHistBalanceFunction->SetMarkerStyle(20);
269 gHistBalanceFunction->SetTitle(histoTitle.Data());
270 gHistBalanceFunction->GetYaxis()->SetTitleOffset(1.3);
271 gHistBalanceFunction->SetName("gHistBalanceFunction");
273 //Shuffled balance function
274 gHistBalanceFunctionShuffled = bShuffled->GetBalanceFunctionHistogram(0,gDeltaEtaDeltaPhi,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax);
275 gHistBalanceFunctionShuffled->SetMarkerStyle(24);
276 gHistBalanceFunctionShuffled->SetName("gHistBalanceFunctionShuffled");
278 //Mixed balance function
279 gHistBalanceFunctionMixed = bMixed->GetBalanceFunctionHistogram(0,gDeltaEtaDeltaPhi,psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax);
280 gHistBalanceFunctionMixed->SetMarkerStyle(25);
281 gHistBalanceFunctionMixed->SetName("gHistBalanceFunctionMixed");
283 //Subtracted balance function
284 gHistBalanceFunctionSubtracted = dynamic_cast<TH1D *>(gHistBalanceFunction->Clone());
285 gHistBalanceFunctionSubtracted->Add(gHistBalanceFunctionMixed,-1);
286 gHistBalanceFunctionSubtracted->Rebin(gRebin);
287 gHistBalanceFunctionSubtracted->SetMarkerStyle(20);
288 gHistBalanceFunctionSubtracted->SetTitle(histoTitle.Data());
289 gHistBalanceFunctionSubtracted->GetYaxis()->SetTitleOffset(1.3);
290 gHistBalanceFunctionSubtracted->SetName("gHistBalanceFunctionSubtracted");
292 TCanvas *c1 = new TCanvas("c1","",0,0,600,500);
293 c1->SetFillColor(10);
294 c1->SetHighLightColor(10);
295 c1->SetLeftMargin(0.15);
296 gHistBalanceFunction->DrawCopy("E");
297 gHistBalanceFunctionShuffled->DrawCopy("ESAME");
298 gHistBalanceFunctionMixed->DrawCopy("ESAME");
300 legend = new TLegend(0.18,0.62,0.45,0.82,"","brNDC");
301 legend->SetTextSize(0.045);
302 legend->SetTextFont(42);
303 legend->SetBorderSize(0);
304 legend->SetFillStyle(0);
305 legend->SetFillColor(10);
306 legend->SetMargin(0.25);
307 legend->SetShadowColor(10);
308 legend->AddEntry(gHistBalanceFunction,"Data","lp");
309 legend->AddEntry(gHistBalanceFunctionShuffled,"Shuffled data","lp");
310 legend->AddEntry(gHistBalanceFunctionMixed,"Mixed data","lp");
313 pngName = "BalanceFunctionDeltaEta.Centrality";
314 pngName += centralityArray[gCentrality-1];
315 pngName += ".Psi"; //pngName += psiMin; pngName += "To"; pngName += psiMax;
317 c1->SaveAs(pngName.Data());
319 GetWeightedMean(gHistBalanceFunction);
320 GetWeightedMean(gHistBalanceFunctionShuffled);
322 TString meanLatex, rmsLatex, skewnessLatex, kurtosisLatex;
323 meanLatex = "#mu = ";
324 meanLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetMean());
325 meanLatex += " #pm ";
326 meanLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetMeanError());
328 rmsLatex = "#sigma = ";
329 rmsLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetRMS());
331 rmsLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetRMSError());
333 skewnessLatex = "S = ";
334 skewnessLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetSkewness(1));
335 skewnessLatex += " #pm ";
336 skewnessLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetSkewness(11));
338 kurtosisLatex = "K = ";
339 kurtosisLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetKurtosis(1));
340 kurtosisLatex += " #pm ";
341 kurtosisLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetKurtosis(11));
342 Printf("Mean: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetMean(),gHistBalanceFunctionSubtracted->GetMeanError());
343 Printf("RMS: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetRMS(),gHistBalanceFunctionSubtracted->GetRMSError());
344 Printf("Skeweness: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetSkewness(1),gHistBalanceFunctionSubtracted->GetSkewness(11));
345 Printf("Kurtosis: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetKurtosis(1),gHistBalanceFunctionSubtracted->GetKurtosis(11));
347 TCanvas *c2 = new TCanvas("c2","",600,0,600,500);
348 c2->SetFillColor(10);
349 c2->SetHighLightColor(10);
350 c2->SetLeftMargin(0.15);
351 gHistBalanceFunctionSubtracted->DrawCopy("E");
353 TLatex *latex = new TLatex();
355 latex->SetTextSize(0.035);
356 latex->SetTextColor(1);
357 latex->DrawLatex(0.64,0.85,meanLatex.Data());
358 latex->DrawLatex(0.64,0.81,rmsLatex.Data());
359 latex->DrawLatex(0.64,0.77,skewnessLatex.Data());
360 latex->DrawLatex(0.64,0.73,kurtosisLatex.Data());
362 TString newFileName = "balanceFunction.Centrality";
363 newFileName += gCentrality; newFileName += ".In";
364 if(gDeltaEtaDeltaPhi == 1) newFileName += "DeltaEta.Psi";
365 else if(gDeltaEtaDeltaPhi == 2) newFileName += "DeltaPhi.Psi";
366 if((psiMin == -0.5)&&(psiMax == 0.5)) newFileName += "InPlane.Ptt";
367 else if((psiMin == 0.5)&&(psiMax == 1.5)) newFileName += "Intermediate.Ptt";
368 else if((psiMin == 1.5)&&(psiMax == 2.5)) newFileName += "OutOfPlane.Ptt";
369 else if((psiMin == 2.5)&&(psiMax == 3.5)) newFileName += "Rest.PttFrom";
370 else newFileName += "All.PttFrom";
371 newFileName += Form("%.1f",ptTriggerMin); newFileName += "To";
372 newFileName += Form("%.1f",ptTriggerMax); newFileName += "PtaFrom";
373 newFileName += Form("%.1f",ptAssociatedMin); newFileName += "To";
374 newFileName += Form("%.1f",ptAssociatedMax);
375 newFileName += ".root";
377 TFile *fOutput = new TFile(newFileName.Data(),"recreate");
379 gHistBalanceFunction->Write();
380 gHistBalanceFunctionShuffled->Write();
381 gHistBalanceFunctionMixed->Write();
382 gHistBalanceFunctionSubtracted->Write();
386 //____________________________________________________________________//
387 void GetWeightedMean(TH1D *gHistBalance, Int_t fStartBin = 1) {
388 //Prints the calculated width of the BF and its error
389 Double_t gSumXi = 0.0, gSumBi = 0.0, gSumBiXi = 0.0;
390 Double_t gSumBiXi2 = 0.0, gSumBi2Xi2 = 0.0;
391 Double_t gSumDeltaBi2 = 0.0, gSumXi2DeltaBi2 = 0.0;
392 Double_t deltaBalP2 = 0.0, integral = 0.0;
393 Double_t deltaErrorNew = 0.0;
395 //Retrieve this variables from Histogram
396 Int_t fNumberOfBins = gHistBalance->GetNbinsX();
397 Double_t fP2Step = gHistBalance->GetBinWidth(1); // assume equal binning!
399 cout<<"=================================================="<<endl;
400 cout<<"RECALCULATION OF BF WIDTH (StartBin = "<<fStartBin<<")"<<endl;
401 cout<<"HISTOGRAM has "<<fNumberOfBins<<" bins with bin size of "<<fP2Step<<endl;
402 cout<<"=================================================="<<endl;
403 for(Int_t i = 1; i <= fNumberOfBins; i++) {
404 // this is to simulate |Delta eta| or |Delta phi|
405 if(fNumberOfBins/2 - fStartBin + 1 < i && i < fNumberOfBins/2 + fStartBin ) continue;
407 cout<<"B: "<<gHistBalance->GetBinContent(i)<<"\t Error: "<<gHistBalance->GetBinError(i)<<"\t bin: "<<TMath::Abs(gHistBalance->GetBinCenter(i))<<endl;
409 gSumXi += TMath::Abs(gHistBalance->GetBinCenter(i)); // this is to simulate |Delta eta| or |Delta phi|
410 gSumBi += gHistBalance->GetBinContent(i);
411 gSumBiXi += gHistBalance->GetBinContent(i)*TMath::Abs(gHistBalance->GetBinCenter(i));
412 gSumBiXi2 += gHistBalance->GetBinContent(i)*TMath::Power(TMath::Abs(gHistBalance->GetBinCenter(i)),2);
413 gSumBi2Xi2 += TMath::Power(gHistBalance->GetBinContent(i),2)*TMath::Power(TMath::Abs(gHistBalance->GetBinCenter(i)),2);
414 gSumDeltaBi2 += TMath::Power(gHistBalance->GetBinError(i),2);
415 gSumXi2DeltaBi2 += TMath::Power(TMath::Abs(gHistBalance->GetBinCenter(i)),2) * TMath::Power(gHistBalance->GetBinError(i),2);
417 deltaBalP2 += fP2Step*TMath::Power(gHistBalance->GetBinError(i),2);
418 integral += fP2Step*gHistBalance->GetBinContent(i);
420 for(Int_t i = fStartBin; i < fNumberOfBins; i++)
421 deltaErrorNew += gHistBalance->GetBinError(i)*(TMath::Abs(gHistBalance->GetBinCenter(i))*gSumBi - gSumBiXi)/TMath::Power(gSumBi,2);
423 Double_t integralError = TMath::Sqrt(deltaBalP2);
425 Double_t delta = gSumBiXi / gSumBi;
426 Double_t deltaError = (gSumBiXi / gSumBi) * TMath::Sqrt(TMath::Power((TMath::Sqrt(gSumXi2DeltaBi2)/gSumBiXi),2) + TMath::Power((gSumDeltaBi2/gSumBi),2) );
427 cout<<"=================================================="<<endl;
428 cout<<"Width: "<<delta<<"\t Error: "<<deltaError<<endl;
429 cout<<"New error: "<<deltaErrorNew<<endl;
430 cout<<"Integral: "<<integral<<"\t Error: "<<integralError<<endl;
431 cout<<"=================================================="<<endl;
435 //______________________________________________________//
436 void drawBFPsi(const char* lhcPeriod = "LHC10h",
437 Int_t gCentrality = 1,
438 Int_t gDeltaEtaDeltaPhi = 2,
439 Double_t psiMin = -0.5, Double_t psiMax = 0.5,
440 Double_t ptTriggerMin = -1.,
441 Double_t ptTriggerMax = -1.,
442 Double_t ptAssociatedMin = -1.,
443 Double_t ptAssociatedMax = -1.) {
444 //Macro that draws the BF distributions for each centrality bin
445 //for reaction plane dependent analysis
446 //Author: Panos.Christakoglou@nikhef.nl
447 gROOT->LoadMacro("~/SetPlotStyle.C");
451 TString filename = lhcPeriod; filename +="/PttFrom";
452 filename += ptTriggerMin; filename += "To";
453 filename += ptTriggerMax; filename += "PtaFrom";
454 filename += ptAssociatedMin; filename += "To";
455 filename += ptAssociatedMax; filename += "/balanceFunction.Centrality";
456 filename += gCentrality; filename += ".In";
457 if(gDeltaEtaDeltaPhi == 1) filename += "DeltaEta.Psi";
458 else if(gDeltaEtaDeltaPhi == 2) filename += "DeltaPhi.Psi";
459 if((psiMin == -0.5)&&(psiMax == 0.5)) filename += "InPlane.Ptt";
460 else if((psiMin == 0.5)&&(psiMax == 1.5)) filename += "Intermediate.Ptt";
461 else if((psiMin == 1.5)&&(psiMax == 2.5)) filename += "OutOfPlane.Ptt";
462 else if((psiMin == 2.5)&&(psiMax == 3.5)) filename += "Rest.Ptt";
463 else filename += "All.PttFrom";
464 filename += ptTriggerMin; filename += "To";
465 filename += ptTriggerMax; filename += ".PtaFrom";
466 filename += ptAssociatedMin; filename += "To";
467 filename += ptAssociatedMax; filename += ".root";
470 TFile *f = TFile::Open(filename.Data());
471 if((!f)||(!f->IsOpen())) {
472 Printf("The file %s is not found. Aborting...",filename);
477 //Raw balance function
478 TH1D *gHistBalanceFunction = dynamic_cast<TH1D *>(f->Get("gHistBalanceFunction"));
479 gHistBalanceFunction->SetStats(kFALSE);
480 gHistBalanceFunction->SetMarkerStyle(20);
481 gHistBalanceFunction->GetYaxis()->SetTitleOffset(1.3);
482 if(gDeltaEtaDeltaPhi == 2) {
483 gHistBalanceFunction->GetYaxis()->SetTitle("B(#Delta #varphi)");
484 gHistBalanceFunction->GetXaxis()->SetTitle("#Delta #varphi (deg.)");
487 //Shuffled balance function
488 TH1D *gHistBalanceFunctionShuffled = dynamic_cast<TH1D *>(f->Get("gHistBalanceFunctionShuffled"));
489 gHistBalanceFunction->SetStats(kFALSE);
490 gHistBalanceFunctionShuffled->SetMarkerStyle(24);
492 //Mixed balance function
493 TH1D *gHistBalanceFunctionMixed = dynamic_cast<TH1D *>(f->Get("gHistBalanceFunctionMixed"));
494 gHistBalanceFunction->SetStats(kFALSE);
495 gHistBalanceFunctionMixed->SetMarkerStyle(25);
497 //Subtracted balance function
498 TH1D *gHistBalanceFunctionSubtracted = dynamic_cast<TH1D *>(f->Get("gHistBalanceFunctionSubtracted"));
499 gHistBalanceFunctionSubtracted->SetStats(kFALSE);
500 gHistBalanceFunctionSubtracted->SetMarkerStyle(20);
501 gHistBalanceFunctionSubtracted->GetYaxis()->SetTitleOffset(1.3);
502 if(gDeltaEtaDeltaPhi == 2) {
503 gHistBalanceFunctionSubtracted->GetYaxis()->SetTitle("B(#Delta #varphi)");
504 gHistBalanceFunctionSubtracted->GetXaxis()->SetTitle("#Delta #varphi (deg.)");
510 TString centralityLatex = "Centrality: ";
511 centralityLatex += centralityArray[gCentrality-1];
512 centralityLatex += "%";
515 if((psiMin == -0.5)&&(psiMax == 0.5))
516 psiLatex = " -7.5^{o} < #varphi - #Psi_{2} < 7.5^{o}";
517 else if((psiMin == 0.5)&&(psiMax == 1.5))
518 psiLatex = " 37.5^{o} < #varphi - #Psi_{2} < 52.5^{o}";
519 else if((psiMin == 1.5)&&(psiMax == 2.5))
520 psiLatex = " 82.5^{o} < #varphi - #Psi_{2} < 97.5^{o}";
522 psiLatex = " 0^{o} < #varphi - #Psi_{2} < 180^{o}";
524 TString pttLatex = Form("%.1f",ptTriggerMin);
525 pttLatex += " < p_{T}^{t} < "; pttLatex += Form("%.1f",ptTriggerMax);
526 pttLatex += " GeV/c";
528 TString ptaLatex = Form("%.1f",ptAssociatedMin);
529 ptaLatex += " < p_{T}^{a} < "; ptaLatex += Form("%.1f",ptAssociatedMax);
530 ptaLatex += " GeV/c";
533 TCanvas *c1 = new TCanvas("c1","",0,0,600,500);
534 c1->SetFillColor(10); c1->SetHighLightColor(10);
535 c1->SetLeftMargin(0.17); c1->SetTopMargin(0.05);
536 gHistBalanceFunction->SetTitle("");
537 gHistBalanceFunction->GetYaxis()->SetTitleOffset(1.4);
538 gHistBalanceFunction->GetYaxis()->SetNdivisions(10);
539 gHistBalanceFunction->GetXaxis()->SetNdivisions(10);
540 gHistBalanceFunction->DrawCopy("E");
541 gHistBalanceFunctionShuffled->DrawCopy("ESAME");
542 gHistBalanceFunctionMixed->DrawCopy("ESAME");
544 legend = new TLegend(0.2,0.72,0.45,0.92,"","brNDC");
545 legend->SetTextSize(0.05);
546 legend->SetTextFont(42);
547 legend->SetBorderSize(0);
548 legend->SetFillStyle(0);
549 legend->SetFillColor(10);
550 legend->SetMargin(0.25);
551 legend->SetShadowColor(10);
552 legend->AddEntry(gHistBalanceFunction,"Data","lp");
553 legend->AddEntry(gHistBalanceFunctionShuffled,"Shuffled data","lp");
554 legend->AddEntry(gHistBalanceFunctionMixed,"Mixed data","lp");
557 TLatex *latexInfo1 = new TLatex();
558 latexInfo1->SetNDC();
559 latexInfo1->SetTextSize(0.04);
560 latexInfo1->SetTextColor(1);
561 latexInfo1->DrawLatex(0.58,0.88,centralityLatex.Data());
562 latexInfo1->DrawLatex(0.58,0.82,psiLatex.Data());
563 latexInfo1->DrawLatex(0.58,0.76,pttLatex.Data());
564 latexInfo1->DrawLatex(0.58,0.70,ptaLatex.Data());
566 //pngName = "BalanceFunctionDeltaEta.Centrality";
567 //pngName += centralityArray[gCentrality-1];
568 //pngName += ".Psi"; //pngName += psiMin; pngName += "To"; pngName += psiMax;
570 //c1->SaveAs(pngName.Data());
572 TCanvas *c2 = new TCanvas("c2","",600,0,600,500);
573 c2->SetFillColor(10); c2->SetHighLightColor(10);
574 c2->SetLeftMargin(0.17); c2->SetTopMargin(0.05);
575 gHistBalanceFunctionSubtracted->SetTitle("");
576 gHistBalanceFunctionSubtracted->GetYaxis()->SetTitleOffset(1.4);
577 gHistBalanceFunctionSubtracted->GetYaxis()->SetNdivisions(10);
578 gHistBalanceFunctionSubtracted->GetXaxis()->SetNdivisions(10);
579 gHistBalanceFunctionSubtracted->DrawCopy("E");
581 TString meanLatex, rmsLatex, skewnessLatex, kurtosisLatex;
582 meanLatex = "#mu = ";
583 meanLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetMean());
584 meanLatex += " #pm ";
585 meanLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetMeanError());
587 rmsLatex = "#sigma = ";
588 rmsLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetRMS());
590 rmsLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetRMSError());
592 skewnessLatex = "S = ";
593 skewnessLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetSkewness(1));
594 skewnessLatex += " #pm ";
595 skewnessLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetSkewness(11));
597 kurtosisLatex = "K = ";
598 kurtosisLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetKurtosis(1));
599 kurtosisLatex += " #pm ";
600 kurtosisLatex += Form("%.3f",gHistBalanceFunctionSubtracted->GetKurtosis(11));
601 Printf("Mean: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetMean(),gHistBalanceFunctionSubtracted->GetMeanError());
602 Printf("RMS: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetRMS(),gHistBalanceFunctionSubtracted->GetRMSError());
603 Printf("Skeweness: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetSkewness(1),gHistBalanceFunctionSubtracted->GetSkewness(11));
604 Printf("Kurtosis: %lf - Error: %lf",gHistBalanceFunctionSubtracted->GetKurtosis(1),gHistBalanceFunctionSubtracted->GetKurtosis(11));
606 latexInfo1->DrawLatex(0.18,0.88,centralityLatex.Data());
607 latexInfo1->DrawLatex(0.18,0.82,psiLatex.Data());
608 latexInfo1->DrawLatex(0.18,0.76,pttLatex.Data());
609 latexInfo1->DrawLatex(0.18,0.70,ptaLatex.Data());
611 TLatex *latexResults = new TLatex();
612 latexResults->SetNDC();
613 latexResults->SetTextSize(0.04);
614 latexResults->SetTextColor(1);
615 latexResults->DrawLatex(0.6,0.88,meanLatex.Data());
616 latexResults->DrawLatex(0.6,0.82,rmsLatex.Data());
617 latexResults->DrawLatex(0.6,0.76,skewnessLatex.Data());
618 latexResults->DrawLatex(0.6,0.70,kurtosisLatex.Data());