]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HBTAN/AliHBTWeightFctn.cxx
New versions of GDC and CDH raw data headers. Some CDH getters are added
[u/mrichter/AliRoot.git] / HBTAN / AliHBTWeightFctn.cxx
1 #include "AliHBTWeightFctn.h"
2 /* $Id$ */
3 //_________________________________________________________________________
4 //
5 // class AliHBTWeightQInvFctn
6 //
7 // This class allows to obtain Q_inv correlation function with weights
8 // calculated by Lednicky's alghorithm.
9 // Numerator is filled with weighted events. Weights are attributed to reconstructed tracks.
10 // Weights are calculated with corresponding simulated particles momenta.
11 // Denominator is filled with mixing unweighted reconstructed tracks.
12 // One needs both pairs 
13 // (simulated and recontructed), thus function is of class AliHBTTwoPairFctn1D.
14 // Author: Ludmila Malinina, JINR (malinina@sunhe.jinr.ru)
15 //
16 ////////////////////////////////////////////////////////////////////////////////
17
18 ClassImp( AliHBTWeightQInvFctn )
19
20   
21 /****************************************************************/
22 AliHBTWeightQInvFctn::AliHBTWeightQInvFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
23  AliHBTTwoPairFctn1D(nbins,maxXval,minXval)
24 {
25 //ctor
26  fWriteNumAndDen = kTRUE;//change default behaviour
27  Rename("wqinvcf","Q_{inv} Weight Correlation Function");
28 }
29 /****************************************************************/
30
31 void  AliHBTWeightQInvFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
32 {
33   //process particles from same events (fills numerator)
34   trackpair = CheckPair(trackpair);
35 //  partpair  = CheckPair(partpair);
36   if ( trackpair && partpair)     
37   {
38 //    Double_t weightPID=1.;
39     Double_t weight = 1.0;
40     if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
41          ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode())    )
42       {   
43          weight=partpair->GetWeight();
44       }   
45 //    Double_t weight=weightHBT*weightPID;
46     fNumerator->Fill(trackpair->GetQInv(),weight);
47   }
48
49 /****************************************************************/
50
51 void  AliHBTWeightQInvFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
52 {
53   // Fills the denominator using mixed pairs
54   trackpair = CheckPair(trackpair);
55 //  partpair  = CheckPair(partpair);
56   if ( trackpair && partpair)  
57   {
58      fDenominator->Fill(trackpair->GetQInv());
59   }
60 }
61 /**************************************************************/
62
63 TH1* AliHBTWeightQInvFctn::GetResult()
64
65 //returns ratio of numerator and denominator                                    
66  //returns the scaled ratio
67  delete fRatio;
68  fRatio = GetRatio(Scale());
69  return fRatio;
70 }                    
71                                                               
72 /**************************************************************************************/
73 /**************************************************************************************/
74 /**************************************************************************************/
75 /**************************************************************************************/
76
77 ClassImp(AliHBTWeightQOutFctn)
78     
79 AliHBTWeightQOutFctn::AliHBTWeightQOutFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
80  AliHBTTwoPairFctn1D(nbins,maxXval,minXval)
81 {
82 //ctor
83  fWriteNumAndDen = kTRUE;//change default behaviour
84  Rename("wqoutcf","Q_{out} Weight Correlation Function");
85 }
86 /****************************************************************/
87
88 void AliHBTWeightQOutFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
89 {
90   //process particles from same events (fills numerator)  
91   trackpair = CheckPair(trackpair);
92 //  partpair  = CheckPair(partpair);
93   if ( trackpair && partpair)     
94   {
95 //    Double_t weightPID=1.;
96     Double_t weight = 1.0;
97     if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
98          ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode())    )
99       {   
100          weight=partpair->GetWeight();
101       }   
102 //    Double_t weight=weightHBT*weightPID;
103     fNumerator->Fill(trackpair->GetQOutLCMS(),weight);
104   }
105
106 /****************************************************************/
107
108 void AliHBTWeightQOutFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
109 {
110   //process particles from diff events (fills denominator)
111   trackpair = CheckPair(trackpair);
112 //  partpair  = CheckPair(partpair);
113   if ( trackpair && partpair)  
114   {
115      fDenominator->Fill(trackpair->GetQOutLCMS());
116   }
117 }
118 /**************************************************************/
119
120 TH1* AliHBTWeightQOutFctn::GetResult() 
121
122  //returns the scaled ratio
123  delete fRatio;
124  fRatio = GetRatio(Scale());
125  return fRatio;
126 }                    
127                                                               
128 /*************************************************************************************/ 
129 /*************************************************************************************/ 
130 /*************************************************************************************/ 
131
132 ClassImp(AliHBTWeightQLongFctn)
133 AliHBTWeightQLongFctn::AliHBTWeightQLongFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
134  AliHBTTwoPairFctn1D(nbins,maxXval,minXval)
135 {
136 //ctor
137  fWriteNumAndDen = kTRUE;//change default behaviour
138  Rename("wqlongcf","Q_{long} Weight Correlation Function");
139 }
140 /****************************************************************/
141
142 void AliHBTWeightQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
143 {
144  //process particles from same events (fills numerator)
145   trackpair = CheckPair(trackpair);
146 //  partpair  = CheckPair(partpair);
147   if ( trackpair && partpair)     
148   {
149 //    Double_t weightPID=1.;
150     Double_t weight = 1.0;
151     if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
152          ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode())    )
153       {   
154          weight=partpair->GetWeight();
155       }   
156 //    Double_t weight=weightHBT*weightPID;
157     fNumerator->Fill(trackpair->GetQLongLCMS(),weight);
158   }
159
160 /****************************************************************/
161
162 void AliHBTWeightQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
163 {
164   //process particles from diff events (fills denominator)
165   trackpair = CheckPair(trackpair);
166 //  partpair  = CheckPair(partpair);
167   if ( trackpair && partpair)  
168   {
169      fDenominator->Fill(trackpair->GetQLongLCMS());
170   }
171 }
172 /**************************************************************/
173 TH1* AliHBTWeightQLongFctn::GetResult()
174
175  //returns the scaled ratio
176  delete fRatio;
177  fRatio = GetRatio(Scale());
178  return fRatio;
179 }                    
180                                                               
181 /*************************************************************************************/ 
182 /*************************************************************************************/ 
183 /*************************************************************************************/ 
184
185 ClassImp(AliHBTWeightQSideFctn)
186 /*************************************************************************************/ 
187
188 AliHBTWeightQSideFctn::AliHBTWeightQSideFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
189  AliHBTTwoPairFctn1D(nbins,maxXval,minXval)
190 {
191 //ctor
192  fWriteNumAndDen = kTRUE;//change default behaviour
193  Rename("wqsidecf","Q_{side} Weight Correlation Function");
194 }
195 /****************************************************************/
196
197 void AliHBTWeightQSideFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
198 {
199   //process particles from same events (fills numerator)
200   trackpair = CheckPair(trackpair);
201 //  partpair  = CheckPair(partpair);
202   if ( trackpair && partpair)     
203   {
204 //    Double_t weightPID=1.;
205     Double_t weight = 1.0;
206     if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
207          ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode())    )
208       {   
209          weight=partpair->GetWeight();
210       }   
211 //    Double_t weight=weightHBT*weightPID;
212     fNumerator->Fill(trackpair->GetQSideLCMS(),weight);
213   }
214
215 /****************************************************************/
216
217 void  AliHBTWeightQSideFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
218 {
219   //process particles from diff events (fills denominator)
220   trackpair = CheckPair(trackpair);
221 //  partpair  = CheckPair(partpair);
222   if ( trackpair && partpair)  
223   {
224      fDenominator->Fill(trackpair->GetQSideLCMS());
225   }
226 }
227 /**************************************************************/
228
229 TH1* AliHBTWeightQSideFctn::GetResult() 
230
231  //returns the scaled ratio
232  delete fRatio;
233  fRatio = GetRatio(Scale());
234  return fRatio;
235 }                    
236                                                               
237 /*************************************************************************************/ 
238 /*************************************************************************************/ 
239 /*************************************************************************************/ 
240
241 ClassImp(AliHBTWeightTwoKStarFctn)
242 /*************************************************************************************/ 
243 AliHBTWeightTwoKStarFctn::AliHBTWeightTwoKStarFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
244  AliHBTTwoPairFctn1D(nbins,maxXval,minXval)
245 {
246 //ctor
247  fWriteNumAndDen = kTRUE;//change default behaviour
248  Rename("wtwokstarcf","2*K^{*} Weight Correlation Function");
249 }
250 /****************************************************************/
251
252 void AliHBTWeightTwoKStarFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
253 {
254   //process particles from same events (fills numerator)
255   trackpair = CheckPair(trackpair);
256 //  partpair  = CheckPair(partpair);
257   if ( trackpair && partpair)     
258   {
259 //    Double_t weightPID=1.;
260     Double_t weight = 1.0;
261     if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
262          ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode())    )
263       {   
264          weight=partpair->GetWeight();
265       }   
266 //    Double_t weight=weightHBT*weightPID;
267     fNumerator->Fill(2.0*(trackpair->GetKStar()),weight);
268   }
269
270 /****************************************************************/
271
272 void  AliHBTWeightTwoKStarFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
273 {
274   //process particles from diff events (fills denominator)
275   trackpair = CheckPair(trackpair);
276 //  partpair  = CheckPair(partpair);
277   if ( trackpair && partpair)  
278   {
279      fDenominator->Fill(2.0*(trackpair->GetKStar()));
280   }
281 }
282 /**************************************************************/
283 TH1* AliHBTWeightTwoKStarFctn::GetResult() 
284                                                                                
285
286  //returns the scaled ratio
287  delete fRatio;
288  fRatio = GetRatio(Scale());
289  return fRatio;
290 }                    
291                                                               
292 /*************************************************************************************/ 
293 /*************************************************************************************/ 
294 /*************************************************************************************/ 
295
296 ClassImp(AliHBTWeightQOutQSideFctn)
297 /*************************************************************************************/ 
298     
299 AliHBTWeightQOutQSideFctn::AliHBTWeightQOutQSideFctn(Int_t nxbins, Double_t maxXval, Double_t minXval,
300                                                          Int_t nybins, Double_t maxYval, Double_t minYval):
301  AliHBTTwoPairFctn2D(nxbins,maxXval,minXval,nybins,maxYval,minYval)
302 {
303   //ctor
304  fWriteNumAndDen = kTRUE;//change default behaviour
305  Rename("wqoutqsidecf","Q_{out} Q_{side} Weight Correlation Function 2D");
306 }    
307 /*************************************************************************************/ 
308
309 void AliHBTWeightQOutQSideFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
310 {
311   //process particles from same events (fills numerator)
312   trackpair = CheckPair(trackpair);
313 //  partpair  = CheckPair(partpair);
314   if ( trackpair && partpair)     
315   {
316 //    Double_t weightPID=1.;
317     Double_t weight = 1.0;
318     if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
319          ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode())    )
320       {   
321          weight=partpair->GetWeight();
322       }   
323 //    Double_t weight=weightHBT*weightPID;
324     fNumerator->Fill(trackpair->GetQOutLCMS(),trackpair->GetQSideLCMS(),weight);
325   }
326
327 /****************************************************************/
328
329 void AliHBTWeightQOutQSideFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
330 {
331   //process particles from diff events (fills denominator)
332   trackpair = CheckPair(trackpair);
333 //  partpair  = CheckPair(partpair);
334   if ( trackpair && partpair)  
335   {
336      fDenominator->Fill(trackpair->GetQOutLCMS(),trackpair->GetQSideLCMS());
337   }
338 }
339 /**************************************************************/
340
341 TH1* AliHBTWeightQOutQSideFctn::GetResult()
342 {
343  //returns the scaled ratio
344  delete fRatio;
345  fRatio = GetRatio(Scale());
346  return fRatio;
347 }
348
349 /*************************************************************************************/ 
350 /*************************************************************************************/ 
351 /*************************************************************************************/ 
352
353 ClassImp(AliHBTWeightQOutQLongFctn)
354 /*************************************************************************************/ 
355     
356 AliHBTWeightQOutQLongFctn::AliHBTWeightQOutQLongFctn(Int_t nxbins, Double_t maxXval, Double_t minXval,
357                                                          Int_t nybins, Double_t maxYval, Double_t minYval):
358  AliHBTTwoPairFctn2D(nxbins,maxXval,minXval,nybins,maxYval,minYval)
359 {
360   //ctor
361  fWriteNumAndDen = kTRUE;//change default behaviour
362  Rename("wqoutqlongcf","Q_{out} Q_{long} Weight Correlation Function 2D");
363 }    
364 /*************************************************************************************/ 
365
366 void AliHBTWeightQOutQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
367 {
368   //process particles from same events (fills numerator)
369   trackpair = CheckPair(trackpair);
370 //  partpair  = CheckPair(partpair);
371   if ( trackpair && partpair)     
372   {
373 //    Double_t weightPID=1.;
374     Double_t weight = 1.0;
375     if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
376          ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode())    )
377       {   
378          weight=partpair->GetWeight();
379       }   
380 //    Double_t weight=weightHBT*weightPID;
381     fNumerator->Fill(trackpair->GetQOutLCMS(),trackpair->GetQLongLCMS(),weight);
382   }
383
384 /****************************************************************/
385
386 void AliHBTWeightQOutQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
387 {
388   //process particles from diff events (fills denominator)
389   trackpair = CheckPair(trackpair);
390 //  partpair  = CheckPair(partpair);
391   if ( trackpair && partpair)  
392   {
393      fDenominator->Fill(trackpair->GetQOutLCMS(),trackpair->GetQLongLCMS());
394   }
395 }
396 /**************************************************************/
397
398 TH1* AliHBTWeightQOutQLongFctn::GetResult()
399 {
400  //returns the scaled ratio
401  delete fRatio;
402  fRatio = GetRatio(Scale());
403  return fRatio;
404 }
405
406 /*************************************************************************************/ 
407 /*************************************************************************************/ 
408 /*************************************************************************************/ 
409
410 ClassImp(AliHBTWeightQSideQLongFctn)
411 /*************************************************************************************/ 
412     
413 AliHBTWeightQSideQLongFctn::AliHBTWeightQSideQLongFctn(Int_t nxbins, Double_t maxXval, Double_t minXval,
414                                                          Int_t nybins, Double_t maxYval, Double_t minYval):
415  AliHBTTwoPairFctn2D(nxbins,maxXval,minXval,nybins,maxYval,minYval)
416 {
417   //ctor
418  fWriteNumAndDen = kTRUE;//change default behaviour
419  Rename("wqsideqlongcf","Q_{side} Q_{long} Weight Correlation Function 2D");
420 }    
421 /*************************************************************************************/ 
422
423 void AliHBTWeightQSideQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
424 {
425   //process particles from same events (fills numerator)
426   trackpair = CheckPair(trackpair);
427 //  partpair  = CheckPair(partpair);
428   if ( trackpair && partpair)     
429   {
430 //    Double_t weightPID=1.;
431     Double_t weight = 1.0;
432     if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
433          ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode())    )
434       {   
435          weight=partpair->GetWeight();
436       }   
437 //    Double_t weight=weightHBT*weightPID;
438     fNumerator->Fill(trackpair->GetQSideLCMS(),trackpair->GetQLongLCMS(),weight);
439   }
440
441 /****************************************************************/
442
443 void AliHBTWeightQSideQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
444 {
445   //process particles from diff events (fills denominator)
446   trackpair = CheckPair(trackpair);
447 //  partpair  = CheckPair(partpair);
448   if ( trackpair && partpair)  
449   {
450      fDenominator->Fill(trackpair->GetQSideLCMS(),trackpair->GetQLongLCMS());
451   }
452 }
453 /**************************************************************/
454
455 TH1* AliHBTWeightQSideQLongFctn::GetResult()
456 {
457  //returns the scaled ratio
458  delete fRatio;
459  fRatio = GetRatio(Scale());
460  return fRatio;
461 }
462 /*************************************************************/
463 /*************************************************************/
464 /*************************************************************/ 
465
466 ClassImp(AliHBTWeightQOutSQideQLongFctn)
467
468 AliHBTWeightQOutSQideQLongFctn::AliHBTWeightQOutSQideQLongFctn(Int_t nXbins, Double_t maxXval, Double_t minXval,
469                                                    Int_t nYbins, Double_t maxYval, Double_t minYval,
470                                                    Int_t nZbins, Double_t maxZval, Double_t minZval):
471  AliHBTTwoPairFctn3D(nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval)
472 {
473   //ctor
474   fWriteNumAndDen = kTRUE;//change default behaviour
475   Rename("wqoslcf","Q_{out}-Q_{side}-Q_{long} Weight Correlation Fctn");
476 }
477 /*************************************************************/
478
479 void AliHBTWeightQOutSQideQLongFctn::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
480 {
481 //Fills numerator
482   //process particles from same events (fills numerator)
483   trackpair = CheckPair(trackpair);
484 //  partpair  = CheckPair(partpair);
485   if ( trackpair && partpair)     
486   {
487 //    Double_t weightPID=1.;
488     Double_t weight = 1.0;
489     if ( ( trackpair->Particle1()->GetPdgCode() == partpair->Particle1()->GetPdgCode()) &&
490          ( trackpair->Particle2()->GetPdgCode() == partpair->Particle2()->GetPdgCode())    )
491       {   
492          weight=partpair->GetWeight();//here we take weight from the particle pair
493       }   
494 //    Double_t weight=weightHBT*weightPID;
495     Double_t out = trackpair->GetQOutLCMS();
496     Double_t side = trackpair->GetQSideLCMS();
497     Double_t lon = trackpair->GetQLongLCMS();
498     
499     if (fAbs)
500      {
501        out = TMath::Abs(out);
502        side = TMath::Abs(side);
503        lon = TMath::Abs(lon);
504      }
505     
506     fNumerator->Fill(out,side,lon,weight);//here we fill in q's corresponding to track pair 
507                                           //weight calculated for the simulated one
508   }
509 }
510 /*************************************************************/
511
512 void AliHBTWeightQOutSQideQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
513 {
514   //process particles from diff events (fills denominator)
515   trackpair = CheckPair(trackpair);
516 //  partpair  = CheckPair(partpair);
517   if ( trackpair && partpair)  
518    {
519     Double_t out = trackpair->GetQOutLCMS();
520     Double_t side = trackpair->GetQSideLCMS();
521     Double_t lon = trackpair->GetQLongLCMS();
522     
523     if (fAbs)
524      {
525        out = TMath::Abs(out);
526        side = TMath::Abs(side);
527        lon = TMath::Abs(lon);
528      }
529    
530     fDenominator->Fill(out,side,lon);
531    }
532 }
533 /*************************************************************/
534
535 TH1* AliHBTWeightQOutSQideQLongFctn::GetResult()
536 {
537  //returns the scaled ratio
538  delete fRatio;
539  fRatio = GetRatio(Scale());
540  return fRatio;
541 }