FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairTrackPar.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 // -------------------------------------------------------------------------
9 // Created by M. Al-Turany 06.02.2007
10 // -------------------------------------------------------------------------
11 
12 #include "FairTrackPar.h"
13 #include <TGenericClassInfo.h> // for TGenericClassInfo
14 #include <TMath.h> // for Sqrt
15 #include <fairlogger/Logger.h> // for Logger, LOG
16 #include "FairField.h" // for FairField
17 #include "FairRunAna.h" // for FairRunAna
18 
19 using namespace std;
20 
22  : TObject()
23  , fX(0.)
24  , fY(0.)
25  , fZ(0.)
26  , fDX(0.)
27  , fDY(0.)
28  , fDZ(0.)
29  , fPx(0.)
30  , fPy(0.)
31  , fPz(0.)
32  , fDPx(0.)
33  , fDPy(0.)
34  , fDPz(0.)
35  , fQp(0.)
36  , fDQp(0.)
37  , fq(1)
38 {}
39 
40 FairTrackPar::FairTrackPar(Double_t x, Double_t y, Double_t z, Double_t px, Double_t py, Double_t pz, Int_t q)
41 
42  : TObject()
43  , fX(x)
44  , fY(y)
45  , fZ(z)
46  , fDX(x)
47  , fDY(y)
48  , fDZ(z)
49  , fPx(px)
50  , fPy(py)
51  , fPz(pz)
52  , fDPx(px)
53  , fDPy(py)
54  , fDPz(pz)
55  , fQp(0.)
56  , fDQp(0.)
57  , fq(q)
58 {
59 
60  Double_t p = TMath::Sqrt(fPx * fPx + fPy * fPy + fPz * fPz);
61  if (p != 0) {
62  fQp = q / p;
63  }
64 }
65 
67  Double_t y,
68  Double_t z,
69  Double_t dx,
70  Double_t dy,
71  Double_t dz,
72  Double_t px,
73  Double_t py,
74  Double_t pz,
75  Double_t dpx,
76  Double_t dpy,
77  Double_t dpz,
78  Int_t q)
79  : TObject()
80  , fX(x)
81  , fY(y)
82  , fZ(z)
83  , fDX(dx)
84  , fDY(dy)
85  , fDZ(dz)
86  , fPx(px)
87  , fPy(py)
88  , fPz(pz)
89  , fDPx(dpx)
90  , fDPy(dpy)
91  , fDPz(dpz)
92  , fQp(0.)
93  , fDQp(0.)
94  , fq(q)
95 {
96  Double_t p = TMath::Sqrt(fPx * fPx + fPy * fPy + fPz * fPz);
97  if (p != 0) {
98  fQp = q / p;
99  }
100 }
101 
103 
104 void FairTrackPar::Print(Option_t* /*option*/) const
105 {
106  LOG(info) << "Position :(" << fX << "," << fY << "," << fZ << ")";
107  LOG(info) << "Momentum :(" << fPx << "," << fPy << "," << fPz << ")";
108 }
109 
110 void FairTrackPar::GetFieldValue(const Double_t point[3], Double_t* bField)
111 {
113  if (fRun->GetField() != 0)
114  fRun->GetField()->GetFieldValue(point, bField);
115  else {
116  bField[0] = .0;
117  bField[1] = .0;
118  bField[2] = .0;
119  }
120 }
121 
virtual void Print(Option_t *option="") const
Double_t fQp
Definition: FairTrackPar.h:124
Double_t fPz
Definition: FairTrackPar.h:118
virtual void GetFieldValue(const Double_t point[3], Double_t *bField)
Double_t fY
Definition: FairTrackPar.h:112
ClassImp(FairEventBuilder)
Double_t fZ
Double_t fZ
Definition: FairTrackPar.h:112
Double_t fX
Definition: FairTrackPar.h:112
FairBoxSet * fq
Double_t fPx
Definition: FairTrackPar.h:118
static FairRunAna * Instance()
Definition: FairRunAna.cxx:61
Double_t fY
virtual ~FairTrackPar()
Double_t fPy
Definition: FairTrackPar.h:118
virtual void GetFieldValue(const Double_t point[3], Double_t *bField)
Definition: FairField.cxx:44
Double_t fX
FairField * GetField()
Definition: FairRunAna.h:78