CbmRoot
Loading...
Searching...
No Matches
CbmTofTrack.h
Go to the documentation of this file.
1/* Copyright (C) 2013-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer], Andrey Lebedev, Florian Uhlig */
4
12#ifndef CBMTOFTRACK_H
13#define CBMTOFTRACK_H 1
14
15#include "CbmHit.h" // for kTOFHIT
16#include "CbmTrack.h" // for CbmTrack
17
18#include <Rtypes.h> // for ClassDef
19#include <RtypesCore.h> // for Double32_t
20
21#include <cassert> // for assert
22#include <cstdint>
23#include <string> // for string
24#include <vector> // for vector
25
33class CbmTofTrack : public CbmTrack {
34public:
37
38
40 virtual ~CbmTofTrack();
41
45 void AddTofHit(int32_t hitIndex) { AddHit(hitIndex, kTOFHIT); }
46
47
49 int32_t GetPidHypo() const { return fPidHypo; }
50
52 float GetMass() const { return fMass; }
53
55 int32_t GetTofHitIndex() const { return GetHitIndex(0); }
56
58 double GetTrackDx() const { return sqrt(fTrackPar.GetCovariance(1, 1)); }
59
61 double GetTrackDy() const { return sqrt(fTrackPar.GetCovariance(2, 2)); }
62
64 int32_t GetTrackIndex() const { return fGlbTrack; }
65
67 double GetTrackLength() const { return fTrackLength; }
68
70 const FairTrackParam* GetTrackParameter() const { return &fTrackPar; }
71
73 double GetTrackX() const { return fTrackPar.GetX(); }
74
76 double GetTrackY() const { return fTrackPar.GetY(); }
77
79 double GetDistance() const { return fDistance; }
80
82 void SetTrackIndex(int32_t trackIndex) { fGlbTrack = trackIndex; }
83
85 void SetTofHitIndex(int32_t tofHitIndex)
86 {
87 fHitIndex.clear();
88 fHitType.clear();
89 AddTofHit(tofHitIndex);
90 }
91
93 void SetTrackParameter(const FairTrackParam* par) { fTrackPar = *par; }
94
96 void SetTrackLength(double trackLength) { fTrackLength = trackLength; }
97
99 void SetPidHypo(int32_t pid) { fPidHypo = pid; }
100
102 void SetMass(float mass) { fMass = mass; }
103
105 void SetDistance(double distance) { fDistance = distance; }
106
107
111 int32_t GetNofTofHits() const { return CbmTrack::GetNofHits(); }
112
113
119 int32_t GetTofHitIndex(int32_t iHit) const
120 {
121 assert(iHit < GetNofTofHits());
122 return GetHitIndex(iHit);
123 }
124
126 virtual std::string ToString() const;
127
128
129private:
130 int32_t fGlbTrack;
132 FairTrackParam fTrackPar;
133 int32_t fPidHypo;
134 float fMass;
135 double fDistance = 0.;
136
137
139};
140
141#endif
@ kTOFHIT
Definition CbmHit.h:31
friend fvec sqrt(const fvec &a)
void SetTrackIndex(int32_t trackIndex)
Definition CbmTofTrack.h:82
double GetTrackY() const
Definition CbmTofTrack.h:76
virtual ~CbmTofTrack()
int32_t fGlbTrack
Index of global track.
double GetTrackDy() const
Definition CbmTofTrack.h:61
float GetMass() const
Definition CbmTofTrack.h:52
double GetTrackDx() const
Definition CbmTofTrack.h:58
int32_t GetTofHitIndex() const
Definition CbmTofTrack.h:55
double GetTrackLength() const
Definition CbmTofTrack.h:67
double GetDistance() const
Definition CbmTofTrack.h:79
void SetTofHitIndex(int32_t tofHitIndex)
Definition CbmTofTrack.h:85
int32_t GetPidHypo() const
Definition CbmTofTrack.h:49
void SetTrackParameter(const FairTrackParam *par)
Definition CbmTofTrack.h:93
void SetMass(float mass)
double fTrackLength
Track length from primary vertex to TOF [cm].
void SetTrackLength(double trackLength)
Definition CbmTofTrack.h:96
int32_t GetTofHitIndex(int32_t iHit) const
ClassDef(CbmTofTrack, 3)
int32_t GetTrackIndex() const
Definition CbmTofTrack.h:64
const FairTrackParam * GetTrackParameter() const
Definition CbmTofTrack.h:70
double fDistance
Normalized distance from hit to track.
int32_t GetNofTofHits() const
float fMass
Mass from Tof.
int32_t fPidHypo
PID hypothesis used for track extrapolation.
void SetPidHypo(int32_t pid)
Definition CbmTofTrack.h:99
void SetDistance(double distance)
FairTrackParam fTrackPar
Track parameters at z of TofHit.
virtual std::string ToString() const
double GetTrackX() const
Definition CbmTofTrack.h:73
void AddTofHit(int32_t hitIndex)
Definition CbmTofTrack.h:45
void AddHit(int32_t index, HitType type)
Definition CbmTrack.cxx:97
std::vector< int32_t > fHitIndex
Definition CbmTrack.h:102
virtual int32_t GetNofHits() const
Definition CbmTrack.h:58
int32_t GetHitIndex(int32_t iHit) const
Definition CbmTrack.h:59
std::vector< HitType > fHitType
Definition CbmTrack.h:105