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(); }
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);
118 for (
auto const &
s :
ev.seedTracks_) {
123 ev.seedTracks_.swap(seeds1);
124 ev.relabel_bad_seedtracks();
138 bool seeds_sorted =
false;
144 #ifdef USE_VTUNE_PAUSE 155 #ifdef USE_VTUNE_PAUSE 166 if (Config::removeDuplicates) {
205 for (
auto const &
s :
ev.seedTracks_) {
210 ev.seedTracks_.swap(seeds1);
211 ev.relabel_bad_seedtracks();
225 bool seeds_sorted =
false;
230 #ifdef USE_VTUNE_PAUSE 241 #ifdef USE_VTUNE_PAUSE 246 check_nan_n_silly_candidates(
ev);
259 check_nan_n_silly_bkfit(
ev);
292 for (
auto const &
s :
ev.seedTracks_) {
297 ev.seedTracks_.swap(seeds1);
298 ev.relabel_bad_seedtracks();
312 bool seeds_sorted =
false;
317 #ifdef USE_VTUNE_PAUSE 328 #ifdef USE_VTUNE_PAUSE 333 check_nan_n_silly_candidates(
ev);
349 check_nan_n_silly_bkfit(
ev);
390 std::vector<double> timevec;
393 timevec.resize(
n + 1, 0.0);
400 unsigned int algorithms[] = {4, 22, 23, 5, 24, 7, 8, 9, 10, 6};
403 for (
auto const &
s :
ev.seedTracks_) {
408 ev.seedTracks_.swap(seeds1);
409 ev.relabel_bad_seedtracks();
416 for (
int it = 0; it <=
n - 1; ++it) {
431 for (
auto &
s :
ev.seedTracks_) {
449 if (
seeds.size() <= 0)
459 timevec[
n] += timevec[it];
465 seeds_used.insert(seeds_used.end(),
seeds.begin(),
seeds.end());
485 ev.candidateTracks_.reserve(
ev.candidateTracks_.size() + tmp_tvec.size());
486 for (
auto &&
t : tmp_tvec)
503 if (do_backward_search) {
509 if (do_backward_search) {
545 ev.seedTracks_.swap(seeds_used);
548 check_nan_n_silly_candidates(
ev);
551 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)
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)
const BeamSpot & refBeamSpot() const
void find_duplicates(TrackVec &tracks)
bool qfilter_n_hits(const TRACK &t, int nMinHits)
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)
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)
void prep_simtracks(Event *event)
void find_tracks_load_seeds_BH(const TrackVec &in_seeds, const bool seeds_sorted)
void findTracksStandard(SteeringParams::IterationType_e iteration_dir=SteeringParams::IT_FwdSearch)
const std::vector< std::vector< Track > > & m_track_candidates
bool m_requires_dupclean_tight
void find_tracks_load_seeds(const TrackVec &in_seeds, const bool seeds_sorted)
sortTracksByPhiStruct(std::vector< std::vector< Track >> *track_candidates)
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 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
const TrackVec & ref_tracks() const
bool sortByZ(const Hit &hit1, const Hit &hit2)
std::vector< Track > TrackVec
double runBuildingTestPlexCloneEngine(Event &ev, const EventOfHits &eoh, MkBuilder &builder)
auto const & tracks
cannot be loose
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)
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)