BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnTrack.h
Go to the documentation of this file.
1/*
2 * Base class to store BMN tracks
3 * Author: Sergei Merts
4 */
5
6#ifndef BMNTRACK_H
7#define BMNTRACK_H
8
9#include "FairHit.h"
10#include "FairTrackParam.h"
11#include "TArrayI.h"
12#include "TObject.h"
13
14#include <TClonesArray.h>
15#include <map>
16
17using namespace std;
18
19class BmnTrack : public TObject
20{
21 public:
22 /** Default constructor **/
24
25 /** Destructor **/
26 virtual ~BmnTrack();
27
28 /** Associate a FairHit to the track **/
29 void AddHit(Int_t hitIndex, FairHit* Hit);
30
31 /** Public method Print
32 ** Output to screen
33 **/
34 void Print();
35
36 /** Public method SortHits
37 ** Sorts the hits in downstream direction
38 ** and writes the hit indices into the member fHits
39 **/
40 void SortHits();
42 {
43 fHitMap.clear();
44 fNhits = 0;
45 };
46
47 /** Accessors **/
48
49 Int_t GetNHits() const { return fNhits; }
50
51 Int_t GetHitIndex(Int_t iHit) const { return fHits.At(iHit); }
52
53 Int_t GetFlag() const { return fFlag; }
54
55 Float_t GetChi2() const { return fChi2; }
56
57 Int_t GetNDF() const { return fNDF; }
58
59 Float_t GetB() const { return fB; }
60
61 Float_t GetLength() const { return fLength; }
62
63 FairTrackParam* GetParamFirst() { return &fParamFirst; }
64
65 FairTrackParam* GetParamLast() { return &fParamLast; }
66
67 Double_t GetP() { return 1.0 / fParamFirst.GetQp(); }
68
69 /** Modifiers **/
70 void SetParamFirst(FairTrackParam& par) { fParamFirst = par; }
71
72 void SetParamLast(FairTrackParam& par) { fParamLast = par; }
73
74 void SetFlag(Int_t flag) { fFlag = flag; }
75
76 void SetChi2(Double_t chi2) { fChi2 = chi2; }
77
78 void SetNDF(Int_t ndf) { fNDF = ndf; }
79
80 void SetNHits(Int_t n) { fNhits = n; }
81
82 void SetB(Double_t b) { fB = b; }
83
84 void SetLength(Double_t length) { fLength = length; }
85
86 Bool_t IsUsed() { return fUsing; }
87
88 void SetUsing(Bool_t flag) { fUsing = flag; }
89
90 private:
91 /** Array containing the indices of the STS hits attached to the track **/
93
94 /** Track parameters at first and last fitted hit **/
95 FairTrackParam fParamFirst;
96 FairTrackParam fParamLast;
97
98 /** Quality flag **/
99 Int_t fFlag; // 13 for tracks not used in vertex finder
100
101 /** Chi square and NDF of track fit **/
103 Int_t fNDF;
104
105 /** Impact parameter of track at target z, in units of its error **/
106 Float_t fB;
107
108 /** Track length **/
110
111 /** Number of hits on track **/
113
114 /** Maps from hit z position to hit index. STL map is used because it
115 ** is automatically sorted. Temporary only; not for storage.
116 ** The Hit index arrays will be filled by the method SortHits.
117 **/
118 map<Float_t, Int_t> fHitMap; //!
119
121
122 ClassDef(BmnTrack, 2);
123};
124
125#endif /* BMNTRACK_H */
bool Bool_t
int Int_t
float Float_t
double Double_t
#define ClassDef(name, id)
BmnTrack()
Default constructor.
Int_t GetNDF() const
Definition BmnTrack.h:57
void SetChi2(Double_t chi2)
Definition BmnTrack.h:76
Float_t GetLength() const
Definition BmnTrack.h:61
void SetParamLast(FairTrackParam &par)
Definition BmnTrack.h:72
void Print()
Public method Print Output to screen.
void SetFlag(Int_t flag)
Definition BmnTrack.h:74
FairTrackParam fParamFirst
Track parameters at first and last fitted hit.
Definition BmnTrack.h:95
FairTrackParam * GetParamFirst()
Definition BmnTrack.h:63
Float_t GetChi2() const
Definition BmnTrack.h:55
TArrayI fHits
Array containing the indices of the STS hits attached to the track.
Definition BmnTrack.h:92
Int_t GetNHits() const
Accessors.
Definition BmnTrack.h:49
Int_t fNDF
Definition BmnTrack.h:103
Int_t GetHitIndex(Int_t iHit) const
Definition BmnTrack.h:51
Bool_t IsUsed()
Definition BmnTrack.h:86
Float_t fB
Impact parameter of track at target z, in units of its error.
Definition BmnTrack.h:106
void AddHit(Int_t hitIndex, FairHit *Hit)
Associate a FairHit to the track.
void DeleteHits()
Definition BmnTrack.h:41
Float_t GetB() const
Definition BmnTrack.h:59
Int_t fNhits
Number of hits on track.
Definition BmnTrack.h:112
Double_t GetP()
Definition BmnTrack.h:67
virtual ~BmnTrack()
Destructor.
void SetNHits(Int_t n)
Definition BmnTrack.h:80
void SetUsing(Bool_t flag)
Definition BmnTrack.h:88
FairTrackParam fParamLast
Definition BmnTrack.h:96
void SetB(Double_t b)
Definition BmnTrack.h:82
void SetParamFirst(FairTrackParam &par)
Modifiers.
Definition BmnTrack.h:70
FairTrackParam * GetParamLast()
Definition BmnTrack.h:65
Int_t fFlag
Quality flag.
Definition BmnTrack.h:99
void SetLength(Double_t length)
Definition BmnTrack.h:84
Float_t fLength
Track length.
Definition BmnTrack.h:109
map< Float_t, Int_t > fHitMap
Maps from hit z position to hit index.
Definition BmnTrack.h:118
Int_t GetFlag() const
Definition BmnTrack.h:53
Float_t fChi2
Chi square and NDF of track fit.
Definition BmnTrack.h:102
Bool_t fUsing
Definition BmnTrack.h:120
void SortHits()
Public method SortHits Sorts the hits in downstream direction and writes the hit indices into the mem...
void SetNDF(Int_t ndf)
Definition BmnTrack.h:78
*brief user defined string literal for JSON values *sa std::size_t n
Definition json.hpp:20362
Definition json.hpp:4446