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