test object from the global name space removed
[u/mrichter/AliRoot.git] / HBTAN / AliHBTNonId3DCorrFctn.cxx
CommitLineData
cbcc22b0 1#include "AliHBTNonId3DCorrFctn.h"
2#include <TH1.h>
3#include <Riostream.h>
4
5///////////////////////////////////////////////////////
6// //
7// AliHBTNonId3DCorrFctn.h //
8// //
9// Class for calculating 3D non-id correlation //
10// functions //
11// //
12///////////////////////////////////////////////////////
13
14ClassImp(AliHBTNonId3DCorrFctn)
15
16AliHBTNonId3DCorrFctn::AliHBTNonId3DCorrFctn(const char* name, const char* title):
17 AliHBTOnePairFctn1D(name,title),
18 fNumOutP(0x0),
19 fDenOutP(0x0),
20 fRatOutP(0x0),
21 fNumOutN(0x0),
22 fDenOutN(0x0),
23 fRatOutN(0x0),
24 fRatOut(0x0),
25 fRatOutNOverP(0x0),
26 fNumSideP(0x0),
27 fDenSideP(0x0),
28 fRatSideP(0x0),
29 fNumSideN(0x0),
30 fDenSideN(0x0),
31 fRatSideN(0x0),
32 fRatSide(0x0),
33 fRatSideNOverP(0x0),
34 fNumLongP(0x0),
35 fDenLongP(0x0),
36 fRatLongP(0x0),
37 fNumLongN(0x0),
38 fDenLongN(0x0),
39 fRatLongN(0x0),
40 fRatLong(0x0),
41 fRatLongNOverP(0x0)
42{
43//ctor
44}
45/******************************************************************/
46AliHBTNonId3DCorrFctn::AliHBTNonId3DCorrFctn(const char* name, const char* title, Int_t nbins, Float_t maxXval, Float_t minXval):
47 AliHBTOnePairFctn1D(name,title,nbins,maxXval,minXval),
48 fNumOutP(0x0),
49 fDenOutP(0x0),
50 fRatOutP(0x0),
51 fNumOutN(0x0),
52 fDenOutN(0x0),
53 fRatOutN(0x0),
54 fRatOut(0x0),
55 fRatOutNOverP(0x0),
56 fNumSideP(0x0),
57 fDenSideP(0x0),
58 fRatSideP(0x0),
59 fNumSideN(0x0),
60 fDenSideN(0x0),
61 fRatSideN(0x0),
62 fRatSide(0x0),
63 fRatSideNOverP(0x0),
64 fNumLongP(0x0),
65 fDenLongP(0x0),
66 fRatLongP(0x0),
67 fNumLongN(0x0),
68 fDenLongN(0x0),
69 fRatLongN(0x0),
70 fRatLong(0x0),
71 fRatLongNOverP(0x0)
72{
73//ctor
74}
75
76/******************************************************************/
77AliHBTNonId3DCorrFctn::AliHBTNonId3DCorrFctn(const AliHBTNonId3DCorrFctn& in):
78 AliHBTOnePairFctn1D(in),
79 fNumOutP(0x0),
80 fDenOutP(0x0),
81 fRatOutP(0x0),
82 fNumOutN(0x0),
83 fDenOutN(0x0),
84 fRatOutN(0x0),
85 fRatOut(0x0),
86 fRatOutNOverP(0x0),
87 fNumSideP(0x0),
88 fDenSideP(0x0),
89 fRatSideP(0x0),
90 fNumSideN(0x0),
91 fDenSideN(0x0),
92 fRatSideN(0x0),
93 fRatSide(0x0),
94 fRatSideNOverP(0x0),
95 fNumLongP(0x0),
96 fDenLongP(0x0),
97 fRatLongP(0x0),
98 fNumLongN(0x0),
99 fDenLongN(0x0),
100 fRatLongN(0x0),
101 fRatLong(0x0),
102 fRatLongNOverP(0x0)
103{
104//ctor
105}
106
107/******************************************************************/
108
109AliHBTNonId3DCorrFctn::~AliHBTNonId3DCorrFctn()
110{
111 //dtor
112 delete fNumOutP;
113 delete fDenOutP;
114 delete fRatOutP;
115 delete fNumOutN;
116 delete fDenOutN;
117 delete fRatOutN;
118 delete fRatOut;
119 delete fRatOutNOverP;
120 delete fNumSideP;
121 delete fDenSideP;
122 delete fRatSideP;
123 delete fNumSideN;
124 delete fDenSideN;
125 delete fRatSideN;
126 delete fRatSide;
127 delete fRatSideNOverP;
128 delete fNumLongP;
129 delete fDenLongP;
130 delete fRatLongP;
131 delete fNumLongN;
132 delete fDenLongN;
133 delete fRatLongN;
134 delete fRatLong;
135 delete fRatLongNOverP;
136
137}
138
139/******************************************************************/
140void AliHBTNonId3DCorrFctn::WriteFunction()
141{
142
143 Double_t outPscale = Scale(fNumOutP,fDenOutP);
144 cout<<"outPscale = "<<outPscale<<endl;
145 fRatOutP->Divide(fNumOutP,fDenOutP,outPscale);
146
147 Double_t outNscale = Scale(fNumOutN,fDenOutN);
148 cout<<"outNscale = "<<outNscale<<endl;
149 fRatOutN->Divide(fNumOutN,fDenOutN,outNscale);
150
151 fRatOutNOverP->Divide(fRatOutN,fRatOutP);
152
153
154 Double_t sidePscale = Scale(fNumSideP,fDenSideP);
155 fRatSideP->Divide(fNumSideP,fDenSideP,sidePscale);
156
157 Double_t sideNscale = Scale(fNumSideN,fDenSideN);
158 fRatSideN->Divide(fNumSideN,fDenSideN,sideNscale);
159
160 fRatSideNOverP->Divide(fRatSideN,fRatSideP);
161
162
163 Double_t longPscale = Scale(fNumLongP,fDenLongP);
164 fRatLongP->Divide(fNumLongP,fDenLongP,longPscale);
165
166 Double_t longNscale = Scale(fNumLongN,fDenLongN);
167 fRatLongN->Divide(fNumLongN,fDenLongN,longNscale);
168
169 fRatLongNOverP->Divide(fRatLongN,fRatLongP);
170
171 fNumOutP->Write();
172 fDenOutP->Write();
173 fRatOutP->Write();
174 fNumOutN->Write();
175 fDenOutN->Write();
176 fRatOutN->Write();
177 fRatOut->Write();
178 fRatOutNOverP->Write();
179
180 fNumSideP->Write();
181 fDenSideP->Write();
182 fRatSideP->Write();
183 fNumSideN->Write();
184 fDenSideN->Write();
185 fRatSideN->Write();
186 fRatSide->Write();
187 fRatSideNOverP->Write();
188
189 fNumLongP->Write();
190 fDenLongP->Write();
191 fRatLongP->Write();
192 fNumLongN->Write();
193 fDenLongN->Write();
194 fRatLongN->Write();
195 fRatLong->Write();
196 fRatLongNOverP->Write();
197
198}
199
200//-------------------------------------
201void AliHBTNonId3DCorrFctn::ProcessSameEventParticles(AliHBTPair* pair)
202{
203 //Fills the numerator using pair from the same event
204 pair = CheckPair(pair);
205 if(pair == 0x0) return;
206
31aae134 207 double tKStar = TMath::Abs(pair->GetKStar());
cbcc22b0 208 double tKStarOut = pair->GetKStarOut();
209 double tKStarSide = pair->GetKStarSide();
210 double tKStarLong = pair->GetKStarLong();
211
212 if(tKStarOut>0.)
213 {
214 fNumOutP->Fill(tKStar);
215 }
216 else
217 {
218 fNumOutN->Fill(tKStar);
219 }
220
221 if(tKStarSide>0.)
222 {
223 fNumSideP->Fill(tKStar);
224 }
225 else
226 {
227 fNumSideN->Fill(tKStar);
228 }
229
230 if(tKStarLong>0.)
231 {
232 fNumLongP->Fill(tKStar);
233 }
234 else
235 {
236 fNumLongN->Fill(tKStar);
237 }
238}
239
240/****************************************************************/
241void AliHBTNonId3DCorrFctn::Init()
242{
243 AliHBTOnePairFctn1D::Init();
244 fNumOutP->Reset();
245 fDenOutP->Reset();
246 fRatOutP->Reset();
247 fNumOutN->Reset();
248 fDenOutN->Reset();
249 fRatOutN->Reset();
250 fRatOut->Reset();
251 fRatOutNOverP->Reset();
252
253 fNumSideP->Reset();
254 fDenSideP->Reset();
255 fRatSideP->Reset();
256 fNumSideN->Reset();
257 fDenSideN->Reset();
258 fRatSideN->Reset();
259 fRatSide->Reset();
260 fRatSideNOverP->Reset();
261
262 fNumLongP->Reset();
263 fDenLongP->Reset();
264 fRatLongP->Reset();
265 fNumLongN->Reset();
266 fDenLongN->Reset();
267 fRatLongN->Reset();
268 fRatLong->Reset();
269 fRatLongNOverP->Reset();
270}
271/****************************************************************/
272
273
274void AliHBTNonId3DCorrFctn::ProcessDiffEventParticles(AliHBTPair* pair)
275{
276
31aae134 277 double tKStar = TMath::Abs(pair->GetKStar());
cbcc22b0 278 double tKStarOut = pair->GetKStarOut();
279 double tKStarSide = pair->GetKStarSide();
280 double tKStarLong = pair->GetKStarLong();
281
282 if(tKStarOut>0.)
283 {
284 fDenOutP->Fill(tKStar);
285 }
286 else
287 {
288 fDenOutN->Fill(tKStar);
289 }
290
291 if(tKStarSide>0.)
292 {
293 fDenSideP->Fill(tKStar);
294 }
295 else
296 {
297 fDenSideN->Fill(tKStar);
298 }
299
300 if(tKStarLong>0.)
301 {
302 fDenLongP->Fill(tKStar);
303 }
304 else
305 {
306 fDenLongN->Fill(tKStar);
307 }
308
309}
310
311
312/******************************************************************/
313
314void AliHBTNonId3DCorrFctn::BuildHistos(Int_t nbins, Float_t max, Float_t min)
315{
316
317 AliHBTFunction1D::BuildHistos(nbins,max,min);
318
319 TString nameNumOutP = "NumOutP";
320 TString nameDenOutP = "DenOutP";
321 TString nameRatOutP = "RatOutP";
322 TString nameNumOutN = "NumOutN";
323 TString nameDenOutN = "DenOutN";
324 TString nameRatOutN = "RatOutN";
325 TString nameRatOut = "RatOut";
326 TString nameRatOutNOverP = "RatOutNOverP";
327 TString nameNumSideP = "NumSideP";
328 TString nameDenSideP = "DenSideP";
329 TString nameRatSideP = "RatSideP";
330 TString nameNumSideN = "NumSideN";
331 TString nameDenSideN = "DenSideN";
332 TString nameRatSideN = "RatSideN";
333 TString nameRatSide = "RatSide";
334 TString nameRatSideNOverP = "RatSideNOverP";
335 TString nameNumLongP = "NumLongP";
336 TString nameDenLongP = "DenLongP";
337 TString nameRatLongP = "RatLongP";
338 TString nameNumLongN = "NumLongN";
339 TString nameDenLongN = "DenLongN";
340 TString nameRatLongN = "RatLongN";
341 TString nameRatLong = "RatLong";
342 TString nameRatLongNOverP = "RatLongNOverP";
343
344 fNumOutP = new TH1D(nameNumOutP.Data(),nameNumOutP.Data(),nbins,min,max);
345 fDenOutP = new TH1D(nameDenOutP.Data(),nameDenOutP.Data(),nbins,min,max);
346 fRatOutP = new TH1D(nameRatOutP.Data(),nameRatOutP.Data(),nbins,min,max);
347
348 fNumOutN = new TH1D(nameNumOutN.Data(),nameNumOutN.Data(),nbins,min,max);
349 fDenOutN = new TH1D(nameDenOutN.Data(),nameDenOutN.Data(),nbins,min,max);
350 fRatOutN = new TH1D(nameRatOutN.Data(),nameRatOutN.Data(),nbins,min,max);
351
352 fRatOut = new TH1D(nameRatOut.Data(),nameRatOut.Data(),nbins,min,max);
353 fRatOutNOverP = new TH1D(nameRatOutNOverP.Data(),nameRatOutNOverP.Data(),nbins,min,max);
354
355 fNumSideP = new TH1D(nameNumSideP.Data(),nameNumSideP.Data(),nbins,min,max);
356 fDenSideP = new TH1D(nameDenSideP.Data(),nameDenSideP.Data(),nbins,min,max);
357 fRatSideP = new TH1D(nameRatSideP.Data(),nameRatSideP.Data(),nbins,min,max);
358
359 fNumSideN = new TH1D(nameNumSideN.Data(),nameNumSideN.Data(),nbins,min,max);
360 fDenSideN = new TH1D(nameDenSideN.Data(),nameDenSideN.Data(),nbins,min,max);
361 fRatSideN = new TH1D(nameRatSideN.Data(),nameRatSideN.Data(),nbins,min,max);
362
363 fRatSide = new TH1D(nameRatSide.Data(),nameRatSide.Data(),nbins,min,max);
364 fRatSideNOverP = new TH1D(nameRatSideNOverP.Data(),nameRatSideNOverP.Data(),nbins,min,max);
365
366 fNumLongP = new TH1D(nameNumLongP.Data(),nameNumLongP.Data(),nbins,min,max);
367 fDenLongP = new TH1D(nameDenLongP.Data(),nameDenLongP.Data(),nbins,min,max);
368 fRatLongP = new TH1D(nameRatLongP.Data(),nameRatLongP.Data(),nbins,min,max);
369
370 fNumLongN = new TH1D(nameNumLongN.Data(),nameNumLongN.Data(),nbins,min,max);
371 fDenLongN = new TH1D(nameDenLongN.Data(),nameDenLongN.Data(),nbins,min,max);
372 fRatLongN = new TH1D(nameRatLongN.Data(),nameRatLongN.Data(),nbins,min,max);
373
374 fRatLong = new TH1D(nameRatLong.Data(),nameRatLong.Data(),nbins,min,max);
375 fRatLongNOverP = new TH1D(nameRatLongNOverP.Data(),nameRatLongNOverP.Data(),nbins,min,max);
376
377
378 fNumOutP->Sumw2();
379 fDenOutP->Sumw2();
380 fRatOutP->Sumw2();
381 fNumOutN->Sumw2();
382 fDenOutN->Sumw2();
383 fRatOutN->Sumw2();
384 fRatOut->Sumw2();
385 fRatOutNOverP->Sumw2();
386 fNumSideP->Sumw2();
387 fDenSideP->Sumw2();
388 fRatSideP->Sumw2();
389 fNumSideN->Sumw2();
390 fDenSideN->Sumw2();
391 fRatSideN->Sumw2();
392 fRatSide->Sumw2();
393 fRatSideNOverP->Sumw2();
394 fNumLongP->Sumw2();
395 fDenLongP->Sumw2();
396 fRatLongP->Sumw2();
397 fNumLongN->Sumw2();
398 fDenLongN->Sumw2();
399 fRatLongN->Sumw2();
400 fRatLong->Sumw2();
401 fRatLongNOverP->Sumw2();
402}
403
404 TH1* AliHBTNonId3DCorrFctn::GetResult()
405 {
406 return fRatOutN;
407 }