1 #if !defined (__CINT__) || (defined(__MAKECINT__))
3 #include "TClonesArray.h"
4 #include "AliParticleYield.h"
13 #include "AliPWGHistoTools.h"
14 #include "TGraphErrors.h"
16 #include "TDatabasePDG.h"
22 // Plots ratios for QM and saves input files for thermal models
25 enum MyParticles { kPDGPi = 211, kPDGK = 321, kPDGProton = 2212, kPDGKS0 = 310, kPDGLambda=3122, kPDGXi=3312,kPDGOmega=3334,kPDGPhi=333,kPDGKStar=313,kPDGDeuteron=1000010020,kPDGHE3 = 1000020030, kPDGHyperTriton = 1010010030, kPDGSigmaStarPlus=3224,kPDGSigmaStarMinus=3114,kPDGXiStar=3324};
27 typedef enum {kStatError, kSystError, kTotalError} myerror_t;
29 TH1F * GetHistoRatios(TClonesArray * arr, Int_t system, Float_t energy, TString centrality, const char * histotitle, Int_t icolor, Int_t imarker = kOpenSquare, Int_t errorsType = kTotalError, Float_t shift = 0) ;
30 TH1F * GetHistoYields(TClonesArray * arr, Int_t system, Float_t energy, TString centrality, const char * histotitle) ;
31 void PrepareThermalModelsInputFiles(TClonesArray * arr, Int_t system, Float_t energy, TString centrality, Bool_t separateCharges=0) ;
32 void SetStyle(Bool_t graypalette=0) ;
34 void DrawRatio(TString what);
37 // Preferred colors and markers
38 // const Int_t fillColors[] = {kGray+1, kRed-10, kBlue-9, kGreen-8, kMagenta-9, kOrange-9,kCyan-8,kYellow-7, kWhite}; // for syst bands
39 // const Int_t colors[] = {kBlack, kRed+1 , kBlue+1, kGreen+3, kMagenta+1, kOrange-1,kCyan+2,kYellow+2 , kWhite};
40 const Int_t markers[] = {kFullCircle, kFullSquare,kOpenCircle,kOpenSquare,kOpenDiamond,kOpenCross,kFullCross,kFullDiamond,kFullStar,kOpenStar,0};
45 TClonesArray *arrPbPb=0, *arrpp7=0, *arrpPb=0, * arrpp276=0, * arrpp900=0, * arrThermus=0;
46 TClonesArray *arrSTARPbPb=0, *arrPHENIXPbPb=0, *arrBRAHMSPbPb=0;
47 TClonesArray *arrSTARpp =0, *arrPHENIXpp=0;
49 const Double_t *scaleRatios = 0;
50 Double_t *correlatedUnc = 0;
51 Double_t correlatedUncLocalPbPb[14] = {0.0424 , 0.0424 , 0.041 , 0 , 0 , 0.0424 , 0.0424 , 0 , 0.05 , 0.05 };
52 Double_t correlatedUncLocalPP [14] = {0.0424 , 0.0424 , 0.041 , 0 , 0 , 0.0424 , 0.0424 , 0 , 0.0424 , 0.0424 };
53 Double_t correlatedUncZero[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
56 TClonesArray * PlotRatiosForQM14() {
57 #if !(!defined (__CINT__) || (defined(__MAKECINT__)))
64 // Uncomment stuff in this section to save the inputs for thermal models
65 //#define SAVE_INPUT_THERMAL_MODEL
66 #ifdef SAVE_INPUT_THERMAL_MODEL
67 // PrepareThermalModelsInputFiles(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M0010", /*separateCharges*/0);
68 // PrepareThermalModelsInputFiles(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M0010", /*separateCharges*/1);
69 // PrepareThermalModelsInputFiles(arrpp7, AliParticleYield::kCSpp, 7000, "", /*separateCharges*/0);
70 // PrepareThermalModelsInputFiles(arrpp7, AliParticleYield::kCSpp, 7000, "", /*separateCharges*/1);
73 // PrepareThermalModelsInputFiles(arrpPb, AliParticleYield::kCSpPb, 5020, "V0A0005", /*separateCharges*/1);
74 // PrepareThermalModelsInputFiles(arrpPb, AliParticleYield::kCSpPb, 5020, "V0A2040", /*separateCharges*/1);
75 //PrepareThermalModelsInputFiles(arrpPb, AliParticleYield::kCSpPb, 5020, "V0A6080", /*separateCharges*/1);
76 // PrepareThermalModelsInputFiles(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M6080", /*separateCharges*/1);
77 // PrepareThermalModelsInputFiles(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M2030", /*separateCharges*/1);
84 TCanvas * c1 = new TCanvas("Ratios", "Ratios", 1400, 600);
85 c1->SetMargin( 0.0744986, 0.0329513, 0.225131, 0.83);
91 DrawRatio("PbPb_0010");
92 // DrawRatio("PbPbSTAR");
93 // DrawRatio("PbPbPHENIX");
94 // DrawRatio("PbPbBRAHMS");
95 // DrawRatio("PbPb_6080");
101 // DrawRatio("ppSTAR");
102 // DrawRatio("ppPHENIX");
103 // DrawRatio("ppBRAHMS");
109 TCanvas * c2 = new TCanvas("Yields", "Yields", 1400, 600);
110 c2->SetMargin( 0.0744986, 0.0329513, 0.225131, 0.0593368);
112 GetHistoYields(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M0010", "Pb-Pb, #sqrt{s_{NN}} = 2.76 TeV, 0-10%")->Draw();
113 GetHistoYields(arrThermus, AliParticleYield::kCSPbPb, 2760, "V0M0010", "Thermus")->Draw("same");
118 TH1F * GetHistoRatios(TClonesArray * arr, Int_t system, Float_t energy, TString centrality, const char * histotitle, Int_t icolor, Int_t imarker, Int_t errorType, Float_t shift) {
119 // FIXME: THIS SHOULD BE REVIEWED TO MAKE SURE THE PLOTS ARE LABELLED CORRECTLY
121 const Int_t nratio = 10;
122 // Int_t denum[nratio] = {kPDGPi , kPDGPi , kPDGKS0 , kPDGPi , kPDGPi , kPDGPi , kPDGDeuteron , kPDGPi , kPDGK , -kPDGK};
124 Int_t num [nratio] = {kPDGK , kPDGProton , kPDGLambda , kPDGXi , kPDGOmega , kPDGDeuteron , kPDGHE3 , kPDGHyperTriton , kPDGPhi , kPDGKStar};
125 Int_t denum[nratio] = {kPDGPi , kPDGPi , kPDGKS0 , kPDGPi , kPDGPi , kPDGProton , kPDGDeuteron , kPDGPi , kPDGK , kPDGK};
126 Int_t isSum[nratio] = {1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 };
127 static const Double_t scale[] = {1 , 3 , 0.5 , 30 , 250 , 50 , 100 , 4e5 , 2 , 2 };
128 // static const Double_t scale[] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,};
131 TH1F * h = new TH1F(Form("hRatio_%d_%0.0f_%s_%d",system,energy,centrality.Data(),errorType), histotitle, nratio, 1+shift, nratio+1+shift);
133 TClonesArray * arrRatios = new TClonesArray ("AliParticleYield");// We save to disk the precomputed ratios
134 Int_t iratioArr = 0;// Index used only to add particles to the array above
136 // Double_t isSum = -1; // if this is -1, then the sum criterion is ignored
137 for(Int_t iratio = 1; iratio <= nratio; iratio++){
138 std::cout << "******** " << num[iratio-1] << "/" << denum[iratio-1]<< " ("<<isSum[iratio-1]<<")*******" << std::endl ;
140 AliParticleYield * ratio = AliParticleYield::FindRatio(arr, num[iratio-1], denum[iratio-1], system, energy, centrality,isSum[iratio-1]);
143 ratio = new AliParticleYield(*ratio); // We need to clone it to avoid a mess if we need to use this particle again later (e.g. double scalings)
145 ratio->Print("short");
149 // If the ratio is not found, try to build it!
150 std::cout << " Looking for " << num[iratio-1] << " ("<<isSum[iratio-1]<<")"<<std::endl;
151 AliParticleYield * part1 = AliParticleYield::FindParticle(arr, num[iratio-1], system, energy, centrality, isSum[iratio-1]);
152 if(part1) part1 = new AliParticleYield(*part1); // We need to clone it to avoid a mess if we need to use this particle again later
153 // Try with the !sum, if part 1 is not found
155 std::cout << " Looking for " << num[iratio-1] << " ("<<!isSum[iratio-1]<<")"<<std::endl;
156 part1 = AliParticleYield::FindParticle(arr, num[iratio-1], system, energy, centrality,!isSum[iratio-1]);
159 part1 = new AliParticleYield(*part1); // We need to clone it to avoid a mess if we need to use this particle again later
160 // If the sum was requested, try to recover it!
161 if(isSum[iratio-1]) {
162 std::cout << " Looking for " << -num[iratio-1] <<std::endl;
163 AliParticleYield * part1_bar = AliParticleYield::FindParticle(arr, -num[iratio-1], system, energy, centrality,0);
164 if(part1 && part1_bar) {
165 std::cout << "Adding " << part1_bar->GetPartName() << " " << part1->GetPartName() << std::endl;
166 part1 = AliParticleYield::Add(part1, part1_bar);
168 } else if (TDatabasePDG::Instance()->GetParticle(-num[iratio-1])){ // Before scaling x2 check it it makes sense (antiparticle exists)
169 std::cout << "WARNING: Sum requested but not found, scaling x2 " << part1->GetName() << std::endl;
172 } else if(part1) { // if we are here, it means the sum was *not* requested (isSum=0), but we found something with (!isSum) = 1
173 // if the not sum was requested, but the sum is found, divide by 2 so that it is comparable
174 std::cout << "WARNING: Using sum/2 for " << part1->GetName() << std::endl;
181 std::cout << " Looking for " << denum[iratio-1] << " ("<<isSum[iratio-1]<<")"<<std::endl;
182 AliParticleYield * part2 = AliParticleYield::FindParticle(arr, denum[iratio-1], system, energy, centrality,isSum[iratio-1]);
183 if(part2) part2 = new AliParticleYield(*part2); // We need to clone it to avoid a mess if we need to use this particle again later
184 if(!part2) {// Try with the !sum, if part 2 is not found
185 std::cout << " Looking for " << denum[iratio-1] << " ("<<!isSum[iratio-1]<<")"<<std::endl;
186 part2 = AliParticleYield::FindParticle(arr, denum[iratio-1], system, energy, centrality,!isSum[iratio-1]);
189 part2 = new AliParticleYield(*part2); // We need to clone it to avoid a mess if we need to use this particle again later
190 if(isSum[iratio-1]) {
191 std::cout << " Looking for " << -denum[iratio-1] << std::endl;
192 AliParticleYield * part2_bar = AliParticleYield::FindParticle(arr, -denum[iratio-1], system, energy, centrality,0);
193 if(part2 && part2_bar){
194 std::cout << "Adding " << part2_bar->GetPartName() << " " << part2->GetPartName() << std::endl;
195 part2 = AliParticleYield::Add(part2, part2_bar);
196 } else if (TDatabasePDG::Instance()->GetParticle(-denum[iratio-1])){ // Before scaling x2 check it it makes sense (antiparticle exists)
197 std::cout << "WARNING: Sum requested but not found, scaling x2 " << part2->GetName() << std::endl;
201 // if the not sum was requested, but the sum is found, divide by 2 so that it is comparable
202 std::cout << "WARNING: Using sum/2 for " << part2->GetName() << std::endl;
208 ratio = AliParticleYield::Divide(part1, part2, correlatedUnc[iratio-1], "YQ"); // Assume by that the systematics of part1 and part2 are uncorrelated.
210 std::cout << "" << std::endl;
211 std::cout << "WARNING: building ratio " << num[iratio-1] <<"/"<<denum[iratio-1]<<": Check uncertainties!!" << std::endl;
213 std::cout << "" << std::endl;
217 ratio->Scale(scale[iratio-1]);
218 h->SetBinContent(iratio, ratio->GetYield());
219 if(errorType == kTotalError) {
220 h->SetBinError (iratio, ratio->GetTotalError(0/* 0 = no normalization error */));
221 } else if (errorType == kStatError) {
222 h->SetBinError (iratio, ratio->GetStatError());
223 } else if (errorType == kSystError) {
224 h->SetBinError (iratio, ratio->GetSystError());
226 std::cout << "ERROR: Unknown Error Type " << errorType << std::endl;
229 // h->GetXaxis()->SetBinLabel(iratio, Form("#splitline{%s}{%s}",Form("#times%2.2f", scale[iratio-1]), ratio->GetLatexName()));
230 h->GetXaxis()->SetBinLabel(iratio, ratio->GetLatexName());
231 new ((*arrRatios)[iratioArr++]) AliParticleYield(*ratio);
234 h->GetXaxis()->SetBinLabel(iratio, Form("#frac{%d}{%d}",num[iratio-1], denum[iratio-1]));
237 std::cout << "*** END OF " << num[iratio-1] << "/" << denum[iratio-1]<< " *******" << std::endl ;
241 h->GetYaxis()->SetRangeUser(0, maxy);
242 h->SetLineColor(icolor);
243 h->SetMarkerColor(icolor);
244 h->SetMarkerStyle(imarker);
246 AliParticleYield::SaveAsASCIIFile(arrRatios, TString("ratios_")+h->GetName());
253 void PrepareThermalModelsInputFiles(TClonesArray * arr, Int_t system, Float_t energy, TString centrality, Bool_t separateCharges) {
254 // If "Separate charges" is true, tries to dump both charges are dumped
255 TClonesArray * arrOut = new TClonesArray("AliParticleYield");
256 const Int_t npart = 12;
257 Int_t particles [npart] = {kPDGPi ,kPDGK ,kPDGKS0, kPDGKStar, kPDGPhi, kPDGProton , kPDGLambda , kPDGXi , kPDGOmega , kPDGDeuteron, kPDGHyperTriton, kPDGHE3 };
258 Int_t isSum[npart] = {1 ,1 ,0 , 1 , 0 , 1 ,0 ,1 ,1 ,0 , 1 , 0 };
260 Int_t ipartOut = 0; // Index for the array
261 for(Int_t ipart = 0; ipart < npart; ipart++){
262 if(!separateCharges) {
263 AliParticleYield * part = AliParticleYield::FindParticle(arr, particles[ipart], system, energy, centrality, isSum[ipart]);
264 if(!part && isSum[ipart]) {
265 //Could not find the particle, but the sum was requested: build the sum!
266 part = AliParticleYield::FindParticle(arr, particles[ipart], system, energy, centrality, 0);
267 AliParticleYield * part2 = AliParticleYield::FindParticle(arr, -particles[ipart], system, energy, centrality, 0);
268 if(part2 && part) part = AliParticleYield::Add(part, part2);
271 if(part) new((*arrOut)[ipartOut++]) AliParticleYield(*part);
274 // ignore isSum and try to find both particles
276 AliParticleYield * part = AliParticleYield::FindParticle(arr, particles[ipart], system, energy, centrality, 0);
277 if(part) new((*arrOut)[ipartOut++]) AliParticleYield(*part);
279 // Try to find antiparticle (-pdg code)
280 part = AliParticleYield::FindParticle(arr, -particles[ipart], system, energy, centrality, 0);
281 if(part) new((*arrOut)[ipartOut++]) AliParticleYield(*part);
283 // If neither charge was found, check if we at least have the sum
284 part = AliParticleYield::FindParticle(arr, abs(particles[ipart]), system, energy, centrality, 1);
285 if (part) new((*arrOut)[ipartOut++]) AliParticleYield(*part);
290 std::cout << "Particles for thermal model fits:" << std::endl;
291 // arrOut->Print("short");
293 std::cout << "" << std::endl;
294 // Write GSI input file
296 AliParticleYield * part = 0;
297 ofstream fout(Form("gsi_System_%d_Energy_%0.0f_Centr_%s_BothCharges_%d", system, energy, centrality.Data(), separateCharges));
298 while ((part = (AliParticleYield*) it.Next())){
299 fout << part->GetYield() << " " << part->GetTotalError() << std::endl;
302 // Write thermus file
303 AliParticleYield::WriteThermusFile(arrOut, Form("thermus_System_%d_Energy_%0.0f_Centr_%s_BothCharges_%d", system, energy, centrality.Data(), separateCharges));
307 TH1F * GetHistoYields(TClonesArray * arr, Int_t system, Float_t energy, TString centrality, const char * histotitle) {
309 const Int_t npart = 11;
310 Int_t pdg [npart] = {kPDGPi, kPDGK , kPDGProton , kPDGLambda , kPDGXi , kPDGOmega , kPDGDeuteron , kPDGHE3 , kPDGHyperTriton , kPDGPhi , kPDGKStar};
311 // Int_t isSum[npart] = {1 ,1 ,1 ,0 ,1 ,1 ,0 ,0 ,1 ,0 ,1 };
312 Int_t isSum[npart] = {0,0,0,0,0,0,0,0,0,0,1};
313 // Double_t scale[npart] = {1 ,1 ,3 ,1 ,30 ,250 ,50 ,10 ,4e5 ,2 ,2 };
314 Double_t scale[npart] = {1,5,30,30,200,1000,4000,2e6,2e6,20,20,};
315 TH1F * h = new TH1F(Form("hPart_%d_%0.0f_%s",system,energy,centrality.Data()), histotitle, npart, 1, npart+1);
317 // Double_t isSum = -1; // if this is -1, then the sum criterion is ignored
318 for(Int_t ipart = 1; ipart <= npart; ipart++){
319 AliParticleYield * part = AliParticleYield::FindParticle(arr, pdg[ipart-1], system, energy, centrality,isSum[ipart-1]);
321 part->Scale(scale[ipart-1]);
322 h->SetBinContent(ipart, part->GetYield());
323 h->SetBinError (ipart, part->GetTotalError(0/* 0 = no normalization error */));
324 h->GetXaxis()->SetBinLabel(ipart, Form("#splitline{%s}{%s}",Form("#times%2.0g", scale[ipart-1]), part->GetLatexName()));
331 arrPbPb = AliParticleYield::ReadFromASCIIFile("PbPb_2760_Cascades.txt");
332 arrPbPb->AbsorbObjects( AliParticleYield::ReadFromASCIIFile("PbPb_2760_DeuHelium3.txt"));
333 arrPbPb->AbsorbObjects( AliParticleYield::ReadFromASCIIFile("PbPb_2760_Hypertriton.txt"));
334 arrPbPb->AbsorbObjects( AliParticleYield::ReadFromASCIIFile("PbPb_2760_Kstar892.txt"));
335 arrPbPb->AbsorbObjects( AliParticleYield::ReadFromASCIIFile("PbPb_2760_LambdaK0.txt"));
336 arrPbPb->AbsorbObjects( AliParticleYield::ReadFromASCIIFile("PbPb_2760_PiKaPr.txt"));
337 arrPbPb->AbsorbObjects( AliParticleYield::ReadFromASCIIFile("PbPb_2760_phi1020.txt"));
338 arrPbPb->AbsorbObjects( AliParticleYield::ReadFromASCIIFile("PbPb_2760_AveragedNumbers.txt"));
340 arrpp7 = AliParticleYield::ReadFromASCIIFile("pp_7000.txt");
342 arrpp276 = AliParticleYield::ReadFromASCIIFile("pp_2760.txt");
343 arrpp900 = AliParticleYield::ReadFromASCIIFile("pp_900.txt");
345 arrpPb = AliParticleYield::ReadFromASCIIFile("pPb_5020_MultiStrange.txt");
346 arrpPb->AbsorbObjects(AliParticleYield::ReadFromASCIIFile("pPb_5020_PiKaPrLamndaK0.txt"));
347 arrpPb->AbsorbObjects(AliParticleYield::ReadFromASCIIFile("pPb_5020_deuteron.txt"));
348 arrpPb->AbsorbObjects(AliParticleYield::ReadFromASCIIFile("pPb_5020_AveragedNumbers.txt"));
350 arrThermus = AliParticleYield::ReadFromASCIIFile("PbPb_2760_Thermus_Boris_20140407.txt");
353 arrSTARPbPb = AliParticleYield::ReadFromASCIIFile("PbPb_200_STAR-AntonQM12.txt");
354 arrPHENIXPbPb = AliParticleYield::ReadFromASCIIFile("PbPb_200_PHENIX-AntonQM12.txt");
355 arrBRAHMSPbPb = AliParticleYield::ReadFromASCIIFile("PbPb_200_BRAHMS-AntonQM12.txt");
356 arrSTARpp = AliParticleYield::ReadFromASCIIFile("pp_200_STAR.txt");
357 arrPHENIXpp = AliParticleYield::ReadFromASCIIFile("pp_200_PHENIX.txt");
361 void SetStyle(Bool_t graypalette) {
362 std::cout << "Setting style!" << std::endl;
364 gStyle->Reset("Plain");
365 gStyle->SetOptTitle(0);
366 gStyle->SetOptStat(0);
367 if(graypalette) gStyle->SetPalette(8,0);
368 else gStyle->SetPalette(1);
369 gStyle->SetCanvasColor(10);
370 gStyle->SetCanvasBorderMode(0);
371 gStyle->SetFrameLineWidth(1);
372 gStyle->SetFrameFillColor(kWhite);
373 gStyle->SetPadColor(10);
374 gStyle->SetPadTickX(1);
375 gStyle->SetPadTickY(1);
376 gStyle->SetPadBottomMargin(0.15);
377 gStyle->SetPadLeftMargin(0.15);
378 gStyle->SetHistLineWidth(1);
379 gStyle->SetHistLineColor(kRed);
380 gStyle->SetFuncWidth(2);
381 gStyle->SetFuncColor(kGreen);
382 gStyle->SetLineWidth(2);
383 gStyle->SetLabelSize(0.045,"yz");
384 gStyle->SetLabelSize(0.06,"x");
385 gStyle->SetLabelOffset(0.01,"y");
386 gStyle->SetLabelOffset(0.01,"x");
387 gStyle->SetLabelColor(kBlack,"xyz");
388 gStyle->SetTitleSize(0.05,"xyz");
389 gStyle->SetTitleOffset(1.25,"y");
390 gStyle->SetTitleOffset(1.2,"x");
391 gStyle->SetTitleFillColor(kWhite);
392 gStyle->SetTextSizePixels(26);
393 gStyle->SetTextFont(42);
394 // gStyle->SetTickLength(0.04,"X"); gStyle->SetTickLength(0.04,"Y");
396 gStyle->SetLegendBorderSize(0);
397 gStyle->SetLegendFillColor(kWhite);
398 // gStyle->SetFillColor(kWhite);
399 gStyle->SetLegendFont(42);
401 gStyle->SetErrorX(0);
402 gStyle->SetEndErrorSize(5);
407 const char * style = "lp";
408 const char ** labels=0;
409 // Bool_t beautify=kFALSE;
410 Bool_t useTitle=kTRUE;
412 TLegend * l = new TLegend( 0.0985145, 0.733119, 0.301016, 0.869775);
413 l->SetFillColor(kWhite);
415 // const Int_t markers[] = {20,24,21,25,23,28,33,20,24,21,25,23,28,33};
416 // const Int_t colors[] = {1,2,3,4,6,7,8,9,10,11,1,2,3,4,6,7,8,9,10};
418 TList * list = gPad->GetListOfPrimitives();
419 TIterator * iter = list->MakeIterator();
422 while ((obj = (TObject*) iter->Next())){
423 if (obj->InheritsFrom("TH1") || obj->InheritsFrom("TGraph") || obj->InheritsFrom("TF1")) {
424 if( (TString(obj->GetName()) == "hframe" ) ) continue;
427 l->AddEntry(obj, labels[ilabel], style);
430 if(TString(obj->GetTitle()).Contains("NoLegend")) continue;
431 l->AddEntry(obj, obj->GetTitle(), style);
434 l->AddEntry(obj, obj->GetName(), style);
438 // if(!obj->InheritsFrom("TF1")){
439 // ((TH1*)obj)->SetLineColor(colors[ilabel]);
440 // ((TH1*)obj)->SetMarkerColor(colors[ilabel]);
441 // ((TH1*)obj)->SetMarkerStyle(markers[ilabel]);
443 // ((TF1*)obj)->SetLineColor(colors[ilabel]);
454 void DrawRatio(TString what) {
455 // This is used to simplify the code above
456 // In order to draw syst error bars, we need to convert to graphs the syst errors histos
459 // const Int_t colors[] = {kBlack, kRed+1 , kBlue+1, kGreen+3, kMagenta+1, kOrange-1,kCyan+2,kYellow+2 , kWhite};
461 TClonesArray * array = 0;
462 Int_t system, color, marker;
463 Float_t energy = 0, shift = 0;
464 TString centrality, label;
465 // FIXME: move this in the different sections below
467 std::cout << "Plotting " << what.Data() << std::endl;
470 if (what == "frame" ) {
471 // This is a bit of an hack: since the particle labels come
472 // directly from AliPArticleYield, and since the PbPb sample is
473 // the only one where we have all the ratios, we draw the PbPb
474 // ratio here and then we set lines and markers to white. We also
475 // add the "NoLegend" flag, so that it does not show up in the legend
476 correlatedUnc = correlatedUncZero;
477 TH1 * h = GetHistoRatios(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M0010", "NoLegend", kWhite);
479 Int_t nratio = h->GetNbinsX();
480 for(Int_t iratio = 0; iratio < nratio; iratio++){
481 Double_t exp = TMath::Floor(TMath::Log10(TMath::Abs(scaleRatios[iratio])));
482 Double_t man = scaleRatios[iratio] / TMath::Power(10, exp);
484 TLatex * scaleLabel = new TLatex(iratio+1+0.2,maxy*1.01, Form("#times %0.0f 10^{%0.0f}", man, exp));
487 TLatex * scaleLabel = new TLatex(iratio+1+0.2,maxy*1.01, Form("#times %g", scaleRatios[iratio]));
492 TLatex * tex = new TLatex(8.8,0.037,"ALICE Preliminary");
493 tex->SetTextFont(42);
494 tex->SetLineWidth(2);
497 h->GetYaxis()->SetDecimals(1);
498 h->GetYaxis()->SetNdivisions(505);
499 // h->GetXaxis()->CenterLabels(1);
503 else if (what == "PbPb_0010") {
505 system = 2; energy = 2760.; centrality = "V0M0010";
506 label = "Pb-Pb, #sqrt{s_{NN}} = 2.76 TeV, 0-10%";
508 marker = kFullCircle;
510 correlatedUnc = correlatedUncLocalPbPb;
514 else if (what == "PbPb_6080") {
516 system = 2; energy = 2760.; centrality = "V0M6080";
517 label = "Pb-Pb, #sqrt{s_{NN}} = 2.76 TeV, 60-80%";
519 marker = kFullCircle;
521 correlatedUnc = correlatedUncLocalPbPb;
523 else if (what == "pp7") {
525 system = 0; energy = 7000.; centrality = "";
526 label = "pp #sqrt{s} = 7 TeV";
528 marker = kFullCircle;
530 correlatedUnc = correlatedUncLocalPP;
532 else if (what == "pp900") {
534 system = 0; energy = 900.; centrality = "";
535 label = "pp #sqrt{s} = 0.9 TeV";
537 marker = kFullCircle;
539 correlatedUnc = correlatedUncLocalPP;
541 else if (what == "pp276") {
543 system = 0; energy = 2760.; centrality = "";
544 label = "pp #sqrt{s} = 2.76 TeV";
546 marker = kFullCircle;
548 correlatedUnc = correlatedUncLocalPP;
550 else if (what == "pPb0005") {
552 system = 1; energy = 5020.; centrality = "V0A0005";
553 label = "p-Pb, #sqrt{s_{NN}} = 5.02 TeV, V0A 0-5%";
555 marker = kFullCircle;
557 correlatedUnc = correlatedUncLocalPP;
559 else if (what == "PbPbSTAR") {
561 system = 2; energy = 200.; centrality = "0005";
562 label = "STAR, Pb-Pb, #sqrt{s_{NN}} = 0.2 TeV, 0-5%";
566 correlatedUnc = correlatedUncZero;
568 else if (what == "PbPbPHENIX") {
569 array = arrPHENIXPbPb;
570 system = 2; energy = 200.; centrality = "0005";
571 label = "PHENIX, Pb-Pb, #sqrt{s_{NN}} = 0.2 TeV, 0-5%";
573 marker = kOpenSquare;
575 correlatedUnc = correlatedUncZero;
577 else if (what == "PbPbBRAHMS") {
578 array = arrBRAHMSPbPb;
579 system = 2; energy = 200.; centrality = "0010";
580 label = "BRAHMS, Pb-Pb, #sqrt{s_{NN}} = 0.2 TeV, 0-10%";
584 correlatedUnc = correlatedUncZero;
586 else if (what == "ppSTAR") {
588 system = 0; energy = 200.; centrality = "";
589 label = "STAR, pp, #sqrt{s} = 0.2 TeV";
593 correlatedUnc = correlatedUncZero;
595 else if (what == "ppPHENIX") {
597 system = 0; energy = 200.; centrality = "";
598 label = "PHENIX, pp, #sqrt{s} = 0.2 TeV";
600 marker = kOpenSquare;
602 correlatedUnc = correlatedUncZero;
607 std::cout << "Unknown ratio " << what.Data() << std::endl;
611 std::cout << "correlatedUnc not set!" << std::endl;
614 std::cout << "CORR: " << correlatedUnc[1] << std::endl;
617 AliPWGHistoTools::GetGraphFromHisto(GetHistoRatios(array, system, energy, centrality, label, color, marker, kStatError, shift)
619 AliPWGHistoTools::GetGraphFromHisto(GetHistoRatios(array, system, energy, centrality, label+"NoLegend", color, marker, kSystError, shift)