15 #if (defined(DUMPHITWINDOW) || defined(DEBUG_BACKWARD_FIT)) && defined(MKFIT_STANDALONE)
19 #ifndef MKFIT_STANDALONE
27 #ifndef MKFIT_STANDALONE
30 return std::isfinite(x);
40 const std::vector<bool> *ihm) {
66 const int iI = inputProp ?
iP :
iC;
68 for (
int i = beg, imp = 0;
i <
end; ++
i, ++imp) {
74 const std::vector<Track> &
tracks,
const std::vector<int> &idxs,
int beg,
int end,
bool inputProp,
int mp_offset) {
80 const int iI = inputProp ?
iP :
iC;
82 for (
int i = beg, imp = mp_offset;
i <
end; ++
i, ++imp) {
97 const int iI = inputProp ?
iP :
iC;
99 for (
int i = beg, imp = 0;
i <
end; ++
i, ++imp) {
100 const TrackCand &trk = tracks[idxs[
i].first][idxs[
i].second];
105 m_SeedAlgo(imp, 0, 0) = tracks[idxs[
i].first].seed_algo();
106 m_SeedLabel(imp, 0, 0) = tracks[idxs[
i].first].seed_label();
115 const std::vector<std::pair<int, IdxChi2List>> &idxs,
124 const int iI = inputProp ?
iP :
iC;
126 for (
int i = beg, imp = 0;
i <
end; ++
i, ++imp) {
127 const TrackCand &trk = tracks[idxs[
i].first][idxs[
i].second.trkIdx];
132 m_SeedAlgo(imp, 0, 0) = tracks[idxs[
i].first].seed_algo();
133 m_SeedLabel(imp, 0, 0) = tracks[idxs[
i].first].seed_label();
145 const int iO = outputProp ?
iP :
iC;
147 for (
int i = beg, imp = 0;
i <
end; ++
i, ++imp) {
153 std::vector<Track> &
tracks,
const std::vector<int> &idxs,
int beg,
int end,
bool outputProp)
const {
157 const int iO = outputProp ?
iP :
iC;
159 for (
int i = beg, imp = 0;
i <
end; ++
i, ++imp) {
170 const float invpt,
const float theta,
float &min_dq,
float &max_dq,
float &min_dphi,
float &max_dphi) {
173 float max_invpt = invpt;
180 if ((ILC.
c_dq_sf) * this_dq > 0.f) {
181 min_dq = (ILC.
c_dq_sf) * this_dq;
182 max_dq = 2.0f * min_dq;
188 if ((ILC.
c_dp_sf) * this_dphi > min_dphi) {
189 min_dphi = (ILC.
c_dp_sf) * this_dphi;
190 max_dphi = 2.0f * min_dphi;
210 const float invpt =
m_Par[ipar].
At(itrk, 3, 0);
213 float max_invpt = invpt;
219 if ((ILC.
c_c2_sf) * this_c2 > minChi2Cut)
238 const float nSigmaR = 3;
240 dprintf(
"LayerOfHits::SelectHitIndices %s layer=%d N_proc=%d\n",
245 float dqv[
NN], dphiv[
NN], qv[
NN], phiv[
NN];
246 int qb1v[
NN], qb2v[
NN], qbv[
NN], pb1v[
NN], pb2v[
NN];
248 const auto assignbins = [&](
int itrack,
257 dphi = std::clamp(
std::abs(dphi), min_dphi, max_dphi);
258 dq = std::clamp(dq, min_dq, max_dq);
262 dphiv[itrack] = dphi;
268 pb1v[itrack] = L.
phiBin(phi - dphi);
269 pb2v[itrack] = L.
phiBin(phi + dphi) + 1;
272 const auto calcdphi2 = [&](
int itrack,
float dphidx,
float dphidy) {
277 const auto calcdphi = [&](
float dphi2,
float min_dphi) {
284 for (
int itrack = 0; itrack <
NN; ++itrack) {
287 float min_dq = ILC.
min_dq();
288 float max_dq = ILC.
max_dq();
292 const float invpt =
m_Par[iI].
At(itrack, 3, 0);
298 const float r2 = x * x + y * y;
299 const float dphidx = -y /
r2, dphidy = x /
r2;
300 const float dphi2 = calcdphi2(itrack, dphidx, dphidy);
305 const float phi =
getPhi(x, y);
306 float dphi = calcdphi(dphi2, min_dphi);
315 assignbins(itrack, z, dz, phi, dphi, min_dq, max_dq, min_dphi, max_dphi);
321 for (
int itrack = 0; itrack <
NN; ++itrack) {
324 float min_dq = ILC.
min_dq();
325 float max_dq = ILC.
max_dq();
329 const float invpt =
m_Par[iI].
At(itrack, 3, 0);
335 const float r2 = x * x + y * y;
336 const float dphidx = -y /
r2, dphidy = x /
r2;
337 const float dphi2 = calcdphi2(itrack, dphidx, dphidy);
342 const float phi =
getPhi(x, y);
343 float dphi = calcdphi(dphi2, min_dphi);
347 y * y *
m_Err[iI].constAt(itrack, 1, 1) +
348 2 * x * y *
m_Err[iI].constAt(itrack, 0, 1)) /
354 assignbins(itrack, r, dr, phi, dphi, min_dq, max_dq, min_dphi, max_dphi);
360 for (
int itrack = 0; itrack < N_proc; ++itrack) {
366 const int qb = qbv[itrack];
367 const int qb1 = qb1v[itrack];
368 const int qb2 = qb2v[itrack];
369 const int pb1 = pb1v[itrack];
370 const int pb2 = pb2v[itrack];
373 const float q = qv[itrack];
374 const float phi = phiv[itrack];
375 const float dphi = dphiv[itrack];
376 const float dq = dqv[itrack];
378 dprintf(
" %2d/%2d: %6.3f %6.3f %6.6f %7.5f %3d %3d %4d %4d\n",
395 #if defined(DUMPHITWINDOW) && defined(MKFIT_STANDALONE)
396 int thisseedmcid = -999999;
398 int seedlabel = m_SeedLabel(itrack, 0, 0);
399 TrackVec &seedtracks = m_event->seedTracks_;
400 int thisidx = -999999;
401 for (
int i = 0;
i < int(seedtracks.size()); ++
i) {
402 auto &thisseed = seedtracks[
i];
403 if (thisseed.label() == seedlabel) {
408 if (thisidx > -999999) {
409 auto &seedtrack = m_event->seedTracks_[thisidx];
410 std::vector<int> thismcHitIDs;
411 seedtrack.mcHitIDsVec(m_event->layerHits_, m_event->simHitsInfo_, thismcHitIDs);
412 if (std::adjacent_find(thismcHitIDs.begin(), thismcHitIDs.end(), std::not_equal_to<>()) ==
413 thismcHitIDs.end()) {
414 thisseedmcid = thismcHitIDs.at(0);
420 for (
int qi = qb1; qi < qb2; ++qi) {
421 for (
int pi = pb1;
pi < pb2; ++
pi) {
426 dprint(
"dead module for track in layer=" << L.
layer_id() <<
" qb=" << qi <<
" pb=" << pb <<
" q=" << q
440 for (uint16_t hi = pbi.first; hi < pbi.second; ++hi) {
447 "Yay, denying masked hit on layer %d, hi %d, orig idx %d\n", L.
layer_info()->
layer_id(), hi, hi_orig);
458 #if defined(DUMPHITWINDOW) && defined(MKFIT_STANDALONE)
462 int st_isfindable = 0;
463 int st_label = -999999;
470 float st_eta = -999.;
471 float st_phi = -999.;
473 Track simtrack = m_event->simTracks_[mchid];
475 st_label = simtrack.
label();
476 st_prodtype = (int)simtrack.
prodType();
477 st_pt = simtrack.
pT();
478 st_eta = simtrack.
momEta();
479 st_phi = simtrack.
momPhi();
481 st_charge = simtrack.
charge();
482 st_r = simtrack.
posR();
504 float hx = thishit.
x();
505 float hy = thishit.
y();
506 float hz = thishit.
z();
507 float hr = std::hypot(hx, hy);
508 float hphi = std::atan2(hy, hx);
519 (hx * hx * thishit.
exx() + hy * hy * thishit.
eyy() + 2.0f * hx * hy *
m_msErr.
At(itrack, 0, 1)) /
526 float hchi2 = thisOutChi2[itrack];
529 float tx =
m_Par[iI].
At(itrack, 0, 0);
530 float ty =
m_Par[iI].
At(itrack, 1, 0);
531 float tz =
m_Par[iI].
At(itrack, 2, 0);
532 float tr = std::hypot(tx, ty);
533 float tphi = std::atan2(ty, tx);
534 float tchi2 =
m_Chi2(itrack, 0, 0);
547 (tx * tx * tex * tex + ty * ty * tey * tey + 2.0
f * tx * ty *
m_Err[iI].At(itrack, 0, 1)) /
552 (ty * ty * tex * tex + tx * tx * tey * tey - 2.0
f * tx * ty *
m_Err[iI].At(itrack, 0, 1)) /
553 (tr * tr * tr * tr));
556 float ht_dxy = std::hypot(hx - tx, hy - ty);
557 float ht_dz = hz - tz;
560 static bool first =
true;
565 "lyr_id/I:lyr_isbrl/I:hit_idx/I:"
566 "trk_cnt/I:trk_idx/I:trk_label/I:"
567 "trk_pt/F:trk_eta/F:trk_mphi/F:trk_chi2/F:"
569 "seed_idx/I:seed_label/I:seed_algo/I:seed_mcid/I:"
571 "st_isfindable/I:st_prodtype/I:st_label/I:"
572 "st_pt/F:st_eta/F:st_phi/F:"
573 "st_nhits/I:st_charge/I:st_r/F:st_z/F:"
574 "trk_q/F:hit_q/F:dq_trkhit/F:dq_cut/F:trk_phi/F:hit_phi/F:dphi_trkhit/F:dphi_cut/F:"
575 "t_x/F:t_y/F:t_r/F:t_phi/F:t_z/F:"
576 "t_ex/F:t_ey/F:t_er/F:t_ephi/F:t_ez/F:"
577 "h_x/F:h_y/F:h_r/F:h_phi/F:h_z/F:"
578 "h_ex/F:h_ey/F:h_er/F:h_ephi/F:h_ez/F:"
579 "ht_dxy/F:ht_dz/F:ht_dphi/F:"
592 "%6.3f %6.3f %6.3f %6.3f "
599 "%6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f "
600 "%6.3f %6.3f %6.3f %6.3f %6.3f "
601 "%6.6f %6.6f %6.6f %6.6f %6.6f "
602 "%6.3f %6.3f %6.3f %6.3f %6.3f "
603 "%6.6f %6.6f %6.6f %6.6f %6.6f "
614 1.0f /
m_Par[iI].
At(itrack, 3, 0),
620 m_SeedLabel(itrack, 0, 0),
621 m_SeedAlgo(itrack, 0, 0),
675 dprintf(
" SHI %3d %4d %4d %5d %6.3f %6.3f %6.4f %7.5f %s\n",
684 (ddq < dq && ddphi < dphi) ?
"PASS" :
"FAIL");
698 assert(
false &&
"this code has not been used in a while -- see comments in code");
724 for (
int it = 0; it <
NN; ++it) {
735 for (
int hit_cnt = 0; hit_cnt <
maxSize; ++hit_cnt) {
741 for (
int itrack = 0; itrack < N_proc; ++itrack) {
765 for (
int itrack = 0; itrack < N_proc; ++itrack) {
768 dprint(
"chi2=" << chi2 <<
" minChi2[itrack]=" << minChi2[itrack]);
769 if (chi2 < minChi2[itrack]) {
770 minChi2[itrack] =
chi2;
771 bestHit[itrack] =
m_XHitArr.
At(itrack, hit_cnt, 0);
778 for (
int itrack = 0; itrack < N_proc; ++itrack) {
796 if (bestHit[itrack] >= 0) {
798 const float chi2 = minChi2[itrack];
800 dprint(
"ADD BEST HIT FOR TRACK #"
801 << itrack << std::endl
802 <<
"prop x=" <<
m_Par[
iP].constAt(itrack, 0, 0) <<
" y=" <<
m_Par[
iP].constAt(itrack, 1, 0) << std::endl
803 <<
"copy in hit #" << bestHit[itrack] <<
" x=" << hit.
position()[0] <<
" y=" << hit.
position()[1]);
811 int fake_hit_idx = -1;
820 dprint(
"ADD FAKE HIT FOR TRACK #" << itrack <<
" withinBounds=" << (fake_hit_idx != -3)
821 <<
" r=" << std::hypot(
m_Par[
iP](itrack, 0, 0),
m_Par[
iP](itrack, 1, 0)));
836 dprint(
"update parameters");
848 dprint(
"m_Par[iP](0,0,0)=" <<
m_Par[iP](0, 0, 0) <<
" m_Par[iC](0,0,0)=" <<
m_Par[iC](0, 0, 0));
859 const float hitHL =
sqrt(msErr.
constAt(itrack, 2, 2) * 3.f);
860 const float qErr =
sqrt(pErr.
constAt(itrack, 2, 2));
861 dprint(
"qCompat " << hitHL <<
" + " << 3.
f * qErr <<
" vs " << res);
862 return hitHL +
std::max(3.
f * qErr, 0.5
f) > res;
864 const float res[2]{msPar.
constAt(itrack, 0, 0) - pPar.
constAt(itrack, 0, 0),
866 const float hitT2 = msErr.
constAt(itrack, 0, 0) + msErr.
constAt(itrack, 1, 1);
867 const float hitT2inv = 1.f / hitT2;
868 const float proj[3] = {msErr.
constAt(itrack, 0, 0) * hitT2inv,
869 msErr.
constAt(itrack, 0, 1) * hitT2inv,
870 msErr.
constAt(itrack, 1, 1) * hitT2inv};
873 pErr.
constAt(itrack, 1, 1) * proj[2]));
874 const float resProj =
875 sqrt(res[0] * proj[0] * res[0] + 2.
f * res[1] * proj[1] * res[0] + res[1] * proj[2] * res[1]);
876 dprint(
"qCompat " <<
sqrt(hitT2 * 3.
f) <<
" + " << 3.f * qErr <<
" vs " << resProj);
877 return sqrt(hitT2 * 3.f) +
std::max(3.f * qErr, 0.5f) > resProj;
887 int itrack,
bool isBarrel,
unsigned int pcm,
unsigned int pcmMin,
const MPlexLV &pPar,
const MPlexHS &msErr) {
894 const float hitT2 = msErr.
constAt(itrack, 0, 0) + msErr.
constAt(itrack, 1, 1);
895 const float hitT2inv = 1.f / hitT2;
896 const float proj[3] = {msErr.
constAt(itrack, 0, 0) * hitT2inv,
897 msErr.
constAt(itrack, 0, 1) * hitT2inv,
898 msErr.
constAt(itrack, 1, 1) * hitT2inv};
899 const bool detXY_OK =
900 std::abs(proj[0] * proj[2] - proj[1] * proj[1]) < 0.1f;
901 const float cosP =
cos(pPar.
constAt(itrack, 4, 0));
902 const float sinP =
sin(pPar.
constAt(itrack, 4, 0));
905 qSF = detXY_OK ? sinT *
std::sqrt(
std::abs(1.
f + cosP * cosP * proj[0] + sinP * sinP * proj[2] -
906 2.
f * cosP * sinP * proj[1]))
913 const float qCorr = pcm * qSF;
914 dprint(
"pcm " << pcm <<
" * " << qSF <<
" = " << qCorr <<
" vs " << pcmMin);
915 return qCorr > pcmMin;
923 std::vector<std::vector<TrackCand>> &tmp_candidates,
934 for (
int it = 0; it <
NN; ++it) {
942 dprintf(
"FindCandidates max hits to process=%d\n", maxSize);
943 int nHitsAdded[
NN]{};
945 for (
int hit_cnt = 0; hit_cnt <
maxSize; ++hit_cnt) {
951 for (
int itrack = 0; itrack < N_proc; ++itrack) {
954 mhp.addInputAt(itrack,
hit);
955 charge_pcm[itrack] =
hit.chargePerCM();
981 bool oneCandPassCut =
false;
982 for (
int itrack = 0; itrack < N_proc; ++itrack) {
989 bool isCompatible =
true;
1000 oneCandPassCut =
true;
1007 if (oneCandPassCut) {
1020 dprint(
"update parameters" << std::endl
1021 <<
"propagated track parameters x=" <<
m_Par[iP].constAt(0, 0, 0)
1022 <<
" y=" <<
m_Par[iP].constAt(0, 1, 0) << std::endl
1030 for (
int itrack = 0; itrack < N_proc; ++itrack) {
1036 if (chi2 < max_c2) {
1037 bool isCompatible =
true;
1048 bool hitExists =
false;
1051 for (
int i = 0;
i <= maxHits; ++
i) {
1063 nHitsAdded[itrack]++;
1064 dprint(
"chi2 cut passed, creating new candidate");
1068 const int hit_idx =
m_XHitArr.
At(itrack, hit_cnt, 0);
1072 newcand.
setCharge(tmpChg(itrack, 0, 0));
1077 if (chi2 < m_iteration_params->chi2CutOverlap) {
1079 ccand[
m_CandIdx(itrack, 0, 0)].considerHitForOverlap(
1087 tmp_candidates[
m_SeedIdx(itrack, 0, 0) -
offset].emplace_back(newcand);
1098 for (
int itrack = 0; itrack < N_proc; ++itrack) {
1115 else if (
m_XWsrResult[itrack].m_in_gap ==
true && nHitsAdded[itrack] == 0) {
1119 dprint(
"ADD FAKE HIT FOR TRACK #" << itrack <<
" withinBounds=" << (fake_hit_idx != -3)
1120 <<
" r=" << std::hypot(
m_Par[
iP](itrack, 0, 0),
m_Par[
iP](itrack, 1, 0)));
1129 tmp_candidates[
m_SeedIdx(itrack, 0, 0) -
offset].emplace_back(newcand);
1150 for (
int it = 0; it <
NN; ++it) {
1158 dprintf(
"FindCandidatesCloneEngine max hits to process=%d\n", maxSize);
1159 int nHitsAdded[
NN]{};
1161 for (
int hit_cnt = 0; hit_cnt <
maxSize; ++hit_cnt) {
1167 for (
int itrack = 0; itrack < N_proc; ++itrack) {
1170 mhp.addInputAt(itrack,
hit);
1171 charge_pcm[itrack] =
hit.chargePerCM();
1191 #pragma omp simd // DOES NOT VECTORIZE AS IT IS NOW
1192 for (
int itrack = 0; itrack < N_proc; ++itrack) {
1201 dprint(
"chi2=" << chi2 <<
" for trkIdx=" << itrack <<
" hitIdx=" <<
m_XHitArr.
At(itrack, hit_cnt, 0));
1202 if (chi2 < max_c2) {
1203 bool isCompatible =
true;
1216 bool hitExists =
false;
1219 for (
int i = 0;
i <= maxHits; ++
i) {
1231 nHitsAdded[itrack]++;
1232 const int hit_idx =
m_XHitArr.
At(itrack, hit_cnt, 0);
1235 if (chi2 < m_iteration_params->chi2CutOverlap) {
1236 ccand[
m_CandIdx(itrack, 0, 0)].considerHitForOverlap(
1242 tmpList.
hitIdx = hit_idx;
1254 dprint(
" adding hit with hit_cnt=" << hit_cnt <<
" for trkIdx=" << tmpList.
trkIdx
1255 <<
" orig Seed=" <<
m_Label(itrack, 0, 0));
1264 for (
int itrack = 0; itrack < N_proc; ++itrack) {
1283 else if (
m_XWsrResult[itrack].m_in_gap ==
true && nHitsAdded[itrack] == 0) {
1289 tmpList.
hitIdx = fake_hit_idx;
1301 dprint(
"adding invalid hit " << fake_hit_idx);
1310 for (
int i = 0;
i < N_proc; ++
i) {
1338 const int iO = outputProp ?
iP :
iC;
1340 for (
int i = 0;
i < N_proc; ++
i) {
1348 dprint((outputProp ?
"propagated" :
"updated")
1365 for (
int i = beg;
i <
end; ++
i, ++itrack) {
1366 const Track &trk = cands[
i];
1392 for (
int i = beg;
i <
end; ++
i, ++itrack) {
1418 const int iO = outputProp ?
iP :
iC;
1421 for (
int i = beg;
i <
end; ++
i, ++itrack) {
1439 const int iO = outputProp ?
iP :
iC;
1442 for (
int i = beg;
i <
end; ++
i, ++itrack) {
1457 #if defined(DEBUG_BACKWARD_FIT) || defined(DEBUG_BACKWARD_FIT_BH)
1459 float e2s(
float x) {
return 1e4 *
std::sqrt(x); }
1474 float tmp_err[6] = {666, 0, 666, 0, 0, 666};
1478 const int layer = lp_iter->m_layer;
1484 for (
int i = 0;
i < N_proc; ++
i) {
1542 for (
int n = 0;
n < N_proc; ++
n) {
1549 #ifdef DEBUG_BACKWARD_FIT_BH
1551 for (
int i = 0;
i < N_proc; ++
i) {
1560 "CHIHIT %3d %10g %10g %10g %10g %10g %11.5g %11.5g %11.5g %10g %10g %10g %10g %11.5g %11.5g %11.5g %10g "
1561 "%10g %10g %10g %10g %11.5g %11.5g\n",
1571 m_Par[ti].At(i, 0, 0),
1575 e2s(
m_Err[ti].At(i, 0, 0)),
1576 e2s(
m_Err[ti].At(i, 1, 1)),
1577 e2s(
m_Err[ti].At(i, 2, 2)),
1582 std::atan2(
m_Par[ti].At(i, 1, 0),
m_Par[ti].
At(i, 0, 0)),
1612 float tmp_err[6] = {666, 0, 666, 0, 0, 666};
1616 const int layer = lp_iter.layer();
1622 #if defined(DEBUG_BACKWARD_FIT)
1623 const Hit *last_hit_ptr[
NN];
1629 for (
int i = 0;
i < N_proc; ++
i) {
1649 #ifdef DEBUG_BACKWARD_FIT
1650 last_hit_ptr[
i] = &hit;
1658 #ifdef DEBUG_BACKWARD_FIT
1659 last_hit_ptr[
i] =
nullptr;
1670 if (done_count == N_proc)
1672 if (here_count == 0)
1704 for (
int n = 0;
n < N_proc; ++
n) {
1711 for (
int i = 0;
i < N_proc; ++
i) {
1712 #if defined(DEBUG_BACKWARD_FIT)
1713 if (chiDebug && last_hit_ptr[
i]) {
1716 float chi = tmp_chi2.
At(i, 0, 0);
1717 float chi_prnt = std::isfinite(chi) ? chi : -9;
1719 #if defined(MKFIT_STANDALONE)
1723 "BKF_OVERLAP %d %d %d %d %d %d %d "
1724 "%f %f %f %f %d %d %d %d "
1729 "BKF_OVERLAP %d %d %d %d %d %d "
1730 "%f %f %f %f %d %d %d "
1746 #if defined(MKFIT_STANDALONE)
1749 e2s(
m_Err[ti].At(i, 0, 0)),
1750 e2s(
m_Err[ti].At(i, 1, 1)),
1751 e2s(
m_Err[ti].At(i, 2, 2)),
void setOriginIndex(int oi)
float hit_phi(int i) const
void addHitIdx(int hitIdx, int hitLyr, float chi2)
const SVector6 & parameters() const
void copy_in(const Track &trk, const int mslot, const int tslot)
static constexpr int MPlexHitIdxMax
const IterationLayerConfig * m_iteration_layer_config
int qBinChecked(float q) const
void setDiagonal3x3(idx_t n, T d)
const HitOnTrack * m_HoTArr[NN]
int getOriginalHitIndex(int i) const
void kalmanOperationEndcap(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)
void copyIn(idx_t n, const T *arr)
HitOnTrack m_HoTArrs[NN][Config::nMaxTrkHits]
void inputTracksAndHitIdx(const std::vector< Track > &tracks, int beg, int end, bool inputProp)
void bkFitInputTracks(TrackVec &cands, int beg, int end)
Sin< T >::type sin(const T &t)
void copyOut(idx_t n, T *arr) const
const Hit * hitArray() const
void outputTracksAndHitIdx(std::vector< Track > &tracks, int beg, int end, bool outputProp) const
PropagationFlags backward_fit_pflags
void addInput(const T &item)
Geom::Theta< T > theta() const
T & At(idx_t n, idx_t i, idx_t j)
bool phi_bin_dead(int qi, int pi) const
void selectHitIndices(const LayerOfHits &layer_of_hits, const int N_proc)
auto const & tracks
cannot be loose
void(* m_compute_chi2_foo)(const MPlexLS &, const MPlexLV &, const MPlexQI &, const MPlexHS &, const MPlexHV &, MPlexQF &, MPlexLV &, const int, const PropagationFlags, const bool)
void bkFitPropTracksToPCA(const int N_proc)
SMatrixSym66 & errors_nc()
WSR_Result is_within_z_sensitive_region(float z, float dz) const
int phiMaskApply(int in) const
void add_hit(const int mslot, int index, int layer)
float getEta(float r, float z)
constexpr bool isFinite(T x)
const float * errArray() const
static unsigned int maxChargePerCM()
const LayerInfo * layer_info() const
const IterationParams * m_iteration_params
constexpr std::array< uint8_t, layerIndexSize > layer
iterator make_iterator(IterationType_e type) const
void kalmanOperation(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)
void findCandidates(const LayerOfHits &layer_of_hits, std::vector< std::vector< TrackCand >> &tmp_candidates, const int offset, const int N_proc, const FindingFoos &fnd_foos)
void(* m_update_param_foo)(const MPlexLS &, const MPlexLV &, MPlexQI &, const MPlexHS &, const MPlexHV &, MPlexLS &, MPlexLV &, const int, const PropagationFlags, const bool)
constexpr bool usePhiQArrays
PropagationFlags finding_inter_layer_pflags
bool isStripQCompatible(int itrack, bool isBarrel, const MPlexLS &pErr, const MPlexLV &pPar, const MPlexHS &msErr, const MPlexHV &msPar)
void add(const Matriplex &v)
const PropagationConfig * m_prop_config
const T & constAt(idx_t n, idx_t i, idx_t j) const
void setup_bkfit(const PropagationConfig &pc)
float getScoreStruct(const IdxChi2List &cand1)
const float * posArray() const
tuple maxSize
'/store/data/Commissioning08/BeamHalo/RECO/StuffAlmostToP5_v1/000/061/642/10A0FE34-A67D-DD11-AD05-000...
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
constexpr Matriplex::idx_t NN
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
const HoTNode * hotsData() const
void propagateTracksToHitR(const MPlexHV &par, const int N_proc, const PropagationFlags pf, const MPlexQI *noMatEffPtr=nullptr)
MPlexQI m_NTailMinusOneHits
uint16_t const *__restrict__ x
int phiBin(float phi) const
HitOnTrack hot(int i) const
ProdType prodType() const
PhiBinInfo_t phi_bin_info(int qi, int pi) const
void setup(const PropagationConfig &pc, const IterationParams &ip, const IterationLayerConfig &ilc, const std::vector< bool > *ihm)
PropagationFlags pca_prop_pflags
bool finding_requires_propagation_to_hit_pos
constexpr float nSigmaPhi
CombCandidate * combCandidate() const
void updateWithLastHit(const LayerOfHits &layer_of_hits, int N_proc, const FindingFoos &fnd_foos)
TrackCand * m_TrkCand[NN]
std::vector< Track > TrackVec
float getScoreCand(const TrackCand &cand1, bool penalizeTailMissHits=false, bool inFindCandidates=false)
const SVector3 & position() const
const HitOnTrack * getHitsOnTrackArray() const
void pack(TMerr &err, TMpar &par)
void bkFitFitTracks(const EventOfHits &eventofhits, const SteeringParams &st_par, const int N_proc, bool chiDebug=false)
static const FindingFoos & get_finding_foos(bool is_barrel)
std::vector< LayerControl > m_layer_plan
void copyOutParErr(std::vector< CombCandidate > &seed_cand_vec, int N_proc, bool outputProp) const
bool passStripChargePCMfromTrack(int itrack, bool isBarrel, unsigned int pcm, unsigned int pcmMin, const MPlexLV &pPar, const MPlexHS &msErr)
float getPhi(float x, float y)
const T & constAt(idx_t n, idx_t i, idx_t j) const
const Hit & refHit(int i) const
void bkFitOutputTracks(TrackVec &cands, int beg, int end, bool outputProp)
void bkFitFitTracksBH(const EventOfHits &eventofhits, const SteeringParams &st_par, const int N_proc, bool chiDebug=false)
void copyIn(idx_t n, const T *arr)
void findCandidatesCloneEngine(const LayerOfHits &layer_of_hits, CandCloner &cloner, const int offset, const int N_proc, const FindingFoos &fnd_foos)
unsigned int detIDinLayer() const
const std::vector< bool > * m_iteration_hit_mask
PropagationFlags finding_intra_layer_pflags
int num_inside_minus_one_hits(const int mslot) const
void add_cand(int idx, const IdxChi2List &cand_info)
float getHitSelDynamicChi2Cut(const int itrk, const int ipar)
WSR_Result is_within_r_sensitive_region(float r, float dr) const
const HoTNode * m_HoTNodeArr[NN]
int num_all_minus_one_hits(const int mslot) const
WSR_Result m_XWsrResult[NN]
void getHitSelDynamicWindows(const float invpt, const float theta, float &min_dq, float &max_dq, float &min_dphi, float &max_dphi)
void copy_out(Track &trk, const int mslot, const int tslot) const
T & At(idx_t n, idx_t i, idx_t j)
CombCandidate & combCandWithOriginalIndex(int idx)
static unsigned int minChargePerCM()
SVector6 & parameters_nc()
void copyOut(idx_t n, T *arr) const
void propagateTracksToHitZ(const MPlexHV &par, const int N_proc, const PropagationFlags pf, const MPlexQI *noMatEffPtr=nullptr)
void propagateTracksToPCAZ(const int N_proc, const PropagationFlags pf)
void addBestHit(const LayerOfHits &layer_of_hits, const int N_proc, const FindingFoos &fnd_foos)