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