]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/OtherData.C
Renames and new scripts
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / OtherData.C
1 /**
2  * @file 
3  * 
4  * @ingroup pwg2_forward_scripts
5  */
6 #include <TGraphAsymmErrors.h>
7 #include <TMultiGraph.h>
8 #include <TStyle.h>
9 #include <TMath.h>
10 #include <TCanvas.h>
11 #include <TLegend.h>
12
13 //____________________________________________________________________
14 /**
15  * @defgroup pwg2_forward_otherdata  External data 
16  *
17  * @ingroup pwg2_forward_scripts
18  */
19 //____________________________________________________________________
20 /**
21  * Values used 
22  * 
23  * @ingroup pwg2_forward_otherdata 
24  */
25 enum { 
26   /** Color used for UA5 data */
27   UA5Color   = kBlue+1,
28   /** Color used for CMS data */
29   CMSColor   = kGreen+1,
30   /** Color used for ALICE data */
31   ALICEColor = kMagenta+1,
32   /** Marker style INEL data */
33   INELStyle  = 20,
34   /** Marker style INEL>0 data */
35   INELGtStyle= 22,
36   /** Marker style NSD data */
37   NSDStyle   = 21,
38   /** Colour offset for mirror data */
39   MirrorOff  = 4
40 };
41
42 //____________________________________________________________________
43 /** 
44  * Set graph attributes 
45  * 
46  * @param g        Graph
47  * @param marker   Marker style 
48  * @param color    Marker and line color
49  * @param name     Name of graph 
50  * @param title    Title of graph 
51  * 
52  * @ingroup pwg2_forward_otherdata
53  */
54 void
55 SetGraphAttributes(TGraph* g, Int_t marker, Int_t color,
56                    const Char_t* name, const Char_t* title)
57 {
58   g->SetName(name);
59   g->SetTitle(title);
60   g->SetMarkerStyle(marker);
61   g->SetMarkerColor(color);
62   g->SetLineColor(color);
63   g->SetFillColor(0);
64   g->SetFillStyle(0);
65   g->GetHistogram()->SetStats(kFALSE);
66   g->GetHistogram()->SetXTitle("#eta");
67   g->GetHistogram()->SetYTitle("#frac{1}{N} #frac{dN_{ch}}{#eta}");
68 }
69
70 //____________________________________________________________________
71 /** 
72  * Get the UA5 NSD data for pp at @f$ \sqrt{s} = 900GeV@f$
73  * p7886_d1x1y4 - Z.Phys.C33:1-6,1986.
74  *
75  * @param mirrored Wether to produce the mirrored plot 
76  * 
77  * @return graph of data 
78  * 
79  * @ingroup pwg2_forward_otherdata
80  */
81 TGraphAsymmErrors* UA5Nsd(Bool_t mirrored=false) 
82 {
83   //UA5 data NSD - p7886_d1x1y4 - Z.Phys.C33:1-6,1986.
84   double x[] = { 0.125, 0.375, 0.625, 0.875, 1.125, 1.375, 1.625, 1.875, 2.125, 
85                  2.375, 2.625, 2.875, 3.125, 3.375, 3.625, 3.875, 4.125, 4.375,
86                  4.625 };
87   double exm[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
88                    0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
89   double exp[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
90                    0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
91   double y[] = { 3.48, 3.38, 3.52, 3.68, 3.71, 3.86, 3.76, 3.66, 3.72, 
92                  3.69, 3.56, 3.41, 3.15, 3.09, 2.74, 2.73, 2.32, 1.99, 1.69 };
93   double eym[] = { 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 
94                    0.07, 0.07, 0.07, 0.07, 0.08, 0.08, 0.09, 0.09, 0.1, 0.13 };
95   double eyp[] = { 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 
96                    0.07, 0.07, 0.07, 0.07, 0.08, 0.08, 0.09, 0.09, 0.1, 0.13 };
97   const int np = 20;
98   double xm[np]; 
99   for (int i = 0; i < np; i++) xm[i] = -x[i];
100
101   TGraphAsymmErrors* g  = new TGraphAsymmErrors(19,x, y,exm,exp,eym,eyp);
102   TGraphAsymmErrors* gm = new TGraphAsymmErrors(19,xm,y,exm,exp,eym,eyp);
103   SetGraphAttributes(g,  NSDStyle, UA5Color,"ua5_nsd",         "UA5 NSD");
104   SetGraphAttributes(gm, NSDStyle+MirrorOff, UA5Color,"ua5_nsd_mirrored",
105                      "UA5 NSD (mirrored)");
106
107   return (mirrored ? gm : g);
108 }
109
110 //____________________________________________________________________
111 /** 
112  * Get the UA5 INEL data for pp at @f$ \sqrt{s} = 900GeV@f$
113  * p7886_d2x1y2 - Z.Phys.C33:1-6,1986.
114  *
115  * @param mirrored Wether to produce the mirrored plot 
116  * 
117  * @return graph of data 
118  * 
119  * @ingroup pwg2_forward_otherdata
120  */
121 TGraphAsymmErrors* UA5Inel(Bool_t mirrored=false) 
122 {
123   //UA5 data INEL - p7886_d2x1y2 - Z.Phys.C33:1-6,1986.
124   double x[] = { 0.125, 0.375, 0.625, 0.875, 1.125, 1.375, 1.625, 1.875, 2.125, 
125                  2.375, 2.625, 2.875, 3.125, 3.375, 3.625, 3.875, 4.125, 4.375,
126                  4.625 };
127   double exm[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
128                    0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
129   double exp[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 
130                    0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
131   double y[] = { 3.14, 3.04, 3.17, 3.33, 3.33, 3.53, 3.46, 3.41, 3.45, 
132                  3.39, 3.07, 3.07, 2.93, 2.93, 2.55, 2.48, 2.18, 1.91, 1.52 };
133   double eym[] = { 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 
134                    0.07, 0.07, 0.07, 0.07, 0.08, 0.08, 0.09, 0.09, 0.1, 0.13 };
135   double eyp[] = { 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 0.07, 
136                    0.07, 0.07, 0.07, 0.07, 0.08, 0.08, 0.09, 0.09, 0.1, 0.13 };
137   const int np = 19;
138   double xm[np]; 
139   for (int i = 0; i < np; i++) xm[i] = -x[i];
140   TGraphAsymmErrors* g  = new TGraphAsymmErrors(np,x, y,exm,exp,eym,eyp);
141   TGraphAsymmErrors* gm = new TGraphAsymmErrors(np,xm,y,exm,exp,eym,eyp);
142
143   SetGraphAttributes(g,  INELStyle, UA5Color, "ua5_inel", "UA5 INEL");
144   SetGraphAttributes(gm, INELStyle+MirrorOff, UA5Color, "ua5_inel_mirrored", 
145                      "UA5 INEL (mirrored)");
146   
147   return (mirrored ? gm : g);
148 }
149
150 //____________________________________________________________________
151 /** 
152  * Get the ALICE INEL data in @f$ |\eta|<1.3@f$ for pp at @f$ \sqrt{s}
153  * = 900GeV@f$ 
154  * p7742_d1x1y1 - Eur.Phys.J.C68:89-108,2010. 
155  *
156  * @return graph of data 
157  * 
158  * @ingroup pwg2_forward_otherdata
159  */
160 TGraphAsymmErrors* AliceCentralInel900()
161 {  
162   // INEL - p7742_d1x1y1 - Eur.Phys.J.C68:89-108,2010. 
163   TGraphAsymmErrors* g = 0;
164   double x[] = { -1.3, -1.1, -0.9, -0.7, -0.5, -0.3, 
165                                  -0.1, 0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3 };
166   double exm[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 
167                    0.1, 0.1, 0.1, 0.1, 0.1 };
168   double exp[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 
169                    0.1, 0.1, 0.1, 0.1, 0.1 };
170   double y[] = { 3.28, 3.28, 3.22, 3.12, 3.06, 3.02, 2.98, 3.02, 3.02, 
171                  3.05, 3.15, 3.21, 3.26, 3.33 };
172   double eym[] = { 0.06324555320336758, 0.06324555320336758, 
173                    0.06324555320336758, 0.06324555320336758, 
174                    0.06324555320336758, 0.05385164807134505, 
175                    0.05385164807134505, 0.05385164807134505, 
176                    0.05385164807134505, 0.06324555320336758, 
177                    0.06324555320336758, 0.06324555320336758, 
178                    0.06324555320336758, 0.06324555320336758 };
179   double eyp[] = { 0.08246211251235322, 0.08246211251235322, 
180                    0.08246211251235322, 0.08246211251235322, 
181                    0.08246211251235322, 0.08246211251235322, 
182                    0.07280109889280519, 0.08246211251235322, 
183                    0.08246211251235322, 0.08246211251235322, 
184                    0.08246211251235322, 0.08246211251235322, 
185                    0.08246211251235322, 0.08246211251235322 };
186   const int np = 14;
187   for (int i = 0; i < np; i++) { 
188     eym[i] += 0.02;
189     eyp[i] += 0.02;
190   }
191   g = new TGraphAsymmErrors(np, x, y, exm, exp, eym, eyp);
192   SetGraphAttributes(g, INELStyle, ALICEColor, "alice_inel", 
193                      "ALICE INEL (publ.)");
194
195   return g;
196 }
197
198 //____________________________________________________________________
199 /** 
200  * Get the ALICE INEL>0 data in @f$ |\eta|<1.3@f$ for pp at @f$
201  * \sqrt{s} = 900GeV@f$ 
202  *
203  * p7741_d4x1y1 - Eur.Phys.J.C68:345-354,2010. 
204  *
205  * @return graph of data 
206  * 
207  * @ingroup pwg2_forward_otherdata
208  */
209 TGraphAsymmErrors* AliceCentralInelGt900()
210 {  
211   // INEL>0 - p7741_d4x1y1 - Eur.Phys.J.C68:345-354,2010. 
212   double x[] = { -0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 0.5, 0.7, 
213     0.9 };
214   double exm[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 
215     0.1 };
216   double exp[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 
217     0.1 };
218   double y[] = { 4.0, 3.87, 3.8, 3.7, 3.67, 3.73, 3.72, 3.77, 3.92, 
219     4.01 };
220   double eym[] = { 0.07615773105863909, 0.07615773105863909, 
221                    0.07615773105863909, 0.06324555320336758, 
222                    0.06324555320336758, 0.06324555320336758, 
223                    0.0670820393249937, 0.07615773105863909, 
224                    0.07615773105863909, 0.07615773105863909 };
225   double eyp[] = { 0.08544003745317531, 0.07615773105863909, 
226                    0.07615773105863909, 0.07280109889280519, 
227                    0.07280109889280519, 0.07280109889280519, 
228                    0.07615773105863909, 0.07615773105863909, 
229                    0.08544003745317531, 0.08544003745317531 };
230   const int np = 10;
231   for (int i = 0; i < np; i++) { 
232     double stat = (i >= 3  && i<=5) ? 0.02 : 0.03;
233     eym[i] += stat;
234     eyp[i] += stat;
235   }
236
237   TGraphAsymmErrors* g = new TGraphAsymmErrors(np, x, y, exm, exp, eym, eyp);
238   SetGraphAttributes(g, INELGtStyle, ALICEColor, "alice_inelgt900", 
239                      "ALICE INEL>0 (publ.)");
240   return g;
241
242 }
243
244 //____________________________________________________________________
245 /** 
246  * Get the ALICE INEL>0 data in @f$ |\eta|<0.9@f$ for pp at @f$
247  * \sqrt{s} = 2.36TeV@f$ 
248  *
249  * p7741_d5x1y1 - Eur.Phys.J.C68:345-354,2010. 
250  *
251  * @return graph of data 
252  * 
253  * @ingroup pwg2_forward_otherdata
254  */
255 TGraphAsymmErrors* AliceCentralInelGt2360()
256 {  
257   // INEL>0 - p7741_d5x1y1 - Eur.Phys.J.C68:345-354,2010. 
258   double x[] = { -0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 0.5, 0.7, 0.9 };
259   double exm[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 };
260   double exp[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 };
261   double y[] = { 4.91, 4.76, 4.63, 4.64, 4.55, 4.55, 4.64, 4.66, 4.82, 4.88 };
262   double eym[] = { 0.08544003745317531, 0.08544003745317531, 
263                    0.08544003745317531, 0.08544003745317531, 
264                    0.08544003745317531, 0.08544003745317531, 
265                    0.08544003745317531, 0.08544003745317531, 
266                    0.08544003745317531, 0.08544003745317531 };
267   double eyp[] = { 0.11401754250991379, 0.11401754250991379, 
268                    0.1044030650891055, 0.1044030650891055, 
269                    0.1044030650891055, 0.1044030650891055, 
270                    0.1044030650891055, 0.1044030650891055, 
271                    0.11401754250991379, 0.11401754250991379 };
272   const int np = 10;
273   for (int i = 0; i < np; i++) { 
274     double stat = 0.3;
275     eym[i] += stat;
276     eyp[i] += stat;
277   }
278
279   TGraphAsymmErrors* g = new TGraphAsymmErrors(np, x, y, exm, exp, eym, eyp);
280   SetGraphAttributes(g, INELGtStyle, ALICEColor, "alice_inelgt2360", 
281                      "ALICE INEL>0 (publ.)");
282   return g;
283 }
284
285 //____________________________________________________________________
286 /** 
287  * Get the ALICE INEL>0 data in @f$ |\eta|<0.9@f$ for pp at @f$
288  * \sqrt{s} = 7TeV@f$ 
289  *
290  * p7741_d6x1y1 - Eur.Phys.J.C68:345-354,2010. 
291  *
292  * @return graph of data 
293  * 
294  * @ingroup pwg2_forward_otherdata
295  */
296 TGraphAsymmErrors* AliceCentralInelGt7000()
297 {  
298   // INEL>0 - p7741_d6x1y1 - Eur.Phys.J.C68:345-354,2010. 
299 // Plot: p7741_d6x1y1
300   double x[] = { -0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 0.5, 0.7, 0.9 };
301   double exm[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 };
302   double exp[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 };
303   double y[] = { 6.22, 6.07, 6.01, 5.84, 5.85, 5.85, 5.91, 6.01, 6.17, 6.26 };
304   double eym[] = { 0.1216552506059644, 0.1216552506059644, 
305                    0.1216552506059644, 0.11180339887498948, 
306                    0.11180339887498948, 0.11180339887498948, 
307                    0.11180339887498948, 0.1216552506059644, 
308                    0.1216552506059644, 0.1216552506059644 };
309   double eyp[] = { 0.21095023109728983, 0.21095023109728983, 
310                    0.2009975124224178, 0.2009975124224178, 
311                    0.2009975124224178, 0.2009975124224178, 
312                    0.2009975124224178, 0.2009975124224178, 
313                    0.21095023109728983, 0.21095023109728983 };
314   const int np = 10;
315   for (int i = 0; i < np; i++) { 
316     double stat = 0.2;
317     eym[i] += stat;
318     eyp[i] += stat;
319   }
320
321   TGraphAsymmErrors* g = new TGraphAsymmErrors(np, x, y, exm, exp, eym, eyp);
322   SetGraphAttributes(g, INELGtStyle, ALICEColor, "alice_inelgt7000", 
323                      "ALICE INEL>0 (publ.)");
324   return g;
325 }
326
327 //____________________________________________________________________
328 /** 
329  * Get the ALICE NSD data in @f$ |\eta|<1.3@f$ for pp at @f$
330  * \sqrt{s} = 900GeV@f$ 
331  *
332  * p7742_d2x1y1 - Eur.Phys.J.C68:89-108,2010. 
333  *
334  * @return graph of data 
335  * 
336  * @ingroup pwg2_forward_otherdata
337  */
338 TGraphAsymmErrors* AliceCentralNsd900()
339 {
340   //NSD - p7742_d2x1y1 - Eur.Phys.J.C68:89-108,2010. 
341   double x[] = { -1.3, -1.1, -0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 
342                  0.5, 0.7, 0.9, 1.1, 1.3 };
343   double exm[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 
344                    0.1, 0.1, 0.1, 0.1, 0.1 };
345   double exp[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 
346                    0.1, 0.1, 0.1, 0.1, 0.1 };
347   double y[] = { 3.9, 3.89, 3.81, 3.7, 3.64, 3.59, 3.53, 3.58, 3.59, 
348                  3.61, 3.74, 3.8, 3.87, 3.95 };
349   double eym[] = { 0.13341664064126335, 0.13152946437965907, 
350                    0.13152946437965907, 0.1216552506059644, 
351                    0.1216552506059644, 0.1216552506059644, 
352                    0.1216552506059644, 0.1216552506059644, 
353                    0.1216552506059644, 0.1216552506059644, 
354                    0.1216552506059644, 0.13152946437965907, 
355                    0.13152946437965907, 0.13341664064126335 };
356   double eyp[] = { 0.13341664064126335, 0.13152946437965907, 
357                    0.13152946437965907, 0.1216552506059644, 
358                    0.1216552506059644, 0.1216552506059644, 
359                    0.1216552506059644, 0.1216552506059644, 
360                    0.1216552506059644, 0.1216552506059644, 
361                    0.1216552506059644, 0.13152946437965907, 
362                    0.13152946437965907, 0.13341664064126335 };
363   const int np = 14;
364   for (int i = 0; i < np; i++) { 
365     double stat = (i == 0 || i == np-1) ? 0.03 : 0.02;
366     eym[i] += stat;
367     eyp[i] += stat;
368   }
369
370   TGraphAsymmErrors* g = new TGraphAsymmErrors(np, x, y, exm, exp, eym, eyp);
371   SetGraphAttributes(g, NSDStyle, ALICEColor, "alice_nsd", "ALICE NSD (publ.)");
372
373   return g;
374 }
375
376 //____________________________________________________________________
377 /** 
378  * Get the ALICE INEL data in @f$ |\eta|<1.3@f$ for pp at @f$
379  * \sqrt{s} = 2.36TeV@f$ 
380  *
381  * p7742_d3x1y1 - Eur.Phys.J.C68:89-108,2010. 
382  *
383  * @return graph of data 
384  * 
385  * @ingroup pwg2_forward_otherdata
386  */
387 TGraphAsymmErrors* AliceCentralInel2360()
388 {  
389   // INEL - p7742_d3x1y1 - Eur.Phys.J.C68:89-108,2010. 
390   double x[] = { -1.3, -1.1, -0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 
391                  0.5, 0.7, 0.9, 1.1, 1.3 };
392   double exm[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 
393                    0.1, 0.1, 0.1, 0.1, 0.1 };
394   double exp[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 
395                    0.1, 0.1, 0.1, 0.1, 0.1 };
396   double y[] = { 4.08, 4.01, 4.0, 3.88, 3.77, 3.8, 3.73, 3.71, 3.79, 
397                  3.82, 3.94, 4.02, 4.05, 4.16 };
398   double eym[] = { 0.13341664064126335, 0.12369316876852982, 
399                    0.12369316876852982, 0.1216552506059644, 
400                    0.1216552506059644, 0.1216552506059644, 
401                    0.1216552506059644, 0.11180339887498948, 
402                    0.1216552506059644, 0.1216552506059644, 
403                    0.12369316876852982, 0.12369316876852982, 
404                    0.13341664064126335, 0.13341664064126335 };
405   double eyp[] = { 0.2716615541441225, 0.2716615541441225, 
406                    0.2716615541441225, 0.260768096208106, 
407                    0.25079872407968906, 0.25079872407968906, 
408                    0.25079872407968906, 0.25079872407968906, 
409                    0.25079872407968906, 0.260768096208106, 
410                    0.261725046566048, 0.2716615541441225, 
411                    0.2716615541441225, 0.2816025568065745 };
412   const int np = 14;
413   for (int i = 0; i < np; i++) { 
414     double stat = (i < 3  || i > np-1-4) ? 0.03 : 0.02;
415     eym[i] += stat;
416     eyp[i] += stat;
417   }
418
419   TGraphAsymmErrors* g = new TGraphAsymmErrors(np, x, y, exm, exp, eym, eyp);
420   SetGraphAttributes(g, NSDStyle, ALICEColor, "alice_inel2360", 
421                      "ALICE INEL (publ.)");
422   return g;
423 }
424
425 //____________________________________________________________________
426 /** 
427  * Get the ALICE NSD data in @f$ |\eta|<1.3@f$ for pp at @f$
428  * \sqrt{s} = 2.36TeV@f$ 
429  *
430  * p7742_d4x1y1 - Eur.Phys.J.C68:89-108,2010. 
431  *
432  * @return graph of data 
433  * 
434  * @ingroup pwg2_forward_otherdata
435  */
436 TGraphAsymmErrors* AliceCentralNsd2360()
437 {  
438   // NSD - p7742_d4x1y1 - Eur.Phys.J.C68:89-108,2010. 
439   double x[] = { -1.3, -1.1, -0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3, 
440                  0.5, 0.7, 0.9, 1.1, 1.3 };
441   double exm[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 
442                    0.1, 0.1, 0.1, 0.1, 0.1 };
443   double exp[] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 
444                    0.1, 0.1, 0.1, 0.1, 0.1 };
445   double y[] = { 4.79, 4.72, 4.7, 4.56, 4.44, 4.47, 4.39, 4.37, 4.47, 
446     4.5, 4.64, 4.73, 4.76, 4.9 };
447   double eym[] = { 0.13601470508735444, 0.13341664064126335, 
448                    0.13341664064126335, 0.12369316876852982, 
449                    0.12369316876852982, 0.12369316876852982, 
450                    0.12369316876852982, 0.12369316876852982, 
451                    0.12369316876852982, 0.12369316876852982,
452                    0.12369316876852982, 0.13341664064126335,
453                    0.13341664064126335, 0.13341664064126335 };
454   double eyp[] = { 0.18439088914585774, 0.18248287590894657,
455                    0.18248287590894657, 0.1726267650163207,
456                    0.1726267650163207, 0.1726267650163207, 
457                    0.16278820596099708, 0.16278820596099708, 
458                    0.1726267650163207, 0.1726267650163207, 
459                    0.1726267650163207, 0.18248287590894657, 
460                    0.18248287590894657, 0.18248287590894657 };
461   const int np = 14;
462   
463   for (int i = 0; i < np; i++) { 
464     double stat = (i < 1) ? 0.03 : 0.02;
465     eym[i] += stat;
466     eyp[i] += stat;
467   }
468
469   TGraphAsymmErrors* g = new TGraphAsymmErrors(np, x, y, exm, exp, eym, eyp);
470   SetGraphAttributes(g, NSDStyle, ALICEColor, "alice_nsd2360", 
471                      "ALICE NSD (publ.)");
472   return g;
473 }
474
475   
476 //____________________________________________________________________
477 /** 
478  * Get the CMS NSD data in @f$ |\eta|<2.25@f$ for pp at @f$
479  * \sqrt{s} = 900GeV@f$ 
480  *
481  * p7743_d8x1y1
482  *
483  * @return graph of data 
484  * 
485  * @ingroup pwg2_forward_otherdata
486  */
487 TGraphAsymmErrors* CMSNsd900()
488 {
489   // CMS published NSD data - p7743_d8x1y1
490   double x[] = { -2.25, -1.75, -1.25, -0.75, -0.25, 0.25, 0.75, 1.25, 1.75, 
491     2.25 };
492   double exm[] = { 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25 };
493   double exp[] = { 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25 };
494   double y[] = { 3.6, 3.73, 3.62, 3.54, 3.48, 3.48, 3.54, 3.62, 3.73,  3.6 };
495   double eym[] = { 0.13, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.14,0.13 };
496   double eyp[] = { 0.13, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.14, 0.13 };
497   const int np = 10;
498   TGraphAsymmErrors* g = new TGraphAsymmErrors(np, x, y, exm, exp, eym, eyp);
499   SetGraphAttributes(g, NSDStyle, CMSColor, "cms_nsd900", "CMS NSD");
500
501   return g;
502 }
503
504
505 //____________________________________________________________________
506 /** 
507  * Get the CMS NSD data in @f$ |\eta|<2.25@f$ for pp at @f$
508  * \sqrt{s} = 2.36GeV@f$ 
509  *
510  * p7743_d8x1y2
511  *
512  * @return graph of data 
513  * 
514  * @ingroup pwg2_forward_otherdata
515  */
516 TGraphAsymmErrors* CMSNsd2360()
517 {
518   // CMS NSD 2360 - p7743_d8x1y2
519   double x[] = { -2.25, -1.75, -1.25, -0.75, -0.25, 0.25, 0.75,1.25,1.75,2.25 };
520   double exm[] = { 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25 };
521   double exp[] = { 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25 };
522   double y[] = { 4.78, 4.81, 4.66, 4.61, 4.47, 4.47, 4.61, 4.66, 4.81,  4.78 };
523   double eym[] = { 0.17, 0.18, 0.17, 0.17, 0.16, 0.16, 0.17, 0.17, 0.18, 0.17 };
524   double eyp[] = { 0.17, 0.18, 0.17, 0.17, 0.16, 0.16, 0.17, 0.17, 0.18, 0.17 };
525   const int np = 10;
526   TGraphAsymmErrors* g = new TGraphAsymmErrors(np, x, y, exm, exp, eym, eyp);
527   SetGraphAttributes(g, NSDStyle, CMSColor, "cms_nsd2360", "CMS NSD");
528   return g;
529 }
530
531
532 //____________________________________________________________________
533 /** 
534  * Get the CMS NSD data in @f$ |\eta|<2.25@f$ for pp at @f$
535  * \sqrt{s} = 7TeV@f$ 
536  *
537  * p7838_d5x1y1
538  *
539  * @return graph of data 
540  * 
541  * @ingroup pwg2_forward_otherdata
542  */
543 TGraphAsymmErrors* CMSNsd7000()
544 {
545   // CMS NSD 7000 - Plot: p7838_d5x1y1
546   double x[] = { -2.25, -1.75, -1.25, -0.75, -0.25, 0.25, 0.75,1.25,1.75,2.25 };
547   double exm[] = { 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25 };
548   double exp[] = { 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25 };
549   double y[] = { 6.18, 6.26, 6.14, 6.01, 5.78, 5.78, 6.01, 6.14, 6.26,  6.18 };
550   double eym[] = { 0.25, 0.25, 0.24, 0.24, 0.23, 0.23, 0.24, 0.24, 0.25, 0.25 };
551   double eyp[] = { 0.25, 0.25, 0.24, 0.24, 0.23, 0.23, 0.24, 0.24, 0.25, 0.25 };
552   const int np = 10;
553   TGraphAsymmErrors* g = new TGraphAsymmErrors(np, x, y, exm, exp, eym, eyp);
554   SetGraphAttributes(g, NSDStyle, CMSColor, "cms_nsd7000", "CMS NSD");
555   return g;
556 }
557
558 //____________________________________________________________________
559 /** 
560  * Get a multi graph of data for a given energy and trigger type 
561  * 
562  * @param energy Energy in GeV (900, 2360, 7000)
563  * @param type   Bit pattern of trigger type 
564  *   - 0x1 INEL 
565  *   - 0x2 INEL>0
566  *   - 0x4 NSD 
567  * 
568  * @return A multi graph with the selected data. 
569  * 
570  * @ingroup pwg2_forward_otherdata
571  */
572 TMultiGraph* 
573 GetData(Int_t energy, Int_t type)
574 {
575   TMultiGraph* mp = new TMultiGraph(Form("dndeta_%dGeV_%d", energy, type),"");
576   TString tn;
577   TString en;
578   if (TMath::Abs(energy-900) < 10) {
579     en.Append(" #sqrt{s}=900GeV");
580     if (type & 0x1) { 
581       tn.Append(" INEL");
582       mp->Add(UA5Inel(false));
583       mp->Add(UA5Inel(true));
584       mp->Add(AliceCentralInel900());
585     }      
586     if (type & 0x4) { 
587       tn.Append(" NSD");
588       mp->Add(UA5Nsd(false));
589       mp->Add(UA5Nsd(true));
590       mp->Add(AliceCentralNsd900());
591       mp->Add(CMSNsd900());
592     }
593     if (type & 0x2) { 
594       tn.Append(" INEL>0");
595       mp->Add(AliceCentralInelGt900());
596     }
597   }
598   if (TMath::Abs(energy-2360) < 10) {
599     en.Append(" #sqrt{s}=2.36TeV");
600     if (type & 0x1) { 
601       tn.Append(" INEL");
602       mp->Add(AliceCentralInel2360());
603     }
604     if (type & 0x4) { 
605       tn.Append(" NSD");
606       mp->Add(AliceCentralNsd2360());
607       mp->Add(CMSNsd2360());
608     }
609     if (type & 0x1) { 
610       tn.Append(" INEL>0");
611       mp->Add(AliceCentralInelGt2360());
612     }
613   }
614   if (TMath::Abs(energy-7000) < 10) {
615     en.Append(" #sqrt{s}=7TeV");
616     if (type & 0x1) { 
617       tn.Append(" INEL");
618     }
619     if (type & 0x4) { 
620       tn.Append(" NSD");
621       mp->Add(CMSNsd7000());
622     }
623     if (type & 0x1) { 
624       tn.Append(" INEL>0");
625       mp->Add(AliceCentralInelGt7000());
626     }
627   }
628   mp->SetTitle(Form("1/N dN_{ch}/d#eta, pp(p#bar{p}), %s, %s", 
629                     en.Data(), tn.Data()));
630   if (!mp->GetListOfGraphs() || mp->GetListOfGraphs()->GetEntries() <= 0) {
631     delete mp;
632     mp = 0;
633   }
634   return mp;
635 }
636
637 //____________________________________________________________________
638 /** 
639  * Plot external data for a given selection of energy and trigger type
640  * (see GetData)
641  * 
642  * @param energy  Energy in GeV
643  * @param type    Trigger type bit mask 
644  * 
645  * @ingroup pwg2_forward_otherdata
646  */
647 void
648 OtherData(Int_t energy=900, Int_t type=0x1)
649 {
650   TMultiGraph* mp = GetData(energy, type);
651   if (!mp) return;
652
653   gStyle->SetTitleX(0.1);
654   gStyle->SetTitleY(1.0);
655   gStyle->SetTitleW(0.85);
656   gStyle->SetTitleH(0.05);
657   gStyle->SetTitleBorderSize(0);
658   gStyle->SetTitleTextColor(kWhite);
659   gStyle->SetTitleFillColor(kBlack);
660   gStyle->SetTitleFontSize(0.02);
661   
662   gStyle->SetOptTitle(1);
663   gStyle->SetOptStat(0);
664   
665   TCanvas* c = new TCanvas("c", "dN/deta", 800, 600);
666   c->SetFillColor(0);
667   c->SetBorderSize(0);
668   c->SetBorderMode(0);
669   c->SetRightMargin(0.05);
670   c->SetTopMargin(0.05);
671   
672
673   mp->SetMinimum(0);
674   mp->Draw("ap");
675   if (mp->GetXaxis())
676     mp->GetXaxis()->SetTitle("#eta");
677   if (mp->GetYaxis())
678     mp->GetYaxis()->SetTitle("#frac{1}{N} #frac{dN_{ch}}{#eta}");
679
680   TLegend* l = c->BuildLegend(0.3, 0.15, 0.7, 0.5);
681   l->SetFillColor(0);
682   l->SetBorderSize(0);
683
684   c->cd();
685 }
686
687 //____________________________________________________________________
688 //
689 // EOF
690 //