27 else if (
gSystem->Getenv(
"ANA_SRC"))
28 fwd =
gSystem->Getenv(
"ANA_SRC");
30 fwd =
gSystem->ExpandPathName(
"$ALICE_PHYSICS/PWGLF/FORWARD/analysis2");
31 gROOT->SetMacroPath(Form(
"%s:%s/dndeta:%s/gse:%s/scripts",
33 gSystem->AddIncludePath(Form(
"-I%s/dndeta -I%s/gse", fwd,fwd));
36 if (!gROOT->GetClass(
"Drawer")) gROOT->LoadMacro(
"Drawer.C+g");
37 if (!gROOT->GetClass(
"GraphSysErr")) gROOT->LoadMacro(
"GraphSysErr.C+g");
38 if (!gROOT->GetClass(
"SysErrorAdder"))gROOT->LoadMacro(
"SysErrorAdder.C+g");
44 reac.Insert(reac.Index(
"P", 1, 1),
" ");
45 reac.Append(
" --> CHARGED X");
48 const char* trigs[] = { trigger.Data(), 0 };
49 const char* exps[] = {
"ALICE",
"WIP", 0 };
51 if (sNN == 8000 && system.EqualTo(
"pp", TString::kIgnoreCase)) {
54 if (trigger.EqualTo(
"INEL",TString::kIgnoreCase))
56 else if (trigger.EqualTo(
"NSD",TString::kIgnoreCase) ||
57 trigger.EqualTo(
"V0AND",TString::kIgnoreCase)) {
67 if (trigger.EqualTo(
"INEL",TString::kIgnoreCase))
69 if (trigger.EqualTo(
"INELGt0",TString::kIgnoreCase))
71 else if (trigger.EqualTo(
"NSD",TString::kIgnoreCase))
74 trigLegTitle =
"Centralities:";
75 adder =
new CENTAdder(system, sNN, trigger);
79 TCanvas*
c =
new TCanvas(
"C",
"C", 1600, 1000);
80 c->SetTopMargin(0.01);
81 c->SetRightMargin(0.20);
82 c->SetLeftMargin(0.12);
89 Double_t ly1 = ly2-(trigLegTitle.IsNull() ? ldy : 2*ldy);
92 TLegend* tl =
new TLegend(lx1,ly1,lx2,ly2, trigLegTitle);
102 TLegend* el =
new TLegend(lx1,ly1,lx2,ly2,
"Sys. errors:");
103 el->SetBorderSize(0);
112 TLegend* ul =
new TLegend(lx1, ly1, lx2, ly2);
113 ul->SetBorderSize(0);
121 exps, option, rebinned,
123 if (!dataOther || !dataOther->Key()) {
124 Error(
"",
"No data found %s",
canvas->GetTitle());
127 THStack* data =
static_cast<THStack*
>(dataOther->Key());
128 TMultiGraph* other =
static_cast<TMultiGraph*
>(dataOther->Value());
132 TIter next(data->GetHists());
136 const char* opt =
"stack stat quad split west west";
137 while ((h = static_cast<TH1*>(next()))) {
139 if (n.Contains(
"syserror", TString::kIgnoreCase))
continue;
147 gse->
Draw(Form(
"%s %s", (first ?
"axis" :
""), opt));
148 gse->
SetKey(
"laboratory",
"CERN");
149 gse->
SetKey(
"accelerator",
"LHC");
150 gse->
SetKey(
"detector", Form(
"FORWARD%s", rebinned ?
"" :
"_full"));
151 gse->
SetKey(
"reackey", reac);
152 gse->
SetKey(
"obskey",
"DN/DETARAP");
153 gse->
SetKey(
"title",
"Systematic study of 1/N dNch/deta over widest possible eta region at the LHC");
154 gse->
SetKey(
"author",
"CHRISTENSEN");
155 gse->
SetKey(
"comment",
"We present 1/N dNch/deta over widest possible eta region at the LHC");
156 gse->
SetKey(
"dscomment",
"The pseudo-rapidity density of charged particle");
161 if (trg.EqualTo(
"INEL>0")) trg =
"INELGt0";
162 TString dir(Form(
"out/%s/%05d/%s", system.Data(),
164 gSystem->Exec(Form(
"mkdir -p %s", dir.Data()));
166 TFile*
file = TFile::Open(Form(
"%s/%s.root",
170 Info(
"",
"Writing to %s", file->GetPath());
179 TMultiGraph* axis = gse->
GetMulti();
180 frame = axis->GetHistogram();
181 frame->SetMinimum(0.1);
182 frame->SetMaximum(frame->GetMaximum()*1.1);
183 frame->GetYaxis()->SetTitleOffset(1.4);
190 if (other) other->Draw(
"p");
195 um->SetUniqueID(trigLegTitle.IsNull() ? kRed+2 : kBlack);
204 ltx->SetTextAlign(23);
205 ltx->SetTextSize(0.04);
208 if (!gROOT->GetClass(
"AliceLogo"))
209 gROOT->LoadMacro(
"AliceLogo.C+");
211 if (gROOT->GetClass(
"AliceLogo")) {
214 gROOT->ProcessLine(
"AliceLogo* al = new AliceLogo();");
215 gROOT->ProcessLine(Form(
"al->Draw(0,%f,%f,%f, 0, 0xf);", lx1,ly1,ldy));
220 TString base(Form(
"%s_%04d_%s", system.Data(), sNN, trigger.Data()));
221 TString outName(Form(
"%s.root", base.Data()));
222 TFile* out = TFile::Open(outName.Data(),
"RECREATE");
225 Info(
"",
"Wrote to %s.root", base.Data());
230 c->Print(Form(
"%s.pdf", base.Data()));
231 c->Print(Form(
"%s.png", base.Data()));
232 c->SaveAs(Form(
"%s_canvas.root", base.Data()));
235 if (trigLegTitle.IsNull() || !alsoLog)
return;
237 frame->SetMinimum(5);
238 frame->SetMaximum(3*frame->GetMaximum());
243 c->Print(Form(
"%s_logy.pdf", base.Data()));
244 c->Print(Form(
"%s_logy.png", base.Data()));
void Draw(Option_t *option="")
virtual GraphSysErr * Make(TH1 *h, TLegend *l, Double_t eff=1, Bool_t verb=false)
static TPair * GetDataOther(TLegend *leg, TObjArray &unique, const TString &system, UShort_t sNN, const char **trigs, const char **exps, Option_t *errOpt="e5", Bool_t rebinned=false, Bool_t empirical=true, const Double_t *effs=0)
void SetKey(const char *key, const char *value, Bool_t replace=false)
static TLatex * MakeTitle(Double_t x, Double_t y, const TString &system, UShort_t sNN, const TString &trigger)
void SetTitle(const char *name)
void WithSysError(const TString &system, UShort_t sNN, TString &trigger, const Option_t *option="e5", Bool_t rebinned=true, Bool_t export=true, Bool_t empirical=true, Bool_t alsoLog=true)
TMultiGraph * GetMulti(Option_t *option="")
const char * GetKey(const char *key) const
TFile * file
TList with histograms for a given trigger.
virtual const char * GetTriggerString() const
static TLegend * MakeUniqueLegend(Double_t x1, Double_t y1, Double_t x2, Double_t y2, TObjArray &unique, Int_t nSNN)