]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HBTAN/AliHBTFunction.cxx
Modifications needed by the HBT analysis (P.Skowronski)
[u/mrichter/AliRoot.git] / HBTAN / AliHBTFunction.cxx
CommitLineData
1b446896 1#include "AliHBTFunction.h"
6e8d850a 2
3/* $Id: */
4
5//--------------------------------------------------------------------
26f1270c 6//AliHBTFunction
7//Author: Piotr Krzysztof Skowronski
8//Piotr.Skowronski@cern.ch
6e8d850a 9//Base classes for HBT functions
10/*
2c33acf3 11 OnePairFctn Function TwoPairFctn
26f1270c 12 | \ \ / | \ /|\
13 | \ \ / | \ / | \
14 | \ \ 1D 2D 3D / | \
15 | \ \ / \ |\ | \________________/__ | \
16 | \ \/ \ | \__|_____________ / \| \
17 | \ \ \_|____|__ \ / | \
18 | \ / \___ | | \ \/ |\ \
19 | / \ | | \ /\ | \ \
20 | / \ \| | \ / \ | \ \
21 | / \ /\ | \ / \ | \ |
22 | / \ / \ | \ / \ | \ |
6e8d850a 23 | / \ / \ | \ / \ | \ |
26f1270c 24 | / \/ \ | \/ \ | \ |
25 OnePair1D OnePair2D OnePair3D TwoPair1D TwoPair2D TwoPair3D
26
27
1b446896 28 four particle functions are intendent to be resolution functions:
29 it is mecessary to have simulated particle pair corresponding to given
30 recontructed track pair in order to calculate function simualted value
2c33acf3 31 and recontructed value, to be further histogrammed
1b446896 32*/
6e8d850a 33//---------------------------------------------------------------------
26f1270c 34
2dc7203b 35#include <TH2.h>
36#include <TH3.h>
37
1b446896 38/******************************************************************/
39/******************************************************************/
40
41ClassImp( AliHBTFunction )
42
201fedb7 43AliHBTFunction::AliHBTFunction():
e6e21fa2 44 fPairCut(new AliHBTEmptyPairCut()), //dummy cut
45 fWriteNumAndDen(kFALSE)
1b446896 46{
2c33acf3 47//Default constructor
ba95ae3f 48}
49/******************************************************************/
28cf76fa 50
201fedb7 51AliHBTFunction::AliHBTFunction(const char* name,const char* title):
e6e21fa2 52 TNamed(name,title),
53 fPairCut(new AliHBTEmptyPairCut()), //dummy cut
54 fWriteNumAndDen(kFALSE)
ba95ae3f 55{
201fedb7 56//Constructor
1b446896 57}
2674b9ff 58/******************************************************************/
59
28cf76fa 60AliHBTFunction::AliHBTFunction(const AliHBTFunction & source):
61 TNamed(source),
e6e21fa2 62 fPairCut((AliHBTPairCut*)source.fPairCut->Clone()),
63 fWriteNumAndDen(source.fWriteNumAndDen)
28cf76fa 64{
65// Copy constructor needed by the coding conventions
66}
67/******************************************************************/
68
2674b9ff 69AliHBTFunction::~AliHBTFunction()
2c33acf3 70{
71//destructor
8928fd0d 72 delete fPairCut;
2c33acf3 73}
2674b9ff 74/******************************************************************/
28cf76fa 75AliHBTFunction & AliHBTFunction::operator= (const AliHBTFunction & source)
76{
77 // Assignment needed by the coding conventions
78 delete fPairCut;
79 fPairCut = (AliHBTPairCut*)source.fPairCut->Clone();
80 return * this;
81}
1b446896 82
c41732dc 83void AliHBTFunction::WriteFunction()
2c33acf3 84{
85//writes result of the function to file
3976deed 86 if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","%s",GetName());
e6e21fa2 87 if (fWriteNumAndDen)
88 {
3976deed 89 if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","Writing Num & Den");
e6e21fa2 90 if (GetNumerator()) GetNumerator()->Write();
91 if (GetDenominator()) GetDenominator()->Write();
3976deed 92 if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","Writing Num & Den Done");
e6e21fa2 93 }
3976deed 94 if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","Getting Result");
1b446896 95 TH1* res = GetResult();
3976deed 96 if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","Getting Result Done");
97
98 if (res)
99 {
100 if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","Writing Result");
101 res->Write();
102 if (AliHBTParticle::GetDebug()) Info("AliHBTFunction","Writing Result Done");
103 }
2c33acf3 104}
1b446896 105/******************************************************************/
106
266c51ca 107TH1* AliHBTFunction::GetRatio(Double_t normfactor)
1b446896 108 {
2c33acf3 109 //returns ratio of numerator and denominator
110 //
18c3af34 111 if (AliHBTParticle::GetDebug()>0) Info("GetRatio","Norm. Factor is %f for %s",normfactor,GetName());
976183fd 112
113 if (normfactor == 0.0)
114 {
115 Error("GetRatio","Scaling Factor is 0. Null poiner returned");
116 return 0x0;
117 }
1b446896 118 TString str = fName + " ratio";
119 TH1 *result = (TH1*)GetNumerator()->Clone(str.Data());
120
121 result->SetTitle(str.Data());
1b446896 122
123 result->Divide(GetNumerator(),GetDenominator(),normfactor);
124
125 return result;
126
127 }
128/******************************************************************/
129void AliHBTFunction::SetPairCut(AliHBTPairCut* cut)
130{
131//Sets new Pair Cut. Old one is deleted
132//Note that it is created new object instead of simple pointer set
133//I do not want to have pointer
134//to object created somewhere else
135//because in that case I could not believe that
136//it would always exist (sb could delete it)
137//so we have always own copy
138
139 if(!cut)
140 {
141 Error("AliHBTFunction::SetPairCut","argument is NULL");
142 return;
143 }
144 delete fPairCut;
145 fPairCut = (AliHBTPairCut*)cut->Clone();
146
147}
148
149/******************************************************************/
150
8928fd0d 151void AliHBTFunction::Rename(const Char_t * name)
1b446896 152 {
153 //renames the function and histograms
154 SetName(name);
155 SetTitle(name);
156
157 TString numstr = fName + " Numerator"; //title and name of the
158 //numerator histogram
159 TString denstr = fName + " Denominator";//title and name of the
160 //denominator histogram
161
162 GetNumerator()->SetName(numstr.Data());
163 GetNumerator()->SetTitle(numstr.Data());
164
165 GetDenominator()->SetName(denstr.Data());
166 GetDenominator()->SetTitle(denstr.Data());
167
168 }
169
8928fd0d 170void AliHBTFunction::Rename(const Char_t * name, const Char_t * title)
1b446896 171 {
172 //renames and retitle the function and histograms
173
174 SetName(name);
175 SetTitle(title);
176
177 TString numstrn = fName + " Numerator"; //name of the
178 //numerator histogram
179
180 TString numstrt = fTitle + " Numerator"; //title of the
181 //numerator histogram
182
183 TString denstrn = fName + " Denominator";//name of the
184 //denominator histogram
185
186 TString denstrt = fTitle + " Denominator";//title of the
187 //denominator histogram
188
189
190 GetNumerator()->SetName(numstrn.Data());
191 GetNumerator()->SetTitle(numstrt.Data());
192
193 GetDenominator()->SetName(denstrn.Data());
194 GetDenominator()->SetTitle(denstrt.Data());
195
196
197 }
26f1270c 198/******************************************************************/
199
c41732dc 200void AliHBTFunction::InitFunction()
26f1270c 201{
202//Iniotializes fctn.: Resets histograms
203//In case histograms are not created in ctor, builds with default parameters
3976deed 204 Info("InitFunction","%s",GetName());
26f1270c 205 if ( !(GetNumerator()&&GetDenominator()) ) BuildHistos();
206 GetNumerator()->Reset();
207 GetDenominator()->Reset();
3976deed 208
209 GetNumerator()->SetDirectory(0x0);
210 GetDenominator()->SetDirectory(0x0);
211 Info("InitFunction","Done");
26f1270c 212}
1b446896 213
214/******************************************************************/
215/******************************************************************/
216/******************************************************************/
217
27b3fe5d 218ClassImp( AliHBTOnePairFctn )
1b446896 219
220/******************************************************************/
221/******************************************************************/
222/******************************************************************/
223
27b3fe5d 224ClassImp( AliHBTTwoPairFctn)
1b446896 225
226/******************************************************************/
227/******************************************************************/
228/******************************************************************/
229
26f1270c 230ClassImp( AliHBTFunction1D )
1b446896 231
26f1270c 232const Int_t AliHBTFunction1D::fgkDefaultNBins = 100;
233const Float_t AliHBTFunction1D::fgkDefaultMin = 0.0;
234const Float_t AliHBTFunction1D::fgkDefaultMax = 0.15;
235const UInt_t AliHBTFunction1D::fgkDefaultNBinsToScale = 30;
236
237
238AliHBTFunction1D::AliHBTFunction1D():
239 fNumerator(0x0),
240 fDenominator(0x0),
241 fNBinsToScale(fgkDefaultNBinsToScale)
2c33acf3 242{//default constructor
26f1270c 243}
244/******************************************************************/
245
246AliHBTFunction1D::AliHBTFunction1D(Int_t nbins, Float_t maxXval, Float_t minXval):
247 fNumerator(0x0),
248 fDenominator(0x0),
249 fNBinsToScale(fgkDefaultNBinsToScale)
250{
1b446896 251 //Constructor of Two Part One Dimentional Function
252 // nbins: number of bins in histograms - default 100
253 // maxXval and minXval: range of histgram(s) default 0 - 0.15 (GeV)
26f1270c 254 BuildHistos(nbins,maxXval,minXval);
255}
256/******************************************************************/
257AliHBTFunction1D::AliHBTFunction1D(const Char_t *name, const Char_t *title):
258 AliHBTFunction(name,title),
259 fNumerator(0x0),
260 fDenominator(0x0),
261 fNBinsToScale(fgkDefaultNBinsToScale)
2c33acf3 262{//constructor
ba95ae3f 263}
1b446896 264/******************************************************************/
26f1270c 265AliHBTFunction1D::AliHBTFunction1D(const Char_t *name, const Char_t *title,
266 Int_t nbins, Float_t maxXval, Float_t minXval):
267 AliHBTFunction(name,title),
268 fNumerator(0x0),
269 fDenominator(0x0),
270 fNBinsToScale(fgkDefaultNBinsToScale)
271{
2c33acf3 272//constructor
273 BuildHistos(nbins,maxXval,minXval);
26f1270c 274}
275/******************************************************************/
276
28cf76fa 277AliHBTFunction1D::AliHBTFunction1D(const AliHBTFunction1D& source):
278 AliHBTFunction(source)
279{
280// Copy constructor needed by the coding conventions byt not used
281 Fatal("AliHBTFunction1D(const AliHBTFunction1D&)","Cpy ctor not usable.");
282}
283/******************************************************************/
284
285AliHBTFunction1D& AliHBTFunction1D::operator= (const AliHBTFunction1D & /*source*/)
286{
287// Assignment needed by the coding conventions byt not used
288 Fatal("Assignment operator","not implemented");
289 return * this;
290 }
291/******************************************************************/
292
26f1270c 293AliHBTFunction1D::~AliHBTFunction1D()
1b446896 294{
2c33acf3 295//destructor
1b446896 296 delete fNumerator;
297 delete fDenominator;
298}
26f1270c 299/******************************************************************/
300void AliHBTFunction1D::BuildHistos()
301{
2c33acf3 302//builds histograms with default settings
26f1270c 303 BuildHistos(fgkDefaultNBins,fgkDefaultMax,fgkDefaultMin);
304}
305
976183fd 306/******************************************************************/
307
26f1270c 308void AliHBTFunction1D::BuildHistos(Int_t nbins, Float_t max, Float_t min)
976183fd 309{
2c33acf3 310//builds numarator and denominator hitograms
26f1270c 311 TString numstr = fName + " Numerator"; //title and name of the
312 //numerator histogram
313 TString denstr = fName + " Denominator";//title and name of the
314 //denominator histogram
315 fNumerator = new TH1D(numstr.Data(),numstr.Data(),nbins,min,max);
316 fDenominator = new TH1D(denstr.Data(),denstr.Data(),nbins,min,max);
317
318 fNumerator->Sumw2();
319 fDenominator->Sumw2();
976183fd 320}
321/******************************************************************/
976183fd 322
26f1270c 323Double_t AliHBTFunction1D::Scale()
324{
325 //Calculates the factor that should be used to scale
326 //quatience of fNumerator and fDenominator to 1 at tail
327 return Scale(fNumerator,fDenominator);
328}
976183fd 329/******************************************************************/
26f1270c 330
331Double_t AliHBTFunction1D::Scale(TH1D* num,TH1D* den)
976183fd 332{
26f1270c 333 //Calculates the factor that should be used to scale
334 //quatience of num and den to 1 at tail
335
18c3af34 336 if (AliHBTParticle::GetDebug()>0) Info("Scale","Enetered Scale()");
26f1270c 337 if(!num)
976183fd 338 {
339 Error("Scale","No numerator");
340 return 0.0;
341 }
26f1270c 342 if(!den)
976183fd 343 {
344 Error("Scale","No denominator");
345 return 0.0;
346 }
347
348 if(fNBinsToScale < 1)
349 {
976183fd 350 Error("Scale","Number of bins for scaling is smaller thnan 1");
0798b21e 351 return 0.0;
976183fd 352 }
26f1270c 353 UInt_t nbins = num->GetNbinsX();
976183fd 354 if (fNBinsToScale > nbins)
355 {
356 Error("Scale","Number of bins for scaling is bigger thnan number of bins in histograms");
357 return 0.0;
358 }
18c3af34 359 if (AliHBTParticle::GetDebug()>0) Info("Scale","No errors detected");
976183fd 360
dd82cadc 361 Double_t densum = 0.0;
362 Double_t numsum = 0.0;
2674b9ff 363
976183fd 364 Int_t offset = nbins - fNBinsToScale - 1;
2c33acf3 365
366 for (UInt_t i = offset; i< nbins; i++)
976183fd 367 {
26f1270c 368 if ( num->GetBinContent(i) > 0.0 )
976183fd 369 {
dd82cadc 370 densum = fDenominator->GetBinContent(i);
371 numsum = fNumerator->GetBinContent(i);
976183fd 372 }
373 }
2674b9ff 374
dd82cadc 375 if(AliHBTParticle::GetDebug() > 0)
376 Info("Scale","numsum=%f densum=%f fNBinsToScaleX=%d",numsum,densum,fNBinsToScale);
2674b9ff 377
dd82cadc 378 if (numsum == 0) return 0.0;
379 Double_t ret = densum/numsum;
976183fd 380
18c3af34 381 if(AliHBTParticle::GetDebug() > 0) Info("Scale","returning %f",ret);
2674b9ff 382 return ret;
976183fd 383}
384
1b446896 385/******************************************************************/
386/******************************************************************/
387/******************************************************************/
388
26f1270c 389//____________________
390///////////////////////////////////////////////////////
391// //
392// AliHBTFunction2D //
393// //
394// Base Calss for 2-dimensinal Functions //
395// //
396// Piotr.Skowronski@cern.ch //
397// http://alisoft.cern.ch/people/skowron/analyzer //
398// //
399///////////////////////////////////////////////////////
1b446896 400
1db320d4 401ClassImp( AliHBTFunction2D )
1b446896 402
26f1270c 403const Int_t AliHBTFunction2D::fgkDefaultNBinsX = 200;//default number of Bins in X axis in histograms
404const Float_t AliHBTFunction2D::fgkDefaultMinX = 0.0;//Default min value of X axis in histograms
405const Float_t AliHBTFunction2D::fgkDefaultMaxX = 1.5;//Default max value of X axis inhistograms
406
407const Int_t AliHBTFunction2D::fgkDefaultNBinsY = 200;//default number of Bins in histograms
408const Float_t AliHBTFunction2D::fgkDefaultMinY = -0.15;//Default min value of histograms
409const Float_t AliHBTFunction2D::fgkDefaultMaxY = 0.15;//Default max value of histograms
410
411const UInt_t AliHBTFunction2D::fgkDefaultNBinsToScaleX = 30;//Default number of X bins used for scaling to tale
412const UInt_t AliHBTFunction2D::fgkDefaultNBinsToScaleY = 30;//Default number of bins used for scaling to tale
413
414/******************************************************************/
415AliHBTFunction2D::AliHBTFunction2D():
416 fNumerator(0x0),
417 fDenominator(0x0),
418 fNBinsToScaleX(fgkDefaultNBinsToScaleX),
419 fNBinsToScaleY(fgkDefaultNBinsToScaleY)
420{//default constructor
421}
422/******************************************************************/
423AliHBTFunction2D::AliHBTFunction2D(const Char_t *name, const Char_t *title):
424 AliHBTFunction(name,title),
425 fNumerator(0x0),
426 fDenominator(0x0),
427 fNBinsToScaleX(fgkDefaultNBinsToScaleX),
428 fNBinsToScaleY(fgkDefaultNBinsToScaleY)
429{//constructor
430}
431/******************************************************************/
432
433AliHBTFunction2D::AliHBTFunction2D(Int_t nXbins, Double_t maxXval, Double_t minXval,
434 Int_t nYbins, Double_t maxYval, Double_t minYval):
435 fNumerator(0x0),
436 fDenominator(0x0),
437 fNBinsToScaleX(fgkDefaultNBinsToScaleX),
438 fNBinsToScaleY(fgkDefaultNBinsToScaleY)
1b446896 439{
26f1270c 440 BuildHistos(nXbins,maxXval,minXval,nYbins,maxYval,minYval);
441}
442/******************************************************************/
1b446896 443
26f1270c 444AliHBTFunction2D::AliHBTFunction2D(const Char_t *name, const Char_t *title,
445 Int_t nXbins, Double_t maxXval, Double_t minXval,
446 Int_t nYbins, Double_t maxYval, Double_t minYval):
447 AliHBTFunction(name,title),
448 fNumerator(0x0),
449 fDenominator(0x0),
450 fNBinsToScaleX(fgkDefaultNBinsToScaleX),
451 fNBinsToScaleY(fgkDefaultNBinsToScaleY)
452{
453 BuildHistos(nXbins,maxXval,minXval,nYbins,maxYval,minYval);
1b446896 454}
26f1270c 455/******************************************************************/
28cf76fa 456AliHBTFunction2D::AliHBTFunction2D(const AliHBTFunction2D & source):
457 AliHBTFunction(source)
458{
459// Copy constructor needed by the coding conventions byt not used
460 Fatal("AliHBTFunction2D(const AliHBTFunction2D&)","Cpy ctor not usable.");
461}
462/******************************************************************/
463
464AliHBTFunction2D& AliHBTFunction2D::operator= (const AliHBTFunction2D& /*source*/) {
465// Assignment needed by the coding conventions byt not used
466 Fatal("Assignment operator","not implemented");
467 return * this;
468}
469/******************************************************************/
26f1270c 470
471AliHBTFunction2D::~AliHBTFunction2D()
1b446896 472{
28cf76fa 473//dtor
1b446896 474 delete fNumerator;
475 delete fDenominator;
476}
26f1270c 477/******************************************************************/
478
479void AliHBTFunction2D::BuildHistos()
1b446896 480{
26f1270c 481//Creates default histograms
482 BuildHistos(fgkDefaultNBinsX,fgkDefaultMaxX,fgkDefaultMinX,
483 fgkDefaultNBinsY,fgkDefaultMaxY,fgkDefaultMinY);
1b446896 484}
26f1270c 485/******************************************************************/
1b446896 486
26f1270c 487void AliHBTFunction2D::BuildHistos(Int_t nxbins, Float_t xmax, Float_t xmin,
488 Int_t nybins, Float_t ymax, Float_t ymin)
1b446896 489{
28cf76fa 490//Builds numerator and denominator histograms (2d-case)
26f1270c 491 TString numstr = fName + " Numerator"; //title and name of the
492 //numerator histogram
493 TString denstr = fName + " Denominator";//title and name of the
494 //denominator histogram
495
496 fNumerator = new TH2D(numstr.Data(),numstr.Data(),
497 nxbins,xmin,xmax,nybins,ymin,ymax);
498
499 fDenominator = new TH2D(denstr.Data(),denstr.Data(),
500 nxbins,xmin,xmax,nybins,ymin,ymax);
501
502 fNumerator->Sumw2();
503 fDenominator->Sumw2();
504}
505/******************************************************************/
1b446896 506
26f1270c 507void AliHBTFunction2D::SetNumberOfBinsToScale(UInt_t xn, UInt_t yn)
508{
509//defines area used for scaling factor calculation
510 fNBinsToScaleX = xn;
511 fNBinsToScaleY = yn;
1b446896 512}
26f1270c 513/******************************************************************/
1b446896 514
26f1270c 515Double_t AliHBTFunction2D::Scale()
516{
28cf76fa 517// Calculates the factor that should be used to scale
518// quatience of fNumerator and fDenominator to 1 at
519// given region
18c3af34 520 if (AliHBTParticle::GetDebug()>0) Info("Scale","Enetered Scale()");
26f1270c 521 if(!fNumerator)
522 {
523 Error("Scale","No numerator");
524 return 0.0;
525 }
526 if(!fDenominator)
527 {
528 Error("Scale","No denominator");
529 return 0.0;
530 }
531
532 if( (fNBinsToScaleX < 1) || (fNBinsToScaleY < 1) )
533 {
26f1270c 534 Error("Scale","Number of bins for scaling is smaller thnan 1");
0798b21e 535 return 0.0;
26f1270c 536 }
537 UInt_t nbinsX = fNumerator->GetNbinsX();
538 if (fNBinsToScaleX > nbinsX)
539 {
540 Error("Scale","Number of X bins for scaling is bigger thnan number of bins in histograms");
541 return 0.0;
542 }
543
544 UInt_t nbinsY = fNumerator->GetNbinsX();
545 if (fNBinsToScaleY > nbinsY)
546 {
547 Error("Scale","Number of Y bins for scaling is bigger thnan number of bins in histograms");
548 return 0.0;
549 }
550
18c3af34 551 if (AliHBTParticle::GetDebug()>0) Info("Scale","No errors detected");
26f1270c 552
553 Int_t offsetX = nbinsX - fNBinsToScaleX - 1; //bin that we start loop over bins in axis X
554 Int_t offsetY = nbinsY - fNBinsToScaleY - 1; //bin that we start loop over bins in axis X
555
dd82cadc 556 Double_t densum = 0.0;
557 Double_t numsum = 0.0;
26f1270c 558
2c33acf3 559 for (UInt_t j = offsetY; j< nbinsY; j++)
560 for (UInt_t i = offsetX; i< nbinsX; i++)
26f1270c 561 {
562 if ( fNumerator->GetBinContent(i,j) > 0.0 )
563 {
dd82cadc 564 densum = fDenominator->GetBinContent(i,j);
565 numsum = fNumerator->GetBinContent(i,j);
26f1270c 566 }
567 }
568
dd82cadc 569 if(AliHBTParticle::GetDebug() > 0)
570 Info("Scale","numsum=%f densum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d",numsum,densum,fNBinsToScaleX,fNBinsToScaleY);
26f1270c 571
dd82cadc 572 if (numsum == 0) return 0.0;
573 Double_t ret = densum/numsum;
26f1270c 574
18c3af34 575 if(AliHBTParticle::GetDebug() > 0) Info("Scale","returning %f",ret);
26f1270c 576 return ret;
577}
1b446896 578
579/******************************************************************/
580/******************************************************************/
581/******************************************************************/
582
26f1270c 583//____________________
584///////////////////////////////////////////////////////
585// //
586// AliHBTFunction3D //
587// //
588// Base Calss for 3-dimensinal Functions //
589// //
590// Piotr.Skowronski@cern.ch //
591// http://alisoft.cern.ch/people/skowron/analyzer //
592// //
593///////////////////////////////////////////////////////
1b446896 594
26f1270c 595ClassImp( AliHBTFunction3D)
1b446896 596
26f1270c 597const Int_t AliHBTFunction3D::fgkDefaultNBinsX = 200;//default number of Bins in X axis in histograms
598const Float_t AliHBTFunction3D::fgkDefaultMinX = 0.0;//Default min value of X axis in histograms
599const Float_t AliHBTFunction3D::fgkDefaultMaxX = 1.5;//Default max value of X axis inhistograms
1b446896 600
26f1270c 601const Int_t AliHBTFunction3D::fgkDefaultNBinsY = 200;//default number of Bins in histograms
602const Float_t AliHBTFunction3D::fgkDefaultMinY = -0.15;//Default min value of histograms
603const Float_t AliHBTFunction3D::fgkDefaultMaxY = 0.15;//Default max value of histograms
604
605const Int_t AliHBTFunction3D::fgkDefaultNBinsZ = 200;//default number of Bins in histograms
606const Float_t AliHBTFunction3D::fgkDefaultMinZ = -0.15;//Default min value of histograms
607const Float_t AliHBTFunction3D::fgkDefaultMaxZ = 0.15;//Default max value of histograms
608
609const UInt_t AliHBTFunction3D::fgkDefaultNBinsToScaleX = 30;//Default number of X bins used for scaling to tale
610const UInt_t AliHBTFunction3D::fgkDefaultNBinsToScaleY = 30;//Default number of bins used for scaling to tale
611const UInt_t AliHBTFunction3D::fgkDefaultNBinsToScaleZ = 30;//Default number of bins used for scaling to tale
612
2c33acf3 613AliHBTFunction3D::AliHBTFunction3D():
614 fNumerator(0x0),
615 fDenominator(0x0),
616 fNBinsToScaleX(fgkDefaultNBinsToScaleX),
617 fNBinsToScaleY(fgkDefaultNBinsToScaleY),
618 fNBinsToScaleZ(fgkDefaultNBinsToScaleZ)
619{
620 //constructor
621}
622/******************************************************************/
623
624AliHBTFunction3D::AliHBTFunction3D(const Char_t *name, const Char_t *title):
625 AliHBTFunction(name,title),
626 fNumerator(0x0),
627 fDenominator(0x0),
628 fNBinsToScaleX(fgkDefaultNBinsToScaleX),
629 fNBinsToScaleY(fgkDefaultNBinsToScaleY),
630 fNBinsToScaleZ(fgkDefaultNBinsToScaleZ)
631{
632 //constructor
633}
634/******************************************************************/
26f1270c 635
636AliHBTFunction3D::AliHBTFunction3D(Int_t nXbins, Double_t maxXval, Double_t minXval,
637 Int_t nYbins, Double_t maxYval, Double_t minYval,
638 Int_t nZbins, Double_t maxZval, Double_t minZval):
639 fNumerator(0x0),
640 fDenominator(0x0),
641 fNBinsToScaleX(fgkDefaultNBinsToScaleX),
642 fNBinsToScaleY(fgkDefaultNBinsToScaleY),
643 fNBinsToScaleZ(fgkDefaultNBinsToScaleZ)
644{
2c33acf3 645 //constructor
646 BuildHistos( nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval);
1b446896 647}
ba95ae3f 648/******************************************************************/
7836ee94 649
2c33acf3 650AliHBTFunction3D::AliHBTFunction3D(const Char_t *name, const Char_t *title,
651 Int_t nXbins, Double_t maxXval, Double_t minXval,
652 Int_t nYbins, Double_t maxYval, Double_t minYval,
653 Int_t nZbins, Double_t maxZval, Double_t minZval):
654 AliHBTFunction(name,title),
655 fNumerator(0x0),
656 fDenominator(0x0),
657 fNBinsToScaleX(fgkDefaultNBinsToScaleX),
658 fNBinsToScaleY(fgkDefaultNBinsToScaleY),
659 fNBinsToScaleZ(fgkDefaultNBinsToScaleZ)
660{
661 //constructor
662 BuildHistos( nXbins,maxXval,minXval,nYbins,maxYval,minYval,nZbins,maxZval,minZval);
663}
664/******************************************************************/
665
28cf76fa 666AliHBTFunction3D::AliHBTFunction3D(const AliHBTFunction3D& source):
667 AliHBTFunction(source)
668{
669// Copy constructor needed by the coding conventions byt not used
670 Fatal("AliHBTFunction3D(const AliHBTFunction3D&)","Cpy ctor not usable.");
671}
672/******************************************************************/
673
674AliHBTFunction3D& AliHBTFunction3D::operator= (const AliHBTFunction3D & /*source*/)
675{
676// Assignment needed by the coding conventions byt not used
677 Fatal("Assignment operator","not implemented");
678 return * this;
679 }
680/******************************************************************/
681
2c33acf3 682
26f1270c 683AliHBTFunction3D::~AliHBTFunction3D()
7836ee94 684{
685 delete fNumerator;
686 delete fDenominator;
687}
ba95ae3f 688/******************************************************************/
7836ee94 689
26f1270c 690void AliHBTFunction3D::BuildHistos()
691{
692//Creates default histograms
693 BuildHistos(fgkDefaultNBinsX,fgkDefaultMaxX,fgkDefaultMinX,
694 fgkDefaultNBinsY,fgkDefaultMaxY,fgkDefaultMinY,
695 fgkDefaultNBinsZ,fgkDefaultMaxZ,fgkDefaultMinZ);
696}
ba95ae3f 697/******************************************************************/
ba95ae3f 698
26f1270c 699void AliHBTFunction3D::BuildHistos(Int_t nxbins, Float_t xmax, Float_t xmin,
700 Int_t nybins, Float_t ymax, Float_t ymin,
701 Int_t nzbins, Float_t zmax, Float_t zmin)
702{
6e8d850a 703 //Builds numerator and denominator histograms (3d-case)
ba95ae3f 704 TString numstr = fName + " Numerator"; //title and name of the
705 //numerator histogram
706 TString denstr = fName + " Denominator";//title and name of the
707 //denominator histogram
708
dd82cadc 709 fNumerator = new TH3F(numstr.Data(),numstr.Data(),
bed069a4 710 nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax);
ba95ae3f 711
dd82cadc 712 fDenominator = new TH3F(denstr.Data(),denstr.Data(),
bed069a4 713 nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax);
ba95ae3f 714
715 fNumerator->Sumw2();
716 fDenominator->Sumw2();
ba95ae3f 717}
ba95ae3f 718
4e871a8a 719/******************************************************************/
26f1270c 720
721Double_t AliHBTFunction3D::Scale()
4e871a8a 722{
6e8d850a 723 // Calculates the factor that should be used to scale
724 // quatience of fNumerator and fDenominator to 1 at
725 // given volume
18c3af34 726 if (AliHBTParticle::GetDebug()>0) Info("Scale","Enetered Scale()");
4e871a8a 727 if(!fNumerator)
728 {
729 Error("Scale","No numerator");
730 return 0.0;
731 }
732 if(!fDenominator)
733 {
734 Error("Scale","No denominator");
735 return 0.0;
736 }
737
26f1270c 738 if( (fNBinsToScaleX < 1) || (fNBinsToScaleY < 1) || (fNBinsToScaleZ < 1))
4e871a8a 739 {
4e871a8a 740 Error("Scale","Number of bins for scaling is smaller thnan 1");
0798b21e 741 return 0.0;
4e871a8a 742 }
26f1270c 743 UInt_t nbinsX = fNumerator->GetNbinsX();
744 if (fNBinsToScaleX > nbinsX)
4e871a8a 745 {
26f1270c 746 Error("Scale","Number of X bins for scaling is bigger thnan number of bins in histograms");
747 return 0.0;
748 }
749
750 UInt_t nbinsY = fNumerator->GetNbinsX();
751 if (fNBinsToScaleY > nbinsY)
752 {
753 Error("Scale","Number of Y bins for scaling is bigger thnan number of bins in histograms");
754 return 0.0;
755 }
756
757 UInt_t nbinsZ = fNumerator->GetNbinsZ();
758 if (fNBinsToScaleZ > nbinsZ)
759 {
760 Error("Scale","Number of Z bins for scaling is bigger thnan number of bins in histograms");
4e871a8a 761 return 0.0;
762 }
26f1270c 763
18c3af34 764 if (AliHBTParticle::GetDebug()>0) Info("Scale","No errors detected");
4e871a8a 765
26f1270c 766 Int_t offsetX = nbinsX - fNBinsToScaleX - 1; //bin that we start loop over bins in axis X
196e34f6 767 Int_t offsetY = nbinsY - fNBinsToScaleY - 1; //bin that we start loop over bins in axis Y
768 Int_t offsetZ = nbinsZ - fNBinsToScaleZ - 1; //bin that we start loop over bins in axis Z
26f1270c 769
dd82cadc 770 Double_t densum = 0.0;
771 Double_t numsum = 0.0;
4e871a8a 772
196e34f6 773 for (UInt_t k = offsetZ; k<nbinsZ; k++)
774 for (UInt_t j = offsetY; j<nbinsY; j++)
775 for (UInt_t i = offsetX; i<nbinsX; i++)
26f1270c 776 {
777 if ( fNumerator->GetBinContent(i,j,k) > 0.0 )
778 {
dd82cadc 779
780 densum = fDenominator->GetBinContent(i,j,k);
781 numsum = fNumerator->GetBinContent(i,j,k);
26f1270c 782 }
783 }
4e871a8a 784
18c3af34 785 if(AliHBTParticle::GetDebug() > 0)
dd82cadc 786 Info("Scale","numsum=%f densum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d fNBinsToScaleZ=%d",
787 numsum,densum,fNBinsToScaleX,fNBinsToScaleY,fNBinsToScaleZ);
4e871a8a 788
dd82cadc 789 if (numsum == 0) return 0.0;
790 Double_t ret = densum/numsum;
4e871a8a 791
18c3af34 792 if(AliHBTParticle::GetDebug() > 0) Info("Scale","returning %f",ret);
4e871a8a 793 return ret;
794}
2c33acf3 795/******************************************************************/
796
797void AliHBTFunction3D::SetNumberOfBinsToScale(UInt_t xn, UInt_t yn,UInt_t zn)
798{
799//sets up the volume to be used for scaling to tail
800 fNBinsToScaleX = xn;
801 fNBinsToScaleY = yn;
802 fNBinsToScaleZ = zn;
803}
ba95ae3f 804
1b446896 805/******************************************************************/
806/******************************************************************/
807/******************************************************************/
26f1270c 808/******************************************************************/
809/******************************************************************/
810/******************************************************************/
811/******************************************************************/
812/******************************************************************/
813/******************************************************************/
1b446896 814
26f1270c 815//____________________
816///////////////////////////////////////////////////////
817// //
818// AliHBTOnePairFctn1D //
819// //
820// Base Calss for 1-dimensinal Functions that need //
821// one pair to fill function //
822// //
823// Piotr.Skowronski@cern.ch //
824// http://alisoft.cern.ch/people/skowron/analyzer //
825// //
826///////////////////////////////////////////////////////
1b446896 827
26f1270c 828ClassImp( AliHBTOnePairFctn1D )
829/******************************************************************/
1b446896 830
26f1270c 831AliHBTOnePairFctn1D::AliHBTOnePairFctn1D(Int_t nbins, Float_t maxXval, Float_t minXval):
832 AliHBTFunction1D(nbins,maxXval,minXval)
1b446896 833{
aa4e0a70 834 //constructor
26f1270c 835}
836/******************************************************************/
1b446896 837
26f1270c 838AliHBTOnePairFctn1D::AliHBTOnePairFctn1D(const Char_t *name, const Char_t *title):
839 AliHBTFunction1D(name,title)
840{
aa4e0a70 841
26f1270c 842}
843/******************************************************************/
844
845AliHBTOnePairFctn1D::AliHBTOnePairFctn1D(const Char_t *name, const Char_t *title,
846 Int_t nbins, Float_t maxXval, Float_t minXval):
847 AliHBTFunction1D(name,title,nbins,maxXval,minXval)
848{
aa4e0a70 849 //constructor
26f1270c 850}
851/******************************************************************/
852
853void AliHBTOnePairFctn1D::ProcessSameEventParticles(AliHBTPair* pair)
854{
6e8d850a 855 //Fills the numerator using pair from the same event
26f1270c 856 pair = CheckPair(pair);
857 if(pair) fNumerator->Fill(GetValue(pair));
858}
859/******************************************************************/
860void AliHBTOnePairFctn1D::ProcessDiffEventParticles(AliHBTPair* pair)
861 {
6e8d850a 862 //Fills the denumerator using mixed pairs
26f1270c 863 pair = CheckPair(pair);
864 if(pair) fDenominator->Fill(GetValue(pair));
865 }
866
867/******************************************************************/
868/******************************************************************/
869/******************************************************************/
870
871//____________________
872///////////////////////////////////////////////////////
873// //
874// AliHBTOnePairFctn2D //
875// //
876// Base Calss for 2-dimensinal Functions that need //
877// one pair to fill function //
878// //
879// Piotr.Skowronski@cern.ch //
880// http://alisoft.cern.ch/people/skowron/analyzer //
881// //
882///////////////////////////////////////////////////////
883
884ClassImp( AliHBTOnePairFctn2D )
885/******************************************************************/
886
887AliHBTOnePairFctn2D::AliHBTOnePairFctn2D(const Char_t *name, const Char_t *title):
888 AliHBTFunction2D(name,title)
889{
aa4e0a70 890 //constructor
26f1270c 891}
892/******************************************************************/
893
894AliHBTOnePairFctn2D::AliHBTOnePairFctn2D(Int_t nXbins, Double_t maxXval, Double_t minXval,
895 Int_t nYbins, Double_t maxYval, Double_t minYval):
896 AliHBTFunction2D(nXbins, maxXval, minXval, nYbins, maxYval, minYval)
897{
aa4e0a70 898 //constructor
26f1270c 899}
900/******************************************************************/
901
902AliHBTOnePairFctn2D::AliHBTOnePairFctn2D(const Char_t *name, const Char_t *title,
903 Int_t nXbins, Double_t maxXval, Double_t minXval,
904 Int_t nYbins, Double_t maxYval, Double_t minYval):
905 AliHBTFunction2D(name,title, nXbins, maxXval, minXval, nYbins, maxYval, minYval)
906{
aa4e0a70 907 //constructor
26f1270c 908}
909/******************************************************************/
910
911void AliHBTOnePairFctn2D::ProcessSameEventParticles(AliHBTPair* pair)
912{
6e8d850a 913 // Fills the numerator using pairs from the same event
26f1270c 914 pair = CheckPair(pair);
915 if(pair)
916 {
917 Double_t x,y;
918 GetValues(pair,x,y);
919 fNumerator->Fill(x,y);
920 }
921}
922/******************************************************************/
923
924void AliHBTOnePairFctn2D::ProcessDiffEventParticles(AliHBTPair* pair)
925{
6e8d850a 926 // Fills the denumerator using mixed pairs
26f1270c 927 pair = CheckPair(pair);
928 if(pair)
929 {
930 Double_t x,y;
931 GetValues(pair,x,y);
932 fDenominator->Fill(x,y);
933 }
934}
935/******************************************************************/
936/******************************************************************/
937/******************************************************************/
938/******************************************************************/
939//____________________
940///////////////////////////////////////////////////////
941// //
942// AliHBTOnePairFctn3D //
943// //
944// Base Calss for 3-dimensinal Functions that need //
945// one pair to fill function //
946// //
947// Piotr.Skowronski@cern.ch //
948// http://alisoft.cern.ch/people/skowron/analyzer //
949// //
950///////////////////////////////////////////////////////
951ClassImp( AliHBTOnePairFctn3D)
952
953/******************************************************************/
954
955AliHBTOnePairFctn3D::AliHBTOnePairFctn3D(const Char_t *name, const Char_t *title):
956 AliHBTFunction3D(name,title)
1b446896 957{
aa4e0a70 958 //constructor
1b446896 959}
26f1270c 960/******************************************************************/
961
962AliHBTOnePairFctn3D::AliHBTOnePairFctn3D(Int_t nXbins, Double_t maxXval, Double_t minXval,
963 Int_t nYbins, Double_t maxYval, Double_t minYval,
964 Int_t nZbins, Double_t maxZval, Double_t minZval):
965 AliHBTFunction3D(nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval)
966{
aa4e0a70 967 //constructor
26f1270c 968}
969/******************************************************************/
970
971AliHBTOnePairFctn3D::AliHBTOnePairFctn3D(const Char_t *name, const Char_t *title,
972 Int_t nXbins, Double_t maxXval, Double_t minXval,
973 Int_t nYbins, Double_t maxYval, Double_t minYval,
974 Int_t nZbins, Double_t maxZval, Double_t minZval):
975 AliHBTFunction3D(name,title,nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval)
976{
aa4e0a70 977 //constructor
26f1270c 978}
979/******************************************************************/
980
981void AliHBTOnePairFctn3D::ProcessSameEventParticles(AliHBTPair* pair)
982{
983//Reacts on pair coming from same event (real pairs)
984//and fills numerator histogram
985 pair = CheckPair(pair);
986 if( pair )
987 {
988 Double_t x,y,z;
989 GetValues(pair,x,y,z);
990 fNumerator->Fill(x,y,z);
991 }
992}
993/******************************************************************/
994
995void AliHBTOnePairFctn3D::ProcessDiffEventParticles(AliHBTPair* pair)
996{
997//Reacts on pair coming from different events (mixed pairs)
998//and fills denominator histogram
999 pair = CheckPair(pair);
1000 if( pair )
1001 {
1002 Double_t x,y,z;
1003 GetValues(pair,x,y,z);
1004 fDenominator->Fill(x,y,z);
1005 }
1006}
1007
1008/******************************************************************/
1009/******************************************************************/
1010/******************************************************************/
1011
1012//____________________
1013///////////////////////////////////////////////////////
1014// //
1015// AliHBTTwoPairFctn1D //
1016// //
1017// Base Calss for 1-dimensinal Functions that need //
1018// two pair (simulated and reconstructed) //
1019// to fill function //
1020// //
1021// Piotr.Skowronski@cern.ch //
1022// http://alisoft.cern.ch/people/skowron/analyzer //
1023// //
1024///////////////////////////////////////////////////////
1025ClassImp(AliHBTTwoPairFctn1D)
1026/******************************************************************/
1027
1028AliHBTTwoPairFctn1D::AliHBTTwoPairFctn1D(Int_t nbins, Float_t maxXval, Float_t minXval):
1029 AliHBTFunction1D(nbins,maxXval,minXval)
1030{
aa4e0a70 1031 //constructor
26f1270c 1032}
1033/******************************************************************/
1034
1035AliHBTTwoPairFctn1D::AliHBTTwoPairFctn1D(const Char_t *name, const Char_t *title):
1036 AliHBTFunction1D(name,title)
1037{
aa4e0a70 1038 //constructor
26f1270c 1039}
1040/******************************************************************/
1041
1042AliHBTTwoPairFctn1D::AliHBTTwoPairFctn1D(const Char_t *name, const Char_t *title,
1043 Int_t nbins, Float_t maxXval, Float_t minXval):
1044 AliHBTFunction1D(name,title,nbins,maxXval,minXval)
1045{
aa4e0a70 1046 //constructor
26f1270c 1047}
1048/******************************************************************/
1049
1050void AliHBTTwoPairFctn1D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
1051{
6e8d850a 1052 // Fills the numerator using pairs from the same event
26f1270c 1053 partpair = CheckPair(partpair);
0bb07108 1054 if( partpair == 0x0) return;
1055
7513c9e5 1056 if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair
1057 trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
0bb07108 1058
1059 Double_t x = GetValue(trackpair,partpair);
1060 fNumerator->Fill(x);
26f1270c 1061}
1062/******************************************************************/
1063
1064void AliHBTTwoPairFctn1D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
1065{
6e8d850a 1066 // Fills the denumerator usin mixed pairs
26f1270c 1067 partpair = CheckPair(partpair);
0bb07108 1068 if( partpair == 0x0) return;
1069
7513c9e5 1070 if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair
1071 trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
0bb07108 1072
1073 Double_t x = GetValue(trackpair,partpair);
1074 fDenominator->Fill(x);
26f1270c 1075}
1076/******************************************************************/
1077/******************************************************************/
1078/******************************************************************/
1079
1080//____________________
1081///////////////////////////////////////////////////////
1082// //
1083// AliHBTTwoPairFctn2D //
1084// //
1085// Base Calss for 2-dimensinal Functions that need //
1086// two pair (simulated and reconstructed) //
1087// to fill function //
1088// //
1089// Piotr.Skowronski@cern.ch //
1090// http://alisoft.cern.ch/people/skowron/analyzer //
1091// //
1092///////////////////////////////////////////////////////
1093
1094ClassImp(AliHBTTwoPairFctn2D)
1095
1096/******************************************************************/
1097
1098AliHBTTwoPairFctn2D::AliHBTTwoPairFctn2D(const Char_t *name, const Char_t *title):
1099 AliHBTFunction2D(name,title)
1100{
aa4e0a70 1101 //constructor
26f1270c 1102}
1103/******************************************************************/
1104
1105AliHBTTwoPairFctn2D::AliHBTTwoPairFctn2D(Int_t nXbins, Double_t maxXval, Double_t minXval,
1106 Int_t nYbins, Double_t maxYval, Double_t minYval):
1107 AliHBTFunction2D(nXbins, maxXval, minXval, nYbins, maxYval, minYval)
1108{
aa4e0a70 1109 //constructor
26f1270c 1110}
1111/******************************************************************/
1112
1113AliHBTTwoPairFctn2D::AliHBTTwoPairFctn2D(const Char_t *name, const Char_t *title,
1114 Int_t nXbins, Double_t maxXval, Double_t minXval,
1115 Int_t nYbins, Double_t maxYval, Double_t minYval):
1116 AliHBTFunction2D(name,title,nXbins, maxXval, minXval, nYbins, maxYval, minYval)
1117{
aa4e0a70 1118 //constructor
26f1270c 1119}
1120/******************************************************************/
1121
1122void AliHBTTwoPairFctn2D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
1b446896 1123{
2c33acf3 1124//processes pair of particles coming from a same events (real pair)
1125 partpair = CheckPair(partpair); //check cuts
0bb07108 1126 if (partpair == 0x0) return;
1127
7513c9e5 1128 if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair
1129 trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
0bb07108 1130
1131 Double_t x,y;
1132 GetValues(trackpair,partpair,x,y);
1133 fNumerator->Fill(x,y);
1b446896 1134}
26f1270c 1135/******************************************************************/
1b446896 1136
26f1270c 1137void AliHBTTwoPairFctn2D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
1b446896 1138{
2c33acf3 1139//processes pair of particles coming from a different events (mixed pair)
1b446896 1140 partpair = CheckPair(partpair);
0bb07108 1141 if (partpair == 0x0) return;
1142
7513c9e5 1143 if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair
1144 trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
0bb07108 1145
1146 Double_t x,y;
1147 GetValues(trackpair,partpair,x,y);
1148 fDenominator->Fill(x,y);
1b446896 1149}
1150
ba95ae3f 1151/******************************************************************/
1152/******************************************************************/
1153/******************************************************************/
26f1270c 1154
1155//____________________
1156///////////////////////////////////////////////////////
1157// //
1158// AliHBTTwoPairFctn3D //
1159// //
1160// Base Calss for 3-dimensinal Functions that need //
1161// two pair (simulated and reconstructed) //
1162// to fill function //
1163// //
1164// Piotr.Skowronski@cern.ch //
1165// http://alisoft.cern.ch/people/skowron/analyzer //
1166// //
1167///////////////////////////////////////////////////////
1168
ba95ae3f 1169ClassImp(AliHBTTwoPairFctn3D)
1170
26f1270c 1171/******************************************************************/
1172
1173AliHBTTwoPairFctn3D::AliHBTTwoPairFctn3D(const Char_t *name, const Char_t *title):
1174 AliHBTFunction3D(name,title)
1175{
aa4e0a70 1176 //constructor
26f1270c 1177}
1178/******************************************************************/
1179
1180AliHBTTwoPairFctn3D::AliHBTTwoPairFctn3D(Int_t nXbins, Double_t maxXval, Double_t minXval,
1181 Int_t nYbins, Double_t maxYval, Double_t minYval,
1182 Int_t nZbins, Double_t maxZval, Double_t minZval):
1183 AliHBTFunction3D(nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval)
1184{
aa4e0a70 1185 //constructor
26f1270c 1186}
1187/******************************************************************/
1188
1189AliHBTTwoPairFctn3D::AliHBTTwoPairFctn3D(const Char_t *name, const Char_t *title,
1190 Int_t nXbins, Double_t maxXval, Double_t minXval,
1191 Int_t nYbins, Double_t maxYval, Double_t minYval,
1192 Int_t nZbins, Double_t maxZval, Double_t minZval):
1193 AliHBTFunction3D(name,title,nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval)
1194{
aa4e0a70 1195 //constructor
26f1270c 1196}
1197/******************************************************************/
1198
1199void AliHBTTwoPairFctn3D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
ba95ae3f 1200{
6e8d850a 1201 // Fills th numerator using pairs from the same event
ba95ae3f 1202 partpair = CheckPair(partpair);
0bb07108 1203 if( partpair == 0x0) return;
1204
7513c9e5 1205 if (partpair->GetSwapedPair() == 0x0)//it means that CheckPair returned swapped pair
1206 trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
0bb07108 1207
1208 Double_t x,y,z;
1209 GetValues(trackpair,partpair,x,y,z);
1210 fNumerator->Fill(x,y,z);
1211
ba95ae3f 1212}
26f1270c 1213/******************************************************************/
ba95ae3f 1214
26f1270c 1215void AliHBTTwoPairFctn3D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
ba95ae3f 1216{
6e8d850a 1217 // Fills the denumerator using mixed pairs
ba95ae3f 1218 partpair = CheckPair(partpair);
0bb07108 1219 if( partpair == 0x0) return;
1220
7513c9e5 1221 if (partpair->GetSwapedPair() == 0x0)//it means that CheckPair returned swapped pair
1222 trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
0bb07108 1223
1224 Double_t x,y,z;
1225 GetValues(trackpair,partpair,x,y,z);
1226 fDenominator->Fill(x,y,z);
ba95ae3f 1227}
1228
26f1270c 1229/******************************************************************/
1230/******************************************************************/
1231/******************************************************************/
1232