CbmRoot
NicaCbmGlobalTrack.cxx
Go to the documentation of this file.
1 /*
2  * NicaCbmTrack.cxx
3  *
4  * Created on: 3 gru 2018
5  * Author: Daniel Wielanek
6  * E-mail: daniel.wielanek@gmail.com
7  * Warsaw University of Technology, Faculty of Physics
8  */
9 #include "NicaCbmGlobalTrack.h"
11 #include "NicaExpEvent.h"
12 
14  : fFirstPoint(new TVector3(0, 0, 0)), fLastPoint(new TVector3(0, 0, 0)) {}
15 
17  : NicaExpTrack(other) {
18  fFirstPoint = new TVector3(*other.fFirstPoint);
19  fLastPoint = new TVector3(*other.fLastPoint);
20  fHelix = other.fHelix;
21 }
22 
25  if (this == &other) return *this;
26  NicaExpTrack::operator=(other);
27  *fFirstPoint = *other.fFirstPoint;
28  *fLastPoint = *other.fLastPoint;
29  fHelix = other.fHelix;
30  return *this;
31 }
32 
34  NicaCbmGlobalEventInterface* /*interface*/) {
35  SetChi2(track->GetChi2());
36  SetTrackLenght(track->GetLength());
37  const FairTrackParam* par = track->GetParamFirst();
38  fFirstPoint->SetXYZ(par->GetX(), par->GetY(), par->GetZ());
39  const FairTrackParam* par2 = track->GetParamLast();
40  fLastPoint->SetXYZ(par2->GetX(), par2->GetY(), par2->GetZ());
41  const CbmTrackParam* track_param = track->GetParamVertex();
42  GetMomentum()->SetXYZM(
43  track_param->GetPx(), track_param->GetPy(), track_param->GetPz(), 0);
44 
45  const NicaExpEvent* ev = (NicaExpEvent*) GetEvent();
46  fHelix.Build(track);
47  GetDCA()->SetXYZ(track_param->GetX() - ev->GetVertex()->X(),
48  track_param->GetY() - ev->GetVertex()->Y(),
49  track_param->GetZ() - ev->GetVertex()->Z());
50  Double_t qp = track_param->GetQp();
51  if (qp > 0)
52  SetCharge(1);
53  else
54  SetCharge(-1);
55 }
56 
57 void NicaCbmGlobalTrack::CopyData(NicaTrack* other) {
58  NicaExpTrack::CopyData(other);
59  NicaCbmGlobalTrack* track = (NicaCbmGlobalTrack*) other;
60  *fFirstPoint = *track->fFirstPoint;
61  *fLastPoint = *track->fLastPoint;
62  fHelix = track->fHelix;
63 }
64 
66  delete fFirstPoint;
67  delete fLastPoint;
68 }
NicaCbmGlobalTrack::fLastPoint
TVector3 * fLastPoint
Definition: NicaCbmGlobalTrack.h:20
NicaCbmGlobalTrack::fFirstPoint
TVector3 * fFirstPoint
Definition: NicaCbmGlobalTrack.h:20
CbmTrackParam::GetPx
Double_t GetPx() const
Definition: CbmTrackParam.h:39
NicaCbmGlobalTrack::fHelix
CbmHelix fHelix
Definition: NicaCbmGlobalTrack.h:21
NicaCbmGlobalEventInterface.h
CbmGlobalTrack::GetParamLast
const FairTrackParam * GetParamLast() const
Definition: CbmGlobalTrack.h:44
NicaCbmGlobalTrack.h
NicaCbmGlobalTrack::operator=
NicaCbmGlobalTrack & operator=(const NicaCbmGlobalTrack &other)
Definition: NicaCbmGlobalTrack.cxx:24
CbmGlobalTrack::GetLength
Double_t GetLength() const
Definition: CbmGlobalTrack.h:50
CbmGlobalTrack::GetChi2
Double_t GetChi2() const
Definition: CbmGlobalTrack.h:47
CbmHelix::Build
void Build(const FairTrackParam *params)
Definition: CbmHelix.h:49
CbmGlobalTrack::GetParamVertex
const CbmTrackParam * GetParamVertex() const
Definition: CbmGlobalTrack.h:45
NicaCbmGlobalEventInterface
Definition: NicaCbmGlobalEventInterface.h:19
NicaCbmGlobalTrack
Definition: NicaCbmGlobalTrack.h:19
NicaCbmGlobalTrack::NicaCbmGlobalTrack
NicaCbmGlobalTrack()
Definition: NicaCbmGlobalTrack.cxx:13
CbmTrackParam::GetPy
Double_t GetPy() const
Definition: CbmTrackParam.h:40
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
CbmTrackParam
Definition: CbmTrackParam.h:22
NicaCbmGlobalTrack::~NicaCbmGlobalTrack
virtual ~NicaCbmGlobalTrack()
Definition: NicaCbmGlobalTrack.cxx:65
CbmTrackParam::GetPz
Double_t GetPz() const
Definition: CbmTrackParam.h:41
CbmGlobalTrack::GetParamFirst
const FairTrackParam * GetParamFirst() const
Definition: CbmGlobalTrack.h:43
NicaCbmGlobalTrack::Update
virtual void Update(CbmGlobalTrack *track, NicaCbmGlobalEventInterface *interface)
Definition: NicaCbmGlobalTrack.cxx:33
NicaCbmGlobalTrack::CopyData
void CopyData(NicaTrack *other)
Definition: NicaCbmGlobalTrack.cxx:57