]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
code cleaning
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 6 Mar 2003 11:08:28 +0000 (11:08 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 6 Mar 2003 11:08:28 +0000 (11:08 +0000)
HBTAN/AliHBTAnalysis.cxx
HBTAN/AliHBTCorrelFctn.cxx
HBTAN/AliHBTCorrelFctn.h
HBTAN/AliHBTEvent.cxx
HBTAN/AliHBTEvent.h
HBTAN/AliHBTFunction.cxx
HBTAN/AliHBTFunction.h

index 50a0a45a4b1916f17f43e659b4bad36de14e24aa..2e502f2d45920a1c0fae7c710aa3483df7e3f4f7 100644 (file)
@@ -36,17 +36,18 @@ const UInt_t AliHBTAnalysis::fgkDefaultMixingInfo = 1000;
 const Int_t  AliHBTAnalysis::fgkDefaultBufferSize = 5;
 
 AliHBTAnalysis::AliHBTAnalysis():
- fReader(0x0),
- fNTrackFunctions(0),
- fNParticleFunctions(0),
- fNParticleAndTrackFunctions(0),
- fNTrackMonitorFunctions(0),
- fNParticleMonitorFunctions(0), 
- fNParticleAndTrackMonitorFunctions(0),
- fBufferSize(2),
- fDisplayMixingInfo(fgkDefaultMixingInfo),
- fIsOwner(kFALSE)
 fReader(0x0),
 fNTrackFunctions(0),
 fNParticleFunctions(0),
 fNParticleAndTrackFunctions(0),
 fNTrackMonitorFunctions(0),
 fNParticleMonitorFunctions(0), 
 fNParticleAndTrackMonitorFunctions(0),
 fBufferSize(2),
 fDisplayMixingInfo(fgkDefaultMixingInfo),
 fIsOwner(kFALSE)
  {
+//default constructor
    fTrackFunctions = new AliHBTOnePairFctn* [fgkFctnArraySize];
    fParticleFunctions = new AliHBTOnePairFctn* [fgkFctnArraySize];
    fParticleAndTrackFunctions = new AliHBTTwoPairFctn* [fgkFctnArraySize];
@@ -60,29 +61,31 @@ AliHBTAnalysis::AliHBTAnalysis():
 /*************************************************************************************/ 
 
 AliHBTAnalysis::AliHBTAnalysis(const AliHBTAnalysis& in):
- fReader(0x0),
- fNTrackFunctions(0),
- fNParticleFunctions(0),
- fNParticleAndTrackFunctions(0),
- fNTrackMonitorFunctions(0),
- fNParticleMonitorFunctions(0), 
- fNParticleAndTrackMonitorFunctions(0),
- fTrackFunctions(0x0),
- fParticleFunctions(0x0),
- fParticleAndTrackFunctions(0x0),
- fParticleMonitorFunctions(0x0),
- fTrackMonitorFunctions(0x0),
- fParticleAndTrackMonitorFunctions(0x0),
- fPairCut(0x0),
- fBufferSize(fgkDefaultBufferSize),
- fDisplayMixingInfo(fgkDefaultMixingInfo),
- fIsOwner(kFALSE)
 fReader(0x0),
 fNTrackFunctions(0),
 fNParticleFunctions(0),
 fNParticleAndTrackFunctions(0),
 fNTrackMonitorFunctions(0),
 fNParticleMonitorFunctions(0), 
 fNParticleAndTrackMonitorFunctions(0),
 fTrackFunctions(0x0),
 fParticleFunctions(0x0),
 fParticleAndTrackFunctions(0x0),
 fParticleMonitorFunctions(0x0),
 fTrackMonitorFunctions(0x0),
 fParticleAndTrackMonitorFunctions(0x0),
 fPairCut(0x0),
 fBufferSize(fgkDefaultBufferSize),
 fDisplayMixingInfo(fgkDefaultMixingInfo),
 fIsOwner(kFALSE)
  {
+//copy constructor
    Fatal("AliHBTAnalysis(const AliHBTAnalysis&)","Sensless");
  }
 /*************************************************************************************/ 
 const AliHBTAnalysis& AliHBTAnalysis::operator=(const AliHBTAnalysis& right)
  {
+//operator =
    Fatal("AliHBTAnalysis(const AliHBTAnalysis&)","Sensless");
    return *this;
  }
@@ -140,6 +143,8 @@ void AliHBTAnalysis::DeleteFunctions()
 
 void AliHBTAnalysis::Init()
 {
+//Initializeation method
+//calls Init for all functions
  UInt_t ii;
  for(ii = 0;ii<fNParticleFunctions;ii++)
    fParticleFunctions[ii]->Init();
@@ -271,7 +276,6 @@ void AliHBTAnalysis::Process(Option_t* option)
 
 void AliHBTAnalysis::ProcessTracksAndParticles()
 {
-
 //In order to minimize calling AliRun::GetEvent (we need at one time particles from different events),
 //the loops are splited
   
@@ -284,7 +288,7 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
   
 //  Int_t N1, N2, N=0; //number of particles in current event(we prcess two events in one time)
   
-  Int_t Nev = fReader->GetNumberOfTrackEvents();
+  Int_t nev = fReader->GetNumberOfTrackEvents();
   
   /***************************************/
   /******   Looping same events   ********/
@@ -298,7 +302,7 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
 
   register UInt_t ii;
   
-  for (Int_t i = 0;i<Nev;i++)
+  for (Int_t i = 0;i<nev;i++)
     {
       partEvent= fReader->GetParticleEvent(i);
       trackEvent = fReader->GetTrackEvent(i);
@@ -368,7 +372,7 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
   /***** Filling denominators    *********/
   /***************************************/
   if (fBufferSize != 0)
-   for (Int_t i = 0;i<Nev-1;i++)   //In each event (but last) ....
+   for (Int_t i = 0;i<nev-1;i++)   //In each event (but last) ....
     {
   
       if ((fNParticleFunctions == 0) && (fNTrackFunctions ==0) && (fNParticleAndTrackFunctions == 0))
@@ -386,20 +390,20 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
 
            if (fPairCut->GetFirstPartCut()->Pass(part1)) continue;
  
-           Int_t NNN;
+           Int_t maxeventnumber;
            
-           if ( ((i+fBufferSize) >= Nev) ||( fBufferSize < 0) ) //if buffer size is negative 
+           if ( ((i+fBufferSize) >= nev) ||( fBufferSize < 0) ) //if buffer size is negative 
                                                                 //or current event+buffersize is greater
                                                                 //than max nuber of events
              {
-               NNN = Nev; //set the max event number 
+               maxeventnumber = nev; //set the max event number 
              }
            else 
              {
-               NNN = i+fBufferSize; //set the current event number + fBufferSize
+               maxeventnumber = i+fBufferSize; //set the current event number + fBufferSize
              }
  
-           for (Int_t k = i+1; k<NNN;k++)  // ... Loop over next event
+           for (Int_t k = i+1; k<maxeventnumber;k++)  // ... Loop over next event
             {
              
              partEvent2= fReader->GetParticleEvent(k);
@@ -443,7 +447,7 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
                 for(ii = 0;ii<fNParticleAndTrackFunctions;ii++)
                   fParticleAndTrackFunctions[ii]->ProcessDiffEventParticles(tmptrackpair,tmppartpair);
               }//for(Int_t l = 0; l<N2;l++)   //  ... on all particles
-            }//for (Int_t k = i+1; k<NNN;k++)  // ... Loop over next event
+            }//for (Int_t k = i+1; k<maxeventnumber;k++)  // ... Loop over next event
        }
     } 
   /***************************************/
@@ -452,14 +456,14 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
 
 void AliHBTAnalysis::ProcessTracks()
 {
-  //In order to minimize calling AliRun::GetEvent (we need at one time particles from different events),
+//In order to minimize calling AliRun::GetEvent (we need at one time particles from different events),
 //the loops are splited
   AliHBTParticle * track1, * track2;
   AliHBTEvent * trackEvent;
   AliHBTEvent * trackEvent2;
 
   UInt_t ii;
-  Int_t Nev = fReader->GetNumberOfTrackEvents();
+  Int_t nev = fReader->GetNumberOfTrackEvents();
 
   AliHBTPair * trackpair = new AliHBTPair();
   AliHBTPair * tmptrackpair; //temporary pointer 
@@ -468,7 +472,7 @@ void AliHBTAnalysis::ProcessTracks()
   /******   Looping same events   ********/
   /******   filling numerators    ********/
   /***************************************/
-  for (Int_t i = 0;i<Nev;i++)
+  for (Int_t i = 0;i<nev;i++)
     {
       trackEvent = fReader->GetTrackEvent(i);
       if (!trackEvent) continue;
@@ -511,7 +515,7 @@ void AliHBTAnalysis::ProcessTracks()
   /***** Filling diff histogram *********/
   /***************************************/
   if (fBufferSize != 0)
-   for (Int_t i = 0;i<Nev-1;i++)   //In each event (but last) ....
+   for (Int_t i = 0;i<nev-1;i++)   //In each event (but last) ....
     {
       if ( fNTrackFunctions ==0 )
         continue; 
@@ -524,20 +528,20 @@ void AliHBTAnalysis::ProcessTracks()
          track1= trackEvent->GetParticle(j);
          if (fPairCut->GetFirstPartCut()->Pass(track1)) continue;
 
-         Int_t NNN;
+         Int_t maxeventnumber;
            
-         if ( ((i+fBufferSize) >= Nev) ||( fBufferSize < 0) ) //if buffer size is negative 
+         if ( ((i+fBufferSize) >= nev) ||( fBufferSize < 0) ) //if buffer size is negative 
                                                               //or current event+buffersize is greater
                                                               //than max nuber of events
           {
-            NNN = Nev; //set the max event number 
+            maxeventnumber = nev; //set the max event number 
           }
          else 
           {
-            NNN = i+fBufferSize; //set the current event number + fBufferSize
+            maxeventnumber = i+fBufferSize; //set the current event number + fBufferSize
           }
  
-         for (Int_t k = i+1; k<NNN;k++)  // ... Loop over next event
+         for (Int_t k = i+1; k<maxeventnumber;k++)  // ... Loop over next event
           {
             trackEvent2 = fReader->GetTrackEvent(k);
             if (!trackEvent2) continue;
@@ -564,7 +568,7 @@ void AliHBTAnalysis::ProcessTracks()
                    fTrackFunctions[ii]->ProcessDiffEventParticles(tmptrackpair);
                
              }//for(Int_t l = 0; l<N2;l++)   //  ... on all particles
-          }//for (Int_t k = i+1; k<NNN;k++)  // ... Loop over next event
+          }//for (Int_t k = i+1; k<maxeventnumber;k++)  // ... Loop over next event
        }
     } 
   /***************************************/
@@ -584,13 +588,13 @@ void AliHBTAnalysis::ProcessParticles()
   AliHBTPair * partpair = new AliHBTPair();
   AliHBTPair * tmppartpair; //temporary pointer to the pair
   
-  Int_t Nev = fReader->GetNumberOfPartEvents();
+  Int_t nev = fReader->GetNumberOfPartEvents();
   
   /***************************************/
   /******   Looping same events   ********/
   /******   filling numerators    ********/
   /***************************************/
-  for (Int_t i = 0;i<Nev;i++)
+  for (Int_t i = 0;i<nev;i++)
     {
       partEvent= fReader->GetParticleEvent(i);
       if (!partEvent) continue;
@@ -642,7 +646,7 @@ void AliHBTAnalysis::ProcessParticles()
   /***** Filling diff histogram *********/
   /***************************************/
   if (fBufferSize != 0) //less then 0 mix everything, == 0 do not mix denominator
-   for (Int_t i = 0;i<Nev-1;i++)   //In each event (but last)....
+   for (Int_t i = 0;i<nev-1;i++)   //In each event (but last)....
     {
       if ( fNParticleFunctions ==0 )
         continue; 
@@ -654,20 +658,20 @@ void AliHBTAnalysis::ProcessParticles()
        {
            part1= partEvent->GetParticle(j);
            if (fPairCut->GetFirstPartCut()->Pass(part1)) continue;
-           Int_t NNN;
+           Int_t maxeventnumber;
 
-           if ( ((i+fBufferSize) >= Nev) ||( fBufferSize < 0) ) //if buffer size is negative 
+           if ( ((i+fBufferSize) >= nev) ||( fBufferSize < 0) ) //if buffer size is negative 
                                                                 //or current event+buffersize is greater
                                                                 //than max nuber of events
             {
-             NNN = Nev; //set the max event number 
+             maxeventnumber = nev; //set the max event number 
             }
            else 
             {
-             NNN = i+fBufferSize; //set the current event number + fBufferSize
+             maxeventnumber = i+fBufferSize; //set the current event number + fBufferSize
             }
            
-           for (Int_t k = i+1; k<NNN;k++)  // ... Loop over next event
+           for (Int_t k = i+1; k<maxeventnumber;k++)  // ... Loop over next event
             {
              
              partEvent2= fReader->GetParticleEvent(k);
@@ -696,7 +700,7 @@ void AliHBTAnalysis::ProcessParticles()
                   fParticleFunctions[ii]->ProcessDiffEventParticles(tmppartpair);
                
               }//for(Int_t l = 0; l<N2;l++)   //  ... on all particles
-            }//for (Int_t k = i+1; k<NNN;k++)  // ... Loop over next event
+            }//for (Int_t k = i+1; k<maxeventnumber;k++)  // ... Loop over next event
        }
     } 
   /***************************************/
