ClassImp( AliHBTFunction )
AliHBTFunction::AliHBTFunction():
- fPairCut(new AliHBTEmptyPairCut()) //dummy cut
+ fPairCut(new AliHBTEmptyPairCut()), //dummy cut
+ fWriteNumAndDen(kFALSE)
{
//Default constructor
}
/******************************************************************/
+
AliHBTFunction::AliHBTFunction(const char* name,const char* title):
- TNamed(name,title),
- fPairCut(new AliHBTEmptyPairCut()) //dummy cut
+ TNamed(name,title),
+ fPairCut(new AliHBTEmptyPairCut()), //dummy cut
+ fWriteNumAndDen(kFALSE)
{
//Constructor
}
/******************************************************************/
+AliHBTFunction::AliHBTFunction(const AliHBTFunction & source):
+ TNamed(source),
+ fPairCut((AliHBTPairCut*)source.fPairCut->Clone()),
+ fWriteNumAndDen(source.fWriteNumAndDen)
+{
+// Copy constructor needed by the coding conventions
+}
+/******************************************************************/
+
AliHBTFunction::~AliHBTFunction()
{
//destructor
delete fPairCut;
}
/******************************************************************/
+AliHBTFunction & AliHBTFunction::operator= (const AliHBTFunction & source)
+{
+ // Assignment needed by the coding conventions
+ delete fPairCut;
+ fPairCut = (AliHBTPairCut*)source.fPairCut->Clone();
+ return * this;
+}
void AliHBTFunction::WriteFunction()
{
//writes result of the function to file
- if (GetNumerator()) GetNumerator()->Write();
- if (GetDenominator()) GetDenominator()->Write();
+ if (fWriteNumAndDen)
+ {
+ if (GetNumerator()) GetNumerator()->Write();
+ if (GetDenominator()) GetDenominator()->Write();
+ }
TH1* res = GetResult();
if (res) res->Write();
}
{
//returns ratio of numerator and denominator
//
- if (gDebug>0) Info("GetRatio","Norm. Factor is %f for %s",normfactor,GetName());
+ if (AliHBTParticle::GetDebug()>0) Info("GetRatio","Norm. Factor is %f for %s",normfactor,GetName());
if (normfactor == 0.0)
{
}
/******************************************************************/
+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
//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()");
+ if (AliHBTParticle::GetDebug()>0) Info("Scale","Enetered Scale()");
if(!num)
{
Error("Scale","No numerator");
if(fNBinsToScale < 1)
{
- return 0.0;
Error("Scale","Number of bins for scaling is smaller thnan 1");
+ return 0.0;
}
UInt_t nbins = num->GetNbinsX();
if (fNBinsToScale > nbins)
Error("Scale","Number of bins for scaling is bigger thnan number of bins in histograms");
return 0.0;
}
- if (gDebug>0) Info("Scale","No errors detected");
+ if (AliHBTParticle::GetDebug()>0) Info("Scale","No errors detected");
Double_t ratio;
Double_t sum = 0;
}
}
- if(gDebug > 0) Info("Scale","sum=%f fNBinsToScale=%d n=%d",sum,fNBinsToScale,n);
+ if(AliHBTParticle::GetDebug() > 0) Info("Scale","sum=%f fNBinsToScale=%d n=%d",sum,fNBinsToScale,n);
if (n == 0) return 0.0;
Double_t ret = sum/((Double_t)n);
- if(gDebug > 0) Info("Scale","returning %f",ret);
+ if(AliHBTParticle::GetDebug() > 0) Info("Scale","returning %f",ret);
return ret;
}
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;
}
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)
+//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
Double_t AliHBTFunction2D::Scale()
{
- // Calculates the factor that should be used to scale
- // quatience of fNumerator and fDenominator to 1 at
- // given region
- 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
+ if (AliHBTParticle::GetDebug()>0) Info("Scale","Enetered Scale()");
if(!fNumerator)
{
Error("Scale","No numerator");
if( (fNBinsToScaleX < 1) || (fNBinsToScaleY < 1) )
{
- return 0.0;
Error("Scale","Number of bins for scaling is smaller thnan 1");
+ return 0.0;
}
UInt_t nbinsX = fNumerator->GetNbinsX();
if (fNBinsToScaleX > nbinsX)
return 0.0;
}
- if (gDebug>0) Info("Scale","No errors detected");
+ if (AliHBTParticle::GetDebug()>0) Info("Scale","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
}
}
- if(gDebug > 0) Info("Scale","sum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d n=%d",sum,fNBinsToScaleX,fNBinsToScaleY,n);
+ if(AliHBTParticle::GetDebug() > 0) Info("Scale","sum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d n=%d",sum,fNBinsToScaleX,fNBinsToScaleY,n);
if (n == 0) return 0.0;
Double_t ret = sum/((Double_t)n);
- if(gDebug > 0) Info("Scale","returning %f",ret);
+ if(AliHBTParticle::GetDebug() > 0) Info("Scale","returning %f",ret);
return ret;
}
}
/******************************************************************/
+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()
{
//denominator histogram
fNumerator = new TH3D(numstr.Data(),numstr.Data(),
- nxbins,xmin,xmin,nybins,ymin,ymin,nzbins,zmin,zmin);
+ 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);
+ nxbins,xmin,xmax,nybins,ymin,ymax,nzbins,zmin,zmax);
fNumerator->Sumw2();
fDenominator->Sumw2();
// Calculates the factor that should be used to scale
// quatience of fNumerator and fDenominator to 1 at
// given volume
- if (gDebug>0) Info("Scale","Enetered Scale()");
+ if (AliHBTParticle::GetDebug()>0) Info("Scale","Enetered Scale()");
if(!fNumerator)
{
Error("Scale","No numerator");
if( (fNBinsToScaleX < 1) || (fNBinsToScaleY < 1) || (fNBinsToScaleZ < 1))
{
- return 0.0;
Error("Scale","Number of bins for scaling is smaller thnan 1");
+ return 0.0;
}
UInt_t nbinsX = fNumerator->GetNbinsX();
if (fNBinsToScaleX > nbinsX)
return 0.0;
}
- if (gDebug>0) Info("Scale","No errors detected");
+ if (AliHBTParticle::GetDebug()>0) Info("Scale","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
}
}
- if(gDebug > 0)
+ if(AliHBTParticle::GetDebug() > 0)
Info("Scale","sum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d fNBinsToScaleZ=%d n=%d",
sum,fNBinsToScaleX,fNBinsToScaleY,fNBinsToScaleZ,n);
if (n == 0) return 0.0;
Double_t ret = sum/((Double_t)n);
- if(gDebug > 0) Info("Scale","returning %f",ret);
+ if(AliHBTParticle::GetDebug() > 0) Info("Scale","returning %f",ret);
return ret;
}
/******************************************************************/
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)
{
+
}
/******************************************************************/
Int_t nbins, Float_t maxXval, Float_t minXval):
AliHBTFunction1D(name,title,nbins,maxXval,minXval)
{
+ //constructor
}
/******************************************************************/
AliHBTOnePairFctn2D::AliHBTOnePairFctn2D(const Char_t *name, const Char_t *title):
AliHBTFunction2D(name,title)
{
+ //constructor
}
/******************************************************************/
Int_t nYbins, Double_t maxYval, Double_t minYval):
AliHBTFunction2D(nXbins, maxXval, minXval, nYbins, maxYval, minYval)
{
+ //constructor
}
/******************************************************************/
Int_t nYbins, Double_t maxYval, Double_t minYval):
AliHBTFunction2D(name,title, nXbins, maxXval, minXval, nYbins, maxYval, minYval)
{
+ //constructor
}
/******************************************************************/
AliHBTOnePairFctn3D::AliHBTOnePairFctn3D(const Char_t *name, const Char_t *title):
AliHBTFunction3D(name,title)
{
+ //constructor
}
/******************************************************************/
Int_t nZbins, Double_t maxZval, Double_t minZval):
AliHBTFunction3D(nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval)
{
+ //constructor
}
/******************************************************************/
Int_t nZbins, Double_t maxZval, Double_t minZval):
AliHBTFunction3D(name,title,nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval)
{
+ //constructor
}
/******************************************************************/
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
}
/******************************************************************/
Int_t nbins, Float_t maxXval, Float_t minXval):
AliHBTFunction1D(name,title,nbins,maxXval,minXval)
{
+ //constructor
}
/******************************************************************/
{
// Fills the numerator using pairs from the same event
partpair = CheckPair(partpair);
- if( partpair )
- {
- Double_t x = GetValue(trackpair,partpair);
- fNumerator->Fill(x);
- }
+ if( partpair == 0x0) return;
+
+ if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair
+ trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
+
+ Double_t x = GetValue(trackpair,partpair);
+ fNumerator->Fill(x);
}
/******************************************************************/
{
// Fills the denumerator usin mixed pairs
partpair = CheckPair(partpair);
- if( partpair )
- {
- Double_t x = GetValue(trackpair,partpair);
- fDenominator->Fill(x);
- }
+ if( partpair == 0x0) return;
+
+ if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair
+ trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
+
+ Double_t x = GetValue(trackpair,partpair);
+ fDenominator->Fill(x);
}
/******************************************************************/
/******************************************************************/
AliHBTTwoPairFctn2D::AliHBTTwoPairFctn2D(const Char_t *name, const Char_t *title):
AliHBTFunction2D(name,title)
{
+ //constructor
}
/******************************************************************/
Int_t nYbins, Double_t maxYval, Double_t minYval):
AliHBTFunction2D(nXbins, maxXval, minXval, nYbins, maxYval, minYval)
{
+ //constructor
}
/******************************************************************/
Int_t nYbins, Double_t maxYval, Double_t minYval):
AliHBTFunction2D(name,title,nXbins, maxXval, minXval, nYbins, maxYval, minYval)
{
+ //constructor
}
/******************************************************************/
{
//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);
- }
+ if (partpair == 0x0) return;
+
+ if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair
+ trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
+
+ Double_t x,y;
+ GetValues(trackpair,partpair,x,y);
+ fNumerator->Fill(x,y);
}
/******************************************************************/
{
//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);
- }
+ if (partpair == 0x0) return;
+
+ if (partpair->GetSwapedPair() == 0x0)//it means that Check pair returned swapped pair
+ trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
+
+ Double_t x,y;
+ GetValues(trackpair,partpair,x,y);
+ fDenominator->Fill(x,y);
}
/******************************************************************/
AliHBTTwoPairFctn3D::AliHBTTwoPairFctn3D(const Char_t *name, const Char_t *title):
AliHBTFunction3D(name,title)
{
+ //constructor
}
/******************************************************************/
Int_t nZbins, Double_t maxZval, Double_t minZval):
AliHBTFunction3D(nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval)
{
+ //constructor
}
/******************************************************************/
Int_t nZbins, Double_t maxZval, Double_t minZval):
AliHBTFunction3D(name,title,nXbins, maxXval, minXval, nYbins, maxYval, minYval, nZbins, maxZval, minZval)
{
+ //constructor
}
/******************************************************************/
{
// Fills th numerator using pairs from the same event
partpair = CheckPair(partpair);
- if( partpair )
- {
- Double_t x,y,z;
- GetValues(trackpair,partpair,x,y,z);
- fNumerator->Fill(x,y,z);
- }
+ if( partpair == 0x0) return;
+
+ if (partpair->GetSwapedPair() == 0x0)//it means that CheckPair returned swapped pair
+ trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
+
+ Double_t x,y,z;
+ GetValues(trackpair,partpair,x,y,z);
+ fNumerator->Fill(x,y,z);
+
}
/******************************************************************/
{
// Fills the denumerator using mixed pairs
partpair = CheckPair(partpair);
- if( partpair )
- {
- Double_t x,y,z;
- GetValues(trackpair,partpair,x,y,z);
- fDenominator->Fill(x,y,z);
- }
-
+ if( partpair == 0x0) return;
+
+ if (partpair->GetSwapedPair() == 0x0)//it means that CheckPair returned swapped pair
+ trackpair = trackpair->GetSwapedPair();//so the track pair must be swapped as well
+
+ Double_t x,y,z;
+ GetValues(trackpair,partpair,x,y,z);
+ fDenominator->Fill(x,y,z);
}
-
/******************************************************************/
/******************************************************************/
/******************************************************************/