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