correct the implementation of deleting tracker containers
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Jun 2009 13:33:34 +0000 (13:33 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Jun 2009 13:33:34 +0000 (13:33 +0000)
TRD/AliTRDtrackerV1.cxx
TRD/AliTRDtrackerV1.h

index 4054e00..8666a46 100644 (file)
@@ -1794,7 +1794,7 @@ Int_t AliTRDtrackerV1::BuildTrackingContainers()
 
 
 //____________________________________________________________________
-void AliTRDtrackerV1::UnloadClusters(Bool_t force) 
+void AliTRDtrackerV1::UnloadClusters() 
 { 
 //
 // Clears the arrays of clusters and tracks. Resets sectors and timebins 
@@ -1803,11 +1803,11 @@ void AliTRDtrackerV1::UnloadClusters(Bool_t force)
 
   if(fTracks){ 
     fTracks->Delete(); 
-    if(force){delete fTracks; fTracks = 0x0;}
+    if(HasRemoveContainers()){delete fTracks; fTracks = 0x0;}
   }
   if(fTracklets){ 
     fTracklets->Delete();
-    if(force){delete fTracklets; fTracklets = 0x0;}
+    if(HasRemoveContainers()){delete fTracklets; fTracklets = 0x0;}
   }
   if(fClusters){ 
     if(IsClustersOwner()) fClusters->Delete();
index f151e44..d8a9069 100644 (file)
@@ -50,7 +50,8 @@ class AliTRDtrackerV1 : public AliTracker
 {
 public:
   enum{
-    kOwner = BIT(14)
+    kOwner            = BIT(14) // owner of clusters
+   ,kRemoveContainers = BIT(15) // delete containers after usage
   };
   enum{
     kMaxLayersPerSector   = 1000
@@ -91,7 +92,9 @@ public:
   static Double_t FitKalman(AliTRDtrackV1 *trk, AliTRDseedV1 *tracklets = 0x0, Bool_t up=0, Int_t np = 0, AliTrackPoint *points = 0x0);
 
   Bool_t          IsClustersOwner() const    { return TestBit(kOwner);}
+  Bool_t          HasRemoveContainers() const    { return TestBit(kRemoveContainers);}
   void            SetClustersOwner(Bool_t own=kTRUE) {SetBit(kOwner, own); if(!own) fClusters = 0x0;}
+  void            SetRemoveContainers(Bool_t rm=kTRUE) {SetBit(kRemoveContainers, rm);}
 
   Int_t           FollowBackProlongation(AliTRDtrackV1 &t);
   Int_t           FollowProlongation(AliTRDtrackV1 &t);
@@ -103,7 +106,7 @@ public:
   Int_t           RefitInward(AliESDEvent *event);
   static void     SetNTimeBins(Int_t nTimeBins){fgNTimeBins = nTimeBins; }
   void            SetReconstructor(const AliTRDReconstructor *rec){ fReconstructor = rec; }
-  void            UnloadClusters(Bool_t force=kFALSE);
+  void            UnloadClusters();
 
   class AliTRDLeastSquare{
   public: