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