]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RALICE/AliInvmass.cxx
Prepare for new code
[u/mrichter/AliRoot.git] / RALICE / AliInvmass.cxx
index a68812965baf925841681d3b8535070ec2a05e78..80149b2acb8a348b53d8865a78f1726caf15ab07 100644 (file)
 ////////////////////////////////////////////////////////////////////////////////
 
 #include "AliInvmass.h"
+#include "Riostream.h"
  
 ClassImp(AliInvmass) // Class implementation to enable ROOT I/O
  
@@ -123,14 +124,12 @@ AliInvmass::~AliInvmass()
 // Destructor to delete dynamically allocated memory
  if (fMinv)
  {
-  fMinv->Delete();
   delete fMinv;
   fMinv=0;
  }
 
  if (fMbkg)
  {
-  fMbkg->Delete();
   delete fMbkg;
   fMbkg=0;
  }
@@ -159,19 +158,19 @@ void AliInvmass::SetPhiSwitch(Int_t i)
  if (i==0) fNewphi=0;
 }
 ////////////////////////////////////////////////////////////////////////////////
-Int_t AliInvmass::GetStorageMode()
+Int_t AliInvmass::GetStorageMode() const
 {
 // Provide mode of storage for the result arrays for inv. mass and comb. background
  return fMode;
 }
 ////////////////////////////////////////////////////////////////////////////////
-Int_t AliInvmass::GetThetaSwitch()
+Int_t AliInvmass::GetThetaSwitch() const
 {
 // Provide the theta switching flag
  return fNewtheta;
 }
 ////////////////////////////////////////////////////////////////////////////////
-Int_t AliInvmass::GetPhiSwitch()
+Int_t AliInvmass::GetPhiSwitch() const
 {
 // Provide the phi switching flag
  return fNewphi;
@@ -206,14 +205,12 @@ void AliInvmass::Combine(TObjArray* a1,TObjArray* a2)
  
  if ((!fBkg || fMode==1) && fMinv)
  {
-  fMinv->Delete();
   delete fMinv;
   fMinv=0;
  }
  
  if (fBkg && (fMode !=1) && fMbkg)
  {
-  fMbkg->Delete();
   delete fMbkg;
   fMbkg=0;
  }
@@ -298,12 +295,20 @@ void AliInvmass::Combine(TObjArray* a1,TObjArray* a2)
     t->SetCharge(q1+q2);
     if (!fBkg || fMode==1) 
     {
-     if (!fMinv) fMinv=new TObjArray();
+     if (!fMinv)
+     {
+      fMinv=new TObjArray();
+      fMinv->SetOwner();
+     }
      fMinv->Add(t);
     }
     else
     {
-     if (!fMbkg) fMbkg=new TObjArray();
+     if (!fMbkg)
+     {
+      fMbkg=new TObjArray();
+      fMbkg->SetOwner();
+     }
      fMbkg->Add(t);
     }
    }