17 #ifdef MKFIT_STANDALONE 25 #include "oneapi/tbb/parallel_for.h" 26 #include "oneapi/tbb/parallel_for_each.h" 62 using namespace mkfit;
65 struct RangeOfSeedIndices {
66 int m_rng_beg, m_rng_end;
69 RangeOfSeedIndices(
int rb,
int re) : m_rng_beg(rb), m_rng_end(re) {
reset(); }
76 bool valid()
const {
return m_beg < m_rng_end; }
78 int n_proc()
const {
return m_end - m_beg; }
92 struct RegionOfSeedIndices {
93 int m_reg_beg, m_reg_end, m_vec_cnt;
95 RegionOfSeedIndices(
const std::vector<int> &seedEtaSeparators,
int region) {
96 m_reg_beg = (
region == 0) ? 0 : seedEtaSeparators[
region - 1];
97 m_reg_end = seedEtaSeparators[
region];
98 m_vec_cnt = (m_reg_end - m_reg_beg +
NN - 1) /
NN;
101 int count()
const {
return m_reg_end - m_reg_beg; }
103 tbb::blocked_range<int> tbb_blk_rng_std(
int thr_hint = -1)
const {
106 return tbb::blocked_range<int>(m_reg_beg, m_reg_end, thr_hint);
109 tbb::blocked_range<int> tbb_blk_rng_vec()
const {
113 RangeOfSeedIndices seed_rng(
const tbb::blocked_range<int> &
i)
const {
114 return RangeOfSeedIndices(m_reg_beg +
NN *
i.begin(),
std::min(m_reg_beg +
NN *
i.end(), m_reg_end));
119 void pre_prop_print(
int ilay,
MkBase *fir) {
120 const float pt = 1.f / fir->
getPar(0, 0, 3);
121 std::cout <<
"propagate to lay=" << ilay <<
" start from x=" << fir->
getPar(0, 0, 0)
122 <<
" y=" << fir->
getPar(0, 0, 1) <<
" z=" << fir->
getPar(0, 0, 2)
128 void post_prop_print(
int ilay,
MkBase *fir) {
129 std::cout <<
"propagate to lay=" << ilay <<
" arrive at x=" << fir->
getPar(0, 1, 0) <<
" y=" << fir->
getPar(0, 1, 1)
135 std::cout <<
"MX - found seed with label=" <<
seed.label() <<
" nHits=" <<
seed.nFoundHits()
136 <<
" chi2=" <<
seed.chi2() <<
" posEta=" <<
seed.posEta() <<
" posPhi=" <<
seed.posPhi()
137 <<
" posR=" <<
seed.posR() <<
" posZ=" <<
seed.z() <<
" pT=" <<
seed.pT() << std::endl;
141 std::cout <<
"MX - found seed with nFoundHits=" <<
seed.nFoundHits() <<
" chi2=" <<
seed.chi2() <<
" x=" <<
seed.x()
142 <<
" y=" <<
seed.y() <<
" z=" <<
seed.z() <<
" px=" <<
seed.px() <<
" py=" <<
seed.py()
143 <<
" pz=" <<
seed.pz() <<
" pT=" <<
seed.pT() << std::endl;
155 print_seed2(event_of_comb_cands[
iseed].front());
181 int lsize = eoh[
l].nHits();
184 maxL = eoh[
l].layer_id();
218 std::cout <<
"MkBuilder building tracks with '" << build_type <<
"'" 236 const bool seeds_sorted,
237 std::function<insert_seed_foo> insert_seed) {
240 const int size = in_seeds.size();
243 std::vector<unsigned> ranks;
254 ranks.swap(phi_eta_binnor.
m_ranks);
259 for (
int i = 0;
i < size; ++
i) {
260 int j = seeds_sorted ?
i : ranks[
i];
261 int reg =
part.m_region[
j];
274 for (
int i = 0;
i < size; ++
i) {
275 int j = seeds_sorted ?
i : ranks[
i];
276 int reg =
part.m_region[
j];
278 insert_seed(
seed,
j, reg, seed_cursors[reg]++);
294 dprintf(
"MkBuilder::import_seeds finished import of %d seeds (last seeding layer min, max):\n" 295 " ec- = %d(%d,%d), t- = %d(%d,%d), brl = %d(%d,%d), t+ = %d(%d,%d), ec+ = %d(%d,%d).\n",
310 int i = 0, place_pos = 0;
312 dprintf(
"MkBuilder::filter_comb_cands Entering filter size eoccs.size=%d\n", eoccs.
size());
315 while (
i < eoccs.
size()) {
317 eoccs[
i].repackCandPostBkwSearch(0);
320 if (!
passed && attempt_all_cands) {
321 for (
int j = 1;
j < (
int)eoccs[
i].size(); ++
j) {
323 eoccs[
i].repackCandPostBkwSearch(
j);
325 eoccs[
i][0] = eoccs[
i][
j];
337 ++removed_cnts[eoccs[
i].front().getEtaRegion()];
344 dprintf(
"MkBuilder::filter_comb_cands reg=%d: n_rem_was=%d removed_in_r=%d n_rem=%d, es_was=%d es_new=%d\n",
348 n_removed + removed_cnts[reg],
352 n_removed += removed_cnts[reg];
358 dprintf(
"MkBuilder::filter_comb_cands n_removed = %d, eoccs.size=%d\n", n_removed, eoccs.
size());
365 int min[5],
max[5], gmin = 0, gmax = 0;
367 for (
int reg = 0; reg < 5; ++reg) {
378 printf(
"MkBuilder::find_min_max_hots_size MIN %3d -- [ %3d | %3d | %3d | %3d | %3d ] " 379 "MAX %3d -- [ %3d | %3d | %3d | %3d | %3d ]\n",
393 out_vec.reserve(out_vec.size() + eoccs.
size());
394 for (
int i = 0;
i < eoccs.
size();
i++) {
398 out_vec.emplace_back(bcand.
exportTrack(remove_missing_hits));
404 out_vec.reserve(out_vec.size() +
m_tracks.size());
406 out_vec.emplace_back(
t);
418 for (
int i = 0;
i < (
int)tv.size(); ++
i) {
421 "Post-cleaning seed silly value check and fix");
427 tv.erase(tv.begin() +
i);
434 printf(
"Nan'n'Silly detected %d silly seeds (fix=%d, remove=%d).\n",
448 assert(!in_seeds.empty());
468 printf(
"No backward search plan for region %d\n",
region);
483 tbb::parallel_for(rosi.tbb_blk_rng_vec(), [&](
const tbb::blocked_range<int> &blk_rng) {
486 RangeOfSeedIndices rng = rosi.seed_rng(blk_rng);
488 std::vector<int> trk_idcs(
NN);
489 std::vector<int> trk_llay(
NN);
491 while (rng.valid()) {
492 dprint(std::endl <<
"processing track=" << rng.m_beg <<
", label=" <<
cands[rng.m_beg].label());
494 int prev_layer = 9999;
496 for (
int i = rng.m_beg,
ii = 0;
i < rng.m_end; ++
i, ++
ii) {
497 int llay =
cands[
i].getLastHitLyr();
499 prev_layer =
std::min(prev_layer, llay);
507 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
509 layer_plan_it.layer(),
510 layer_plan_it.last_layer());
512 assert(layer_plan_it.is_pickup_only());
514 int curr_layer = layer_plan_it.layer();
516 mkfndr->m_Stopped.setVal(0);
521 while (++layer_plan_it) {
522 prev_layer = curr_layer;
523 curr_layer = layer_plan_it.layer();
524 mkfndr->setup(prop_config,
537 dprint(
"at layer " << curr_layer <<
", nHits in layer " << layer_of_hits.
nHits());
540 if (curr_tridx < rng.n_proc()) {
541 int prev_tridx = curr_tridx;
543 for (
int i = rng.m_beg,
ii = 0;
i < rng.m_end; ++
i, ++
ii) {
544 if (trk_llay[
ii] == prev_layer)
545 trk_idcs[curr_tridx++] =
i;
547 if (curr_tridx > prev_tridx) {
548 dprintf(
"added %d seeds, started with %d\n", curr_tridx - prev_tridx, prev_tridx);
550 mkfndr->inputTracksAndHitIdx(
cands, trk_idcs, prev_tridx, curr_tridx,
false, prev_tridx);
554 if (layer_plan_it.is_pickup_only())
557 dcall(pre_prop_print(curr_layer, mkfndr.get()));
559 mkfndr->clearFailFlag();
563 dcall(post_prop_print(curr_layer, mkfndr.get()));
565 mkfndr->selectHitIndices(layer_of_hits, curr_tridx);
569 const float r_min_sqr = layer_info.
rin() * layer_info.
rin();
570 for (
int i = 0;
i < curr_tridx; ++
i) {
571 if (!mkfndr->m_Stopped[
i]) {
572 if (mkfndr->radiusSqr(
i,
MkBase::iP) < r_min_sqr) {
574 mkfndr->m_Stopped[
i] = 1;
575 mkfndr->outputTrackAndHitIdx(
cands[rng.m_beg +
i],
i,
false);
578 mkfndr->m_XHitSize[
i] = 0;
582 mkfndr->m_XHitSize[
i] = 0;
588 dprint(
"make new candidates");
590 mkfndr->addBestHit(layer_of_hits, curr_tridx, fnd_foos);
593 for (
int i = 0;
i < curr_tridx; ++
i) {
594 if (!mkfndr->m_Stopped[
i] && mkfndr->bestHitLastHoT(
i).index == -2) {
595 mkfndr->m_Stopped[
i] = 1;
596 mkfndr->outputTrackAndHitIdx(
cands[rng.m_beg +
i],
i,
false);
602 mkfndr->outputNonStoppedTracksAndHitIdx(
cands, trk_idcs, 0, curr_tridx,
false);
618 assert(!in_seeds.empty());
637 seed_cand_vec.clear();
650 for (
int ic = 0; ic < (
int)ccand.
size(); ++ic) {
651 if (ccand[ic].getLastHitIdx() != -2) {
653 if (ccand[ic].
pT() < iter_params.minPtCut) {
654 ccand[ic].addHitIdx(-2, layer, 0.0
f);
659 const float dphi =
std::abs(ccand[ic].posPhi() - ccand[ic].momPhi());
660 if (ccand[ic].posRsq() > 625.
f && dphi > 1.371
f && dphi < 4.512
f) {
663 ccand[ic].addHitIdx(-2, layer, 0.0
f);
669 seed_cand_vec.push_back(std::pair<int, int>(
iseed, ic));
670 ccand[ic].resetOverlaps();
675 "Per layer silly check"))
690 return seed_cand_vec.size();
696 const std::vector<std::pair<int, int>> &seed_cand_idx,
698 const int start_seed,
708 for (
int ti = itrack; ti < end; ++ti) {
713 dprintf(
"WSR Check label %d, seed %d, cand %d score %f -> wsr %d, in_gap %d\n",
715 seed_cand_idx[ti].first,
716 seed_cand_idx[ti].second,
727 dprintf(
"Barrel cand propagation failed, got to r=%f ... layer is %f - %f\n",
733 tmp_cands[seed_cand_idx[ti].first - start_seed].push_back(
cand);
735 dprintf(
" creating extra stopped held back candidate\n");
736 tmp_cands[seed_cand_idx[ti].first - start_seed].back().addHitIdx(-2, layer_info.
layer_id(), 0);
741 dprintf(
" creating extra held back candidate\n");
742 tmp_cands[seed_cand_idx[ti].first - start_seed].push_back(
cand);
760 printf(
"No backward search plan for region %d\n",
region);
772 const int adaptiveSPT = std::clamp(
774 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
777 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
seeds) {
780 const int start_seed =
seeds.begin();
781 const int end_seed =
seeds.end();
782 const int n_seeds = end_seed - start_seed;
784 std::vector<std::vector<TrackCand>> tmp_cands(n_seeds);
786 tmp_cands[
iseed].reserve(2 *
params.maxCandsPerSeed);
789 std::vector<std::pair<int, int>> seed_cand_idx;
790 seed_cand_idx.reserve(n_seeds *
params.maxCandsPerSeed);
794 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
796 layer_plan_it.layer(),
797 layer_plan_it.last_layer());
799 assert(layer_plan_it.is_pickup_only());
801 int curr_layer = layer_plan_it.layer(), prev_layer;
803 dprintf(
"\nMkBuilder::FindTracksStandard region=%d, seed_pickup_layer=%d, first_layer=%d\n",
806 layer_plan_it.next_layer());
812 while (++layer_plan_it) {
813 prev_layer = curr_layer;
814 curr_layer = layer_plan_it.layer();
815 mkfndr->setup(prop_config,
829 dprintf(
"\n* Processing layer %d\n", curr_layer);
830 mkfndr->begin_layer(layer_of_hits);
837 layer_plan_it.is_pickup_only(),
840 dprintf(
" Number of candidates to process: %d, nHits in layer: %d\n", theEndCand, layer_of_hits.
nHits());
842 if (layer_plan_it.is_pickup_only() || theEndCand == 0)
846 for (
int itrack = 0; itrack < theEndCand; itrack +=
NN) {
849 dprint(
"processing track=" << itrack <<
", label=" 850 << eoccs[seed_cand_idx[itrack].
first][seed_cand_idx[itrack].
second].
label());
853 mkfndr->inputTracksAndHitIdx(eoccs.
refCandidates(), seed_cand_idx, itrack, end,
false);
856 dcall(pre_prop_print(curr_layer, mkfndr.get()));
858 mkfndr->clearFailFlag();
862 dcall(post_prop_print(curr_layer, mkfndr.get()));
864 dprint(
"now get hit range");
865 mkfndr->selectHitIndices(layer_of_hits, end - itrack);
868 mkfndr.get(), layer_info, tmp_cands, seed_cand_idx,
region, start_seed, itrack, end);
870 dprint(
"make new candidates");
871 mkfndr->findCandidates(layer_of_hits, tmp_cands, start_seed, end - itrack, fnd_foos);
876 for (
int is = 0; is < n_seeds; ++is) {
877 dprint(
"dump seed n " << is <<
" with N_input_candidates=" << tmp_cands[is].size());
879 std::sort(tmp_cands[is].begin(), tmp_cands[is].end(), sortCandByScore);
883 for (
int is = 0; is < n_seeds; ++is) {
884 if (!tmp_cands[is].
empty()) {
885 eoccs[start_seed + is].clear();
889 bool first_short =
true;
890 for (
int ii = 0;
ii < (
int)tmp_cands[is].size() && n_placed <
params.maxCandsPerSeed; ++
ii) {
908 eoccs[start_seed + is].emplace_back(tc);
910 }
else if (first_short) {
912 if (tc.
score() > eoccs[start_seed + is].refBestShortCand().score()) {
913 eoccs[start_seed + is].setBestShortCand(tc);
918 tmp_cands[is].clear();
946 printf(
"No backward search plan for region %d\n",
region);
953 const int adaptiveSPT = std::clamp(
955 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
957 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
seeds) {
977 const int start_seed,
986 const int n_seeds = end_seed - start_seed;
988 std::vector<std::pair<int, int>> seed_cand_idx;
989 std::vector<UpdateIndices> seed_cand_update_idx, seed_cand_overlap_idx;
990 seed_cand_idx.reserve(n_seeds *
params.maxCandsPerSeed);
991 seed_cand_update_idx.reserve(n_seeds *
params.maxCandsPerSeed);
992 seed_cand_overlap_idx.reserve(n_seeds *
params.maxCandsPerSeed);
994 std::vector<std::vector<TrackCand>> extra_cands(n_seeds);
995 for (
int ii = 0;
ii < n_seeds; ++
ii)
996 extra_cands[
ii].reserve(
params.maxCandsPerSeed);
998 cloner.
begin_eta_bin(&eoccs, &seed_cand_update_idx, &seed_cand_overlap_idx, &extra_cands, start_seed, n_seeds);
1004 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
1006 layer_plan_it.layer(),
1007 layer_plan_it.last_layer());
1009 assert(layer_plan_it.is_pickup_only());
1011 int curr_layer = layer_plan_it.layer(), prev_layer;
1014 "\nMkBuilder::find_tracks_in_layers region=%d, seed_pickup_layer=%d, first_layer=%d; start_seed=%d, " 1018 layer_plan_it.next_layer(),
1026 while (++layer_plan_it) {
1027 prev_layer = curr_layer;
1028 curr_layer = layer_plan_it.layer();
1029 mkfndr->
setup(prop_config,
1039 const bool pickup_only = layer_plan_it.is_pickup_only();
1045 dprintf(
"\n\n* Processing layer %d, %s\n\n", curr_layer, pickup_only ?
"pickup only" :
"full finding");
1049 seed_cand_idx, start_seed, end_seed, curr_layer, prev_layer, pickup_only, iteration_dir);
1051 dprintf(
" Number of candidates to process: %d, nHits in layer: %d\n", theEndCand, layer_of_hits.
nHits());
1060 if (pickup_only || theEndCand == 0)
1066 for (
int itrack = 0; itrack < theEndCand; itrack +=
NN) {
1067 const int end =
std::min(itrack +
NN, theEndCand);
1070 dprintf(
"\nProcessing track=%d, start_seed=%d, n_seeds=%d, theEndCand=%d, end=%d, nn=%d, end_eq_tec=%d\n",
1079 for (
int i = itrack;
i < end; ++
i)
1087 for (
int i = itrack;
i < end; ++
i)
1088 dprintf(
" track %d, idx %d is from seed %d\n",
i,
i - itrack, mkfndr->
m_Label(
i - itrack, 0, 0));
1096 dprint(
"now get hit range");
1098 if (iter_params.useHitSelectionV2)
1104 mkfndr, layer_info, extra_cands, seed_cand_idx,
region, start_seed, itrack, end);
1117 dprint(
"make new candidates");
1133 const int theEndUpdater = seed_cand_update_idx.size();
1135 for (
int itrack = 0; itrack < theEndUpdater; itrack +=
NN) {
1136 const int end =
std::min(itrack +
NN, theEndUpdater);
1146 const int theEndOverlapper = seed_cand_overlap_idx.size();
1148 for (
int itrack = 0; itrack < theEndOverlapper; itrack +=
NN) {
1149 const int end =
std::min(itrack +
NN, theEndOverlapper);
1157 mkfndr->
inputOverlapHits(layer_of_hits, seed_cand_overlap_idx, itrack, end);
1164 for (
int ii = itrack;
ii < end; ++
ii) {
1165 const int fi =
ii - itrack;
1166 TrackCand &tc = eoccs[seed_cand_overlap_idx[
ii].seed_idx][seed_cand_overlap_idx[
ii].cand_idx];
1170 auto chi2Ovlp = mkfndr->
m_Chi2[fi];
1171 if (mkfndr->
m_FailFlag[fi] == 0 && chi2Ovlp >= 0.0f && chi2Ovlp <= 60.0f) {
1174 tc.
addHitIdx(seed_cand_overlap_idx[
ii].ovlp_idx, curr_layer, chi2Ovlp);
1177 if (scoreCand > scoreCandOvlp)
1188 for (
int i = 0;
i < ((
int)
cc.size()) - 1; ++
i) {
1190 printf(
"CloneEngine - NOT SORTED: layer=%d, iseed=%d (size=%lu)-- %d : %f smaller than %d : %f\n",
1217 #ifdef DEBUG_FINAL_FIT 1221 dprintf(
" %4d with q=%+d chi2=%7.3f pT=%7.3f eta=% 7.3f x=%.3f y=%.3f z=%.3f" 1222 " nHits=%2d label=%4d findable=%d\n",
1223 i,
t.charge(),
t.chi2(),
t.pT(),
t.momEta(),
t.x(),
t.y(),
t.z(),
1224 t.nFoundHits(),
t.label(),
t.isFindable());
1234 tbb::parallel_for(rosi.tbb_blk_rng_vec(), [&](
const tbb::blocked_range<int> &blk_rng) {
1237 RangeOfSeedIndices rng = rosi.seed_rng(blk_rng);
1239 while (rng.valid()) {
1253 #ifdef DEBUG_FINAL_FIT 1258 for (
int icand = start_cand; icand < end_cand; icand +=
NN) {
1259 const int end =
std::min(icand +
NN, end_cand);
1261 #ifdef DEBUG_FINAL_FIT 1262 dprintf(
"Pre Final fit for %d - %d\n", icand, end);
1263 for (
int i = icand;
i < end; ++
i) {
1264 dprint_tcand(eoccs[
i][0],
i);
1268 bool chi_debug =
false;
1269 #ifdef DEBUG_BACKWARD_FIT_BH 1284 #ifdef DEBUG_BACKWARD_FIT_BH 1287 mkfndr->
m_Chi2(0, 0, 0) / (eoccs[icand][0].nFoundHits() * 3 - 6) > 20.0
f) {
1289 #ifdef MKFIT_STANDALONE 1290 printf(
"CHIHDR Event %d, Cand %3d, pT %f, chipdof %f ### NOTE x,y,z in cm, sigmas, deltas in mum ### !!!\n",
1293 printf(
"CHIHDR Cand %3d, pT %f, chipdof %f ### NOTE x,y,z in cm, sigmas, deltas in mum ### !!!\n",
1297 mkfndr->
m_Chi2(0, 0, 0) / (eoccs[icand][0].nFoundHits() * 3 - 6));
1299 printf(
"CHIHDR %3s %10s" 1300 " %10s %10s %10s %10s %11s %11s %11s" 1301 " %10s %10s %10s %10s %11s %11s %11s" 1302 " %10s %10s %10s %10s %10s %11s %11s\n",
1304 "x_h",
"y_h",
"z_h",
"r_h",
"sx_h",
"sy_h",
"sz_h",
1305 "x_t",
"y_t",
"z_t",
"r_t",
"sx_t",
"sy_t",
"sz_t",
1306 "pt",
"phi",
"theta",
"phi_h",
"phi_t",
"d_xy",
"d_z");
1315 #ifdef DEBUG_FINAL_FIT 1316 dprintf(
"Post Final fit for %d - %d\n", icand, end);
1317 for (
int i = icand;
i < end; ++
i) {
1318 dprint_tcand(eoccs[
i][0],
i);
1333 const int adaptiveSPT = std::clamp(
1335 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
1337 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
cands) {
1352 for (
int icand = start_cand; icand < end_cand; icand +=
step) {
1355 bool chi_debug =
false;
1357 #ifdef DEBUG_FINAL_FIT 1359 dprintf(
"Pre Final fit for %d - %d\n", icand, end);
1360 for (
int i = icand;
i < end; ++
i) {
1361 dprint_tcand(eoccs[
i][0],
i);
1364 static bool first =
true;
1368 "BKF_OVERLAP event/I:label/I:prod_type/I:is_findable/I:layer/I:is_stereo/I:is_barrel/I:" 1369 "pt/F:pt_cur/F:eta/F:phi/F:phi_cur/F:r_cur/F:z_cur/F:chi2/F:isnan/I:isfin/I:gtzero/I:hit_label/I:" 1370 "sx_t/F:sy_t/F:sz_t/F:d_xy/F:d_z/F\n");
1388 #ifdef DEBUG_FINAL_FIT 1389 dprintf(
"Post Final fit for %d - %d\n", icand, end);
1390 for (
int i = icand;
i < end; ++
i) {
1391 dprint_tcand(eoccs[
i][0],
i);
void(MkBase::* m_propagate_foo)(float, const int, const PropagationFlags &)
const IterationConfig & m_iter_config
float getScoreCand(const track_score_func &score_func, const Track &cand1, bool penalizeTailMissHits=false, bool inFindCandidates=false)
void import_seeds(const TrackVec &in_seeds, const bool seeds_sorted, std::function< insert_seed_foo > insert_seed)
void addHitIdx(int hitIdx, int hitLyr, float chi2)
int find_tracks_unroll_candidates(std::vector< std::pair< int, int >> &seed_cand_vec, int start_seed, int end_seed, int layer, int prev_layer, bool pickup_only, SteeringParams::IterationType_e iteration_dir)
std::pair< int, int > max_hits_layer(const EventOfHits &eoh) const
void export_tracks(TrackVec &out_vec)
IterationParams m_backward_params
void findTracksBestHit(SteeringParams::IterationType_e iteration_dir=SteeringParams::IT_FwdSearch)
ExecutionContext()=default
void chi2OfLoadedHit(int N_proc, const FindingFoos &fnd_foos)
Track exportTrack(bool remove_missing_hits=false) const
float radius(int itrack, int i) const
void inputOverlapHits(const LayerOfHits &layer_of_hits, const std::vector< UpdateIndices > &idxs, int beg, int end)
void resizeAfterFiltering(int n_removed)
void insertSeed(const Track &seed, int seed_idx, const track_score_func &score_func, int region, int pos)
void begin_eta_bin(EventOfCombCandidates *e_o_ccs, std::vector< UpdateIndices > *update_list, std::vector< UpdateIndices > *overlap_list, std::vector< std::vector< TrackCand >> *extra_cands, int start_seed, int n_seeds)
void inputTracksAndHitIdx(const std::vector< Track > &tracks, int beg, int end, bool inputProp)
void bkFitInputTracks(TrackVec &cands, int beg, int end)
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
uint32_t cc[maxCellsPerHit]
constexpr bool nan_n_silly_print_bad_seeds
std::atomic< int > m_nan_n_silly_per_layer_count
void find_min_max_hots_size()
Sin< T >::type sin(const T &t)
const auto regions_begin() const
constexpr Process operator++(Process p)
void setState(SeedState_e ss)
void selectHitIndices(const LayerOfHits &layer_of_hits, const int N_proc, bool fill_binsearch_only=false)
void setup(const PropagationConfig &pc, const IterationConfig &ic, const IterationParams &ip, const IterationLayerConfig &ilc, const SteeringParams &sp, const std::vector< bool > *ihm, const Event *ev, int region, bool infwd)
void findTracksCloneEngine(SteeringParams::IterationType_e iteration_dir=SteeringParams::IT_FwdSearch)
void bkFitPropTracksToPCA(const int N_proc)
constexpr bool nan_n_silly_check_seeds
void inputTracksAndHits(const std::vector< CombCandidate > &tracks, const LayerOfHits &layer_of_hits, const std::vector< UpdateIndices > &idxs, int beg, int end, bool inputProp)
float propagate_to() const
void begin_event(MkJob *job, Event *ev, const char *build_type)
const auto & params() const
bool cands_in_backward_rep() const
const EventOfHits & m_event_of_hits
constexpr bool nan_n_silly_fixup_bad_cands_every_layer
void swap(Association< C > &lhs, Association< C > &rhs)
void finalize_registration()
track_score_func m_track_scorer
unsigned int nHits() const
U second(std::pair< T, U > const &p)
PropagationFlags finding_inter_layer_pflags
void find_tracks_load_seeds_BH(const TrackVec &in_seeds, const bool seeds_sorted)
void findTracksStandard(SteeringParams::IterationType_e iteration_dir=SteeringParams::IT_FwdSearch)
std::function< filter_candidates_cf > filter_candidates_func
iterator make_iterator(IterationType_e type) const
std::vector< IterationLayerConfig > m_layer_configs
void reset(int new_capacity, int max_cands_per_seed, int expected_num_hots=128)
void find_tracks_load_seeds(const TrackVec &in_seeds, const bool seeds_sorted)
constexpr bool nan_n_silly_remove_bad_seeds
void register_entry_safe(typename A1::real_t r1, typename A2::real_t r2)
constexpr Matriplex::idx_t NN
Cos< T >::type cos(const T &t)
void setup_bkfit(const PropagationConfig &pc, const SteeringParams &sp, const Event *ev)
partition_seeds_func m_seed_partitioner
std::vector< int > m_seedEtaSeparators
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
void seed_post_cleaning(TrackVec &tv)
ExecutionContext g_exe_ctx
Pool< MkFinder > m_finders
float getHypot(float x, float y)
void select_best_comb_cands(bool clear_m_tracks=false, bool remove_missing_hits=false)
constexpr int numThreadsFinder
int filter_comb_cands(filter_candidates_func filter, bool attempt_all_cands)
Pool< CandCloner > m_cloners
void begin_registration(C n_items)
void begin_layer(const LayerOfHits &layer_of_hits)
trk_cand_vec_type::size_type size() const
const LayerInfo & layer(int l) const
const auto & steering_params(int i)
const TrackerInfo & m_trk_info
void updateWithLoadedHit(int N_proc, const LayerOfHits &layer_of_hits, const FindingFoos &fnd_foos)
void selectHitIndicesV2(const LayerOfHits &layer_of_hits, const int N_proc)
std::vector< Track > TrackVec
constexpr bool nan_n_silly_fixup_bad_seeds
void begin_layer(int lay)
Pool< MkFitter > m_fitters
const std::vector< CombCandidate > & refCandidates() const
bool sortByScoreTrackCand(const TrackCand &cand1, const TrackCand &cand2)
void bkFitFitTracks(const EventOfHits &eventofhits, const SteeringParams &st_par, const int N_proc, bool chiDebug=false)
EventOfCombCandidates m_event_of_comb_cands
std::vector< CombCandidate > & refCandidates_nc()
void find_tracks_handle_missed_layers(MkFinder *mkfndr, const LayerInfo &layer_info, std::vector< std::vector< TrackCand >> &tmp_cands, const std::vector< std::pair< int, int >> &seed_cand_idx, const int region, const int start_seed, const int itrack, const int end)
static const FindingFoos & get_finding_foos(bool is_barrel)
std::vector< int > m_seedMaxLastLayer
constexpr bool nan_n_silly_check_cands_every_layer
int getLastHitIdx() const
void export_best_comb_cands(TrackVec &out_vec, bool remove_missing_hits=false)
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)
static std::unique_ptr< MkBuilder > make_builder(bool silent=true)
constexpr int numSeedsPerTask
constexpr int numThreadsEvents
const auto regions_end() const
int getLastHitLyr() const
void copyOutParErr(std::vector< CombCandidate > &seed_cand_vec, int N_proc, bool outputProp) const
void findCandidatesCloneEngine(const LayerOfHits &layer_of_hits, CandCloner &cloner, const int offset, const int N_proc, const FindingFoos &fnd_foos)
void fit_cands(MkFinder *mkfndr, int start_cand, int end_cand, int region)
const std::vector< bool > * get_mask_for_layer(int layer)
while(__syncthreads_or(more))
int max_max_cands() const
constexpr bool usePropToPlane
~ExecutionContext()=default
std::vector< int > m_seedMinLastLayer
WSR_Result m_XWsrResult[NN]
constexpr bool nan_n_silly_print_bad_cands_every_layer
void reset(double vett[256])
SeedState_e state() const
void fit_cands_BH(MkFinder *mkfndr, int start_cand, int end_cand, int region)
void find_tracks_in_layers(CandCloner &cloner, MkFinder *mkfndr, SteeringParams::IterationType_e iteration_dir, const int start_seed, const int end_seed, const int region)
const PropagationConfig & prop_config() const
const Hit & refHit(int i) const
float getPar(int itrack, int i, int par) const