154 #ifndef ST_COORDINATE_TRANSFORM_HH
155 #define ST_COORDINATE_TRANSFORM_HH
160 #include "StGlobals.hh"
161 #include "SystemOfUnits.h"
162 #include "StThreeVector.hh"
163 #include "StTpcDb/StTpcDb.h"
164 #include "StObject.h"
168 #include "StTpcPadCoordinate.hh"
169 #include "StTpcLocalCoordinate.hh"
170 #include "StTpcLocalSectorCoordinate.hh"
171 #include "StTpcLocalSectorAlignedCoordinate.hh"
172 #include "StGlobalCoordinate.hh"
174 #include "StTpcLocalDirection.hh"
175 #include "StTpcLocalSectorDirection.hh"
176 #include "StTpcLocalSectorAlignedDirection.hh"
177 #include "StGlobalDirection.hh"
200 {StTpcDb::instance()->Pad2Tpc(a.sector(),a.row()).LocalToMasterVect(a.position().xyz(),b.position().xyz()); b.setSector(a.sector()); b.setRow(a.row());}
205 {StTpcDb::instance()->Pad2Glob(a.sector(),a.row()).LocalToMasterVect(a.position().xyz(),b.position().xyz());}
212 {StTpcDb::instance()->Pad2Tpc(a.sector(),a.row()).MasterToLocalVect(a.position().xyz(),b.position().xyz()); b.setSector(a.sector()); b.setRow(a.row());}
215 this->operator()(a,c,sector,row);
216 this->operator()(c,b);
219 {StTpcDb::instance()->Pad2Glob(sector,row).MasterToLocalVect(a.position().xyz(),b.position().xyz()); b.setSector(sector); b.setRow(row);}
222 {StTpcDb::instance()->Tpc2GlobalMatrix().LocalToMaster(a.position().xyz(),b.position().xyz());}
224 {StTpcDb::instance()->Tpc2GlobalMatrix().MasterToLocal(a.position().xyz(),b.position().xyz()); b.setSector(sector); b.setRow(row);}
226 {StTpcDb::instance()->Tpc2GlobalMatrix().LocalToMasterVect(a.position().xyz(),b.position().xyz());}
228 {StTpcDb::instance()->Tpc2GlobalMatrix().MasterToLocalVect(a.position().xyz(),b.position().xyz()); b.setSector(sector); b.setRow(row);}
234 Double_t tBFromZ(Double_t z, Int_t sector, Int_t row, Int_t pad = 0)
const;
235 Double_t zFromTB(Double_t tb, Int_t sector, Int_t row, Int_t pad = 0)
const;
238 static Int_t rowFromLocalY(Double_t y, Int_t sector);
239 static Int_t rowFromLocal(
const StThreeVector<Double_t>& a, Int_t sector) {
return rowFromLocalY(a.y(), sector);}
240 Double_t padFromLocal(
const StThreeVector<Double_t>& a, Int_t sector, Int_t row)
const {
return padFromX(a.x(), sector, row);}
241 Double_t padFromX(Double_t x, Int_t sector, Int_t row)
const;
246 Double_t yFromRow(Int_t sector, Int_t row)
const {
return (St_tpcPadConfigC::instance()->radialDistanceAtRow(sector,row));}
247 Double_t xFromPad(Int_t sector, Int_t row, Double_t pad)
const;
250 Double_t angle = TMath::RadToDeg()*TMath::ATan2(a.y(),a.x());
251 if(angle<0) angle+= 360;
252 Int_t sectorNumber= (int)( (angle+15)/30);
253 if(a.z()>0){sectorNumber=15-sectorNumber;
if(sectorNumber> 12)sectorNumber-=12;}
254 else {sectorNumber+=9;
if(sectorNumber<=12)sectorNumber+=12;}
258 Double_t mTimeBinWidth;
259 Double_t mInnerSectorzOffset;
260 Double_t mOuterSectorzOffset;
262 Double_t mInnerSectorzOffset_West;
263 Double_t mOuterSectorzOffset_West;
265 Int_t mNoOfInnerRows;