CbmRoot
Loading...
Searching...
No Matches
CbmKFStsHit.cxx
Go to the documentation of this file.
1/* Copyright (C) 2006-2017 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer], Sergey Gorbunov */
4
5#include "CbmKFStsHit.h"
6
7#include "CbmKF.h"
8#include "CbmKFMaterial.h"
10#include "CbmMvdHit.h"
11#include "CbmStsAddress.h"
12#include "CbmStsHit.h"
13#include "CbmStsSetup.h"
14//#include <ios.h>
15using std::ios;
16using std::vector;
17
19
21
23{
24
25 CbmKF* KF = CbmKF::Instance();
26 int id = 1000 + CbmStsSetup::Instance()->GetStationNumber(h->GetAddress());
27
29
30 if (MaterialIndex >= 0) {
32 }
33 else {
35 tube = &st_tube;
36 }
37 TVector3 pos, err;
38 h->Position(pos);
39 h->PositionError(err);
40
41 FitPoint.x = pos.X();
42 FitPoint.y = pos.Y();
43 FitPoint.z = pos.Z();
44#if 1
45 FitPoint.V[0] = err.X() * err.X();
46 FitPoint.V[1] = h->GetDxy();
47 FitPoint.V[2] = err.Y() * err.Y();
48#else
49 FitPoint.V[0] = 3.000e-06;
50 FitPoint.V[1] = -1.120e-05;
51 FitPoint.V[2] = 8.357e-05;
52#endif // 0
53}
54
55
57{
58
59 CbmKF* KF = CbmKF::Instance();
60 int id = 1100 + h->GetStationNr();
61 // cout << " station " << h->GetStationNr() << " has id " << id << flush;
63 // cout << " and material index = " << MaterialIndex << endl;
64
65 if (MaterialIndex >= 0) {
67 }
68 else {
70 tube = &st_tube;
71 }
72 TVector3 pos, err;
73 h->Position(pos);
74 h->PositionError(err);
75
76 FitPoint.x = pos.X();
77 FitPoint.y = pos.Y();
78 FitPoint.z = pos.Z();
79
80 FitPoint.V[0] = err.X() * err.X();
81 FitPoint.V[1] = 0.;
82 FitPoint.V[2] = err.Y() * err.Y();
83}
84
85
86Int_t CbmKFStsHit::Filter(CbmKFTrackInterface& track, Bool_t downstream, Double_t& QP0)
87{
88 Bool_t err = 0;
89 Double_t zfst, zlst, zend;
90 if (downstream) {
91 zfst = tube->z - tube->ZThickness / 4.;
92 zlst = tube->z + tube->ZThickness / 4.;
93 zend = tube->z + tube->ZThickness / 2.;
94 }
95 else {
96 zfst = tube->z + tube->ZThickness / 4.;
97 zlst = tube->z - tube->ZThickness / 4.;
98 zend = tube->z - tube->ZThickness / 2.;
99 }
100 Double_t zthick = tube->ZThickness / 2.;
101
102 err = err || tube->Pass(zfst, zthick, track, downstream, QP0);
103 err = err || track.Propagate(FitPoint.z, QP0);
104 err = err || FitPoint.Filter(track);
105 err = err || tube->Pass(zlst, zthick, track, downstream, QP0);
106 err = err || track.Propagate(zend, QP0);
107 return err;
108}
109
110
112//
113// mathAddMeasurements: the implementation of the Probabilistic
114// Data Association Filter for the MAPS
115//
116//
117// Author : Dmitry Emeliyanov, RAL, dmitry.emeliyanov@cern.ch
118//
120
121void CbmKFStsHit::FilterPDAF(CbmKFTrackInterface& track, vector<CbmKFStsHit*>& vpHits, Bool_t downstream, Double_t* QP0,
122 double gateX, double gateY, int& best_hit_idx)
123{
124
125 best_hit_idx = 0;
126 if (vpHits.empty()) {
127 return;
128 }
129
130 double qp0 = (QP0) ? *QP0 : track.GetTrack()[4];
131
132 CbmKFStsHit* h = (*vpHits.begin());
133
134 vector<CbmKFPixelMeasurement*> vm;
135 vm.clear();
136 for (vector<CbmKFStsHit*>::iterator phIt = vpHits.begin(); phIt != vpHits.end(); ++phIt) {
137 vm.push_back(&((*phIt)->FitPoint));
138 }
139
140 CbmKFTube* tube = h->tube;
141
142 Double_t zfst, zlst, zend;
143 if (downstream) {
144 zfst = tube->z - tube->ZThickness / 4.;
145 zlst = tube->z + tube->ZThickness / 4.;
146 zend = tube->z + tube->ZThickness / 2.;
147 }
148 else {
149 zfst = tube->z + tube->ZThickness / 4.;
150 zlst = tube->z - tube->ZThickness / 4.;
151 zend = tube->z - tube->ZThickness / 2.;
152 }
153 Double_t zthick = tube->ZThickness / 2.;
154
155 tube->Pass(zfst, zthick, track, downstream, qp0);
156 track.Propagate(h->FitPoint.z, qp0);
157
158 vector<double> vProb;
159 vProb.clear();
160
161 CbmKFPixelMeasurement::FilterPDAF(track, vm, gateX, gateY, vProb);
162
163 int idx = 0;
164 double bestProb = 0.0;
165
166 for (vector<double>::iterator probIt = vProb.begin(); probIt != vProb.end(); ++probIt) {
167 if ((*probIt) > bestProb) {
168 bestProb = (*probIt);
169 best_hit_idx = idx;
170 }
171 idx++;
172 }
173 vProb.clear();
174
175 tube->Pass(zlst, zthick, track, downstream, qp0);
176 track.Propagate(zend, qp0);
177
178 if (QP0) {
179 *QP0 = qp0;
180 }
181}
ClassImp(CbmKFStsHit)
static CbmKFTube st_tube
Data class for a reconstructed hit in the STS.
Int_t MaterialIndex
Definition CbmKFHit.h:26
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:21
CbmKFTube * tube
Definition CbmKFStsHit.h:22
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)
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:34
std::vector< CbmKFMaterial * > vMaterial
Definition CbmKF.h:63
static CbmKF * Instance()
Definition CbmKF.h:40
Int_t GetMaterialIndex(Int_t uid)
Definition CbmKF.cxx:362
data class for a reconstructed 3-d hit in the STS
Definition CbmStsHit.h:35
static CbmStsSetup * Instance()
Int_t GetStationNumber(Int_t address)
Data class with information on a STS local track.