00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef ST_COORDINATE_SVTTRANSFORM_HH
00019 #define ST_COORDINATE_SVTTRANSFORM_HH
00020
00021 #include <stdlib.h>
00022 #include <vector>
00023 #ifndef ST_NO_NAMESPACES
00024 using std::vector;
00025 #endif
00026
00027 #ifndef ST_NO_EXCEPTIONS
00028
00029 #endif
00030
00031 #include "TF1.h"
00032
00033 #include "tables/St_svg_geom_Table.h"
00034
00035 #include "StThreeVector.hh"
00036
00037 #define DEBUG_SVT 0
00038 #define idbsvt if(DEBUG_SVT) cout
00039
00040 class StGlobalCoordinate;
00041 class StSvtLocalCoordinate;
00042 class StSvtWaferCoordinate;
00043 class StSvtConfig;
00044 class StSvtGeometry;
00045 class StSvtHybridCollection;
00046 class StSvtT0;
00047 class svg_geom_st;
00048 class svg_shape_st;
00049 class srs_srspar_st;
00050 class StTpcDb;
00051 class St_svtCorrectionC;
00052 class StSvtCoordinateTransform {
00053 public:
00054
00055 StSvtCoordinateTransform();
00056 StSvtCoordinateTransform(StTpcDb* tpcDbPointer);
00057 ~StSvtCoordinateTransform();
00058
00059
00060 void operator()(const StSvtWaferCoordinate&, StGlobalCoordinate&);
00061 void operator()(const StGlobalCoordinate&, StSvtWaferCoordinate&, Int_t Id);
00062
00063
00064
00065 void operator()(const StSvtLocalCoordinate&, StSvtWaferCoordinate&);
00066 void operator()(const StSvtWaferCoordinate&, StSvtLocalCoordinate&);
00067
00068
00069
00070 void operator()(const StSvtLocalCoordinate&, StGlobalCoordinate&);
00071 void operator()(const StGlobalCoordinate& ,StSvtLocalCoordinate&, Int_t Id);
00072 void setParamPointers( srs_srspar_st* srspar, svg_geom_st* geom, svg_shape_st* shape, StSvtConfig* config, StSvtHybridCollection* driftVeloc=NULL, StSvtT0* T0=NULL);
00073 void setParamPointers( srs_srspar_st* srspar, svg_geom_st* geom, svg_shape_st* shape, StSvtConfig* config, StSvtHybridCollection* driftVeloc=NULL, StSvtHybridCollection* driftCurve=NULL, StSvtT0* T0=NULL);
00074 void setParamPointers( StSvtGeometry* geom, StSvtConfig* config, StSvtHybridCollection* driftVeloc=NULL, StSvtT0* T0=NULL);
00075 void setParamPointers( StSvtGeometry* geom, StSvtConfig* config, StSvtHybridCollection* driftVeloc=NULL, StSvtHybridCollection* driftCurve=NULL, StSvtT0* T0=NULL);
00076 void setParamPointers( StSvtGeometry* geom, StSvtConfig* config, StSvtHybridCollection* driftVeloc, StSvtHybridCollection* driftCurve, StSvtT0* T0, St_svtCorrectionC* driftVelCorr);
00077 void setVelocityScale( double deltaV);
00078 int LocaltoGlobal(const StSvtLocalCoordinate&, StThreeVector<double>& x, int Index);
00079 int GlobaltoLocal(const StThreeVector<double>& x , StSvtLocalCoordinate&, int HardWarePos, int Index );
00080 int IsOnWaferZ( const StThreeVector<double>& x, int HardWarePos);
00081 int IsOnWaferR(const StThreeVector<double>& x, int HardWarePos);
00082 void setDriftVelocity();
00083
00084 private:
00085
00086 UInt_t mFlag;
00087 StSvtConfig *mconfig;
00088 StSvtGeometry* mgeom;
00089 StSvtHybridCollection* mDriftVelocity;
00090 double mDeltaDriftVelocity;
00091 StSvtHybridCollection* mDriftCurve;
00092 StSvtT0* mT0;
00093 TF1* mPoly9;
00094 St_svtCorrectionC* mdriftVelCorr;
00095 };
00096
00097 #endif
00098