StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTpcSimpleGeometry.hh
1 /**********************************************************************
2  *
3  * $Id: StTpcSimpleGeometry.hh,v 1.7 2012/06/11 15:04:55 fisyak Exp $
4  *
5  * Author: brian May 20, 1998
6  *
7  **********************************************************************
8  *
9  * Description: Database interface for Geometrical parameters
10  * for the STAR Main TPC
11  *
12  **********************************************************************
13  *
14  * $Log: StTpcSimpleGeometry.hh,v $
15  * Revision 1.7 2012/06/11 15:04:55 fisyak
16  * std namespace
17  *
18  * Revision 1.6 2003/09/02 17:59:16 perev
19  * gcc 3.2 updates + WarnOff
20  *
21  * Revision 1.5 2000/01/10 23:11:30 lasiuk
22  * Include MACROS for compatibility with SUN CC5.0
23  *
24  * Revision 1.4 1999/10/11 23:55:10 calderon
25  * Version with Database Access and persistent file.
26  * Not fully tested due to problems with cons, it
27  * doesn't find the local files at compile time.
28  * Yuri suggests forcing commit to work directly with
29  * files in repository.
30  *
31  * Revision 1.3 1999/04/07 00:47:50 lasiuk
32  * add z offset for driftLength
33  *
34  * Revision 1.2 1998/12/15 11:20:38 lasiuk
35  * add i/o sector spacing = 3 mm
36  *
37  * Revision 1.1 1998/11/10 17:12:07 fisyak
38  * Put Brian trs versin into StRoot
39  *
40  * Revision 1.7 1998/11/08 17:01:39 lasiuk
41  * allocators for vectors, resize() for LINUX compatibility
42  *
43  * Revision 1.6 1998/11/05 18:18:32 lasiuk
44  * additional wire info
45  *
46  * Revision 1.5 1998/11/04 20:19:49 lasiuk
47  * ensure unit integrity
48  *
49  * Revision 1.4 1998/10/22 14:59:32 lasiuk
50  * include pad length functions
51  *
52  * Revision 1.3 1998/06/30 22:55:45 lasiuk
53  * added anode wire member functions
54  *
55  * Revision 1.2 1998/05/25 17:01:57 lasiuk
56  * No drift velocity (SC now)
57  * padrows in STL container
58  *
59  * Revision 1.1 1998/05/21 21:27:38 lasiuk
60  * Initial revision
61  *
62  **********************************************************************/
63 #ifndef ST_TPC_SIMPLE_GEOMETRY_HH
64 #define ST_TPC_SIMPLE_GEOMETRY_HH
65 
66 #include <Stiostream.h>
67 #include <vector>
68 using std::vector;
69 
70 #include "StGlobals.hh"
71 #include "StThreeVector.hh"
72 #include "StTpcGeometry.hh"
73 
75 
76 public:
78  //StTpcSimpleGeometry(const StTpcSimpleGeometry&);
79  //StTpcSimpleGeometry& operator=(cont StTpcSimpleGeometry&);
80 
81  static StTpcGeometry* instance();
82  static StTpcGeometry* instance(const char*);
83 
84  // Rows
85  int numberOfRows() const;
86  int numberOfInnerRows() const;
87  int numberOfInnerRows48() const;
88  int numberOfInnerRows52() const;
89  int numberOfOuterRows() const;
90  int numberOfPadsAtRow(int) const;
91  double radialDistanceAtRow(int) const;
92  double innerSectorRowPitch1() const;
93  double innerSectorRowPitch2() const;
94  double outerSectorRowPitch() const;
95  double ioSectorSpacing() const;
96 
97  int numberOfSectors() const;
98  // TimeBuckets
99  int numberOfTimeBuckets() const;
100 
101  // Pads
102  double innerSectorPadWidth() const;
103  double outerSectorPadWidth() const;
104  double innerSectorPadLength() const;
105  double outerSectorPadLength() const;
106  double innerSectorPadPitch() const;
107  double outerSectorPadPitch() const;
108 
109  // Wire Plane
110  double anodeWireRadius() const;
111  double frischGridWireRadius() const;
112  double gateWireRadius() const;
113 
114  double anodeWirePitch() const;
115  double frischGridPitch() const;
116  double gatePitch() const;
117 
118  double innerSectorAnodeWirePadPlaneSeparation() const;
119  double innerSectorFrischGridPadPlaneSeparation() const;
120  double innerSectorGatingGridPadPlaneSeparation() const;
121 
122  double outerSectorAnodeWirePadPlaneSeparation() const;
123  double outerSectorFrischGridPadPlaneSeparation() const;
124  double outerSectorGatingGridPadPlaneSeparation() const;
125 
126  int numberOfInnerSectorAnodeWires() const;
127  double firstInnerSectorAnodeWire() const;
128  double lastInnerSectorAnodeWire() const;
129  double innerSectorAnodeWire(int) const;
130 
131 
132  int numberOfOuterSectorAnodeWires() const;
133  double firstOuterSectorAnodeWire() const;
134  double lastOuterSectorAnodeWire() const;
135  double outerSectorAnodeWire(int) const;
136 
137  double innerSectorEdge() const;
138  double outerSectorEdge() const;
139 
140  // General -- Field Cage
141  double endCapZ() const;
142  double driftDistance() const;
143  double ifcRadius() const;
144  double ofcRadius() const;
145  double frischGrid() const;
146  double innerSectorzOffSet() const;
147  double outerSectorzOffSet() const;
148 
149  bool acceptance(StThreeVector<StDouble>&) const;
150 
151  // Diagnostic: print out complete database
152  void print(ostream& os = cout) const;
153 
154 protected:
156  StTpcSimpleGeometry(const char*);
157 
158 private:
159  static StTpcGeometry* mInstance;
160 
161 private:
162  int mPadRows;
163  int mInnerPadRows;
164  int mInnerPadRows48;
165  int mInnerPadRows52;
166  int mOuterPadRows;
167  int mTimeBuckets;
168  int mSectors;
169  double mIfcRadius;
170  double mOfcRadius;
171  double mEndCapZ;
172  double mInnerSectorPadWidth;
173  double mInnerSectorPadLength;
174  double mInnerSectorPadPitch;
175  double mInnerSectorRowPitch1;
176  double mInnerSectorRowPitch2;
177  double mFirstPadRow;
178  double mFirstOuterSectorPadRow;
179  double mLastOuterSectorPadRow;
180  double mFirstRowWidth;
181  double mLastRowWidth;
182  double mInnerSectorEdge;
183 
184  double mOuterSectorPadWidth;
185  double mOuterSectorPadLength;
186  double mOuterSectorPadPitch;
187  double mOuterSectorRowPitch;
188  double mOuterSectorLength;
189  double mIoSectorSeparation;
190  double mOuterSectorEdge;
191  double mIoSectorSpacing;
192 
193  double mFrischGrid;
194  double mDriftDistance;
195  double mInnerSectorzOffSet;
196  double mOuterSectorzOffSet;
197 #ifndef ST_NO_TEMPLATE_DEF_ARGS
198  vector<int> mPadsInRow;
199  vector<double> mRadialDistanceAtRow;
200 #else
201  vector<int, allocator<int> > mPadsInRow;
202  vector<double, allocator<double> > mRadialDistanceAtRow;
203 #endif
204  // Wires
205  double mAnodeWireRadius;
206  double mFrischGridWireRadius;
207  double mGateWireRadius;
208 
209  double mAnodeWirePitch;
210  double mFrischGridWirePitch;
211  double mGateWirePitch;
212 
213  double mInnerSectorAnodeWirePadPlaneSeparation;
214  double mInnerSectorFrischGridPadPlaneSeparation;
215  double mInnerSectorGatingGridPadPlaneSeparation;
216 
217  double mOuterSectorAnodeWirePadPlaneSeparation;
218  double mOuterSectorFrischGridPadPlaneSeparation;
219  double mOuterSectorGatingGridPadPlaneSeparation;
220 
221  double mFirstInnerSectorAnodeWire;
222  double mLastInnerSectorAnodeWire;
223  int mNumberOfInnerSectorAnodeWires;
224 
225  double mFirstOuterSectorAnodeWire;
226  double mLastOuterSectorAnodeWire;
227  int mNumberOfOuterSectorAnodeWires;
228 };
229 
230 inline int StTpcSimpleGeometry::numberOfRows() const {return(mPadRows);}
231 inline int StTpcSimpleGeometry::numberOfInnerRows() const {return(mInnerPadRows);}
232 inline int StTpcSimpleGeometry::numberOfInnerRows48() const {return(mInnerPadRows48);}
233 inline int StTpcSimpleGeometry::numberOfInnerRows52() const {return(mInnerPadRows52);}
234 inline int StTpcSimpleGeometry::numberOfOuterRows() const {return(mOuterPadRows);}
235 inline int StTpcSimpleGeometry::numberOfTimeBuckets() const {return(mTimeBuckets);}
236 inline int StTpcSimpleGeometry::numberOfSectors() const {return(mSectors);}
237 inline double StTpcSimpleGeometry::innerSectorRowPitch1() const {return (mInnerSectorRowPitch1);}
238 inline double StTpcSimpleGeometry::innerSectorRowPitch2() const {return (mInnerSectorRowPitch2);}
239 inline double StTpcSimpleGeometry::outerSectorRowPitch() const {return (mOuterSectorRowPitch);}
240 
241 inline double StTpcSimpleGeometry::innerSectorPadWidth() const {return (mInnerSectorPadWidth);}
242 inline double StTpcSimpleGeometry::outerSectorPadWidth() const {return (mOuterSectorPadWidth);}
243 inline double StTpcSimpleGeometry::innerSectorPadLength() const {return (mInnerSectorPadLength);}
244 inline double StTpcSimpleGeometry::outerSectorPadLength() const {return (mOuterSectorPadLength);}
245 
246 inline double StTpcSimpleGeometry::innerSectorPadPitch() const {return (mInnerSectorPadPitch);}
247 inline double StTpcSimpleGeometry::outerSectorPadPitch() const {return (mOuterSectorPadPitch);}
248 
249 inline double StTpcSimpleGeometry::frischGrid() const {return (mFrischGrid);}
250 inline double StTpcSimpleGeometry::endCapZ() const {return (mEndCapZ);}
251 inline double StTpcSimpleGeometry::driftDistance() const {return (mDriftDistance);}
252 inline double StTpcSimpleGeometry::ifcRadius() const {return (mIfcRadius);}
253 inline double StTpcSimpleGeometry::ofcRadius() const {return (mOfcRadius);}
254 inline double StTpcSimpleGeometry::innerSectorzOffSet() const {return mInnerSectorzOffSet;}
255 inline double StTpcSimpleGeometry::outerSectorzOffSet() const {return mOuterSectorzOffSet;}
256 
257 // Wires
258 inline double StTpcSimpleGeometry::anodeWireRadius() const {return mAnodeWireRadius;}
259 inline double StTpcSimpleGeometry::frischGridWireRadius() const {return mFrischGridWireRadius;}
260 inline double StTpcSimpleGeometry::gateWireRadius() const {return mGateWireRadius;}
261 
262 inline double StTpcSimpleGeometry::anodeWirePitch() const {return mAnodeWirePitch;}
263 inline double StTpcSimpleGeometry::frischGridPitch() const {return mFrischGridWirePitch;}
264 inline double StTpcSimpleGeometry::gatePitch() const {return mGateWirePitch;}
265 
266 inline double StTpcSimpleGeometry::innerSectorAnodeWirePadPlaneSeparation() const {return mInnerSectorAnodeWirePadPlaneSeparation;}
267 inline double StTpcSimpleGeometry::innerSectorFrischGridPadPlaneSeparation() const {return mInnerSectorFrischGridPadPlaneSeparation;}
268 inline double StTpcSimpleGeometry::innerSectorGatingGridPadPlaneSeparation() const {return mInnerSectorGatingGridPadPlaneSeparation;}
269 inline double StTpcSimpleGeometry::outerSectorAnodeWirePadPlaneSeparation() const {return mOuterSectorAnodeWirePadPlaneSeparation;}
270 inline double StTpcSimpleGeometry::outerSectorFrischGridPadPlaneSeparation() const {return mOuterSectorFrischGridPadPlaneSeparation;}
271 inline double StTpcSimpleGeometry::outerSectorGatingGridPadPlaneSeparation() const {return mOuterSectorGatingGridPadPlaneSeparation;}
272 
273 
274 inline double StTpcSimpleGeometry::firstInnerSectorAnodeWire() const {return (mFirstInnerSectorAnodeWire);}
275 inline double StTpcSimpleGeometry::lastInnerSectorAnodeWire() const {return (mLastInnerSectorAnodeWire);}
276 inline int StTpcSimpleGeometry::numberOfInnerSectorAnodeWires() const {return (mNumberOfInnerSectorAnodeWires);}
277 
278 inline double StTpcSimpleGeometry::firstOuterSectorAnodeWire() const{ return (mFirstOuterSectorAnodeWire);}
279 inline double StTpcSimpleGeometry::lastOuterSectorAnodeWire() const{ return (mLastOuterSectorAnodeWire);}
280 inline int StTpcSimpleGeometry::numberOfOuterSectorAnodeWires() const { return (mNumberOfOuterSectorAnodeWires);}
281 
282 inline double StTpcSimpleGeometry::innerSectorEdge() const { return (mInnerSectorEdge);}
283 inline double StTpcSimpleGeometry::outerSectorEdge() const { return (mOuterSectorEdge);}
284 inline double StTpcSimpleGeometry::ioSectorSpacing() const { return (mIoSectorSpacing);}
285 #endif