16 #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; }
82 RangeOfSeedIndices &operator++() {
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)
122 <<
" pz=" << pt /
std::tan(fir->
getPar(0, 0, 5)) <<
" pT=" << pt << std::endl;
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)
133 <<
" chi2=" << seed.
chi2() <<
" posEta=" << seed.
posEta() <<
" posPhi=" << seed.
posPhi()
134 <<
" posR=" << seed.
posR() <<
" posZ=" << seed.
z() <<
" pT=" << seed.
pT() << std::endl;
137 void print_seed2(
const TrackCand &seed) {
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;
144 std::cout <<
"found total seeds=" << seeds.size() << std::endl;
145 for (
auto &&seed : seeds) {
152 print_seed2(event_of_comb_cands[
iseed].front());
194 std::cout <<
"MkBuilder building tracks with '" << build_type <<
"'"
214 const int size = in_seeds.size();
223 for (
int i = 0;
i <
size; ++
i) {
248 "MkBuilder::import_seeds finished import of %d seeds (last seeding layer min, max):\n"
249 " ec- = %d(%d,%d), t- = %d(%d,%d), brl = %d(%d,%d), t+ = %d(%d,%d), ec+ = %d(%d,%d).\n",
279 int i = 0, place_pos = 0;
281 dprintf(
"MkBuilder::filter_comb_cands Entering filter size eoccsm_size=%d\n", eoccs.
size());
284 while (i < eoccs.
size()) {
285 if (
filter(eoccs[i].front())) {
291 ++removed_cnts[eoccs[
i].front().getEtaRegion()];
298 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",
302 n_removed + removed_cnts[reg],
306 n_removed += removed_cnts[reg];
312 dprintf(
"MkBuilder::filter_comb_cands n_removed = %d, eoccsm_size=%d\n", n_removed, eoccs.
size());
319 int min[5],
max[5], gmin = 0, gmax = 0;
321 for (
int reg = 0; reg < 5; ++reg) {
325 min[reg] =
std::min(min[reg], eoccs[i].hotsSize());
326 max[reg] =
std::max(max[reg], eoccs[i].hotsSize());
332 "MkBuilder::find_min_max_hots_size MIN %3d -- [ %3d | %3d | %3d | %3d | %3d ] MAX %3d -- [ %3d | %3d | %3d | "
356 out_vec.reserve(out_vec.size() + eoccs.
size());
357 for (
int i = 0;
i < eoccs.
size();
i++) {
359 assert(!eoccs[
i].
empty() &&
"BackwardFitBH requires output tracks to align with seeds.");
364 out_vec.emplace_back(bcand.
exportTrack(remove_missing_hits));
370 out_vec.reserve(out_vec.size() +
m_tracks.size());
372 out_vec.emplace_back(
t);
381 #ifdef SELECT_SEED_LABEL
383 for (
int i = 0;
i < (int)tv.size(); ++
i) {
384 if (tv[
i].
label() == SELECT_SEED_LABEL) {
385 printf(
"Preselect seed with label %d - found on pos %d\n", SELECT_SEED_LABEL,
i);
393 if (tv.size() != 1) {
394 printf(
"Preselect seed with label %d - NOT FOUND. Cleaning out seeds.\n", SELECT_SEED_LABEL);
403 for (
int i = 0;
i < (int)tv.size(); ++
i) {
406 "Post-cleaning seed silly value check and fix");
412 tv.erase(tv.begin() +
i);
419 printf(
"Nan'n'Silly detected %d silly seeds (fix=%d, remove=%d).\n",
433 assert(!in_seeds.empty());
440 m_tracks.back().setEtaRegion(region);
454 printf(
"No backward search plan for region %d\n",
region);
469 tbb::parallel_for(rosi.tbb_blk_rng_vec(), [&](
const tbb::blocked_range<int> &blk_rng) {
472 RangeOfSeedIndices rng = rosi.seed_rng(blk_rng);
474 std::vector<int> trk_idcs(
NN);
475 std::vector<int> trk_llay(
NN);
477 while (rng.valid()) {
478 dprint(std::endl <<
"processing track=" << rng.m_beg <<
", label=" << cands[rng.m_beg].label());
480 int prev_layer = 9999;
482 for (
int i = rng.m_beg,
ii = 0;
i < rng.m_end; ++
i, ++
ii) {
483 int llay = cands[
i].getLastHitLyr();
485 prev_layer =
std::min(prev_layer, llay);
487 dprintf(
" %2d %2d %2d lay=%3d prev_layer=%d\n",
ii,
i, cands[
i].
label(), llay, prev_layer);
493 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
495 layer_plan_it.layer(),
496 layer_plan_it.last_layer());
498 assert(layer_plan_it.is_pickup_only());
500 int curr_layer = layer_plan_it.layer();
502 mkfndr->m_Stopped.setVal(0);
507 while (++layer_plan_it) {
508 prev_layer = curr_layer;
509 curr_layer = layer_plan_it.layer();
510 mkfndr->setup(prop_config,
518 dprint(
"at layer " << curr_layer <<
", nHits in layer " << layer_of_hits.
nHits());
521 if (curr_tridx < rng.n_proc()) {
522 int prev_tridx = curr_tridx;
524 for (
int i = rng.m_beg,
ii = 0;
i < rng.m_end; ++
i, ++
ii) {
525 if (trk_llay[
ii] == prev_layer)
526 trk_idcs[curr_tridx++] =
i;
528 if (curr_tridx > prev_tridx) {
529 dprintf(
"added %d seeds, started with %d\n", curr_tridx - prev_tridx, prev_tridx);
531 mkfndr->inputTracksAndHitIdx(cands, trk_idcs, prev_tridx, curr_tridx,
false, prev_tridx);
535 if (layer_plan_it.is_pickup_only())
538 dcall(pre_prop_print(curr_layer, mkfndr.get()));
543 dcall(post_prop_print(curr_layer, mkfndr.get()));
545 mkfndr->selectHitIndices(layer_of_hits, curr_tridx);
549 const float r_min_sqr = layer_info.
rin() * layer_info.
rin();
550 for (
int i = 0;
i < curr_tridx; ++
i) {
551 if (!mkfndr->m_Stopped[
i]) {
552 if (mkfndr->radiusSqr(
i,
MkBase::iP) < r_min_sqr) {
554 mkfndr->m_Stopped[
i] = 1;
555 mkfndr->outputTrackAndHitIdx(cands[rng.m_beg +
i],
i,
false);
558 mkfndr->m_XHitSize[
i] = 0;
562 mkfndr->m_XHitSize[
i] = 0;
568 dprint(
"make new candidates");
570 mkfndr->addBestHit(layer_of_hits, curr_tridx, fnd_foos);
573 for (
int i = 0;
i < curr_tridx; ++
i) {
574 if (!mkfndr->m_Stopped[
i] && mkfndr->bestHitLastHoT(
i).index == -2) {
575 mkfndr->m_Stopped[
i] = 1;
576 mkfndr->outputTrackAndHitIdx(cands[rng.m_beg +
i],
i,
false);
582 mkfndr->outputNonStoppedTracksAndHitIdx(cands, trk_idcs, 0, curr_tridx,
false);
598 assert(!in_seeds.empty());
615 seed_cand_vec.clear();
625 for (
int ic = 0; ic < (int)ccand.
size(); ++ic) {
626 if (ccand[ic].getLastHitIdx() != -2) {
629 const float dphi =
std::abs(ccand[ic].posPhi() - ccand[ic].momPhi());
630 if (ccand[ic].posRsq() > 625.
f && dphi > 1.371
f && dphi < 4.512
f) {
633 ccand[ic].addHitIdx(-2, layer, 0.0
f);
639 seed_cand_vec.push_back(std::pair<int, int>(
iseed, ic));
640 ccand[ic].resetOverlaps();
645 "Per layer silly check"))
660 return seed_cand_vec.size();
666 const std::vector<std::pair<int, int>> &seed_cand_idx,
668 const int start_seed,
678 for (
int ti = itrack; ti <
end; ++ti) {
686 dprintf(
"WSR Check label %d, seed %d, cand %d score %f -> wsr %d, in_gap %d\n",
688 seed_cand_idx[ti].first,
689 seed_cand_idx[ti].second,
694 if (layer_info.
is_barrel() && cand_r < layer_info.
rin()) {
698 dprintf(
"Barrel cand propagated to r=%f ... layer is %f - %f\n", cand_r, layer_info.
rin(), layer_info.
rout());
703 tmp_cands[seed_cand_idx[ti].first - start_seed].push_back(cand);
705 dprintf(
" creating extra stopped held back candidate\n");
706 tmp_cands[seed_cand_idx[ti].first - start_seed].back().addHitIdx(-2, layer_info.
layer_id(), 0);
709 dprintf(
" creating extra held back candidate\n");
710 tmp_cands[seed_cand_idx[ti].first - start_seed].push_back(cand);
728 printf(
"No backward search plan for region %d\n",
region);
740 const int adaptiveSPT = std::clamp(
742 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
745 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
seeds) {
748 const int start_seed = seeds.begin();
749 const int end_seed = seeds.end();
750 const int n_seeds = end_seed - start_seed;
752 std::vector<std::vector<TrackCand>> tmp_cands(n_seeds);
757 std::vector<std::pair<int, int>> seed_cand_idx;
762 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
764 layer_plan_it.layer(),
765 layer_plan_it.last_layer());
767 assert(layer_plan_it.is_pickup_only());
769 int curr_layer = layer_plan_it.layer(), prev_layer;
771 dprintf(
"\nMkBuilder::FindTracksStandard region=%d, seed_pickup_layer=%d, first_layer=%d\n",
774 layer_plan_it.next_layer());
780 while (++layer_plan_it) {
781 prev_layer = curr_layer;
782 curr_layer = layer_plan_it.layer();
783 mkfndr->setup(prop_config,
788 dprintf(
"\n* Processing layer %d\n", curr_layer);
799 layer_plan_it.is_pickup_only(),
802 dprintf(
" Number of candidates to process: %d, nHits in layer: %d\n", theEndCand, layer_of_hits.
nHits());
804 if (layer_plan_it.is_pickup_only() || theEndCand == 0)
808 for (
int itrack = 0; itrack < theEndCand; itrack +=
NN) {
811 dprint(
"processing track=" << itrack <<
", label="
812 << eoccs[seed_cand_idx[itrack].
first][seed_cand_idx[itrack].
second].
label());
815 mkfndr->inputTracksAndHitIdx(eoccs.
refCandidates(), seed_cand_idx, itrack,
end,
false);
818 dcall(pre_prop_print(curr_layer, mkfndr.get()));
823 dcall(post_prop_print(curr_layer, mkfndr.get()));
825 dprint(
"now get hit range");
826 mkfndr->selectHitIndices(layer_of_hits, end - itrack);
829 mkfndr.get(), layer_info, tmp_cands, seed_cand_idx,
region, start_seed, itrack,
end);
831 dprint(
"make new candidates");
832 mkfndr->findCandidates(layer_of_hits, tmp_cands, start_seed, end - itrack, fnd_foos);
837 for (
int is = 0; is < n_seeds; ++is) {
838 dprint(
"dump seed n " << is <<
" with N_input_candidates=" << tmp_cands[is].
size());
840 std::sort(tmp_cands[is].
begin(), tmp_cands[is].
end(), sortCandByScore);
844 for (
int is = 0; is < n_seeds; ++is) {
845 if (!tmp_cands[is].
empty()) {
846 eoccs[start_seed + is].clear();
850 bool first_short =
true;
869 eoccs[start_seed + is].emplace_back(tc);
871 }
else if (first_short) {
873 if (tc.
score() > eoccs[start_seed + is].refBestShortCand().score()) {
874 eoccs[start_seed + is].setBestShortCand(tc);
879 tmp_cands[is].clear();
907 printf(
"No backward search plan for region %d\n",
region);
914 const int adaptiveSPT = std::clamp(
916 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
918 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
seeds) {
938 const int start_seed,
947 const int n_seeds = end_seed - start_seed;
949 std::vector<std::pair<int, int>> seed_cand_idx, seed_cand_update_idx;
953 std::vector<std::vector<TrackCand>> extra_cands(n_seeds);
954 for (
int ii = 0;
ii < n_seeds; ++
ii)
957 cloner.
begin_eta_bin(&eoccs, &seed_cand_update_idx, &extra_cands, start_seed, n_seeds);
965 dprintf(
"Made iterator for %d, first layer=%d ... end layer=%d\n",
967 layer_plan_it.layer(),
968 layer_plan_it.last_layer());
970 assert(layer_plan_it.is_pickup_only());
972 int curr_layer = layer_plan_it.layer(), prev_layer;
975 "\nMkBuilder::find_tracks_in_layers region=%d, seed_pickup_layer=%d, first_layer=%d; start_seed=%d, "
979 layer_plan_it.next_layer(),
987 while (++layer_plan_it) {
988 prev_layer = curr_layer;
989 curr_layer = layer_plan_it.layer();
990 mkfndr->
setup(prop_config,
995 const bool pickup_only = layer_plan_it.is_pickup_only();
997 dprintf(
"\n\n* Processing layer %d, %s\n\n", curr_layer, pickup_only ?
"pickup only" :
"full finding");
1004 seed_cand_idx, start_seed, end_seed, curr_layer, prev_layer, pickup_only, iteration_dir);
1006 dprintf(
" Number of candidates to process: %d, nHits in layer: %d\n", theEndCand, layer_of_hits.
nHits());
1015 if (pickup_only || theEndCand == 0)
1021 for (
int itrack = 0; itrack < theEndCand; itrack +=
NN) {
1025 dprintf(
"\nProcessing track=%d, start_seed=%d, n_seeds=%d, theEndCand=%d, end=%d, nn=%d, end_eq_tec=%d\n",
1034 for (
int i = itrack;
i <
end; ++
i)
1042 for (
int i = itrack;
i <
end; ++
i)
1043 dprintf(
" track %d, idx %d is from seed %d\n",
i,
i - itrack, mkfndr->
m_Label(
i - itrack, 0, 0));
1050 dprint(
"now get hit range");
1052 #ifdef DUMPHITWINDOW
1059 mkfndr, layer_info, extra_cands, seed_cand_idx, region, start_seed, itrack, end);
1067 dprint(
"make new candidates");
1080 const int theEndUpdater = seed_cand_update_idx.size();
1082 for (
int itrack = 0; itrack < theEndUpdater; itrack +=
NN) {
1096 auto &cc = eoccs[
iseed];
1098 for (
int i = 0;
i < ((int)cc.size()) - 1; ++
i) {
1099 if (cc[
i].score() < cc[
i + 1].score()) {
1100 printf(
"CloneEngine - NOT SORTED: layer=%d, iseed=%d (size=%lu)-- %d : %f smaller than %d : %f\n",
1136 tbb::parallel_for(rosi.tbb_blk_rng_vec(), [&](
const tbb::blocked_range<int> &blk_rng) {
1139 RangeOfSeedIndices rng = rosi.seed_rng(blk_rng);
1141 while (rng.valid()) {
1158 for (
int icand = start_cand; icand < end_cand; icand +=
NN) {
1162 printf(
"Pre Final fit for %d - %d\n", icand, end);
1163 for (
int i = icand;
i <
end; ++
i) {
1166 " %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",
1181 bool chi_debug =
false;
1182 #ifdef DEBUG_BACKWARD_FIT_BH
1197 #ifdef DEBUG_BACKWARD_FIT_BH
1200 mkfndr->
m_Chi2(0, 0, 0) / (eoccs[icand][0].nFoundHits() * 3 - 6) > 20.0
f) {
1202 #ifdef MKFIT_STANDALONE
1203 printf(
"CHIHDR Event %d, Cand %3d, pT %f, chipdof %f ### NOTE x,y,z in cm, sigmas, deltas in mum ### !!!\n",
1206 printf(
"CHIHDR Cand %3d, pT %f, chipdof %f ### NOTE x,y,z in cm, sigmas, deltas in mum ### !!!\n",
1210 mkfndr->
m_Chi2(0, 0, 0) / (eoccs[icand][0].nFoundHits() * 3 - 6));
1212 "CHIHDR %3s %10s %10s %10s %10s %10s %11s %11s %11s %10s %10s %10s %10s %11s %11s %11s %10s %10s %10s %10s "
1245 printf(
"Post Final fit for %d - %d\n", icand, end);
1246 for (
int i = icand;
i <
end; ++
i) {
1249 " %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",
1275 const int adaptiveSPT = std::clamp(
1277 dprint(
"adaptiveSPT " << adaptiveSPT <<
" fill " << rosi.count() <<
"/" << eoccs.
size() <<
" region " <<
region);
1279 tbb::parallel_for(rosi.tbb_blk_rng_std(adaptiveSPT), [&](
const tbb::blocked_range<int> &
cands) {
1294 for (
int icand = start_cand; icand < end_cand; icand +=
step) {
1298 printf(
"Pre Final fit for %d - %d\n", icand, end);
1299 for (
int i = icand;
i <
end; ++
i) {
1302 " %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",
1317 bool chi_debug =
false;
1318 #ifdef DEBUG_BACKWARD_FIT
1320 static bool first =
true;
1324 "BKF_OVERLAP event/I:label/I:prod_type/I:is_findable/I:layer/I:is_stereo/I:is_barrel/I:"
1325 "pt/F:eta/F:phi/F:chi2/F:isnan/I:isfin/I:gtzero/I:hit_label/I:"
1326 "sx_t/F:sy_t/F:sz_t/F:d_xy/F:d_z/F\n");
1346 printf(
"Post Final fit for %d - %d\n", icand, end);
1347 for (
int i = icand;
i <
end; ++
i) {
1350 " %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
trk_cand_vec_type::size_type size() const
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)
void find_tracks_load_seeds_BH(const TrackVec &in_seeds)
void export_tracks(TrackVec &out_vec)
IterationParams m_backward_params
void findTracksBestHit(SteeringParams::IterationType_e iteration_dir=SteeringParams::IT_FwdSearch)
ExecutionContext()=default
const LayerInfo & layer(int l) const
void resizeAfterFiltering(int n_removed)
SeedState_e state() const
Track exportTrack(bool remove_missing_hits=false) const
void insertSeed(const Track &seed, int region)
void inputTracksAndHitIdx(const std::vector< Track > &tracks, int beg, int end, bool inputProp)
void bkFitInputTracks(TrackVec &cands, int beg, int end)
void(MkBase::* m_propagate_foo)(float, const int, const PropagationFlags)
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)
int filter_comb_cands(std::function< filter_track_cand_foo > filter)
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)
const std::vector< CombCandidate > & refCandidates() const
constexpr bool nan_n_silly_check_seeds
float propagate_to() const
void begin_event(MkJob *job, Event *ev, const char *build_type)
RadixSort & Sort(const udword *input, udword nb, RadixHint hint=RADIX_SIGNED)
const EventOfHits & m_event_of_hits
constexpr bool nan_n_silly_fixup_bad_cands_every_layer
HitOnTrack getLastHitOnTrack() const
constexpr std::array< uint8_t, layerIndexSize > layer
iterator make_iterator(IterationType_e type) const
float getPar(int itrack, int i, int par) const
U second(std::pair< T, U > const &p)
PropagationFlags finding_inter_layer_pflags
void findTracksStandard(SteeringParams::IterationType_e iteration_dir=SteeringParams::IT_FwdSearch)
void setup_bkfit(const PropagationConfig &pc)
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)
constexpr bool nan_n_silly_remove_bad_seeds
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
constexpr Matriplex::idx_t NN
Cos< T >::type cos(const T &t)
const auto regions_begin() const
std::vector< int > m_seedEtaSeparators
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
std::vector< int > m_region
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)
const auto regions_end() const
Pool< CandCloner > m_cloners
const auto & params() const
std::vector< float > m_sort_score
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
WithinSensitiveRegion_e m_wsr
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_load_seeds(const TrackVec &in_seeds)
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)
const udword * GetRanks() const
Access to results. mRanks is a list of indices in sorted order,.
void print(std::string_view label, const MeasurementState &s)
std::vector< int > m_seedMaxLastLayer
void copyOutParErr(std::vector< CombCandidate > &seed_cand_vec, int N_proc, bool outputProp) const
int getLastHitIdx() const
constexpr bool nan_n_silly_check_cands_every_layer
void import_seeds(const TrackVec &in_seeds, std::function< insert_seed_foo > insert_seed)
void export_best_comb_cands(TrackVec &out_vec, bool remove_missing_hits=false)
const Hit & refHit(int i) const
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
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)
int max_max_cands() const
while(__syncthreads_or(more))
std::function< partition_seeds_foo > m_partition_seeds
~ExecutionContext()=default
std::vector< int > m_seedMinLastLayer
int getLastHitLyr() const
WSR_Result m_XWsrResult[NN]
constexpr bool nan_n_silly_print_bad_cands_every_layer
void reset(double vett[256])
T & At(idx_t n, idx_t i, idx_t j)
tuple size
Write out results.
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)