]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCROC.cxx
-fiorellas update
[u/mrichter/AliRoot.git] / TPC / AliTPCROC.cxx
index e72058edd77e564a21a3dddd6cd5311e568d1d83..40fb279f42e200ad8ec18ee3d85bf9834e47d9f0 100644 (file)
@@ -293,6 +293,15 @@ AliTPCROC::AliTPCROC()
     fNPads[i]     = 0;
     fRowPosIndex[i]= 0;
   }
+  
+  for (UInt_t i=0;i<100;++i){
+    fPadRowLow[i]=0.;
+    fPadRowUp[i]=0.;
+    fNPadsLow[i]=0;
+    fNPadsUp[i]=0;
+    fYInner[i]=0.;
+    fYOuter[i]=0.;
+  }
 }
 
 
@@ -370,6 +379,16 @@ AliTPCROC::AliTPCROC(const AliTPCROC &roc)
     fNPads[1][irow]       = roc.fNPads[1][irow];
     fRowPosIndex[1][irow] = roc.fRowPosIndex[1][irow];
   }
+  
+  for (UInt_t i=0;i<100;++i){
+    fPadRowLow[i]=roc.fPadRowLow[i];
+    fPadRowUp[i]=roc.fPadRowUp[i];
+    fNPadsLow[i]=roc.fNPadsLow[i];
+    fNPadsUp[i]=roc.fNPadsUp[i];
+    fYInner[i]=roc.fYInner[i];
+    fYOuter[i]=roc.fYOuter[i];
+  }
+
 }
 //____________________________________________________________________________
 AliTPCROC & AliTPCROC::operator =(const AliTPCROC & roc)
@@ -377,6 +396,8 @@ AliTPCROC & AliTPCROC::operator =(const AliTPCROC & roc)
   //
   // assignment operator - dummy
   //
+  if (this == &roc) return (*this);
+
   fZLength = roc.fZLength;
   return (*this);
 }
@@ -404,10 +425,10 @@ void AliTPCROC::GetPositionLocal(UInt_t sector, UInt_t row, UInt_t pad, Float_t
   pos[2]=fZLength;
   if (sector<36){
    pos[0] = fPadRowLow[row];
-   pos[1] = fInnerPadPitchWidth*(Int_t(pad)-Int_t(fNPads[0][row])/2);
+   pos[1] = fInnerPadPitchWidth*(Int_t(pad)+0.5-Int_t(fNPads[0][row])/2);
   }else{
     pos[0] = fPadRowUp[row];
-    pos[1] = fOuterPadPitchWidth*(Int_t(pad)-Int_t(fNPads[1][row])/2);    
+    pos[1] = fOuterPadPitchWidth*(Int_t(pad)+0.5-Int_t(fNPads[1][row])/2);    
   }
   if ((sector%36)>=18){
     pos[2] *= -1.;