CbmRoot
Loading...
Searching...
No Matches
HalCbmHbtTrack.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 "HalCbmHbtTrack.h"
5
6#include "HalCbmHbtEvent.h"
7#include "HalCbmTrack.h"
8
9#include <Hal/Event.h>
10
11
12HalCbmHbtTrack::HalCbmHbtTrack() : Hal::ExpTrack(), fHelix(CbmHelix()), fR(-1) {}
13
15
16HalCbmHbtTrack::HalCbmHbtTrack(const HalCbmHbtTrack& other) : Hal::ExpTrack(other)
17{
18 fHelix = other.fHelix;
19 fR = other.fR;
20 for (int i = 0; i < 9; i++) {
21 fPosAt[i] = other.fPosAt[i];
22 fMomAt[i] = other.fMomAt[i];
23 }
26}
27
29{
30 if (this == &other) return *this;
31 Hal::ExpTrack::operator=(other);
32 fHelix = other.fHelix;
33 fR = other.fR;
34 for (int i = 0; i < 9; i++) {
35 fPosAt[i] = other.fPosAt[i];
36 fMomAt[i] = other.fMomAt[i];
37 }
40 return *this;
41}
42
43void HalCbmHbtTrack::CopyData(Hal::Track* other)
44{
45 Hal::ExpTrack::CopyData(other);
46 fHelix = ((HalCbmTrack*) other)->GetHelix();
47 Double_t x = GetEvent()->GetVertex()->X();
48 Double_t y = GetEvent()->GetVertex()->Y();
49 Double_t z = GetEvent()->GetVertex()->Z();
50 const Double_t R[9] = {20, 30, 40, 50, 60, 70, 80, 90, 100};
51 for (int i = 0; i < 9; i++) {
52 fPosAt[i] = fHelix.Eval(R[i] + z, fMomAt[i]);
53 fPosAt[i] -= TVector3(x, y, z);
54 }
55 fR = -1;
56}
57
59{
60 if (fR == R) return;
61 Double_t x = GetEvent()->GetVertex()->X();
62 Double_t y = GetEvent()->GetVertex()->Y();
63 Double_t z = GetEvent()->GetVertex()->Z();
65 fPosAtCustom -= TVector3(x, y, z);
66 fR = R;
67}
Double_t X() const
Definition CbmHelix.h:27
TVector3 Eval(Double_t z)
Definition CbmHelix.cxx:31
TVector3 fPosAt[9]
CbmHelix & GetHelix()
TVector3 fMomAtCustom
virtual ~HalCbmHbtTrack()
TVector3 fMomAt[9]
TVector3 fPosAtCustom
HalCbmHbtTrack & operator=(const HalCbmHbtTrack &other)
void CalculateAtR(Double_t R)
virtual void CopyData(Hal::Track *other)