]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCParam.h
Adding histogram
[u/mrichter/AliRoot.git] / TPC / AliTPCParam.h
index 47372a1155f54267124b59b62c61bfdb020886a9..5bae3b8d4c69823b7f4012caf8c6e429ce7a08f3 100644 (file)
@@ -24,14 +24,16 @@ 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;
   //trasforamtion from global to global - adjust index[0] sector 
   //return value is equal to sector corresponding to global position
+  void Transform1to2Ideal(Float_t *xyz, Int_t *index) const;
+  //transformation to rotated coordinata - ideal frame 
   void Transform1to2(Float_t *xyz, Int_t *index) const;
-  //transformation to rotated coordinata 
+  //transformation to rotated coordinata   
   void Transform2to1(Float_t *xyz, Int_t *index) const;
   //transformation from rotated coordinata to global coordinata
   void Transform2to2(Float_t *xyz, Int_t *index, Int_t *oindex) const;
@@ -217,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() const {return fZLength;}
+  Float_t  GetZLength(Int_t sector=0) const;
   Int_t    GetGeometryType() const {return fGeometryType;}
 
   //
@@ -278,7 +280,7 @@ public:
   Float_t GetYInner(Int_t irow) const; // wire length in low sec row
   Float_t GetYOuter(Int_t irow) const; // wire length in up sec row  
   Int_t GetSectorIndex(Float_t angle, Int_t row, Float_t z) const; // get sector index
-  Float_t GetChamberCenter(Int_t isec) const; // get readout chamber positions
+  Float_t GetChamberCenter(Int_t isec, Float_t * center = 0) const; // get readout chamber positions
   TGeoHMatrix *GetTrackingMatrix(Int_t isec) const {
     return fTrackingMatrix[isec];}
   TGeoHMatrix *GetClusterMatrix(Int_t isec) const {
@@ -493,46 +495,14 @@ inline Float_t   AliTPCParam::GetAngle(Int_t isec) const
   return fRotAngle[isec*4+2];
 }
 
-//inline void AliTPCParam::GetChamberPos(Int_t isec, Float_t* xyz) const
-//{
-  //
-  //return displacement and rotation of the readout chamber
-  //with respect to the ideal geometry
-//  xyz[0] = fChamberPos[isec*3];
-//  xyz[1] = fChamberPos[isec*3+1];
-//  xyz[2] = fChamberPos[isec*3+2];
-//}
-
-//inline void AliTPCParam::GetChamberRot(Int_t isec, Float_t* angles) const
-//{
-  //
-  //return displacement and rotation of the readout chamber
-  //with respect to the ideal geometry
-//  angles[0] = fChamberRot[isec*3];
-//  angles[1] = fChamberRot[isec*3+1];
-//  angles[2] = fChamberRot[isec*3+2];
-//}
-
-/* inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const */
-/* { */
-/*   //transformation to rotated coordinates  */
-/*   //we must have information about sector! */
-/*   //rotate to given sector */
-/*   Double_t xyzmaster[3] = {xyz[0],xyz[1],xyz[2]}; */
-/*   Double_t xyzlocal[3];   */
-/*   fGlobalMatrix[index[1]]->MasterToLocal(xyzmaster,xyzlocal); */
-/*   xyz[0] = xyzlocal[0]; */
-/*   xyz[1] = xyzlocal[1]; */
-/*   xyz[2] = TMath::Abs(xyzlocal[2]); */
-/*   index[0]=2; */
-/* } */
 
-inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const
+inline void AliTPCParam::Transform1to2Ideal(Float_t *xyz, Int_t *index) const
 {
   //transformation to rotated coordinates
   //we must have information about sector!
-
   //rotate to given sector
+  // ideal frame
+
   Float_t cos,sin;
   AdjustCosSin(index[1],cos,sin);
   Float_t x1=xyz[0]*cos + xyz[1]*sin;
@@ -544,6 +514,21 @@ inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const
 }
 
 
+inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const
+{
+  //transformation to rotated coordinates 
+  //we must have information about sector!
+  //rotate to given sector
+  Double_t xyzmaster[3] = {xyz[0],xyz[1],xyz[2]};
+  Double_t xyzlocal[3];  
+  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];
+  index[0]=2;
+}
+
 
 
 
@@ -682,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;
@@ -701,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;
@@ -749,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