8 #include <TMultiGraph.h>
12 #include <TGraphErrors.h>
13 #include <TPrincipal.h>
17 Long_t p = gROOT->ProcessLine(Form(
"Drawer::GetStack(0, \"pp\", %d, "
18 "\"%s\", false, true)",
19 sNN, trigger.Data()));
20 THStack* s = (THStack*)p;
21 TList* l = s->GetHists();
25 while ((h = static_cast<TH1*>(n()))) {
27 if (m.EqualTo(
"dndetaForward_all"))
break;
32 case 900: h->SetTitle(
"900GeV"); h->SetMarkerColor(kRed+2);
break;
33 case 2760: h->SetTitle(
"2.76TeV"); h->SetMarkerColor(kGreen+2);
break;
34 case 7000: h->SetTitle(
"7TeV"); h->SetMarkerColor(kBlue+2);
break;
35 case 8000: h->SetTitle(
"8TeV"); h->SetMarkerColor(kBlack);
break;
50 Info(
"OneBin",
"Getting one bin %d,%p,%p,%p,%p,%p",
51 bin, h0900,h2760,h7000,h8000,tuple);
53 Double_t eta = h0900->GetXaxis()->GetBinCenter(bin);
54 Double_t w = h0900->GetXaxis()->GetBinWidth(bin);
55 Info(
"",
"Eta=%f +/- %f", eta, w);
56 Double_t e[] = { 900., 2760., 7000., 8000., 0 };
57 TH1* h[] = { h0900, h2760, h7000, h8000, 0 };
58 Float_t x[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
63 g->SetName(Form(
"eta%03d", bin));
64 g->SetTitle(Form(
"%f", eta));
65 g->SetMarkerStyle(bin % 10 + 20);
66 g->SetMarkerColor(bin % 6 + 2);
76 g->SetPoint(i, *pe, c);
77 g->SetPointError(i, w, v);
86 if (tuple) tuple->Fill(x);
87 if (i > 0) mg->Add(g);
97 fwd =
gSystem->ExpandPathName(
"$ALICE_PHYSICS/PWGLF/FORWARD/analysis2");
98 gROOT->SetMacroPath(Form(
"%s/dndeta:%s", gROOT->GetMacroPath(),
fwd));
100 if (!gROOT->GetClass(
"Drawer")) gROOT->LoadMacro(
"Drawer.C+");
106 Info(
"",
"900: %p 2760: %p 7000: %p 8000: %p",
107 h0900, h2760, h7000, h8000);
108 Double_t e8000 = (trigger.EqualTo(
"INEL") ? 0.852 : 0.93);
111 TFile* out = TFile::Open(
"trends.root",
"RECREATE");
112 THStack* sOrig =
new THStack(
"orig", Form(
"pp - %s", trigger.Data()));
118 TCanvas* cOrig =
new TCanvas(
"cOrig",
"Original", 1200, 1200);
119 cOrig->SetTopMargin(0.01);
120 cOrig->SetRightMargin(0.01);
121 sOrig->Draw(
"nostack");
122 sOrig->GetHistogram()->SetYTitle(
"1/#it{N} d#it{N}_{ch}/d#it{#eta}");
123 sOrig->GetHistogram()->SetXTitle(
"#it{#eta}");
124 sOrig->DrawClone(
"nostack");
127 TLegend* l = cOrig->BuildLegend(.35, .2, .55, .6,
"#sqrt{s}");
136 Info(
"",
"Wrote original");
138 TCanvas* cG =
new TCanvas(
"cG",
"one", 1200, 1200);
139 cG->SetTopMargin(0.01);
140 cG->SetRightMargin(0.01);
142 Info(
"",
"Creating tuple");
143 TNtuple* tuple =
new TNtuple(
"tuple",
"Tuple",
145 "v0900:e0900:v2760:e2760:"
146 "v7000:e7000:v8000:e8000");
147 TMultiGraph* mg =
new TMultiGraph;
148 Int_t n = h0900->GetNbinsX();
149 Info(
"",
"Loop over bins %d", n);
151 for (
Int_t i = 1; i <= n; i++) {
152 Info(
"",
"Getting one bin %d,%p,%p,%p,%p,%p,%p",
153 i, h0900,h2760,h7000,h8000,mg,tuple);
154 OneBin(i, h0900, h2760, h7000, h8000, mg, tuple);
162 TPrincipal* p =tuple->Principal(
"v0900:v2760:v7000:v8000",
"eta<0",
"npdhc");
TH1 * GetOne(UShort_t sNN, const TString &trigger)
void Interpolate(const TString &trigger="INEL")
void OneBin(Int_t bin, TH1 *h0900, TH1 *h2760, TH1 *h7000, TH1 *h8000, TMultiGraph *mg, TNtuple *tuple, Double_t sysErr=0.076)