Monitor function ProcessDiff ProcessSame substituted with Process, since previous...
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Nov 2002 10:43:21 +0000 (10:43 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Nov 2002 10:43:21 +0000 (10:43 +0000)
HBTAN/AliHBTAnalysis.cxx
HBTAN/AliHBTAnalysis.h
HBTAN/AliHBTMonitorFunction.cxx
HBTAN/AliHBTMonitorFunction.h

index 1ac601c5ef93265d1828fe17462874713fd55535..92beb74cc31deb452237c2a401483554a2a0e799 100644 (file)
 #include <TBenchmark.h>
 #include <TList.h>
 
+//_________________________________________________________
+///////////////////////////////////////////////////////////
+//
+//Central Object Of HBTAnalyser: 
+//This class performs main looping within HBT Analysis
+//User must plug a reader of Type AliHBTReader
+//User plugs in coorelation and monitor functions
+//as well as monitor functions
+//
+//HBT Analysis Tool, which is integral part of AliRoot,
+//ALICE Off-Line framework:
+//
+//Piotr.Skowronski@cern.ch
+//more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html
+//
+//_________________________________________________________
+
 ClassImp(AliHBTAnalysis)
 
 const UInt_t AliHBTAnalysis::fgkFctnArraySize = 100;
@@ -90,27 +107,77 @@ AliHBTAnalysis::~AliHBTAnalysis()
  }
 
 /*************************************************************************************/ 
+
 void AliHBTAnalysis::DeleteFunctions()
 {
+ //Deletes all functions added to analysis
  UInt_t ii;
  for(ii = 0;ii<fNParticleFunctions;ii++)
    delete fParticleFunctions[ii];
+ fNParticleFunctions = 0;
                 
  for(ii = 0;ii<fNTrackFunctions;ii++)
    delete fTrackFunctions[ii];
-
+ fNTrackFunctions = 0;
  for(ii = 0;ii<fNParticleAndTrackFunctions;ii++)
    delete fParticleAndTrackFunctions[ii];
+ fNParticleAndTrackFunctions = 0;
  
  for(ii = 0; ii<fNParticleMonitorFunctions; ii++)
    delete fParticleMonitorFunctions[ii];
+ fNParticleMonitorFunctions = 0;
    
  for(ii = 0; ii<fNTrackMonitorFunctions; ii++)
    delete fTrackMonitorFunctions[ii];
+ fNTrackMonitorFunctions = 0;
    
  for(ii = 0; ii<fNParticleAndTrackMonitorFunctions; ii++)
    delete fParticleAndTrackMonitorFunctions[ii];
+ fNParticleAndTrackMonitorFunctions = 0;
 }
+/*************************************************************************************/ 
+
+void AliHBTAnalysis::Init()
+{
+ UInt_t ii;
+ for(ii = 0;ii<fNParticleFunctions;ii++)
+   fParticleFunctions[ii]->Init();
+                
+ for(ii = 0;ii<fNTrackFunctions;ii++)
+   fTrackFunctions[ii]->Init();
+
+ for(ii = 0;ii<fNParticleAndTrackFunctions;ii++)
+   fParticleAndTrackFunctions[ii]->Init();
+ for(ii = 0; ii<fNParticleMonitorFunctions; ii++)
+   fParticleMonitorFunctions[ii]->Init();
+   
+ for(ii = 0; ii<fNTrackMonitorFunctions; ii++)
+   fTrackMonitorFunctions[ii]->Init();
+   
+ for(ii = 0; ii<fNParticleAndTrackMonitorFunctions; ii++)
+   fParticleAndTrackMonitorFunctions[ii]->Init();
+}
+/*************************************************************************************/ 
+
+void AliHBTAnalysis::ResetFunctions()
+{
+//In case fOwner is true, deletes all functions
+//in other case, just set number of analysis to 0
+ if (fIsOwner) DeleteFunctions();
+ else
+  {
+    fNParticleFunctions = 0;
+    fNTrackFunctions = 0;
+    fNParticleAndTrackFunctions = 0;
+    fNParticleMonitorFunctions = 0;
+    fNTrackMonitorFunctions = 0;
+    fNParticleAndTrackMonitorFunctions = 0;
+  }
+}
+/*************************************************************************************/ 
+
 void AliHBTAnalysis::Process(Option_t* option)
 {
  //default option  = "TracksAndParticles"
@@ -143,7 +210,6 @@ void AliHBTAnalysis::Process(Option_t* option)
    return;
   }
  
  const char *oT = strstr(option,"Tracks");
  const char *oP = strstr(option,"Particles");
  
