12 #ifdef COPY_SORTED_HITS
18 #ifdef COPY_SORTED_HITS
19 void LayerOfHits::alloc_hits(
int size) {
22 for (
int ihit = 0; ihit < m_capacity; ihit++) {
27 void LayerOfHits::free_hits() { std::free(m_hits); }
38 float extent = qmax - qmin;
40 float extra = 0.5f * (
m_nq * dq - extent);
68 assert(
m_nq > 0 &&
"setupLayer() was not called.");
73 #ifdef COPY_SORTED_HITS
88 const Hit &
h = hitv[
i];
112 #ifdef COPY_SORTED_HITS
113 memcpy(&m_hits[
i], &hitv[j],
sizeof(
Hit));
125 const int q_bin = jqphi >> 16;
128 if (jqphi != curr_qphi) {
140 assert(
m_nq > 0 &&
"setupLayer() was not called.");
144 for (
const auto &
d : deadv) {
147 int phi_bin_1 =
phiBin(
d.phi1);
148 int phi_bin_2 =
phiBin(
d.phi2) + 1;
149 for (
int q_bin = q_bin_1; q_bin < q_bin_2; q_bin++) {
150 if (phi_bin_1 > phi_bin_2) {
154 for (
int pb = 0; pb < phi_bin_2; pb++) {
158 for (
int pb = phi_bin_1; pb < phi_bin_2; pb++) {
167 assert(
m_nq > 0 &&
"setupLayer() was not called.");
180 const Hit &
h = (*m_ext_hits)[idx];
210 #ifdef COPY_SORTED_HITS
229 #ifdef COPY_SORTED_HITS
230 memcpy(&m_hits[
i], &hitv[k],
sizeof(
Hit));
242 const int q_bin = jqphi >> 16;
245 if (jqphi != curr_qphi) {
256 if (build_original_to_internal_map) {
266 "LayerOfHits::endRegistrationOfHits() original_to_internal index map vector is largish: m_n_hits=%d, "
267 "map_vector_size=%d\n",
356 for (
int qb = 0; qb <
m_nq; ++qb) {
364 ((pb + 1) % 8 == 0) ?
"\n" :
"");
374 : m_layers_of_hits(trk_inf.n_layers()), m_n_layers(trk_inf.n_layers()) {
386 dprintf(
"TrackCand::exportTrack label=%5d, total_hits=%2d, overlaps=%2d -- n_seed_hits=%d,prod_type=%d\n",
402 if (remove_missing_hits) {
408 dprintf(
" nh=%2d, ch=%d, idx=%d lyr=%d prev_idx=%d\n",
431 m_seed_label = seed.
label();
441 dprintf(
" hit idx=%d lyr=%d\n", hp->index, hp->layer);
442 cand.
addHitIdx(hp->index, hp->layer, 0.0f);
464 while (ci->score() > best_short->
score())
473 printf(
"FindTracksStd -- Replacing best cand (%f) with short one (%f) in final sorting\n",
475 best_short->
score());
482 }
else if (best_short) {
515 if (remove_seed_hits && tc.
nFoundHits() <= backward_fit_min_hits) {
516 remove_seed_hits =
false;
520 int stash_end =
m_hots.size();
521 int stash_pos = stash_end;
525 if (remove_seed_hits) {
534 while (n_hits_to_pick > 0) {
536 if (
m_hots[idx].m_hot.index >= 0)
538 idx =
m_hots[idx].m_prev_idx;
548 while (stash_pos != stash_end &&
m_hots[stash_pos].m_hot.index < 0)
550 while (stash_pos != stash_end) {
558 idx =
m_hots[idx].m_prev_idx;
564 while (stash_pos != stash_end) {
567 m_hots[pos].m_prev_idx = pos - 1;
605 int last_idx = -1, prev_idx;
607 prev_idx =
m_hots[curr_idx].m_prev_idx;
609 m_hots[curr_idx].m_prev_idx = last_idx;
613 }
while (prev_idx != -1);
static constexpr int m_nphi
void endRegistrationOfHits(bool build_original_to_internal_map)
constexpr int32_t ceil(float num)
void addHitIdx(int hitIdx, int hitLyr, float chi2)
int nTailMinusOneHits() const
const edm::EventSetup & c
int phiBinFine(float phi) const
const HoTNode & hot_node(int i) const
int qBinChecked(float q) const
void mergeCandsAndBestShortOne(const IterationParams ¶ms, bool update_score, bool sort_cands)
const LayerInfo & layer(int l) const
CombCandidate * m_comb_candidate
Track exportTrack(bool remove_missing_hits=false) const
std::vector< float > m_hit_phis
udword * RelinquishRanks()
TrackCand m_best_short_cand
short int m_nInsideMinusOneHits_before_bkwsearch
static constexpr int m_phi_mask_fine
void setLastCcIndex(int i)
const HitVec * m_ext_hits
void setNInsideMinusOneHits(int n)
void setNFoundHits(int n)
short int m_nTailMinusOneHits_before_bkwsearch
vecvecPhiBinDead_t m_phi_bin_deads
void resizeHits(int nHits, int nFoundHits)
RadixSort & Sort(const udword *input, udword nb, RadixHint hint=RADIX_SIGNED)
int nInsideMinusOneHits() const
void setNTailMinusOneHits(int n)
U second(std::pair< T, U > const &p)
constexpr bool usePhiQArrays
void setNMissingHits(int n)
void setup_bins(float qmin, float qmax, float dq)
static constexpr int m_phi_fine_xmask
unsigned int * m_hit_ranks
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
void suckInDeads(const DeadVec &deadv)
const HitOnTrack * beginHitsOnTrack() const
int phiBin(float phi) const
ProdType prodType() const
void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits)
SeedingHitSet::ConstRecHitPointer Hit
CombCandidate * combCandidate() const
std::vector< Hit > HitVec
void setupLayer(const LayerInfo &li)
float getScoreCand(const TrackCand &cand1, bool penalizeTailMissHits=false, bool inFindCandidates=false)
static constexpr int m_phi_bits_shift
bool sortByScoreTrackCand(const TrackCand &cand1, const TrackCand &cand2)
void empty_q_bins_dead(int q_bin_1, int q_bin_2)
short int m_lastHitIdx_before_bkwsearch
std::vector< DeadRegion > DeadVec
trk_cand_vec_type m_trk_cands
std::vector< float > m_hit_qs
int getLastHitLyr() const
void suckInHits(const HitVec &hitv)
void beginRegistrationOfHits(const HitVec &hitv)
void importSeed(const Track &seed, int region)
EventOfHits(const TrackerInfo &trk_inf)
void * aligned_alloc64(std::size_t size)
vecvecPhiBinInfo_t m_phi_bin_infos
Input values are unsigned.
void registerHit(int idx)
void setNOverlapHits(int n)
const LayerInfo * m_layer_info
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
const HitOnTrack * endHitsOnTrack() const
void setHitIdxAtPos(int pos, const HitOnTrack &hot)
std::vector< int > m_ext_idcs
std::vector< LayerOfHits > m_layers_of_hits
std::vector< HitInfo > m_hit_infos
tuple size
Write out results.
void empty_q_bins(int q_bin_1, int q_bin_2, uint16_t hit_count)
std::vector< uint32_t > m_qphifines
std::vector< HoTNode > m_hots