Bug corrections
[u/mrichter/AliRoot.git] / HBTAN / AliHBTWeightTheorFctn.cxx
CommitLineData
604034d8 1/* $Id$ */
2
eb828ce0 3//_____________________________________________________________________________
4///////////////////////////////////////////////////////////////////////////////
5//
6// class AliHBTWeightTheorQInvFctn
7//
8// This function allows to obtain Q_inv correlation function with weights
9// calculated by Lednicky's alghorithm.
10// Numerator is filled with weighted events. Weights are attributed to simulated particles.
11// Weights are calculated with corresponding simulated particles momenta.
12// Denominator is filled with mixing unweighted simulated particles.
13// One needs only simulated pairs, so
14// this function is of class AliHBTOnePairFctn1D.
604034d8 15//-----------------------------------------------------------
16// This class introduces the weights calculated according
17// with functions of efficiency of identification (TPC+TOF)
18// (calculated by B.V. Batyunia).
19// Author: Ludmila Malinina, JINR (malinina@sunhe.jinr.ru)
20//-----------------------------------------------------------
a6e49985 21
dd82cadc 22#include "AliHBTWeightTheorFctn.h"
a6e49985 23
dd82cadc 24//--for test--AliHBTWeightQInvFctn* yyy= new AliHBTWeightQInvFctn();
9714a029 25/*************************************************************/
26/*************************************************************/
27/*************************************************************/
a6e49985 28
dd82cadc 29ClassImp(AliHBTWeightTheorQInvFctn)
a6e49985 30/*************************************************************/
31
dd82cadc 32AliHBTWeightTheorQInvFctn::AliHBTWeightTheorQInvFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
604034d8 33 AliHBTOnePairFctn1D(nbins,maxXval,minXval)
a6e49985 34{
604034d8 35 //ctor
9714a029 36 fWriteNumAndDen = kTRUE;//change default behaviour
37 Rename("wqinvtheorcf","Q_{inv} Weight Theoretical Correlation Function");
a6e49985 38}
fc13079c 39/**************************************************************/
40
dd82cadc 41void AliHBTWeightTheorQInvFctn::ProcessSameEventParticles(AliHBTPair* partpair)
a6e49985 42{
dd82cadc 43 //Processes Particles and tracks Same different event
a6e49985 44 partpair = CheckPair(partpair);
ce5d39b1 45 if (partpair == 0x0) return;
dd82cadc 46 Double_t weight = partpair->GetWeight();
a6e49985 47 if(TMath::Abs(weight)<=10.) fNumerator->Fill(partpair->GetQInv(),weight);
48}
a6e49985 49/**************************************************************/
fc13079c 50
dd82cadc 51TH1* AliHBTWeightTheorQInvFctn::GetResult()
a6e49985 52{
fc13079c 53 //returns the scaled ratio
54 delete fRatio;
55 fRatio = GetRatio(Scale());
56 return fRatio;
a6e49985 57}
58
9714a029 59/*************************************************************/
60/*************************************************************/
61/*************************************************************/
62
dd82cadc 63ClassImp(AliHBTWeightTheorQOutFctn)
9714a029 64/*************************************************************/
65
dd82cadc 66AliHBTWeightTheorQOutFctn::AliHBTWeightTheorQOutFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
9714a029 67 AliHBTOnePairFctn1D(nbins,maxXval,minXval)
68{
69 //ctor
70 fWriteNumAndDen = kTRUE;//change default behaviour
71 Rename("wqouttheorcf","Q_{out} Weight Theoretical Correlation Function");
72}
73/****************************************************************/
fc13079c 74
dd82cadc 75void AliHBTWeightTheorQOutFctn::ProcessSameEventParticles(AliHBTPair* partpair)
9714a029 76{
77 //Processes Particles and tracks Same different even
78 partpair = CheckPair(partpair);
ce5d39b1 79 if (partpair == 0x0) return;
dd82cadc 80 Double_t weight = partpair->GetWeight();
9714a029 81 if(TMath::Abs(weight)<=10.) fNumerator->Fill(partpair->GetQOutCMSLC(),weight);
82}
83
84/**************************************************************/
dd82cadc 85TH1* AliHBTWeightTheorQOutFctn::GetResult()
9714a029 86{
fc13079c 87 //returns the scaled ratio
88 delete fRatio;
89 fRatio = GetRatio(Scale());
90 return fRatio;
9714a029 91}
92
93/*************************************************************/
94/*************************************************************/
95/*************************************************************/
96
dd82cadc 97ClassImp(AliHBTWeightTheorQSideFctn)
9714a029 98/*************************************************************/
99
dd82cadc 100AliHBTWeightTheorQSideFctn::AliHBTWeightTheorQSideFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
9714a029 101 AliHBTOnePairFctn1D(nbins,maxXval,minXval)
102{
103 //ctor
104 fWriteNumAndDen = kTRUE;//change default behaviour
105 Rename("wqsidetheorcf","Q_{side} Weight Theoretical Correlation Function");
106}
107/****************************************************************/
fc13079c 108
dd82cadc 109void AliHBTWeightTheorQSideFctn::ProcessSameEventParticles(AliHBTPair* partpair)
9714a029 110{
111 //Processes Particles and tracks Same different even
112 partpair = CheckPair(partpair);
ce5d39b1 113 if (partpair == 0x0) return;
dd82cadc 114 Double_t weight = partpair->GetWeight();
9714a029 115 if(TMath::Abs(weight)<=10.) fNumerator->Fill(partpair->GetQSideCMSLC(),weight);
116}
9714a029 117/**************************************************************/
fc13079c 118
dd82cadc 119TH1* AliHBTWeightTheorQSideFctn::GetResult()
9714a029 120{
fc13079c 121 //returns the scaled ratio
122 delete fRatio;
123 fRatio = GetRatio(Scale());
124 return fRatio;
9714a029 125}
126
127/*************************************************************/
128/*************************************************************/
129/*************************************************************/
130
dd82cadc 131ClassImp(AliHBTWeightTheorQLongFctn)
9714a029 132/*************************************************************/
133
dd82cadc 134AliHBTWeightTheorQLongFctn::AliHBTWeightTheorQLongFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
9714a029 135 AliHBTOnePairFctn1D(nbins,maxXval,minXval)
136{
137 //ctor
138 fWriteNumAndDen = kTRUE;//change default behaviour
139 Rename("wqlongtheorcf","Q_{long} Weight Theoretical Correlation Function");
140}
141/****************************************************************/
fc13079c 142
dd82cadc 143void AliHBTWeightTheorQLongFctn::ProcessSameEventParticles(AliHBTPair* partpair)
9714a029 144{
145 //Processes Particles and tracks Same different even
146 partpair = CheckPair(partpair);
ce5d39b1 147 if (partpair == 0x0) return;
dd82cadc 148 Double_t weight = partpair->GetWeight();
9714a029 149 if(TMath::Abs(weight)<=10.) fNumerator->Fill(partpair->GetQLongCMSLC(),weight);
150}
9714a029 151/**************************************************************/
fc13079c 152
dd82cadc 153TH1* AliHBTWeightTheorQLongFctn::GetResult()
154{
fc13079c 155 //returns the scaled ratio
156 delete fRatio;
157 fRatio = GetRatio(Scale());
158 return fRatio;
dd82cadc 159}
160
161/*************************************************************/
162/*************************************************************/
163/*************************************************************/
164
165ClassImp(AliHBTWeightTheorOSLFctn)
166
167AliHBTWeightTheorOSLFctn::AliHBTWeightTheorOSLFctn(Int_t nXbins, Double_t maxXval, Double_t minXval,
168 Int_t nYbins, Double_t maxYval, Double_t minYval,
169 Int_t nZbins, Double_t maxZval, Double_t minZval):
170 AliHBTOnePairFctn3D(nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval)
171{
f78d233e 172 //ctor
dd82cadc 173 fWriteNumAndDen = kTRUE;//change default behaviour
174 Rename("wqosltheorcf","Q_{out}-Q_{side}-Q_{long} Weight Theoretical Correlation Fctn");
175}
f78d233e 176
dd82cadc 177/*************************************************************/
178
179void AliHBTWeightTheorOSLFctn::ProcessSameEventParticles(AliHBTPair* partpair)
180{
181//Fills numerator
182 partpair = CheckPair(partpair);
183 if (partpair == 0x0) return;
184 Double_t weight = partpair->GetWeight();
185 Double_t out = TMath::Abs(partpair->GetQOutCMSLC());
186 Double_t side = TMath::Abs(partpair->GetQSideCMSLC());
187 Double_t lon = TMath::Abs(partpair->GetQLongCMSLC());
188 fNumerator->Fill(out,side,lon,weight);
189}
190/*************************************************************/
191
192TH1* AliHBTWeightTheorOSLFctn::GetResult()
9714a029 193{
fc13079c 194 //returns the scaled ratio
195 delete fRatio;
196 fRatio = GetRatio(Scale());
197 return fRatio;
9714a029 198}