]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
SetOwner method implemented
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Sep 2002 15:26:55 +0000 (15:26 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Sep 2002 15:26:55 +0000 (15:26 +0000)
HBTAN/AliHBTEvent.cxx
HBTAN/AliHBTEvent.h

index 215b24fab69349d54a11d3e19dc6a2ebb9ebec78..003a062980c1358f42858285a09f059917d67f8f 100644 (file)
@@ -21,6 +21,7 @@ AliHBTEvent::AliHBTEvent()
     fSize=fgkInitEventSize;
     fParticles = new AliHBTParticle* [fSize];
     fNParticles = 0;
+    fOwner = kTRUE;
  }
 /**************************************************************************/ 
 
@@ -37,7 +38,7 @@ AliHBTEvent::~AliHBTEvent()
 void  AliHBTEvent::Reset()
 {
   //deletes all particles from the event
-  if(fParticles)
+  if(fParticles && fOwner)
     {
       for(Int_t i =0; i<fNParticles; i++)
         delete fParticles[i];
index d83e58827b0c319ec97f4690b3110cb7ecda9d05..12948603332a662229b04bf75419f29de602fbfd 100644 (file)
@@ -23,13 +23,15 @@ class AliHBTEvent: public TObject
                         Double_t vx, Double_t vy, Double_t vz, Double_t time);
     
     Int_t   GetNumberOfParticles() const;
-    void   Reset(); //deletes all entries
+    void    Reset(); //deletes all entries
+    void    SetOwner(Bool_t owns = kTRUE){ fOwner = owns; }
+    Bool_t  IsOwner() {return fOwner;}
   protected:
     AliHBTParticle ** fParticles; //!array of pointers to the particles
-    Int_t fNParticles; //!number of particles in Event
-    Int_t fSize;       //!current size of the array
-    
-    void  Expand();    //expands the array if necessary
+    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:
     
   public: