EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairTrackPar.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairTrackPar.cxx
1 // -------------------------------------------------------------------------
2 // Created by M. Al-Turany 06.02.2007
3 // -------------------------------------------------------------------------
4 
5 #include "FairTrackPar.h"
6 #include "TMath.h"
7 #include "FairLogger.h"
8 
9 using namespace std;
10 
11 // ----- Default constructor -------------------------------------------
13  : TObject(),
14  fX (0.),
15  fY (0.),
16  fZ (0.),
17  fDX (0.),
18  fDY (0.),
19  fDZ (0.),
20  fPx (0.),
21  fPy (0.),
22  fPz (0.),
23  fDPx (0.),
24  fDPy (0.),
25  fDPz (0.),
26  fQp (0.),
27  fDQp (0.),
28  fq (1),
29  fLogger(FairLogger::GetLogger())
30 {
31 
32 
33 }
34 // -------------------------------------------------------------------------
35 
36 // ----- Constructor with parameters -----------------------------------
37 FairTrackPar::FairTrackPar(Double_t x, Double_t y, Double_t z,
38  Double_t px, Double_t py, Double_t pz, Int_t q)
39 
40  : TObject(),
41  fX (x),
42  fY (y),
43  fZ (z),
44  fDX (x),
45  fDY (y),
46  fDZ (z),
47  fPx (px),
48  fPy (py),
49  fPz (pz),
50  fDPx (px),
51  fDPy (py),
52  fDPz (pz),
53  fQp (0.),
54  fDQp (0.),
55  fq (q),
56  fLogger(FairLogger::GetLogger())
57 {
58 
59  Double_t p=TMath::Sqrt(fPx*fPx +fPy*fPy +fPz*fPz );
60  if (p!=0) { fQp = q/p; }
61 
62 
63 }
64 // -------------------------------------------------------------------------
65 
66 // ----- Destructor ----------------------------------------------------
68 // -------------------------------------------------------------------------
69 
70 // ----- Public method Print -------------------------------------------
71 void FairTrackPar::Print(Option_t* option) const
72 {
73  fLogger->Info(MESSAGE_ORIGIN,"Position :(%f,%f,%f)",fX,fY,fZ);
74  fLogger->Info(MESSAGE_ORIGIN,"Momentum :(%f,%f,%f)",fPx,fPy,fPz);
75 }
76 
78 
79 
80 
81 
82 
83