1 #include "AliHBTFunction.h"
2 /******************************************************************/
4 Piotr Krzysztof Skowronski
5 Piotr.Skowronski@cern.ch
6 Base classes for HBT functions
21 four particle functions are intendent to be resolution functions:
22 it is mecessary to have simulated particle pair corresponding to given
23 recontructed track pair in order to calculate function simualted value
24 and recontructed value to be further histogrammed
27 /******************************************************************/
28 /******************************************************************/
30 ClassImp( AliHBTFunction )
32 AliHBTFunction::AliHBTFunction()
35 fPairCut = new AliHBTEmptyPairCut(); //dummy cut
41 if (GetNumerator()) GetNumerator()->Write();
42 if (GetDenominator()) GetDenominator()->Write();
43 TH1* res = GetResult();
44 if (res) GetResult()->Write();
46 /******************************************************************/
49 GetRatio(Double_t normfactor)
51 TString str = fName + " ratio";
52 TH1 *result = (TH1*)GetNumerator()->Clone(str.Data());
54 result->SetTitle(str.Data());
57 result->Divide(GetNumerator(),GetDenominator(),normfactor);
62 /******************************************************************/
63 void AliHBTFunction::SetPairCut(AliHBTPairCut* cut)
65 //Sets new Pair Cut. Old one is deleted
66 //Note that it is created new object instead of simple pointer set
67 //I do not want to have pointer
68 //to object created somewhere else
69 //because in that case I could not believe that
70 //it would always exist (sb could delete it)
71 //so we have always own copy
75 Error("AliHBTFunction::SetPairCut","argument is NULL");
79 fPairCut = (AliHBTPairCut*)cut->Clone();
83 /******************************************************************/
86 Rename(const Char_t * name)
88 //renames the function and histograms
92 TString numstr = fName + " Numerator"; //title and name of the
94 TString denstr = fName + " Denominator";//title and name of the
95 //denominator histogram
97 GetNumerator()->SetName(numstr.Data());
98 GetNumerator()->SetTitle(numstr.Data());
100 GetDenominator()->SetName(denstr.Data());
101 GetDenominator()->SetTitle(denstr.Data());
105 void AliHBTFunction::
106 Rename(const Char_t * name, const Char_t * title)
108 //renames and retitle the function and histograms
113 TString numstrn = fName + " Numerator"; //name of the
114 //numerator histogram
116 TString numstrt = fTitle + " Numerator"; //title of the
117 //numerator histogram
119 TString denstrn = fName + " Denominator";//name of the
120 //denominator histogram
122 TString denstrt = fTitle + " Denominator";//title of the
123 //denominator histogram
126 GetNumerator()->SetName(numstrn.Data());
127 GetNumerator()->SetTitle(numstrt.Data());
129 GetDenominator()->SetName(denstrn.Data());
130 GetDenominator()->SetTitle(denstrt.Data());
135 /******************************************************************/
136 /******************************************************************/
137 /******************************************************************/
139 ClassImp( AliHBTTwoPartFctn )
141 /******************************************************************/
142 /******************************************************************/
143 /******************************************************************/
145 ClassImp( AliHBTFourPartFctn)
147 /******************************************************************/
148 /******************************************************************/
149 /******************************************************************/
151 ClassImp( AliHBTTwoPartFctn1D )
153 AliHBTTwoPartFctn1D::
154 AliHBTTwoPartFctn1D(Int_t nbins, Double_t maxXval, Double_t minXval)
156 //Constructor of Two Part One Dimentional Function
157 // nbins: number of bins in histograms - default 100
158 // maxXval and minXval: range of histgram(s) default 0 - 0.15 (GeV)
161 TString numstr = fName + " Numerator"; //title and name of the
162 //numerator histogram
163 TString denstr = fName + " Denominator";//title and name of the
164 //denominator histogram
166 fNumerator = new TH1D(numstr.Data(),numstr.Data(),nbins,minXval,maxXval);
167 fDenominator = new TH1D(denstr.Data(),denstr.Data(),nbins,minXval,maxXval);
170 fDenominator->Sumw2();
173 /******************************************************************/
174 AliHBTTwoPartFctn1D::~AliHBTTwoPartFctn1D()
179 /******************************************************************/
180 /******************************************************************/
181 /******************************************************************/
183 ClassImp( AliHBTTwoPartFctn2D )
185 AliHBTTwoPartFctn2D::
186 AliHBTTwoPartFctn2D(Int_t nXbins, Double_t maxXval, Double_t minXval ,
187 Int_t nYbins, Double_t maxYval, Double_t minYval)
190 TString numstr = fName + " Numerator"; //title and name of the
191 //numerator histogram
192 TString denstr = fName + " Denominator";//title and name of the
193 //denominator histogram
195 fNumerator = new TH2D(numstr.Data(),numstr.Data(),
196 nXbins,minXval,maxXval,
197 nYbins,minYval,maxYval);
199 fDenominator = new TH2D(denstr.Data(),denstr.Data(),
200 nXbins,minXval,maxXval,
201 nYbins,minYval,maxYval);
204 fDenominator->Sumw2();
207 AliHBTTwoPartFctn2D::~AliHBTTwoPartFctn2D()
212 void AliHBTTwoPartFctn2D::ProcessSameEventParticles(AliHBTPair* pair)
214 pair = CheckPair(pair);
219 fNumerator->Fill(y,x);
223 void AliHBTTwoPartFctn2D::ProcessDiffEventParticles(AliHBTPair* pair)
225 pair = CheckPair(pair);
230 fDenominator->Fill(y,x);
236 /******************************************************************/
237 /******************************************************************/
238 /******************************************************************/
240 ClassImp( AliHBTTwoPartFctn3D)
242 AliHBTTwoPartFctn3D::
243 AliHBTTwoPartFctn3D(Int_t nXbins, Double_t maxXval, Double_t minXval,
244 Int_t nYbins, Double_t maxYval, Double_t minYval,
245 Int_t nZbins, Double_t maxZval, Double_t minZval)
248 TString numstr = fName + " Numerator"; //title and name of the
249 //numerator histogram
250 TString denstr = fName + " Denominator";//title and name of the
251 //denominator histogram
253 fNumerator = new TH3D(numstr.Data(),numstr.Data(),
254 nXbins,minXval,maxXval,
255 nYbins,minYval,maxYval,
256 nZbins,minZval,maxZval);
258 fDenominator = new TH3D(denstr.Data(),denstr.Data(),
259 nXbins,minXval,maxXval,
260 nYbins,minYval,maxYval,
261 nZbins,minZval,maxZval);
264 fDenominator->Sumw2();
269 AliHBTTwoPartFctn3D::~AliHBTTwoPartFctn3D()
276 /******************************************************************/
277 /******************************************************************/
278 /******************************************************************/
279 ClassImp( AliHBTFourPartFctn2D)
282 AliHBTFourPartFctn2D::
283 AliHBTFourPartFctn2D(Int_t nXbins, Double_t maxXval, Double_t minXval ,
284 Int_t nYbins, Double_t maxYval, Double_t minYval)
287 TString numstr = fName + " Numerator"; //title and name of the
288 //numerator histogram
289 TString denstr = fName + " Denominator";//title and name of the
290 //denominator histogram
292 fNumerator = new TH2D(numstr.Data(),numstr.Data(),
293 nXbins,minXval,maxXval,
294 nYbins,minYval,maxYval);
296 fDenominator = new TH2D(denstr.Data(),denstr.Data(),
297 nXbins,minXval,maxXval,
298 nYbins,minYval,maxYval);
301 fDenominator->Sumw2();
304 AliHBTFourPartFctn2D::~AliHBTFourPartFctn2D()
309 void AliHBTFourPartFctn2D::
310 ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
312 partpair = CheckPair(partpair);
313 trackpair = CheckPair(trackpair);
314 if( partpair && trackpair)
317 GetValues(trackpair,partpair,x,y);
318 fNumerator->Fill(y,x);
322 void AliHBTFourPartFctn2D::
323 ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
325 partpair = CheckPair(partpair);
326 trackpair = CheckPair(trackpair);
327 if( partpair && trackpair)
330 GetValues(trackpair,partpair,x,y);
331 fDenominator->Fill(y,x);