CbmRoot
Loading...
Searching...
No Matches
LitScalTrack.h
Go to the documentation of this file.
1/* Copyright (C) 2009-2014 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Andrey Lebedev [committer] */
4
12#ifndef LITSCALTRACK_H_
13#define LITSCALTRACK_H_
14
15#include "LitScalPixelHit.h"
16#include "LitTrackParam.h"
17
18#include <sstream>
19#include <string>
20#include <vector>
21
22using std::string;
23using std::stringstream;
24using std::vector;
25
26namespace lit
27{
28 namespace parallel
29 {
30
41 public:
46 : fHits()
47 , fParamFirst()
48 , fParamLast()
49 , fChiSq(0.)
50 , fNDF(1)
54 , fIsGood(true)
55 {
56 fHits.reserve(30);
57 }
58
62 virtual ~LitScalTrack() {}
63
68 void AddHit(const LitScalPixelHit* hit) { fHits.push_back(hit); }
69
74 unsigned short GetNofHits() const { return fHits.size(); }
75
83 void SetNofHits(unsigned short nofHits) { return fHits.resize(nofHits); }
84
90 const LitScalPixelHit* GetHit(unsigned short index) const { return fHits[index]; }
91
96 const LitTrackParamScal& GetParamFirst() const { return fParamFirst; }
97
102 void SetParamFirst(const LitTrackParamScal& param) { fParamFirst = param; }
103
108 const LitTrackParamScal& GetParamLast() const { return fParamLast; }
109
114 void SetParamLast(const LitTrackParamScal& param) { fParamLast = param; }
115
120 fscal GetChiSq() const { return fChiSq; }
121
126 void SetChiSq(fscal chiSq) { fChiSq = chiSq; }
127
132 void IncChiSq(fscal dChiSq) { fChiSq += dChiSq; }
133
138 unsigned short GetNDF() const { return fNDF; }
139
144 void SetNDF(unsigned short NDF) { fNDF = NDF; }
145
150 unsigned short GetNofMissingHits() const { return fNofMissingHits; }
151
156 void SetNofMissingHits(unsigned short nofMissingHits) { fNofMissingHits = nofMissingHits; }
157
162 unsigned short GetLastStationId() const { return fLastStationId; }
163
168 void SetLastStationId(unsigned short lastStationId) { fLastStationId = lastStationId; }
169
174 void IncNofMissingHits(unsigned short dNofMissingHits = 1) { fNofMissingHits += dNofMissingHits; }
175
180 unsigned short GetPreviousTrackId() const { return fPreviousTrackId; }
181
186 void SetPreviousTrackId(unsigned short previousTrackId) { fPreviousTrackId = previousTrackId; }
187
192 bool IsGood() const { return fIsGood; }
193
198 void IsGood(bool isGood) { fIsGood = isGood; }
199
204 string ToString() const
205 {
206 stringstream ss;
207 ss << "LitTrack: nofHits=" << GetNofHits() << " chiSq=" << GetChiSq() << " NDF=" << GetNDF()
208 << " nofMissingHits=" << GetNofMissingHits() << " previousTrackId=" << GetPreviousTrackId()
209 << " paramFirst=" << GetParamFirst() << " paramLast=" << GetParamLast() << "\n";
210 return ss.str();
211 }
212
217 friend ostream& operator<<(ostream& strm, const LitScalTrack& track)
218 {
219 strm << track.ToString();
220 return strm;
221 }
222
223 private:
224 vector<const LitScalPixelHit*> fHits; // Array of hits
225 LitTrackParamScal fParamFirst; // First track parameter
226 LitTrackParamScal fParamLast; // Last track parameter
227 fscal fChiSq; // Chi-square of the track
228 unsigned short fNDF; // Number of degrees of freedom
229 unsigned short fNofMissingHits; // Number of missing hits
230 unsigned short fPreviousTrackId; // Id of the track seed
231 unsigned char fLastStationId; // ID of last station
232 bool fIsGood; // true id track is "good"
233 };
234
235 } // namespace parallel
236} // namespace lit
237
238
239#endif /* LITSCALTRACK_H_ */
Base class for scalar pixel hits.
Track parameters data class.
Base class for scalar pixel hits.
Scalar track data class.
void IncChiSq(fscal dChiSq)
Increases chi square by dChiSq.
void SetPreviousTrackId(unsigned short previousTrackId)
Sets previous trackId.
void SetChiSq(fscal chiSq)
Sets chi square.
void SetNofHits(unsigned short nofHits)
Depricated.
string ToString() const
Returns string representation of the class.
vector< const LitScalPixelHit * > fHits
friend ostream & operator<<(ostream &strm, const LitScalTrack &track)
Operator << for convenient output to ostream.
const LitTrackParamScal & GetParamFirst() const
Returns first parameter of the track.
void SetNofMissingHits(unsigned short nofMissingHits)
Sets number of missing hits.
unsigned short GetPreviousTrackId() const
Return Previous track index.
void IsGood(bool isGood)
Sets is good track.
void SetNDF(unsigned short NDF)
Sets number of degrees of freedom.
fscal GetChiSq() const
Returns chi square of the track.
LitTrackParamScal fParamLast
unsigned short GetNofHits() const
Returns number of hits in track.
unsigned short GetLastStationId() const
Returns last station ID.
const LitTrackParamScal & GetParamLast() const
Returns last parameter of the track.
unsigned short GetNofMissingHits() const
Returns number of missing hits.
unsigned short fPreviousTrackId
bool IsGood() const
Returns true if track is good.
void SetParamLast(const LitTrackParamScal &param)
Sets last track parameter.
const LitScalPixelHit * GetHit(unsigned short index) const
Returns pointer to the hit.
virtual ~LitScalTrack()
Destructor.
void IncNofMissingHits(unsigned short dNofMissingHits=1)
Increases number of missing hits by dNofMissingHits.
void SetParamFirst(const LitTrackParamScal &param)
Sets first track parameter.
void AddHit(const LitScalPixelHit *hit)
Adds hit to track.
void SetLastStationId(unsigned short lastStationId)
Set last station ID.
LitTrackParamScal fParamFirst
unsigned short GetNDF() const
Returns number of degrees of freedom.
unsigned short NDF(const LitScalTrack &track)
Returns number of degrees of freedom for the track.
Definition LitMath.h:56