Class version updated.
[u/mrichter/AliRoot.git] / EVGEN / testPDF.C
CommitLineData
f72b7291 1 void testPDF(Double_t a = 208.)
2{
3// Dynamically link some shared libs
4 char parm[20][20];
5 Double_t val[20];
6//
7// Initialization
8//
9 printf("PDF initialized with: \n \n");
10 strncpy(parm[0], "NPTYPE\0", 20);
11 val[0] = 1.;
12 printf("%10s %13.3f \n", parm[0], val[0]);
13 strncpy(parm[1], "NGROUP\0", 20);
14 val[1] = 5.;
15 printf("%10s %13.3f\n", parm[1], val[1]);
16 strncpy(parm[2], "NSET\0", 20);
17 val[2] = 12.;
18 printf("%10s %13.3f\n", parm[2], val[2]);
19 strncpy(parm[3], "TMAS\0", 20);
20 val[3] = 175.;
21 printf("%10s %13.3f\n", parm[3], val[3]);
22 strncpy(parm[4], "NATYPE\0", 20);
23 val[4] = 4.;
24 printf("%10s %13.3f\n", parm[4], val[4]);
25 strncpy(parm[5], "NAGROUP\0", 20);
26 val[5] = 0.;
27 printf("%10s %13.3f\n", parm[5], val[5]);
28 strncpy(parm[6], "NASET\0", 20);
29 val[6] = 0.;
30 printf("%10s %13.3f\n", parm[6]);
31 AliStructFuncType::PdfSet(parm, val);
32//
33// Plots
34//
35// ================================================================
36// Pdf
37//
38 TCanvas *c1 = new TCanvas("c1","Gluon PDF",400,10,600,700);
39 TF1* f_gl_2 = new TF1("f_gl_2", pdf_gl, -6., 0., 2);
40 f_gl_2->SetParameter(0,2);
41 f_gl_2->SetParameter(1,a);
42 f_gl_2->SetMaximum(1000.);
43 f_gl_2->SetLineColor(1);
44 f_gl_2->Draw();
45
46 TF1* f_gl_5 = new TF1("f_gl_5", pdf_gl, -6., 0., 2);
47 f_gl_5->SetParameter(0,5);
48 f_gl_5->SetParameter(1,a);
49 f_gl_5->SetLineColor(2);
50 f_gl_5->Draw("Same");
51
52 TF1* f_gl_10 = new TF1("f_gl_10", pdf_gl, -6., 0., 2);
53 f_gl_10->SetParameter(0,10);
54 f_gl_10->SetParameter(1,a);
55 f_gl_10->SetLineColor(3);
56 f_gl_10->Draw("Same");
57
58 TF1* f_gl_50 = new TF1("f_gl_50", pdf_gl, -6., 0., 2);
59 f_gl_50->SetParameter(0,50);
60 f_gl_50->SetParameter(1,a);
61 f_gl_50->SetLineColor(4);
62 f_gl_50->Draw("Same");
63
64// ================================================================
65// Gluon Modification
66//
67 TCanvas *c2 = new TCanvas("c2","Gluon PDF Nucl. Mod.",400,10,600,700);
68
69 TF1* fmod_gl_2 = new TF1("fmod_gl_2", mod_gl, -6., 0., 2);
70 fmod_gl_2->SetParameter(0,2.);
71 fmod_gl_2->SetParameter(1,a);
72 fmod_gl_2->SetMaximum(1.5);
73 fmod_gl_2->SetLineColor(1);
74 fmod_gl_2->Draw();
75 fmod_gl_2->GetHistogram()->SetXTitle("log(x)");
76 fmod_gl_2->GetHistogram()->SetYTitle("F^{g}_{A}/F^{g}_{p}");
77
78 TF1* fmod_gl_5 = new TF1("fmod_gl_5", mod_gl, -6., 0., 2);
79 fmod_gl_5->SetParameter(0,5.);
80 fmod_gl_5->SetParameter(1,a);
81 fmod_gl_5->SetLineColor(2);
82 fmod_gl_5->Draw("Same");
83
84 TF1* fmod_gl_10 = new TF1("fmod_gl_10", mod_gl, -6., 0., 2);
85 fmod_gl_10->SetParameter(0,10.);
86 fmod_gl_10->SetParameter(1,a);
87 fmod_gl_10->SetLineColor(3);
88 fmod_gl_10->Draw("Same");
89
90 TF1* fmod_gl_50 = new TF1("fmod_gl_50", mod_gl, -6., 0., 2);
91 fmod_gl_50->SetParameter(0,50.);
92 fmod_gl_50->SetParameter(1,a);
93 fmod_gl_50->SetLineColor(4);
94 fmod_gl_50->Draw("Same");
95 label();
96
97
98// =================================================================
99// Sea Quark Modification
100//
101 TCanvas *c3 = new TCanvas("c3","Sea Quark PDF Nucl. Mod.",400,10,600,700);
102 TF1* fmod_sq_2 = new TF1("fmod_sq_2", mod_sq, -6., 0., 2);
103 fmod_sq_2->SetParameter(0,2.);
104 fmod_sq_2->SetParameter(1,a);
105 fmod_sq_2->SetMaximum(1.5);
106 fmod_sq_2->SetLineColor(1);
107 fmod_sq_2->Draw();
108 fmod_sq_2->GetHistogram()->SetXTitle("log(x)");
109 fmod_sq_2->GetHistogram()->SetYTitle("F^{sea q}_{A}/F^{sea q}_{p}");
110
111 TF1* fmod_sq_5 = new TF1("fmod_sq_5", mod_sq, -6., 0., 2);
112 fmod_sq_5->SetParameter(0,5.);
113 fmod_sq_5->SetParameter(1,a);
114 fmod_sq_5->SetLineColor(2);
115 fmod_sq_5->Draw("Same");
116
117 TF1* fmod_sq_10 = new TF1("fmod_sq_10", mod_sq, -6., 0., 2);
118 fmod_sq_10->SetParameter(0,10.);
119 fmod_sq_10->SetParameter(1,a);
120 fmod_sq_10->SetLineColor(3);
121 fmod_sq_10->Draw("Same");
122
123 TF1* fmod_sq_50 = new TF1("fmod_sq_50", mod_sq, -6., 0., 2);
124 fmod_sq_50->SetParameter(0,50.);
125 fmod_sq_50->SetParameter(1,a);
126 fmod_sq_50->SetLineColor(4);
127 fmod_sq_50->Draw("Same");
128 label();
129
130// =================================================================
131// Valence Quark Modification
132//
133 TCanvas *c4 = new TCanvas("c4","Valence Quark PDF Nucl. Mod.",
134 400,10,600,700);
135 TF1* fmod_vq_2 = new TF1("fmod_vq_2", mod_vq, -6., 0., 2);
136 fmod_vq_2->SetParameter(0,2.);
137 fmod_vq_2->SetParameter(1,a);
138 fmod_vq_2->SetMaximum(1.5);
139 fmod_vq_2->SetLineColor(1);
140 fmod_vq_2->Draw();
141 fmod_vq_2->GetHistogram()->SetXTitle("log(x)");
142 fmod_vq_2->GetHistogram()->SetYTitle("F^{val q}_{A}/F^{val q}_{p}");
143
144 TF1* fmod_vq_5 = new TF1("fmod_vq_5", mod_vq, -6., 0., 2);
145 fmod_vq_5->SetParameter(0,5.);
146 fmod_vq_5->SetParameter(1,a);
147 fmod_vq_5->SetLineColor(2);
148 fmod_vq_5->SetMaximum(1.5);
149 fmod_vq_5->Draw("Same");
150
151 TF1* fmod_vq_10 = new TF1("fmod_vq_10", mod_vq, -6., 0., 2);
152 fmod_vq_10->SetParameter(0,10.);
153 fmod_vq_10->SetParameter(1,a);
154 fmod_vq_10->SetLineColor(3);
155 fmod_vq_10->SetMaximum(1.5);
156 fmod_vq_10->Draw("Same");
157
158 TF1* fmod_vq_50 = new TF1("fmod_vq_50", mod_vq, -6., 0., 2);
159 fmod_vq_50->SetParameter(0,50.);
160 fmod_vq_50->SetParameter(1,a);
161 fmod_vq_50->SetLineColor(4);
162 fmod_vq_50->SetMaximum(1.5);
163 fmod_vq_50->Draw("Same");
164 label();
165
166}
167
168
169Double_t pdf_gl(Double_t* x, Double_t* par)
170{
171 Double_t xx = TMath::Power(10.,x[0]);
172 Double_t y;
173 Double_t upv, dnv, usea, dsea, str, chm, bot, top, gl;
174 Double_t q = par[0];
175 Double_t a = par[1];
176
177 AliStructFuncType::StructA(xx, q, a, upv, dnv, usea,
178 dsea, str, chm, bot, top, gl);
179
180 y = gl;
181
182 return y;
183}
184
185Double_t mod_gl(Double_t* x, Double_t* par)
186{
187 Double_t xx = TMath::Power(10.,x[0]);
188 Double_t y;
189 Double_t upv, dnv, usea, dsea, str, chm, bot, top, gl;
190 Double_t q = par[0];
191 Double_t a = par[1];
192
193 AliStructFuncType::StructA(xx, q, a, upv, dnv, usea,
194 dsea, str, chm, bot, top, gl);
195
196 Double_t y1 = gl;
197
198 AliStructFuncType::StructA(xx, q, 1., upv, dnv, usea,
199 dsea, str, chm, bot, top, gl);
200
201 return y1/gl;
202}
203
204Double_t mod_sq(Double_t* x, Double_t* par)
205{
206 Double_t xx = TMath::Power(10.,x[0]);
207 Double_t y;
208 Double_t upv, dnv, usea, dsea, str, chm, bot, top, gl;
209 Double_t q = par[0];
210 Double_t a = par[1];
211
212 AliStructFuncType::StructA(xx, q, a, upv, dnv, usea,
213 dsea, str, chm, bot, top, gl);
214
215 Double_t y1 = usea+dsea;
216
217 AliStructFuncType::StructA(xx, q, 1., upv, dnv, usea,
218 dsea, str, chm, bot, top, gl);
219
220 return y1/(usea+dsea);
221}
222
223
224Double_t mod_vq(Double_t* x, Double_t* par)
225{
226 Double_t xx = TMath::Power(10.,x[0]);
227 Double_t y;
228 Double_t upv, dnv, usea, dsea, str, chm, bot, top, gl;
229 Double_t q = par[0];
230 Double_t a = par[1];
231
232 AliStructFuncType::StructA(xx, q, a, upv, dnv, usea,
233 dsea, str, chm, bot, top, gl);
234
235 Double_t y1 = upv+dnv;
236
237 AliStructFuncType::StructA(xx, q, 1., upv, dnv, usea,
238 dsea, str, chm, bot, top, gl);
239
240 return y1/(upv+dnv);
241}
242
243
244void label()
245{
246 TLine *line = new TLine(-5.7,1.4,-5.2,1.4);
247 line->SetLineColor(1);
248 line->SetLineWidth(3);
249 line->Draw();
250 tex = new TLatex(-5.1, 1.38,"Q = 2 GeV");
251 tex->SetTextSize(0.04);
252 tex->SetLineWidth(2);
253 tex->Draw();
254
255 TLine *line = new TLine(-5.7,1.3,-5.2,1.3);
256 line->SetLineColor(2);
257 line->SetLineWidth(3);
258 line->Draw();
259 tex = new TLatex(-5.1, 1.28,"Q = 5 GeV");
260 tex->SetTextSize(0.04);
261 tex->SetLineWidth(2);
262 tex->Draw();
263
264
265 TLine *line = new TLine(-5.7,1.2,-5.2,1.2);
266 line->SetLineColor(3);
267 line->SetLineWidth(3);
268 line->Draw();
269 tex = new TLatex(-5.1, 1.18,"Q = 10 GeV");
270 tex->SetTextSize(0.04);
271 tex->SetLineWidth(2);
272 tex->Draw();
273
274
275 TLine *line = new TLine(-5.7,1.1,-5.2,1.1);
276 line->SetLineColor(4);
277 line->SetLineWidth(3);
278 line->Draw();
279 tex = new TLatex(-5.1, 1.08,"Q = 50 GeV");
280 tex->SetTextSize(0.04);
281 tex->SetLineWidth(2);
282 tex->Draw();
283}
284
285
286