BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnTrack.cxx
Go to the documentation of this file.
1#include "BmnTrack.h"
2
3#include <TClonesArray.h>
4
5// ----- Default constructor -------------------------------------------
7 : TObject()
8 , fHits()
10 , fParamLast()
11 , fFlag(-1)
12 , fChi2(0.)
13 , fNDF(0)
14 , fB(0.)
15 , fLength(0)
16 , fNhits(0)
17 , fHitMap()
18 , fUsing(kFALSE)
19{}
20
21//// ----- Destructor ----------------------------------------------------
23{
24 fHitMap.clear();
25}
26
27// ----- Public method AddStsHit ---------------------------------------
28void BmnTrack::AddHit(Int_t hitIndex, FairHit* hit)
29{
30 fHitMap[hit->GetZ()] = hitIndex;
31}
32
33// ----- Public method Print -------------------------------------------
35{
36 cout << " Number of attached hits : " << fNhits << endl;
37 cout << "PARAM FIRST: " << endl;
38 fParamFirst.Print();
39 cout << "PARAM LAST: " << endl;
40 fParamLast.Print();
41 cout << " Length: " << fLength << " Chi2: " << fChi2 << ", Quality flag " << fFlag << endl;
42}
43
44// ----- Public method SortHits ----------------------------------------
46{
47
48 Int_t index = 0;
49 map<Float_t, Int_t>::iterator it;
50
51 fHits.Reset();
52 fHits.Set(fHitMap.size());
53 index = 0;
54 for (it = fHitMap.begin(); it != fHitMap.end(); it++) {
55 fHits[index] = it->second;
56 index++;
57 }
58 fNhits = fHits.GetSize();
59}
int Int_t
constexpr Bool_t kFALSE
BmnTrack()
Default constructor.
Definition BmnTrack.cxx:6
void Print()
Public method Print Output to screen.
Definition BmnTrack.cxx:34
FairTrackParam fParamFirst
Track parameters at first and last fitted hit.
Definition BmnTrack.h:95
TArrayI fHits
Array containing the indices of the STS hits attached to the track.
Definition BmnTrack.h:92
Int_t fNDF
Definition BmnTrack.h:103
virtual ~BmnTrack()
Destructor.
Definition BmnTrack.cxx:22
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.
Definition BmnTrack.cxx:28
Int_t fNhits
Number of hits on track.
Definition BmnTrack.h:112
FairTrackParam fParamLast
Definition BmnTrack.h:96
Int_t fFlag
Quality flag.
Definition BmnTrack.h:99
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
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...
Definition BmnTrack.cxx:45