BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
CbmL1TrackFitter.cxx
Go to the documentation of this file.
1
/*
2
*=====================================================
3
*
4
* CBM Level 1 Reconstruction
5
*
6
* Authors: I.Kisel, S.Gorbunov
7
*
8
* e-mail : ikisel@kip.uni-heidelberg.de
9
*
10
*=====================================================
11
*
12
* Fit reconstructed tracks and find primary vertex
13
*
14
*/
15
16
#include "CbmKF.h"
17
#include "CbmKFMath.h"
18
#include "CbmKFPrimaryVertexFinder.h"
19
#include "
CbmL1.h
"
20
#include "
L1Algo/L1AddMaterial.h
"
21
#include "
L1Algo/L1Algo.h
"
22
#include "
L1Algo/L1Extrapolation.h
"
23
#include "
L1Algo/L1Filtration.h
"
24
#include "
L1Algo/L1StsHit.h
"
25
#include "
L1Algo/L1TrackPar.h
"
26
#include "
TStopwatch.h
"
27
28
void
CbmL1::TrackFitter(vector<CbmL1Track>& Tracks,
CbmL1Vtx
* V)
29
{
30
TStopwatch timer;
31
timer.
Start
();
32
/*
33
//int nt=0;
34
for( vector<CbmL1Track>::iterator i = Tracks.begin(); i!=Tracks.end(); ++i)
35
{
36
CbmL1Track &T = *i;
37
38
int stmin = 1000, stmax = -1000;
39
for ( vector<L1StsHit*>::iterator j = T.StsHits.begin(); j != T.StsHits.end(); ++j)
40
{
41
if ((*j)->iStation < stmin ) stmin = (*j)->iStation;
42
if ((*j)->iStation > stmax ) stmax = (*j)->iStation;
43
}
44
45
T.nStations = stmax - stmin + 1;
46
T.is_long = ( T.StsHits.size() >= 4 ) && ( T.nStations >=4 );
47
48
//T.is_long = T.is_long &&( vMCPoints[T.MapsHits.back()->MC_Point].mother_ID==-1 );
49
//if ( !T.is_long ) continue;
50
51
static L1FieldRegion fld[20];
52
{
53
vector<L1StsHit*>::iterator ih2 = T.StsHits.begin(), ih1, ih0;
54
ih1 = ih2;
55
ih1++;
56
ih0 = ih1;
57
ih0++;
58
int ist0 = (*ih0)->iStation;
59
int ist1 = (*ih1)->iStation;
60
int ist2 = (*ih2)->iStation;
61
L1Station *st0 = &(algo->vStations[ist0]);
62
L1Station *st1 = &(algo->vStations[ist1]);
63
L1Station *st2 = &(algo->vStations[ist2]);
64
L1FieldValue B0, B1, B2;
65
fvec Z0= st0->z, Z1= st1->z, Z2= st2->z ;
66
st0->fieldSlice.GetFieldValue( (*ih0)->x, (*ih0)->y, B0 );
67
st1->fieldSlice.GetFieldValue( (*ih1)->x, (*ih1)->y, B1 );
68
st2->fieldSlice.GetFieldValue( (*ih2)->x, (*ih2)->y, B2 );
69
fld[ist0].Set( B0, Z0, B1, Z1, B2, Z2 );
70
fld[ist1] = fld[ist0];
71
fld[ist2] = fld[ist0];
72
if( ih0!=T.StsHits.end() ){
73
while(1){
74
ih2 = ih1; B2 = B1; Z2 = Z1; st2 = st1;
75
ih1 = ih0; B1 = B0; Z1 = Z0; st1 = st0;
76
ih0++;
77
if( ih0==T.StsHits.end() ) break;
78
ist0 = (*ih0)->iStation;
79
st0 = &(algo->vStations[ist0]);
80
Z0 = st0->z;
81
st0->fieldSlice.GetFieldValue( (*ih0)->x, (*ih0)->y, B0 );
82
fld[ist0].Set( B0, Z0, B1, Z1, B2, Z2 );
83
}
84
}
85
}
86
fvec vINF = 100.;
87
L1TrackPar tp;
88
for( int i=0; i<5; i++ ) *((&tp.x)+i) = T.T[i];
89
{
90
fvec qp0 = tp.qp;
91
tp.NDF = 2;
92
tp.chi2 = 0;
93
vector<L1StsHit*>::iterator ih = T.StsHits.begin();
94
int ist = (*ih)->iStation;
95
L1Station *st = &(algo->vStations[ist]);
96
tp.x = (*ih)->x;
97
tp.y = (*ih)->y;
98
tp.z = st->z;
99
tp.C00 = st->XYInfo.C00;
100
tp.C10 = st->XYInfo.C10;
101
tp.C11 = st->XYInfo.C11;
102
for( int i=3; i<15; i++ ) *((&tp.C00)+i) = 0;
103
tp.C22 = tp.C33 = tp.C44 = vINF;
104
for( ; ih!= T.StsHits.end(); ih++ ){
105
ist = (*ih)->iStation;
106
st = &(algo->vStations[ist]);
107
L1Extrapolate( tp, st->z, qp0, fld[ist] );
108
fvec u_f = (*ih)->u_front, u_b = (*ih)->u_back;
109
L1Filter( tp, st->frontInfo, u_f );
110
L1Filter( tp, st->backInfo, u_b );
111
L1AddMaterial( tp, st->materialInfo, qp0 );
112
}
113
}
114
for( int i=0; i<6; i++ ) T.TLast[i] = (*((&tp.x)+i))[0] ;
115
for( int i=0; i<15; i++ ) T.CLast[i] = (*((&tp.C00)+i))[0];
116
117
{
118
fvec qp0 = tp.qp;
119
tp.NDF = 2;
120
tp.chi2 = 0;
121
vector<L1StsHit*>::reverse_iterator ih = T.StsHits.rbegin();
122
int ist = (*ih)->iStation;
123
L1Station *st = &(algo->vStations[ist]);
124
tp.x = (*ih)->x;
125
tp.y = (*ih)->y;
126
tp.z = st->z;
127
tp.C00 = st->XYInfo.C00;
128
tp.C10 = st->XYInfo.C10;
129
tp.C11 = st->XYInfo.C11;
130
for( int i=3; i<15; i++ ) *((&tp.C00)+i) = 0;
131
tp.C22 = tp.C33 = tp.C44 = vINF;
132
for( ; ih!= T.StsHits.rend(); ih++ ){
133
ist = (*ih)->iStation;
134
st = &(algo->vStations[ist]);
135
L1Extrapolate( tp, st->z, qp0, fld[ist] );
136
fvec u_f = (*ih)->u_front, u_b = (*ih)->u_back;
137
L1Filter( tp, st->frontInfo, u_f );
138
L1Filter( tp, st->backInfo, u_b );
139
L1AddMaterial( tp, st->materialInfo, qp0 );
140
}
141
}
142
for( int i=0; i<6; i++ ) T.T[i] = (*((&tp.x)+i))[0] ;
143
for( int i=0; i<15; i++ ) T.C[i] = (*((&tp.C00)+i))[0];
144
T.chi2 = tp.chi2[0];
145
T.NDF = tp.NDF[0]-5;
146
}
147
timer.Stop();
148
149
stat_vtx_ntracks = 0;
150
151
if(V){ // primary vertex fit
152
153
vector<CbmKFTrackInterface*> vTracks;
154
155
{ for( vector<CbmL1Track>::iterator i = Tracks.begin(); i!=Tracks.end(); ++i)
156
{
157
if( ( i->StsHits.size() < 5 ) || ( i->nStations <5 ) ) continue;
158
vTracks.push_back( &*i );
159
stat_vtx_ntracks ++;
160
}
161
}
162
cout<<"Fit vertex"<<endl;
163
if ( vTracks.size()>=3 )
164
{
165
CbmKFPrimaryVertexFinder PVFinder;
166
PVFinder.SetTracks( vTracks );
167
PVFinder.Fit(*V);
168
}
169
}// prim. vtx
170
*/
171
// c_time.Stop();
172
// stat_fit_time += double(c_time.Time());
173
// timer.Stop();
174
stat_fit_time += timer.
CpuTime
();
175
stat_fit_time_ntracks += Tracks.size();
176
}
L1AddMaterial.h
L1Algo.h
L1Extrapolation.h
L1Filtration.h
L1StsHit.h
L1TrackPar.h
TStopwatch.h
TStopwatch::Start
void Start(Bool_t reset=kTRUE)
TStopwatch::CpuTime
Double_t CpuTime()
CbmL1.h
CbmL1Vtx
Definition
CbmL1Vtx.h:23
reconstruction
cat
CbmL1TrackFitter.cxx
Generated on
for BmnRoot by
1.17.0