]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCtrackerSector.cxx
During simulation: fill STU region w/ non null time sums
[u/mrichter/AliRoot.git] / TPC / AliTPCtrackerSector.cxx
index 49db7df40a35b9fe6293039c7458f6daf1c628ba..101085178740342259b1056d2e5a3b74bb2beb7d 100644 (file)
@@ -54,8 +54,11 @@ AliTPCtrackerRow::AliTPCtrackerRow():
   fN1(0),
   fClusters2(0),
   fN2(0),
+  fFastCluster(),
   fN(0),
-  fX(0.)
+  fClusters(),
+  fIndex(),
+  fX(0.)  
 {
   //
   // default constructor
@@ -90,8 +93,10 @@ AliTPCtrackerRow::InsertCluster(const AliTPCclusterMI* c, UInt_t index) {
 
   if (fN==0) {fIndex[0]=index; fClusters[fN++]=c; return;}
   Int_t i=Find(c->GetZ());
-  memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTPCclusterMI*));
-  memmove(fIndex   +i+1 ,fIndex   +i,(fN-i)*sizeof(UInt_t));
+  if (i>=0 && i<=kMaxClusterPerRow-2) {
+    memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTPCclusterMI*));
+    memmove(fIndex   +i+1 ,fIndex   +i,(fN-i)*sizeof(UInt_t));
+  }
   fIndex[i]=index; fClusters[i]=c; fN++;
 }
 
@@ -194,7 +199,7 @@ void AliTPCtrackerRow::SetFastCluster(Int_t i, Short_t cl){
   //
   // Set cluster info for fast navigation
   //
-  if (i>510|| i<0){
+  if (i>=510|| i<0){
   }else{
     fFastCluster[i]=cl;
   }
@@ -284,20 +289,26 @@ void AliTPCtrackerSector::InsertCluster(AliTPCclusterMI *cl, Int_t size, const A
   //
   if (left ==0){
     tpcrow = fRow+row;
-    if(!tpcrow->GetClusters1()) tpcrow->SetClusters1(new AliTPCclusterMI[size]); 
+    if(!tpcrow->GetClusters1()) {
+       tpcrow->SetClusters1(new AliTPCclusterMI[size]); 
+       tpcrow->SetN1(0);
+    }
     if(size < kMaxClusterPerRow) {
       tpcrow->SetCluster1(tpcrow->GetN1(), *cl);
-      //printf("inner: size %d, tpcrow->GetN1() %d  sec %d row %d tpcrow %p \n", size, tpcrow->GetN1(), sec, row, tpcrow);
+      //printf("inner: size %d, tpcrow->GetN1() %d  sec %d row %d tpcrow %p cl %p\n", size, tpcrow->GetN1(), sec, row, tpcrow, cl);
 
       tpcrow->IncrementN1();
     }
   }
   if (left ==1){
     tpcrow = fRow+row;
-    if(!tpcrow->GetClusters2()) tpcrow->SetClusters2(new AliTPCclusterMI[size]); 
+    if(!tpcrow->GetClusters2()) { 
+      tpcrow->SetClusters2(new AliTPCclusterMI[size]); 
+      tpcrow->SetN2(0);
+    }
     if(size < kMaxClusterPerRow)  { 
       tpcrow->SetCluster2(tpcrow->GetN2(), *cl);
-      //printf("outer: size %d, tpcrow->GetN2() %d  sec %d row %d tpcrow %p \n", size, tpcrow->GetN2(), sec, row, tpcrow);
+      //printf("outer: size %d, tpcrow->GetN2() %d  sec %d row %d tpcrow %p cl %p\n", size, tpcrow->GetN2(), sec, row, tpcrow, cl);
 
       tpcrow->IncrementN2();
     }