26void L1Algo::BranchFitterFast(
const L1Branch &t,
L1TrackPar& T,
const bool dir,
const fvec qp0,
const bool initParams)
32 const std::vector<THitI>& hits = t.
StsHits;
33 const int nHits = t.
StsHits.size();
35 const signed short int step = -2*
static_cast<int>(dir) + 1;
36 const int iFirstHit = (dir) ? nHits-1 : 0;
37 const int iLastHit = (dir) ? 0 : nHits-1;
43 int ista0 = GetFStation(
vSFlag[hit0.
f]);
44 int ista1 = GetFStation(
vSFlag[hit1.
f]);
45 int ista2 = GetFStation(
vSFlag[hit2.
f]);
56 x0 = (*vStsHitPointsUnused)[ihp].X();
57 y0 = (*vStsHitPointsUnused)[ihp].Y();
61 StripsToCoor(u0, v0, x0, y0, sta0);
69 x1 = (*vStsHitPointsUnused)[ihp].X();
70 y1 = (*vStsHitPointsUnused)[ihp].Y();
74 StripsToCoor(u1, v1, x1, y1, sta1);
81 x2 = (*vStsHitPointsUnused)[ihp].X();
82 y2 = (*vStsHitPointsUnused)[ihp].Y();
86 StripsToCoor(u2, v2, x2, y2, sta2);
125 fld.Set( fB2, fz2, fB1, fz1, fB0, fz0 );
127 int ista_prev = ista1;
130 for(
int i = iFirstHit + step; step*
i <= step*iLastHit;
i += step){
133 ista = GetFStation(
vSFlag[hit.
f]);
139 if ( (step*ista <= step*(
NMvdStations + (step+1)/2 - 1)) && (step*ista_prev >= step*(
NMvdStations + (step+1)/2 - 1 - step)) )
146 L1HitPoint &point = (*vStsHitPointsUnused)[ihp];
172 StripsToCoor(u,
v, x, y, sta);
177 fld.Set( fB2, fz2, fB1, fz1, fB0, fz0 );
183void L1Algo::BranchFitter(
const L1Branch &t,
L1TrackPar& T,
const bool dir,
const fvec qp0,
const bool initParams)
185 BranchFitterFast (t, T, dir, qp0, initParams);
186 for (
int i = 0;
i < 1;
i++) {
187 BranchFitterFast (t, T, !dir, T.
qp,
false);
188 BranchFitterFast (t, T, dir, T.
qp,
false);
203 std::vector<THitI> newHits;
206 const signed short int step = - 2*
static_cast<int>(dir) + 1;
207 const int iFirstHit = (dir) ? 2 : t.StsHits.size()-3;
214 const int ista0 = GetFStation(
vSFlag[hit0.
f]);
215 const int ista1 = GetFStation(
vSFlag[hit1.
f]);
216 const int ista2 = GetFStation(
vSFlag[hit2.
f]);
218 const L1Station &sta0 = vStations[ista0];
219 const L1Station &sta1 = vStations[ista1];
220 const L1Station &sta2 = vStations[ista2];
226 x0 = (*vStsHitPointsUnused)[ihp].X();
227 y0 = (*vStsHitPointsUnused)[ihp].Y();
231 StripsToCoor(u0, v0, x0, y0, sta0);
239 x1 = (*vStsHitPointsUnused)[ihp].X();
240 y1 = (*vStsHitPointsUnused)[ihp].Y();
244 StripsToCoor(u1, v1, x1, y1, sta1);
252 x2 = (*vStsHitPointsUnused)[ihp].X();
253 y2 = (*vStsHitPointsUnused)[ihp].Y();
257 StripsToCoor(u2, v2, x2, y2, sta2);
273 fld.Set( fB2, fz2, fB1, fz1, fB0, fz0 );
275 int ista = ista2 + 2*step;
276 if (ista2 == FIRSTCASTATION)
279 const fvec Pick_gather2 = Pick_gather*Pick_gather;
280 for( ; (ista <
NStations) && (ista >= 0); ista += step ){
289 const fscal iz = 1/T.
z[0];
292 while( area.GetNext( ih ) ) {
294 L1StsHit &hit = (*vStsHitsUnused)[ih];
301 L1HitPoint &point = (*vStsHitPointsUnused)[ih];
302 xh = point.
X(), yh = point.
Y(), zh = point.
Z();
304 GetHitCoor(hit, xh, yh, zh, sta);
312 fscal y_minus_new = y[0] - dym_est;
313 if (yh < y_minus_new)
continue;
318 fscal dx = xh - x[0];
319 fscal dy = yh - y[0];
320 fscal d2 = dx*dx + dy*dy;
321 if( d2 > r2_best )
continue;
324 if (dx*dx > dxm_est2)
continue;
329 if( iHit_best < 0 )
break;
331 newHits.push_back(
RealIHit[iHit_best]);
334 L1StsHit &hit = (*vStsHitsUnused)[iHit_best];
337 L1HitPoint &point = (*vStsHitPointsUnused)[iHit_best];
338 x = point.
X(), y = point.
Y();
348 StripsToCoor(u,
v, x, y, sta);
368 fld.Set( fB2, fz2, fB1, fz1, fB0, fz0 );
373 const unsigned int NOldHits = t.
StsHits.size();
374 const unsigned int NNewHits = newHits.size();
375 t.
StsHits.resize(NNewHits + NOldHits);
376 for (
int i = NOldHits-1;
i >= 0 ;
i--) {
379 for (
unsigned int i = 0, ii = NNewHits-1;
i < NNewHits;
i++,ii--) {
384 const unsigned int NOldHits = t.
StsHits.size();
385 t.
StsHits.resize(newHits.size()+NOldHits);
386 for (
unsigned int i = 0;
i < newHits.size();
i++) {
405 BranchFitter (t, T, dir);
409 FindMoreHits(t, T, dir, T.
qp);
413 BranchFitterFast (t, T, dir, T.
qp,
false);
416 FindMoreHits(t, T, dir, T.
qp);
void L1AddPipeMaterial(L1TrackPar &T, fvec qp0, fvec w=1, fvec mass2=0.1395679f *0.1395679f)
void L1AddMaterial(L1TrackPar &T, fvec radThick, fvec qp0, fvec w=1, fvec mass2=0.1395679f *0.1395679f)
void L1Filter(L1TrackPar &T, L1UMeasurementInfo &info, fvec u, fvec w=1., fvec *du2=0)
friend F32vec4 sqrt(const F32vec4 &a)
friend F32vec4 fabs(const F32vec4 &a)
vector< unsigned char > vSFlag
L1Station vStations[MaxNStations] _fvecalignment
vector< L1Strip > vStsStrips
vector< unsigned char > vSFlagB
THitI StsHitsUnusedStartIndex[MaxNStations+1]
vector< L1StsHit > vStsHits
vector< L1Strip > vStsStripsB
vector< int > vStsHits2Unus
L1Grid vGrid[MaxNStations]
void GetFieldValue(const fvec &x, const fvec &y, L1FieldValue &B) const
L1XYMeasurementInfo XYInfo
L1UMeasurementInfo backInfo
L1MaterialInfo materialInfo
L1UMeasurementInfo frontInfo
std::vector< THitI > StsHits
contain strips positions and coordinates of hit