]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HBTAN/AliHBTFunction.cxx
Mag. field activated.
[u/mrichter/AliRoot.git] / HBTAN / AliHBTFunction.cxx
index 33b73f55cf5b1570edfdc9b59466f6dd62475058..29cba4bc3f2565f22bb5446e62bb1a80069c4496 100644 (file)
@@ -1,12 +1,13 @@
 #include "AliHBTFunction.h"
-//____________________
-//////////////////////////////////////////////////////////////////////
-//
+
+/* $Id: */
+
+//--------------------------------------------------------------------
 //AliHBTFunction
 //Author: Piotr Krzysztof Skowronski
 //Piotr.Skowronski@cern.ch
-/*Base classes for HBT functions
-
+//Base classes for HBT functions
+/*
  OnePairFctn       Function                  TwoPairFctn
    | \    \        /  |   \                      /|\   
    |  \    \      /   |    \                    / | \    
    |       / \       \|    |    \        /  \     |  \     \              
    |      /   \      /\    |     \      /    \    |   \     |              
    |     /     \    /  \   |      \    /      \   |    \    |               
-   |    /       \  /    \  |       \  /        \  |     \   |                 
+   |    /       \  /    \  |       \  /        \  |     \   |
    |   /         \/      \ |        \/          \ |      \  |               
  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 <TH2.h>
+#include <TH3.h>
 
 /******************************************************************/
 /******************************************************************/
@@ -302,7 +304,7 @@ Double_t AliHBTFunction1D::Scale(TH1D* num,TH1D* den)
 
   Double_t ratio;
   Double_t sum = 0;
-  Int_t N = 0;
+  Int_t n = 0;
   
   Int_t offset = nbins - fNBinsToScale - 1; 
 
@@ -312,14 +314,14 @@ Double_t AliHBTFunction1D::Scale(TH1D* num,TH1D* den)
      {
        ratio = den->GetBinContent(i)/num->GetBinContent(i);
        sum += ratio;
-       N++;
+       n++;
      }
    }
   
-  if(gDebug > 0) Info("Scale","sum=%f fNBinsToScale=%d N=%d",sum,fNBinsToScale,N);
+  if(gDebug > 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 (n == 0) return 0.0;
+  Double_t ret = sum/((Double_t)n);
 
   if(gDebug > 0) Info("Scale","returning %f",ret);
   return ret;
@@ -341,7 +343,7 @@ Double_t AliHBTFunction1D::Scale(TH1D* num,TH1D* den)
 //                                                   //
 ///////////////////////////////////////////////////////
 
-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
@@ -415,6 +417,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 
@@ -441,6 +444,9 @@ void AliHBTFunction2D::SetNumberOfBinsToScale(UInt_t xn, UInt_t yn)
 
 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()");
   if(!fNumerator) 
    {
@@ -479,7 +485,7 @@ Double_t AliHBTFunction2D::Scale()
 
   Double_t ratio;
   Double_t sum = 0;
-  Int_t N = 0;
+  Int_t n = 0;
   
   for (UInt_t j = offsetY; j< nbinsY; j++)
     for (UInt_t i = offsetX; i< nbinsX; i++)
@@ -488,14 +494,14 @@ Double_t AliHBTFunction2D::Scale()
        {
          ratio = fDenominator->GetBinContent(i,j)/fNumerator->GetBinContent(i,j);
          sum += ratio;
-         N++;
+         n++;
        }
      }
   
-  if(gDebug > 0) Info("Scale","sum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d N=%d",sum,fNBinsToScaleX,fNBinsToScaleY,N);
+  if(gDebug > 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 (n == 0) return 0.0;
+  Double_t ret = sum/((Double_t)n);
 
   if(gDebug > 0) Info("Scale","returning %f",ret);
   return ret;
@@ -609,6 +615,7 @@ 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)
    TString numstr = fName + " Numerator";  //title and name of the 
                                            //numerator histogram
    TString denstr = fName + " Denominator";//title and name of the 
@@ -628,6 +635,9 @@ void AliHBTFunction3D::BuildHistos(Int_t nxbins, Float_t xmax, Float_t xmin,
 
 Double_t AliHBTFunction3D::Scale()
 {
+  // 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(!fNumerator) 
    {
@@ -674,7 +684,7 @@ Double_t AliHBTFunction3D::Scale()
 
   Double_t ratio;
   Double_t sum = 0;
-  Int_t N = 0;
+  Int_t n = 0;
   
   for (UInt_t k = offsetZ; k<nbinsZ; k++)
     for (UInt_t j = offsetY; j<nbinsY; j++)
@@ -684,16 +694,16 @@ Double_t AliHBTFunction3D::Scale()
          {
            ratio = fDenominator->GetBinContent(i,j,k)/fNumerator->GetBinContent(i,j,k);
            sum += ratio;
-           N++;
+           n++;
          }
        }
   
   if(gDebug > 0) 
-    Info("Scale","sum=%f fNBinsToScaleX=%d fNBinsToScaleY=%d fNBinsToScaleZ=%d N=%d",
-          sum,fNBinsToScaleX,fNBinsToScaleY,fNBinsToScaleZ,N);
+    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 (n == 0) return 0.0;
+  Double_t ret = sum/((Double_t)n);
 
   if(gDebug > 0) Info("Scale","returning %f",ret);
   return ret;
@@ -755,14 +765,14 @@ AliHBTOnePairFctn1D::AliHBTOnePairFctn1D(const Char_t *name, const Char_t *title
 
 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));
   }
@@ -810,6 +820,7 @@ AliHBTOnePairFctn2D::AliHBTOnePairFctn2D(const Char_t *name, const Char_t *title
 
 void AliHBTOnePairFctn2D::ProcessSameEventParticles(AliHBTPair* pair)
 {
+  // Fills the numerator using pairs from the same event
   pair = CheckPair(pair);
   if(pair) 
    { 
@@ -822,6 +833,7 @@ void AliHBTOnePairFctn2D::ProcessSameEventParticles(AliHBTPair* pair)
 
 void AliHBTOnePairFctn2D::ProcessDiffEventParticles(AliHBTPair* pair)
 {
+  // Fills the denumerator using mixed pairs
   pair = CheckPair(pair);
   if(pair) 
    { 
@@ -941,6 +953,7 @@ AliHBTTwoPairFctn1D::AliHBTTwoPairFctn1D(const Char_t *name, const Char_t *title
 
 void AliHBTTwoPairFctn1D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
 {
+  // Fills the numerator using pairs from the same event
   partpair  = CheckPair(partpair);
   if( partpair ) 
    { 
@@ -952,6 +965,7 @@ void AliHBTTwoPairFctn1D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHB
 
 void AliHBTTwoPairFctn1D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
 {
+  // Fills the denumerator usin mixed pairs
   partpair  = CheckPair(partpair);
   if( partpair )
    { 
@@ -1074,6 +1088,7 @@ AliHBTTwoPairFctn3D::AliHBTTwoPairFctn3D(const Char_t *name, const Char_t *title
 
 void AliHBTTwoPairFctn3D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
 {
+  // Fills th numerator using pairs from the same event
   partpair  = CheckPair(partpair);
   if( partpair ) 
    { 
@@ -1086,6 +1101,7 @@ void AliHBTTwoPairFctn3D::ProcessSameEventParticles(AliHBTPair* trackpair, AliHB
 
 void AliHBTTwoPairFctn3D::ProcessDiffEventParticles(AliHBTPair* trackpair, AliHBTPair* partpair)
 {
+  // Fills the denumerator using mixed pairs
   partpair  = CheckPair(partpair);
   if( partpair ) 
    {