X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=RALICE%2FAliInvmass.cxx;h=80149b2acb8a348b53d8865a78f1726caf15ab07;hb=528ce3fbdc16bd6ecfa075bed0f8616d2d48e638;hp=a54c867e316d2f97fc335fe0d2bd5303521ac8ec;hpb=959fbac55c99883f629c3c4797ac5b89fd3ab079;p=u%2Fmrichter%2FAliRoot.git diff --git a/RALICE/AliInvmass.cxx b/RALICE/AliInvmass.cxx index a54c867e316..80149b2acb8 100644 --- a/RALICE/AliInvmass.cxx +++ b/RALICE/AliInvmass.cxx @@ -13,12 +13,7 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.2 1999/09/29 09:24:28 fca -Introduction of the Copyright and cvs Log - -*/ +// $Id$ //////////////////////////////////////////////////////////////////////////////// // Class AliInvmass @@ -104,9 +99,11 @@ Introduction of the Copyright and cvs Log // // //--- Author: Nick van Eijndhoven 12-apr-1999 UU-SAP Utrecht +//- Modified: NvE $Date$ UU-SAP Utrecht //////////////////////////////////////////////////////////////////////////////// #include "AliInvmass.h" +#include "Riostream.h" ClassImp(AliInvmass) // Class implementation to enable ROOT I/O @@ -127,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; } @@ -163,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; @@ -210,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; } @@ -302,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); } }