#include "TGraphErrors.h"
#include "TMath.h"
#include "TDatabasePDG.h"
+#include "TH2F.h"
+#include "TSystem.h"
void SetStyle(Bool_t graypalette=0) ;
void NewLegendQM() ;
void DrawRatio(TString what);
+void DrawFrame(Bool_t yields = 0) ;
void LoadArrays() ;
+//void AddLabel(Float_t x, Float_t y, TString text);
+void myLatexDraw(TLatex *currentLatex, Float_t currentSize=0.5, Int_t currentColor=1);
+void myPaveSetup(float rRatio=0, float rRange3=0, float rRange5=0,
+ int rFillColor=0);
+void myPadSetUp(TPad *currentPad);
+
+// Ratios to be draw. Remember to change the labels in DrawFrame if you change this
+const Int_t nratio = 10;
+// Int_t denum[nratio] = {kPDGPi , kPDGPi , kPDGKS0 , kPDGPi , kPDGPi , kPDGPi , kPDGDeuteron , kPDGPi , kPDGK , -kPDGK};
+
+Int_t num [nratio] = {kPDGK , kPDGProton , kPDGLambda , kPDGXi , kPDGOmega , kPDGDeuteron , kPDGHE3 , kPDGHyperTriton , kPDGPhi , kPDGKStar};
+Int_t denum[nratio] = {kPDGPi , kPDGPi , kPDGKS0 , kPDGPi , kPDGPi , kPDGProton , kPDGDeuteron , kPDGPi , kPDGK , kPDGK};
+Int_t isSum[nratio] = {1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 };
+const char * ratiosLabels[] = {"K/^{}#pi",
+ "p/^{}#pi",
+ "#Lambda /^{}K_{s}^{0}",
+ "#Xi/^{}#pi",
+ "#Omega/^{}#pi",
+ "d/^{}p",
+ "^{3}He^{}/d",
+ "{}^{3}_{#Lambda}H^{}/#pi",
+ "#phi /^{}K",
+ "K*/^{}K",};
+static const Double_t scale[] = {1 , 3 , 0.5 , 30 , 250 , 50 , 100 , 4e5 , 2 , 1 };
+//static const Double_t scale[] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,};
+
// Preferred colors and markers
// const Int_t fillColors[] = {kGray+1, kRed-10, kBlue-9, kGreen-8, kMagenta-9, kOrange-9,kCyan-8,kYellow-7, kWhite}; // for syst bands
// const Int_t colors[] = {kBlack, kRed+1 , kBlue+1, kGreen+3, kMagenta+1, kOrange-1,kCyan+2,kYellow+2 , kWhite};
const Int_t markers[] = {kFullCircle, kFullSquare,kOpenCircle,kOpenSquare,kOpenDiamond,kOpenCross,kFullCross,kFullDiamond,kFullStar,kOpenStar,0};
+//
Double_t maxy = 0.4;
TClonesArray *arrSTARPbPb=0, *arrPHENIXPbPb=0, *arrBRAHMSPbPb=0;
TClonesArray *arrSTARpp =0, *arrPHENIXpp=0;
-const Double_t *scaleRatios = 0;
+//const Double_t *scaleRatios = 0;
Double_t *correlatedUnc = 0;
Double_t correlatedUncLocalPbPb[14] = {0.0424 , 0.0424 , 0.041 , 0 , 0 , 0.0424 , 0.0424 , 0 , 0.05 , 0.05 };
Double_t correlatedUncLocalPP [14] = {0.0424 , 0.0424 , 0.041 , 0 , 0 , 0.0424 , 0.0424 , 0 , 0.0424 , 0.0424 };
Double_t correlatedUncZero[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+TCanvas *myCan = 0;
+
TClonesArray * PlotRatiosForQM14() {
#if !(!defined (__CINT__) || (defined(__MAKECINT__)))
// Uncomment stuff in this section to save the inputs for thermal models
//#define SAVE_INPUT_THERMAL_MODEL
#ifdef SAVE_INPUT_THERMAL_MODEL
+ // PrepareThermalModelsInputFiles(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M0010", /*separateCharges*/1);
+ //PrepareThermalModelsInputFiles(arrpp7, AliParticleYield::kCSpp, 7000, "", /*separateCharges*/1);
+ PrepareThermalModelsInputFiles(arrpPb, AliParticleYield::kCSpPb, 5020, "V0A0005", /*separateCharges*/1);
+ PrepareThermalModelsInputFiles(arrpPb, AliParticleYield::kCSpPb, 5020, "V0A2040", /*separateCharges*/1);
+ PrepareThermalModelsInputFiles(arrpPb, AliParticleYield::kCSpPb, 5020, "V0A6080", /*separateCharges*/1);
+ // PrepareThermalModelsInputFiles(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M6080", /*separateCharges*/1);
+ //PrepareThermalModelsInputFiles(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M2030", /*separateCharges*/1);
+
// PrepareThermalModelsInputFiles(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M0010", /*separateCharges*/0);
- // PrepareThermalModelsInputFiles(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M0010", /*separateCharges*/1);
// PrepareThermalModelsInputFiles(arrpp7, AliParticleYield::kCSpp, 7000, "", /*separateCharges*/0);
- // PrepareThermalModelsInputFiles(arrpp7, AliParticleYield::kCSpp, 7000, "", /*separateCharges*/1);
-
-
- // PrepareThermalModelsInputFiles(arrpPb, AliParticleYield::kCSpPb, 5020, "V0A0005", /*separateCharges*/1);
- // PrepareThermalModelsInputFiles(arrpPb, AliParticleYield::kCSpPb, 5020, "V0A2040", /*separateCharges*/1);
- //PrepareThermalModelsInputFiles(arrpPb, AliParticleYield::kCSpPb, 5020, "V0A6080", /*separateCharges*/1);
- // PrepareThermalModelsInputFiles(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M6080", /*separateCharges*/1);
- // PrepareThermalModelsInputFiles(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M2030", /*separateCharges*/1);
+ PrepareThermalModelsInputFiles(arrpPb, AliParticleYield::kCSpPb, 5020, "V0A0005", /*separateCharges*/0);
+ PrepareThermalModelsInputFiles(arrpPb, AliParticleYield::kCSpPb, 5020, "V0A2040", /*separateCharges*/0);
+ PrepareThermalModelsInputFiles(arrpPb, AliParticleYield::kCSpPb, 5020, "V0A6080", /*separateCharges*/0);
+ // PrepareThermalModelsInputFiles(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M6080", /*separateCharges*/0);
+ // PrepareThermalModelsInputFiles(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M2030", /*separateCharges*/0);
return 0;
#endif
SetStyle();
- TCanvas * c1 = new TCanvas("Ratios", "Ratios", 1400, 600);
- c1->SetMargin( 0.0744986, 0.0329513, 0.225131, 0.83);
+ // TCanvas * c1 = new TCanvas("Ratios", "Ratios", 1400, 600);
+ // c1->SetMargin( 0.0744986, 0.0329513, 0.225131, 0.83);
// c1->SetLogy();
// CENTRAL
- DrawRatio("frame");
+ DrawRatio("allpp");
+ // DrawRatio("frame");
- DrawRatio("PbPb_0010");
+ // DrawRatio("PbPb_0010");
// DrawRatio("PbPbSTAR");
// DrawRatio("PbPbPHENIX");
// DrawRatio("PbPbBRAHMS");
- // DrawRatio("PbPb_6080");
+ // DrawRatio("PbPb_6080");
- DrawRatio("pp7");
- DrawRatio("pPb0005");
- DrawRatio("pp276");
- DrawRatio("pp900");
+ // DrawRatio("pp7");
+ // DrawRatio("pPb0005");
+ // DrawRatio("pp276");
+ // DrawRatio("pp900");
// DrawRatio("ppSTAR");
// DrawRatio("ppPHENIX");
// DrawRatio("ppBRAHMS");
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) {
// FIXME: THIS SHOULD BE REVIEWED TO MAKE SURE THE PLOTS ARE LABELLED CORRECTLY
- const Int_t nratio = 10;
- // Int_t denum[nratio] = {kPDGPi , kPDGPi , kPDGKS0 , kPDGPi , kPDGPi , kPDGPi , kPDGDeuteron , kPDGPi , kPDGK , -kPDGK};
-
- Int_t num [nratio] = {kPDGK , kPDGProton , kPDGLambda , kPDGXi , kPDGOmega , kPDGDeuteron , kPDGHE3 , kPDGHyperTriton , kPDGPhi , kPDGKStar};
- Int_t denum[nratio] = {kPDGPi , kPDGPi , kPDGKS0 , kPDGPi , kPDGPi , kPDGProton , kPDGDeuteron , kPDGPi , kPDGK , kPDGK};
- Int_t isSum[nratio] = {1 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 1 };
- static const Double_t scale[] = {1 , 3 , 0.5 , 30 , 250 , 50 , 100 , 4e5 , 2 , 2 };
- // static const Double_t scale[] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,};
- scaleRatios = scale;
+ // scaleRatios = scale;
TH1F * h = new TH1F(Form("hRatio_%d_%0.0f_%s_%d",system,energy,centrality.Data(),errorType), histotitle, nratio, 1+shift, nratio+1+shift);
TClonesArray * arrRatios = new TClonesArray ("AliParticleYield");// We save to disk the precomputed ratios
// If the ratio is not found, try to build it!
std::cout << " Looking for " << num[iratio-1] << " ("<<isSum[iratio-1]<<")"<<std::endl;
AliParticleYield * part1 = AliParticleYield::FindParticle(arr, num[iratio-1], system, energy, centrality, isSum[iratio-1]);
- if(part1) part1 = new AliParticleYield(*part1); // We need to clone it to avoid a mess if we need to use this particle again later
+ if(part1) {
+ part1 = new AliParticleYield(*part1); // We need to clone it to avoid a mess if we need to use this particle again later
+ if(isSum[iratio-1] && part1->IsTypeAverage()) {
+ std::cout << "Sum requested, found average, scaling x2" << std::endl;
+ part1->Scale(2.);
+ }
+ }
// Try with the !sum, if part 1 is not found
if(!part1) {
std::cout << " Looking for " << num[iratio-1] << " ("<<!isSum[iratio-1]<<")"<<std::endl;
}
std::cout << " Looking for " << denum[iratio-1] << " ("<<isSum[iratio-1]<<")"<<std::endl;
AliParticleYield * part2 = AliParticleYield::FindParticle(arr, denum[iratio-1], system, energy, centrality,isSum[iratio-1]);
- if(part2) part2 = new AliParticleYield(*part2); // We need to clone it to avoid a mess if we need to use this particle again later
+ if(part2) {
+ part2 = new AliParticleYield(*part2); // We need to clone it to avoid a mess if we need to use this particle again later
+ if(isSum[iratio-1] && part2->IsTypeAverage()) {
+ std::cout << "Sum requested, found average, scaling x2" << std::endl;
+ part2->Scale(2.);
+ }
+ }
if(!part2) {// Try with the !sum, if part 2 is not found
std::cout << " Looking for " << denum[iratio-1] << " ("<<!isSum[iratio-1]<<")"<<std::endl;
part2 = AliParticleYield::FindParticle(arr, denum[iratio-1], system, energy, centrality,!isSum[iratio-1]);
}
ratio = AliParticleYield::Divide(part1, part2, correlatedUnc[iratio-1], "YQ"); // Assume by that the systematics of part1 and part2 are uncorrelated.
+
if(ratio) {
std::cout << "" << std::endl;
std::cout << "WARNING: building ratio " << num[iratio-1] <<"/"<<denum[iratio-1]<<": Check uncertainties!!" << std::endl;
h->SetLineColor(icolor);
h->SetMarkerColor(icolor);
h->SetMarkerStyle(imarker);
-
- AliParticleYield::SaveAsASCIIFile(arrRatios, TString("ratios_")+h->GetName());
+ // the "if" avoids saving twice the same ratios
+ if(errorType == kSystError) AliParticleYield::SaveAsASCIIFile(arrRatios, TString("ratios_")+h->GetName());
return h;
void PrepareThermalModelsInputFiles(TClonesArray * arr, Int_t system, Float_t energy, TString centrality, Bool_t separateCharges) {
// If "Separate charges" is true, tries to dump both charges are dumped
TClonesArray * arrOut = new TClonesArray("AliParticleYield");
+ TClonesArray * arrOutGSI = new TClonesArray("AliParticleYield"); // We add dummy lines to the GSI output file if needed!
const Int_t npart = 12;
Int_t particles [npart] = {kPDGPi ,kPDGK ,kPDGKS0, kPDGKStar, kPDGPhi, kPDGProton , kPDGLambda , kPDGXi , kPDGOmega , kPDGDeuteron, kPDGHyperTriton, kPDGHE3 };
- Int_t isSum[npart] = {1 ,1 ,0 , 1 , 0 , 1 ,0 ,1 ,1 ,0 , 1 , 0 };
+ Int_t isSum[npart] = {1 ,1 ,0 , 1 , 0 , 1 ,1 ,1 ,1 ,0 , 1 , 0 };
Int_t ipartOut = 0; // Index for the array
+ Int_t ipartOutGSI = 0; // Index for the array
+
for(Int_t ipart = 0; ipart < npart; ipart++){
if(!separateCharges) {
AliParticleYield * part = AliParticleYield::FindParticle(arr, particles[ipart], system, energy, centrality, isSum[ipart]);
//Could not find the particle, but the sum was requested: build the sum!
part = AliParticleYield::FindParticle(arr, particles[ipart], system, energy, centrality, 0);
AliParticleYield * part2 = AliParticleYield::FindParticle(arr, -particles[ipart], system, energy, centrality, 0);
- if(part2 && part) part = AliParticleYield::Add(part, part2);
+ if(part2 && part) part = AliParticleYield::Add(part, part2);
+ else if(part) part->Scale(2.); // If we only found a particle, we can scale it by a factor 2.
else part = 0;
}
- if(part) new((*arrOut)[ipartOut++]) AliParticleYield(*part);
+ // We want to save the average of particle and antiparticle in this case
+ if(part) {
+ if(isSum[ipart] && !part->IsTypeAverage()) part->Scale(0.5); // If it's not already an average, but just a sum, divide by 2
+ new((*arrOut )[ipartOut++]) AliParticleYield(*part);
+ new((*arrOutGSI)[ipartOutGSI++]) AliParticleYield(*part);
+ } else { // Add dummy particle to the GSI list
+ new((*arrOutGSI)[ipartOutGSI++]) AliParticleYield(particles[ipart], system, energy, -10, -10, -10, -10, -10, -10, 5, 256, "DUMMY", 1, "ALICE");
+ }
}
else {
// ignore isSum and try to find both particles
else notFound=1;
// Try to find antiparticle (-pdg code)
part = AliParticleYield::FindParticle(arr, -particles[ipart], system, energy, centrality, 0);
- if(part) new((*arrOut)[ipartOut++]) AliParticleYield(*part);
+ if(part) {
+ new((*arrOut)[ipartOut++]) AliParticleYield(*part);
+ new((*arrOutGSI)[ipartOutGSI++]) AliParticleYield(*part);
+ }
else if (notFound) {
// If neither charge was found, check if we at least have the sum
part = AliParticleYield::FindParticle(arr, abs(particles[ipart]), system, energy, centrality, 1);
- if (part) new((*arrOut)[ipartOut++]) AliParticleYield(*part);
+ if (part) {
+ part->Scale(0.5);
+ new((*arrOut)[ipartOut++]) AliParticleYield(*part);
+ new((*arrOutGSI)[ipartOutGSI++]) AliParticleYield(*part);
+ }
+ else {
+ new((*arrOutGSI)[ipartOutGSI++]) AliParticleYield(particles[ipart], system, energy, -10, -10, -10, -10, -10, -10, 5, 256, "DUMMY", 1, "ALICE");
+ }
}
}
}
std::cout << "Particles for thermal model fits:" << std::endl;
- // arrOut->Print("short");
- arrOut->Print("");
+ arrOut->Print("short");
+ // arrOut->Print("");
std::cout << "" << std::endl;
// Write GSI input file
- TIter it(arrOut);
+ TIter it(arrOutGSI);
AliParticleYield * part = 0;
ofstream fout(Form("gsi_System_%d_Energy_%0.0f_Centr_%s_BothCharges_%d", system, energy, centrality.Data(), separateCharges));
while ((part = (AliParticleYield*) it.Next())){
const Int_t npart = 11;
Int_t pdg [npart] = {kPDGPi, kPDGK , kPDGProton , kPDGLambda , kPDGXi , kPDGOmega , kPDGDeuteron , kPDGHE3 , kPDGHyperTriton , kPDGPhi , kPDGKStar};
- // Int_t isSum[npart] = {1 ,1 ,1 ,0 ,1 ,1 ,0 ,0 ,1 ,0 ,1 };
- Int_t isSum[npart] = {0,0,0,0,0,0,0,0,0,0,1};
- // Double_t scale[npart] = {1 ,1 ,3 ,1 ,30 ,250 ,50 ,10 ,4e5 ,2 ,2 };
+ Int_t isSum[npart] = {1 ,1 ,1 ,0 ,1 ,1 ,0 ,0 ,1 ,0 ,1 };
+ //Int_t isSum[npart] = {0,0,0,0,0,0,0,0,0,0,1};
+ //Double_t scale[npart] = {1 ,1 ,3 ,1 ,30 ,250 ,50 ,10 ,4e5 ,2 ,2 };
Double_t scale[npart] = {1,5,30,30,200,1000,4000,2e6,2e6,20,20,};
TH1F * h = new TH1F(Form("hPart_%d_%0.0f_%s",system,energy,centrality.Data()), histotitle, npart, 1, npart+1);
arrpPb->AbsorbObjects(AliParticleYield::ReadFromASCIIFile("pPb_5020_PiKaPrLamndaK0.txt"));
arrpPb->AbsorbObjects(AliParticleYield::ReadFromASCIIFile("pPb_5020_deuteron.txt"));
arrpPb->AbsorbObjects(AliParticleYield::ReadFromASCIIFile("pPb_5020_AveragedNumbers.txt"));
-
+ arrpPb->AbsorbObjects(AliParticleYield::ReadFromASCIIFile("pPb_5020_phi.txt"));
+ arrpPb->AbsorbObjects(AliParticleYield::ReadFromASCIIFile("pPb_5020_Kstar.txt"));
arrThermus = AliParticleYield::ReadFromASCIIFile("PbPb_2760_Thermus_Boris_20140407.txt");
// RHIC data
gStyle->SetOptStat(0);
if(graypalette) gStyle->SetPalette(8,0);
else gStyle->SetPalette(1);
+ gStyle->SetDrawBorder(0);
gStyle->SetCanvasColor(10);
gStyle->SetCanvasBorderMode(0);
+ gStyle->SetPadBorderMode(0);
gStyle->SetFrameLineWidth(1);
gStyle->SetFrameFillColor(kWhite);
gStyle->SetPadColor(10);
// ratio here and then we set lines and markers to white. We also
// add the "NoLegend" flag, so that it does not show up in the legend
correlatedUnc = correlatedUncZero;
- TH1 * h = GetHistoRatios(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M0010", "NoLegend", kWhite);
- h->Draw();
- Int_t nratio = h->GetNbinsX();
+ DrawFrame();
+ // TH1 * h = GetHistoRatios(arrPbPb, AliParticleYield::kCSPbPb, 2760, "V0M0010", "NoLegend", kWhite);
+ // h->Draw();
+ // h->GetYaxis()->SetDecimals(1);
+ // h->GetYaxis()->SetNdivisions(505);
+ // h->GetXaxis()->CenterLabels(1);
+ // Int_t nratio = h->GetNbinsX();
for(Int_t iratio = 0; iratio < nratio; iratio++){
- Double_t exp = TMath::Floor(TMath::Log10(TMath::Abs(scaleRatios[iratio])));
- Double_t man = scaleRatios[iratio] / TMath::Power(10, exp);
+ Double_t exp = TMath::Floor(TMath::Log10(TMath::Abs(scale[iratio])));
+ Double_t man = scale[iratio] / TMath::Power(10, exp);
if(exp > 2) {
- TLatex * scaleLabel = new TLatex(iratio+1+0.2,maxy*1.01, Form("#times %0.0f 10^{%0.0f}", man, exp));
+ // TLatex * scaleLabel = new TLatex(iratio+1+0.2,maxy*1.01, Form("#times %0.0f 10^{%0.0f}", man, exp));
+ TLatex * scaleLabel = new TLatex(iratio+1+0.2,0.005, Form("#times %0.0f 10^{%0.0f}", man, exp));
scaleLabel->Draw();
} else {
- TLatex * scaleLabel = new TLatex(iratio+1+0.2,maxy*1.01, Form("#times %g", scaleRatios[iratio]));
+ TLatex * scaleLabel = new TLatex(iratio+1+0.2,0.005, Form("#times %g", scale[iratio]));
scaleLabel->Draw();
}
}
tex->SetLineWidth(2);
tex->Draw();
- h->GetYaxis()->SetDecimals(1);
- h->GetYaxis()->SetNdivisions(505);
- // h->GetXaxis()->CenterLabels(1);
gPad->SetGridx();
}
else if (what == "PbPb_0010") {
array = arrPbPb;
system = 2; energy = 2760.; centrality = "V0M0010";
- label = "Pb-Pb, #sqrt{s_{NN}} = 2.76 TeV, 0-10%";
+ label = "Pb-Pb, #sqrt{s}{}_{NN} = 2.76 TeV, 0-10%";
color = kRed+1;
marker = kFullCircle;
shift = 0;
else if (what == "PbPbSTAR") {
array = arrSTARPbPb;
system = 2; energy = 200.; centrality = "0005";
- label = "STAR, Pb-Pb, #sqrt{s_{NN}} = 0.2 TeV, 0-5%";
+ label = "STAR, Au-Au, #sqrt{s_{NN}} = 0.2 TeV, 0-5%";
color = kBlack;
marker = kOpenStar;
shift = +0.2;
else if (what == "PbPbPHENIX") {
array = arrPHENIXPbPb;
system = 2; energy = 200.; centrality = "0005";
- label = "PHENIX, Pb-Pb, #sqrt{s_{NN}} = 0.2 TeV, 0-5%";
+ label = "PHENIX, Au-Au, #sqrt{s_{NN}} = 0.2 TeV, 0-5%";
color = kBlack;
marker = kOpenSquare;
shift = -0.15;
else if (what == "PbPbBRAHMS") {
array = arrBRAHMSPbPb;
system = 2; energy = 200.; centrality = "0010";
- label = "BRAHMS, Pb-Pb, #sqrt{s_{NN}} = 0.2 TeV, 0-10%";
+ label = "BRAHMS, Au-Au, #sqrt{s_{NN}} = 0.2 TeV, 0-10%";
color = kBlack;
marker = kOpenCross;
shift = -0.3;
marker = kOpenSquare;
shift = -0.2;
correlatedUnc = correlatedUncZero;
+ }
+ // From here on, it's meta names, to draw several series of ratios
+ else if (what == "allpp"){
+ DrawRatio("frame");
+ DrawRatio("pp7");
+ array =0;
+ // DrawRatio("pp276");
+ // DrawRatio("pp900");
+ // myCan->Print("Ratios_pponly.eps");
+ // gSystem->Exec("epstopdf Ratios_pponly.eps Ratios_pponly.pdf");
+ // gSystem->Exec("if [ \"$USER\" = \"mfloris\" ]; then cp Ratios_pponly.{eps,pdf} /Users/mfloris/Documents/PapersNTalks/ALICE/ThermalFits/img/; fi ");
}
}
+void DrawFrame(Bool_t isYields) {
+
+ myCan = new TCanvas("myCan","BD april.2014",50,10,1000,650);
+ myCan->Draw();
+ myCan->cd();
+ // Set the Pads
+ TPad *myPadLabel = new TPad("myPadLabel","myPadLabel",0.0,0.92,1.0,1.0);
+ myPadSetUp(myPadLabel);
+ myPadLabel->Draw();
+
+ TPad *myPadHisto = new TPad("myPadHisto","myPadHisto",0.0,isYields ? 0.25 : 0.05 ,1.0,0.92,0);
+ myPadSetUp(myPadHisto);
+ myPadHisto->Draw();
+
+ TPad *myPadStdDev = new TPad("myPadStdDev","myPadStdDev",0.0,0.0,1.0,0.25,0);
+ myPadSetUp(myPadStdDev);
+ if(isYields) myPadStdDev->Draw();
+
+ myPadLabel->cd();
+
+ double xLabelPosition[nratio] = {0.124498, 0.211847, 0.295181, 0.39, 0.477912, 0.566265, 0.640562, 0.727912, 0.825301, 0.910643 };
+ double yLabelPosition = 0.39;
+
+ // labels
+ for(Int_t iratio = 0; iratio < nratio; iratio++){
+ TLatex *myRatio = new TLatex(xLabelPosition[iratio],yLabelPosition,ratiosLabels[iratio]);
+ myLatexDraw(myRatio,0.5);
+ }
+
+
+ if(isYields) {
+ myPadStdDev->cd();
+ myPadStdDev->SetTopMargin(0.0);
+ myPadStdDev->SetTicks(1,1);
+
+ Float_t devMax = 3.5;
+
+ TH2F *myBlankStdDev = new TH2F("myBlankStdDev","myBlankStdDev",18,0,18,10,-devMax,+devMax);
+ myBlankStdDev->GetXaxis()->SetLabelFont(43); // precision 3: size will be in pixels
+ myBlankStdDev->GetYaxis()->SetLabelFont(43);
+ myBlankStdDev->GetYaxis()->SetTitleFont(43);
+ myBlankStdDev->SetLabelSize(23,"xy");
+ myBlankStdDev->SetTitleSize(26,"y");
+ myBlankStdDev->SetNdivisions(505,"x");
+ myBlankStdDev->SetNdivisions(605,"y");
+ myBlankStdDev->SetLabelOffset(0.012,"xy");
+ myBlankStdDev->SetYTitle("std. dev. ^{ }");
+ myBlankStdDev->SetTitleOffset(1,"y");
+ myBlankStdDev->Draw();
+ }
+
+ myPadHisto->cd();
+ myPadHisto->SetBottomMargin(0.01);
+ // myPadHisto->SetLogy();
+ myPadHisto->SetTicks(1,1);
+
+ TH2F *myBlankHisto = new TH2F("NoLegend","NoLegend",nratio,1,nratio+1,10,-0.01,maxy);
+ myBlankHisto->GetXaxis()->SetLabelFont(43); // precision 3: size will be in pixels
+ myBlankHisto->GetYaxis()->SetLabelFont(43);
+ myBlankHisto->GetYaxis()->SetTitleFont(43);
+ myBlankHisto->SetLabelSize(23,"xy");
+ myBlankHisto->SetTitleSize(26,"y");
+ myBlankHisto->SetMaximum(10);
+ myBlankHisto->SetMinimum(0);
+ myBlankHisto->SetNdivisions(10,"x");
+ myBlankHisto->SetNdivisions(505,"y");
+ myBlankHisto->SetYTitle("d#it{N}/d#it{y}");
+ myBlankHisto->SetLabelOffset(0.012,"xy");
+ myBlankHisto->SetTitleOffset(1,"y");
+ myBlankHisto->Draw();
+
+}
+
+void myLatexDraw(TLatex *currentLatex, Float_t currentSize, Int_t currentColor){
+ currentLatex->SetTextSize(currentSize);
+ currentLatex->SetTextAngle(0);
+ currentLatex->Draw();
+ return;
+}
+
+void myPaveSetup(float rRatio, float rRange3, float rRange5,
+ int rFillColor){
+
+ float cHiRange = 0, cLoRange = 0;
+ if(rRange3<rRange5) {cHiRange=rRange5;cLoRange=rRange3;}
+ else {cHiRange=rRange3;cLoRange=rRange5;}
+
+ TPave *cPave= new TPave(rRatio-0.25,cLoRange,rRatio+0.25,cHiRange,0,"br");
+ cPave->SetFillColor(rFillColor);
+ cPave->SetLineColor(1);
+ cPave->Draw();
+}
+
+void myPadSetUp(TPad *currentPad){
+ currentPad->SetLeftMargin(0.10);
+ currentPad->SetRightMargin(0.02);
+ currentPad->SetTopMargin(0.02);
+ currentPad->SetBottomMargin(0.02);
+ return;
+}