memory leaks removed; new base class for CFs introduced
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Feb 2004 11:16:25 +0000 (11:16 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Feb 2004 11:16:25 +0000 (11:16 +0000)
HBTAN/AliHBTCorrelFctn.cxx
HBTAN/AliHBTCorrelFctn.h
HBTAN/AliHBTFunction.cxx
HBTAN/AliHBTFunction.h
HBTAN/AliHBTTwoTrackEffFctn.cxx
HBTAN/AliHBTTwoTrackEffFctn.h
HBTAN/AliHBTWeightFctn.cxx
HBTAN/AliHBTWeightFctn.h
HBTAN/AliHBTWeightTheorFctn.cxx
HBTAN/AliHBTWeightTheorFctn.h
HBTAN/HBTAnalysisLinkDef.h

index 5fff9883c2011590e695dd927718ca6f21a70b8f..adf5cca67ec79622145cf4d11b75a7be78891ecb 100644 (file)
@@ -34,8 +34,11 @@ AliHBTQInvCorrelFctn::AliHBTQInvCorrelFctn(Int_t nbins, Double_t maxXval, Double
 /*************************************************************************************/ 
 
 TH1* AliHBTQInvCorrelFctn::GetResult()
-{  
- return GetRatio(Scale());
+{
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }
 /*************************************************************************************/ 
 /*************************************************************************************/ 
@@ -54,8 +57,10 @@ AliHBTQOutCMSLCCorrelFctn::AliHBTQOutCMSLCCorrelFctn(Int_t nbins, Double_t maxXv
     
 TH1* AliHBTQOutCMSLCCorrelFctn::GetResult()
 {
- //returns result of the function
- return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }
 /*************************************************************************************/ 
 /*************************************************************************************/ 
@@ -74,8 +79,10 @@ AliHBTQLongCMSLCCorrelFctn::AliHBTQLongCMSLCCorrelFctn(Int_t nbins, Double_t max
     
 TH1* AliHBTQLongCMSLCCorrelFctn::GetResult()
 {
- //returns result of the function
- return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }
 /*************************************************************************************/ 
 /*************************************************************************************/ 
@@ -94,8 +101,10 @@ AliHBTQSideCMSLCCorrelFctn::AliHBTQSideCMSLCCorrelFctn(Int_t nbins, Double_t max
     
 TH1* AliHBTQSideCMSLCCorrelFctn::GetResult()
 {
- //returns result
- return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }
 
 
@@ -116,8 +125,7 @@ AliHBTInvMassCorrelFctn::AliHBTInvMassCorrelFctn(Int_t nbins, Double_t maxXval,
 TH1* AliHBTInvMassCorrelFctn::GetResult()
 {
  //returns result
- TString name = fName + " Result";
- return (TH1*)GetNumerator()->Clone(name.Data());
+ return GetNumerator();
 }
 /*************************************************************************************/ 
 /*************************************************************************************/ 
@@ -137,8 +145,10 @@ AliHBTTwoKStarCorrelFctn::AliHBTTwoKStarCorrelFctn(Int_t nbins, Double_t maxXval
 
 TH1* AliHBTTwoKStarCorrelFctn::GetResult()
 {  
- //returns result
- return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }
 
 /*************************************************************************************/ 
index 942f6300eca206895d05d0b06a91fa7cc95e2b0b..df22900af1a2fa8ac641d747051678d6889d9dc8 100644 (file)
@@ -23,7 +23,7 @@
 #include <Riostream.h>
 
 /*************************************************************************************/ 
-class AliHBTQInvCorrelFctn: public AliHBTOnePairFctn1D
+class AliHBTQInvCorrelFctn: public AliHBTOnePairFctn1D, public AliHBTCorrelFunction
 {
 //Q Invaraint Correlation Function
 //1D two particle function 
@@ -34,12 +34,12 @@ class AliHBTQInvCorrelFctn: public AliHBTOnePairFctn1D
  protected:
    Double_t GetValue(AliHBTPair * pair){return pair->GetQInv();}
  private:  
-   ClassDef(AliHBTQInvCorrelFctn,1)
+   ClassDef(AliHBTQInvCorrelFctn,2)
  
 };
 /*************************************************************************************/ 
 
-class AliHBTQOutCMSLCCorrelFctn: public AliHBTOnePairFctn1D
+class AliHBTQOutCMSLCCorrelFctn: public AliHBTOnePairFctn1D, public AliHBTCorrelFunction
 {
 //Q OutCMSLCaraint Correlation Function
 //1D two particle function 
@@ -50,11 +50,11 @@ class AliHBTQOutCMSLCCorrelFctn: public AliHBTOnePairFctn1D
  protected:
    Double_t GetValue(AliHBTPair * pair){return pair->GetQOutCMSLC();}
  private:  
-    ClassDef(AliHBTQOutCMSLCCorrelFctn,1)
+    ClassDef(AliHBTQOutCMSLCCorrelFctn,2)
 };
 /*************************************************************************************/ 
 
-class AliHBTQLongCMSLCCorrelFctn: public AliHBTOnePairFctn1D
+class AliHBTQLongCMSLCCorrelFctn: public AliHBTOnePairFctn1D, public AliHBTCorrelFunction
 {
 //Q LongCMSLCaraint Correlation Function
 //1D two particle function 
@@ -65,11 +65,11 @@ class AliHBTQLongCMSLCCorrelFctn: public AliHBTOnePairFctn1D
  protected:
    Double_t GetValue(AliHBTPair * pair){return pair->GetQLongCMSLC();}
  private:  
-    ClassDef(AliHBTQLongCMSLCCorrelFctn,1)
+    ClassDef(AliHBTQLongCMSLCCorrelFctn,2)
 };
 /*************************************************************************************/ 
 
-class AliHBTQSideCMSLCCorrelFctn: public AliHBTOnePairFctn1D
+class AliHBTQSideCMSLCCorrelFctn: public AliHBTOnePairFctn1D, public AliHBTCorrelFunction
 {
 //Q SideCMSLCaraint Correlation Function
 //1D two particle function 
@@ -80,7 +80,7 @@ class AliHBTQSideCMSLCCorrelFctn: public AliHBTOnePairFctn1D
  protected:
    Double_t GetValue(AliHBTPair * pair){return pair->GetQSideCMSLC();}
  private:  
-    ClassDef(AliHBTQSideCMSLCCorrelFctn,1)
+    ClassDef(AliHBTQSideCMSLCCorrelFctn,2)
 };
 /*************************************************************************************/ 
 
@@ -99,7 +99,7 @@ class AliHBTInvMassCorrelFctn: public AliHBTOnePairFctn1D
 
 /*************************************************************************************/ 
 
-class AliHBTTwoKStarCorrelFctn: public AliHBTOnePairFctn1D
+class AliHBTTwoKStarCorrelFctn: public AliHBTOnePairFctn1D, public AliHBTCorrelFunction
 {
 //   Correlation Function of 2*KStar
  public:
@@ -109,7 +109,7 @@ class AliHBTTwoKStarCorrelFctn: public AliHBTOnePairFctn1D
  protected:
    Double_t GetValue(AliHBTPair * pair) { return 2.0*pair->GetKStar();}
  private:  
-    ClassDef(AliHBTTwoKStarCorrelFctn,1)
+    ClassDef(AliHBTTwoKStarCorrelFctn,2)
 };
 
 #endif
index 369ef975c4271def63f04a7bbb8feba5465d6653..841abcb92eb406cb902c55d3048bd2c7aeda9e1b 100644 (file)
@@ -210,6 +210,28 @@ void AliHBTFunction::InitFunction()
   GetDenominator()->SetDirectory(0x0);
   Info("InitFunction","Done");
 }
+/******************************************************************/
+/******************************************************************/
+/******************************************************************/
+ClassImp(AliHBTCorrelFunction)
+//____________________________________________
+//////////////////////////////////////////////
+//
+// class AliHBTCorrelFunction
+// 
+// Base class for correlation fuctions, that is which returns ratio.
+// Stores pointer the created ratio histogram and deletes it when function is deleted
+// created in order to evoid memory leak 
+//
+////////////////////////////////////////////////////////
+AliHBTCorrelFunction& AliHBTCorrelFunction::operator=(const AliHBTCorrelFunction& in)
+{
+ //assigment operator
+  if (&in == this) return *this;
+  delete fRatio;
+  fRatio=(in.fRatio)?(TH1*)in.fRatio->Clone():0x0;
+  return *this;
+}
 
 /******************************************************************/
 /******************************************************************/
index c5f91b3e89da1be3669208dd609c0c2403180b11..23a058f17a1333ea178ad7c041cda424f699d8d4 100644 (file)
@@ -73,6 +73,24 @@ inline AliHBTPair* AliHBTFunction::CheckPair(AliHBTPair* pair)
   return pair; 
 }
 
+/******************************************************************/
+/******************************************************************/
+/******************************************************************/
+class AliHBTCorrelFunction
+{
+  public:
+    AliHBTCorrelFunction():fRatio(0x0){}
+    AliHBTCorrelFunction(const AliHBTCorrelFunction& in):fRatio((in.fRatio)?(TH1*)in.fRatio->Clone():0x0){}
+    virtual ~AliHBTCorrelFunction(){delete fRatio;}
+    
+    AliHBTCorrelFunction& operator=(const AliHBTCorrelFunction& in);
+   
+  protected:
+    TH1* fRatio;//!pointer to the ratio(result)
+    
+  ClassDef(AliHBTCorrelFunction,1)
+};
+
 /******************************************************************/
 /******************************************************************/
 /******************************************************************/
index 261369e2bb114a1248685fa0a6688926476f01ff..c9ea7616e3b3189f3ec03a853f9781322237f605 100644 (file)
@@ -37,14 +37,15 @@ AliHBTTwoTrackEffFctn::AliHBTTwoTrackEffFctn(Int_t nbins, Double_t maxval, Doubl
 TH1* AliHBTTwoTrackEffFctn::GetResult()
 {
 //returns ratio of numerator and denominator
- TH1* res = GetRatio(Scale());
- if(res)
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ if(fRatio)
   {
-   res->GetXaxis()->SetTitle("dP [GeV]");
-   res->GetYaxis()->SetTitle("C(dP)");
-   res->SetTitle("Double Track Resolution: dP Correlation Fctn.");
+   fRatio->GetXaxis()->SetTitle("dP [GeV]");
+   fRatio->GetYaxis()->SetTitle("C(dP)");
+   fRatio->SetTitle("Double Track Resolution: dP Correlation Fctn.");
   }
- return res;
+ return fRatio;
 }
 /******************************************************************/
 /******************************************************************/
index 8d8a256ff7f096ceefd361d658a14482400d710b..94688aa2da1a5e3541e8d126a059852f1605192c 100644 (file)
@@ -15,7 +15,7 @@
 #include "AliHBTPair.h"
 #include "AliHBTFunction.h"
 
-class AliHBTTwoTrackEffFctn: public AliHBTOnePairFctn1D
+class AliHBTTwoTrackEffFctn: public AliHBTOnePairFctn1D, public AliHBTCorrelFunction
  {
   public:
     AliHBTTwoTrackEffFctn();
@@ -25,10 +25,10 @@ class AliHBTTwoTrackEffFctn: public AliHBTOnePairFctn1D
   protected:
     Double_t GetValue(AliHBTPair* pair){return pair->GetDeltaP();}
   private:
-    ClassDef(AliHBTTwoTrackEffFctn,1)
+    ClassDef(AliHBTTwoTrackEffFctn,2)
  };
 
-class AliHBTTwoTrackEffFctn3D: public AliHBTOnePairFctn3D
+class AliHBTTwoTrackEffFctn3D: public AliHBTOnePairFctn3D, public AliHBTCorrelFunction
  {
   public:
     AliHBTTwoTrackEffFctn3D();
@@ -38,8 +38,8 @@ class AliHBTTwoTrackEffFctn3D: public AliHBTOnePairFctn3D
     void ProcessDiffEventParticles(AliHBTPair* /*pair*/){}
 
   protected:
-    void GetValues(AliHBTPair* pair,Double_t& x, Double_t& y,Double_t& z);
+    void GetValues(AliHBTPair*,Double_t&, Double_t&,Double_t&);
   private:
-    ClassDef(AliHBTTwoTrackEffFctn3D,1)
+    ClassDef(AliHBTTwoTrackEffFctn3D,2)
  };
 #endif
index 606918cb5b520e1fb833455e034c88df4f57c26b..5c37dc3885f5799d517511aaf0d99071cffc55fe 100644 (file)
@@ -63,7 +63,10 @@ void  AliHBTWeightQInvFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, Ali
 TH1* AliHBTWeightQInvFctn::GetResult()
 { 
 //returns ratio of numerator and denominator                                    
- return GetRatio(Scale());                                                  
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
                                                               
 /**************************************************************************************/
@@ -116,8 +119,10 @@ void AliHBTWeightQOutFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, AliH
 
 TH1* AliHBTWeightQOutFctn::GetResult() 
 { 
-//returns ratio of numerator and denominator                                    
- return GetRatio(Scale());                                                  
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
                                                               
 /*************************************************************************************/ 
@@ -167,8 +172,10 @@ void AliHBTWeightQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, Ali
 /**************************************************************/
 TH1* AliHBTWeightQLongFctn::GetResult()
 { 
-//returns ratio of numerator and denominator                                    
- return GetRatio(Scale());                                                  
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
                                                               
 /*************************************************************************************/ 
@@ -221,8 +228,10 @@ void  AliHBTWeightQSideFctn::ProcessDiffEventParticles(AliHBTPair* trackpair, Al
 
 TH1* AliHBTWeightQSideFctn::GetResult() 
 { 
-//returns ratio of numerator and denominator                                    
- return GetRatio(Scale());                                                  
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
                                                               
 /*************************************************************************************/ 
@@ -274,8 +283,10 @@ void  AliHBTWeightTwoKStarFctn::ProcessDiffEventParticles(AliHBTPair* trackpair,
 TH1* AliHBTWeightTwoKStarFctn::GetResult() 
                                                                                
 { 
-//returns ratio of numerator and denominator                                    
- return GetRatio(Scale());                                                  
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
                                                               
 /*************************************************************************************/ 
@@ -329,8 +340,10 @@ void AliHBTWeightQOutQSideFctn::ProcessDiffEventParticles(AliHBTPair* trackpair,
 
 TH1* AliHBTWeightQOutQSideFctn::GetResult()
 {
-  //returns result
-  return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }
 
 /*************************************************************************************/ 
@@ -384,8 +397,10 @@ void AliHBTWeightQOutQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair,
 
 TH1* AliHBTWeightQOutQLongFctn::GetResult()
 {
-  //returns result
-  return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }
 
 /*************************************************************************************/ 
@@ -439,6 +454,8 @@ void AliHBTWeightQSideQLongFctn::ProcessDiffEventParticles(AliHBTPair* trackpair
 
 TH1* AliHBTWeightQSideQLongFctn::GetResult()
 {
-  //returns result
-  return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }
index 23daf3c617facd41884bb993c56349320acac9b0..38f493479c97f8b4d8e73c3c36d289530930b327 100644 (file)
@@ -25,7 +25,7 @@
 
 class AliHBTWeights;
 
-class AliHBTWeightQInvFctn: public AliHBTTwoPairFctn1D
+class AliHBTWeightQInvFctn: public AliHBTTwoPairFctn1D, public AliHBTCorrelFunction
 {
  public:
   AliHBTWeightQInvFctn(Int_t nbins = 100, Double_t maxXval = 0.15, Double_t minXval = 0.0);
@@ -38,11 +38,11 @@ class AliHBTWeightQInvFctn: public AliHBTTwoPairFctn1D
  protected:
   Double_t GetValue(AliHBTPair* trackpair, AliHBTPair* partpair)
     { return trackpair->GetQInv()-partpair->GetQInv();} //isn't use                                                                    
-  ClassDef(AliHBTWeightQInvFctn,1)
+  ClassDef(AliHBTWeightQInvFctn,2)
 };
 /*************************************************************************************/ 
 
-class AliHBTWeightQOutFctn: public AliHBTTwoPairFctn1D
+class AliHBTWeightQOutFctn: public AliHBTTwoPairFctn1D, public AliHBTCorrelFunction
 {
 
   //  friend class AliHBTOnePairFctn1D;
@@ -56,12 +56,12 @@ class AliHBTWeightQOutFctn: public AliHBTTwoPairFctn1D
  protected:
   Double_t GetValue(AliHBTPair* trackpair, AliHBTPair* partpair)         
     { return trackpair->GetQOutCMSLC()-partpair->GetQOutCMSLC();} //isn't use                                                                    
-  ClassDef(AliHBTWeightQOutFctn,1)
+  ClassDef(AliHBTWeightQOutFctn,2)
  
 };
 /*************************************************************************************/ 
   
-class AliHBTWeightQLongFctn: public AliHBTTwoPairFctn1D
+class AliHBTWeightQLongFctn: public AliHBTTwoPairFctn1D, public AliHBTCorrelFunction
 {
   //  friend class AliHBTOnePairFctn1D;
  public:
@@ -75,12 +75,12 @@ class AliHBTWeightQLongFctn: public AliHBTTwoPairFctn1D
   Double_t GetValue(AliHBTPair* trackpair, AliHBTPair* partpair)
     { return trackpair->GetQLongCMSLC()-partpair->GetQLongCMSLC();} //isn't used
 
-  ClassDef(AliHBTWeightQLongFctn,1)
+  ClassDef(AliHBTWeightQLongFctn,2)
  
 };
 /*************************************************************************************/ 
   
-class AliHBTWeightQSideFctn: public AliHBTTwoPairFctn1D
+class AliHBTWeightQSideFctn: public AliHBTTwoPairFctn1D, public AliHBTCorrelFunction
 {
   // friend class AliHBTOnePairFctn1D;
  public:
@@ -94,11 +94,11 @@ class AliHBTWeightQSideFctn: public AliHBTTwoPairFctn1D
   Double_t GetValue(AliHBTPair* trackpair, AliHBTPair* partpair)         
     { return trackpair->GetQLongCMSLC()-partpair->GetQLongCMSLC();} //isn't used
 
-  ClassDef(AliHBTWeightQSideFctn,1
+  ClassDef(AliHBTWeightQSideFctn,2
 };
 /*************************************************************************************/ 
   
-class AliHBTWeightTwoKStarFctn: public AliHBTTwoPairFctn1D
+class AliHBTWeightTwoKStarFctn: public AliHBTTwoPairFctn1D, public AliHBTCorrelFunction
 {
   // friend class AliHBTOnePairFctn1D;
  public:
@@ -111,12 +111,12 @@ class AliHBTWeightTwoKStarFctn: public AliHBTTwoPairFctn1D
  protected:
   Double_t GetValue(AliHBTPair* trackpair, AliHBTPair* partpair)         
     { return trackpair->GetKStar()-partpair->GetKStar();} //isn't used
-  ClassDef(AliHBTWeightTwoKStarFctn,1
+  ClassDef(AliHBTWeightTwoKStarFctn,2
 
 };
 /*************************************************************************************/ 
 
-class AliHBTWeightQOutQSideFctn: public AliHBTTwoPairFctn2D
+class AliHBTWeightQOutQSideFctn: public AliHBTTwoPairFctn2D, public AliHBTCorrelFunction
 {
 
   //  friend class AliHBTOnePairFctn1D;
@@ -130,12 +130,12 @@ class AliHBTWeightQOutQSideFctn: public AliHBTTwoPairFctn2D
       
  protected:
   void GetValues(AliHBTPair* /*trackpair*/, AliHBTPair* /*partpair*/, Double_t& /*x*/, Double_t& /*y*/){}
-  ClassDef(AliHBTWeightQOutQSideFctn,1)
+  ClassDef(AliHBTWeightQOutQSideFctn,2)
  
 };
 /*************************************************************************************/ 
 
-class AliHBTWeightQOutQLongFctn: public AliHBTTwoPairFctn2D
+class AliHBTWeightQOutQLongFctn: public AliHBTTwoPairFctn2D, public AliHBTCorrelFunction
 {
 
   //  friend class AliHBTOnePairFctn1D;
@@ -149,13 +149,13 @@ class AliHBTWeightQOutQLongFctn: public AliHBTTwoPairFctn2D
       
  protected:
   void GetValues(AliHBTPair* /*trackpair*/, AliHBTPair* /*partpair*/, Double_t& /*x*/, Double_t& /*y*/){}
-  ClassDef(AliHBTWeightQOutQLongFctn,1)
+  ClassDef(AliHBTWeightQOutQLongFctn,2)
  
 };
 
 /*************************************************************************************/ 
 
-class AliHBTWeightQSideQLongFctn: public AliHBTTwoPairFctn2D
+class AliHBTWeightQSideQLongFctn: public AliHBTTwoPairFctn2D, public AliHBTCorrelFunction
 {
 
   //  friend class AliHBTOnePairFctn1D;
@@ -169,7 +169,7 @@ class AliHBTWeightQSideQLongFctn: public AliHBTTwoPairFctn2D
       
  protected:
   void GetValues(AliHBTPair* /*trackpair*/, AliHBTPair* /*partpair*/, Double_t& /*x*/, Double_t& /*y*/){}
-  ClassDef(AliHBTWeightQSideQLongFctn,1)
+  ClassDef(AliHBTWeightQSideQLongFctn,2)
  
 };
 
index 4e2f8ed1cfe9a6e7313b4af4427339a85e3ea4cd..611914b1115502f2713faf487fb6ffbd441c68dc 100644 (file)
@@ -36,7 +36,8 @@ AliHBTWeightTheorQInvFctn::AliHBTWeightTheorQInvFctn(Int_t nbins, Double_t maxXv
  fWriteNumAndDen = kTRUE;//change default behaviour
  Rename("wqinvtheorcf","Q_{inv} Weight Theoretical Correlation Function");
 }
-/****************************************************************/
+/**************************************************************/
+
 void  AliHBTWeightTheorQInvFctn::ProcessSameEventParticles(AliHBTPair* partpair)
 {
   //Processes Particles and tracks Same different event
@@ -45,12 +46,14 @@ void  AliHBTWeightTheorQInvFctn::ProcessSameEventParticles(AliHBTPair* partpair)
   Double_t weight = partpair->GetWeight();
   if(TMath::Abs(weight)<=10.) fNumerator->Fill(partpair->GetQInv(),weight);
 } 
-
 /**************************************************************/
+
 TH1* AliHBTWeightTheorQInvFctn::GetResult() 
 {
-  //returns ratio of numerator and denominator
-  return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
                                                               
 /*************************************************************/
@@ -68,6 +71,7 @@ AliHBTWeightTheorQOutFctn::AliHBTWeightTheorQOutFctn(Int_t nbins, Double_t maxXv
  Rename("wqouttheorcf","Q_{out} Weight Theoretical Correlation Function");
 }
 /****************************************************************/
+
 void  AliHBTWeightTheorQOutFctn::ProcessSameEventParticles(AliHBTPair* partpair)
 {
   //Processes Particles and tracks Same different even
@@ -80,8 +84,10 @@ void  AliHBTWeightTheorQOutFctn::ProcessSameEventParticles(AliHBTPair* partpair)
 /**************************************************************/
 TH1* AliHBTWeightTheorQOutFctn::GetResult() 
 {
-  //returns ratio of numerator and denominator
-  return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
 
 /*************************************************************/
@@ -99,6 +105,7 @@ AliHBTWeightTheorQSideFctn::AliHBTWeightTheorQSideFctn(Int_t nbins, Double_t max
  Rename("wqsidetheorcf","Q_{side} Weight Theoretical Correlation Function");
 }
 /****************************************************************/
+
 void  AliHBTWeightTheorQSideFctn::ProcessSameEventParticles(AliHBTPair* partpair)
 {
   //Processes Particles and tracks Same different even
@@ -107,12 +114,14 @@ void  AliHBTWeightTheorQSideFctn::ProcessSameEventParticles(AliHBTPair* partpair
   Double_t weight = partpair->GetWeight();
   if(TMath::Abs(weight)<=10.) fNumerator->Fill(partpair->GetQSideCMSLC(),weight);
 } 
-
 /**************************************************************/
+
 TH1* AliHBTWeightTheorQSideFctn::GetResult() 
 {
-  //returns ratio of numerator and denominator
-  return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
 
 /*************************************************************/
@@ -130,6 +139,7 @@ AliHBTWeightTheorQLongFctn::AliHBTWeightTheorQLongFctn(Int_t nbins, Double_t max
  Rename("wqlongtheorcf","Q_{long} Weight Theoretical Correlation Function");
 }
 /****************************************************************/
+
 void  AliHBTWeightTheorQLongFctn::ProcessSameEventParticles(AliHBTPair* partpair)
 {
   //Processes Particles and tracks Same different even
@@ -138,12 +148,14 @@ void  AliHBTWeightTheorQLongFctn::ProcessSameEventParticles(AliHBTPair* partpair
   Double_t weight = partpair->GetWeight();
   if(TMath::Abs(weight)<=10.) fNumerator->Fill(partpair->GetQLongCMSLC(),weight);
 } 
-
 /**************************************************************/
+
 TH1* AliHBTWeightTheorQLongFctn::GetResult() 
 {
-  //returns ratio of numerator and denominator
-  return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
 
 /*************************************************************/
@@ -177,6 +189,8 @@ void AliHBTWeightTheorOSLFctn::ProcessSameEventParticles(AliHBTPair* partpair)
 
 TH1* AliHBTWeightTheorOSLFctn::GetResult()
 {
-  //returns ratio of numerator and denominator
-  return GetRatio(Scale());
+ //returns the scaled ratio
+ delete fRatio;
+ fRatio = GetRatio(Scale());
+ return fRatio;
 }                    
index 645669c667e549c49eecd7026b4471d7dad5cae4..89b323692c88942f7f4697d40b80fbc818e1bb82 100644 (file)
@@ -21,7 +21,7 @@
 
 class AliHBTWeights;
 
-class AliHBTWeightTheorQInvFctn: public AliHBTOnePairFctn1D
+class AliHBTWeightTheorQInvFctn: public AliHBTOnePairFctn1D, public AliHBTCorrelFunction
 {
 
   public:
@@ -36,8 +36,9 @@ class AliHBTWeightTheorQInvFctn: public AliHBTOnePairFctn1D
 
   ClassDef(AliHBTWeightTheorQInvFctn,1)
 };
+/*************************************************************/
 
-class AliHBTWeightTheorQOutFctn: public AliHBTOnePairFctn1D
+class AliHBTWeightTheorQOutFctn: public AliHBTOnePairFctn1D, public AliHBTCorrelFunction
 {
 
   public:
@@ -52,8 +53,9 @@ class AliHBTWeightTheorQOutFctn: public AliHBTOnePairFctn1D
 
   ClassDef(AliHBTWeightTheorQOutFctn,1)
 };
+/*************************************************************/
 
-class AliHBTWeightTheorQSideFctn: public AliHBTOnePairFctn1D
+class AliHBTWeightTheorQSideFctn: public AliHBTOnePairFctn1D, public AliHBTCorrelFunction
 {
 
   public:
@@ -68,8 +70,9 @@ class AliHBTWeightTheorQSideFctn: public AliHBTOnePairFctn1D
 
   ClassDef(AliHBTWeightTheorQSideFctn,1)
 };
+/*************************************************************/
 
-class AliHBTWeightTheorQLongFctn: public AliHBTOnePairFctn1D
+class AliHBTWeightTheorQLongFctn: public AliHBTOnePairFctn1D, public AliHBTCorrelFunction
 {
 
   public:
@@ -84,8 +87,9 @@ class AliHBTWeightTheorQLongFctn: public AliHBTOnePairFctn1D
 
   ClassDef(AliHBTWeightTheorQLongFctn,1)
 };
+/*************************************************************/
 
-class AliHBTWeightTheorOSLFctn: public AliHBTOnePairFctn3D
+class AliHBTWeightTheorOSLFctn: public AliHBTOnePairFctn3D, public AliHBTCorrelFunction
 {
 
   public:
index e067e9b3c695427084c3600c855670baec46b527..ae082a51c25d2a53d7d6d689b16559bfc9b63243 100644 (file)
@@ -13,6 +13,8 @@
 #pragma link C++ class AliHBTFunction+;
 #pragma link C++ class AliHBTMonitorFunction+;
 
+#pragma link C++ class AliHBTCorrelFunction+;
+
 #pragma link C++ class AliHBTFunction1D+;
 #pragma link C++ class AliHBTFunction2D+;
 #pragma link C++ class AliHBTFunction3D+;