17 #ifdef MKFIT_STANDALONE 25 #include "oneapi/tbb/parallel_for.h" 26 #include "oneapi/tbb/parallel_for_each.h" 56 using namespace mkfit;
59 struct RangeOfSeedIndices {
60 int m_rng_beg, m_rng_end;
63 RangeOfSeedIndices(
int rb,
int re) : m_rng_beg(rb), m_rng_end(re) {
reset(); }
70 bool valid()
const {
return m_beg < m_rng_end; }
72 int n_proc()
const {
return m_end - m_beg; }
86 struct RegionOfSeedIndices {
87 int m_reg_beg, m_reg_end, m_vec_cnt;
89 RegionOfSeedIndices(
const std::vector<int> &seedEtaSeparators,
int region) {
90 m_reg_beg = (
region == 0) ? 0 : seedEtaSeparators[
region - 1];
91 m_reg_end = seedEtaSeparators[
region];
92 m_vec_cnt = (m_reg_end - m_reg_beg +
NN - 1) /
NN;
95 int count()
const {
return m_reg_end - m_reg_beg; }
97 tbb::blocked_range<int> tbb_blk_rng_std(
int thr_hint = -1)
const {
100 return tbb::blocked_range<int>(m_reg_beg, m_reg_end, thr_hint);
103 tbb::blocked_range<int> tbb_blk_rng_vec()
const {
107 RangeOfSeedIndices seed_rng(
const tbb::blocked_range<int> &
i)
const {
108 return RangeOfSeedIndices(m_reg_beg +
NN *
i.begin(),
std::min(m_reg_beg +
NN *
i.end(), m_reg_end));
113 void pre_prop_print(
int ilay,
MkBase *fir) {
114 const float pt = 1.f / fir->
getPar(0, 0, 3);
115 std::cout <<
"propagate to lay=" << ilay <<
" start from x=" << fir->
getPar(0, 0, 0)
116 <<
" y=" << fir->
getPar(0, 0, 1) <<
" z=" << fir->
getPar(0, 0, 2)
122 void post_prop_print(
int ilay,
MkBase *fir) {
123 std::cout <<
"propagate to lay=" << ilay <<
" arrive at x=" << fir->
getPar(0, 1, 0) <<
" y=" << fir->
getPar(0, 1, 1)
129 std::cout <<
"MX - found seed with label=" <<
seed.label() <<
" nHits=" <<
seed.nFoundHits()
130 <<
" chi2=" <<
seed.chi2() <<
" posEta=" <<
seed.posEta() <<
" posPhi=" <<
seed.posPhi()
131 <<
" posR=" <<
seed.posR() <<
" posZ=" <<
seed.z() <<
" pT=" <<
seed.pT() << std::endl;
135 std::cout <<
"MX - found seed with nFoundHits=" <<
seed.nFoundHits() <<
" chi2=" <<
seed.chi2() <<
" x=" <<
seed.x()
136 <<
" y=" <<
seed.y() <<
" z=" <<
seed.z() <<
" px=" <<
seed.px() <<
" py=" <<
seed.py()
137 <<
" pz=" <<
seed.pz() <<
" pT=" <<
seed.pT() << std::endl;
149 print_seed2(event_of_comb_cands[
iseed].front());
174 int lsize = eoh[
l].nHits();
177 maxL = eoh[
l].layer_id();
211 std::cout <<
"MkBuilder building tracks with '" << build_type <<
"'" 229 const bool seeds_sorted,
230 std::function<insert_seed_foo> insert_seed) {
233 const int size = in_seeds.size();
236 std::vector<unsigned> ranks;
247 ranks.swap(phi_eta_binnor.
m_ranks);
252 for (
int i = 0;
i <
size; ++
i) {
253 int j = seeds_sorted ?
i : ranks[
i];
254 int reg =
part.m_region[
j];
267 for (
int i = 0;
i <
size; ++
i) {
268 int j = seeds_sorted ?
i : ranks[
i];
269 int reg =
part.m_region[
j];
271 insert_seed(
seed, reg, seed_cursors[reg]++);
287 dprintf(
"MkBuilder::import_seeds finished import of %d seeds (last seeding layer min, max):\n" 288 " ec- = %d(%d,%d), t- = %d(%d,%d), brl = %d(%d,%d), t+ = %d(%d,%d), ec+ = %d(%d,%d).\n",
303 int i = 0, place_pos = 0;
305 dprintf(
"MkBuilder::filter_comb_cands Entering filter size eoccs.size=%d\n", eoccs.
size());
308 while (
i < eoccs.
size()) {
310 eoccs[
i].repackCandPostBkwSearch(0);
313 if (!
passed && attempt_all_cands) {
316 eoccs[
i].repackCandPostBkwSearch(
j);
318 eoccs[
i][0] = eoccs[
i][
j];
330 ++removed_cnts[eoccs[
i].front().getEtaRegion()];
337 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",
341 n_removed + removed_cnts[reg],
345 n_removed += removed_cnts[reg];
351 dprintf(
"MkBuilder::filter_comb_cands n_removed = %d, eoccs.size=%d\n", n_removed, eoccs.
size());
358 int min[5],
max[5], gmin = 0, gmax = 0;
360 for (
int reg = 0; reg < 5; ++reg) {
371 printf(
"MkBuilder::find_min_max_hots_size MIN %3d -- [ %3d | %3d | %3d | %3d | %3d ] " 372 "MAX %3d -- [ %3d | %3d | %3d | %3d | %3d ]\n",
386 out_vec.reserve(out_vec.size() + eoccs.
size());
387 for (
int i = 0;
i < eoccs.
size();
i++) {
391 out_vec.emplace_back(bcand.
exportTrack(remove_missing_hits));
397 out_vec.reserve(out_vec.size() +
m_tracks.size());
399 out_vec.emplace_back(
t);
411 for (
int i = 0;
i < (
int)tv.size(); ++
i) {
414 "Post-cleaning seed silly value check and fix");
420 tv.erase(tv.begin() +
i);
427 printf(
"Nan'n'Silly detected %d silly seeds (fix=%d, remove=%d).\n",
441 assert(!in_seeds.empty());
461 printf(
"No backward search plan for region %d\n",
region);
476 tbb::parallel_for(rosi.tbb_blk_rng_vec(), [&](
const tbb::blocked_range<int> &blk_rng) {
479 RangeOfSeedIndices rng = rosi.seed_rng(blk_rng);
481 std::vector<int> trk_idcs(
NN);
482 std::vector<int> trk_llay(
NN);
484 while (rng.valid()) {
485 dprint(std::endl <<
"processing track=" << rng.m_beg <<
", label=" <<
cands[rng.m_beg].label());
487 int prev_layer = 9999;
489 for (
int i = rng.m_beg,
ii = 0;
i < rng.m_end; ++
i, ++
ii) {
490 int llay =
cands[
i].getLastHitLyr();
492 prev_layer =
std::min(prev_layer, llay);
500 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
502 layer_plan_it.layer(),
503 layer_plan_it.last_layer());
505 assert(layer_plan_it.is_pickup_only());
507 int curr_layer = layer_plan_it.layer();
509 mkfndr->m_Stopped.setVal(0);
514 while (++layer_plan_it) {
515 prev_layer = curr_layer;
516 curr_layer = layer_plan_it.layer();
517 mkfndr->setup(prop_config,
527 dprint(
"at layer " << curr_layer <<
", nHits in layer " << layer_of_hits.
nHits());
530 if (curr_tridx < rng.n_proc()) {
531 int prev_tridx = curr_tridx;
533 for (
int i = rng.m_beg,
ii = 0;
i < rng.m_end; ++
i, ++
ii) {
534 if (trk_llay[
ii] == prev_layer)
535 trk_idcs[curr_tridx++] =
i;
537 if (curr_tridx > prev_tridx) {
538 dprintf(
"added %d seeds, started with %d\n", curr_tridx - prev_tridx, prev_tridx);
540 mkfndr->inputTracksAndHitIdx(
cands, trk_idcs, prev_tridx, curr_tridx,
false, prev_tridx);
544 if (layer_plan_it.is_pickup_only())
547 dcall(pre_prop_print(curr_layer, mkfndr.get()));
549 mkfndr->clearFailFlag();
553 dcall(post_prop_print(curr_layer, mkfndr.get()));
555 mkfndr->selectHitIndices(layer_of_hits, curr_tridx);
559 const float r_min_sqr = layer_info.
rin() * layer_info.
rin();
560 for (
int i = 0;
i < curr_tridx; ++
i) {
561 if (!mkfndr->m_Stopped[
i]) {
562 if (mkfndr->radiusSqr(
i,
MkBase::iP) < r_min_sqr) {
564 mkfndr->m_Stopped[
i] = 1;
565 mkfndr->outputTrackAndHitIdx(
cands[rng.m_beg +
i],
i,
false);
568 mkfndr->m_XHitSize[
i] = 0;
572 mkfndr->m_XHitSize[
i] = 0;
578 dprint(
"make new candidates");
580 mkfndr->addBestHit(layer_of_hits, curr_tridx, fnd_foos);
583 for (
int i = 0;
i < curr_tridx; ++
i) {
584 if (!mkfndr->m_Stopped[
i] && mkfndr->bestHitLastHoT(
i).index == -2) {
585 mkfndr->m_Stopped[
i] = 1;
586 mkfndr->outputTrackAndHitIdx(
cands[rng.m_beg +
i],
i,
false);
592 mkfndr->outputNonStoppedTracksAndHitIdx(
cands, trk_idcs, 0, curr_tridx,
false);
608 assert(!in_seeds.empty());
627 seed_cand_vec.clear();
640 for (
int ic = 0; ic < (
int)ccand.
size(); ++ic) {
641 if (ccand[ic].getLastHitIdx() != -2) {
643 if (ccand[ic].
pT() < iter_params.minPtCut) {
644 ccand[ic].addHitIdx(-2, layer, 0.0
f);
649 const float dphi =
std::abs(ccand[ic].posPhi() - ccand[ic].momPhi());
650 if (ccand[ic].posRsq() > 625.
f && dphi > 1.371
f && dphi < 4.512
f) {
653 ccand[ic].addHitIdx(-2, layer, 0.0
f);
659 seed_cand_vec.push_back(std::pair<int, int>(
iseed, ic));
660 ccand[ic].resetOverlaps();
665 "Per layer silly check"))
680 return seed_cand_vec.size();
686 const std::vector<std::pair<int, int>> &seed_cand_idx,
688 const int start_seed,
698 for (
int ti = itrack; ti < end; ++ti) {
706 dprintf(
"WSR Check label %d, seed %d, cand %d score %f -> wsr %d, in_gap %d\n",
708 seed_cand_idx[ti].first,
709 seed_cand_idx[ti].second,
714 if (layer_info.
is_barrel() && cand_r < layer_info.
rin()) {
718 dprintf(
"Barrel cand propagated to r=%f ... layer is %f - %f\n", cand_r, layer_info.
rin(), layer_info.
rout());
723 tmp_cands[seed_cand_idx[ti].first - start_seed].push_back(
cand);
725 dprintf(
" creating extra stopped held back candidate\n");
726 tmp_cands[seed_cand_idx[ti].first - start_seed].back().addHitIdx(-2, layer_info.
layer_id(), 0);
729 dprintf(
" creating extra held back candidate\n");
730 tmp_cands[seed_cand_idx[ti].first - start_seed].push_back(
cand);
748 printf(
"No backward search plan for region %d\n",
region);
760 const int adaptiveSPT = std::clamp(
762 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
765 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
seeds) {
768 const int start_seed =
seeds.begin();
769 const int end_seed =
seeds.end();
770 const int n_seeds = end_seed - start_seed;
772 std::vector<std::vector<TrackCand>> tmp_cands(n_seeds);
774 tmp_cands[
iseed].reserve(2 *
params.maxCandsPerSeed);
777 std::vector<std::pair<int, int>> seed_cand_idx;
778 seed_cand_idx.reserve(n_seeds *
params.maxCandsPerSeed);
782 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
784 layer_plan_it.layer(),
785 layer_plan_it.last_layer());
787 assert(layer_plan_it.is_pickup_only());
789 int curr_layer = layer_plan_it.layer(), prev_layer;
791 dprintf(
"\nMkBuilder::FindTracksStandard region=%d, seed_pickup_layer=%d, first_layer=%d\n",
794 layer_plan_it.next_layer());
800 while (++layer_plan_it) {
801 prev_layer = curr_layer;
802 curr_layer = layer_plan_it.layer();
803 mkfndr->setup(prop_config,
810 dprintf(
"\n* Processing layer %d\n", curr_layer);
821 layer_plan_it.is_pickup_only(),
824 dprintf(
" Number of candidates to process: %d, nHits in layer: %d\n", theEndCand, layer_of_hits.
nHits());
826 if (layer_plan_it.is_pickup_only() || theEndCand == 0)
830 for (
int itrack = 0; itrack < theEndCand; itrack +=
NN) {
833 dprint(
"processing track=" << itrack <<
", label=" 834 << eoccs[seed_cand_idx[itrack].
first][seed_cand_idx[itrack].
second].
label());
837 mkfndr->inputTracksAndHitIdx(eoccs.
refCandidates(), seed_cand_idx, itrack, end,
false);
840 dcall(pre_prop_print(curr_layer, mkfndr.get()));
842 mkfndr->clearFailFlag();
846 dcall(post_prop_print(curr_layer, mkfndr.get()));
848 dprint(
"now get hit range");
849 mkfndr->selectHitIndices(layer_of_hits, end - itrack);
852 mkfndr.get(), layer_info, tmp_cands, seed_cand_idx,
region, start_seed, itrack, end);
854 dprint(
"make new candidates");
855 mkfndr->findCandidates(layer_of_hits, tmp_cands, start_seed, end - itrack, fnd_foos);
860 for (
int is = 0; is < n_seeds; ++is) {
861 dprint(
"dump seed n " << is <<
" with N_input_candidates=" << tmp_cands[is].
size());
863 std::sort(tmp_cands[is].begin(), tmp_cands[is].end(), sortCandByScore);
867 for (
int is = 0; is < n_seeds; ++is) {
868 if (!tmp_cands[is].
empty()) {
869 eoccs[start_seed + is].clear();
873 bool first_short =
true;
874 for (
int ii = 0;
ii < (
int)tmp_cands[is].
size() && n_placed <
params.maxCandsPerSeed; ++
ii) {
892 eoccs[start_seed + is].emplace_back(tc);
894 }
else if (first_short) {
896 if (tc.
score() > eoccs[start_seed + is].refBestShortCand().score()) {
897 eoccs[start_seed + is].setBestShortCand(tc);
902 tmp_cands[is].clear();
930 printf(
"No backward search plan for region %d\n",
region);
937 const int adaptiveSPT = std::clamp(
939 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
941 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
seeds) {
961 const int start_seed,
970 const int n_seeds = end_seed - start_seed;
972 std::vector<std::pair<int, int>> seed_cand_idx;
973 std::vector<UpdateIndices> seed_cand_update_idx;
974 seed_cand_idx.reserve(n_seeds *
params.maxCandsPerSeed);
975 seed_cand_update_idx.reserve(n_seeds *
params.maxCandsPerSeed);
977 std::vector<std::vector<TrackCand>> extra_cands(n_seeds);
978 for (
int ii = 0;
ii < n_seeds; ++
ii)
979 extra_cands[
ii].reserve(
params.maxCandsPerSeed);
981 cloner.
begin_eta_bin(&eoccs, &seed_cand_update_idx, &extra_cands, start_seed, n_seeds);
987 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
989 layer_plan_it.layer(),
990 layer_plan_it.last_layer());
992 assert(layer_plan_it.is_pickup_only());
994 int curr_layer = layer_plan_it.layer(), prev_layer;
997 "\nMkBuilder::find_tracks_in_layers region=%d, seed_pickup_layer=%d, first_layer=%d; start_seed=%d, " 1001 layer_plan_it.next_layer(),
1009 while (++layer_plan_it) {
1010 prev_layer = curr_layer;
1011 curr_layer = layer_plan_it.layer();
1012 mkfndr->
setup(prop_config,
1019 const bool pickup_only = layer_plan_it.is_pickup_only();
1021 dprintf(
"\n\n* Processing layer %d, %s\n\n", curr_layer, pickup_only ?
"pickup only" :
"full finding");
1028 seed_cand_idx, start_seed, end_seed, curr_layer, prev_layer, pickup_only, iteration_dir);
1030 dprintf(
" Number of candidates to process: %d, nHits in layer: %d\n", theEndCand, layer_of_hits.
nHits());
1039 if (pickup_only || theEndCand == 0)
1045 for (
int itrack = 0; itrack < theEndCand; itrack +=
NN) {
1046 const int end =
std::min(itrack +
NN, theEndCand);
1049 dprintf(
"\nProcessing track=%d, start_seed=%d, n_seeds=%d, theEndCand=%d, end=%d, nn=%d, end_eq_tec=%d\n",
1058 for (
int i = itrack;
i < end; ++
i)
1066 for (
int i = itrack;
i < end; ++
i)
1067 dprintf(
" track %d, idx %d is from seed %d\n",
i,
i - itrack, mkfndr->
m_Label(
i - itrack, 0, 0));
1075 dprint(
"now get hit range");
1077 #ifdef DUMPHITWINDOW 1084 mkfndr, layer_info, extra_cands, seed_cand_idx,
region, start_seed, itrack, end);
1092 dprint(
"make new candidates");
1105 const int theEndUpdater = seed_cand_update_idx.size();
1107 for (
int itrack = 0; itrack < theEndUpdater; itrack +=
NN) {
1108 const int end =
std::min(itrack +
NN, theEndUpdater);
1123 for (
int i = 0;
i < ((
int)
cc.size()) - 1; ++
i) {
1125 printf(
"CloneEngine - NOT SORTED: layer=%d, iseed=%d (size=%lu)-- %d : %f smaller than %d : %f\n",
1152 #ifdef DEBUG_FINAL_FIT 1156 dprintf(
" %4d with q=%+d chi2=%7.3f pT=%7.3f eta=% 7.3f x=%.3f y=%.3f z=%.3f" 1157 " nHits=%2d label=%4d findable=%d\n",
1158 i,
t.charge(),
t.chi2(),
t.pT(),
t.momEta(),
t.x(),
t.y(),
t.z(),
1159 t.nFoundHits(),
t.label(),
t.isFindable());
1169 tbb::parallel_for(rosi.tbb_blk_rng_vec(), [&](
const tbb::blocked_range<int> &blk_rng) {
1172 RangeOfSeedIndices rng = rosi.seed_rng(blk_rng);
1174 while (rng.valid()) {
1187 #ifdef DEBUG_FINAL_FIT 1192 for (
int icand = start_cand; icand < end_cand; icand +=
NN) {
1193 const int end =
std::min(icand +
NN, end_cand);
1195 #ifdef DEBUG_FINAL_FIT 1196 dprintf(
"Pre Final fit for %d - %d\n", icand, end);
1197 for (
int i = icand;
i < end; ++
i) {
1198 dprint_tcand(eoccs[
i][0],
i);
1202 bool chi_debug =
false;
1203 #ifdef DEBUG_BACKWARD_FIT_BH 1218 #ifdef DEBUG_BACKWARD_FIT_BH 1221 mkfndr->
m_Chi2(0, 0, 0) / (eoccs[icand][0].nFoundHits() * 3 - 6) > 20.0
f) {
1223 #ifdef MKFIT_STANDALONE 1224 printf(
"CHIHDR Event %d, Cand %3d, pT %f, chipdof %f ### NOTE x,y,z in cm, sigmas, deltas in mum ### !!!\n",
1227 printf(
"CHIHDR Cand %3d, pT %f, chipdof %f ### NOTE x,y,z in cm, sigmas, deltas in mum ### !!!\n",
1231 mkfndr->
m_Chi2(0, 0, 0) / (eoccs[icand][0].nFoundHits() * 3 - 6));
1233 printf(
"CHIHDR %3s %10s" 1234 " %10s %10s %10s %10s %11s %11s %11s" 1235 " %10s %10s %10s %10s %11s %11s %11s" 1236 " %10s %10s %10s %10s %10s %11s %11s\n",
1238 "x_h",
"y_h",
"z_h",
"r_h",
"sx_h",
"sy_h",
"sz_h",
1239 "x_t",
"y_t",
"z_t",
"r_t",
"sx_t",
"sy_t",
"sz_t",
1240 "pt",
"phi",
"theta",
"phi_h",
"phi_t",
"d_xy",
"d_z");
1249 #ifdef DEBUG_FINAL_FIT 1250 dprintf(
"Post Final fit for %d - %d\n", icand, end);
1251 for (
int i = icand;
i < end; ++
i) {
1252 dprint_tcand(eoccs[
i][0],
i);
1267 const int adaptiveSPT = std::clamp(
1269 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
1271 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
cands) {
1286 for (
int icand = start_cand; icand < end_cand; icand +=
step) {
1289 bool chi_debug =
false;
1291 #ifdef DEBUG_FINAL_FIT 1293 dprintf(
"Pre Final fit for %d - %d\n", icand, end);
1294 for (
int i = icand;
i < end; ++
i) {
1295 dprint_tcand(eoccs[
i][0],
i);
1298 static bool first =
true;
1302 "BKF_OVERLAP event/I:label/I:prod_type/I:is_findable/I:layer/I:is_stereo/I:is_barrel/I:" 1303 "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:" 1304 "sx_t/F:sy_t/F:sz_t/F:d_xy/F:d_z/F\n");
1323 #ifdef DEBUG_FINAL_FIT 1324 dprintf(
"Post Final fit for %d - %d\n", icand, end);
1325 for (
int i = icand;
i < end; ++
i) {
1326 dprint_tcand(eoccs[
i][0],
i);
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)
void setup_bkfit(const PropagationConfig &pc, const SteeringParams &sp)
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
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
bool cands_in_backward_rep() const
const EventOfHits & m_event_of_hits
constexpr bool nan_n_silly_fixup_bad_cands_every_layer
void finalize_registration()
void insertSeed(const Track &seed, const track_score_func &score_func, int region, int pos)
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
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
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
int filter_comb_cands(filter_candidates_func filter, bool attempt_all_cands)
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)
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])
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 setup(const PropagationConfig &pc, const IterationParams &ip, const IterationLayerConfig &ilc, const SteeringParams &sp, const std::vector< bool > *ihm, bool infwd)
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