BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnKFStsHit.cxx
Go to the documentation of this file.
1
// -------------------------------------------------------------------------
2
// ----- BmnKFStsHit source file -----
3
// ----- Created 27/03/21 by A.Zinchenko, D.Zinchenko -----
4
// ----- (from CbmKFStsHit.cxx) -----
5
// -------------------------------------------------------------------------
6
7
#include "
BmnKFStsHit.h
"
8
9
#include "CbmKF.h"
10
#include "CbmKFMaterial.h"
11
#include "CbmKFTrackInterface.h"
12
#include "CbmStsHit.h"
13
#include "CbmStsSensor.h"
14
// #include "CbmMvdHit.h"
15
// #include <ios.h>
16
using
std::ios;
17
using
std::vector;
18
19
// AZ static CbmKFTube st_tube;
20
21
void
BmnKFStsHit::Create
(
CbmStsHit
* h)
22
{
23
24
CbmKF
* KF =
CbmKF::Instance
();
25
int
id
= 1000 + h->
GetStationNr
();
26
MaterialIndex
= KF->
GetMaterialIndex
(
id
);
27
Int_t
ista = h->
GetStationNr
(), isec = h->
GetSectorNr
(), isen = h->
GetSensorNr
();
28
CbmStsSensor
* sensor = KF->
StsDigi
->
GetSensor
(ista, isec, isen);
29
Double_t
phis[2] = {sensor->
GetStereoF
(), sensor->
GetStereoB
()};
30
31
// AZ if( MaterialIndex>=0 ) tube = (CbmKFTube*)KF->vMaterial[MaterialIndex];
32
if
(
MaterialIndex
>= 0) {
33
// AZ - adjust hit position
34
tube
= (
CbmKFTube
*)KF->
vMaterial
[
MaterialIndex
];
35
st_tube
= *
tube
;
36
st_tube
.z = h->GetZ();
37
st_tube
.ZReference = h->GetZ();
38
tube
= &
st_tube
;
39
}
else
{
40
st_tube
.z =
st_tube
.dz =
st_tube
.r =
st_tube
.R =
st_tube
.rr =
st_tube
.RR = 0;
41
tube
= &
st_tube
;
42
}
43
TVector3
pos, err;
44
h->Position(pos);
45
h->PositionError(err);
46
47
// FitPoint.x = pos.X();
48
// FitPoint.y = pos.Y();
49
// FitPoint.z = pos.Z();
50
fX
= pos.
X
();
51
fY
= pos.
Y
();
52
fZ
= pos.
Z
();
53
Double_t
sigma2 = err.
X
() * err.
X
();
54
#if 1
55
for
(
Int_t
j = 0; j < 2; ++j) {
56
Double_t
u =
fX
*
cos
(phis[j]) +
fY
*
sin
(phis[j]);
57
// FitPoint[j].Set(z, u, phi, sigma2);
58
FitPoint
[j].Set(
fZ
, u, phis[j], sigma2);
59
}
60
// FitPoint.V[0] = err.X() * err.X();
61
// FitPoint.V[1] = h->GetCovXY();
62
// FitPoint.V[2] = err.Y() * err.Y();
63
#else
64
FitPoint
.V[0] = 3.000e-06;
65
FitPoint
.V[1] = -1.120e-05;
66
FitPoint
.V[2] = 8.357e-05;
67
#endif
// 0
68
}
69
70
/*
71
void CbmKFStsHit::Create( CbmMvdHit *h ){
72
73
CbmKF *KF = CbmKF::Instance();
74
int id = 1100+h->GetStationNr();
75
// cout << " station " << h->GetStationNr() << " has id " << id << flush;
76
MaterialIndex = KF->GetMaterialIndex( id );
77
// cout << " and material index = " << MaterialIndex << endl;
78
79
if( MaterialIndex>=0 ) tube = (CbmKFTube*)KF->vMaterial[MaterialIndex];
80
else{
81
st_tube.z = st_tube.dz = st_tube.r = st_tube.R = st_tube.rr = st_tube.RR = 0;
82
tube = &st_tube;
83
}
84
TVector3 pos, err;
85
h->Position(pos);
86
h->PositionError(err);
87
88
FitPoint.x = pos.X();
89
FitPoint.y = pos.Y();
90
FitPoint.z = pos.Z();
91
92
FitPoint.V[0] = err.X() * err.X();
93
FitPoint.V[1] = 0.;
94
FitPoint.V[2] = err.Y() * err.Y();
95
}
96
*/
97
98
Int_t
BmnKFStsHit::Filter
(
CbmKFTrackInterface
& track,
Bool_t
downstream,
Double_t
& QP0)
99
{
100
Bool_t
err = 0;
101
Double_t
zfst, zlst, zend;
102
if
(downstream) {
103
zfst =
tube
->z -
tube
->ZThickness / 4.;
104
zlst =
tube
->z +
tube
->ZThickness / 4.;
105
zend =
tube
->z +
tube
->ZThickness / 2.;
106
}
else
{
107
zfst =
tube
->z +
tube
->ZThickness / 4.;
108
zlst =
tube
->z -
tube
->ZThickness / 4.;
109
zend =
tube
->z -
tube
->ZThickness / 2.;
110
}
111
Double_t
zthick =
tube
->ZThickness / 2.;
112
113
err = err ||
tube
->Pass(zfst, zthick, track, downstream, QP0);
114
// AZ err = err || track.Propagate( FitPoint.z, QP0 );
115
// AZ err = err || FitPoint.Filter( track );
116
err = err || track.
Propagate
(
FitPoint
[0].z, QP0);
117
err = err ||
FitPoint
[0].Filter(track);
118
err = err ||
FitPoint
[1].Filter(track);
119
err = err ||
tube
->Pass(zlst, zthick, track, downstream, QP0);
120
err = err || track.
Propagate
(zend, QP0);
121
return
err;
122
}
123
124
////////////////////////////////////////////////////////////////////////////
125
//
126
// mathAddMeasurements: the implementation of the Probabilistic
127
// Data Association Filter for the MAPS
128
//
129
//
130
// Author : Dmitry Emeliyanov, RAL, dmitry.emeliyanov@cern.ch
131
//
132
/////////////////////////////////////////////////////////////////////////////
133
/*
134
void CbmKFStsHit::FilterPDAF( CbmKFTrackInterface &track,
135
vector<CbmKFStsHit*> &vpHits,
136
Bool_t downstream, Double_t *QP0,
137
double gateX, double gateY, int &best_hit_idx ){
138
139
best_hit_idx=0;
140
if( vpHits.empty() ) return;
141
142
double qp0 = (QP0)? *QP0 : track.GetTrack()[4];
143
144
CbmKFStsHit* h=(*vpHits.begin());
145
146
vector<CbmKFPixelMeasurement*> vm;
147
vm.clear();
148
for(vector<CbmKFStsHit*>::iterator phIt=vpHits.begin(); phIt!=vpHits.end();++phIt){
149
vm.push_back(&((*phIt)->FitPoint));
150
}
151
152
CbmKFTube *tube = h->tube;
153
154
Double_t zfst, zlst, zend;
155
if( downstream )
156
{
157
zfst = tube->z - tube->ZThickness/4.;
158
zlst = tube->z + tube->ZThickness/4.;
159
zend = tube->z + tube->ZThickness/2.;
160
}
161
else
162
{
163
zfst = tube->z + tube->ZThickness/4.;
164
zlst = tube->z - tube->ZThickness/4.;
165
zend = tube->z - tube->ZThickness/2.;
166
}
167
Double_t zthick = tube->ZThickness/2.;
168
169
tube->Pass( zfst, zthick, track, downstream, qp0 );
170
track.Propagate( h->FitPoint.z, qp0 );
171
172
vector<double> vProb;
173
vProb.clear();
174
175
CbmKFPixelMeasurement::FilterPDAF(track, vm, gateX, gateY, vProb );
176
177
int idx=0;
178
double bestProb=0.0;
179
180
for(vector<double>::iterator probIt=vProb.begin(); probIt!=vProb.end();++probIt){
181
if((*probIt)>bestProb){
182
bestProb=(*probIt);
183
best_hit_idx=idx;
184
}
185
idx++;
186
}
187
vProb.clear();
188
189
tube->Pass( zlst, zthick, track, downstream, qp0 );
190
track.Propagate( zend, qp0 );
191
192
if( QP0 ) *QP0 = qp0;
193
}
194
*/
Bool_t
bool Bool_t
Int_t
int Int_t
Double_t
double Double_t
BmnKFStsHit::st_tube
CbmKFTube st_tube
Definition
BmnKFStsHit.h:34
BmnKFStsHit::Filter
Int_t Filter(CbmKFTrackInterface &track, Bool_t downstream, Double_t &QP0)
Definition
BmnKFStsHit.cxx:98
BmnKFStsHit::tube
CbmKFTube * tube
Definition
BmnKFStsHit.h:32
BmnKFStsHit::fX
Double_t fX
Definition
BmnKFStsHit.h:33
BmnKFStsHit::fZ
Double_t fZ
Definition
BmnKFStsHit.h:33
BmnKFStsHit::FitPoint
CbmKFUMeasurement FitPoint[2]
Definition
BmnKFStsHit.h:31
BmnKFStsHit::Create
void Create(CbmStsHit *h)
Definition
BmnKFStsHit.cxx:21
BmnKFStsHit::fY
Double_t fY
Definition
BmnKFStsHit.h:33
CbmKFHit::MaterialIndex
Int_t MaterialIndex
Definition
CbmKFHit.h:24
CbmKFTrackInterface
Definition
CbmKFTrackInterface.h:26
CbmKFTrackInterface::Propagate
Int_t Propagate(Double_t z_out, Double_t QP0, Bool_t line=false)
Definition
CbmKFTrackInterface.cxx:463
CbmKFTube
Definition
CbmKFMaterial.h:72
CbmKF
The CbmKF Kalman Filter algorithm.
Definition
CbmKF.h:28
CbmKF::vMaterial
std::vector< CbmKFMaterial * > vMaterial
Definition
CbmKF.h:57
CbmKF::Instance
static CbmKF * Instance()
Definition
CbmKF.h:34
CbmKF::GetMaterialIndex
Int_t GetMaterialIndex(Int_t uid)
Definition
CbmKF.cxx:459
CbmKF::StsDigi
CbmStsDigiScheme * StsDigi
Definition
CbmKF.h:83
CbmStsDigiScheme::GetSensor
CbmStsSensor * GetSensor(Int_t stationNr, Int_t sectorNr, Int_t sensorNr)
Sector by number.
Definition
CbmStsDigiScheme.cxx:211
CbmStsHit
Definition
CbmStsHit.h:27
CbmStsHit::GetSensorNr
Int_t GetSensorNr() const
Definition
CbmStsHit.h:72
CbmStsHit::GetStationNr
virtual Int_t GetStationNr() const
Definition
CbmStsHit.h:67
CbmStsHit::GetSectorNr
Int_t GetSectorNr() const
Definition
CbmStsHit.h:68
CbmStsSensor
Definition
CbmStsSensor.h:44
CbmStsSensor::GetStereoF
Double_t GetStereoF() const
Definition
CbmStsSensor.h:117
CbmStsSensor::GetStereoB
Double_t GetStereoB() const
Definition
CbmStsSensor.h:118
TVector3
TVector3::Z
Double_t Z() const
TVector3::Y
Double_t Y() const
TVector3::X
Double_t X() const
cos
RVec< PromoteType< T > > cos(const RVec< T > &v)
sin
RVec< PromoteType< T > > sin(const RVec< T > &v)
BmnKFStsHit.h
reconstruction
KF
Interface
BmnKFStsHit.cxx
Generated on
for BmnRoot by
1.17.0