@@ -198,7 +264,6 @@ void AliHBTAnalysis::Process(Option_t* option)
   }
  
 }
-
 /*************************************************************************************/ 
 
 void AliHBTAnalysis::ProcessTracksAndParticles()
@@ -252,11 +317,11 @@ void AliHBTAnalysis::ProcessTracksAndParticles()
          if (fPairCut->GetFirstPartCut()->Pass(part1)) continue;
 
          for(ii = 0; ii<fNParticleMonitorFunctions; ii++)
-           fParticleMonitorFunctions[ii]->ProcessSameEventParticles(part1);
+           fParticleMonitorFunctions[ii]->Process(part1);
          for(ii = 0; ii<fNTrackMonitorFunctions; ii++)
-           fTrackMonitorFunctions[ii]->ProcessSameEventParticles(track1);
+           fTrackMonitorFunctions[ii]->Process(track1);
          for(ii = 0; ii<fNParticleAndTrackMonitorFunctions; ii++)
-           fParticleAndTrackMonitorFunctions[ii]->ProcessSameEventParticles(track1,part1);
+           fParticleAndTrackMonitorFunctions[ii]->Process(track1,part1);
 
          if ( (fNParticleFunctions == 0) && (fNTrackFunctions ==0) && (fNParticleAndTrackFunctions == 0))
            continue; 
@@ -415,7 +480,7 @@ void AliHBTAnalysis::ProcessTracks()
          if (fPairCut->GetFirstPartCut()->Pass(track1)) continue;
 
          for(ii = 0; ii<fNTrackMonitorFunctions; ii++)
-           fTrackMonitorFunctions[ii]->ProcessSameEventParticles(track1);
+           fTrackMonitorFunctions[ii]->Process(track1);
 
          if ( fNTrackFunctions ==0 )
            continue; 
@@ -539,7 +604,7 @@ void AliHBTAnalysis::ProcessParticles()
         
          UInt_t zz;
          for(zz = 0; zz<fNParticleMonitorFunctions; zz++)
-           fParticleMonitorFunctions[zz]->ProcessSameEventParticles(part1);
+           fParticleMonitorFunctions[zz]->Process(part1);
 
          if ( fNParticleFunctions ==0 )
            continue; 
@@ -890,11 +955,11 @@ void AliHBTAnalysis::ProcessTracksAndParticlesNonIdentAnal()
          track1= trackEvent1->GetParticle(j);
 
          for(ii = 0; ii<fNParticleMonitorFunctions; ii++)
-           fParticleMonitorFunctions[ii]->ProcessSameEventParticles(part1);
+           fParticleMonitorFunctions[ii]->Process(part1);
          for(ii = 0; ii<fNTrackMonitorFunctions; ii++)
-           fTrackMonitorFunctions[ii]->ProcessSameEventParticles(track1);
+           fTrackMonitorFunctions[ii]->Process(track1);
          for(ii = 0; ii<fNParticleAndTrackMonitorFunctions; ii++)
-           fParticleAndTrackMonitorFunctions[ii]->ProcessSameEventParticles(track1,part1);
+           fParticleAndTrackMonitorFunctions[ii]->Process(track1,part1);
 
          /***************************************/
          /******   filling numerators    ********/
@@ -1046,7 +1111,7 @@ void AliHBTAnalysis::ProcessTracksNonIdentAnal()
          track1= trackEvent1->GetParticle(j);
 
          for(ii = 0; ii<fNTrackMonitorFunctions; ii++)
