StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TrackT.h
1 #ifndef __TRACK__
2 #define __TRACK__
3 #define NSP 1000
4 // ROOT headers
5 #include "TObject.h"
6 #include "TMath.h"
7 
8 // StRoot headers
9 #include "HitT.h"
10 
11 // C++ headers
12 #include <string>
13 
14 //________________
15 class TrackT : public TObject {
16 
17  private:
18  Char_t beg;
19  Double32_t fInvpT; //signed
20  Double32_t fTanL;
21  Double32_t fPhi;
22  Double32_t fRho;
23 #ifdef __USE_GLOBAL__
24  Double32_t fInvpTGl; //signed
25  Double32_t fTanLGl;
26  Double32_t fPhiGl;
27  Double32_t fRhoGl;
28 #endif
29  UInt_t fNpoint; //Number of fitted points for this track
30  UInt_t fNPpoint; //Number of possible points for this track
31  Short_t fValid; //Validity criterion
32  UInt_t fNsp; //Number of points for this track with a special value
33  UInt_t fIdHitT[NSP]; //Index of HitT in fHitT array
34  Double32_t fdEdx;
35  Double32_t fLength;
36  Char_t end;
37  public:
38  TrackT() { Clear(); }
39  virtual ~TrackT() {Clear();}
40  void Clear(Option_t *option="") {if (option); memset(&beg, 0, &end - &beg);}
41  Double32_t GetpX() { return GetpT()*TMath::Cos(fPhi);}
42  Double32_t GetpY() { return GetpT()*TMath::Sin(fPhi);}
43  Double32_t GetpZ() { return GetpT()*fTanL;}
44  Double32_t GetInvpT() { return fInvpT;}
45  Double32_t GetTanL() { return fTanL;}
46  Double32_t GetDip() { return TMath::ATan(fTanL);}
47  Double32_t GetPhi() { return fPhi;}
48  Double32_t GetRho() { return fRho;}
49  Double32_t GetpT() { return TMath::Abs(fInvpT) > 1.e-7 ? 1./TMath::Abs(fInvpT): 1e7; }
50  Double32_t GetMomentum(){ return GetpT()*TMath::Sqrt(1. + fTanL*fTanL);}
51  UInt_t GetNpoint() { return fNpoint; }
52  UInt_t GetNPpoint() { return fNPpoint; }
53  Short_t GetCharge() { return (Short_t) TMath::Sign(1., fInvpT); }
54  Short_t GetValid() { return fValid; }
55  UInt_t GetN() { return fNsp; }
56  const UInt_t *GetIndx() const { return fIdHitT;}
57  Int_t GetHitTId(UInt_t i=0) {return i < fNsp ? ((Int_t) fIdHitT[i])-1 : -1;}
58  Double32_t GetdEdx() {return fdEdx;}
59  Double32_t GetLegth() {return fLength;}
60  virtual void SetInvpT(Double32_t p) {fInvpT = p; }
61  virtual void SetDip(Double32_t p) {fTanL = TMath::Tan(p); }
62  virtual void SetTanL(Double32_t p) {fTanL = p; }
63  virtual void SetPhi(Double32_t p) {fPhi = p; }
64  virtual void SetRho(Double32_t p) {fRho = p; }
65 #ifdef __USE_GLOBAL__
66 
67  virtual void SetInvpTGl(Double32_t p) {fInvpTGl = p; }
68  virtual void SetDipGl(Double32_t p) {fTanLGl = TMath::Tan(p); }
69  virtual void SetTanLGl(Double32_t p) {fTanLGl = p; }
70  virtual void SetPhiGl(Double32_t p) {fPhiGl = p; }
71  virtual void SetRhoGl(Double32_t p) {fRhoGl = p; }
72 #endif
73  virtual void SetNpoint(UInt_t p) {fNpoint = p; }
74  virtual void SetNPpoint(UInt_t p) {fNPpoint = p; }
75  virtual void SetValid(Short_t p=1) {fValid = p; }
76  virtual void SetLength(Double_t L) {fLength = L;}
77  virtual void SetN(UInt_t n) {if (n <= NSP) fNsp = n; else fNsp = NSP;}
78  virtual void SetHitTId(UInt_t i) {fIdHitT[fNsp] = i+1; if ( fNsp < NSP) fNsp++;}
79  virtual void SetdEdx(Double_t I70, Double_t L) {fdEdx = I70; fLength = L;}
80  virtual void Print(Option_t *opt="") const;
81 
82  ClassDef(TrackT, 1)
83 };
84 #endif
Definition: TrackT.h:15