17 #ifdef MKFIT_STANDALONE 24 #include "oneapi/tbb/parallel_for.h" 25 #include "oneapi/tbb/parallel_for_each.h" 58 using namespace mkfit;
61 struct RangeOfSeedIndices {
62 int m_rng_beg, m_rng_end;
65 RangeOfSeedIndices(
int rb,
int re) : m_rng_beg(rb), m_rng_end(re) {
reset(); }
72 bool valid()
const {
return m_beg < m_rng_end; }
74 int n_proc()
const {
return m_end - m_beg; }
81 RangeOfSeedIndices &operator++() {
88 struct RegionOfSeedIndices {
89 int m_reg_beg, m_reg_end, m_vec_cnt;
91 RegionOfSeedIndices(
const std::vector<int> &seedEtaSeparators,
int region) {
92 m_reg_beg = (
region == 0) ? 0 : seedEtaSeparators[
region - 1];
93 m_reg_end = seedEtaSeparators[
region];
94 m_vec_cnt = (m_reg_end - m_reg_beg +
NN - 1) /
NN;
97 int count()
const {
return m_reg_end - m_reg_beg; }
99 tbb::blocked_range<int> tbb_blk_rng_std(
int thr_hint = -1)
const {
102 return tbb::blocked_range<int>(m_reg_beg, m_reg_end, thr_hint);
105 tbb::blocked_range<int> tbb_blk_rng_vec()
const {
109 RangeOfSeedIndices seed_rng(
const tbb::blocked_range<int> &
i)
const {
110 return RangeOfSeedIndices(m_reg_beg +
NN *
i.begin(),
std::min(m_reg_beg +
NN *
i.end(), m_reg_end));
115 void pre_prop_print(
int ilay,
MkBase *fir) {
116 const float pt = 1.f / fir->
getPar(0, 0, 3);
117 std::cout <<
"propagate to lay=" << ilay <<
" start from x=" << fir->
getPar(0, 0, 0)
118 <<
" y=" << fir->
getPar(0, 0, 1) <<
" z=" << fir->
getPar(0, 0, 2)
124 void post_prop_print(
int ilay,
MkBase *fir) {
125 std::cout <<
"propagate to lay=" << ilay <<
" arrive at x=" << fir->
getPar(0, 1, 0) <<
" y=" << fir->
getPar(0, 1, 1)
131 std::cout <<
"MX - found seed with label=" <<
seed.label() <<
" nHits=" <<
seed.nFoundHits()
132 <<
" chi2=" <<
seed.chi2() <<
" posEta=" <<
seed.posEta() <<
" posPhi=" <<
seed.posPhi()
133 <<
" posR=" <<
seed.posR() <<
" posZ=" <<
seed.z() <<
" pT=" <<
seed.pT() << std::endl;
137 std::cout <<
"MX - found seed with nFoundHits=" <<
seed.nFoundHits() <<
" chi2=" <<
seed.chi2() <<
" x=" <<
seed.x()
138 <<
" y=" <<
seed.y() <<
" z=" <<
seed.z() <<
" px=" <<
seed.px() <<
" py=" <<
seed.py()
139 <<
" pz=" <<
seed.pz() <<
" pT=" <<
seed.pT() << std::endl;
151 print_seed2(event_of_comb_cands[
iseed].front());
176 int lsize = eoh[
l].nHits();
179 maxL = eoh[
l].layer_id();
213 std::cout <<
"MkBuilder building tracks with '" << build_type <<
"'" 231 const bool seeds_sorted,
232 std::function<insert_seed_foo> insert_seed) {
235 const int size = in_seeds.size();
238 std::vector<unsigned> ranks;
249 ranks.swap(phi_eta_binnor.
m_ranks);
254 for (
int i = 0;
i <
size; ++
i) {
255 int j = seeds_sorted ?
i : ranks[
i];
256 int reg =
part.m_region[
j];
269 for (
int i = 0;
i <
size; ++
i) {
270 int j = seeds_sorted ?
i : ranks[
i];
271 int reg =
part.m_region[
j];
273 insert_seed(
seed, reg, seed_cursors[reg]++);
289 dprintf(
"MkBuilder::import_seeds finished import of %d seeds (last seeding layer min, max):\n" 290 " ec- = %d(%d,%d), t- = %d(%d,%d), brl = %d(%d,%d), t+ = %d(%d,%d), ec+ = %d(%d,%d).\n",
305 int i = 0, place_pos = 0;
307 dprintf(
"MkBuilder::filter_comb_cands Entering filter size eoccsm_size=%d\n", eoccs.
size());
310 while (
i < eoccs.
size()) {
311 if (
filter(eoccs[
i].front())) {
317 ++removed_cnts[eoccs[
i].front().getEtaRegion()];
324 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",
328 n_removed + removed_cnts[reg],
332 n_removed += removed_cnts[reg];
338 dprintf(
"MkBuilder::filter_comb_cands n_removed = %d, eoccsm_size=%d\n", n_removed, eoccs.
size());
345 int min[5],
max[5], gmin = 0, gmax = 0;
347 for (
int reg = 0; reg < 5; ++reg) {
358 printf(
"MkBuilder::find_min_max_hots_size MIN %3d -- [ %3d | %3d | %3d | %3d | %3d ] " 359 "MAX %3d -- [ %3d | %3d | %3d | %3d | %3d ]\n",
373 out_vec.reserve(out_vec.size() + eoccs.
size());
374 for (
int i = 0;
i < eoccs.
size();
i++) {
376 assert(!eoccs[
i].
empty() &&
"BackwardFitBH requires output tracks to align with seeds.");
381 out_vec.emplace_back(bcand.
exportTrack(remove_missing_hits));
387 out_vec.reserve(out_vec.size() +
m_tracks.size());
389 out_vec.emplace_back(
t);
398 #ifdef SELECT_SEED_LABEL 400 for (
int i = 0;
i < (
int)tv.size(); ++
i) {
401 if (tv[
i].
label() == SELECT_SEED_LABEL) {
402 printf(
"Preselect seed with label %d - found on pos %d\n", SELECT_SEED_LABEL,
i);
410 if (tv.size() != 1) {
411 printf(
"Preselect seed with label %d - NOT FOUND. Cleaning out seeds.\n", SELECT_SEED_LABEL);
420 for (
int i = 0;
i < (
int)tv.size(); ++
i) {
423 "Post-cleaning seed silly value check and fix");
429 tv.erase(tv.begin() +
i);
436 printf(
"Nan'n'Silly detected %d silly seeds (fix=%d, remove=%d).\n",
450 assert(!in_seeds.empty());
470 printf(
"No backward search plan for region %d\n",
region);
485 tbb::parallel_for(rosi.tbb_blk_rng_vec(), [&](
const tbb::blocked_range<int> &blk_rng) {
488 RangeOfSeedIndices rng = rosi.seed_rng(blk_rng);
490 std::vector<int> trk_idcs(
NN);
491 std::vector<int> trk_llay(
NN);
493 while (rng.valid()) {
494 dprint(std::endl <<
"processing track=" << rng.m_beg <<
", label=" <<
cands[rng.m_beg].label());
496 int prev_layer = 9999;
498 for (
int i = rng.m_beg,
ii = 0;
i < rng.m_end; ++
i, ++
ii) {
499 int llay =
cands[
i].getLastHitLyr();
501 prev_layer =
std::min(prev_layer, llay);
509 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
511 layer_plan_it.layer(),
512 layer_plan_it.last_layer());
514 assert(layer_plan_it.is_pickup_only());
516 int curr_layer = layer_plan_it.layer();
518 mkfndr->m_Stopped.setVal(0);
523 while (++layer_plan_it) {
524 prev_layer = curr_layer;
525 curr_layer = layer_plan_it.layer();
526 mkfndr->setup(prop_config,
534 dprint(
"at layer " << curr_layer <<
", nHits in layer " << layer_of_hits.
nHits());
537 if (curr_tridx < rng.n_proc()) {
538 int prev_tridx = curr_tridx;
540 for (
int i = rng.m_beg,
ii = 0;
i < rng.m_end; ++
i, ++
ii) {
541 if (trk_llay[
ii] == prev_layer)
542 trk_idcs[curr_tridx++] =
i;
544 if (curr_tridx > prev_tridx) {
545 dprintf(
"added %d seeds, started with %d\n", curr_tridx - prev_tridx, prev_tridx);
547 mkfndr->inputTracksAndHitIdx(
cands, trk_idcs, prev_tridx, curr_tridx,
false, prev_tridx);
551 if (layer_plan_it.is_pickup_only())
554 dcall(pre_prop_print(curr_layer, mkfndr.get()));
559 dcall(post_prop_print(curr_layer, mkfndr.get()));
561 mkfndr->selectHitIndices(layer_of_hits, curr_tridx);
565 const float r_min_sqr = layer_info.
rin() * layer_info.
rin();
566 for (
int i = 0;
i < curr_tridx; ++
i) {
567 if (!mkfndr->m_Stopped[
i]) {
568 if (mkfndr->radiusSqr(
i,
MkBase::iP) < r_min_sqr) {
570 mkfndr->m_Stopped[
i] = 1;
571 mkfndr->outputTrackAndHitIdx(
cands[rng.m_beg +
i],
i,
false);
574 mkfndr->m_XHitSize[
i] = 0;
578 mkfndr->m_XHitSize[
i] = 0;
584 dprint(
"make new candidates");
586 mkfndr->addBestHit(layer_of_hits, curr_tridx, fnd_foos);
589 for (
int i = 0;
i < curr_tridx; ++
i) {
590 if (!mkfndr->m_Stopped[
i] && mkfndr->bestHitLastHoT(
i).index == -2) {
591 mkfndr->m_Stopped[
i] = 1;
592 mkfndr->outputTrackAndHitIdx(
cands[rng.m_beg +
i],
i,
false);
598 mkfndr->outputNonStoppedTracksAndHitIdx(
cands, trk_idcs, 0, curr_tridx,
false);
614 assert(!in_seeds.empty());
633 seed_cand_vec.clear();
646 for (
int ic = 0; ic < (
int)ccand.
size(); ++ic) {
647 if (ccand[ic].getLastHitIdx() != -2) {
649 if (ccand[ic].
pT() < iter_params.minPtCut) {
650 ccand[ic].addHitIdx(-2,
layer, 0.0
f);
655 const float dphi =
std::abs(ccand[ic].posPhi() - ccand[ic].momPhi());
656 if (ccand[ic].posRsq() > 625.
f && dphi > 1.371
f && dphi < 4.512
f) {
659 ccand[ic].addHitIdx(-2,
layer, 0.0
f);
665 seed_cand_vec.push_back(std::pair<int, int>(
iseed, ic));
666 ccand[ic].resetOverlaps();
671 "Per layer silly check"))
686 return seed_cand_vec.size();
692 const std::vector<std::pair<int, int>> &seed_cand_idx,
694 const int start_seed,
704 for (
int ti = itrack; ti <
end; ++ti) {
712 dprintf(
"WSR Check label %d, seed %d, cand %d score %f -> wsr %d, in_gap %d\n",
714 seed_cand_idx[ti].first,
715 seed_cand_idx[ti].second,
720 if (layer_info.
is_barrel() && cand_r < layer_info.
rin()) {
724 dprintf(
"Barrel cand propagated to r=%f ... layer is %f - %f\n", cand_r, layer_info.
rin(), layer_info.
rout());
729 tmp_cands[seed_cand_idx[ti].first - start_seed].push_back(
cand);
731 dprintf(
" creating extra stopped held back candidate\n");
732 tmp_cands[seed_cand_idx[ti].first - start_seed].back().addHitIdx(-2, layer_info.
layer_id(), 0);
735 dprintf(
" creating extra held back candidate\n");
736 tmp_cands[seed_cand_idx[ti].first - start_seed].push_back(
cand);
754 printf(
"No backward search plan for region %d\n",
region);
766 const int adaptiveSPT = std::clamp(
768 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
771 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
seeds) {
774 const int start_seed =
seeds.begin();
775 const int end_seed =
seeds.end();
776 const int n_seeds = end_seed - start_seed;
778 std::vector<std::vector<TrackCand>> tmp_cands(n_seeds);
780 tmp_cands[
iseed].reserve(2 *
params.maxCandsPerSeed);
783 std::vector<std::pair<int, int>> seed_cand_idx;
784 seed_cand_idx.reserve(n_seeds *
params.maxCandsPerSeed);
788 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
790 layer_plan_it.layer(),
791 layer_plan_it.last_layer());
793 assert(layer_plan_it.is_pickup_only());
795 int curr_layer = layer_plan_it.layer(), prev_layer;
797 dprintf(
"\nMkBuilder::FindTracksStandard region=%d, seed_pickup_layer=%d, first_layer=%d\n",
800 layer_plan_it.next_layer());
806 while (++layer_plan_it) {
807 prev_layer = curr_layer;
808 curr_layer = layer_plan_it.layer();
809 mkfndr->setup(prop_config,
814 dprintf(
"\n* Processing layer %d\n", curr_layer);
825 layer_plan_it.is_pickup_only(),
828 dprintf(
" Number of candidates to process: %d, nHits in layer: %d\n", theEndCand, layer_of_hits.
nHits());
830 if (layer_plan_it.is_pickup_only() || theEndCand == 0)
834 for (
int itrack = 0; itrack < theEndCand; itrack +=
NN) {
837 dprint(
"processing track=" << itrack <<
", label=" 838 << eoccs[seed_cand_idx[itrack].
first][seed_cand_idx[itrack].
second].
label());
841 mkfndr->inputTracksAndHitIdx(eoccs.
refCandidates(), seed_cand_idx, itrack,
end,
false);
844 dcall(pre_prop_print(curr_layer, mkfndr.get()));
849 dcall(post_prop_print(curr_layer, mkfndr.get()));
851 dprint(
"now get hit range");
852 mkfndr->selectHitIndices(layer_of_hits,
end - itrack);
855 mkfndr.get(), layer_info, tmp_cands, seed_cand_idx,
region, start_seed, itrack,
end);
857 dprint(
"make new candidates");
858 mkfndr->findCandidates(layer_of_hits, tmp_cands, start_seed,
end - itrack, fnd_foos);
863 for (
int is = 0; is < n_seeds; ++is) {
864 dprint(
"dump seed n " << is <<
" with N_input_candidates=" << tmp_cands[is].
size());
866 std::sort(tmp_cands[is].begin(), tmp_cands[is].
end(), sortCandByScore);
870 for (
int is = 0; is < n_seeds; ++is) {
871 if (!tmp_cands[is].
empty()) {
872 eoccs[start_seed + is].clear();
876 bool first_short =
true;
877 for (
int ii = 0;
ii < (
int)tmp_cands[is].
size() && n_placed <
params.maxCandsPerSeed; ++
ii) {
895 eoccs[start_seed + is].emplace_back(tc);
897 }
else if (first_short) {
899 if (tc.
score() > eoccs[start_seed + is].refBestShortCand().score()) {
900 eoccs[start_seed + is].setBestShortCand(tc);
905 tmp_cands[is].clear();
933 printf(
"No backward search plan for region %d\n",
region);
940 const int adaptiveSPT = std::clamp(
942 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
944 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
seeds) {
964 const int start_seed,
973 const int n_seeds = end_seed - start_seed;
975 std::vector<std::pair<int, int>> seed_cand_idx, seed_cand_update_idx;
976 seed_cand_idx.reserve(n_seeds *
params.maxCandsPerSeed);
977 seed_cand_update_idx.reserve(n_seeds *
params.maxCandsPerSeed);
979 std::vector<std::vector<TrackCand>> extra_cands(n_seeds);
980 for (
int ii = 0;
ii < n_seeds; ++
ii)
981 extra_cands[
ii].reserve(
params.maxCandsPerSeed);
983 cloner.
begin_eta_bin(&eoccs, &seed_cand_update_idx, &extra_cands, start_seed, n_seeds);
991 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
993 layer_plan_it.layer(),
994 layer_plan_it.last_layer());
996 assert(layer_plan_it.is_pickup_only());
998 int curr_layer = layer_plan_it.layer(), prev_layer;
1001 "\nMkBuilder::find_tracks_in_layers region=%d, seed_pickup_layer=%d, first_layer=%d; start_seed=%d, " 1005 layer_plan_it.next_layer(),
1013 while (++layer_plan_it) {
1014 prev_layer = curr_layer;
1015 curr_layer = layer_plan_it.layer();
1016 mkfndr->
setup(prop_config,
1021 const bool pickup_only = layer_plan_it.is_pickup_only();
1023 dprintf(
"\n\n* Processing layer %d, %s\n\n", curr_layer, pickup_only ?
"pickup only" :
"full finding");
1030 seed_cand_idx, start_seed, end_seed, curr_layer, prev_layer, pickup_only, iteration_dir);
1032 dprintf(
" Number of candidates to process: %d, nHits in layer: %d\n", theEndCand, layer_of_hits.
nHits());
1041 if (pickup_only || theEndCand == 0)
1047 for (
int itrack = 0; itrack < theEndCand; itrack +=
NN) {
1051 dprintf(
"\nProcessing track=%d, start_seed=%d, n_seeds=%d, theEndCand=%d, end=%d, nn=%d, end_eq_tec=%d\n",
1060 for (
int i = itrack;
i <
end; ++
i)
1068 for (
int i = itrack;
i <
end; ++
i)
1069 dprintf(
" track %d, idx %d is from seed %d\n",
i,
i - itrack, mkfndr->
m_Label(
i - itrack, 0, 0));
1076 dprint(
"now get hit range");
1078 #ifdef DUMPHITWINDOW 1085 mkfndr, layer_info, extra_cands, seed_cand_idx,
region, start_seed, itrack,
end);
1093 dprint(
"make new candidates");
1106 const int theEndUpdater = seed_cand_update_idx.size();
1108 for (
int itrack = 0; itrack < theEndUpdater; itrack +=
NN) {
1122 auto &cc = eoccs[
iseed];
1124 for (
int i = 0;
i < ((
int)cc.size()) - 1; ++
i) {
1125 if (cc[
i].
score() < cc[
i + 1].score()) {
1126 printf(
"CloneEngine - NOT SORTED: layer=%d, iseed=%d (size=%lu)-- %d : %f smaller than %d : %f\n",
1162 tbb::parallel_for(rosi.tbb_blk_rng_vec(), [&](
const tbb::blocked_range<int> &blk_rng) {
1165 RangeOfSeedIndices rng = rosi.seed_rng(blk_rng);
1167 while (rng.valid()) {
1184 for (
int icand = start_cand; icand < end_cand; icand +=
NN) {
1188 printf(
"Pre Final fit for %d - %d\n", icand,
end);
1189 for (
int i = icand;
i <
end; ++
i) {
1192 " %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",
1207 bool chi_debug =
false;
1208 #ifdef DEBUG_BACKWARD_FIT_BH 1223 #ifdef DEBUG_BACKWARD_FIT_BH 1226 mkfndr->
m_Chi2(0, 0, 0) / (eoccs[icand][0].nFoundHits() * 3 - 6) > 20.0
f) {
1228 #ifdef MKFIT_STANDALONE 1229 printf(
"CHIHDR Event %d, Cand %3d, pT %f, chipdof %f ### NOTE x,y,z in cm, sigmas, deltas in mum ### !!!\n",
1232 printf(
"CHIHDR Cand %3d, pT %f, chipdof %f ### NOTE x,y,z in cm, sigmas, deltas in mum ### !!!\n",
1236 mkfndr->
m_Chi2(0, 0, 0) / (eoccs[icand][0].nFoundHits() * 3 - 6));
1238 "CHIHDR %3s %10s %10s %10s %10s %10s %11s %11s %11s %10s %10s %10s %10s %11s %11s %11s %10s %10s %10s %10s " 1271 printf(
"Post Final fit for %d - %d\n", icand,
end);
1272 for (
int i = icand;
i <
end; ++
i) {
1275 " %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",
1301 const int adaptiveSPT = std::clamp(
1303 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
1305 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
cands) {
1320 for (
int icand = start_cand; icand < end_cand; icand +=
step) {
1324 printf(
"Pre Final fit for %d - %d\n", icand,
end);
1325 for (
int i = icand;
i <
end; ++
i) {
1328 " %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",
1343 bool chi_debug =
false;
1344 #ifdef DEBUG_BACKWARD_FIT 1346 static bool first =
true;
1350 "BKF_OVERLAP event/I:label/I:prod_type/I:is_findable/I:layer/I:is_stereo/I:is_barrel/I:" 1351 "pt/F:eta/F:phi/F:chi2/F:isnan/I:isfin/I:gtzero/I:hit_label/I:" 1352 "sx_t/F:sy_t/F:sz_t/F:d_xy/F:d_z/F\n");
1372 printf(
"Post Final fit for %d - %d\n", icand,
end);
1373 for (
int i = icand;
i <
end; ++
i) {
1376 " %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
int filter_comb_cands(std::function< filter_track_cand_foo > filter)
void(MkBase::* m_propagate_foo)(float, const int, const PropagationFlags)
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
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()
constexpr std::array< uint8_t, layerIndexSize > layer
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 begin_eta_bin(EventOfCombCandidates *e_o_ccs, std::vector< std::pair< int, int >> *update_list, std::vector< std::vector< TrackCand >> *extra_cands, int start_seed, int n_seeds)
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)
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)
void updateWithLastHit(const LayerOfHits &layer_of_hits, int N_proc, const FindingFoos &fnd_foos)
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 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)
while(__syncthreads_or(more))
int max_max_cands() const
std::function< partition_seeds_foo > m_partition_seeds
~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 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