]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCParam.h
15 minutes interval for calculation of drift correction
[u/mrichter/AliRoot.git] / TPC / AliTPCParam.h
index ad851ea7b9f5347dd60ff7cb149c76cc112e5b6e..50509ddd4f40ce12afcd51de876b5e537a7983bd 100644 (file)
@@ -24,7 +24,7 @@ class AliTPCParam : public AliDetectorParam {
 public:
   AliTPCParam(); 
   virtual ~AliTPCParam();
-  
+  TGeoHMatrix *  Tracking2LocalMatrix(const TGeoHMatrix * geoMatrix, Int_t sector) const;  
   virtual Bool_t  Transform(Float_t *xyz, Int_t *index, Int_t* oindex);
   //transformation from input coodination system to output coordination system  
   Int_t  Transform0to1(Float_t *xyz, Int_t *index) const;
@@ -219,7 +219,7 @@ public:
   Int_t    GetNInnerSector() const {return fNInnerSector;}
   Int_t    GetNOuterSector() const {return fNOuterSector;}
   Int_t    GetNSector() const {return fNSector;}
-  Float_t  GetZLength(Int_t sector) const {return (sector<35) ? fZLength-0.275 : fZLength-0.302;}
+  Float_t  GetZLength(Int_t sector=0) const;
   Int_t    GetGeometryType() const {return fGeometryType;}
 
   //
@@ -521,7 +521,8 @@ inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const
   //rotate to given sector
   Double_t xyzmaster[3] = {xyz[0],xyz[1],xyz[2]};
   Double_t xyzlocal[3];  
-  fGlobalMatrix[index[1]]->MasterToLocal(xyzmaster,xyzlocal);
+  if (index[1]>=0 && index[1]<fNSector) 
+    fGlobalMatrix[index[1]]->MasterToLocal(xyzmaster,xyzlocal);
   xyz[0] = xyzlocal[0];
   xyz[1] = xyzlocal[1];
   xyz[2] = xyzlocal[2];
@@ -544,9 +545,9 @@ inline void AliTPCParam::Transform2to1(Float_t *xyz, Int_t *index) const
   xyz[1]=y1;
   xyz[2]=fZLength-xyz[2]; 
   if (index[1]<fNInnerSector)
-    if ( index[1]>=(fNInnerSector>>1)) xyz[2]*=-1.;
+    {if ( index[1]>=(fNInnerSector>>1))        xyz[2]*=-1.;}
   else 
-    if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) )    xyz[2]*=-1;      
+    {if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) )    xyz[2]*=-1;}
   index[0]=1;
 }
 
@@ -666,6 +667,13 @@ inline void AliTPCParam::Transform4to8(Float_t *xyz, Int_t *index) const
   //transform xyz coordinates to 'digit' coordinates
   //
 
+  if (index[1]<fNInnerSector) {
+    if ( index[1]>=(fNInnerSector>>1)) xyz[1]*=-1.;
+  }
+  else {
+    if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[1]*=-1;      
+  }
+
   xyz[2]/=fZWidth;  
   if  (index[1]<fNInnerSector) {    
     xyz[0]/=fInnerPadPitchLength;
@@ -685,6 +693,13 @@ inline void AliTPCParam::Transform8to4(Float_t *xyz, Int_t *index) const
   //
   //transforms 'digit' coordinates to xyz coordinates
   //
+  if (index[1]<fNInnerSector) {
+    if ( index[1]>=(fNInnerSector>>1)) xyz[1]*=-1.;
+  }
+  else {
+    if ( (index[1]-fNInnerSector) >= (fNOuterSector>>1) ) xyz[1]*=-1;      
+  }
+
   xyz[2]*=fZWidth;
   if  (index[1]<fNInnerSector) {    
     xyz[0]*=fInnerPadPitchLength;
@@ -733,5 +748,8 @@ inline void  AliTPCParam::Transform8to6(Float_t *xyz, Int_t *index) const
   }  
   index[0]=6;
 }
-
+inline Float_t AliTPCParam::GetZLength(Int_t sector) const
+{ if(sector <18 || (sector>35&&sector<54)) return   fZLength-0.275;
+  else return fZLength-0.302;
+}
 #endif