18 # include <TSeqCollection.h>
19 # include <TLegendEntry.h>
68 return sMin + TMath::Power(x/xMax, 2)*(sMax-sMin);
73 return SysEval(x, sMin, sMax, 80);
77 return SysEval(x, sMin, sMax, 2);
93 if (!gROOT->GetClass(
"GraphSysErr"))
return 0;
94 TString bin; bin.Form(
"%03dd%02d_%03dd%02d",
97 TString sub(bin); sub.Prepend(
"cent"); sub.Append(
"/dndeta");
98 TString nme(bin); nme.Prepend(
"CENT_");
102 Color_t col = g->GetMarkerColor();
105 Double_t cMin = sNN == 5023 ? 0.005 : 0.004;
106 Double_t cMax = sNN == 5023 ? 0.075 : 0.062;
111 gse->
SetTitle(Form(
"%5.1f - %5.1f%%", c1, c2));
112 gse->
SetKey(
"author", (sNN == 5023 ?
"PREGHENELLA : 2015":
"SHAHOYAN : 2013"));
113 gse->
SetKey(
"title", Form(
"dNch/deta in PbPb at %d GeV", sNN));
114 gse->
SetKey(
"obskey",
"DN/DETARAP");
115 gse->
SetKey(
"reackey",
"PB PB --> CHARGED X");
116 gse->
SetKey(
"laboratory",
"CERN");
117 gse->
SetKey(
"accelerator",
"LHC");
118 gse->
SetKey(
"detector",
"TRACKLETS");
119 gse->
SetKey(
"reference", sNN==5023 ?
"ALICE-AN-2830" :
"ALICE-AN-2180");
120 gse->
AddQualifier(
"CENTRALITY IN PCT", Form(
"%.1f TO %.1f",c1,c2));
121 gse->
AddQualifier(
"SQRT(S)/NUCLEON IN GEV", Form(
"%d", sNN));
124 gse->SetMarkerStyle(g->GetMarkerStyle());
125 gse->SetMarkerSize(g->GetMarkerSize());
127 gse->SetMarkerColor(col);
128 gse->SetLineColor(col);
129 gse->SetFillColor(col);
136 MakeCommon(gse,
"Particle composition", 0.01, col);
138 MakeCommon(gse,
"pT extrapolation", 0.02, col);
140 MakeCommon(gse,
"Background subrtaction", bg, col);
145 for (
Int_t i = 1; i <= g->GetNbinsX(); i++) {
146 Double_t eta = g->GetXaxis()->GetBinCenter(i);
147 Double_t eEta = g->GetXaxis()->GetBinWidth(i)/2;
149 if (xo > 2)
continue;
150 Double_t ea = 0.02*TMath::Power(xo/2,2);
151 gse->
SetPoint(j, eta, g->GetBinContent(i));
153 gse->
SetStatError(j, g->GetBinError(i),g->GetBinError(i));
154 gse->
SetSysError(acc, j, eEta, eEta, ea/100, ea/100);
175 if (!gROOT->GetClass(
"GraphSysErr"))
return 0;
176 TString bin; bin.Form(
"%03dd%02d_%03dd%02d",
179 TString sub(bin); sub.Prepend(
"cent"); sub.Append(
"/averages/truth");
180 TString nme(bin); nme.Prepend(
"CENTT_");
184 Color_t col = g->GetMarkerColor();
189 gse->
SetTitle(Form(
"%5.1f - %5.1f%%", c1, c2));
190 gse->
SetKey(
"author", (sNN == 5023 ?
"PREGHENELLA : 2015":
"SHAHOYAN : 2013"));
191 gse->
SetKey(
"title", Form(
"dNch/deta in PbPb at %d GeV", sNN));
192 gse->
SetKey(
"obskey",
"DN/DETARAP");
193 gse->
SetKey(
"reackey",
"PB PB --> CHARGED X");
194 gse->
SetKey(
"laboratory",
"CERN");
195 gse->
SetKey(
"accelerator",
"LHC");
196 gse->
SetKey(
"detector",
"TRACKLETS");
197 gse->
SetKey(
"reference", sNN==5023 ?
"ALICE-AN-2830" :
"ALICE-AN-2180");
198 gse->
AddQualifier(
"CENTRALITY IN PCT", Form(
"%.1f TO %.1f",c1,c2));
199 gse->
AddQualifier(
"SQRT(S)/NUCLEON IN GEV", Form(
"%d", sNN));
202 gse->SetMarkerStyle(g->GetMarkerStyle());
203 gse->SetMarkerSize(g->GetMarkerSize());
205 gse->SetMarkerColor(col);
206 gse->SetLineColor(col);
207 gse->SetFillColor(col);
216 for (
Int_t i = 1; i <= g->GetNbinsX(); i++) {
217 Double_t eta = g->GetXaxis()->GetBinCenter(i);
218 Double_t eEta = g->GetXaxis()->GetBinWidth(i)/2;
220 if (xo > 2)
continue;
221 Double_t ea = 0.02*TMath::Power(xo/2,2);
222 gse->
SetPoint(j, eta, g->GetBinContent(i));
224 gse->
SetStatError(j, g->GetBinError(i),g->GetBinError(i));
234 GetO(TDirectory*
dir,
const char* name, TClass* cls=0)
237 Warning(
"GetO",
"No directory passed");
243 Warning(
"GetO",
"object %s not found in %s",
244 name, dir->GetPath());
248 if (!o->IsA()->InheritsFrom(cls)) {
249 Warning(
"GetO",
"Object %s in %s is not a %s, but a %s",
250 name, dir->GetPath(), cls->GetName(), o->ClassName());
256 TDirectory*
GetD(TDirectory*
dir,
const char* name)
258 return static_cast<TDirectory*
>(
GetO(dir,name,TDirectory::Class()));
264 return static_cast<TH1*
>(
GetO(dir,name,TH1::Class()));
274 if (!gROOT->GetClass(
"GraphSysErr"))
275 gROOT->LoadMacro(
"$HOME/GraphSysErr/GraphSysErr.C+g");
277 TString base =
gSystem->BaseName(input); base.ReplaceAll(
".root",
"");
278 TFile*
file = TFile::Open(input,
"READ");
281 TH1* cent =
GetH1(file,
"realCent");
286 for (
Int_t i = 1; i <= cent->GetNbinsX(); i++) {
287 Double_t c1 = cent->GetXaxis()->GetBinLowEdge(i);
288 Double_t c2 = cent->GetXaxis()->GetBinUpEdge(i);
294 if (first) g->Draw(
"quad stat combine axis");
295 else g->Draw(
"quad stat combine");
300 TString obase(base); obase.Prepend(
"GSE_");
302 std::ofstream out(Form(
"%s.input", obase.Data()));
304 out <<
"*E" << std::endl;
307 TFile* rout = TFile::Open(Form(
"%s.root", obase.Data()),
"RECREATE");
308 stack->AddAll(truths);
309 stack->Write(
"container", TObject::kSingleKey);
317 ExtractGSE(Form(
"MiddNdeta_0x%x.root", flags));
void Export(std::ostream &out=std::cout, Option_t *option="", Int_t nsign=2)
void SetSysLineColor(Int_t id, Color_t color)
void SetYTitle(const char *title)
void SetKey(const char *key, const char *value, Bool_t replace=false)
void SetPointError(Int_t i, Double_t ex)
void SetSysError(Int_t id, Double_t eyl, Double_t eyh)
void SetCommonSumLineColor(Color_t color)
void AddQualifier(const TString &key, const TString &value, Bool_t replace=false)
void SetCommonSumOption(EDrawOption_t opt)
void SetStatError(Int_t i, Double_t ey)
void SetPoint(Int_t i, Double_t x, Double_t y)
void SetTitle(const char *name)
UInt_t DefineCommon(const char *title, Bool_t relative, Double_t ey, EDrawOption_t option=kFill)
UInt_t DeclarePoint2Point(const char *title, Bool_t relative, EDrawOption_t option=kBar)
void SetDataOption(EDrawOption_t opt)
void SetSysFillColor(Int_t id, Color_t color)
An (X,Y) graph with configurable errors.
void SetSumOption(EDrawOption_t opt)
TFile * file
TList with histograms for a given trigger.
void SetSumFillColor(Color_t color)
void SetSumLineColor(Color_t color)
void SetXTitle(const char *title)
void SetCommonSumFillColor(Color_t color)