8 #include "oneapi/tbb/parallel_for.h"
14 inline bool sortByHitsChi2(
const std::pair<Track, TrackState> &cand1,
const std::pair<Track, TrackState> &cand2) {
15 if (cand1.first.nFoundHits() == cand2.first.nFoundHits())
16 return cand1.first.chi2() < cand2.first.chi2();
18 return cand1.first.nFoundHits() > cand2.first.nFoundHits();
22 return std::atan2(hit1.
y(), hit1.
x()) < std::atan2(hit2.
y(), hit2.
x());
36 bool operator()(
const std::pair<int, int> &track1,
const std::pair<int, int> &track2) {
43 inline bool sortByZ(
const Hit &hit1,
const Hit &hit2) {
return hit1.
z() < hit2.
z(); }
53 for (
auto &
t : tracks) {
61 void check_nan_n_silly_candidates(
Event &
ev) {
70 int sc = check_nan_n_silly(ev.candidateTracks_,
"Pre-bkfit silly check");
72 printf(
"Nan'n'Silly: Number of silly pre-bkfit candidates = %d\n", sc);
76 void check_nan_n_silly_bkfit(
Event &ev) {
78 int sc = check_nan_n_silly(ev.fitTracks_,
"Post-bkfit silly check");
80 printf(
"Nan'n'Silly: Number of silly post-bkfit candidates = %d\n", sc);
116 unsigned int algorithms[] = {4};
120 if (
std::find(algorithms, algorithms + 1,
s.algoint()) != algorithms + 1)
143 #ifdef USE_VTUNE_PAUSE
148 double time =
dtime();
152 time =
dtime() - time;
154 #ifdef USE_VTUNE_PAUSE
165 if (Config::removeDuplicates) {
202 unsigned int algorithms[] = {4};
206 if (
std::find(algorithms, algorithms + 1,
s.algoint()) != algorithms + 1)
228 #ifdef USE_VTUNE_PAUSE
233 double time =
dtime();
237 time =
dtime() - time;
239 #ifdef USE_VTUNE_PAUSE
244 check_nan_n_silly_candidates(ev);
257 check_nan_n_silly_bkfit(ev);
288 unsigned int algorithms[] = {4};
292 if (
std::find(algorithms, algorithms + 1,
s.algoint()) != algorithms + 1)
314 #ifdef USE_VTUNE_PAUSE
319 double time =
dtime();
323 time =
dtime() - time;
325 #ifdef USE_VTUNE_PAUSE
330 check_nan_n_silly_candidates(ev);
346 check_nan_n_silly_bkfit(ev);
387 std::vector<double> timevec;
390 timevec.resize(n + 1, 0.0);
397 unsigned int algorithms[] = {4, 22, 23, 5, 24, 7, 8, 9, 10, 6};
402 if (
std::find(algorithms, algorithms + n,
s.algoint()) != algorithms + n)
413 for (
int it = 0; it <= n - 1; ++it) {
446 if (seeds.size() <= 0)
451 double time =
dtime();
455 timevec[it] =
dtime() - time;
456 timevec[
n] += timevec[it];
462 seeds_used.insert(seeds_used.end(), seeds.begin(), seeds.end());
483 for (
auto &&
t : tmp_tvec)
500 if (do_backward_search) {
506 if (do_backward_search) {
545 check_nan_n_silly_candidates(ev);
548 check_nan_n_silly_bkfit(ev);
void find_and_remove_duplicates(TrackVec &tracks, const IterationConfig &itconf)
bool qfilter_n_hits_pixseed(const TRACK &t, int nMinHits)
void find_tracks_load_seeds_BH(const TrackVec &in_seeds)
bool qfilter_pixelLessFwd(const TRACK &t, const BeamSpot &bspot, const TrackerInfo &tk_info)
quality filter tuned for pixelLess iteration during forward search
void export_tracks(TrackVec &out_vec)
void findTracksBestHit(SteeringParams::IterationType_e iteration_dir=SteeringParams::IT_FwdSearch)
void find_duplicates(TrackVec &tracks)
const BeamSpot & refBeamSpot() const
bool qfilter_n_hits(const TRACK &t, int nMinHits)
void relabel_bad_seedtracks()
constexpr bool nan_n_silly_check_cands_post_bkfit
bool qfilter_n_layers(const TRACK &t, const BeamSpot &bspot, const TrackerInfo &trk_inf)
constexpr bool nan_n_silly_print_bad_cands_bkfit
int filter_comb_cands(std::function< filter_track_cand_foo > filter)
double runBuildingTestPlexStandard(Event &ev, const EventOfHits &eoh, MkBuilder &builder)
constexpr bool nan_n_silly_check_cands_pre_bkfit
void compactifyHitStorageForBestCand(bool remove_seed_hits, int backward_fit_min_hits)
bool sortTracksByPhi(const Track &track1, const Track &track2)
void root_val(Event *event)
void findTracksCloneEngine(SteeringParams::IterationType_e iteration_dir=SteeringParams::IT_FwdSearch)
auto const & tracks
cannot be loose
bool m_backward_drop_seed_hits
void begin_event(MkJob *job, Event *ev, const char *build_type)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool sortByHitsChi2(const std::pair< Track, TrackState > &cand1, const std::pair< Track, TrackState > &cand2)
const TrackVec & ref_tracks() const
void prep_simtracks(Event *event)
void findTracksStandard(SteeringParams::IterationType_e iteration_dir=SteeringParams::IT_FwdSearch)
const std::vector< std::vector< Track > > & m_track_candidates
bool m_requires_dupclean_tight
sortTracksByPhiStruct(std::vector< std::vector< Track >> *track_candidates)
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
TrackVec & ref_tracks_nc()
bool qfilter_pixelLessBkwd(const TRACK &t, const BeamSpot &bspot, const TrackerInfo &tk_info)
quality filter tuned for pixelLess iteration during backward search
void seed_post_cleaning(TrackVec &tv)
void fill_hitmask_bool_vectors(int track_algo, std::vector< std::vector< bool >> &layer_masks)
void select_best_comb_cands(bool clear_m_tracks=false, bool remove_missing_hits=false)
void runBuildingTestPlexDumbCMSSW(Event &ev, const EventOfHits &eoh, MkBuilder &builder)
int m_backward_fit_min_hits
bool sortByZ(const Hit &hit1, const Hit &hit2)
tuple detachedTripletStep
std::vector< Track > TrackVec
double runBuildingTestPlexCloneEngine(Event &ev, const EventOfHits &eoh, MkBuilder &builder)
void find_tracks_load_seeds(const TrackVec &in_seeds)
bool qfilter_nan_n_silly(const TRACK &t)
std::vector< double > runBtpCe_MultiIter(Event &ev, const EventOfHits &eoh, MkBuilder &builder, int n)
void export_best_comb_cands(TrackVec &out_vec, bool remove_missing_hits=false)
bool operator()(const std::pair< int, int > &track1, const std::pair< int, int > &track2)
void handle_duplicates(Event *event)
TrackVec candidateTracks_
TrackAlgorithm
track algorithm; copy from TrackBase.h to keep in standalone builds
void root_val_dumb_cmssw(Event *event)
void quality_val(Event *event)
bool sortTracksByEta(const Track &track1, const Track &track2)
std::vector< std::vector< bool > > m_mask_vector
bool sortByPhi(const Hit &hit1, const Hit &hit2)
bool m_requires_seed_hit_sorting
bool m_requires_quality_filter
double runBuildingTestPlexBestHit(Event &ev, const EventOfHits &eoh, MkBuilder &builder)
bool sortByEta(const Hit &hit1, const Hit &hit2)
int clean_cms_seedtracks_iter(TrackVec *seed_ptr, const IterationConfig &itrcfg, const BeamSpot &bspot)