]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCtrackerSector.cxx
adding getter for the streamer info list, do not add streamer infos which are already...
[u/mrichter/AliRoot.git] / TPC / AliTPCtrackerSector.cxx
index 7dcd4fcffe68070ee305b5efde125561c7cfe075..551a9d54570d3183d81349839ea9511b944c134e 100644 (file)
@@ -258,8 +258,57 @@ void AliTPCtrackerSector::Setup(const AliTPCParam *par, Int_t f) {
   } 
 }
 
+//_________________________________________________________________________
+void AliTPCtrackerSector::InsertCluster(AliTPCclusterMI *cl, Int_t size, const AliTPCParam *par) {
+  //-----------------------------------------------------------------------
+  // Insert cluster to the sector
+  //-----------------------------------------------------------------------
 
+  if(!cl) return; 
 
+  const Int_t fkNIS = par->GetNInnerSector()/2;
+  const Int_t fkNOS = par->GetNOuterSector()/2;
+  Int_t row = cl->GetRow();
+  Int_t sec = cl->GetDetector();
+
+  // add cluster to the corresponding pad row
+  AliTPCtrackerRow *tpcrow = 0x0;
+
+  Int_t left=0;
+  if (sec<fkNIS*2){
+    left = sec/fkNIS;
+  }
+  else{
+    left = (sec-fkNIS*2)/fkNOS;
+  }
+  //
+  if (left ==0){
+    tpcrow = fRow+row;
+    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 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]); 
+      tpcrow->SetN2(0);
+    }
+    if(size < kMaxClusterPerRow)  { 
+      tpcrow->SetCluster2(tpcrow->GetN2(), *cl);
+      //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();
+    }
+  }
+}