StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StExtGeometry.h
1 
5 /***************************************************************************
6  *
7  * $Id: StExtGeometry.h,v 2.3 2017/05/04 00:56:18 perev Exp $
8  *
9  * Author: Victor Perevoztchikov, November 2016
10  ***************************************************************************
11  *
12  * Description:
13  *
14  ***************************************************************************
15  *
16  * $Id: StExtGeometry.h,v 2.3 2017/05/04 00:56:18 perev Exp $
17  **************************************************************************/
18 #ifndef StExtGeometry_hh
19 #define StExtGeometry_hh
20 
21 #include "StObject.h"
22 #include "StThreeVectorF.hh"
23 #include "StPhysicalHelixD.hh"
24 #include "THelixTrack.h"
25 
26 class StExtGeometry : public StObject {
27 public:
28  friend class StTrack;
29 
30  StExtGeometry(const char *name="");
31  virtual ~StExtGeometry();
32 
33  const char *name() const;
34  int charge() const; // synchro with StiTrackNode charge definition
35  double rxy() const;
36  double phi() const;
37  double z() const;
38  double curvature() const;
39  double psi() const;
40  double tanDip() const;
41  double pt() const;
42  double hz() const;
43  double length() const;
44  double curve() const;
45 
46  StThreeVectorF origin() const;
47  StThreeVectorF momentum() const;
48 
49  StPhysicalHelixD helix() const;
50  THelixTrack thelix() const;
51  const float* params() const;
52  const float* errMatrix() const;
53  //
54  // Experts only set function
55  //
56  void setName(const char *name);
57  void set(double rXY,const double pars[6], const double errs[15]);
58  void setLength(double len);
59  void setCurve (double cur);
60 
61  void add(StExtGeometry **top);
62  const StExtGeometry* next() const;
63 
65  enum {kPhi,kZ,kPsi,kPti,kTan,kCurv,kLen};
67  enum {kPhiPhi
68  ,kPhiZ, kZZ
69  ,kPhiPsi, kZPsi, kPsiPsi
70  ,kPhiPti, kZPti, kPsiPti, kPtiPti
71  ,kPhiTan, kZTan, kPsiTan, kPtiTan, kTanTan};
72 
73 protected:
74  char mName[8]; //Name of external detector
75  StExtGeometry *mNext;
76 
77  Float_t mRxy; // XY radius
78  Float_t mPhi; // Azimutal angle of point
79  Float_t mZ; // Z coord of point
80  Float_t mPsi; // Azimutal angle of track
81  Float_t mPti; // signed inverse pt [sign = sign(-qB)
82  Float_t mTan; // tangent of lambda(lambda ange bte track & xy plane
83  Float_t mCurv; // signed curvature [sign = sign(-qB)]
84  Float_t mLen; // total length of track to this point
85 
86  Float_t mG[15]; // Error matrix
87  char mEnd[1];
88 
89  ClassDef(StExtGeometry,2)
90 };
91 
92 inline const char* StExtGeometry::name() const {return mName;}
93 inline int StExtGeometry::charge() const {return (mPti>0)? -1:1;}
94 inline double StExtGeometry::rxy() const {return mRxy;}
95 inline double StExtGeometry::phi() const {return mPhi ;}
96 inline double StExtGeometry::z() const {return mZ ;}
97 inline double StExtGeometry::curvature() const {return mCurv;}
98 inline double StExtGeometry::psi() const {return mPsi ;}
99 inline double StExtGeometry::tanDip() const {return mTan ;}
100 inline double StExtGeometry::pt() const {return 1./fabs(mPti);}
101 inline double StExtGeometry::hz() const {return mCurv/mPti;}
102 inline double StExtGeometry::length() const {return mLen;}
103 inline double StExtGeometry::curve() const {return mCurv;}
104 inline const float* StExtGeometry::params() const {return &mPhi;}
105 inline const float* StExtGeometry::errMatrix() const {return mG;}
106 inline void StExtGeometry::setLength(double len){mLen = len;}
107 inline void StExtGeometry::setCurve (double cur){mCurv = cur;}
108 inline const StExtGeometry* StExtGeometry::next() const { return mNext;}
109 
110 #endif