2 #include <TGraphAsymmErrors.h>
14 TString fname(Form(
"%s_%04d.root", trig.Data(), sNN));
15 TFile*
file = TFile::Open(fname.Data(),
"READ");
17 Error(
"",
"Failed to open %s", fname.Data());
22 if (objName ==
"INELGt0") objName =
"INELg0";
24 TObject* o = file->Get(objName);
26 Error(
"",
"Failed to find %s in %s", objName.Data(), fname.Data());
31 if (!o->IsA()->InheritsFrom(TGraphAsymmErrors::Class())) {
32 Error(
"",
"%s is not a TGraphAsymmErrors, but a %s",
33 objName.Data(), o->ClassName());
45 o <<
" Double_t " << name <<
"[] = {";
46 Int_t n = last-first+1;
47 for (
Int_t i = 0; i < n; i++) {
50 if (i % 5 == 0) o <<
"\n ";
54 o <<
"};" << std::endl;
62 o <<
"// sNN=" << sNN <<
" trig=" << trig << std::endl;
64 Int_t maxN = src->GetN();
73 for (
Int_t i = 0; i < maxN; i++) {
76 if (first < 0) first = i;
79 if (first < 0 || last < 0) {
80 Warning(
"",
"No points found for %d/%s", sNN, trig.Data());
83 Int_t n = last-first+1;
84 Printf(
"Got %d-%d+1=%d non-zero points for %s",
85 last,first,last-first+1, src->GetName());
87 o <<
" if (sNN==" << sNN <<
" && trg.EqualTo(\"" << trig <<
"\",TString::kIgnoreCase)) {\n"
89 <<
" const Int_t n = " << n <<
";" << std::endl;
98 if (otrg.EqualTo(
"INEL")) otrg =
"Inel";
99 else if (otrg.EqualTo(
"NSD")) otrg =
"Nsd";
100 else if (otrg.EqualTo(
"INELGt0")) otrg =
"InelGt0";
102 o <<
" TGraphAsymmErrors* g = new TGraphAsymmErrors(" << n <<
",x,y,xel,xeh,yel,yeh);\n"
103 <<
" SetGraphAttributes(g," << trig <<
",WIP,false,\n"
104 <<
" \"alice_pp" << sNN << otrg <<
"Work\",\n"
105 <<
" \"PWG-UD/MULT - " << date <<
"\");\n"
114 std::ofstream o(
"PWGUD.C");
116 o <<
"Int_t INEL = kRed+2;\n"
117 <<
"Int_t NSD = kGreen+2;\n"
118 <<
"Int_t INELGt0 = kBlue+2;\n"
119 <<
"Int_t WIP = 20;\n"
120 <<
"void SetGraphAttributes(TGraph* g, Int_t t, Int_t exp, bool b, const char* name, const char* title) {\n"
121 <<
" g->SetMarkerColor(t);\n"
122 <<
" g->SetMarkerStyle(exp);\n"
123 <<
" g->SetLineColor(t);\n"
124 <<
" g->SetFillColor(t);\n"
125 <<
" g->SetName(name);\n"
126 <<
" g->SetTitle(title);\n"
127 <<
" g->SetFillStyle(0);\n"
128 <<
" g->GetHistogram()->SetStats(kFALSE);\n"
129 <<
" g->GetHistogram()->SetXTitle(\"#eta\");\n"
130 <<
" g->GetHistogram()->SetYTitle(\"#frac{1}{N} #frac{dN_{ch}}{#eta}\");\n"
132 <<
"TGraphAsymmErrors* GetPWGUD(UShort_t sNN, const TString& trg)\n"
134 UShort_t aSNN[] = { 900, 2760, 7000, 8000, 0 };
135 const Char_t* aTrig[] = {
"INEL",
"NSD",
"INELGt0", 0 };
138 while ((*pSNN > 0)) {
139 const char** pTrig = aTrig;
147 o <<
" Warning(\"\",\"No data for sNN=%d and trig=%s\",sNN,trg.Data());\n"
151 <<
"TMultiGraph* PWGUD() {\n"
152 <<
" TMultiGraph* mg = new TMultiGraph();\n";
154 while ((*pSNN > 0)) {
155 const char** pTrig = aTrig;
157 o <<
" mg->Add(GetPWGUD(" << *pSNN <<
",\"" << *pTrig <<
"\"));\n";
163 <<
" mg->Draw(\"APL\");\n"
TFile * file
TList with histograms for a given trigger.