StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFtpcTrackingParams.hh
1 // $Id: StFtpcTrackingParams.hh,v 1.22 2012/11/07 23:30:18 fisyak Exp $
2 // $Log: StFtpcTrackingParams.hh,v $
3 // Revision 1.22 2012/11/07 23:30:18 fisyak
4 // Supress warnings
5 //
6 // Revision 1.21 2007/12/12 12:55:19 jcs
7 // Markus Oldenburg replaced assert() with a return code which can be tested in StFtpcTrackMaker
8 // replaced 'return 1' with 'return kStOK'
9 // replaced 'return 0' with 'return KStErr'
10 //
11 // Revision 1.20 2007/05/14 19:44:16 jcs
12 // remove obsolete include statement
13 //
14 // Revision 1.19 2007/05/08 10:47:33 jcs
15 // replace StMagUtilities with StarMagField as requested by Yuri
16 //
17 // Revision 1.18 2005/07/06 19:40:07 fisyak
18 // use templated version of StThreeVectorF and StPhysicalHelixD
19 //
20 // Revision 1.17 2004/06/04 11:05:26 jcs
21 // replaced StarDb/ftpc/fdepars/fdepar with StarDb/ftpc/ftpcdEdxPars
22 //
23 // Revision 1.16 2003/10/07 14:11:10 jcs
24 // remove previous fix for determining magnetic field
25 //
26 // Revision 1.15 2003/10/02 00:10:37 perev
27 // Zeroing of members added and bug in ResetMagField fixed
28 //
29 // Revision 1.14 2003/09/26 06:08:58 oldi
30 // Check if the magentic field was reversed 'by hand' with a chain option.
31 // If yes, multiply the scaleFactor of the field with -1.
32 //
33 // Revision 1.13 2003/09/11 21:31:30 jeromel
34 // removed inline as it would leave a few undefined reference
35 //
36 // Revision 1.12 2003/05/21 09:47:10 putschke
37 // Include rotation around y-axis for FTPC east and west
38 //
39 // Revision 1.11 2003/05/20 18:35:08 oldi
40 // Cuts for vertex estimation introduced (globDca < 1 cm, multiplicity >= 200).
41 //
42 // Revision 1.10 2003/01/16 18:04:35 oldi
43 // Bugs eliminated. Now it compiles on Solaris again.
44 // Split residuals for global and primary fit.
45 //
46 // Revision 1.9 2002/11/21 15:46:30 oldi
47 // Enabled rotation for FTPC west. If there is an observed shift of the vertex
48 // position in y-direction (in FTPC west), just fill this offset into the Db.
49 // Up to now this offset is set to 0., i.e. only FTPC east is rotated (because
50 // the offset is at 0.3427 cm).
51 //
52 // Revision 1.8 2002/11/19 12:45:11 oldi
53 // A new database entry (installationPointY[east/west]) was introduced. Now
54 // the rotation of FTPC east is done around the correct axis, which isn't
55 // measured but comes from the drawings. The measurements used before were true
56 // measurements but had nothing to do with the rotation axis, unfortunately.
57 // Anyway, the difference is rather small since a typical cluster is rotated
58 // by less than 0.1mm.
59 // Some code cleanup done.
60 //
61 // Revision 1.7 2002/11/06 13:47:40 oldi
62 // All current database values hardcoded (for stand alone usage).
63 // Code clean ups.
64 //
65 // Revision 1.6 2002/10/31 13:42:31 oldi
66 // Everything read from database now.
67 //
68 // Revision 1.5 2002/10/11 15:45:47 oldi
69 // Get FTPC geometry and dimensions from database.
70 // No field fit activated: Returns momentum = 0 but fits a helix.
71 // Bug in TrackMaker fixed (events with z_vertex > outer_ftpc_radius were cut).
72 // QA histograms corrected (0 was supressed).
73 // Code cleanup (several lines of code changed due to *params -> Instance()).
74 // cout -> gMessMgr.
75 //
76 // Revision 1.4 2002/10/03 10:34:08 oldi
77 // Usage of gufld removed.
78 // Magnetic field is read by StMagUtilities, now.
79 //
80 // Revision 1.3 2002/06/07 06:00:40 oldi
81 // New value for rotation angle of FTPC east after temperature offset was corrected.
82 //
83 
84 #ifndef STAR_StFtpcTrackingParams
85 #define STAR_StFtpcTrackingParams
86 
87 #ifndef ROOT_Rtypes
88 #include "Rtypes.h"
89 #endif
90 
91 // SCL
92 #include "SystemOfUnits.h"
93 #include "StThreeVectorD.hh"
94 #include "StMatrixD.hh"
95 #include "Stypes.h"
96 
97 #ifndef ST_NO_NAMESPACES
98 using namespace units;
99 #endif
100 
101 #include "tables/St_ftpcTrackingPars_Table.h"
102 #include "tables/St_ftpcDimensions_Table.h"
103 #include "tables/St_ftpcPadrowZ_Table.h"
104 #include "tables/St_ftpcdEdxPars_Table.h"
105 #include "tables/St_ftpcCoordTrans_Table.h"
106 
107 #include "StTpcDb/StTpcDb.h"
108 
109 #include "StarMagField.h"
110 
111 class St_ftpcDimensions;
112 class St_ftpcPadrowZ;
113 class St_ftpcdEdxPars;
114 class StGlobalCoordinate;
116 class StTpcDb;
117 
119 {
120 private:
121 
122  static StFtpcTrackingParams* mInstance;
123 
124  char mStart; // start of simple variables
125 
126  Int_t mReturnCode;
127 
129  Double_t mInnerRadius;
130  Double_t mOuterRadius;
131  Int_t mNumberOfPadRows;
132  Int_t mNumberOfPadRowsPerSide;
133  Double_t *mPadRowPosZ;
134 
136  Double_t mMaxVertexPosZWarning;
137  Double_t mMaxVertexPosZError;
138 
140  Int_t mHistoBins;
141  Double_t mHistoMin;
142  Double_t mHistoMax;
143  Double_t mMaxDcaVertex;
144  Int_t mMinNumTracks;
145 
147  Int_t mRowSegments;
148  Int_t mPhiSegments;
149  Int_t mEtaSegments;
150 
152  Bool_t mLaser[4];
153  Bool_t mVertexConstraint[4];
154  Int_t mMaxTrackletLength[4];
155  Int_t mMinTrackLength[4];
156  Int_t mRowScopeTracklet[4];
157  Int_t mRowScopeTrack[4];
158  Int_t mPhiScope[4];
159  Int_t mEtaScope[4];
160  Double_t mMaxDca[4];
161 
163  Double_t mMaxAngleTracklet[4];
164 
166  Double_t mMaxAngleTrack[4];
167  Double_t mMaxCircleDist[4];
168  Double_t mMaxLengthDist[4];
169 
171  Double_t mMaxDist;
172  Double_t mMinPointRatio;
173  Double_t mMaxPointRatio;
174 
175  // dE/dx
176  Int_t mDebugLevel;
177  Int_t mIdMethod;
178  Int_t mNoAngle;
179  Int_t mMaxHit;
180  Int_t mMinHit;
181  Int_t mMaxTrack;
182 
183  Double_t mPadLength;
184  Double_t mFracTrunc;
185  Double_t mAip;
186  Double_t mALargeNumber;
187 
188  // internal FTPC rotation
189  StMatrixD *mFtpcRotationY[2];
190  StMatrixD *mFtpcRotationYInverse[2];
191  StMatrixD *mFtpcRotationX[2];
192  StMatrixD *mFtpcRotationXInverse[2];
193  StMatrixD *mFtpcRotation[2];
194  StMatrixD *mFtpcRotationInverse[2];
195  Double_t mInstallationPointY[2];
196  Double_t mInstallationPointX[2];
197  Double_t mInstallationPointZ[2];
198  Double_t mObservedVertexOffsetY[2];
199  Double_t mObservedVertexOffsetX[2];
200 
201  char mEnd; //End of simple variables
202 
203  // transformation due to rotated and displaced TPC
204  StMatrixD mTpcToGlobalRotation; // (3X3)
205  StMatrixD mGlobalToTpcRotation; // (3X3)
206  StThreeVectorD mTpcPositionInGlobal;
207 
208 protected:
209 
210  StFtpcTrackingParams(St_ftpcTrackingPars *trackPars = 0,
211  St_ftpcdEdxPars *dEdxPars = 0,
212  St_ftpcDimensions *dimensions = 0,
213  St_ftpcPadrowZ *padrow_z = 0);
215 
216  Int_t InitTrackingParams(ftpcTrackingPars_st *trackParsTable);
217  Int_t InitdEdx(ftpcdEdxPars_st *dEdxParsTable);
218  Int_t InitDimensions(ftpcDimensions_st* dimensionsTable);
219  Int_t InitPadRows(ftpcPadrowZ_st* padrowzTable);
220  Int_t InitCoordTransformation();
221  Int_t InitCoordTransformation(ftpcCoordTrans_st* ftpcCoordTrans);
222  Int_t InitSpaceTransformation();
223 
224 public:
225 
226  static StFtpcTrackingParams* Instance(Bool_t debug,
227  St_ftpcTrackingPars *trackPars,
228  St_ftpcdEdxPars *dEdxPars,
229  St_ftpcDimensions *dimensions,
230  St_ftpcPadrowZ *padrow_z);
231  static StFtpcTrackingParams* Instance(Bool_t debug,
232  St_ftpcCoordTrans *ftpcCoordTrans);
233  static StFtpcTrackingParams* Instance();
234 
235  virtual ~StFtpcTrackingParams();
236 
237  void PrintParams();
238 
239  Int_t GetReturnCode() { return mReturnCode; }
240 
242 
243  Double_t InnerRadius();
244  Double_t OuterRadius();
245  Int_t NumberOfPadRows();
246  Int_t NumberOfPadRowsPerSide();
247  Double_t PadRowPosZ(Int_t row);
249 
250 
252 
253  Double_t MaxVertexPosZWarning();
254  Double_t MaxVertexPosZError();
256 
257 
259 
260  Int_t HistoBins();
261  Double_t HistoMin();
262  Double_t HistoMax();
263  Double_t MaxDcaVertex();
264  Int_t MinNumTracks();
266 
268 
269  Int_t RowSegments();
270  Int_t PhiSegments();
271  Int_t EtaSegments();
273 
274 
276 
277  Bool_t Laser(Int_t tracking_method);
278  Bool_t VertexConstraint(Int_t tracking_method);
279  Int_t MaxTrackletLength(Int_t tracking_method);
280  Int_t MinTrackLength(Int_t tracking_method);
281  Int_t RowScopeTracklet(Int_t tracking_method);
282  Int_t RowScopeTrack(Int_t tracking_method);
283  Int_t PhiScope(Int_t tracking_method);
284  Int_t EtaScope(Int_t tracking_method);
285  Double_t MaxDca(Int_t tracking_method);
287 
289  Double_t MaxAngleTracklet(Int_t tracking_method);
290 
291 
293 
294  Double_t MaxAngleTrack(Int_t tracking_method);
295  Double_t MaxCircleDist(Int_t tracking_method);
296  Double_t MaxLengthDist(Int_t tracking_method);
298 
299 
301 
302  Double_t MaxDist();
303  Double_t MinPointRatio();
304  Double_t MaxPointRatio();
306 
307 
309 
310  Int_t DebugLevel();
311  Int_t IdMethod();
312  Int_t NoAngle();
313  Int_t MaxHit();
314  Int_t MinHit();
315  Int_t MaxTrack();
316 
317  Double_t PadLength();
318  Double_t FracTrunc();
319  Double_t Aip();
320  Double_t ALargeNumber();
322 
323 
325  StMatrixD TpcToGlobalRotation();
326  StMatrixD GlobalToTpcRotation();
327  StThreeVectorD TpcPositionInGlobal();
328 
329 
331 
332  StMatrixD FtpcRotation(Int_t i);
333  StMatrixD FtpcRotationInverse(Int_t i);
334  StMatrixD FtpcRotationX(Int_t i);
335  StMatrixD FtpcRotationXInverse(Int_t i);
336  StMatrixD FtpcRotationY(Int_t i);
337  StMatrixD FtpcRotationYInverse(Int_t i);
338  Double_t InstallationPointX(Int_t i);
339  Double_t InstallationPointY(Int_t i);
340  Double_t InstallationPointZ(Int_t i);
341  Double_t ObservedVertexOffsetY(Int_t i);
342  Double_t ObservedVertexOffsetX(Int_t i);
344 
345 
346  StarMagField *MagField() {return StarMagField::Instance();}
347  Double_t MagFieldFactor(){ return StarMagField::Instance()->GetFactor();}
348 
349  ClassDef(StFtpcTrackingParams,0) // Parameters for FTPC tracking
350 };
351 
352 #endif