Added transformation function (Marian)
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Apr 2007 12:09:49 +0000 (12:09 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 Apr 2007 12:09:49 +0000 (12:09 +0000)
TPC/AliTPCROC.cxx
TPC/AliTPCROC.h

index c4bb00e..e8da2a7 100644 (file)
@@ -197,6 +197,43 @@ void AliTPCROC::SetGeometry()
   //   SetOuterWWPitch(kOuterWWPitch);
   //   SetROuterFirstWire(kROuterFirstWire);
   //   SetROuterLastWire(kROuterLastWire);  
+
+  UInt_t i=0;
+  Float_t firstrow = fInnerRadiusLow + 1.575;   
+  for( i= 0;i<fNRowLow;i++)
+    {
+      Float_t x = firstrow + fInnerPadPitchLength*(Float_t)i;  
+      fPadRowLow[i]=x;
+      fYInner[i+1]  = x*TMath::Tan(fInnerAngle/2.)-fInnerWireMount;
+      fNPadsLow[i] = GetNPads(0,i) ;     // ROC implement     
+    }
+  // cross talk rows
+  fYInner[0]=(fPadRowLow[0]-fInnerPadPitchLength)*TMath::Tan(fInnerAngle/2.)-fInnerWireMount;
+  fYInner[fNRowLow+1]=(fPadRowLow[fNRowLow-1]+fInnerPadPitchLength)*TMath::Tan(fInnerAngle/2.)-fInnerWireMount; 
+  firstrow = fOuterRadiusLow + 1.6;
+  for(i=0;i<fNRowUp;i++)
+    {
+      if(i<fNRowUp1){
+       Float_t x = firstrow + fOuter1PadPitchLength*(Float_t)i; 
+       fPadRowUp[i]=x;
+       fYOuter[i+1]= x*TMath::Tan(fOuterAngle/2.)-fOuterWireMount;
+       fNPadsUp[i] =  GetNPads(36,i) ;     // ROC implement      
+       if(i==fNRowUp1-1) {
+         fLastWireUp1=fPadRowUp[i] +0.625;
+         firstrow = fPadRowUp[i] + 0.5*(fOuter1PadPitchLength+fOuter2PadPitchLength);
+       }
+      }
+      else
+       {
+         Float_t x = firstrow + fOuter2PadPitchLength*(Float_t)(i-64);
+         fPadRowUp[i]=x;
+         fNPadsUp[i] =  GetNPads(36,i) ;     // ROC implement
+       }
+      fYOuter[i+1]  = fPadRowUp[i]*TMath::Tan(fOuterAngle/2.)-fOuterWireMount;
+    }
+  
+
+
 } 
 
 
@@ -357,3 +394,36 @@ AliTPCROC::~AliTPCROC()
   
 }
 
+
+
+
+void AliTPCROC::GetPositionLocal(UInt_t sector, UInt_t row, UInt_t pad, Float_t *pos){
+  //
+  // get position of center of pad - ideal frame used
+  //
+  pos[2]=fZLength;
+  if (sector<36){
+   pos[0] = fPadRowLow[row];
+   pos[1] = fInnerPadPitchWidth*(Int_t(pad)-Int_t(fNPads[0][row])/2);
+  }else{
+    pos[0] = fPadRowUp[row];
+    pos[1] = fOuterPadPitchWidth*(Int_t(pad)-Int_t(fNPads[0][row])/2);    
+  }
+  if ((sector%36)>=18){
+    pos[2] *= -1.;
+    pos[1] *= -1.;
+  }
+}
+
+
+void AliTPCROC::GetPositionGlobal(UInt_t sector, UInt_t row, UInt_t pad, Float_t *pos){
+  //
+  // get position of center of pad - ideal frame used 
+  //
+  GetPositionLocal(sector,row,pad,pos);
+  Double_t alpha = TMath::DegToRad()*(10.+20.*(sector%18));
+  Float_t gx = pos[0]*TMath::Cos(alpha)-pos[1]*TMath::Sin(alpha);
+  Float_t gy = pos[1]*TMath::Cos(alpha)+pos[0]*TMath::Sin(alpha);
+  pos[0] = gx;
+  pos[1] = gy;
+}
index 231dfb5..6c6231b 100644 (file)
@@ -22,7 +22,8 @@ class AliTPCROC : public TObject {
   AliTPCROC &operator = (const AliTPCROC & roc); //assignment operator
   void Init(); 
   virtual           ~AliTPCROC();
-
+  void GetPositionLocal(UInt_t sector, UInt_t row, UInt_t pad, Float_t *pos);
+  void GetPositionGlobal(UInt_t sector, UInt_t row, UInt_t pad, Float_t *pos);
   //
   //    numbering
   UInt_t GetNSectors() const          { return fNSectorsAll;}
@@ -48,8 +49,15 @@ class AliTPCROC : public TObject {
   UInt_t    GetNSector() const {return fNSectorsAll;}
   Float_t  GetZLength() const {return fZLength;}
   //
-
- protected:
+  // get pad row parameters
+  //
+  Float_t GetPadRowRadiiLow(Int_t irow) const {return ( irow>=0 && (irow<fNRowLow) ) ? fPadRowLow[irow]: 0;} //get the pad row (irow) radii
+  Float_t GetPadRowRadiiUp(Int_t irow) const {return ( irow>=0 && (irow<fNRowUp) ) ? fPadRowUp[irow]: 0;}   //get the pad row (irow) radii   
+  Float_t GetPadRowRadii(Int_t isec,Int_t irow) const {
+    return ( (isec < fNSectors[0]) ?GetPadRowRadiiLow(irow):GetPadRowRadiiUp(irow));}
+  //
+  
+protected:
   //
   //     number of pads
   //
@@ -113,12 +121,12 @@ class AliTPCROC : public TObject {
   UInt_t     fNRowUp2;            //number of long pad rows per sector up   -set
   UInt_t     fNRowUp;            //number of pad rows per sector up     -calculated
   UInt_t     fNtRows;            //total number of rows in TPC          -calculated
-  Float_t   fPadRowLow[600]; //Lower sector, pad row radii          -calculated
-  Float_t   fPadRowUp[600];  //Upper sector, pad row radii          -calculated 
-  UInt_t     fNPadsLow[600];  //Lower sector, number of pads per row -calculated
-  UInt_t     fNPadsUp[600];   //Upper sector, number of pads per row -calculated
-  Float_t   fYInner[600];     //Inner sector, wire-length
-  Float_t   fYOuter[600];     //Outer sector, wire-length   
+  Float_t   fPadRowLow[100]; //Lower sector, pad row radii          -calculated
+  Float_t   fPadRowUp[100];  //Upper sector, pad row radii          -calculated 
+  UInt_t     fNPadsLow[100];  //Lower sector, number of pads per row -calculated
+  UInt_t     fNPadsUp[100];   //Upper sector, number of pads per row -calculated
+  Float_t   fYInner[100];     //Inner sector, wire-length
+  Float_t   fYOuter[100];     //Outer sector, wire-length   
  protected:
   static AliTPCROC*   fgInstance; //! Instance of this class (singleton implementation)
   ClassDef(AliTPCROC,0)    //  TPC ROC class