17 #ifdef MKFIT_STANDALONE 25 #include "oneapi/tbb/parallel_for.h" 26 #include "oneapi/tbb/parallel_for_each.h" 59 using namespace mkfit;
62 struct RangeOfSeedIndices {
63 int m_rng_beg, m_rng_end;
66 RangeOfSeedIndices(
int rb,
int re) : m_rng_beg(rb), m_rng_end(re) {
reset(); }
73 bool valid()
const {
return m_beg < m_rng_end; }
75 int n_proc()
const {
return m_end - m_beg; }
89 struct RegionOfSeedIndices {
90 int m_reg_beg, m_reg_end, m_vec_cnt;
92 RegionOfSeedIndices(
const std::vector<int> &seedEtaSeparators,
int region) {
93 m_reg_beg = (
region == 0) ? 0 : seedEtaSeparators[
region - 1];
94 m_reg_end = seedEtaSeparators[
region];
95 m_vec_cnt = (m_reg_end - m_reg_beg +
NN - 1) /
NN;
98 int count()
const {
return m_reg_end - m_reg_beg; }
100 tbb::blocked_range<int> tbb_blk_rng_std(
int thr_hint = -1)
const {
103 return tbb::blocked_range<int>(m_reg_beg, m_reg_end, thr_hint);
106 tbb::blocked_range<int> tbb_blk_rng_vec()
const {
110 RangeOfSeedIndices seed_rng(
const tbb::blocked_range<int> &
i)
const {
111 return RangeOfSeedIndices(m_reg_beg +
NN *
i.begin(),
std::min(m_reg_beg +
NN *
i.end(), m_reg_end));
116 void pre_prop_print(
int ilay,
MkBase *fir) {
117 const float pt = 1.f / fir->
getPar(0, 0, 3);
118 std::cout <<
"propagate to lay=" << ilay <<
" start from x=" << fir->
getPar(0, 0, 0)
119 <<
" y=" << fir->
getPar(0, 0, 1) <<
" z=" << fir->
getPar(0, 0, 2)
125 void post_prop_print(
int ilay,
MkBase *fir) {
126 std::cout <<
"propagate to lay=" << ilay <<
" arrive at x=" << fir->
getPar(0, 1, 0) <<
" y=" << fir->
getPar(0, 1, 1)
132 std::cout <<
"MX - found seed with label=" <<
seed.label() <<
" nHits=" <<
seed.nFoundHits()
133 <<
" chi2=" <<
seed.chi2() <<
" posEta=" <<
seed.posEta() <<
" posPhi=" <<
seed.posPhi()
134 <<
" posR=" <<
seed.posR() <<
" posZ=" <<
seed.z() <<
" pT=" <<
seed.pT() << std::endl;
138 std::cout <<
"MX - found seed with nFoundHits=" <<
seed.nFoundHits() <<
" chi2=" <<
seed.chi2() <<
" x=" <<
seed.x()
139 <<
" y=" <<
seed.y() <<
" z=" <<
seed.z() <<
" px=" <<
seed.px() <<
" py=" <<
seed.py()
140 <<
" pz=" <<
seed.pz() <<
" pT=" <<
seed.pT() << std::endl;
152 print_seed2(event_of_comb_cands[
iseed].front());
177 int lsize = eoh[
l].nHits();
180 maxL = eoh[
l].layer_id();
214 std::cout <<
"MkBuilder building tracks with '" << build_type <<
"'" 232 const bool seeds_sorted,
233 std::function<insert_seed_foo> insert_seed) {
236 const int size = in_seeds.size();
239 std::vector<unsigned> ranks;
250 ranks.swap(phi_eta_binnor.
m_ranks);
255 for (
int i = 0;
i <
size; ++
i) {
256 int j = seeds_sorted ?
i : ranks[
i];
257 int reg =
part.m_region[
j];
270 for (
int i = 0;
i <
size; ++
i) {
271 int j = seeds_sorted ?
i : ranks[
i];
272 int reg =
part.m_region[
j];
274 insert_seed(
seed, reg, seed_cursors[reg]++);
290 dprintf(
"MkBuilder::import_seeds finished import of %d seeds (last seeding layer min, max):\n" 291 " ec- = %d(%d,%d), t- = %d(%d,%d), brl = %d(%d,%d), t+ = %d(%d,%d), ec+ = %d(%d,%d).\n",
306 int i = 0, place_pos = 0;
308 dprintf(
"MkBuilder::filter_comb_cands Entering filter size eoccsm_size=%d\n", eoccs.
size());
311 while (
i < eoccs.
size()) {
318 ++removed_cnts[eoccs[
i].front().getEtaRegion()];
325 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",
329 n_removed + removed_cnts[reg],
333 n_removed += removed_cnts[reg];
339 dprintf(
"MkBuilder::filter_comb_cands n_removed = %d, eoccsm_size=%d\n", n_removed, eoccs.
size());
346 int min[5],
max[5], gmin = 0, gmax = 0;
348 for (
int reg = 0; reg < 5; ++reg) {
359 printf(
"MkBuilder::find_min_max_hots_size MIN %3d -- [ %3d | %3d | %3d | %3d | %3d ] " 360 "MAX %3d -- [ %3d | %3d | %3d | %3d | %3d ]\n",
374 out_vec.reserve(out_vec.size() + eoccs.
size());
375 for (
int i = 0;
i < eoccs.
size();
i++) {
377 assert(!eoccs[
i].
empty() &&
"BackwardFitBH requires output tracks to align with seeds.");
382 out_vec.emplace_back(bcand.
exportTrack(remove_missing_hits));
388 out_vec.reserve(out_vec.size() +
m_tracks.size());
390 out_vec.emplace_back(
t);
399 #ifdef SELECT_SEED_LABEL 401 for (
int i = 0;
i < (
int)tv.size(); ++
i) {
402 if (tv[
i].
label() == SELECT_SEED_LABEL) {
403 printf(
"Preselect seed with label %d - found on pos %d\n", SELECT_SEED_LABEL,
i);
411 if (tv.size() != 1) {
412 printf(
"Preselect seed with label %d - NOT FOUND. Cleaning out seeds.\n", SELECT_SEED_LABEL);
421 for (
int i = 0;
i < (
int)tv.size(); ++
i) {
424 "Post-cleaning seed silly value check and fix");
430 tv.erase(tv.begin() +
i);
437 printf(
"Nan'n'Silly detected %d silly seeds (fix=%d, remove=%d).\n",
451 assert(!in_seeds.empty());
471 printf(
"No backward search plan for region %d\n",
region);
486 tbb::parallel_for(rosi.tbb_blk_rng_vec(), [&](
const tbb::blocked_range<int> &blk_rng) {
489 RangeOfSeedIndices rng = rosi.seed_rng(blk_rng);
491 std::vector<int> trk_idcs(
NN);
492 std::vector<int> trk_llay(
NN);
494 while (rng.valid()) {
495 dprint(std::endl <<
"processing track=" << rng.m_beg <<
", label=" <<
cands[rng.m_beg].label());
497 int prev_layer = 9999;
499 for (
int i = rng.m_beg,
ii = 0;
i < rng.m_end; ++
i, ++
ii) {
500 int llay =
cands[
i].getLastHitLyr();
502 prev_layer =
std::min(prev_layer, llay);
510 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
512 layer_plan_it.layer(),
513 layer_plan_it.last_layer());
515 assert(layer_plan_it.is_pickup_only());
517 int curr_layer = layer_plan_it.layer();
519 mkfndr->m_Stopped.setVal(0);
524 while (++layer_plan_it) {
525 prev_layer = curr_layer;
526 curr_layer = layer_plan_it.layer();
527 mkfndr->setup(prop_config,
535 dprint(
"at layer " << curr_layer <<
", nHits in layer " << layer_of_hits.
nHits());
538 if (curr_tridx < rng.n_proc()) {
539 int prev_tridx = curr_tridx;
541 for (
int i = rng.m_beg,
ii = 0;
i < rng.m_end; ++
i, ++
ii) {
542 if (trk_llay[
ii] == prev_layer)
543 trk_idcs[curr_tridx++] =
i;
545 if (curr_tridx > prev_tridx) {
546 dprintf(
"added %d seeds, started with %d\n", curr_tridx - prev_tridx, prev_tridx);
548 mkfndr->inputTracksAndHitIdx(
cands, trk_idcs, prev_tridx, curr_tridx,
false, prev_tridx);
552 if (layer_plan_it.is_pickup_only())
555 dcall(pre_prop_print(curr_layer, mkfndr.get()));
560 dcall(post_prop_print(curr_layer, mkfndr.get()));
562 mkfndr->selectHitIndices(layer_of_hits, curr_tridx);
566 const float r_min_sqr = layer_info.
rin() * layer_info.
rin();
567 for (
int i = 0;
i < curr_tridx; ++
i) {
568 if (!mkfndr->m_Stopped[
i]) {
569 if (mkfndr->radiusSqr(
i,
MkBase::iP) < r_min_sqr) {
571 mkfndr->m_Stopped[
i] = 1;
572 mkfndr->outputTrackAndHitIdx(
cands[rng.m_beg +
i],
i,
false);
575 mkfndr->m_XHitSize[
i] = 0;
579 mkfndr->m_XHitSize[
i] = 0;
585 dprint(
"make new candidates");
587 mkfndr->addBestHit(layer_of_hits, curr_tridx, fnd_foos);
590 for (
int i = 0;
i < curr_tridx; ++
i) {
591 if (!mkfndr->m_Stopped[
i] && mkfndr->bestHitLastHoT(
i).index == -2) {
592 mkfndr->m_Stopped[
i] = 1;
593 mkfndr->outputTrackAndHitIdx(
cands[rng.m_beg +
i],
i,
false);
599 mkfndr->outputNonStoppedTracksAndHitIdx(
cands, trk_idcs, 0, curr_tridx,
false);
615 assert(!in_seeds.empty());
634 seed_cand_vec.clear();
647 for (
int ic = 0; ic < (
int)ccand.
size(); ++ic) {
648 if (ccand[ic].getLastHitIdx() != -2) {
650 if (ccand[ic].
pT() < iter_params.minPtCut) {
651 ccand[ic].addHitIdx(-2, layer, 0.0
f);
656 const float dphi =
std::abs(ccand[ic].posPhi() - ccand[ic].momPhi());
657 if (ccand[ic].posRsq() > 625.
f && dphi > 1.371
f && dphi < 4.512
f) {
660 ccand[ic].addHitIdx(-2, layer, 0.0
f);
666 seed_cand_vec.push_back(std::pair<int, int>(
iseed, ic));
667 ccand[ic].resetOverlaps();
672 "Per layer silly check"))
687 return seed_cand_vec.size();
693 const std::vector<std::pair<int, int>> &seed_cand_idx,
695 const int start_seed,
705 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,
721 if (layer_info.
is_barrel() && cand_r < layer_info.
rin()) {
725 dprintf(
"Barrel cand propagated to r=%f ... layer is %f - %f\n", cand_r, layer_info.
rin(), layer_info.
rout());
730 tmp_cands[seed_cand_idx[ti].first - start_seed].push_back(
cand);
732 dprintf(
" creating extra stopped held back candidate\n");
733 tmp_cands[seed_cand_idx[ti].first - start_seed].back().addHitIdx(-2, layer_info.
layer_id(), 0);
736 dprintf(
" creating extra held back candidate\n");
737 tmp_cands[seed_cand_idx[ti].first - start_seed].push_back(
cand);
755 printf(
"No backward search plan for region %d\n",
region);
767 const int adaptiveSPT = std::clamp(
769 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
772 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
seeds) {
775 const int start_seed =
seeds.begin();
776 const int end_seed =
seeds.end();
777 const int n_seeds = end_seed - start_seed;
779 std::vector<std::vector<TrackCand>> tmp_cands(n_seeds);
781 tmp_cands[
iseed].reserve(2 *
params.maxCandsPerSeed);
784 std::vector<std::pair<int, int>> seed_cand_idx;
785 seed_cand_idx.reserve(n_seeds *
params.maxCandsPerSeed);
789 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
791 layer_plan_it.layer(),
792 layer_plan_it.last_layer());
794 assert(layer_plan_it.is_pickup_only());
796 int curr_layer = layer_plan_it.layer(), prev_layer;
798 dprintf(
"\nMkBuilder::FindTracksStandard region=%d, seed_pickup_layer=%d, first_layer=%d\n",
801 layer_plan_it.next_layer());
807 while (++layer_plan_it) {
808 prev_layer = curr_layer;
809 curr_layer = layer_plan_it.layer();
810 mkfndr->setup(prop_config,
815 dprintf(
"\n* Processing layer %d\n", curr_layer);
826 layer_plan_it.is_pickup_only(),
829 dprintf(
" Number of candidates to process: %d, nHits in layer: %d\n", theEndCand, layer_of_hits.
nHits());
831 if (layer_plan_it.is_pickup_only() || theEndCand == 0)
835 for (
int itrack = 0; itrack < theEndCand; itrack +=
NN) {
838 dprint(
"processing track=" << itrack <<
", label=" 839 << eoccs[seed_cand_idx[itrack].
first][seed_cand_idx[itrack].
second].
label());
842 mkfndr->inputTracksAndHitIdx(eoccs.
refCandidates(), seed_cand_idx, itrack, end,
false);
845 dcall(pre_prop_print(curr_layer, mkfndr.get()));
850 dcall(post_prop_print(curr_layer, mkfndr.get()));
852 dprint(
"now get hit range");
853 mkfndr->selectHitIndices(layer_of_hits, end - itrack);
856 mkfndr.get(), layer_info, tmp_cands, seed_cand_idx,
region, start_seed, itrack, end);
858 dprint(
"make new candidates");
859 mkfndr->findCandidates(layer_of_hits, tmp_cands, start_seed, end - itrack, fnd_foos);
864 for (
int is = 0; is < n_seeds; ++is) {
865 dprint(
"dump seed n " << is <<
" with N_input_candidates=" << tmp_cands[is].
size());
867 std::sort(tmp_cands[is].begin(), tmp_cands[is].end(), sortCandByScore);
871 for (
int is = 0; is < n_seeds; ++is) {
872 if (!tmp_cands[is].
empty()) {
873 eoccs[start_seed + is].clear();
877 bool first_short =
true;
878 for (
int ii = 0;
ii < (
int)tmp_cands[is].
size() && n_placed <
params.maxCandsPerSeed; ++
ii) {
896 eoccs[start_seed + is].emplace_back(tc);
898 }
else if (first_short) {
900 if (tc.
score() > eoccs[start_seed + is].refBestShortCand().score()) {
901 eoccs[start_seed + is].setBestShortCand(tc);
906 tmp_cands[is].clear();
934 printf(
"No backward search plan for region %d\n",
region);
941 const int adaptiveSPT = std::clamp(
943 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
945 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
seeds) {
965 const int start_seed,
974 const int n_seeds = end_seed - start_seed;
976 std::vector<std::pair<int, int>> seed_cand_idx;
977 std::vector<UpdateIndices> seed_cand_update_idx;
978 seed_cand_idx.reserve(n_seeds *
params.maxCandsPerSeed);
979 seed_cand_update_idx.reserve(n_seeds *
params.maxCandsPerSeed);
981 std::vector<std::vector<TrackCand>> extra_cands(n_seeds);
982 for (
int ii = 0;
ii < n_seeds; ++
ii)
983 extra_cands[
ii].reserve(
params.maxCandsPerSeed);
985 cloner.
begin_eta_bin(&eoccs, &seed_cand_update_idx, &extra_cands, start_seed, n_seeds);
993 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
995 layer_plan_it.layer(),
996 layer_plan_it.last_layer());
998 assert(layer_plan_it.is_pickup_only());
1000 int curr_layer = layer_plan_it.layer(), prev_layer;
1003 "\nMkBuilder::find_tracks_in_layers region=%d, seed_pickup_layer=%d, first_layer=%d; start_seed=%d, " 1007 layer_plan_it.next_layer(),
1015 while (++layer_plan_it) {
1016 prev_layer = curr_layer;
1017 curr_layer = layer_plan_it.layer();
1018 mkfndr->
setup(prop_config,
1023 const bool pickup_only = layer_plan_it.is_pickup_only();
1025 dprintf(
"\n\n* Processing layer %d, %s\n\n", curr_layer, pickup_only ?
"pickup only" :
"full finding");
1032 seed_cand_idx, start_seed, end_seed, curr_layer, prev_layer, pickup_only, iteration_dir);
1034 dprintf(
" Number of candidates to process: %d, nHits in layer: %d\n", theEndCand, layer_of_hits.
nHits());
1043 if (pickup_only || theEndCand == 0)
1049 for (
int itrack = 0; itrack < theEndCand; itrack +=
NN) {
1050 const int end =
std::min(itrack +
NN, theEndCand);
1053 dprintf(
"\nProcessing track=%d, start_seed=%d, n_seeds=%d, theEndCand=%d, end=%d, nn=%d, end_eq_tec=%d\n",
1062 for (
int i = itrack;
i < end; ++
i)
1070 for (
int i = itrack;
i < end; ++
i)
1071 dprintf(
" track %d, idx %d is from seed %d\n",
i,
i - itrack, mkfndr->
m_Label(
i - itrack, 0, 0));
1078 dprint(
"now get hit range");
1080 #ifdef DUMPHITWINDOW 1087 mkfndr, layer_info, extra_cands, seed_cand_idx,
region, start_seed, itrack, end);
1095 dprint(
"make new candidates");
1108 const int theEndUpdater = seed_cand_update_idx.size();
1110 for (
int itrack = 0; itrack < theEndUpdater; itrack +=
NN) {
1111 const int end =
std::min(itrack +
NN, theEndUpdater);
1124 auto &cc = eoccs[
iseed];
1126 for (
int i = 0;
i < ((
int)cc.size()) - 1; ++
i) {
1127 if (cc[
i].
score() < cc[
i + 1].score()) {
1128 printf(
"CloneEngine - NOT SORTED: layer=%d, iseed=%d (size=%lu)-- %d : %f smaller than %d : %f\n",
1164 tbb::parallel_for(rosi.tbb_blk_rng_vec(), [&](
const tbb::blocked_range<int> &blk_rng) {
1167 RangeOfSeedIndices rng = rosi.seed_rng(blk_rng);
1169 while (rng.valid()) {
1182 #ifdef DEBUG_FINAL_FIT 1186 for (
int icand = start_cand; icand < end_cand; icand +=
NN) {
1187 const int end =
std::min(icand +
NN, end_cand);
1189 #ifdef DEBUG_FINAL_FIT 1190 printf(
"Pre Final fit for %d - %d\n", icand, end);
1191 for (
int i = icand;
i < end; ++
i) {
1194 " %4d with q=%+d chi2=%7.3f pT=%7.3f eta=% 7.3f x=%.3f y=%.3f z=%.3f nHits=%2d label=%4d findable=%d\n",
1209 bool chi_debug =
false;
1210 #ifdef DEBUG_BACKWARD_FIT_BH 1225 #ifdef DEBUG_BACKWARD_FIT_BH 1228 mkfndr->
m_Chi2(0, 0, 0) / (eoccs[icand][0].nFoundHits() * 3 - 6) > 20.0
f) {
1230 #ifdef MKFIT_STANDALONE 1231 printf(
"CHIHDR Event %d, Cand %3d, pT %f, chipdof %f ### NOTE x,y,z in cm, sigmas, deltas in mum ### !!!\n",
1234 printf(
"CHIHDR Cand %3d, pT %f, chipdof %f ### NOTE x,y,z in cm, sigmas, deltas in mum ### !!!\n",
1238 mkfndr->
m_Chi2(0, 0, 0) / (eoccs[icand][0].nFoundHits() * 3 - 6));
1240 "CHIHDR %3s %10s %10s %10s %10s %10s %11s %11s %11s %10s %10s %10s %10s %11s %11s %11s %10s %10s %10s %10s " 1272 #ifdef DEBUG_FINAL_FIT 1273 printf(
"Post Final fit for %d - %d\n", icand, end);
1274 for (
int i = icand;
i < end; ++
i) {
1277 " %4d with q=%+d chi2=%7.3f pT=%7.3f eta=% 7.3f x=%.3f y=%.3f z=%.3f nHits=%2d label=%4d findable=%d\n",
1303 const int adaptiveSPT = std::clamp(
1305 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
1307 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
cands) {
1322 for (
int icand = start_cand; icand < end_cand; icand +=
step) {
1325 #ifdef DEBUG_FINAL_FIT 1326 printf(
"Pre Final fit for %d - %d\n", icand, end);
1327 for (
int i = icand;
i < end; ++
i) {
1330 " %4d with q=%+d chi2=%7.3f pT=%7.3f eta=% 7.3f x=%.3f y=%.3f z=%.3f nHits=%2d label=%4d findable=%d\n",
1345 bool chi_debug =
false;
1346 #ifdef DEBUG_BACKWARD_FIT 1348 static bool first =
true;
1352 "BKF_OVERLAP event/I:label/I:prod_type/I:is_findable/I:layer/I:is_stereo/I:is_barrel/I:" 1353 "pt/F:eta/F:phi/F:chi2/F:isnan/I:isfin/I:gtzero/I:hit_label/I:" 1354 "sx_t/F:sy_t/F:sz_t/F:d_xy/F:d_z/F\n");
1373 #ifdef DEBUG_FINAL_FIT 1374 printf(
"Post Final fit for %d - %d\n", icand, end);
1375 for (
int i = icand;
i < end; ++
i) {
1378 " %4d with q=%+d chi2=%7.3f pT=%7.3f eta=% 7.3f x=%.3f y=%.3f z=%.3f nHits=%2d label=%4d findable=%d\n",
const IterationConfig & m_iter_config
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
Track exportTrack(bool remove_missing_hits=false) const
void resizeAfterFiltering(int n_removed)
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)
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
void(MkBase::* m_propagate_foo)(float, const int, const PropagationFlags)
constexpr Process operator++(Process p)
void selectHitIndices(const LayerOfHits &layer_of_hits, const int N_proc)
void setState(SeedState_e ss)
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
const EventOfHits & m_event_of_hits
constexpr bool nan_n_silly_fixup_bad_cands_every_layer
void finalize_registration()
int filter_comb_cands(IterationConfig::filter_candidates_func filter)
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)
void setup_bkfit(const PropagationConfig &pc)
iterator make_iterator(IterationType_e type) const
static const PropagationConfig & get_default()
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 swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void register_entry_safe(typename A1::real_t r1, typename A2::real_t r2)
constexpr Matriplex::idx_t NN
void insertSeed(const Track &seed, int region, int pos)
Cos< T >::type cos(const T &t)
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
void setup(const PropagationConfig &pc, const IterationParams &ip, const IterationLayerConfig &ilc, const std::vector< bool > *ihm)
Pool< CandCloner > m_cloners
void begin_registration(C n_items)
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
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)
void updateWithLoadedHit(int N_proc, const FindingFoos &fnd_foos)
void print(std::string_view label, const MeasurementState &s)
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)
void begin_eta_bin(EventOfCombCandidates *e_o_ccs, std::vector< UpdateIndices > *update_list, std::vector< std::vector< TrackCand >> *extra_cands, int start_seed, int n_seeds)
while(__syncthreads_or(more))
int max_max_cands() const
~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])
std::function< filter_candidates_cf > filter_candidates_func
SeedState_e state() const
T & At(idx_t n, idx_t i, idx_t j)
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 Hit & refHit(int i) const
float getPar(int itrack, int i, int par) const