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