-           fTrackMonitorFunctions[ii]->ProcessSameEventParticles(track1);
+           fTrackMonitorFunctions[ii]->Process(track1);
 
          /***************************************/
          /******   filling numerators    ********/
@@ -1172,7 +1237,7 @@ void AliHBTAnalysis::ProcessParticlesNonIdentAnal()
 
          UInt_t zz;
          for(zz = 0; zz<fNParticleMonitorFunctions; zz++)
-           fParticleMonitorFunctions[zz]->ProcessSameEventParticles(part1);
+           fParticleMonitorFunctions[zz]->Process(part1);
 
          /***************************************/
          /******   filling numerators    ********/
index 808b790a66c0979d30b93957a946159bec47bee6..7ba0ba7a64c451c96f32fa5c6b7ab324dd37e097 100644 (file)
@@ -19,6 +19,10 @@ class AliHBTMonTwoParticleFctn;
 
 class TList;
 
+//____________________
+//Central Object of HBT Analyser
+//Performs looping over events/particles
+
 class AliHBTAnalysis: public TObject
  {
    public:
@@ -49,6 +53,8 @@ class AliHBTAnalysis: public TObject
      void SetOwner(Bool_t owner=kTRUE){fIsOwner=owner;}
      Bool_t IsOwner() const {return fIsOwner;}
      Bool_t IsNonIdentAnalysis();
+     void   Init();
+     void   ResetFunctions();
    protected:
      
      Bool_t RunCoherencyCheck();
index 10003dfba49cbcadc7b58ffe558b7d6c3056b621..53e6532babdcdf60ab7d1be19333e9482c6a928e 100644 (file)
@@ -149,7 +149,7 @@ AliHBTMonOneParticleFctn1D::~AliHBTMonOneParticleFctn1D()
 }
 /******************************************************************/
 
