X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HBTAN%2FAliHBTFunction.cxx;h=6a07f04f94cad07f8c08e63bc4a9b1d4c3285fa0;hb=fee887149f06dd548885cd5d1dc9ad2a71cff732;hp=c34c8056c384f503b98edc7c7004bf75d420a0be;hpb=2dc7203bd47e8aa157a04ac6571b43b89706d247;p=u%2Fmrichter%2FAliRoot.git diff --git a/HBTAN/AliHBTFunction.cxx b/HBTAN/AliHBTFunction.cxx index c34c8056c38..6a07f04f94c 100644 --- a/HBTAN/AliHBTFunction.cxx +++ b/HBTAN/AliHBTFunction.cxx @@ -1,12 +1,30 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/* $Id$ */ + #include "AliHBTFunction.h" -//____________________ -////////////////////////////////////////////////////////////////////// -// +#include "AliLog.h" + + +//-------------------------------------------------------------------- //AliHBTFunction //Author: Piotr Krzysztof Skowronski //Piotr.Skowronski@cern.ch -/*Base classes for HBT functions - +//Base classes for HBT functions +/* OnePairFctn Function TwoPairFctn | \ \ / | \ /|\ | \ \ / | \ / | \ @@ -19,19 +37,17 @@ | / \ \| | \ / \ | \ \ | / \ /\ | \ / \ | \ | | / \ / \ | \ / \ | \ | - | / \ / \ | \ / \ | \ | + | / \ / \ | \ / \ | \ | | / \/ \ | \/ \ | \ | OnePair1D OnePair2D OnePair3D TwoPair1D TwoPair2D TwoPair3D - four particle functions are intendent to be resolution functions: it is mecessary to have simulated particle pair corresponding to given recontructed track pair in order to calculate function simualted value and recontructed value, to be further histogrammed - */ -/////////////////////////////////////////////////////////////////////// +//--------------------------------------------------------------------- #include #include @@ -41,32 +57,74 @@ ClassImp( AliHBTFunction ) -AliHBTFunction::AliHBTFunction() +AliHBTFunction::AliHBTFunction(): + fPairCut(new AliAODPairEmptyCut()), //dummy cut + fWriteNumAndDen(kFALSE), + fAbs(kFALSE) { //Default constructor - fPairCut = new AliHBTEmptyPairCut(); //dummy cut } /******************************************************************/ -AliHBTFunction::AliHBTFunction(const char* name,const char* title):TNamed(name,title) + +AliHBTFunction::AliHBTFunction(const char* name,const char* title): + TNamed(name,title), + fPairCut(new AliAODPairEmptyCut()), //dummy cut + fWriteNumAndDen(kFALSE), + fAbs(kFALSE) +{ +//Constructor +} +/******************************************************************/ + +AliHBTFunction::AliHBTFunction(const AliHBTFunction & source): + TNamed(source), + fPairCut((AliAODPairCut*)source.fPairCut->Clone()), + fWriteNumAndDen(source.fWriteNumAndDen), + fAbs(source.fAbs) { - fPairCut = new AliHBTEmptyPairCut(); //dummy cut +// Copy constructor needed by the coding conventions } /******************************************************************/ AliHBTFunction::~AliHBTFunction() { //destructor + AliDebug(1,"Deleting"); delete fPairCut; } /******************************************************************/ +AliHBTFunction & AliHBTFunction::operator= (const AliHBTFunction & source) +{ + // Assignment needed by the coding conventions + delete fPairCut; + fPairCut = (AliAODPairCut*)source.fPairCut->Clone(); + fAbs = source.fAbs; + return * this; +} -void AliHBTFunction::Write() +Int_t AliHBTFunction::WriteFunction() { //writes result of the function to file - if (GetNumerator()) GetNumerator()->Write(); - if (GetDenominator()) GetDenominator()->Write(); + Int_t retval =0; + AliDebug(1,"Entering"); + if (fWriteNumAndDen) + { + AliDebug(1,"Writing Num & Den"); + if (GetNumerator()) GetNumerator()->Write(); + if (GetDenominator()) GetDenominator()->Write(); + AliDebug(1,"Writing Num & Den Done"); + } + AliDebug(1,"Getting Result"); TH1* res = GetResult(); - if (res) res->Write(); + AliDebug(1,"Getting Result Done"); + + if (res) + { + AliDebug(1,"Writing Result"); + retval = res->Write(); + AliDebug(1,"Writing Result Done"); + } + return retval; } /******************************************************************/ @@ -74,15 +132,16 @@ TH1* AliHBTFunction::GetRatio(Double_t normfactor) { //returns ratio of numerator and denominator // - if (gDebug>0) Info("GetRatio","Norm. Factor is %f for %s",normfactor,GetName()); + AliDebug(1,Form("Norm. Factor is %f for %s",normfactor,GetName())); if (normfactor == 0.0) { - Error("GetRatio","Scaling Factor is 0. Null poiner returned"); + AliError("Scaling Factor is 0. Null poiner returned"); return 0x0; } TString str = fName + " ratio"; TH1 *result = (TH1*)GetNumerator()->Clone(str.Data()); + result->SetDirectory(0x0); result->SetTitle(str.Data()); @@ -92,7 +151,7 @@ TH1* AliHBTFunction::GetRatio(Double_t normfactor) } /******************************************************************/ -void AliHBTFunction::SetPairCut(AliHBTPairCut* cut) +void AliHBTFunction::SetPairCut(AliAODPairCut* cut) { //Sets new Pair Cut. Old one is deleted //Note that it is created new object instead of simple pointer set @@ -104,11 +163,11 @@ void AliHBTFunction::SetPairCut(AliHBTPairCut* cut) if(!cut) { - Error("AliHBTFunction::SetPairCut","argument is NULL"); + AliError("argument is NULL"); return; } delete fPairCut; - fPairCut = (AliHBTPairCut*)cut->Clone(); + fPairCut = (AliAODPairCut*)cut->Clone(); } @@ -163,13 +222,41 @@ void AliHBTFunction::Rename(const Char_t * name, const Char_t * title) } /******************************************************************/ -void AliHBTFunction::Init() +void AliHBTFunction::InitFunction() { //Iniotializes fctn.: Resets histograms //In case histograms are not created in ctor, builds with default parameters + AliDebug(1,"Entering"); if ( !(GetNumerator()&&GetDenominator()) ) BuildHistos(); GetNumerator()->Reset(); GetDenominator()->Reset(); + + GetNumerator()->SetDirectory(0x0); + GetDenominator()->SetDirectory(0x0); + AliDebug(1,"Done"); +} +/******************************************************************/ +/******************************************************************/ +/******************************************************************/ +ClassImp(AliHBTCorrelFunction) +//____________________________________________ +////////////////////////////////////////////// +// +// class AliHBTCorrelFunction +// +// Base class for correlation fuctions, that is which returns ratio. +// Stores pointer the created ratio histogram and deletes it when function is deleted +// created in order to evoid memory leak +// +//////////////////////////////////////////////////////// +AliHBTCorrelFunction& AliHBTCorrelFunction::operator=(const AliHBTCorrelFunction& in) +{ + //assigment operator + if (&in == this) return *this; + delete fRatio; + fRatio=(in.fRatio)?(TH1*)in.fRatio->Clone():0x0; + fRatio->SetDirectory(0x0); + return *this; } /******************************************************************/ @@ -235,6 +322,22 @@ AliHBTFunction1D::AliHBTFunction1D(const Char_t *name, const Char_t *title, } /******************************************************************/ +AliHBTFunction1D::AliHBTFunction1D(const AliHBTFunction1D& source): + AliHBTFunction(source) +{ +// Copy constructor needed by the coding conventions byt not used + Fatal("AliHBTFunction1D(const AliHBTFunction1D&)","Cpy ctor not usable."); +} +/******************************************************************/ + +AliHBTFunction1D& AliHBTFunction1D::operator= (const AliHBTFunction1D & /*source*/) +{ +// Assignment needed by the coding conventions byt not used + Fatal("Assignment operator","not implemented"); + return * this; + } +/******************************************************************/ + AliHBTFunction1D::~AliHBTFunction1D() { //destructor @@ -278,34 +381,33 @@ Double_t AliHBTFunction1D::Scale(TH1D* num,TH1D* den) //Calculates the factor that should be used to scale //quatience of num and den to 1 at tail - if (gDebug>0) Info("Scale","Enetered Scale()"); + AliDebug(1,"Entered"); if(!num) { - Error("Scale","No numerator"); + AliError("No numerator"); return 0.0; } if(!den) { - Error("Scale","No denominator"); + AliError("No denominator"); return 0.0; } if(fNBinsToScale < 1) { + AliError("Number of bins for scaling is smaller than 1"); return 0.0; - Error("Scale","Number of bins for scaling is smaller thnan 1"); } UInt_t nbins = num->GetNbinsX(); if (fNBinsToScale > nbins) { - Error("Scale","Number of bins for scaling is bigger thnan number of bins in histograms"); + AliError("Number of bins for scaling is bigger thnan number of bins in histograms"); return 0.0; } - if (gDebug>0) Info("Scale","No errors detected"); + AliDebug(1,"No errors detected"); - Double_t ratio; - Double_t sum = 0; - Int_t n = 0; + Double_t densum = 0.0; + Double_t numsum = 0.0; Int_t offset = nbins - fNBinsToScale - 1; @@ -313,18 +415,17 @@ Double_t AliHBTFunction1D::Scale(TH1D* num,TH1D* den) { if ( num->GetBinContent(i) > 0.0 ) { - ratio = den->GetBinContent(i)/num->GetBinContent(i); - sum += ratio; - n++; + densum += den->GetBinContent(i); + numsum += num->GetBinContent(i); } } - if(gDebug > 0) Info("Scale","sum=%f fNBinsToScale=%d n=%d",sum,fNBinsToScale,n); + AliDebug(1,Form("numsum=%f densum=%f fNBinsToScaleX=%d",numsum,densum,fNBinsToScale)); - if (n == 0) return 0.0; - Double_t ret = sum/((Double_t)n); + if (numsum == 0) return 0.0; + Double_t ret = densum/numsum; - if(gDebug > 0) Info("Scale","returning %f",ret); + AliDebug(1,Form("returning %f",ret)); return ret; } @@ -340,11 +441,11 @@ Double_t AliHBTFunction1D::Scale(TH1D* num,TH1D* den) // Base Calss for 2-dimensinal Functions // // // // Piotr.Skowronski@cern.ch // -// http://alisoft.cern.ch/people/skowron/analyzer // +// http://aliweb.cern.ch/people/skowron/analyzer // // // /////////////////////////////////////////////////////// -ClassImp( AliHBTFunction1D ) +ClassImp( AliHBTFunction2D ) const Int_t AliHBTFunction2D::fgkDefaultNBinsX = 200;//default number of Bins in X axis in histograms const Float_t AliHBTFunction2D::fgkDefaultMinX = 0.0;//Default min value of X axis in histograms @@ -399,9 +500,24 @@ AliHBTFunction2D::AliHBTFunction2D(const Char_t *name, const Char_t *title, BuildHistos(nXbins,maxXval,minXval,nYbins,maxYval,minYval); } /******************************************************************/ +AliHBTFunction2D::AliHBTFunction2D(const AliHBTFunction2D & source): + AliHBTFunction(source) +{ +// Copy constructor needed by the coding conventions byt not used + Fatal("AliHBTFunction2D(const AliHBTFunction2D&)","Cpy ctor not usable."); +} +/******************************************************************/ + +AliHBTFunction2D& AliHBTFunction2D::operator= (const AliHBTFunction2D& /*source*/) { +// Assignment needed by the coding conventions byt not used + Fatal("Assignment operator","not implemented"); + return * this; +} +/******************************************************************/ AliHBTFunction2D::~AliHBTFunction2D() { +//dtor delete fNumerator; delete fDenominator; } @@ -418,6 +534,7 @@ void AliHBTFunction2D::BuildHistos() void AliHBTFunction2D::BuildHistos(Int_t nxbins, Float_t xmax, Float_t xmin, Int_t nybins, Float_t ymax, Float_t ymin) { +//Builds numerator and denominator histograms (2d-case) TString numstr = fName + " Numerator"; //title and name of the //numerator histogram TString denstr = fName + " Denominator";//title and name of the @@ -444,63 +561,65 @@ void AliHBTFunction2D::SetNumberOfBinsToScale(UInt_t xn, UInt_t yn) Double_t AliHBTFunction2D::Scale() { - if (gDebug>0) Info("Scale","Enetered Scale()"); +// Calculates the factor that should be used to scale +// quatience of fNumerator and fDenominator to 1 at +// given region + AliDebug(1,"Entered"); if(!fNumerator) { - Error("Scale","No numerator"); + AliError("No numerator"); return 0.0; } if(!fDenominator) { - Error("Scale","No denominator"); + AliError("No denominator"); return 0.0; } if( (fNBinsToScaleX < 1) || (fNBinsToScaleY < 1) ) { + AliError("Number of bins for scaling is smaller thnan 1"); return 0.0; - Error("Scale","Number of bins for scaling is smaller thnan 1"); } UInt_t nbinsX = fNumerator->GetNbinsX(); if (fNBinsToScaleX > nbinsX) { - Error("Scale","Number of X bins for scaling is bigger thnan number of bins in histograms"); + AliError("Number of X bins for scaling is bigger thnan number of bins in histograms"); return 0.0; } UInt_t nbinsY = fNumerator->GetNbinsX(); if (fNBinsToScaleY > nbinsY) { - Error("Scale","Number of Y bins for scaling is bigger thnan number of bins in histograms"); + AliError("Number of Y bins for scaling is bigger thnan number of bins in histograms"); return 0.0; } - if (gDebug>0) Info("Scale","No errors detected"); + AliDebug(1,"No errors detected"); Int_t offsetX = nbinsX - fNBinsToScaleX - 1; //bin that we start loop over bins in axis X Int_t offsetY = nbinsY - fNBinsToScaleY - 1; //bin that we start loop over bins in axis X - Double_t ratio; - Double_t sum = 0; - Int_t n = 0; + Double_t densum = 0.0; + Double_t numsum = 0.0; for (UInt_t j = offsetY; j< nbinsY; j++) for (UInt_t i = offsetX; i< nbinsX; i++) { if ( fNumerator->GetBinContent(i,j) > 0.0 ) { - ratio = fDenominator->GetBinContent(i,j)/fNumerator->GetBinContent(i,j); - sum += ratio; - n++; + densum += fDenominator->GetBinContent(i,j); + numsum += fNumerator->GetBinContent(i,j); } } - if(gDebug > 0) Info("Scale","sum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d n=%d",sum,fNBinsToScaleX,fNBinsToScaleY,n); + AliDebug(1,Form("numsum=%f densum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d", + numsum,densum,fNBinsToScaleX,fNBinsToScaleY)); - if (n == 0) return 0.0; - Double_t ret = sum/((Double_t)n); + if (numsum == 0) return 0.0; + Double_t ret = densum/numsum; - if(gDebug > 0) Info("Scale","returning %f",ret); + AliDebug(1,Form("returning %f",ret)); return ret; } @@ -516,7 +635,7 @@ Double_t AliHBTFunction2D::Scale() // Base Calss for 3-dimensinal Functions // // // // Piotr.Skowronski@cern.ch // -// http://alisoft.cern.ch/people/skowron/analyzer // +// http://aliweb.cern.ch/people/skowron/analyzer // // // /////////////////////////////////////////////////////// @@ -591,6 +710,22 @@ AliHBTFunction3D::AliHBTFunction3D(const Char_t *name, const Char_t *title, } /******************************************************************/ +AliHBTFunction3D::AliHBTFunction3D(const AliHBTFunction3D& source): + AliHBTFunction(source) +{ +// Copy constructor needed by the coding conventions byt not used + Fatal("AliHBTFunction3D(const AliHBTFunction3D&)","Cpy ctor not usable."); +} +/******************************************************************/ + +AliHBTFunction3D& AliHBTFunction3D::operator= (const AliHBTFunction3D & /*source*/) +{ +// Assignment needed by the coding conventions byt not used + Fatal("Assignment operator","not implemented"); + return * this; + } +/******************************************************************/ + AliHBTFunction3D::~AliHBTFunction3D() { @@ -612,16 +747,32 @@ void AliHBTFunction3D::BuildHistos(Int_t nxbins, Float_t xmax, Float_t xmin, Int_t nybins, Float_t ymax, Float_t ymin, Int_t nzbins, Float_t zmax, Float_t zmin) { + //Builds numerator and denominator histograms (3d-case) + + AliDebug(1,"Entered"); + + if (fNumerator ) + { + delete fNumerator; + fNumerator = 0x0; + } + + if (fDenominator ) + { + delete fDenominator; + fDenominator = 0x0; + } + TString numstr = fName + " Numerator"; //title and name of the //numerator histogram TString denstr = fName + " Denominator";//title and name of the //denominator histogram - fNumerator = new TH3D(numstr.Data(),numstr.Data(), - nxbins,xmin,xmin,nybins,ymin,ymin,nzbins,zmin,zmin); + fNumerator = new TH3F(numstr.Data(),numstr.Data(), + nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax); - fDenominator = new TH3D(denstr.Data(),denstr.Data(), - nxbins,xmin,xmin,nybins,ymin,ymin,nzbins,zmin,zmin); + fDenominator = new TH3F(denstr.Data(),denstr.Data(), + nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax); fNumerator->Sumw2(); fDenominator->Sumw2(); @@ -631,53 +782,55 @@ void AliHBTFunction3D::BuildHistos(Int_t nxbins, Float_t xmax, Float_t xmin, Double_t AliHBTFunction3D::Scale() { - if (gDebug>0) Info("Scale","Enetered Scale()"); + // Calculates the factor that should be used to scale + // quatience of fNumerator and fDenominator to 1 at + // given volume + AliDebug(1,"Entered"); if(!fNumerator) { - Error("Scale","No numerator"); + AliError("No numerator"); return 0.0; } if(!fDenominator) { - Error("Scale","No denominator"); + AliError("No denominator"); return 0.0; } if( (fNBinsToScaleX < 1) || (fNBinsToScaleY < 1) || (fNBinsToScaleZ < 1)) { + AliError("Number of bins for scaling is smaller thnan 1"); return 0.0; - Error("Scale","Number of bins for scaling is smaller thnan 1"); } UInt_t nbinsX = fNumerator->GetNbinsX(); if (fNBinsToScaleX > nbinsX) { - Error("Scale","Number of X bins for scaling is bigger thnan number of bins in histograms"); + AliError("Number of X bins for scaling is bigger thnan number of bins in histograms"); return 0.0; } UInt_t nbinsY = fNumerator->GetNbinsX(); if (fNBinsToScaleY > nbinsY) { - Error("Scale","Number of Y bins for scaling is bigger thnan number of bins in histograms"); + AliError("Number of Y bins for scaling is bigger thnan number of bins in histograms"); return 0.0; } UInt_t nbinsZ = fNumerator->GetNbinsZ(); if (fNBinsToScaleZ > nbinsZ) { - Error("Scale","Number of Z bins for scaling is bigger thnan number of bins in histograms"); + AliError("Number of Z bins for scaling is bigger thnan number of bins in histograms"); return 0.0; } - if (gDebug>0) Info("Scale","No errors detected"); + AliDebug(1,"No errors detected"); Int_t offsetX = nbinsX - fNBinsToScaleX - 1; //bin that we start loop over bins in axis X Int_t offsetY = nbinsY - fNBinsToScaleY - 1; //bin that we start loop over bins in axis Y Int_t offsetZ = nbinsZ - fNBinsToScaleZ - 1; //bin that we start loop over bins in axis Z - Double_t ratio; - Double_t sum = 0; - Int_t n = 0; + Double_t densum = 0.0; + Double_t numsum = 0.0; for (UInt_t k = offsetZ; kGetBinContent(i,j,k) > 0.0 ) { - ratio = fDenominator->GetBinContent(i,j,k)/fNumerator->GetBinContent(i,j,k); - sum += ratio; - n++; + + densum += fDenominator->GetBinContent(i,j,k); + numsum += fNumerator->GetBinContent(i,j,k); } } - if(gDebug > 0) - Info("Scale","sum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d fNBinsToScaleZ=%d n=%d", - sum,fNBinsToScaleX,fNBinsToScaleY,fNBinsToScaleZ,n); + AliDebug(1,Form("numsum=%f densum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d fNBinsToScaleZ=%d", + numsum,densum,fNBinsToScaleX,fNBinsToScaleY,fNBinsToScaleZ)); - if (n == 0) return 0.0; - Double_t ret = sum/((Double_t)n); + if (numsum == 0) return 0.0; + Double_t ret = densum/numsum; - if(gDebug > 0) Info("Scale","returning %f",ret); + AliDebug(1,Form("returning %f",ret)); return ret; } /******************************************************************/ @@ -730,7 +882,7 @@ void AliHBTFunction3D::SetNumberOfBinsToScale(UInt_t xn, UInt_t yn,UInt_t zn) // one pair to fill function // // // // Piotr.Skowronski@cern.ch // -// http://alisoft.cern.ch/people/skowron/analyzer // +// http://aliweb.cern.ch/people/skowron/analyzer // // // /////////////////////////////////////////////////////// @@ -740,12 +892,14 @@ ClassImp( AliHBTOnePairFctn1D ) AliHBTOnePairFctn1D::AliHBTOnePairFctn1D(Int_t nbins, Float_t maxXval, Float_t minXval): AliHBTFunction1D(nbins,maxXval,minXval) { + //constructor } /******************************************************************/ AliHBTOnePairFctn1D::AliHBTOnePairFctn1D(const Char_t *name, const Char_t *title): AliHBTFunction1D(name,title) { + } /******************************************************************/ @@ -753,19 +907,20 @@ AliHBTOnePairFctn1D::AliHBTOnePairFctn1D(const Char_t *name, const Char_t *title Int_t nbins, Float_t maxXval, Float_t minXval): AliHBTFunction1D(name,title,nbins,maxXval,minXval) { + //constructor } /******************************************************************/ void AliHBTOnePairFctn1D::ProcessSameEventParticles(AliHBTPair* pair) { - //Fills the numerator + //Fills the numerator using pair from the same event pair = CheckPair(pair); if(pair) fNumerator->Fill(GetValue(pair)); } /******************************************************************/ void AliHBTOnePairFctn1D::ProcessDiffEventParticles(AliHBTPair* pair) { - //fills denumerator + //Fills the denumerator using mixed pairs pair = CheckPair(pair); if(pair) fDenominator->Fill(GetValue(pair)); } @@ -783,7 +938,7 @@ void AliHBTOnePairFctn1D::ProcessDiffEventParticles(AliHBTPair* pair) // one pair to fill function // // // // Piotr.Skowronski@cern.ch // -// http://alisoft.cern.ch/people/skowron/analyzer // +// http://aliweb.cern.ch/people/skowron/analyzer // // // /////////////////////////////////////////////////////// @@ -793,6 +948,7 @@ ClassImp( AliHBTOnePairFctn2D ) AliHBTOnePairFctn2D::AliHBTOnePairFctn2D(const Char_t *name, const Char_t *title): AliHBTFunction2D(name,title) { + //constructor } /******************************************************************/ @@ -800,6 +956,7 @@ AliHBTOnePairFctn2D::AliHBTOnePairFctn2D(Int_t nXbins, Double_t maxXval, Double_ Int_t nYbins, Double_t maxYval, Double_t minYval): AliHBTFunction2D(nXbins, maxXval, minXval, nYbins, maxYval, minYval) { + //constructor } /******************************************************************/ @@ -808,11 +965,13 @@ AliHBTOnePairFctn2D::AliHBTOnePairFctn2D(const Char_t *name, const Char_t *title Int_t nYbins, Double_t maxYval, Double_t minYval): AliHBTFunction2D(name,title, nXbins, maxXval, minXval, nYbins, maxYval, minYval) { + //constructor } /******************************************************************/ void AliHBTOnePairFctn2D::ProcessSameEventParticles(AliHBTPair* pair) { + // Fills the numerator using pairs from the same event pair = CheckPair(pair); if(pair) { @@ -825,6 +984,7 @@ void AliHBTOnePairFctn2D::ProcessSameEventParticles(AliHBTPair* pair) void AliHBTOnePairFctn2D::ProcessDiffEventParticles(AliHBTPair* pair) { + // Fills the denumerator using mixed pairs pair = CheckPair(pair); if(pair) { @@ -846,7 +1006,7 @@ void AliHBTOnePairFctn2D::ProcessDiffEventParticles(AliHBTPair* pair) // one pair to fill function // // // // Piotr.Skowronski@cern.ch // -// http://alisoft.cern.ch/people/skowron/analyzer // +// http://aliweb.cern.ch/people/skowron/analyzer // // // /////////////////////////////////////////////////////// ClassImp( AliHBTOnePairFctn3D) @@ -856,6 +1016,7 @@ ClassImp( AliHBTOnePairFctn3D) AliHBTOnePairFctn3D::AliHBTOnePairFctn3D(const Char_t *name, const Char_t *title): AliHBTFunction3D(name,title) { + //constructor } /******************************************************************/ @@ -864,6 +1025,7 @@ AliHBTOnePairFctn3D::AliHBTOnePairFctn3D(Int_t nXbins, Double_t maxXval, Double_ Int_t nZbins, Double_t maxZval, Double_t minZval): AliHBTFunction3D(nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval) { + //constructor } /******************************************************************/ @@ -873,6 +1035,7 @@ AliHBTOnePairFctn3D::AliHBTOnePairFctn3D(const Char_t *name, const Char_t *title Int_t nZbins, Double_t maxZval, Double_t minZval): AliHBTFunction3D(name,title,nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval) { + //constructor } /******************************************************************/ @@ -917,7 +1080,7 @@ void AliHBTOnePairFctn3D::ProcessDiffEventParticles(AliHBTPair* pair) // to fill function // // // // Piotr.Skowronski@cern.ch // -// http://alisoft.cern.ch/people/skowron/analyzer // +// http://aliweb.cern.ch/people/skowron/analyzer // // // /////////////////////////////////////////////////////// ClassImp(AliHBTTwoPairFctn1D) @@ -926,12 +1089,14 @@ ClassImp(AliHBTTwoPairFctn1D) AliHBTTwoPairFctn1D::AliHBTTwoPairFctn1D(Int_t nbins, Float_t maxXval, Float_t minXval): AliHBTFunction1D(nbins,maxXval,minXval) { + //constructor } /******************************************************************/ AliHBTTwoPairFctn1D::AliHBTTwoPairFctn1D(const Char_t *name, const Char_t *title): AliHBTFunction1D(name,title) { + //constructor } /******************************************************************/ @@ -939,28 +1104,29 @@ AliHBTTwoPairFctn1D::AliHBTTwoPairFctn1D(const Char_t *name, const Char_t *title Int_t nbins, Float_t maxXval, Float_t minXval): AliHBTFunction1D(name,title,nbins,maxXval,minXval) { + //constructor } /******************************************************************/ void AliHBTTwoPairFctn1D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) { - partpair = CheckPair(partpair); - if( partpair ) - { - Double_t x = GetValue(trackpair,partpair); - fNumerator->Fill(x); - } + // Fills the numerator using pairs from the same event + trackpair = CheckPair(trackpair); + if( trackpair == 0x0) return; + + Double_t x = GetValue(trackpair,partpair); + fNumerator->Fill(x); } /******************************************************************/ void AliHBTTwoPairFctn1D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) { - partpair = CheckPair(partpair); - if( partpair ) - { - Double_t x = GetValue(trackpair,partpair); - fDenominator->Fill(x); - } + // Fills the denumerator usin mixed pairs + trackpair = CheckPair(trackpair); + if( trackpair == 0x0) return; + + Double_t x = GetValue(trackpair,partpair); + fDenominator->Fill(x); } /******************************************************************/ /******************************************************************/ @@ -976,7 +1142,7 @@ void AliHBTTwoPairFctn1D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHB // to fill function // // // // Piotr.Skowronski@cern.ch // -// http://alisoft.cern.ch/people/skowron/analyzer // +// http://aliweb.cern.ch/people/skowron/analyzer // // // /////////////////////////////////////////////////////// @@ -987,6 +1153,7 @@ ClassImp(AliHBTTwoPairFctn2D) AliHBTTwoPairFctn2D::AliHBTTwoPairFctn2D(const Char_t *name, const Char_t *title): AliHBTFunction2D(name,title) { + //constructor } /******************************************************************/ @@ -994,6 +1161,7 @@ AliHBTTwoPairFctn2D::AliHBTTwoPairFctn2D(Int_t nXbins, Double_t maxXval, Double_ Int_t nYbins, Double_t maxYval, Double_t minYval): AliHBTFunction2D(nXbins, maxXval, minXval, nYbins, maxYval, minYval) { + //constructor } /******************************************************************/ @@ -1002,32 +1170,31 @@ AliHBTTwoPairFctn2D::AliHBTTwoPairFctn2D(const Char_t *name, const Char_t *title Int_t nYbins, Double_t maxYval, Double_t minYval): AliHBTFunction2D(name,title,nXbins, maxXval, minXval, nYbins, maxYval, minYval) { + //constructor } /******************************************************************/ void AliHBTTwoPairFctn2D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) { //processes pair of particles coming from a same events (real pair) - partpair = CheckPair(partpair); //check cuts - if( partpair ) - { - Double_t x,y; - GetValues(trackpair,partpair,x,y); - fNumerator->Fill(x,y); - } + trackpair = CheckPair(trackpair); + if( trackpair == 0x0) return; + + Double_t x,y; + GetValues(trackpair,partpair,x,y); + fNumerator->Fill(x,y); } /******************************************************************/ void AliHBTTwoPairFctn2D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) { //processes pair of particles coming from a different events (mixed pair) - partpair = CheckPair(partpair); - if( partpair ) - { - Double_t x,y; - GetValues(trackpair,partpair,x,y); - fDenominator->Fill(x,y); - } + trackpair = CheckPair(trackpair); + if( trackpair == 0x0) return; + + Double_t x,y; + GetValues(trackpair,partpair,x,y); + fDenominator->Fill(x,y); } /******************************************************************/ @@ -1044,7 +1211,7 @@ void AliHBTTwoPairFctn2D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHB // to fill function // // // // Piotr.Skowronski@cern.ch // -// http://alisoft.cern.ch/people/skowron/analyzer // +// http://aliweb.cern.ch/people/skowron/analyzer // // // /////////////////////////////////////////////////////// @@ -1055,6 +1222,7 @@ ClassImp(AliHBTTwoPairFctn3D) AliHBTTwoPairFctn3D::AliHBTTwoPairFctn3D(const Char_t *name, const Char_t *title): AliHBTFunction3D(name,title) { + //constructor } /******************************************************************/ @@ -1063,6 +1231,7 @@ AliHBTTwoPairFctn3D::AliHBTTwoPairFctn3D(Int_t nXbins, Double_t maxXval, Double_ Int_t nZbins, Double_t maxZval, Double_t minZval): AliHBTFunction3D(nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval) { + //constructor } /******************************************************************/ @@ -1072,34 +1241,34 @@ AliHBTTwoPairFctn3D::AliHBTTwoPairFctn3D(const Char_t *name, const Char_t *title Int_t nZbins, Double_t maxZval, Double_t minZval): AliHBTFunction3D(name,title,nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval) { + //constructor } /******************************************************************/ void AliHBTTwoPairFctn3D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) { - partpair = CheckPair(partpair); - if( partpair ) - { - Double_t x,y,z; - GetValues(trackpair,partpair,x,y,z); - fNumerator->Fill(x,y,z); - } + // Fills th numerator using pairs from the same event + trackpair = CheckPair(trackpair); + if( trackpair == 0x0) return; + + Double_t x,y,z; + GetValues(trackpair,partpair,x,y,z); + fNumerator->Fill(x,y,z); + } /******************************************************************/ void AliHBTTwoPairFctn3D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair) { - partpair = CheckPair(partpair); - if( partpair ) - { - Double_t x,y,z; - GetValues(trackpair,partpair,x,y,z); - fDenominator->Fill(x,y,z); - } - + // Fills the denumerator using mixed pairs + trackpair = CheckPair(trackpair); + if( trackpair == 0x0) return; + + Double_t x,y,z; + GetValues(trackpair,partpair,x,y,z); + fDenominator->Fill(x,y,z); } - /******************************************************************/ /******************************************************************/ /******************************************************************/