14 #if (defined(DUMPHITWINDOW) || defined(DEBUG_BACKWARD_FIT)) && defined(MKFIT_STANDALONE) 18 #ifndef MKFIT_STANDALONE 26 #ifndef MKFIT_STANDALONE 29 return std::isfinite(
x);
39 const std::vector<bool> *ihm) {
65 const int iI = inputProp ?
iP :
iC;
67 for (
int i = beg, imp = 0;
i <
end; ++
i, ++imp) {
73 const std::vector<Track> &
tracks,
const std::vector<int> &idxs,
int beg,
int end,
bool inputProp,
int mp_offset) {
79 const int iI = inputProp ?
iP :
iC;
81 for (
int i = beg, imp = mp_offset;
i <
end; ++
i, ++imp) {
96 const int iI = inputProp ?
iP :
iC;
98 for (
int i = beg, imp = 0;
i <
end; ++
i, ++imp) {
104 m_SeedAlgo(imp, 0, 0) =
tracks[idxs[
i].first].seed_algo();
105 m_SeedLabel(imp, 0, 0) =
tracks[idxs[
i].first].seed_label();
114 const std::vector<std::pair<int, IdxChi2List>> &idxs,
123 const int iI = inputProp ?
iP :
iC;
125 for (
int i = beg, imp = 0;
i <
end; ++
i, ++imp) {
131 m_SeedAlgo(imp, 0, 0) =
tracks[idxs[
i].first].seed_algo();
132 m_SeedLabel(imp, 0, 0) =
tracks[idxs[
i].first].seed_label();
144 const int iO = outputProp ?
iP :
iC;
146 for (
int i = beg, imp = 0;
i <
end; ++
i, ++imp) {
152 std::vector<Track> &
tracks,
const std::vector<int> &idxs,
int beg,
int end,
bool outputProp)
const {
156 const int iO = outputProp ?
iP :
iC;
158 for (
int i = beg, imp = 0;
i <
end; ++
i, ++imp) {
169 const float invpt,
const float theta,
float &min_dq,
float &max_dq,
float &min_dphi,
float &max_dphi) {
172 float max_invpt = invpt;
179 if ((ILC.
c_dq_sf) * this_dq > 0.f) {
180 min_dq = (ILC.
c_dq_sf) * this_dq;
181 max_dq = 2.0f * min_dq;
187 if ((ILC.
c_dp_sf) * this_dphi > min_dphi) {
188 min_dphi = (ILC.
c_dp_sf) * this_dphi;
189 max_dphi = 2.0f * min_dphi;
209 const float invpt =
m_Par[ipar].
At(itrk, 3, 0);
212 float max_invpt = invpt;
218 if ((ILC.
c_c2_sf) * this_c2 > minChi2Cut)
238 const float nSigmaR = 3;
240 dprintf(
"LayerOfHits::SelectHitIndices %s layer=%d N_proc=%d\n",
241 L.is_barrel() ?
"barrel" :
"endcap",
245 float dqv[
NN], dphiv[
NN], qv[
NN], phiv[
NN];
246 bidx_t 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;
265 qbv[itrack] =
L.qBinChecked(
q);
266 qb1v[itrack] =
L.qBinChecked(
q - dq);
267 qb2v[itrack] =
L.qBinChecked(
q + dq) + 1;
268 pb1v[itrack] =
L.phiBinChecked(phi - dphi);
269 pb2v[itrack] =
L.phiMaskApply(
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);
310 const float edgeCorr =
std::abs(0.5
f * (
L.layer_info()->rout() -
L.layer_info()->rin()) /
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)) /
350 const float edgeCorr =
std::abs(0.5
f * (
L.layer_info()->zmax() -
L.layer_info()->zmin()) *
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 bidx_t qb = qbv[itrack];
367 const bidx_t qb1 = qb1v[itrack];
368 const bidx_t qb2 = qb2v[itrack];
369 const bidx_t pb1 = pb1v[itrack];
370 const bidx_t 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 %3u %3u %4u %4u\n",
379 L.layer_id(), itrack,
q, phi, dq, dphi,
387 #if defined(DUMPHITWINDOW) && defined(MKFIT_STANDALONE) 388 int thisseedmcid = -999999;
390 int seedlabel = m_SeedLabel(itrack, 0, 0);
391 TrackVec &seedtracks = m_event->seedTracks_;
392 int thisidx = -999999;
393 for (
int i = 0;
i <
int(seedtracks.size()); ++
i) {
394 auto &thisseed = seedtracks[
i];
395 if (thisseed.label() == seedlabel) {
400 if (thisidx > -999999) {
401 auto &seedtrack = m_event->seedTracks_[thisidx];
402 std::vector<int> thismcHitIDs;
403 seedtrack.mcHitIDsVec(m_event->layerHits_, m_event->simHitsInfo_, thismcHitIDs);
404 if (std::adjacent_find(thismcHitIDs.begin(), thismcHitIDs.end(), std::not_equal_to<>()) ==
405 thismcHitIDs.end()) {
406 thisseedmcid = thismcHitIDs.at(0);
412 for (bidx_t qi = qb1; qi != qb2; ++qi) {
413 for (bidx_t
pi = pb1;
pi != pb2;
pi =
L.phiMaskApply(
pi + 1)) {
415 if (qi == qb &&
L.isBinDead(
pi, qi) ==
true) {
416 dprint(
"dead module for track in layer=" <<
L.layer_id() <<
" qb=" << qi <<
" pi=" <<
pi <<
" q=" <<
q 429 auto pbi =
L.phiQBinContent(
pi, qi);
430 for (bcnt_t
hi = pbi.begin();
hi < pbi.end(); ++
hi) {
433 unsigned int hi_orig =
L.getOriginalHitIndex(
hi);
437 "Yay, denying masked hit on layer %u, hi %u, orig idx %u\n",
L.layer_info()->layer_id(),
hi, hi_orig);
448 #if defined(DUMPHITWINDOW) && defined(MKFIT_STANDALONE) 450 const MCHitInfo &mchinfo = m_event->simHitsInfo_[
L.refHit(
hi).mcHitID()];
452 int st_isfindable = 0;
453 int st_label = -999999;
460 float st_eta = -999.;
461 float st_phi = -999.;
463 Track simtrack = m_event->simTracks_[mchid];
465 st_label = simtrack.
label();
467 st_pt = simtrack.
pT();
468 st_eta = simtrack.
momEta();
469 st_phi = simtrack.
momPhi();
471 st_charge = simtrack.
charge();
472 st_r = simtrack.
posR();
476 const Hit &thishit =
L.refHit(
hi);
494 float hx = thishit.
x();
495 float hy = thishit.
y();
496 float hz = thishit.
z();
497 float hr = std::hypot(hx, hy);
498 float hphi = std::atan2(hy, hx);
509 (hx * hx * thishit.
exx() + hy * hy * thishit.
eyy() + 2.0f * hx * hy *
m_msErr.
At(itrack, 0, 1)) /
516 float hchi2 = thisOutChi2[itrack];
519 float tx =
m_Par[iI].
At(itrack, 0, 0);
520 float ty =
m_Par[iI].
At(itrack, 1, 0);
521 float tz =
m_Par[iI].
At(itrack, 2, 0);
522 float tr = std::hypot(tx, ty);
523 float tphi = std::atan2(ty, tx);
524 float tchi2 =
m_Chi2(itrack, 0, 0);
537 (tx * tx *
tex *
tex + ty * ty * tey * tey + 2.0
f * tx * ty *
m_Err[iI].At(itrack, 0, 1)) /
542 (ty * ty *
tex *
tex + tx * tx * tey * tey - 2.0
f * tx * ty *
m_Err[iI].At(itrack, 0, 1)) /
543 (tr * tr * tr * tr));
546 float ht_dxy = std::hypot(hx - tx, hy - ty);
547 float ht_dz = hz - tz;
550 static bool first =
true;
555 "lyr_id/I:lyr_isbrl/I:hit_idx/I:" 556 "trk_cnt/I:trk_idx/I:trk_label/I:" 557 "trk_pt/F:trk_eta/F:trk_mphi/F:trk_chi2/F:" 559 "seed_idx/I:seed_label/I:seed_algo/I:seed_mcid/I:" 561 "st_isfindable/I:st_prodtype/I:st_label/I:" 562 "st_pt/F:st_eta/F:st_phi/F:" 563 "st_nhits/I:st_charge/I:st_r/F:st_z/F:" 564 "trk_q/F:hit_q/F:dq_trkhit/F:dq_cut/F:trk_phi/F:hit_phi/F:dphi_trkhit/F:dphi_cut/F:" 565 "t_x/F:t_y/F:t_r/F:t_phi/F:t_z/F:" 566 "t_ex/F:t_ey/F:t_er/F:t_ephi/F:t_ez/F:" 567 "h_x/F:h_y/F:h_r/F:h_phi/F:h_z/F:" 568 "h_ex/F:h_ey/F:h_er/F:h_ephi/F:h_ez/F:" 569 "ht_dxy/F:ht_dz/F:ht_dphi/F:" 578 printf(
"HITWINDOWSEL " 582 "%6.3f %6.3f %6.3f %6.3f " 589 "%6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f " 590 "%6.3f %6.3f %6.3f %6.3f %6.3f " 591 "%6.6f %6.6f %6.6f %6.6f %6.6f " 592 "%6.3f %6.3f %6.3f %6.3f %6.3f " 593 "%6.6f %6.6f %6.6f %6.6f %6.6f " 598 L.layer_id(),
L.is_barrel(),
L.getOriginalHitIndex(
hi),
600 1.0f /
m_Par[iI].
At(itrack, 3, 0),
getEta(
m_Par[iI].At(itrack, 5, 0)),
m_Par[iI].
At(itrack, 4, 0),
m_Chi2(itrack, 0, 0),
602 m_SeedIdx(itrack, 0, 0), m_SeedLabel(itrack, 0, 0), m_SeedAlgo(itrack, 0, 0), thisseedmcid,
604 st_isfindable, st_prodtype, st_label,
605 st_pt, st_eta, st_phi,
606 st_nhits, st_charge, st_r, st_z,
607 q,
L.hit_q(
hi), ddq, dq, phi,
L.hit_phi(
hi), ddphi, dphi,
608 tx, ty, tr, tphi, tz,
609 tex, tey, ter, tephi, tez,
610 hx, hy, hr, hphi, hz,
611 hex, hey, her, hephi, hez,
612 ht_dxy, ht_dz, ht_dphi,
624 dprintf(
" SHI %3u %4u %5u %6.3f %6.3f %6.4f %7.5f %s\n",
626 ddq, ddphi, (ddq < dq && ddphi < dphi) ?
"PASS" :
"FAIL");
641 assert(
false &&
"this code has not been used in a while -- see comments in code");
667 for (
int it = 0; it <
NN; ++it) {
678 for (
int hit_cnt = 0; hit_cnt <
maxSize; ++hit_cnt) {
684 for (
int itrack = 0; itrack < N_proc; ++itrack) {
708 for (
int itrack = 0; itrack < N_proc; ++itrack) {
714 bestHit[itrack] =
m_XHitArr.
At(itrack, hit_cnt, 0);
721 for (
int itrack = 0; itrack < N_proc; ++itrack) {
739 if (bestHit[itrack] >= 0) {
743 dprint(
"ADD BEST HIT FOR TRACK #" 744 << itrack << std::endl
745 <<
"prop x=" <<
m_Par[
iP].constAt(itrack, 0, 0) <<
" y=" <<
m_Par[
iP].constAt(itrack, 1, 0) << std::endl
746 <<
"copy in hit #" << bestHit[itrack] <<
" x=" <<
hit.position()[0] <<
" y=" <<
hit.position()[1]);
764 <<
" r=" << std::hypot(
m_Par[
iP](itrack, 0, 0),
m_Par[
iP](itrack, 1, 0)));
779 dprint(
"update parameters");
791 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));
802 const float hitHL =
sqrt(msErr.
constAt(itrack, 2, 2) * 3.f);
803 const float qErr =
sqrt(pErr.
constAt(itrack, 2, 2));
804 dprint(
"qCompat " << hitHL <<
" + " << 3.
f * qErr <<
" vs " <<
res);
809 const float hitT2 = msErr.
constAt(itrack, 0, 0) + msErr.
constAt(itrack, 1, 1);
810 const float hitT2inv = 1.f / hitT2;
811 const float proj[3] = {msErr.
constAt(itrack, 0, 0) * hitT2inv,
812 msErr.
constAt(itrack, 0, 1) * hitT2inv,
813 msErr.
constAt(itrack, 1, 1) * hitT2inv};
817 const float resProj =
819 dprint(
"qCompat " <<
sqrt(hitT2 * 3.
f) <<
" + " << 3.
f * qErr <<
" vs " << resProj);
830 int itrack,
bool isBarrel,
unsigned int pcm,
unsigned int pcmMin,
const MPlexLV &pPar,
const MPlexHS &msErr) {
837 const float hitT2 = msErr.
constAt(itrack, 0, 0) + msErr.
constAt(itrack, 1, 1);
838 const float hitT2inv = 1.f / hitT2;
839 const float proj[3] = {msErr.
constAt(itrack, 0, 0) * hitT2inv,
840 msErr.
constAt(itrack, 0, 1) * hitT2inv,
841 msErr.
constAt(itrack, 1, 1) * hitT2inv};
842 const bool detXY_OK =
844 const float cosP =
cos(pPar.
constAt(itrack, 4, 0));
845 const float sinP =
sin(pPar.
constAt(itrack, 4, 0));
849 2.
f * cosP * sinP *
proj[1]))
856 const float qCorr = pcm * qSF;
857 dprint(
"pcm " << pcm <<
" * " << qSF <<
" = " << qCorr <<
" vs " << pcmMin);
858 return qCorr > pcmMin;
866 std::vector<std::vector<TrackCand>> &tmp_candidates,
877 for (
int it = 0; it <
NN; ++it) {
887 int nHitsAdded[
NN]{};
888 bool isTooLargeCluster[
NN]{
false};
890 for (
int hit_cnt = 0; hit_cnt <
maxSize; ++hit_cnt) {
896 for (
int itrack = 0; itrack < N_proc; ++itrack) {
899 mhp.addInputAt(itrack,
hit);
900 charge_pcm[itrack] =
hit.chargePerCM();
926 bool oneCandPassCut =
false;
927 for (
int itrack = 0; itrack < N_proc; ++itrack) {
934 bool isCompatible =
true;
948 isTooLargeCluster[itrack] =
true;
949 isCompatible =
false;
954 oneCandPassCut =
true;
961 if (oneCandPassCut) {
974 dprint(
"update parameters" << std::endl
975 <<
"propagated track parameters x=" <<
m_Par[
iP].constAt(0, 0, 0)
976 <<
" y=" <<
m_Par[
iP].constAt(0, 1, 0) << std::endl
984 for (
int itrack = 0; itrack < N_proc; ++itrack) {
991 bool isCompatible =
true;
1005 isCompatible =
false;
1009 bool hitExists =
false;
1024 nHitsAdded[itrack]++;
1025 dprint(
"chi2 cut passed, creating new candidate");
1029 const int hit_idx =
m_XHitArr.
At(itrack, hit_cnt, 0);
1033 newcand.
setCharge(tmpChg(itrack, 0, 0));
1039 if (
chi2 < max_c2) {
1041 ccand[
m_CandIdx(itrack, 0, 0)].considerHitForOverlap(
1049 tmp_candidates[
m_SeedIdx(itrack, 0, 0) -
offset].emplace_back(newcand);
1060 for (
int itrack = 0; itrack < N_proc; ++itrack) {
1077 else if (
m_XWsrResult[itrack].m_in_gap ==
true && nHitsAdded[itrack] == 0) {
1081 else if (isTooLargeCluster[itrack] ==
true && nHitsAdded[itrack] == 0) {
1086 <<
" r=" << std::hypot(
m_Par[
iP](itrack, 0, 0),
m_Par[
iP](itrack, 1, 0)));
1095 tmp_candidates[
m_SeedIdx(itrack, 0, 0) -
offset].emplace_back(newcand);
1116 for (
int it = 0; it <
NN; ++it) {
1124 dprintf(
"FindCandidatesCloneEngine max hits to process=%d\n",
maxSize);
1126 int nHitsAdded[
NN]{};
1127 bool isTooLargeCluster[
NN]{
false};
1129 for (
int hit_cnt = 0; hit_cnt <
maxSize; ++hit_cnt) {
1135 for (
int itrack = 0; itrack < N_proc; ++itrack) {
1138 mhp.addInputAt(itrack,
hit);
1139 charge_pcm[itrack] =
hit.chargePerCM();
1159 #pragma omp simd // DOES NOT VECTORIZE AS IT IS NOW 1160 for (
int itrack = 0; itrack < N_proc; ++itrack) {
1169 dprint(
"chi2=" <<
chi2 <<
" for trkIdx=" << itrack <<
" hitIdx=" <<
m_XHitArr.
At(itrack, hit_cnt, 0));
1170 if (
chi2 < max_c2) {
1171 bool isCompatible =
true;
1186 isTooLargeCluster[itrack] =
true;
1187 isCompatible =
false;
1193 bool hitExists =
false;
1208 nHitsAdded[itrack]++;
1209 const int hit_idx =
m_XHitArr.
At(itrack, hit_cnt, 0);
1213 if (
chi2 < max_c2) {
1214 ccand[
m_CandIdx(itrack, 0, 0)].considerHitForOverlap(
1220 tmpList.
hitIdx = hit_idx;
1232 dprint(
" adding hit with hit_cnt=" << hit_cnt <<
" for trkIdx=" << tmpList.
trkIdx 1233 <<
" orig Seed=" <<
m_Label(itrack, 0, 0));
1242 for (
int itrack = 0; itrack < N_proc; ++itrack) {
1261 else if (
m_XWsrResult[itrack].m_in_gap ==
true && nHitsAdded[itrack] == 0) {
1265 else if (isTooLargeCluster[itrack] ==
true && nHitsAdded[itrack] == 0) {
1271 tmpList.
hitIdx = fake_hit_idx;
1283 dprint(
"adding invalid hit " << fake_hit_idx);
1292 for (
int i = 0;
i < N_proc; ++
i) {
1320 const int iO = outputProp ?
iP :
iC;
1322 for (
int i = 0;
i < N_proc; ++
i) {
1330 dprint((outputProp ?
"propagated" :
"updated")
1331 <<
" track parameters x=" <<
cand.parameters()[0] <<
" y=" <<
cand.parameters()[1]
1332 <<
" z=" <<
cand.parameters()[2] <<
" pt=" << 1. /
cand.parameters()[3] <<
" posEta=" <<
cand.posEta());
1347 for (
int i = beg;
i <
end; ++
i, ++itrack) {
1374 for (
int i = beg;
i <
end; ++
i, ++itrack) {
1400 const int iO = outputProp ?
iP :
iC;
1403 for (
int i = beg;
i <
end; ++
i, ++itrack) {
1421 const int iO = outputProp ?
iP :
iC;
1424 for (
int i = beg;
i <
end; ++
i, ++itrack) {
1439 #if defined(DEBUG_BACKWARD_FIT) || defined(DEBUG_BACKWARD_FIT_BH) 1456 float tmp_err[6] = {666, 0, 666, 0, 0, 666};
1460 const int layer = lp_iter->m_layer;
1466 for (
int i = 0;
i < N_proc; ++
i) {
1524 for (
int n = 0;
n < N_proc; ++
n) {
1531 #ifdef DEBUG_BACKWARD_FIT_BH 1533 for (
int i = 0;
i < N_proc; ++
i) {
1542 "CHIHIT %3d %10g %10g %10g %10g %10g %11.5g %11.5g %11.5g %10g %10g %10g %10g %11.5g %11.5g %11.5g %10g " 1543 "%10g %10g %10g %10g %11.5g %11.5g\n",
1557 e2s(
m_Err[ti].At(
i, 0, 0)),
1558 e2s(
m_Err[ti].At(
i, 1, 1)),
1559 e2s(
m_Err[ti].At(
i, 2, 2)),
1594 float tmp_err[6] = {666, 0, 666, 0, 0, 666};
1598 const int layer = lp_iter.layer();
1604 #if defined(DEBUG_BACKWARD_FIT) 1605 const Hit *last_hit_ptr[
NN];
1611 for (
int i = 0;
i < N_proc; ++
i) {
1631 #ifdef DEBUG_BACKWARD_FIT 1632 last_hit_ptr[
i] = &
hit;
1640 #ifdef DEBUG_BACKWARD_FIT 1641 last_hit_ptr[
i] =
nullptr;
1652 if (done_count == N_proc)
1654 if (here_count == 0)
1686 for (
int n = 0;
n < N_proc; ++
n) {
1693 for (
int i = 0;
i < N_proc; ++
i) {
1694 #if defined(DEBUG_BACKWARD_FIT) 1695 if (chiDebug && last_hit_ptr[
i]) {
1698 float chi = tmp_chi2.
At(
i, 0, 0);
1699 float chi_prnt = std::isfinite(chi) ? chi : -9;
1701 #if defined(MKFIT_STANDALONE) 1705 "BKF_OVERLAP %d %d %d %d %d %d %d " 1706 "%f %f %f %f %d %d %d %d " 1711 "BKF_OVERLAP %d %d %d %d %d %d " 1712 "%f %f %f %f %d %d %d " 1728 #if defined(MKFIT_STANDALONE) 1731 e2s(
m_Err[ti].At(
i, 0, 0)),
1732 e2s(
m_Err[ti].At(
i, 1, 1)),
1733 e2s(
m_Err[ti].At(
i, 2, 2)),
void setOriginIndex(int oi)
void addHitIdx(int hitIdx, int hitLyr, float chi2)
unsigned int maxClusterSize
void copy_in(const Track &trk, const int mslot, const int tslot)
static constexpr int MPlexHitIdxMax
const SVector6 & parameters() const
const IterationLayerConfig * m_iteration_layer_config
void setDiagonal3x3(idx_t n, T d)
const HitOnTrack * m_HoTArr[NN]
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 copy_out(Track &trk, const int mslot, const int tslot) const
void copyIn(idx_t n, const T *arr)
void outputTracksAndHitIdx(std::vector< Track > &tracks, int beg, int end, bool outputProp) const
HitOnTrack m_HoTArrs[NN][Config::nMaxTrkHits]
const Hit * hitArray() const
void inputTracksAndHitIdx(const std::vector< Track > &tracks, int beg, int end, bool inputProp)
void bkFitInputTracks(TrackVec &cands, int beg, int end)
const T & constAt(idx_t n, idx_t i, idx_t j) const
Sin< T >::type sin(const T &t)
PropagationFlags backward_fit_pflags
void addInput(const T &item)
ProdType prodType() const
T & At(idx_t n, idx_t i, idx_t j)
void selectHitIndices(const LayerOfHits &layer_of_hits, const int N_proc)
void bkFitPropTracksToPCA(const int N_proc)
SMatrixSym66 & errors_nc()
void add_hit(const int mslot, int index, int layer)
float getEta(float r, float z)
constexpr bool isFinite(T x)
const float * posArray() const
static unsigned int maxChargePerCM()
static constexpr int kHitStopIdx
const IterationParams * m_iteration_params
constexpr std::array< uint8_t, layerIndexSize > layer
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)
static constexpr int kHitInGapIdx
constexpr bool usePhiQArrays
const HoTNode * hotsData() const
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
void setup_bkfit(const PropagationConfig &pc)
iterator make_iterator(IterationType_e type) const
const T & constAt(idx_t n, idx_t i, idx_t j) const
int num_all_minus_one_hits(const int mslot) const
float getScoreStruct(const IdxChi2List &cand1)
float getScoreCand(const Track &cand1, bool penalizeTailMissHits=false, bool inFindCandidates=false)
unsigned int detIDinLayer() const
void(* m_compute_chi2_foo)(const MPlexLS &, const MPlexLV &, const MPlexQI &, const MPlexHS &, const MPlexHV &, MPlexQF &, MPlexLV &, const int, const PropagationFlags, const bool)
const float * errArray() const
constexpr Matriplex::idx_t NN
unsigned int bin_content_t
Cos< T >::type cos(const T &t)
CombCandidate * combCandidate() const
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
void propagateTracksToHitR(const MPlexHV &par, const int N_proc, const PropagationFlags pf, const MPlexQI *noMatEffPtr=nullptr)
MPlexQI m_NTailMinusOneHits
void copyOut(idx_t n, T *arr) const
const HitOnTrack * getHitsOnTrackArray() 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
void updateWithLastHit(const LayerOfHits &layer_of_hits, int N_proc, const FindingFoos &fnd_foos)
TrackCand * m_TrkCand[NN]
std::vector< Track > TrackVec
auto const & tracks
cannot be loose
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
bool passStripChargePCMfromTrack(int itrack, bool isBarrel, unsigned int pcm, unsigned int pcmMin, const MPlexLV &pPar, const MPlexHS &msErr)
float getPhi(float x, float y)
static constexpr int kHitMaxClusterIdx
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)
HitOnTrack hot(int i) const
void copyOutParErr(std::vector< CombCandidate > &seed_cand_vec, int N_proc, bool outputProp) const
int num_inside_minus_one_hits(const int mslot) const
void findCandidatesCloneEngine(const LayerOfHits &layer_of_hits, CandCloner &cloner, const int offset, const int N_proc, const FindingFoos &fnd_foos)
void copyOut(idx_t n, T *arr) const
const std::vector< bool > * m_iteration_hit_mask
PropagationFlags finding_intra_layer_pflags
void add_cand(int idx, const IdxChi2List &cand_info)
float getHitSelDynamicChi2Cut(const int itrk, const int ipar)
static constexpr int kHitMissIdx
const HoTNode * m_HoTNodeArr[NN]
unsigned short bin_index_t
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)
Geom::Theta< T > theta() const
static constexpr int kHitEdgeIdx
void(* m_update_param_foo)(const MPlexLS &, const MPlexLV &, MPlexQI &, const MPlexHS &, const MPlexHV &, MPlexLS &, MPlexLV &, const int, const PropagationFlags, const bool)
T & At(idx_t n, idx_t i, idx_t j)
CombCandidate & combCandWithOriginalIndex(int idx)
static unsigned int minChargePerCM()
SVector6 & parameters_nc()
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)
const Hit & refHit(int i) const
void addBestHit(const LayerOfHits &layer_of_hits, const int N_proc, const FindingFoos &fnd_foos)