-void AliHBTMonOneParticleFctn1D::ProcessSameEventParticles(AliHBTParticle* particle)
+void AliHBTMonOneParticleFctn1D::Process(AliHBTParticle* particle)
 {
  //Fills the result
    particle = CheckParticle(particle);
@@ -178,7 +178,7 @@ AliHBTMonOneParticleFctn2D::~AliHBTMonOneParticleFctn2D()
 {
   delete fResult;
 }
-void AliHBTMonOneParticleFctn2D::ProcessSameEventParticles(AliHBTParticle* particle)
+void AliHBTMonOneParticleFctn2D::Process(AliHBTParticle* particle)
 {
   particle = CheckParticle(particle);
   if(particle) 
@@ -256,7 +256,7 @@ AliHBTMonTwoParticleFctn1D::~AliHBTMonTwoParticleFctn1D()
 }
 /******************************************************************/
 void AliHBTMonTwoParticleFctn1D::
-ProcessSameEventParticles(AliHBTParticle* trackparticle, AliHBTParticle* partparticle)
+Process(AliHBTParticle* trackparticle, AliHBTParticle* partparticle)
 {
   partparticle  = CheckParticle(partparticle);
   trackparticle = CheckParticle(trackparticle);
@@ -292,7 +292,7 @@ AliHBTMonTwoParticleFctn2D::~AliHBTMonTwoParticleFctn2D()
 }
 /******************************************************************/
 void AliHBTMonTwoParticleFctn2D::
-ProcessSameEventParticles(AliHBTParticle* trackparticle, AliHBTParticle* partparticle)
+Process(AliHBTParticle* trackparticle, AliHBTParticle* partparticle)
 {
   partparticle  = CheckParticle(partparticle);
   trackparticle = CheckParticle(trackparticle);
@@ -309,7 +309,7 @@ ProcessSameEventParticles(AliHBTParticle* trackparticle, AliHBTParticle* partpar
 ClassImp(AliHBTMonTwoParticleFctn3D)
 
 void AliHBTMonTwoParticleFctn3D::
-ProcessSameEventParticles(AliHBTParticle* trackparticle, AliHBTParticle* partparticle)
+Process(AliHBTParticle* trackparticle, AliHBTParticle* partparticle)
 {
   partparticle  = CheckParticle(partparticle);
   trackparticle = CheckParticle(trackparticle);
index a03f9554900140b5d74c5813fbf8d079896b8812..64c1592802de339f6ae8d262fa303c515b374916 100644 (file)
@@ -22,7 +22,7 @@ class AliHBTMonitorFunction: public TNamed
     virtual TH1* GetResult() = 0;
 
     virtual void Write();
-    
+    virtual void Init(){}
     void Rename(const Char_t * name); 
     void Rename(const Char_t * name, const Char_t * title); 
     
@@ -59,7 +59,7 @@ class AliHBTMonOneParticleFctn: public AliHBTMonitorFunction
     AliHBTMonOneParticleFctn(const Char_t *name, const Char_t *title):AliHBTMonitorFunction(name,title){}
     virtual ~AliHBTMonOneParticleFctn(){}
     
-    virtual void ProcessSameEventParticles(AliHBTParticle* particle) = 0;
+    virtual void Process(AliHBTParticle* particle) = 0;
     
   protected:
   public:  
@@ -78,7 +78,7 @@ class AliHBTMonOneParticleFctn1D: public AliHBTMonOneParticleFctn
   
   TH1* GetResult(){return fResult;}
 
-  void ProcessSameEventParticles(AliHBTParticle* particle);
+  void Process(AliHBTParticle* particle);
 
  protected:
   virtual Double_t GetValue(AliHBTParticle* particle) = 0; 
@@ -99,7 +99,7 @@ class AliHBTMonOneParticleFctn2D: public AliHBTMonOneParticleFctn
   
   TH1* GetResult(){return fResult;}
   
-  void ProcessSameEventParticles(AliHBTParticle* particle);
+  void Process(AliHBTParticle* particle);
 
  protected:
   virtual void GetValues(AliHBTParticle* particle, Double_t&, Double_t&) = 0;
@@ -140,7 +140,7 @@ class AliHBTMonTwoParticleFctn: public AliHBTMonitorFunction
     virtual ~AliHBTMonTwoParticleFctn(){};
     
     virtual void 
-    ProcessSameEventParticles(AliHBTParticle* trackparticle, AliHBTParticle* partparticle) = 0;
+    Process(AliHBTParticle* trackparticle, AliHBTParticle* partparticle) = 0;
             
   protected:
   public:  
@@ -159,7 +159,7 @@ class AliHBTMonTwoParticleFctn1D: public AliHBTMonTwoParticleFctn
   
   TH1* GetResult(){return fResult;}
   
-  void ProcessSameEventParticles(AliHBTParticle* trackparticle, AliHBTParticle* partparticle);
+  void Process(AliHBTParticle* trackparticle, AliHBTParticle* partparticle);
   
  protected:
   virtual Double_t GetValue(AliHBTParticle* trackparticle, AliHBTParticle* partparticle) = 0;
@@ -179,9 +179,7 @@ class AliHBTMonTwoParticleFctn2D: public AliHBTMonTwoParticleFctn
   
   TH1* GetResult(){return fResult;}
   
-  void ProcessSameEventParticles(AliHBTParticle* trackparticle, AliHBTParticle* partparticle);
-  void ProcessDiffEventParticles(AliHBTParticle* trackparticle, AliHBTParticle* partparticle){};
+  void Process(AliHBTParticle* trackparticle, AliHBTParticle* partparticle);
   
  protected:
   virtual void GetValues(AliHBTParticle*,AliHBTParticle*, Double_t&, Double_t&) = 0;
@@ -204,10 +202,8 @@ class AliHBTMonTwoParticleFctn3D: public AliHBTMonTwoParticleFctn
   
   TH1* GetResult(){return fResult;}
   
-  void ProcessSameEventParticles(AliHBTParticle* trackparticle, AliHBTParticle* partparticle);
-  void ProcessDiffEventParticles(AliHBTParticle* trackparticle, AliHBTParticle* partparticle){};
-  
+  void Process(AliHBTParticle* trackparticle, AliHBTParticle* partparticle);
+
  protected:
   virtual void GetValues(AliHBTParticle*,AliHBTParticle*, Double_t&, Double_t&,Double_t&) = 0;