BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
CbmKFStsHit.cxx
Go to the documentation of this file.
1
2#include "CbmKFStsHit.h"
3
4#include "CbmKF.h"
5#include "CbmKFMaterial.h"
6#include "CbmKFTrackInterface.h"
7#include "CbmMvdHit.h"
8#include "CbmStsHit.h"
9// #include <ios.h>
10using std::ios;
11using std::vector;
12
14
16{
17
18 CbmKF* KF = CbmKF::Instance();
19 int id = 1000 + h->GetStationNr();
21
22 if (MaterialIndex >= 0)
24 else {
25 st_tube.z = st_tube.dz = st_tube.r = st_tube.R = st_tube.rr = st_tube.RR = 0;
26 tube = &st_tube;
27 }
28 TVector3 pos, err;
29 h->Position(pos);
30 h->PositionError(err);
31
32 FitPoint.x = pos.X();
33 FitPoint.y = pos.Y();
34 FitPoint.z = pos.Z();
35#if 1
36 FitPoint.V[0] = err.X() * err.X();
37 FitPoint.V[1] = h->GetCovXY();
38 FitPoint.V[2] = err.Y() * err.Y();
39#else
40 FitPoint.V[0] = 3.000e-06;
41 FitPoint.V[1] = -1.120e-05;
42 FitPoint.V[2] = 8.357e-05;
43#endif // 0
44}
45
47{
48
49 CbmKF* KF = CbmKF::Instance();
50 int id = 1100 + h->GetStationNr();
51 // cout << " station " << h->GetStationNr() << " has id " << id << flush;
53 // cout << " and material index = " << MaterialIndex << endl;
54
55 if (MaterialIndex >= 0)
57 else {
58 st_tube.z = st_tube.dz = st_tube.r = st_tube.R = st_tube.rr = st_tube.RR = 0;
59 tube = &st_tube;
60 }
61 TVector3 pos, err;
62 h->Position(pos);
63 h->PositionError(err);
64
65 FitPoint.x = pos.X();
66 FitPoint.y = pos.Y();
67 FitPoint.z = pos.Z();
68
69 FitPoint.V[0] = err.X() * err.X();
70 FitPoint.V[1] = 0.;
71 FitPoint.V[2] = err.Y() * err.Y();
72}
73
75{
76 Bool_t err = 0;
77 Double_t zfst, zlst, zend;
78 if (downstream) {
79 zfst = tube->z - tube->ZThickness / 4.;
80 zlst = tube->z + tube->ZThickness / 4.;
81 zend = tube->z + tube->ZThickness / 2.;
82 } else {
83 zfst = tube->z + tube->ZThickness / 4.;
84 zlst = tube->z - tube->ZThickness / 4.;
85 zend = tube->z - tube->ZThickness / 2.;
86 }
87 Double_t zthick = tube->ZThickness / 2.;
88
89 err = err || tube->Pass(zfst, zthick, track, downstream, QP0);
90 err = err || track.Propagate(FitPoint.z, QP0);
91 err = err || FitPoint.Filter(track);
92 err = err || tube->Pass(zlst, zthick, track, downstream, QP0);
93 err = err || track.Propagate(zend, QP0);
94 return err;
95}
96
97////////////////////////////////////////////////////////////////////////////
98//
99// mathAddMeasurements: the implementation of the Probabilistic
100// Data Association Filter for the MAPS
101//
102//
103// Author : Dmitry Emeliyanov, RAL, dmitry.emeliyanov@cern.ch
104//
105/////////////////////////////////////////////////////////////////////////////
106
108 vector<CbmKFStsHit*>& vpHits,
109 Bool_t downstream,
110 Double_t* QP0,
111 double gateX,
112 double gateY,
113 int& best_hit_idx)
114{
115
116 best_hit_idx = 0;
117 if (vpHits.empty())
118 return;
119
120 double qp0 = (QP0) ? *QP0 : track.GetTrack()[4];
121
122 CbmKFStsHit* h = (*vpHits.begin());
123
124 vector<CbmKFPixelMeasurement*> vm;
125 vm.clear();
126 for (vector<CbmKFStsHit*>::iterator phIt = vpHits.begin(); phIt != vpHits.end(); ++phIt) {
127 vm.push_back(&((*phIt)->FitPoint));
128 }
129
130 CbmKFTube* tube = h->tube;
131
132 Double_t zfst, zlst, zend;
133 if (downstream) {
134 zfst = tube->z - tube->ZThickness / 4.;
135 zlst = tube->z + tube->ZThickness / 4.;
136 zend = tube->z + tube->ZThickness / 2.;
137 } else {
138 zfst = tube->z + tube->ZThickness / 4.;
139 zlst = tube->z - tube->ZThickness / 4.;
140 zend = tube->z - tube->ZThickness / 2.;
141 }
142 Double_t zthick = tube->ZThickness / 2.;
143
144 tube->Pass(zfst, zthick, track, downstream, qp0);
145 track.Propagate(h->FitPoint.z, qp0);
146
147 vector<double> vProb;
148 vProb.clear();
149
150 CbmKFPixelMeasurement::FilterPDAF(track, vm, gateX, gateY, vProb);
151
152 int idx = 0;
153 double bestProb = 0.0;
154
155 for (vector<double>::iterator probIt = vProb.begin(); probIt != vProb.end(); ++probIt) {
156 if ((*probIt) > bestProb) {
157 bestProb = (*probIt);
158 best_hit_idx = idx;
159 }
160 idx++;
161 }
162 vProb.clear();
163
164 tube->Pass(zlst, zthick, track, downstream, qp0);
165 track.Propagate(zend, qp0);
166
167 if (QP0)
168 *QP0 = qp0;
169}
static CbmKFTube st_tube
bool Bool_t
int Int_t
double Double_t
Double_t GetCovXY() const
Accessors.
Definition CbmHit.h:41
Int_t MaterialIndex
Definition CbmKFHit.h:24
Double_t ZThickness
static void FilterPDAF(CbmKFTrackInterface &track, std::vector< CbmKFPixelMeasurement * > &vm, double gateX, double gateY, std::vector< double > &vProb)
CbmKFPixelMeasurement FitPoint
Definition CbmKFStsHit.h:20
CbmKFTube * tube
Definition CbmKFStsHit.h:21
static void FilterPDAF(CbmKFTrackInterface &track, std::vector< CbmKFStsHit * > &vpHits, Bool_t downstream, Double_t *QP0, double gateX, double gateY, int &best_hit_idx)
Int_t Filter(CbmKFTrackInterface &track, Bool_t downstream, Double_t &QP0)
void Create(CbmStsHit *h)
Int_t Propagate(Double_t z_out, Double_t QP0, Bool_t line=false)
Double_t z
The CbmKF Kalman Filter algorithm.
Definition CbmKF.h:28
std::vector< CbmKFMaterial * > vMaterial
Definition CbmKF.h:57
static CbmKF * Instance()
Definition CbmKF.h:34
Int_t GetMaterialIndex(Int_t uid)
Definition CbmKF.cxx:459
CbmMvdHit.h.
Definition CbmMvdHit.h:26
virtual Int_t GetStationNr() const
Definition CbmMvdHit.h:48
virtual Int_t GetStationNr() const
Definition CbmStsHit.h:67
Double_t Z() const
Double_t Y() const
Double_t X() const