Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaTrackInfo.h
Go to the documentation of this file.
1#ifndef Podd_THaTrackInfo_h_
2#define Podd_THaTrackInfo_h_
3
5//
6// THaTrackInfo
7//
9
10#include "TVector3.h"
11#include "DataType.h" // for kBig
12
13class THaTrack;
14class THaSpectrometer;
15
17public:
20
22 Double_t ph, Double_t px, Double_t py, Double_t pz ) :
23 fP(p), fDp(dp), fX(x), fY(y), fTheta(th), fPhi(ph), fOK(1), fSpectro(nullptr)
24 { fPvect.SetXYZ(px,py,pz); }
25
27 Double_t ph, const TVector3& pvect ) :
28 fP(p), fDp(dp), fX(x), fY(y), fTheta(th), fPhi(ph), fPvect(pvect), fOK(1),
29 fSpectro(nullptr)
30 {}
31
32 THaTrackInfo( const THaTrackInfo& t ) = default;
35 virtual ~THaTrackInfo() = default;
36
37 void Clear( Option_t* opt="" );
38
39 Bool_t IsOK() const { return fOK; }
40 Double_t GetPx() const { return fPvect.X(); }
41 Double_t GetPy() const { return fPvect.Y(); }
42 Double_t GetPz() const { return fPvect.Z(); }
43
44 Double_t GetP() const { return fP; }
45 Double_t GetDp() const { return fDp; }
46 Double_t GetX() const { return fX; }
47 Double_t GetY() const { return fY; }
48 Double_t GetTheta() const { return fTheta; }
49 Double_t GetPhi() const { return fPhi; }
50 const TVector3& GetPvect() const { return fPvect; }
51
53
55 Double_t ph, Double_t px, Double_t py, Double_t pz )
56 {
57 fP = p; fDp = dp; fX = x; fY = y; fTheta = th; fPhi = ph;
58 fPvect.SetXYZ(px,py,pz); fOK = 1;
59 }
61 Double_t ph, const TVector3& pvect )
62 {
63 fP = p; fDp = dp; fX = x; fY = y; fTheta = th; fPhi = ph; fPvect = pvect;
64 fOK = 1;
65 }
66 void SetP( Double_t p );
68
69protected:
70 Double_t fP; // Track momentum (GeV)
71 Double_t fDp; // TRANSPORT delta
72 Double_t fX; // TRANSPORT x at target (m)
73 Double_t fY; // TRANSPORT y at target (m)
74 Double_t fTheta; // Tangent of TRANSPORT theta at target
75 Double_t fPhi; // Tangent of TRANSPORT phi at target
76 TVector3 fPvect; // Momentum vector in lab (GeV)
77 Int_t fOK; // Data ok (0:no 1:yes)
78
80
81 ClassDef(THaTrackInfo,1) // Track information
82};
83
84//_____________________________________________________________________________
85inline
87{
89 fOK = 0;
90}
91
92//_____________________________________________________________________________
93inline
95{
96 // Set momentum to new value. Changes p, dp, and pvect
97
98 Double_t p0 = fP / (1.0+fDp);
99 fP = p;
100 fPvect.SetMag(p);
101 if( p0 != 0.0 )
102 fDp = fP/p0 - 1.0;
103}
104
105#endif
106
int Int_t
const Data_t kBig
Definition DataType.h:15
bool Bool_t
double Double_t
const char Option_t
#define ClassDef(name, id)
winID h TVirtualViewer3D TVirtualGLPainter p
THaTrackInfo(const THaTrackInfo &t)=default
virtual ~THaTrackInfo()=default
THaSpectrometer * GetSpectrometer() const
Double_t fP
Double_t fPhi
Double_t GetY() const
Double_t GetX() const
Double_t fDp
Double_t GetPx() const
THaTrackInfo(Double_t p, Double_t dp, Double_t x, Double_t y, Double_t th, Double_t ph, Double_t px, Double_t py, Double_t pz)
THaTrackInfo & operator=(const THaTrackInfo &)
THaSpectrometer * fSpectro
Double_t GetPz() const
void SetSpectrometer(THaSpectrometer *s)
void SetP(Double_t p)
Double_t GetPy() const
Double_t GetTheta() const
Double_t GetP() const
void Set(Double_t p, Double_t dp, Double_t x, Double_t y, Double_t th, Double_t ph, Double_t px, Double_t py, Double_t pz)
const TVector3 & GetPvect() const
TVector3 fPvect
Double_t GetDp() const
Double_t fY
void Set(Double_t p, Double_t dp, Double_t x, Double_t y, Double_t th, Double_t ph, const TVector3 &pvect)
Double_t GetPhi() const
void Clear(Option_t *opt="")
Bool_t IsOK() const
Double_t fTheta
THaTrackInfo(Double_t p, Double_t dp, Double_t x, Double_t y, Double_t th, Double_t ph, const TVector3 &pvect)
Double_t fX
Double_t Z() const
void SetXYZ(Double_t x, Double_t y, Double_t z)
Double_t Y() const
Double_t X() const
void SetMag(Double_t)
Double_t y[n]
Double_t x[n]