]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCseed.cxx
skim task first usable version
[u/mrichter/AliRoot.git] / TPC / AliTPCseed.cxx
index 4c5a5948edbd01b2238410ede47ba44c405f51a0..e4923ee49b6c229b391faaa6d96cf78ca229891e 100644 (file)
@@ -69,7 +69,8 @@ AliTPCseed::AliTPCseed():
   fSeed1(-1),
   fSeed2(-1),
   fMAngular(0),
-  fCircular(0)
+  fCircular(0),
+  fPoolID(-1)
 {
   //
   for (Int_t i=0;i<160;i++) SetClusterIndex2(i,-3);
@@ -80,7 +81,9 @@ AliTPCseed::AliTPCseed():
     fDEDX[i] = 0.;
     fSDEDX[i] = 1e10;
     fNCDEDX[i] = 0;
+    fNCDEDXInclThres[i] = 0;
   }
+  fDEDX[4] = 0;
   for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
 }
 
@@ -110,7 +113,8 @@ AliTPCseed::AliTPCseed(const AliTPCseed &s, Bool_t clusterOwner):
   fSeed1(-1),
   fSeed2(-1),
   fMAngular(0),
-  fCircular(0)
+  fCircular(0),
+  fPoolID(-1)
 {
   //---------------------
   // dummy copy constructor
@@ -131,7 +135,9 @@ AliTPCseed::AliTPCseed(const AliTPCseed &s, Bool_t clusterOwner):
     fDEDX[i] = s.fDEDX[i];
     fSDEDX[i] = s.fSDEDX[i];
     fNCDEDX[i] = s.fNCDEDX[i];
+    fNCDEDXInclThres[i] = s.fNCDEDXInclThres[i];
   }
+  fDEDX[4] = s.fDEDX[4];
   for (Int_t i=0;i<12;i++) fOverlapLabels[i] = s.fOverlapLabels[i];
 
 }
@@ -163,7 +169,8 @@ AliTPCseed::AliTPCseed(const AliTPCtrack &t):
   fSeed1(-1),
   fSeed2(-1),
   fMAngular(0),
-  fCircular(0)
+  fCircular(0),
+  fPoolID(-1)
 {
   //
   // Constructor from AliTPCtrack
@@ -184,7 +191,9 @@ AliTPCseed::AliTPCseed(const AliTPCtrack &t):
     fDEDX[i] = 0.;
     fSDEDX[i] = 1e10;
     fNCDEDX[i] = 0;
+    fNCDEDXInclThres[i] = 0;
   }
+    fDEDX[4] = 0;
   for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
 }
 
@@ -215,7 +224,8 @@ AliTPCseed::AliTPCseed(Double_t xr, Double_t alpha, const Double_t xx[5],
   fSeed1(-1),
   fSeed2(-1),
   fMAngular(0),
-  fCircular(0)
+  fCircular(0),
+  fPoolID(-1)
 {
   //
   // Constructor
@@ -228,7 +238,9 @@ AliTPCseed::AliTPCseed(Double_t xr, Double_t alpha, const Double_t xx[5],
     fDEDX[i] = 0.;
     fSDEDX[i] = 1e10;
     fNCDEDX[i] = 0;
+    fNCDEDXInclThres[i] = 0;
   }
+    fDEDX[4] = 0;
   for (Int_t i=0;i<12;i++) fOverlapLabels[i] = -1;
 }
 
@@ -248,12 +260,17 @@ AliTPCseed & AliTPCseed::operator=(const AliTPCseed &param)
 {
   //
   // assignment operator 
+  // don't touch pool ID
   //
   if(this!=&param){
     AliTPCtrack::operator=(param);
     fEsd =param.fEsd; 
-    for(Int_t i = 0;i<160;++i)fClusterPointer[i] = param.fClusterPointer[i]; // this is not allocated by AliTPCSeed
     fClusterOwner = param.fClusterOwner;
+    if (!fClusterOwner) for(Int_t i = 0;i<160;++i)fClusterPointer[i] = param.fClusterPointer[i];
+    else                for(Int_t i = 0;i<160;++i) {
+       delete fClusterPointer[i];
+       fClusterPointer[i] = new AliTPCclusterMI(*(param.fClusterPointer[i]));
+      }
     // leave out fPoint, they are also not copied in the copy ctor...
     // but deleted in the dtor... strange...
     fRow            = param.fRow;
@@ -274,7 +291,9 @@ AliTPCseed & AliTPCseed::operator=(const AliTPCseed &param)
       fDEDX[i]   = param.fDEDX[i];
       fSDEDX[i]  = param.fSDEDX[i];
       fNCDEDX[i] = param.fNCDEDX[i];
+      fNCDEDXInclThres[i] = param.fNCDEDXInclThres[i];
     }
+      fDEDX[4]   = param.fDEDX[4];
     for(Int_t i = 0;i<AliPID::kSPECIES;++i)fTPCr[i] = param.fTPCr[i];
     
     fSeedType = param.fSeedType;
@@ -380,8 +399,9 @@ void AliTPCseed::Reset(Bool_t all)
   */
 
   if (all){   
-    for (Int_t i=0;i<200;i++) SetClusterIndex2(i,-3);
-    for (Int_t i=0;i<160;i++) fClusterPointer[i]=0;
+    for (Int_t i=200;i--;) SetClusterIndex2(i,-3);
+    if (!fClusterOwner) for (Int_t i=160;i--;) fClusterPointer[i]=0;
+    else                for (Int_t i=160;i--;) {delete fClusterPointer[i]; fClusterPointer[i]=0;}
   }
 
 }
@@ -1681,3 +1701,11 @@ Float_t AliTPCseed::GetTPCClustInfo(Int_t nNeighbours, Int_t type, Int_t row0, I
     return ncl+nclBelowThr;
   return 0;
 }
+
+//_______________________________________________________________________
+void AliTPCseed::Clear(Option_t*)
+{
+  // formally seed may allocate memory for clusters (althought this should not happen for 
+  // the seeds in the pool). Hence we need this method for fwd. compatibility
+  if (fClusterOwner) for (int i=160;i--;) {delete fClusterPointer[i]; fClusterPointer[i] = 0;}
+}