BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
CbmStsTrack.cxx
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- CbmStsTrack source file -----
3// ----- Created 26/01/05 by V. Friese -----
4// -------------------------------------------------------------------------
5
6#include "CbmStsTrack.h"
7
8#include "FairHit.h"
9
10#include <iostream>
11#include <map>
12
13using std::cout;
14using std::endl;
15using std::map;
16
17// ----- Default constructor -------------------------------------------
19 : TObject()
20 , fStsHits()
21 , fMvdHits()
22 , fPidHypo(0)
23 , fParamFirst()
24 , fParamLast()
25 , fFlag(0)
26 , fChi2(0.)
27 , fNDF(0)
28 , fB(0.)
29 , fStsHitMap()
30 , fMvdHitMap()
31 , fnEv()
32 , fHitsArr("CbmStsHit", 10)
33{}
34// -------------------------------------------------------------------------
35
36// ----- Destructor ----------------------------------------------------
38{
39 fStsHitMap.clear();
40 fMvdHitMap.clear();
41}
42// -------------------------------------------------------------------------
43
44// ----- Public method AddStsHit ---------------------------------------
46{
47 fStsHitMap[hit->GetZ()] = hitIndex;
48}
49// -------------------------------------------------------------------------
50
51// ----- SM -------------------------------------------------------------
53{
54 fStsHitMap[hit->GetZ()] = hitIndex;
55}
56// -------------------------------------------------------------------------
57
58// ----- Public method AddMvdHit ---------------------------------------
60{
61 fMvdHitMap[hit->GetZ()] = hitIndex;
62}
63// -------------------------------------------------------------------------
64
65// ----- Public method Print -------------------------------------------
67{
68 cout << " Number of attached STS hits : " << fStsHits.GetSize() << endl;
69 cout << " Number of attached MVD hits : " << fMvdHits.GetSize() << endl;
70 fParamFirst.Print();
71 cout << " Chi2: " << fChi2 << ", Quality flag " << fFlag << endl;
72}
73// -------------------------------------------------------------------------
74
75// ----- Public method SortHits ----------------------------------------
77{
78
79 Int_t index = 0;
80 map<Double_t, Int_t>::iterator it;
81
82 fStsHits.Reset();
83 fStsHits.Set(fStsHitMap.size());
84 index = 0;
85 for (it = fStsHitMap.begin(); it != fStsHitMap.end(); it++) {
86 fStsHits[index] = it->second;
87 index++;
88 }
89
90 fMvdHits.Reset();
91 fMvdHits.Set(fMvdHitMap.size());
92 index = 0;
93 for (it = fMvdHitMap.begin(); it != fMvdHitMap.end(); it++) {
94 fMvdHits[index] = it->second;
95 index++;
96 }
97}
98// -------------------------------------------------------------------------
99
100// ----- Public method SortMvdHits ----------------------------------------
102{
103
104 Int_t index = 0;
105 map<Double_t, Int_t>::iterator it;
106
107 fMvdHits.Reset();
108 fMvdHits.Set(fMvdHitMap.size());
109 for (it = fMvdHitMap.begin(); it != fMvdHitMap.end(); it++) {
110 fMvdHits[index] = it->second;
111 index++;
112 }
113}
114// -------------------------------------------------------------------------
115
117{
118 // AZ-260124 - compute Pt at first point
119
120 Double_t tx = fParamFirst.GetTx();
121 Double_t ty = fParamFirst.GetTy();
122 Double_t txy2 = tx * tx + ty * ty;
123 Double_t pz = TMath::Abs(1 / fParamFirst.GetQp()) / TMath::Sqrt(1 + txy2);
124 Double_t pt = pz * TMath::Sqrt(txy2);
125 return pt;
126}
127// -------------------------------------------------------------------------
128
130{
131 // AZ-260124 - compute Eta at first point
132
133 Double_t tx = fParamFirst.GetTx();
134 Double_t ty = fParamFirst.GetTy();
135 Double_t txy2 = tx * tx + ty * ty;
136 Double_t pz = TMath::Abs(1 / fParamFirst.GetQp()) / TMath::Sqrt(1 + txy2);
137 Double_t pt = pz * TMath::Sqrt(txy2);
138 TVector3 mom(pt, 0.0, pz);
139 return mom.Eta();
140}
int Int_t
double Double_t
Double_t GetZ() const
Definition CbmBaseHit.h:50
TClonesArray fHitsArr
virtual ~CbmStsTrack()
Destructor.
Int_t fFlag
Quality flag.
void SortHits()
Public method SortHits Sorts the hits in downstream direction and writes the hit indizes into the mem...
Double32_t fB
Impact parameter of track at target z, in units of its error.
FairTrackParam fParamFirst
Track parameters at first and last fitted hit.
void Print()
Public method Print Output to screen.
std::map< Double_t, Int_t > fStsHitMap
Maps from hit z position to hit index.
void AddStsHit(Int_t hitIndex, FairHit *hit)
Add a StsHit to the list.
CbmStsTrack()
Default constructor.
TArrayI fMvdHits
Array containg the indizes of the MVD hits attached to the track.
Definition CbmStsTrack.h:99
Int_t fPidHypo
PID hypothesis used by the track fitter.
std::map< Double_t, Int_t > fMvdHitMap
TArrayI fStsHits
Array containg the indizes of the STS hits attached to the track.
Definition CbmStsTrack.h:96
Double32_t fChi2
Chi square and NDF of track fit.
void AddMvdHit(Int_t hitIndex, FairHit *mvdHit)
Associate a MvdHit to the track.
Double_t GetEta() const
void SortMvdHits()
FairTrackParam fParamLast
void AddPixelHit(Int_t hitIndex, CbmBaseHit *hit)
Double_t GetPt() const
Double_t Eta() const
Double_t Sqrt(Double_t x)
Double_t Abs(Double_t d)