18 # include <TSeqCollection.h>
19 # include <TLegendEntry.h>
43 else if (c < 10)
return 1;
44 else if (c < 20)
return 2;
45 else if (c < 30)
return 3;
46 else if (c < 40)
return 4;
47 else if (c < 50)
return 5;
48 else if (c < 60)
return 6;
49 else if (c < 70)
return 7;
50 else if (c < 80)
return 8;
51 else if (c < 90)
return 9;
66 const Color_t
cc[] = { kMagenta+2,
118 return sMin + TMath::Power(x/xMax, 2)*(sMax-sMin);
123 return SysEval(x, sMin, sMax, 80);
127 return SysEval(x, sMin, sMax, 2);
148 if (!gROOT->GetClass(
"GraphSysErr"))
return 0;
149 TString bin; bin.Form(
"%03dd%02d_%03dd%02d",
152 Bool_t isAll = (c1+1.e-9 >= c2);
153 if (isAll) bin =
"all";
155 if (!isAll) sub.Prepend(
"cent");
156 sub.Append(Form(
"/results%dd/result", dimen));
157 TString nme(bin); nme.Prepend(
"CENT_");
162 Printf(
"Trigger efficiency: %6.4f", eff);
163 if (eff < 1e-6) eff = 1;
165 g->SetBinContent(0,0);
171 Double_t cMin = sNN == 5440 ? 0.0024 : sNN == 5023 ? 0.005 : 0.004;
172 Double_t cMax = sNN == 5440 ? 0.0961 : sNN == 5023 ? 0.075 : 0.062;
177 gse->
SetTitle(Form(
"%5.1f - %5.1f%%", c1, c2));
179 gse->
SetKey(
"title", Form(
"dNch/deta in PbPb at %d GeV", sNN));
180 gse->
SetKey(
"obskey",
"DN/DETARAP");
181 gse->
SetKey(
"reackey",
"PB PB --> CHARGED X");
182 gse->
SetKey(
"laboratory",
"CERN");
183 gse->
SetKey(
"accelerator",
"LHC");
184 gse->
SetKey(
"detector",
"TRACKLETS");
185 gse->
SetKey(
"reference", sNN==5023 ?
"ALICE-AN-2830" :
"ALICE-AN-2180");
186 if (!isAll)gse->
AddQualifier(
"CENTRALITY IN PCT", Form(
"%.1f TO %.1f",c1,c2));
187 gse->
AddQualifier(
"SQRT(S)/NUCLEON IN GEV", Form(
"%d", sNN));
190 gse->SetMarkerStyle(g->GetMarkerStyle());
191 gse->SetMarkerSize(g->GetMarkerSize());
193 gse->SetMarkerColor(col);
194 gse->SetLineColor(col);
195 gse->SetFillColor(col);
202 MakeCommon(gse,
"Particle composition", 0.01, col);
204 MakeCommon(gse,
"pT extrapolation", 0.02, col);
206 MakeCommon(gse,
"Background subtraction", bg, col);
208 MakeCommon(gse,
"EM contamination", (c1>=70?0.04:0), col);
215 for (
Int_t i = 1; i <= g->GetNbinsX(); i++) {
216 Double_t eta = g->GetXaxis()->GetBinCenter(i);
217 Double_t eEta = g->GetXaxis()->GetBinWidth(i)/2;
219 if (xo > 2)
continue;
220 Double_t ea = 0.02*TMath::Power(xo/2,2);
221 gse->
SetPoint(j, eta, g->GetBinContent(i));
223 gse->
SetStatError(j, g->GetBinError(i),g->GetBinError(i));
224 gse->
SetSysError(acc, j, eEta, eEta, ea/100, ea/100);
250 if (!gROOT->GetClass(
"GraphSysErr"))
return 0;
251 TString bin; bin.Form(
"%03dd%02d_%03dd%02d",
254 Bool_t isAll = (c1+1.e-9 >= c2);
255 if (isAll) bin =
"all";
257 if (!isAll) sub.Prepend(
"cent");
258 sub.Append(Form(
"/results%dd/simG",dimen));
259 TString nme(bin); nme.Prepend(
"CENTT_");
268 gse->
SetTitle(Form(
"%5.1f - %5.1f%%", c1, c2));
269 gse->
SetKey(
"author", (sNN == 5023 ?
"PREGHENELLA : 2015":
"SHAHOYAN : 2013"));
270 gse->
SetKey(
"title", Form(
"dNch/deta in PbPb at %d GeV", sNN));
271 gse->
SetKey(
"obskey",
"DN/DETARAP");
272 gse->
SetKey(
"reackey",
"PB PB --> CHARGED X");
273 gse->
SetKey(
"laboratory",
"CERN");
274 gse->
SetKey(
"accelerator",
"LHC");
275 gse->
SetKey(
"detector",
"TRACKLETS");
276 gse->
SetKey(
"reference", sNN==5023 ?
"ALICE-AN-2830" :
"ALICE-AN-2180");
277 if (!isAll)gse->
AddQualifier(
"CENTRALITY IN PCT", Form(
"%.1f TO %.1f",c1,c2));
278 gse->
AddQualifier(
"SQRT(S)/NUCLEON IN GEV", Form(
"%d", sNN));
281 gse->SetMarkerStyle(g->GetMarkerStyle());
282 gse->SetMarkerSize(g->GetMarkerSize());
284 gse->SetMarkerColor(col);
285 gse->SetLineColor(col);
286 gse->SetFillColor(col);
295 for (
Int_t i = 1; i <= g->GetNbinsX(); i++) {
296 Double_t eta = g->GetXaxis()->GetBinCenter(i);
297 Double_t eEta = g->GetXaxis()->GetBinWidth(i)/2;
299 if (xo > 2)
continue;
300 Double_t ea = 0.02*TMath::Power(xo/2,2);
301 gse->
SetPoint(j, eta, g->GetBinContent(i));
303 gse->
SetStatError(j, g->GetBinError(i),g->GetBinError(i));
313 GetO(TDirectory*
dir,
const char* name, TClass* cls=0)
316 Warning(
"GetO",
"No directory passed");
322 Warning(
"GetO",
"object %s not found in %s",
323 name, dir->GetPath());
327 if (!o->IsA()->InheritsFrom(cls)) {
328 Warning(
"GetO",
"Object %s in %s is not a %s, but a %s",
329 name, dir->GetPath(), cls->GetName(), o->ClassName());
335 TDirectory*
GetD(TDirectory*
dir,
const char* name)
337 return static_cast<TDirectory*
>(
GetO(dir,name,TDirectory::Class()));
343 return static_cast<TH1*
>(
GetO(dir,name,TH1::Class()));
353 if (!gROOT->GetClass(
"GraphSysErr"))
354 gROOT->LoadMacro(
"$HOME/GraphSysErr/GraphSysErr.C+g");
357 TFile*
file = TFile::Open(Form(
"%s/result.root",input),
"READ");
359 Warning(
"ExtractGSE2",
"Failed to open %s/result.root", input);
364 if (base.EndsWith(
"unit")) dimen = 0;
365 else if (base.EndsWith(
"const")) dimen = 1;
366 else if (base.EndsWith(
"eta")) dimen = 2;
367 else if (base.EndsWith(
"etaipz")) dimen = 3;
369 Error(
"ExtractGSE2",
"Don't know how to extract dimension from %s",base);
374 TH1* cent =
GetH1(file,
"realCent");
379 for (
Int_t i = 1; i <= cent->GetNbinsX(); i++) {
380 Double_t c1 = cent->GetXaxis()->GetBinLowEdge(i);
381 Double_t c2 = cent->GetXaxis()->GetBinUpEdge(i);
388 if (first) g->Draw(
"quad stat combine axis");
389 else g->Draw(
"quad stat combine");
390 if (t) t->Draw(
"quad");
395 frame = gse->
GetMulti()->GetHistogram();
398 if (frame) frame->SetMinimum(1);
402 std::ofstream out(Form(
"%s/gse.input", base.Data()));
404 out <<
"*E" << std::endl;
407 TFile* rout = TFile::Open(Form(
"%s/gse.root", base.Data()),
"RECREATE");
408 stack->AddAll(truths);
409 stack->Write(
"container", TObject::kSingleKey);
417 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.
TMultiGraph * GetMulti(Option_t *option="")
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)