]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RALICE/AliSample.cxx
01-dev-2004 NvE Installation scripts modified to make use of environment variable...
[u/mrichter/AliRoot.git] / RALICE / AliSample.cxx
index 2670a940aed490604a5d2127950cb11a4542ea46..62aa9c41e067e0c5b23090f84279005cc5c2d086 100644 (file)
 
 ///////////////////////////////////////////////////////////////////////////
 // Class AliSample
-// Perform statistics on various multi-dimensional data samples
+// Perform statistics on various multi-dimensional data samples.
 // A data sample can be filled using the "Enter" and/or "Remove" functions,
 // whereas the "Reset" function resets the complete sample to 'empty'.
 // The info which can be extracted from a certain data sample are the
 // sum, mean, variance, sigma, covariance and correlation.
-// The "Info" function provides all statistics data for a certain sample.
+// The "Data" function provides all statistics data for a certain sample.
 // The variables for which these stat. parameters have to be calculated
 // are indicated by the index of the variable which is passed as an
 // argument to the various member functions.
 // the mean_x can be obtained as s.GetMean(1) whereas the mean_y is obtained
 // via s.GetMean(2).
 // The correlation between x and y is available via s.GetCor(1,2).
-// The x-statistics are obtained via s.Info(1), y-statistics via s.Info(2),
-// and the covariance and correlation between x and y via s.Info(1,2).
-// All statistics of a sample are obtained via s.Info().
+// The x-statistics are obtained via s.Data(1), y-statistics via s.Data(2),
+// and the covariance and correlation between x and y via s.Data(1,2).
+// All statistics of a sample are obtained via s.Data().
 //
 //--- Author: Nick van Eijndhoven 30-mar-1996 CERN Geneva
 //- Modified: NvE $Date$ UU-SAP Utrecht
 ///////////////////////////////////////////////////////////////////////////
 
 #include "AliSample.h"
+#include "Riostream.h"
+ClassImp(AliSample) // Class implementation to enable ROOT I/O
  
 AliSample::AliSample()
 {
@@ -252,19 +255,19 @@ void AliSample::Compute()
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-Int_t AliSample::GetDimension()
+Int_t AliSample::GetDimension() const
 {
 // Provide the dimension of a certain sample
  return fDim;
 }
 ///////////////////////////////////////////////////////////////////////////
-Int_t AliSample::GetN()
+Int_t AliSample::GetN() const
 {
 // Provide the number of entries of a certain sample
  return fN;
 }
 ///////////////////////////////////////////////////////////////////////////
-Float_t AliSample::GetSum(Int_t i)
+Float_t AliSample::GetSum(Int_t i) const
 {
 // Provide the sum of a certain variable
  if (fDim < i)
@@ -278,7 +281,7 @@ Float_t AliSample::GetSum(Int_t i)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-Float_t AliSample::GetMean(Int_t i)
+Float_t AliSample::GetMean(Int_t i) const
 {
 // Provide the mean of a certain variable
  if (fDim < i)
@@ -292,7 +295,7 @@ Float_t AliSample::GetMean(Int_t i)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-Float_t AliSample::GetVar(Int_t i)
+Float_t AliSample::GetVar(Int_t i) const
 {
 // Provide the variance of a certain variable
  if (fDim < i)
@@ -306,7 +309,7 @@ Float_t AliSample::GetVar(Int_t i)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-Float_t AliSample::GetSigma(Int_t i)
+Float_t AliSample::GetSigma(Int_t i) const
 {
 // Provide the standard deviation of a certain variable
  if (fDim < i)
@@ -320,7 +323,7 @@ Float_t AliSample::GetSigma(Int_t i)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-Float_t AliSample::GetCov(Int_t i,Int_t j)
+Float_t AliSample::GetCov(Int_t i,Int_t j) const
 {
 // Provide the covariance between variables i and j
  if ((fDim < i) || (fDim < j))
@@ -336,7 +339,7 @@ Float_t AliSample::GetCov(Int_t i,Int_t j)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-Float_t AliSample::GetCor(Int_t i,Int_t j)
+Float_t AliSample::GetCor(Int_t i,Int_t j) const
 {
 // Provide the correlation between variables i and j
  if ((fDim < i) || (fDim < j))
@@ -352,7 +355,7 @@ Float_t AliSample::GetCor(Int_t i,Int_t j)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-void AliSample::Info()
+void AliSample::Data() const
 {
 // Printing of statistics of all variables
  for (Int_t i=0; i<fDim; i++)
@@ -363,12 +366,12 @@ void AliSample::Info()
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-void AliSample::Info(Int_t i)
+void AliSample::Data(Int_t i) const
 {
 // Printing of statistics of ith variable
  if (fDim < i)
  {
-  cout << " *AliSample::Info(i)* Error : Dimension less than " << i << endl;
+  cout << " *AliSample::Data(i)* Error : Dimension less than " << i << endl;
  }
  else
  {
@@ -378,14 +381,14 @@ void AliSample::Info(Int_t i)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-void AliSample::Info(Int_t i,Int_t j)
+void AliSample::Data(Int_t i,Int_t j) const
 {
 // Printing of covariance and correlation between variables i and j
  if ((fDim < i) || (fDim < j))
  {
   Int_t k=i;
   if (j > i) k=j;
-  cout << " *AliSample::Info(i,j)* Error : Dimension less than " << k << endl;
+  cout << " *AliSample::Data(i,j)* Error : Dimension less than " << k << endl;
  }
  else
  {