StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSvtCoordinateTransform.hh
1 /***********************************************************************
2  *
3  * $Id: StSvtCoordinateTransform.hh,v 1.17 2007/04/13 16:10:34 fisyak Exp $
4  *
5  * Author: Helen Caines made this on April 14 2000
6  *
7  ***********************************************************************
8  * Description:
9  *
10  * Geometrical transformation Routines for:
11  * Raw Wafer Coordinate <--> Local Coordinate
12  * Local Coordinate <--> Global Coordinate
13  *
14  * These Routines deal positions ONLY!
15  *
16 
17  ***********************************************************************/
18 #ifndef ST_COORDINATE_SVTTRANSFORM_HH
19 #define ST_COORDINATE_SVTTRANSFORM_HH
20 
21 #include <stdlib.h>
22 #include <vector>
23 #ifndef ST_NO_NAMESPACES
24 using std::vector;
25 #endif
26 //#include <unistd.h>
27 #ifndef ST_NO_EXCEPTIONS
28 //#include <stdexcept>
29 #endif
30 
31 #include "TF1.h"
32 
33 #include "tables/St_svg_geom_Table.h"
34 
35 #include "StThreeVector.hh"
36 
37 #define DEBUG_SVT 0
38 #define idbsvt if(DEBUG_SVT) cout
39 
40 class StGlobalCoordinate;
43 class StSvtConfig;
44 class StSvtGeometry;
46 class StSvtT0;
47 class svg_geom_st;
48 class svg_shape_st;
49 class srs_srspar_st;
50 class StTpcDb;
51 class St_svtCorrectionC;
53 public:
54 
56  StSvtCoordinateTransform(StTpcDb* tpcDbPointer);
58 
59  // Raw Data <--> Global Coordinate
60  void operator()(const StSvtWaferCoordinate&, StGlobalCoordinate&);
61  void operator()(const StGlobalCoordinate&, StSvtWaferCoordinate&, Int_t Id);
62 
63  // Raw Data <--> Svt Local Coordinates
64 
65  void operator()(const StSvtLocalCoordinate&, StSvtWaferCoordinate&);
66  void operator()(const StSvtWaferCoordinate&, StSvtLocalCoordinate&);
67 
68 
69  // Svt Local <--> Global
70  void operator()(const StSvtLocalCoordinate&, StGlobalCoordinate&);
71  void operator()(const StGlobalCoordinate& ,StSvtLocalCoordinate&, Int_t Id);
72  void setParamPointers( srs_srspar_st* srspar, svg_geom_st* geom, svg_shape_st* shape, StSvtConfig* config, StSvtHybridCollection* driftVeloc=NULL, StSvtT0* T0=NULL);
73  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);
74  void setParamPointers( StSvtGeometry* geom, StSvtConfig* config, StSvtHybridCollection* driftVeloc=NULL, StSvtT0* T0=NULL);
75  void setParamPointers( StSvtGeometry* geom, StSvtConfig* config, StSvtHybridCollection* driftVeloc=NULL, StSvtHybridCollection* driftCurve=NULL, StSvtT0* T0=NULL);
76  void setParamPointers( StSvtGeometry* geom, StSvtConfig* config, StSvtHybridCollection* driftVeloc, StSvtHybridCollection* driftCurve, StSvtT0* T0, St_svtCorrectionC* driftVelCorr);
77  void setVelocityScale( double deltaV);
78  int LocaltoGlobal(const StSvtLocalCoordinate&, StThreeVector<double>& x, int Index);
79  int GlobaltoLocal(const StThreeVector<double>& x , StSvtLocalCoordinate&, int HardWarePos, int Index );
80  int IsOnWaferZ( const StThreeVector<double>& x, int HardWarePos);
81  int IsOnWaferR(const StThreeVector<double>& x, int HardWarePos);
82  void setDriftVelocity();
83 
84 private:
85 
86  UInt_t mFlag;
87  StSvtConfig *mconfig;
88  StSvtGeometry* mgeom;
89  StSvtHybridCollection* mDriftVelocity;
90  double mDeltaDriftVelocity;
91  StSvtHybridCollection* mDriftCurve;
92  StSvtT0* mT0;
93  TF1* mPoly9;
94  St_svtCorrectionC* mdriftVelCorr;
95 };
96 
97 #endif
98