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