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