StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFtpcSlowSimField.hh
1 // $Id: StFtpcSlowSimField.hh,v 1.7 2003/09/02 17:58:16 perev Exp $
2 // $Log: StFtpcSlowSimField.hh,v $
3 // Revision 1.7 2003/09/02 17:58:16 perev
4 // gcc 3.2 updates + WarnOff
5 //
6 // Revision 1.6 2003/07/03 13:30:56 fsimon
7 // Implementation of cathode offset simulation:
8 // The inner radius (and thus the E-field) is changed according to
9 // phi of the cluster and the size of the offset.
10 // GetVelocityZ not inline anymore, since it got quite big
11 //
12 // Revision 1.5 2003/02/14 16:58:03 fsimon
13 // Add functionality that allows for different temperature corrections
14 // in west and east, important for embedding. Drift tables are created
15 // for east and west seperately.
16 //
17 // Revision 1.4 2002/09/13 13:45:23 fsimon
18 // Commented out anglefactor
19 //
20 // Revision 1.3 2001/03/06 23:36:05 jcs
21 // use database instead of params
22 //
23 // Revision 1.2 2000/11/27 14:08:04 hummler
24 // inplement tzero and lorentz angle correction factor
25 //
26 // Revision 1.1 2000/11/23 10:16:43 hummler
27 // New FTPC slow simulator in pure maker form
28 //
29 //
31 // Author: W.G.Gong
32 // Email: gong@mppmu.mpg.de
33 // Date: Oct 25, 1996
35 #ifndef STAR_StFtpcSlowSimField
36 #define STAR_StFtpcSlowSimField
37 
38 class Inparam;
39 class StFtpcParamReader;
40 class StFtpcDbReader;
41 extern int Locate(const int npt, const float* x, const float xx);
42 
43 //
44 // class field will divide radius into grid points and
45 // define efield and gas parameters at grid points.
46 //
48 {
49 public:
51  StFtpcDbReader *dbReader);
53  float Interpolate(const int npt, const float* x,
54  const float* y,const int ich,
55  const float xx);
56  float InterpValue(const int npt, const float* x,
57  const float* y, const float xx);
58  void Output() const; // write out the field value for checking
59 
60  int GetGridIndex(const float r) const
61  { return ((int) ((r - innerRadius)*inverseDeltaRadius) ) ; }
62 
63  // GetVelocityZ is inline although too long because it is called in the
64  // main drift loop
65  void GetVelocityZ(const float inverseRadius, const int padrow, const float phi, float *inverseVelocity, float *angle);
66 
67  float GetVelAtReadout() const { return finalVelocity; }
68 
69  float GetDeltaRadius() const { return del_r; }
70 
71  float GetInverseDeltaRadius() const { return inverseDeltaRadius; }
72 
73  float GetTwoDeltaRadius() const { return twoDeltaRadius; }
74 
75  float GetDiffusionXSqr(const int i) const {return grid_point[i].diff_x;}
76 
77  float GetDiffusionZSqr(const int i) const {return grid_point[i].diff_z;}
78 
79  float GetDlnvDr(const int i) const {return grid_point[i].dlnv_dr;}
80 
81 private:
82  StFtpcParamReader *mParam;
83  StFtpcDbReader *mDb;
84  // variable declarations
85  float del_r; // radial grid size
86  float inverseDeltaRadius; // 1/del_r
87  float twoDeltaRadius; // 2*del_r
88  float finalVelocity;
89  // variables to handle fcl_padtrans information:
90  int nMagboltzBins;
91  int nPadrowPositions;
92  float EFieldMin;
93  float EFieldStep;
94  float EFieldStepInverted;
95  float EFieldStepInvConverted; // include pi/180
96  float radTimesField;
97  float innerRadius;
98  float outerRadius;
99  float *preciseEField;
100  // DV and LA needed for east & west seperately to permit different t corrections
101  float *inverseDriftVelocityWest;
102  float *preciseLorentzAngleWest;
103  float *inverseDriftVelocityEast;
104  float *preciseLorentzAngleEast;
105  float angleFactor;
106 
107  // variables for cathode offset simulation
108  float mOffsetCathodeWest;
109  float mOffsetCathodeEast;
110  float mAngleOffsetWest;
111  float mAngleOffsetEast;
112 
113  struct grid_data {
114  float rhit; // hit radius in cm
115  float ef; // Efield in V/cm
116  float vel_z; // long. drift speed in cm/usec
117  float diff_z; // long. diffusion coeff. in um/::sqrt(cm)
118  float diff_x; // trans. diffusion coef. in um/::sqrt(cm)
119  float diff_y; // trans. diffusion coef. in um/::sqrt(cm)
120  float lorentz; // Lorentz angle in rad
121  float dlnv_dr; // drift velocity gradient
122  };
123  grid_data *grid_point;
124 };
125 
126 #endif
127