12 inline bool sortByHitsChi2(
const std::pair<Track, TrackState> &cand1,
const std::pair<Track, TrackState> &cand2) {
13 if (cand1.first.nFoundHits() == cand2.first.nFoundHits())
14 return cand1.first.chi2() < cand2.first.chi2();
16 return cand1.first.nFoundHits() > cand2.first.nFoundHits();
34 bool operator()(
const std::pair<int, int> &track1,
const std::pair<int, int> &track2) {
41 inline bool sortByZ(
const Hit &hit1,
const Hit &hit2) {
return hit1.
z() < hit2.
z(); }
59 void check_nan_n_silly_candidates(
Event &
ev) {
68 int sc = check_nan_n_silly(
ev.candidateTracks_,
"Pre-bkfit silly check");
70 printf(
"Nan'n'Silly: Number of silly pre-bkfit candidates = %d\n", sc);
74 void check_nan_n_silly_bkfit(
Event &
ev) {
76 int sc = check_nan_n_silly(
ev.fitTracks_,
"Post-bkfit silly check");
78 printf(
"Nan'n'Silly: Number of silly post-bkfit candidates = %d\n", sc);
115 for (
auto const &
s :
ev.seedTracks_) {
120 ev.seedTracks_.swap(seeds1);
121 ev.relabel_bad_seedtracks();
135 bool seeds_sorted =
false;
141 #ifdef USE_VTUNE_PAUSE 152 #ifdef USE_VTUNE_PAUSE 168 job.switch_to_backward();
188 ev.seedTracks_.swap(seeds1);
207 for (
auto const &
s :
ev.seedTracks_) {
212 ev.seedTracks_.swap(seeds1);
213 ev.relabel_bad_seedtracks();
227 bool seeds_sorted =
false;
229 ev.setCurrentSeedTracks(
ev.seedTracks_);
233 #ifdef USE_VTUNE_PAUSE 244 #ifdef USE_VTUNE_PAUSE 249 check_nan_n_silly_candidates(
ev);
252 ev.candidateTracks_.clear();
255 job.switch_to_backward();
265 check_nan_n_silly_bkfit(
ev);
277 ev.resetCurrentSeedTracks();
284 ev.seedTracks_.swap(seeds1);
303 for (
auto const &
s :
ev.seedTracks_) {
308 ev.seedTracks_.swap(seeds1);
309 ev.relabel_bad_seedtracks();
323 bool seeds_sorted =
false;
325 ev.setCurrentSeedTracks(
ev.seedTracks_);
329 #ifdef USE_VTUNE_PAUSE 340 #ifdef USE_VTUNE_PAUSE 345 check_nan_n_silly_candidates(
ev);
348 ev.candidateTracks_.clear();
351 job.switch_to_backward();
364 check_nan_n_silly_bkfit(
ev);
377 ev.resetCurrentSeedTracks();
384 ev.seedTracks_.swap(seeds1);
415 std::vector<double> timevec;
418 timevec.resize(
n + 1, 0.0);
426 for (
auto const &
s :
ev.seedTracks_) {
431 ev.seedTracks_.swap(seeds1);
432 ev.relabel_bad_seedtracks();
439 for (
int it = 0;
it <=
n - 1; ++
it) {
454 for (
auto &
s :
ev.seedTracks_) {
474 if (
seeds.size() <= 0)
476 ev.setCurrentSeedTracks(
seeds);
485 timevec[
n] += timevec[
it];
491 seeds_used.insert(seeds_used.end(),
seeds.begin(),
seeds.end());
499 return itconf.
m_pre_bkfit_filter(tc, jb) && StdSeq::qfilter_nan_n_silly<TrackCand>(tc, jb);
502 pre_filter = StdSeq::qfilter_nan_n_silly<TrackCand>;
512 ev.candidateTracks_.reserve(
ev.candidateTracks_.size() + tmp_tvec.size());
513 for (
auto &&
t : tmp_tvec)
518 job.switch_to_backward();
532 if (do_backward_search)
537 if (do_backward_search) {
548 return itconf.
m_post_bkfit_filter(tc, jb) && StdSeq::qfilter_nan_n_silly<TrackCand>(tc, jb);
551 post_filter = StdSeq::qfilter_nan_n_silly<TrackCand>;
555 if (do_backward_search)
565 ev.resetCurrentSeedTracks();
577 ev.seedTracks_.swap(seeds_used);
580 check_nan_n_silly_candidates(
ev);
583 check_nan_n_silly_bkfit(
ev);
void export_tracks(TrackVec &out_vec)
void findTracksBestHit(SteeringParams::IterationType_e iteration_dir=SteeringParams::IT_FwdSearch)
const BeamSpot & refBeamSpot() const
constexpr bool nan_n_silly_check_cands_post_bkfit
constexpr bool nan_n_silly_print_bad_cands_bkfit
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)
clean_seeds_func m_seed_cleaner
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)
std::function< filter_candidates_cf > filter_candidates_func
const std::vector< std::vector< Track > > & m_track_candidates
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()
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 filter_comb_cands(filter_candidates_func filter, bool attempt_all_cands)
int m_backward_fit_min_hits
const TrackVec & ref_tracks() const
filter_candidates_func m_post_bkfit_filter
bool sortByZ(const Hit &hit1, const Hit &hit2)
std::vector< Track > TrackVec
double runBuildingTestPlexCloneEngine(Event &ev, const EventOfHits &eoh, MkBuilder &builder)
clean_duplicates_func m_duplicate_cleaner
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 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)
filter_candidates_func m_pre_bkfit_filter
bool m_requires_seed_hit_sorting
double runBuildingTestPlexBestHit(Event &ev, const EventOfHits &eoh, MkBuilder &builder)
bool sortByEta(const Hit &hit1, const Hit &hit2)
MPlex< T, D1, D2, N > atan2(const MPlex< T, D1, D2, N > &y, const MPlex< T, D1, D2, N > &x)