@@ -904,7 +908,7 @@ void AliHBTAnalysis::ProcessTracksAndParticlesNonIdentAnal()
 
   AliHBTEvent * rawtrackEvent, *rawpartEvent;
   
-  Int_t Nev = fReader->GetNumberOfTrackEvents();
+  Int_t nev = fReader->GetNumberOfTrackEvents();
 
   AliHBTPair * trackpair = new AliHBTPair();
   AliHBTPair * partpair = new AliHBTPair();
@@ -923,7 +927,7 @@ void AliHBTAnalysis::ProcessTracksAndParticlesNonIdentAnal()
   Info("ProcessTracksAndParticlesNonIdentAnal","*****  NON IDENT MODE ****************");
   Info("ProcessTracksAndParticlesNonIdentAnal","**************************************");
   
-  for (Int_t i = 0;i<Nev;i++)
+  for (Int_t i = 0;i<nev;i++)
     {
       rawpartEvent  = fReader->GetParticleEvent(i);
       rawtrackEvent = fReader->GetTrackEvent(i);
@@ -1061,6 +1065,7 @@ void AliHBTAnalysis::ProcessTracksAndParticlesNonIdentAnal()
  
 void AliHBTAnalysis::ProcessTracksNonIdentAnal()
 {
+//Process Tracks only with non identical mode
   AliHBTParticle * track1, * track2;
 
   AliHBTEvent * trackEvent1=0x0;
@@ -1069,7 +1074,7 @@ void AliHBTAnalysis::ProcessTracksNonIdentAnal()
 
   AliHBTEvent * rawtrackEvent;
   
-  Int_t Nev = fReader->GetNumberOfTrackEvents();
+  Int_t nev = fReader->GetNumberOfTrackEvents();
 
   AliHBTPair * trackpair = new AliHBTPair();
 
@@ -1084,7 +1089,7 @@ void AliHBTAnalysis::ProcessTracksNonIdentAnal()
   Info("ProcessTracksNonIdentAnal","*****  NON IDENT MODE ****************");
   Info("ProcessTracksNonIdentAnal","**************************************");
   
-  for (Int_t i = 0;i<Nev;i++)
+  for (Int_t i = 0;i<nev;i++)
     {
       rawtrackEvent = fReader->GetTrackEvent(i);
       if (rawtrackEvent == 0x0)  continue;//in case of any error
@@ -1187,6 +1192,7 @@ void AliHBTAnalysis::ProcessTracksNonIdentAnal()
 
 void AliHBTAnalysis::ProcessParticlesNonIdentAnal()
 {
+//process paricles only with non identical mode
   AliHBTParticle * part1 = 0x0, * part2 = 0x0;
 
   AliHBTEvent * partEvent1 = 0x0;
@@ -1195,7 +1201,7 @@ void AliHBTAnalysis::ProcessParticlesNonIdentAnal()
 
   AliHBTEvent * rawpartEvent = 0x0;
 
-  Int_t Nev = fReader->GetNumberOfPartEvents();
+  Int_t nev = fReader->GetNumberOfPartEvents();
 
   AliHBTPair * partpair = new AliHBTPair();
 
@@ -1209,7 +1215,7 @@ void AliHBTAnalysis::ProcessParticlesNonIdentAnal()
   Info("ProcessParticlesNonIdentAnal","*****  NON IDENT MODE ****************");
   Info("ProcessParticlesNonIdentAnal","**************************************");
 
-  for (Int_t i = 0;i<Nev;i++)
+  for (Int_t i = 0;i<nev;i++)
     {
       rawpartEvent  = fReader->GetParticleEvent(i);
       if ( rawpartEvent == 0x0  ) continue;//in case of any error
index bda4216832f208ce00164b8b863ac7028b8d77e7..042cc6b515a7999e58a4142866f91a259bf948da 100644 (file)
@@ -1,16 +1,19 @@
 #include "AliHBTCorrelFctn.h"
-//Set of Correlation fuctions
-//AliHBTQInvCorrelFctn - Q Invariant correlatyion function
+//_____________________________________________________________
+///////////////////////////////////////////////////////////////
 //
+//  Set of Correlation fuctions
+//  AliHBTQInvCorrelFctn - Q Invariant correlatyion function
 //
+//  Corroleation function is created from dividing two histograms of QInvariant:
+//    of particles from the same evnt
+//  by 
+//    of particles from different events
 //
+///////////////////////////////////////////////////////////////
 
 ClassImp(AliHBTQInvCorrelFctn)
 
-//Corroleation function is created from dividing two histograms of QInvariant:
-//  of particles from the same evnt
-//by 
-//  of particles from different events
 
 AliHBTQInvCorrelFctn::
 AliHBTQInvCorrelFctn(Int_t nbins, Double_t maxXval, Double_t minXval):
index 9c001a99efeb9264c106eb137c0e8a8d65b89dfc..407e1358ffbb440c68c6b217896f1481eba2b7a2 100644 (file)
@@ -1,15 +1,19 @@
 #ifndef ALIHBTCORRELFUNCTION_H
 #define ALIHBTCORRELFUNCTION_H
-
-#include "AliHBTFunction.h"
-#include "AliHBTParticle.h"
-#include <Riostream.h>
+//_________________________________________________________________
+///////////////////////////////////////////////////////////////////
+//
 //Set of functions:
 //   Q Invaraint Correlation Function
 //   Invariant Mass Function
 //
 //more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html
 //Piotr.Skowronski@cern.ch
+//
+///////////////////////////////////////////////////////////////////
+#include "AliHBTFunction.h"
+
+class AliHBTParticle;
 
 /*************************************************************************************/ 
 class AliHBTQInvCorrelFctn: public AliHBTOnePairFctn1D
index 003a062980c1358f42858285a09f059917d67f8f..67dea548966e7cb90f1ed912bb63b253b4920cfe 100644 (file)
@@ -1,32 +1,35 @@
 #include "AliHBTEvent.h"
 #include "AliHBTParticle.h"
+//_________________________________________________________________________
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// class AliHBTEvent                                                     //
+//                                                                       //
+// This class stores HBT perticles for one event                         //
+// more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html  //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
 
 ClassImp(AliHBTEvent)
 
 const UInt_t AliHBTEvent::fgkInitEventSize = 10000;
 
 
-
 /**************************************************************************/ 
  
-AliHBTEvent::AliHBTEvent()
+AliHBTEvent::AliHBTEvent():
+  fSize(fgkInitEventSize),
+  fParticles(new AliHBTParticle* [fSize]),
+  fNParticles(0),
+  fOwner(kTRUE)
  {
-    if(fgkInitEventSize<1) 
-     {
-      Fatal("AliHBTEvent::AliHBTEvent()",
-            "fgkInitEventSize has a stiupid value (%d). Change it to positive number and recompile",
-             fgkInitEventSize);
-      
-     }
-    fSize=fgkInitEventSize;
-    fParticles = new AliHBTParticle* [fSize];
-    fNParticles = 0;
-    fOwner = kTRUE;
+ //default constructor    
  }
 /**************************************************************************/ 
 
 AliHBTEvent::~AliHBTEvent()
  {
+ //destructor
    this->Reset();//delete all particles
    if(fParticles)
     { 
@@ -37,7 +40,7 @@ AliHBTEvent::~AliHBTEvent()
 /**************************************************************************/ 
 void  AliHBTEvent::Reset()
 {
 //deletes all particles from the event
+ //deletes all particles from the event
   if(fParticles && fOwner)
     {
       for(Int_t i =0; i<fNParticles; i++)
@@ -45,9 +48,11 @@ void  AliHBTEvent::Reset()
     }
    fNParticles = 0;
 } 
+/**************************************************************************/ 
 
 AliHBTParticle* AliHBTEvent::GetParticleSafely(Int_t n)
  {
+ //returns nth particle  with range check
    if( (n<0) || (fNParticles<=n) ) return 0x0;
    else return fParticles[n];
    
@@ -56,7 +61,7 @@ AliHBTParticle* AliHBTEvent::GetParticleSafely(Int_t n)
 
 void  AliHBTEvent:: AddParticle(AliHBTParticle* hbtpart)
  {
  //Adds new perticle to the event
+ //Adds new perticle to the event
    if ( fNParticles+1 >= fSize) Expand(); //if there is no space in array, expand it
    fParticles[fNParticles++] = hbtpart; //add a pointer
  }
@@ -64,6 +69,7 @@ void  AliHBTEvent:: AddParticle(AliHBTParticle* hbtpart)
 /**************************************************************************/ 
 void  AliHBTEvent::AddParticle(TParticle* part)
  {
+ //Adds TParticle to event
    AddParticle( new AliHBTParticle(*part) );
  }
 /**************************************************************************/ 
@@ -71,6 +77,7 @@ void  AliHBTEvent::
 AddParticle(Int_t pdg, Double_t px, Double_t py, Double_t pz, Double_t etot,
             Double_t vx, Double_t vy, Double_t vz, Double_t time)
  {
+ //adds particle to event
    AddParticle(new  AliHBTParticle(pdg,px,py,pz,etot,vx,vy,vz,time) );
  }
 /**************************************************************************/ 
@@ -97,4 +104,3 @@ void AliHBTEvent::Expand()
  }
  
  
index 12948603332a662229b04bf75419f29de602fbfd..d2d632a3c693d8f034219def2da02a341581694e 100644 (file)
@@ -1,39 +1,49 @@
 #ifndef ALIHBTEvent_H
 #define ALIHBTEvent_H
-//This class sters HBT perticles for one event
-//more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html
+//_________________________________________________________________________
+///////////////////////////////////////////////////////////////////////////
+//                                                                       //
+// class AliHBTEvent                                                     //
+//                                                                       //
+// This class stores HBT perticles for one event                         //
+// more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html  //
+//                                                                       //
+///////////////////////////////////////////////////////////////////////////
 
 #include <TObject.h>
 
 class AliHBTParticle;
 class TParticle;
+
 class AliHBTEvent: public TObject
  {
   public:
     AliHBTEvent();
     virtual ~AliHBTEvent();
-    const static UInt_t fgkInitEventSize; //initial number of the array
-                                         //if expanded, this size is used also
+
     AliHBTParticle* GetParticle(Int_t n);  //gets particle 
     AliHBTParticle* GetParticleSafely(Int_t n); //gets particle with index check
     
-    void    AddParticle(AliHBTParticle*); //adds particle to the event
-    void    AddParticle(TParticle*); //adds particle to the event
+    void    AddParticle(AliHBTParticle* hbtpart); //adds particle to the event
+    void    AddParticle(TParticle* part); //adds particle to the event
     void    AddParticle(Int_t pdg, Double_t px, Double_t py, Double_t pz, Double_t etot,
                         Double_t vx, Double_t vy, Double_t vz, Double_t time);
     
     Int_t   GetNumberOfParticles() const;
     void    Reset(); //deletes all entries
     void    SetOwner(Bool_t owns = kTRUE){ fOwner = owns; }
-    Bool_t  IsOwner() {return fOwner;}
+    Bool_t  IsOwner() const {return fOwner;}
+
   protected:
+    Int_t  fSize;       //!current size of the array
     AliHBTParticle ** fParticles; //!array of pointers to the particles
     Int_t  fNParticles; //!number of particles in Event
-    Int_t  fSize;       //!current size of the array
     Bool_t fOwner;      //flag if that event owns the 
     void   Expand();    //expands the array if necessary
+
   private:
-    
+    const static UInt_t fgkInitEventSize; //initial number of the array
+                                         //if expanded, this size is used also
   public:
     ClassDef(AliHBTEvent,1)
  };
index 33b73f55cf5b1570edfdc9b59466f6dd62475058..c34c8056c384f503b98edc7c7004bf75d420a0be 100644 (file)
@@ -33,6 +33,9 @@
 */
 /////////////////////////////////////////////////////////////////////// 
 
+#include <TH2.h>
+#include <TH3.h>
+
 /******************************************************************/
 /******************************************************************/
 
@@ -302,7 +305,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 +315,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;
@@ -479,7 +482,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 +491,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;
@@ -674,7 +677,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 +687,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;
index 3687a5f934565e28c46bc34e2aa19d962e71db43..1e28e382e1eb8d6caf3856675c902faf66bdee3b 100644 (file)
@@ -1,17 +1,5 @@
-//Piotr Skowronski@cern.ch
-
 #ifndef ALIHBTFUNCTION_H
 #define ALIHBTFUNCTION_H
-
-#include "AliHBTParticleCut.h"
-#include "AliHBTPairCut.h"
-#include "AliHBTPair.h"
-
-#include <TH2.h>
-#include <TH3.h>
-
-class AliHBTAnalysis;
-
 //____________________
 ///////////////////////////////////////////////////////
 //                                                   //
@@ -24,6 +12,17 @@ class AliHBTAnalysis;
 //                                                   //
 ///////////////////////////////////////////////////////
 
+#include <TH1.h>
+
+#include "AliHBTPairCut.h"
+#include "AliHBTPair.h"
+
+class TH2D;
+class TH3D;
+
+class AliHBTAnalysis;
+class AliHBTParticleCut;
+
 class AliHBTFunction: public TNamed
 {
   public:
@@ -42,13 +41,13 @@ class AliHBTFunction: public TNamed
     void Rename(const Char_t * name); //renames the function and histograms ==title is the same that name
     void Rename(const Char_t * name, const Char_t * title); //renames and retitle the function and histograms
     
-    void SetPairCut(AliHBTPairCut*);
+    void SetPairCut(AliHBTPairCut* cut);
     
     virtual AliHBTPair* CheckPair(AliHBTPair* pair);
     
   protected:
     virtual void BuildHistos() = 0;//builds default histograms
-    AliHBTPairCut*      fPairCut;
+    AliHBTPairCut*   fPairCut;     //pair cut
     
   public:  
    ClassDef(AliHBTFunction,2)