CbmRoot
Loading...
Searching...
No Matches
CbmStsTrack.h
Go to the documentation of this file.
1/* Copyright (C) 2006-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese, Denis Bertini [committer], Evgeny Lavrik */
4
19#ifndef CBMSTSTRACK_H
20#define CBMSTSTRACK_H 1
21
22#include "CbmHit.h" // for kSTSHIT
23#include "CbmTrack.h" // for CbmTrack
24
25#include <Rtypes.h> // for ClassDef
26#include <RtypesCore.h> // for Double32_t
27
28#include <cassert> // for assert
29#include <cstdint>
30#include <string> // for string
31#include <vector> // for vector
32
42class CbmStsTrack : public CbmTrack {
43public:
46
47
49 virtual ~CbmStsTrack();
50
51
55 void AddMvdHit(int32_t hitIndex) { fMvdHitIndex.push_back(hitIndex); }
56
57
61 void AddStsHit(int32_t hitIndex) { AddHit(hitIndex, kSTSHIT); }
62
63
67 double GetB() const { return fB; }
68
69
75 int32_t GetMvdHitIndex(int32_t iHit) const { return fMvdHitIndex.at(iHit); }
76
77
81 virtual int32_t GetTotalNofHits() const { return (GetNofStsHits() + GetNofMvdHits()); }
82
83
87 int32_t GetNofMvdHits() const { return fMvdHitIndex.size(); }
88
89
93 int32_t GetNofStsHits() const { return CbmTrack::GetNofHits(); }
94
95
101 int32_t GetStsHitIndex(int32_t iHit) const
102 {
103 assert(iHit < GetNofStsHits());
104 return CbmTrack::GetHitIndex(iHit);
105 }
106
107
111 void SetB(double b) { fB = b; }
112
113
115 virtual std::string ToString() const;
116
117
121 float GetELoss() const { return fELoss; }
122
126 void SetELoss(float ELoss) { fELoss = ELoss; }
127
128 constexpr static float ELossOverflow() { return 1.e6; }
129
130private:
132 std::vector<int32_t> fMvdHitIndex;
133
134
136 Double32_t fB;
137
139 float fELoss {-1.f};
140
144
148
152 using CbmTrack::AddHit;
153
155};
156
157#endif
@ kSTSHIT
Definition CbmHit.h:25
virtual ~CbmStsTrack()
int32_t GetNofMvdHits() const
Definition CbmStsTrack.h:87
void AddMvdHit(int32_t hitIndex)
Definition CbmStsTrack.h:55
int32_t GetMvdHitIndex(int32_t iHit) const
Definition CbmStsTrack.h:75
ClassDef(CbmStsTrack, 3)
virtual std::string ToString() const
Double32_t fB
int32_t GetStsHitIndex(int32_t iHit) const
double GetB() const
Definition CbmStsTrack.h:67
virtual int32_t GetTotalNofHits() const
Definition CbmStsTrack.h:81
float GetELoss() const
void AddHit(int32_t index, HitType type)
Definition CbmTrack.cxx:97
void AddStsHit(int32_t hitIndex)
Definition CbmStsTrack.h:61
void SetB(double b)
void SetELoss(float ELoss)
std::vector< int32_t > fMvdHitIndex
static constexpr float ELossOverflow()
int32_t GetNofStsHits() const
Definition CbmStsTrack.h:93
void AddHit(int32_t index, HitType type)
Definition CbmTrack.cxx:97
virtual int32_t GetNofHits() const
Definition CbmTrack.h:58
int32_t GetHitIndex(int32_t iHit) const
Definition CbmTrack.h:59