CbmRoot
Loading...
Searching...
No Matches
HalCbmTrack.cxx
Go to the documentation of this file.
1/* Copyright (C) 2023-2023 Warsaw University of Technology, Warsaw
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Daniel Wielanek [committer] */
4#include "HalCbmTrack.h"
5
6#include "CbmHelix.h"
7#include "HalCbmDetectorID.h"
9
10#include <Hal/DataFormat.h>
11#include <Hal/Event.h>
12#include <Hal/ExpEvent.h>
13#include <Hal/Track.h>
14
16 : fTofTrack(new Hal::ToFTrack())
17 , fHelix()
18 , fChi2Vertex(0)
19 , fMvdHits(0)
20 , fStsHits(0)
21 , fTrdHits(0)
22{
23}
24
25Hal::DetectorTrack* HalCbmTrack::GetDetTrack(const UInt_t detID) const
26{
27 if (detID == HalCbm::DetectorID::kTOF) {
28 return fTofTrack;
29 }
30 return nullptr;
31}
32
33HalCbmTrack::HalCbmTrack(const HalCbmTrack& other) : Hal::ExpTrack(other)
34{
35 fTofTrack = new Hal::ToFTrack(*other.fTofTrack);
36 fHelix = other.fHelix;
38 fMvdHits = other.fMvdHits;
39 fStsHits = other.fStsHits;
40 fTrdHits = other.fTrdHits;
41}
42
44{
45 if (this == &other) return *this;
46 Hal::ExpTrack::operator=(other);
47 *fTofTrack = *other.fTofTrack;
48 fHelix = other.fHelix;
50 fMvdHits = other.fMvdHits;
51 fStsHits = other.fStsHits;
52 fTrdHits = other.fTrdHits;
53 return *this;
54}
55
57{
58 TVector3 mom(GetPx(), GetPy(), GetPz());
59 TVector3 pos(GetDCA().X() + GetEvent()->GetVertex()->X(), GetDCA().Y() + GetEvent()->GetVertex()->Y(),
60 GetDCA().Z() + GetEvent()->GetVertex()->Z());
61 fHelix.Build(pos, mom, GetCharge());
62}
63
65
66void HalCbmTrack::CopyData(Hal::Track* other)
67{
68 Hal::ExpTrack::CopyData(other);
69 fTofTrack = (static_cast<HalCbmTrack*>(other))->fTofTrack;
70 fHelix = (static_cast<HalCbmTrack*>(other))->fHelix;
71 fChi2Vertex = (static_cast<HalCbmTrack*>(other))->fChi2Vertex;
72 fMvdHits = (static_cast<HalCbmTrack*>(other))->fMvdHits;
73 fStsHits = (static_cast<HalCbmTrack*>(other))->fStsHits;
74 fTrdHits = (static_cast<HalCbmTrack*>(other))->fTrdHits;
75}
void Build(const FairTrackParam *params)
Definition CbmHelix.h:44
virtual ~HalCbmTrack()
CbmHelix fHelix
Definition HalCbmTrack.h:27
Float_t fChi2Vertex
Definition HalCbmTrack.h:28
HalCbmTrack & operator=(const HalCbmTrack &other)
Int_t fTrdHits
Definition HalCbmTrack.h:31
virtual Hal::DetectorTrack * GetDetTrack(const UInt_t detID) const
Int_t fMvdHits
Definition HalCbmTrack.h:29
virtual void CopyData(Hal::Track *other)
void BuildHelix()
Int_t fStsHits
Definition HalCbmTrack.h:30
Hal::ToFTrack * fTofTrack
Definition HalCbmTrack.h:26