Definition at line 469 of file mkFit.cc.
References dir2webdir::argc, GCPpyPlots::argv, cms::cuda::assert(), mkfit::Config::backwardFit, mkfit::Config::backwardSearch, nano_mu_local_reco_cff::bool, DMR_cfg::cerr, mkfit::Config::cf_fitting, mkfit::Config::cf_seeding, mkfit::cleanSeedsBadLabel, mkfit::cleanSeedsN2, mkfit::cleanSeedsPure, mkfit::Config::cmsSelMinLayers, mkfit::Config::cmssw_val, mkfit::Config::cmsswMatchingBK, mkfit::Config::cmsswMatchingFW, mkfit::cmsswSeeds, mkfit::internal::deadvectors, mkfit::Config::dumpForPlots, beamvalidation::exit(), RntDumper::FinalizeAll(), mkfit::Config::finderReportBestOutOfN, mkfit::Config::fit_val, mkfit::Config::geomPlugin, getOpt(), mkfit::hitBased, mps_fire::i, mkfit::Config::includePCA, mkfit::Config::inclusiveShorts, initGeom(), createfilelist::int, mkfit::Config::json_dump_after, mkfit::Config::json_dump_before, mkfit::Config::json_load_filenames, mkfit::Config::json_patch_filenames, mkfit::Config::json_save_iters_fname_fmt, mkfit::Config::json_save_iters_include_iter_info_preamble, mkfit::Config::json_verbose, mkfit::Config::keepHitInfo, mkfit::Config::kludgeCmsHitErrors, mkfit::labelBased, listOpts(), mkfit::Config::loopOverFile, MPT_SIZE, mkfit::Config::mtvLikeValidation, mkfit::Config::mtvRequireSeeds, mkfit::Const::nan_etc_sigs_enable, mkfit::Config::nEvents, next_arg_or_die(), mkfit::Config::nItersCMSSW, mkfit::Config::nMinFoundHits, mkfit::noCleaning, mkfit::Config::nTracks, mkfit::Config::numHitsPerTask, mkfit::Config::numSeedsPerTask, mkfit::Config::numThreadsEvents, mkfit::Config::numThreadsFinder, mkfit::Config::numThreadsSimulation, mkfit::Config::quality_val, mkfit::Config::readCmsswTracks, mkfit::Config::readSimTrackStates, mkfit::Config::recalculateDependentConstants(), mkfit::Config::seedCleaning, mkfit::Config::seedInput, setOpt(), validateAlignments::shell, mkfit::Config::silent, mkfit::Config::sim_val, mkfit::Config::sim_val_for_cmssw, mkfit::simSeeds, submitPVResolutionJobs::stderr, test_standard(), mkfit::trkParamBased, mkfit::Config::tryToSaveSimInfo, mkfit::Config::useDeadModules, mkfit::Config::useHitsForDuplicates, mkfit::Config::usePhiQArrays, mkfit::Config::usePropToPlane, and mkfit::Config::usePtMultScat.
472 feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
476 #ifdef USE_VTUNE_PAUSE 481 "To make sure this is true for icc and gcc<6 when mixing bools/ints in bitfields.");
489 for (
int i = 1;
i <
argc; ++
i) {
490 mArgs.push_back(
argv[
i]);
492 bool run_shell =
false;
495 while (
i != mArgs.end()) {
498 if (*
i ==
"-h" || *
i ==
"-help" || *
i ==
"--help") {
501 "Usage: %s [options]\n" 502 "Options: defaults defined as (def: DEFAULT VALUE)\n" 503 "\n----------------------------------------------------------------------------------------------------------" 505 "Generic options\n\n" 506 " --geom <str> geometry plugin to use (def: %s)\n" 507 " --silent suppress printouts inside event loop (def: %s)\n" 508 " --best-out-of <int> run test num times, report best time (def: %d)\n" 509 " --input-file file name for reading (def: %s)\n" 510 " --output-file file name for writitng (def: %s)\n" 511 " --read-cmssw-tracks read external cmssw reco tracks if available (def: %s)\n" 512 " --read-simtrack-states read in simTrackStates for pulls in validation (def: %s)\n" 513 " --num-events <int> number of events to run over or simulate (def: %d)\n" 514 " if using --input-file, must be enabled AFTER on command line\n" 515 " --start-event <int> event number to start at when reading from a file (def: %d)\n" 516 " --loop-over-file after reaching the end of the file, start over from the beginning until " 517 " <num-events> events have been processed\n" 518 " --shell start interactive shell instead of running test_standard()\n" 520 "If no --input-file is specified, will trigger simulation\n" 521 " --num-tracks <int> number of tracks to generate for each event (def: %d)\n" 522 "\n----------------------------------------------------------------------------------------------------------" 524 "Threading related options\n\n" 525 " --num-thr-sim <int> number of threads for simulation (def: %d)\n" 526 " --num-thr <int> number of threads for track finding (def: %d)\n" 527 " --num-thr-ev <int> number of threads to run the event loop (def: %d)\n" 528 " --seeds-per-task <int> number of seeds to process in a tbb task (def: %d)\n" 529 " --hits-per-task <int> number of layer1 hits per task when using find seeds (def: %d)\n" 530 "\n----------------------------------------------------------------------------------------------------------" 532 "FittingTestMPlex options\n\n" 533 " --fit-std run standard fitting test (def: %s)\n" 534 " --cf-fitting enable conformal fit before fitting tracks to get initial estimate of track " 535 "parameters and errors (def: %s)\n" 536 " --fit-val enable ROOT based validation for fittingMPlex (def: %s)\n" 537 "\n----------------------------------------------------------------------------------------------------------" 539 "BuildingTestMPlex options\n\n" 540 " **Specify which building routine you would like to run\n" 541 " --build-cmssw run dummy validation of CMSSW tracks with MkBuilder stuff (def: %s)\n" 542 " --build-bh run best-hit building test (def: %s)\n" 543 " --build-std run standard combinatorial building test (def: %s)\n" 544 " --build-ce run clone engine combinatorial building test (def: %s)\n" 545 " --build-mimi run clone engine on multiple-iteration test (def: %s)\n" 546 " --num-iters-cmssw <int> number of mimi iterations to run (def: set to 3 when --build-mimi is in effect, " 549 " **Seeding options\n" 550 " --seed-input <str> which seed collecion used for building (def: %s)\n" 551 " --seed-cleaning <str> which seed cleaning to apply if using cmssw seeds (def: %s)\n" 552 " --cf-seeding enable conformal fit over seeds (def: %s)\n" 554 " **Duplicate removal options\n" 555 " --remove-dup run duplicate removal after building, using both hit and kinematic criteria (def: " 557 " --remove-dup-no-hit run duplicate removal after building, using kinematic criteria only (def: %s)\n" 559 " **Dead module (strip) option\n" 560 " --use-dead-modules run duplicate removal after building, using both hit and kinematic criteria " 563 " **Additional options for building\n" 564 " --use-phiq-arr use phi-Q arrays in select hit indices (def: %s)\n" 565 " --kludge-cms-hit-errors make sure err(xy) > 15 mum, err(z) > 30 mum (def: %s)\n" 566 " --backward-fit perform backward fit during building (def: %s)\n" 567 " --no-backward-search do not do backward search after backward fit\n" 568 " (def: do search if backward-fit is enabled and available in given iteration)\n" 569 " --include-pca do the backward fit to point of closest approach, does not imply " 570 "'--backward-fit' (def: %s)\n" 571 " --use-p2p <0|1> use prop-to-plane (def: %d)\n" 572 " --use-ptms <0|1> use pT multiple scattering (def: %d)\n" 573 "\n----------------------------------------------------------------------------------------------------------" 575 "Validation options\n\n" 576 " **Text file based options\n" 577 " --quality-val enable printout validation for MkBuilder (def: %s)\n" 578 " must enable: --dump-for-plots\n" 579 " --dump-for-plots make shell printouts for plots (def: %s)\n" 580 " --mtv-like-val configure validation to emulate CMSSW MultiTrackValidator (MTV) (def: %s)\n" 581 " --mtv-require-seeds configure validation to emulate MTV but require sim tracks to be matched to " 584 " **ROOT based options\n" 585 " --sim-val-for-cmssw enable ROOT based validation for CMSSW tracks with simtracks as reference [eff, " 586 "FR, DR] (def: %s)\n" 587 " --sim-val enable ROOT based validation for seeding, building, and fitting with simtracks " 588 "as reference [eff, FR, DR] (def: %s)\n" 589 " --cmssw-val enable ROOT based validation for building and fitting with CMSSW tracks as " 590 "reference [eff, FR, DR] (def: %s)\n" 591 " must enable: --geom CMS-phase1 --read-cmssw-tracks\n" 592 " --cmssw-match-fw <str> which cmssw track matching routine to use if validating against CMSSW tracks, " 593 "forward built tracks only (def: %s)\n" 594 " must enable: --geom CMS-phase1 --cmssw-val --read-cmssw-tracks\n" 595 " --cmssw-match-bk <str> which cmssw track matching routine to use if validating against CMSSW tracks, " 596 "backward fit tracks only (def: %s)\n" 597 " must enable: --geom CMS-phase1 --cmssw-val --read-cmssw-tracks --backward-fit " 598 "--backward-fit-pca\n" 599 " --inc-shorts include short reco tracks into FR (def: %s)\n" 600 " --keep-hit-info keep vectors of hit idxs and branches in trees (def: %s)\n" 601 " --try-to-save-sim-info two options for this flag [related to validation with simtracks as reference " 602 "collection] (def: %s)\n" 603 " a) IF (--read-simtrack-states is enabled)\n" 604 " If a sim track is associated to a reco track, but it does not contain " 605 "the last found on the reco track\n" 606 " still save sim track kinematic info from generator position\n" 607 " b) ELSE (--read-simtrack-states is NOT enabled)\n" 608 " Save sim track kinematic info from generator position if matched to " 610 "\n----------------------------------------------------------------------------------------------------------" 612 "Combo spaghetti, that's with cole slaw:\n\n" 613 " **Building and fitting combo options\n" 614 " --backward-fit-pca perform backward fit to point of closest approach during building\n" 615 " == --backward-fit --include-pca\n" 616 " **Seed combo options\n" 617 " --cmssw-simseeds use CMS geom with simtracks for seeds\n" 618 " == --geom CMS-phase1 --seed-input %s\n" 619 " --cmssw-stdseeds use CMS geom with CMSSW seeds uncleaned\n" 620 " == --geom CMS-phase1 --seed-input %s --seed-cleaning %s\n" 621 " --cmssw-n2seeds use CMS geom with CMSSW seeds cleaned with N^2 routine\n" 622 " == --geom CMS-phase1 --seed-input %s --seed-cleaning %s\n" 623 " --cmssw-pureseeds use CMS geom with pure CMSSW seeds (seeds which produced CMSSW reco tracks), " 624 "enable read of CMSSW tracks\n" 625 " == --geom CMS-phase1 --seed-input %s --seed-cleaning %s --read-cmssw-tracks\n" 626 " --cmssw-goodlabelseeds use CMS geom with CMSSW seeds with label() >= 0\n" 627 " == --geom CMS-phase1 --seed-input %s --seed-cleaning %s\n" 629 " **CMSSW validation combo options\n" 630 " --cmssw-val-fhit-bhit use CMSSW validation with hit based matching (50 percent after seed) for forward " 632 " use CMSSW validation with hit based matching (50 percent after seed) for " 633 "backward fit tracks\n" 634 " == --cmssw-val --read-cmssw-tracks --cmssw-match-fw %s --cmssw-match-bk %s\n" 635 " must enable: --backward-fit-pca\n" 636 " --cmssw-val-fhit-bprm use CMSSW validation with hit based matching (50 percent after seed) for forward " 638 " use CMSSW validation with track parameter based matching for backward fit " 640 " == --cmssw-val --read-cmssw-tracks --cmssw-match-fw %s --cmssw-match-bk %s\n" 641 " must enable: --backward-fit-pca\n" 642 " --cmssw-val-fprm-bhit use CMSSW validation with track parameter based matching for forward built " 644 " use CMSSW validation with hit based matching (50 percent after seed) for " 645 "backward fit tracks\n" 646 " == --cmssw-val --read-cmssw-tracks --cmssw-match-fw %s --cmssw-match-bk %s\n" 647 " must enable: --backward-fit-pca\n" 648 " --cmssw-val-fprm-bprm use CMSSW validation with track parameter based matching for forward built " 650 " use CMSSW validation with track parameter based matching for backward fit " 652 " == --cmssw-val --read-cmssw-tracks --cmssw-match-fw %s --cmssw-match-bk %s\n" 653 " must enable: --backward-fit-pca\n" 654 " --cmssw-val-label use CMSSW validation with stricter hit based matching for both forward built and " 655 "backward fit tracks, enable read of CMSSW tracks\n" 656 " == --cmssw-val --read-cmssw-tracks --cmssw-match-fw %s --cmssw-match-bk %s\n" 657 " must enable: --cmssw-pureseeds --backward-fit-pca\n" 658 "\n----------------------------------------------------------------------------------------------------------" 660 "JSON config patcher options:\n\n" 661 " --json-load <filename> load single IterationConfig from given JSON file (def: do not load)\n" 662 " can be specified multiple times for several files\n" 663 " --json-patch <filename> patch IterationsInfo from given JSON file (def: do not patch)\n" 664 " can be specified multiple times for several files\n" 665 " --json-save-iterations <fname-fmt> save per iteration json files\n" 666 " %%d in fname-fmt gets replaced with iteration index\n" 667 " %%s in fname-fmt gets replaced with iteration algorithm name\n" 668 " exactly one of %%d and %%s must be specified\n" 669 " --json-save-iterations-include-iter-info-preamble (def: %s)\n" 670 " --json-verbose print each patch assignment as it is being made (def: %s)\n" 671 " --json-dump-before print iteration config before patching (def: %s)\n" 672 " --json-dump-after print iteration config after patching (def: %s)\n" 673 "\n----------------------------------------------------------------------------------------------------------" 680 g_input_file.c_str(),
681 g_output_file.c_str(),
698 b2a(g_run_build_cmssw),
700 b2a(g_run_build_default || g_run_build_std),
701 b2a(g_run_build_default || g_run_build_ce),
702 b2a(g_run_build_mimi),
760 printf(
"List of options for string based inputs \n");
768 printf(
"--seed-input \n");
772 printf(
"--seed-cleaning \n");
776 printf(
"--cmssw-matching \n");
783 else if (*
i ==
"--geom") {
786 }
else if (*
i ==
"--silent") {
788 }
else if (*
i ==
"--best-out-of") {
791 }
else if (*
i ==
"--input-file") {
794 g_operation =
"read";
796 }
else if (*
i ==
"--output-file") {
799 g_operation =
"write";
800 }
else if (*
i ==
"--read-cmssw-tracks") {
802 }
else if (*
i ==
"--read-simtrack-states") {
804 }
else if (*
i ==
"--num-events") {
807 }
else if (*
i ==
"--start-event") {
809 g_start_event = atoi(
i->c_str());
810 }
else if (*
i ==
"--loop-over-file") {
812 }
else if (*
i ==
"--shell") {
814 std::cerr <<
"--shell option is only supported when compiled with ROOT.\n";
818 }
else if (*
i ==
"--num-tracks") {
821 }
else if (*
i ==
"--num-thr-sim") {
824 }
else if (*
i ==
"--num-thr") {
827 }
else if (*
i ==
"--num-thr-ev") {
830 }
else if (*
i ==
"--seeds-per-task") {
833 }
else if (*
i ==
"--hits-per-task") {
836 }
else if (*
i ==
"--fit-std") {
837 g_run_build_default =
false;
838 g_run_fit_std =
true;
839 }
else if (*
i ==
"--cf-fitting") {
841 }
else if (*
i ==
"--fit-val") {
843 }
else if (*
i ==
"--build-cmssw") {
844 g_run_build_default =
false;
845 g_run_build_cmssw =
true;
846 }
else if (*
i ==
"--build-bh") {
847 g_run_build_default =
false;
848 g_run_build_bh =
true;
849 }
else if (*
i ==
"--build-std") {
850 g_run_build_default =
false;
851 g_run_build_std =
true;
852 }
else if (*
i ==
"--build-ce") {
853 g_run_build_default =
false;
854 g_run_build_ce =
true;
855 }
else if (*
i ==
"--build-mimi") {
856 g_run_build_default =
false;
857 g_run_build_mimi =
true;
860 }
else if (*
i ==
"--num-iters-cmssw") {
863 }
else if (*
i ==
"--seed-input") {
866 }
else if (*
i ==
"--seed-cleaning") {
869 }
else if (*
i ==
"--cf-seeding") {
871 }
else if (*
i ==
"--use-phiq-arr") {
872 #ifdef CONFIG_PhiQArrays 875 printf(
"--use-phiq-arr has no effect: recompile with CONFIG_PhiQArrays\n");
877 }
else if (*
i ==
"--remove-dup") {
878 Config::removeDuplicates =
true;
880 }
else if (*
i ==
"--remove-dup-no-hit") {
881 Config::removeDuplicates =
true;
883 }
else if (*
i ==
"--use-dead-modules") {
885 }
else if (*
i ==
"--kludge-cms-hit-errors") {
887 }
else if (*
i ==
"--backward-fit") {
889 }
else if (*
i ==
"--no-backward-search") {
891 }
else if (*
i ==
"--include-pca") {
893 }
else if (*
i ==
"--use-p2p") {
896 }
else if (*
i ==
"--use-ptms") {
899 }
else if (*
i ==
"--quality-val") {
901 }
else if (*
i ==
"--dump-for-plots") {
903 }
else if (*
i ==
"--mtv-like-val") {
907 }
else if (*
i ==
"--mtv-require-seeds") {
912 }
else if (*
i ==
"--sim-val-for-cmssw") {
914 }
else if (*
i ==
"--sim-val") {
916 }
else if (*
i ==
"--cmssw-val") {
918 }
else if (*
i ==
"--cmssw-match-fw") {
921 }
else if (*
i ==
"--cmssw-match-bk") {
924 }
else if (*
i ==
"--inc-shorts") {
926 }
else if (*
i ==
"--keep-hit-info") {
928 }
else if (*
i ==
"--try-to-save-sim-info") {
930 }
else if (*
i ==
"--backward-fit-pca") {
933 }
else if (*
i ==
"--cmssw-simseeds") {
936 }
else if (*
i ==
"--cmssw-stdseeds") {
940 }
else if (*
i ==
"--cmssw-n2seeds") {
944 }
else if (*
i ==
"--cmssw-pureseeds") {
949 }
else if (*
i ==
"--cmssw-goodlabelseeds") {
953 }
else if (*
i ==
"--cmssw-val-fhit-bhit") {
958 }
else if (*
i ==
"--cmssw-val-fhit-bprm") {
963 }
else if (*
i ==
"--cmssw-val-fprm-bhit") {
968 }
else if (*
i ==
"--cmssw-val-fprm-bprm") {
973 }
else if (*
i ==
"--cmssw-val-label") {
978 }
else if (*
i ==
"--json-load") {
981 }
else if (*
i ==
"--json-patch") {
984 }
else if (*
i ==
"--json-save-iterations") {
987 }
else if (*
i ==
"--json-save-iterations-include-iter-info-preamble") {
989 }
else if (*
i ==
"--json-verbose") {
991 }
else if (*
i ==
"--json-dump-before") {
993 }
else if (*
i ==
"--json-dump-after") {
996 fprintf(
stderr,
"Error: Unknown option/argument '%s'.\n",
i->c_str());
1008 std::cerr <<
"What have you done?!? Can't mix cmssw label matching without pure seeds! Exiting...\n";
1011 std::cerr <<
"What have you done?!? Short reco tracks are already accounted for in the MTV-Like Validation! Inclusive " 1012 "shorts is only an option for the standard simval, and will break the MTV-Like simval! Exiting...\n";
1018 printf(
"mkFit configuration complete.\n" 1019 " vusize=%d, num_thr_events=%d, num_thr_finder=%d\n" 1020 " sizeof(Track)=%zu, sizeof(Hit)=%zu, sizeof(SVector3)=%zu, sizeof(SMatrixSym33)=%zu, sizeof(MCHitInfo)=%zu\n",
1035 std::cerr <<
"shell selected on a non-ROOT build.\n";
std::vector< DeadVec > deadvectors
ROOT::Math::SVector< float, 3 > SVector3
void setOpt(const std::string &cmd_ln_str, T &c_opt, const U &g_opt_map, const std::string &ex_txt)
std::vector< std::string > json_patch_filenames
shell
Create symlink for executable/python cms config if needed.
void recalculateDependentConstants()
constexpr bool usePhiQArrays
matchOpts cmsswMatchingFW
std::string getOpt(const T &c_opt, const U &g_opt_map)
matchOpts cmsswMatchingBK
void listOpts(const U &g_opt_map)
static void FinalizeAll()
constexpr int numThreadsFinder
constexpr bool nan_etc_sigs_enable
void next_arg_or_die(lStr_t &args, lStr_i &i, bool allow_single_minus=false)
bool json_save_iters_include_iter_info_preamble
std::vector< std::string > json_load_filenames
constexpr int numSeedsPerTask
constexpr int numThreadsEvents
std::list< std::string > lStr_t
const bool useHitsForDuplicates
std::string json_save_iters_fname_fmt
ROOT::Math::SMatrix< float, 3, 3, ROOT::Math::MatRepSym< float, 3 > > SMatrixSym33
int finderReportBestOutOfN