44 #ifndef STTOFGEOMETRY_H
45 #define STTOFGEOMETRY_H
46 #include "tofSlatGeom.h"
48 #include "StHelixD.hh"
51 #ifndef ST_NO_NAMESPACES
56 #include "StThreeVectorD.hh"
57 #include "StPhysicalHelixD.hh"
82 int i_eta_max,i_eta_min;
83 int i_phi_max,i_phi_min;
84 int n_counter_eta, n_counter_phi;
85 int n_tray_eta, n_tray_phi;
86 float counter_thickness, counter_width;
88 float tray_height, tray_width, tray_length, tray_phi_zero;
91 #ifndef ST_NO_TEMPLATE_DEF_ARGS
92 typedef vector<Int_t> idVector;
93 typedef idVector::iterator idVectorIter;
95 typedef vector<Int_t,allocator<Int_t> > idVector;
96 typedef idVector::iterator idVectorIter;
108 vector<StThreeVector<double> > layerHitPositions;
113 #ifndef ST_NO_TEMPLATE_DEF_ARGS
114 typedef vector<tofSlatGeom_st> slatGeomVector;
115 typedef vector<StructTofSlatEta> tofSlatEtaVector;
116 typedef vector<StructTofSlatPhi> tofSlatPhiVector;
117 typedef vector<StructSlatHit> tofSlatHitVector;
119 typedef vector<tofSlatGeom_st,allocator<tofSlatGeom_st> > slatGeomVector;
120 typedef vector<StructTofSlatEta,allocator<StructTofSlatEta> > tofSlatEtaVector;
121 typedef vector<StructTofSlatPhi,allocator<StructTofSlatPhi> > tofSlatPhiVector;
122 typedef vector<SructSlatHit,allocator<StructSlatHit> > tofSlatHitVector;
124 typedef slatGeomVector::iterator slatGeomIter;
125 typedef vector<StructSlatHit>::iterator tofSlatHitVectorIter;
132 tofSlatEtaVector mTofSlatEtaVec;
133 tofSlatPhiVector mTofSlatPhiVec;
134 slatGeomVector mTofSlatVec;
135 unsigned short mTofDaqMap[48];
136 unsigned short mTofSlatMap[42];
138 int calcSlatId(
const int iphi,
const int ieta)
const;
148 "/afs/rhic.bnl.gov/star/users/geurts/public/dbase/ctg_pars.xdf");
154 tofSlatGeom_st
tofSlat(
const Int_t slatId)
const;
163 void printGeo(ostream& os = cout)
const;
164 void printSlat(
const Int_t slatId, ostream& os = cout)
const;
171 static const unsigned int mMaxSlatLayers;
177 unsigned short daqToSlatId(
const int)
const;
178 int slatIdToDaq(
const Int_t)
const;
182 Bool_t projTrayVector(
const StHelixD &helix, idVector &trayVec)
const;
187 const {
return mTofParam;}
188 inline unsigned short StTofGeometry::daqToSlatId(
const int daqId)
189 const {
return mTofDaqMap[daqId];}
190 inline int StTofGeometry::slatIdToDaq(
const Int_t slatId)
191 const {
return mTofSlatMap[slatId];}
192 inline void StTofGeometry::SetDebug(){mDebug =
true;}
193 inline bool StTofGeometry::Debug(){
return mDebug;}
195 const unsigned int StTofGeometry::mMaxSlatLayers(5);
tofSlatGeom_st tofSlat(const Int_t slatId) const
return slat geometry structure for slatId
idVector slatNeighbours(const int)
returns idVector of 3x3 (max) neighbouring slatIds
void printGeo(ostream &os=cout) const
print global geometry parameters
idVector slatNeighboursWide(const int)
returns idVector of 5x5 (max) neighbouring slatIds
void initDaqMap()
set-up the default Daq-to-SlatId and Slat-to-DaqId mappings
void initGeomFromXdf(const Char_t *="/afs/rhic.bnl.gov/star/users/geurts/public/dbase/ctg_pars.xdf")
initialize TOF Slat parameters from XDF file
tofSlatHitVector tofHelixToArray(const StPhysicalHelixD &helix, idVector slatIdVec)
finds slats in an array of trays which are crossed by a track-helix.
float slatPhiPosition(StThreeVectorD *)
returns the local Phi angle of a track inside a slat
Time-of-Flight Geometry Utilities.
float slatHitPosition(StThreeVectorD *)
returns 1-D hit position on the TOFp slat (Zhit)
StThreeVectorD tofSlatNormPoint(const Int_t slatId) const
calculate the normal vector <r> to a slat
~StTofGeometry()
default empty destructor
StThreeVectorD tofPlaneNormPoint(const Int_t slatId) const
calculate the normal vector to a slats-plane
int tofSlatCross(const StThreeVectorD &point, const tofSlatGeom_st tofSlat) const
check if a point is in a slat
void printSlat(const Int_t slatId, ostream &os=cout) const
print slat-specific geometry parameters
int tofSlatCrossId(const StThreeVectorD &point) const
return the index of a slat if the point is in the slat
void initGeomFromDbase(StMaker *)
initialize TOF Slat parameters from STAR dBase
StTofGeometry()
defaulty constructor
void init()
initialize geometry class from XDF file and set-up DAQ/Slat mappings