Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-07 05:53:42

0001 #include "RecoTracker/MkFitCore/src/Matriplex/MatriplexCommon.h"
0002 
0003 // CCCC #include "fittestMPlex.h"
0004 #include "RecoTracker/MkFitCMS/standalone/buildtestMPlex.h"
0005 
0006 #include "RecoTracker/MkFitCore/interface/HitStructures.h"
0007 #include "RecoTracker/MkFitCore/interface/MkBuilder.h"
0008 #include "RecoTracker/MkFitCore/src/MkFitter.h"
0009 #include "RecoTracker/MkFitCMS/interface/MkStdSeqs.h"
0010 #include "RecoTracker/MkFitCMS/standalone/MkStandaloneSeqs.h"
0011 
0012 #include "RecoTracker/MkFitCore/interface/Config.h"
0013 #include "RecoTracker/MkFitCore/standalone/ConfigStandalone.h"
0014 
0015 #include "RecoTracker/MkFitCore/standalone/Event.h"
0016 
0017 #include "RecoTracker/MkFitCore/src/MaterialEffects.h"
0018 
0019 #ifndef NO_ROOT
0020 #include "RecoTracker/MkFitCore/standalone/Validation.h"
0021 #endif
0022 
0023 //#define DEBUG
0024 #include "RecoTracker/MkFitCore/src/Debug.h"
0025 
0026 #include "oneapi/tbb/task_arena.h"
0027 #include "oneapi/tbb/parallel_for.h"
0028 
0029 #if defined(USE_VTUNE_PAUSE)
0030 #include "ittnotify.h"
0031 #endif
0032 
0033 #include <cstdlib>
0034 #include <limits>
0035 #include <list>
0036 #include <sstream>
0037 #include <memory>
0038 
0039 using namespace mkfit;
0040 
0041 //==============================================================================
0042 
0043 void initGeom() {
0044   std::cout << "Constructing geometry '" << Config::geomPlugin << "'\n";
0045 
0046   // NB: we currently assume that each node is a layer, and that layers
0047   // are added starting from the center
0048   // NB: z is just a dummy variable, VUSolid is actually infinite in size.  *** Therefore, set it to the eta of simulation ***
0049 
0050   /*
0051   // Test CMSSW loading
0052   IterationsInfo ii;
0053   unsigned int algorithms[]={ 4,22,23,5,24,7,8,9,10,6 }; // 10 iterations
0054   ii.resize(10);
0055   for (int i = 0; i < 10; ++i) {
0056       ii[i].m_track_algorithm = algorithms[i];
0057   }
0058   auto xx = configJson_Load_File(ii, "mkfit-phase1-initialStep.json");
0059   printf("%d\n", xx->m_iteration_index);
0060   */
0061 
0062   mkfit::execTrackerInfoCreatorPlugin(Config::geomPlugin, Config::TrkInfo, Config::ItrInfo);
0063 
0064   ConfigJson cj(Config::json_verbose);
0065 
0066   if (Config::json_dump_before)
0067     cj.dump(Config::ItrInfo);
0068 
0069   if (!Config::json_load_filenames.empty()) {
0070     ConfigJsonPatcher::PatchReport report;
0071 
0072     for (auto& fn : Config::json_load_filenames) {
0073       // This is for testing only ... we drop the loaded IterationConfig
0074       // as further code will always use IterationsInfo[ iter_index ].
0075       cj.patchLoad_File(Config::ItrInfo, fn, &report);
0076     }
0077 
0078     printf(
0079         "mkFit.cc/%s--JSON-Load read %d JSON entities from %d files, replaced %d parameters.\n"
0080         "   NOTE that these changes were NOT APPLIED to actual configuration that is going to be used.\n",
0081         __func__,
0082         report.n_json_entities,
0083         report.n_files,
0084         report.n_replacements);
0085   }
0086 
0087   if (!Config::json_patch_filenames.empty()) {
0088     ConfigJsonPatcher::PatchReport report;
0089 
0090     cj.patch_Files(Config::ItrInfo, Config::json_patch_filenames, &report);
0091 
0092     printf("mkFit.cc/%s--JOSN-Patch read %d JSON entities from %d files, replaced %d parameters.\n",
0093            __func__,
0094            report.n_json_entities,
0095            report.n_files,
0096            report.n_replacements);
0097   }
0098 
0099   if (Config::json_dump_after)
0100     cj.dump(Config::ItrInfo);
0101 
0102   if (!Config::json_save_iters_fname_fmt.empty()) {
0103     cj.save_Iterations(
0104         Config::ItrInfo, Config::json_save_iters_fname_fmt, Config::json_save_iters_include_iter_info_preamble);
0105   }
0106 
0107   // Test functions for ConfigJsonPatcher
0108   // cj.test_Direct (Config::ItrInfo[0]);
0109   // cj.test_Patcher(Config::ItrInfo[0]);
0110 }
0111 
0112 namespace {
0113   int g_start_event = 1;
0114 
0115   bool g_run_fit_std = false;
0116 
0117   bool g_run_build_all = true;
0118   bool g_run_build_cmssw = false;
0119   bool g_run_build_bh = false;
0120   bool g_run_build_std = false;
0121   bool g_run_build_ce = false;
0122   bool g_run_build_mimi = false;
0123 
0124   std::string g_operation = "simulate_and_process";
0125   ;
0126   std::string g_input_file = "";
0127   std::string g_output_file = "";
0128 
0129   seedOptsMap g_seed_opts;
0130   void init_seed_opts() {
0131     g_seed_opts["sim"] = {simSeeds, "Use simtracks for seeds"};
0132     g_seed_opts["cmssw"] = {cmsswSeeds, "Use external CMSSW seeds"};
0133     g_seed_opts["find"] = {findSeeds, "Use mplex seed finder for seeds"};
0134   }
0135 
0136   cleanOptsMap g_clean_opts;
0137   void init_clean_opts() {
0138     g_clean_opts["none"] = {noCleaning, "No cleaning applied to external CMSSW seeds"};
0139     g_clean_opts["n2"] = {cleanSeedsN2, "Apply N^2 cleaning by Mario to external CMSSW seeds"};
0140     g_clean_opts["pure"] = {
0141         cleanSeedsPure,
0142         "Only use external CMSSW seeds that have produced a CMSSW track \n    must enable: --read-cmssw-tracks"};
0143     g_clean_opts["badlabel"] = {cleanSeedsBadLabel, "Remove seeds with label()<0 in external CMSSW seeds"};
0144   }
0145 
0146   matchOptsMap g_match_opts;
0147   void init_match_opts() {
0148     g_match_opts["trkparam"] = {trkParamBased,
0149                                 "Use track parameter-based matching for validating against CMSSW tracks"};
0150     g_match_opts["hits"] = {hitBased, "Use hit-based matching for validating against CMSSW tracks"};
0151     g_match_opts["label"] = {labelBased, "Only allowed with pure seeds: stricter hit-based matching"};
0152   }
0153 
0154   const char* b2a(bool b) { return b ? "true" : "false"; }
0155 }  // namespace
0156 
0157 //==============================================================================
0158 
0159 // Getters and setters of enum configs (from command line using anon. namespace above)
0160 
0161 template <typename T, typename U>
0162 std::string getOpt(const T& c_opt, const U& g_opt_map) {
0163   static const std::string empty("");
0164 
0165   for (const auto& g_opt_pair : g_opt_map) {
0166     if (g_opt_pair.second.first == c_opt)
0167       return g_opt_pair.first;
0168   }
0169   std::cerr << "No match for option " << c_opt << std::endl;
0170   return empty;
0171 }
0172 
0173 template <typename T, typename U>
0174 void setOpt(const std::string& cmd_ln_str, T& c_opt, const U& g_opt_map, const std::string& ex_txt) {
0175   if (g_opt_map.count(cmd_ln_str))
0176     c_opt = g_opt_map.at(cmd_ln_str).first;
0177   else {
0178     std::cerr << cmd_ln_str << " is not a valid " << ex_txt << " option!! Exiting..." << std::endl;
0179     exit(1);
0180   }
0181 }
0182 
0183 template <typename U>
0184 void listOpts(const U& g_opt_map) {
0185   for (const auto& g_opt_pair : g_opt_map) {
0186     std::cout << "  " << g_opt_pair.first.c_str() << " : " << g_opt_pair.second.second.c_str() << std::endl;
0187   }
0188 }
0189 
0190 //==============================================================================
0191 
0192 void test_standard() {
0193   printf("Running test_standard(), operation=\"%s\"\n", g_operation.c_str());
0194   printf("  vusize=%d, num_th_sim=%d, num_th_finder=%d\n",
0195          MPT_SIZE,
0196          Config::numThreadsSimulation,
0197          Config::numThreadsFinder);
0198   printf(
0199       "  sizeof(Track)=%zu, sizeof(Hit)=%zu, sizeof(SVector3)=%zu, sizeof(SMatrixSym33)=%zu, sizeof(MCHitInfo)=%zu\n",
0200       sizeof(Track),
0201       sizeof(Hit),
0202       sizeof(SVector3),
0203       sizeof(SMatrixSym33),
0204       sizeof(MCHitInfo));
0205 
0206   if (Config::seedInput == cmsswSeeds)
0207     printf("- reading seeds from file\n");
0208 
0209   initGeom();
0210 
0211   DataFile data_file;
0212   if (g_operation == "read") {
0213     int evs_in_file = data_file.openRead(g_input_file, Config::TrkInfo.n_layers());
0214     int evs_available = evs_in_file - g_start_event + 1;
0215     if (Config::nEvents == -1) {
0216       Config::nEvents = evs_available;
0217     } else if (Config::nEvents > evs_available and not Config::loopOverFile) {
0218       printf("Requested number of events %d, only %d available.\n", Config::nEvents, evs_available);
0219       Config::nEvents = evs_available;
0220     }
0221 
0222     if (g_start_event > 1) {
0223       data_file.skipNEvents(g_start_event - 1);
0224     }
0225   }
0226 
0227   constexpr int NT = 5;
0228   double t_sum[NT] = {0};
0229   double t_skip[NT] = {0};
0230   std::vector<double> t_sum_iter(Config::nItersCMSSW, 0.0);
0231   std::vector<double> t_skip_iter(Config::nItersCMSSW, 0.0);
0232   double time = dtime();
0233 
0234   std::atomic<int> nevt{g_start_event};
0235   std::atomic<int> seedstot{0}, simtrackstot{0}, candstot{0};
0236   std::atomic<int> maxHits_all{0}, maxLayer_all{0};
0237 
0238   MkBuilder::populate();
0239 
0240   std::vector<std::unique_ptr<Event>> evs(Config::numThreadsEvents);
0241   std::vector<std::unique_ptr<Validation>> vals(Config::numThreadsEvents);
0242   std::vector<std::unique_ptr<MkBuilder>> mkbs(Config::numThreadsEvents);
0243   std::vector<std::shared_ptr<EventOfHits>> eohs(Config::numThreadsEvents);
0244   std::vector<std::shared_ptr<FILE>> fps;
0245   fps.reserve(Config::numThreadsEvents);
0246 
0247   const std::string valfile("valtree");
0248 
0249   for (int i = 0; i < Config::numThreadsEvents; ++i) {
0250     std::ostringstream serial;
0251     if (Config::numThreadsEvents > 1) {
0252       serial << "_" << i;
0253     }
0254     vals[i].reset(Validation::make_validation(valfile + serial.str() + ".root", &Config::TrkInfo));
0255     mkbs[i] = MkBuilder::make_builder(Config::silent);
0256     eohs[i].reset(new EventOfHits(Config::TrkInfo));
0257     evs[i].reset(new Event(*vals[i], 0, Config::TrkInfo.n_layers()));
0258     if (g_operation == "read") {
0259       fps.emplace_back(fopen(g_input_file.c_str(), "r"), [](FILE* fp) {
0260         if (fp)
0261           fclose(fp);
0262       });
0263     }
0264   }
0265 
0266   tbb::task_arena arena(Config::numThreadsFinder);
0267 
0268   dprint("parallel_for step size " << (Config::nEvents + Config::numThreadsEvents - 1) / Config::numThreadsEvents);
0269 
0270   time = dtime();
0271 
0272   int events_per_thread = (Config::nEvents + Config::numThreadsEvents - 1) / Config::numThreadsEvents;
0273 
0274   arena.execute([&]() {
0275     tbb::parallel_for(
0276         tbb::blocked_range<int>(0, Config::numThreadsEvents, 1),
0277         [&](const tbb::blocked_range<int>& threads) {
0278           int thisthread = threads.begin();
0279 
0280           assert(threads.begin() == threads.end() - 1 && thisthread < Config::numThreadsEvents);
0281 
0282           // std::vector<Track> plex_tracks;
0283           auto& ev = *evs[thisthread].get();
0284           auto& mkb = *mkbs[thisthread].get();
0285           auto& eoh = *eohs[thisthread].get();
0286           auto fp = fps[thisthread].get();
0287 
0288           int evstart = thisthread * events_per_thread;
0289           int evend = std::min(Config::nEvents, evstart + events_per_thread);
0290 
0291           dprint("thisthread " << thisthread << " events " << Config::nEvents << " events/thread " << events_per_thread
0292                                << " range " << evstart << ":" << evend);
0293 
0294           for (int evt = evstart; evt < evend; ++evt) {
0295             ev.reset(nevt++);
0296 
0297             if (!Config::silent) {
0298               std::lock_guard<std::mutex> printlock(Event::printmutex);
0299               printf("\n");
0300               printf("Processing event %d\n", ev.evtID());
0301             }
0302 
0303             ev.read_in(data_file, fp);
0304 
0305             // skip events with zero seed tracks!
0306             if (ev.seedTracks_.empty())
0307               continue;
0308 
0309             // plex_tracks.resize(ev.simTracks_.size());
0310 
0311             StdSeq::loadHitsAndBeamSpot(ev, eoh);
0312 
0313             std::vector<DeadVec> deadvectors(ev.layerHits_.size());
0314 #include "RecoTracker/MkFitCMS/standalone/deadmodules.h"
0315             if (Config::useDeadModules) {
0316               StdSeq::loadDeads(eoh, deadvectors);
0317             }
0318 
0319             double t_best[NT] = {0}, t_cur[NT] = {0};
0320             std::vector<double> t_cur_iter;
0321             simtrackstot += ev.simTracks_.size();
0322             seedstot += ev.seedTracks_.size();
0323 
0324             int ncands_thisthread = 0;
0325             int maxHits_thisthread = 0;
0326             int maxLayer_thisthread = 0;
0327             for (int b = 0; b < Config::finderReportBestOutOfN; ++b) {
0328               t_cur[0] = 0;  // t_cur[0] = (g_run_fit_std) ? runFittingTestPlex(ev, plex_tracks) : 0;
0329               t_cur[1] = (g_run_build_all || g_run_build_bh) ? runBuildingTestPlexBestHit(ev, eoh, mkb) : 0;
0330               t_cur[3] = (g_run_build_all || g_run_build_ce) ? runBuildingTestPlexCloneEngine(ev, eoh, mkb) : 0;
0331               if (g_run_build_all || g_run_build_mimi)
0332                 t_cur_iter = runBtpCe_MultiIter(ev, eoh, mkb, Config::nItersCMSSW);
0333               t_cur[4] = (g_run_build_all || g_run_build_mimi) ? t_cur_iter[Config::nItersCMSSW] : 0;
0334               if (g_run_build_all || g_run_build_cmssw)
0335                 runBuildingTestPlexDumbCMSSW(ev, eoh, mkb);
0336               t_cur[2] = (g_run_build_all || g_run_build_std) ? runBuildingTestPlexStandard(ev, eoh, mkb) : 0;
0337               if (g_run_build_ce || g_run_build_mimi) {
0338                 ncands_thisthread = mkb.total_cands();
0339                 auto const& ln = mkb.max_hits_layer(eoh);
0340                 maxHits_thisthread = ln.first;
0341                 maxLayer_thisthread = ln.second;
0342               }
0343               for (int i = 0; i < NT; ++i)
0344                 t_best[i] = (b == 0) ? t_cur[i] : std::min(t_cur[i], t_best[i]);
0345 
0346               if (!Config::silent) {
0347                 std::lock_guard<std::mutex> printlock(Event::printmutex);
0348                 if (Config::finderReportBestOutOfN > 1) {
0349                   printf("----------------------------------------------------------------\n");
0350                   printf("Best-of-times:");
0351                   for (int i = 0; i < NT; ++i)
0352                     printf("  %.5f/%.5f", t_cur[i], t_best[i]);
0353                   printf("\n");
0354                 }
0355                 printf("----------------------------------------------------------------\n");
0356               }
0357             }
0358 
0359             candstot += ncands_thisthread;
0360             if (maxHits_thisthread > maxHits_all) {
0361               maxHits_all = maxHits_thisthread;
0362               maxLayer_all = maxLayer_thisthread;
0363             }
0364             if (!Config::silent) {
0365               std::lock_guard<std::mutex> printlock(Event::printmutex);
0366               printf("Matriplex fit = %.5f  --- Build  BHMX = %.5f  STDMX = %.5f  CEMX = %.5f  MIMI = %.5f\n",
0367                      t_best[0],
0368                      t_best[1],
0369                      t_best[2],
0370                      t_best[3],
0371                      t_best[4]);
0372             }
0373 
0374             {
0375               static std::mutex sum_up_lock;
0376               std::lock_guard<std::mutex> locker(sum_up_lock);
0377 
0378               for (int i = 0; i < NT; ++i)
0379                 t_sum[i] += t_best[i];
0380               if (evt > 0)
0381                 for (int i = 0; i < NT; ++i)
0382                   t_skip[i] += t_best[i];
0383               if (g_run_build_all || g_run_build_mimi) {
0384                 for (int i = 0; i < Config::nItersCMSSW; ++i)
0385                   t_sum_iter[i] += t_cur_iter[i];
0386                 if (evt > 0)
0387                   for (int i = 0; i < Config::nItersCMSSW; ++i)
0388                     t_skip_iter[i] += t_cur_iter[i];
0389               }
0390             }
0391           }
0392         },
0393         tbb::simple_partitioner());
0394   });
0395 
0396   time = dtime() - time;
0397 
0398   printf("\n");
0399   printf("================================================================\n");
0400   printf("=== TOTAL for %d events\n", Config::nEvents);
0401   printf("================================================================\n");
0402 
0403   printf("Total Matriplex fit = %.5f  --- Build  BHMX = %.5f  STDMX = %.5f  CEMX = %.5f  MIMI = %.5f\n",
0404          t_sum[0],
0405          t_sum[1],
0406          t_sum[2],
0407          t_sum[3],
0408          t_sum[4]);
0409   printf("Total event > 1 fit = %.5f  --- Build  BHMX = %.5f  STDMX = %.5f  CEMX = %.5f  MIMI = %.5f\n",
0410          t_skip[0],
0411          t_skip[1],
0412          t_skip[2],
0413          t_skip[3],
0414          t_skip[4]);
0415   printf("Total event loop time %.5f simtracks %d seedtracks %d builtcands %d maxhits %d on lay %d\n",
0416          time,
0417          simtrackstot.load(),
0418          seedstot.load(),
0419          candstot.load(),
0420          maxHits_all.load(),
0421          maxLayer_all.load());
0422   //fflush(stdout);
0423   if (g_run_build_all || g_run_build_mimi) {
0424     printf("================================================================\n");
0425     for (int i = 0; i < Config::nItersCMSSW; ++i)
0426       std::cout << " Iteration " << i << " build time = " << t_sum_iter[i] << " \n";
0427     printf("================================================================\n");
0428     for (int i = 0; i < Config::nItersCMSSW; ++i)
0429       std::cout << " Iteration " << i << " build time (event > 1) = " << t_skip_iter[i] << " \n";
0430     printf("================================================================\n");
0431   }
0432   if (g_operation == "read") {
0433     data_file.close();
0434   }
0435 
0436   for (auto& val : vals) {
0437     val->fillConfigTree();
0438     val->saveTTrees();
0439   }
0440 }
0441 
0442 //==============================================================================
0443 // Command line argument parsing
0444 //==============================================================================
0445 
0446 typedef std::list<std::string> lStr_t;
0447 typedef lStr_t::iterator lStr_i;
0448 
0449 bool has_suffix(const std::string& str, const std::string& suffix) {
0450   return str.size() >= suffix.size() && str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
0451 }
0452 
0453 void next_arg_or_die(lStr_t& args, lStr_i& i, bool allow_single_minus = false) {
0454   lStr_i j = i;
0455   if (++j == args.end() || has_suffix(*j, ".C") || ((*j)[0] == '-' && !(*j == "-" && allow_single_minus))) {
0456     std::cerr << "Error: option " << *i << " requires an argument.\n";
0457     exit(1);
0458   }
0459   i = j;
0460 }
0461 
0462 //==============================================================================
0463 // main
0464 //==============================================================================
0465 
0466 #include <fenv.h>
0467 
0468 int main(int argc, const char* argv[]) {
0469 #ifdef _GNU_SOURCE
0470   if (Const::nan_etc_sigs_enable) {
0471     feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);  //FE_ALL_EXCEPT);
0472   }
0473 #endif
0474 
0475 #ifdef USE_VTUNE_PAUSE
0476   __itt_pause();
0477 #endif
0478 
0479   assert(sizeof(Track::Status) == 4 &&
0480          "To make sure this is true for icc and gcc<6 when mixing bools/ints in bitfields.");
0481 
0482   // init enum maps
0483   init_seed_opts();
0484   init_clean_opts();
0485   init_match_opts();
0486 
0487   lStr_t mArgs;
0488   for (int i = 1; i < argc; ++i) {
0489     mArgs.push_back(argv[i]);
0490   }
0491 
0492   lStr_i i = mArgs.begin();
0493   while (i != mArgs.end()) {
0494     lStr_i start = i;
0495 
0496     if (*i == "-h" || *i == "-help" || *i == "--help") {
0497       printf(
0498           "\n"
0499           "Usage: %s [options]\n"
0500           "Options: defaults defined as (def: DEFAULT VALUE)\n"
0501           "\n----------------------------------------------------------------------------------------------------------"
0502           "\n\n"
0503           "Generic options\n\n"
0504           "  --geom           <str>   geometry plugin to use (def: %s)\n"
0505           "  --silent                 suppress printouts inside event loop (def: %s)\n"
0506           "  --best-out-of    <int>   run test num times, report best time (def: %d)\n"
0507           "  --input-file             file name for reading (def: %s)\n"
0508           "  --output-file            file name for writitng (def: %s)\n"
0509           "  --read-cmssw-tracks      read external cmssw reco tracks if available (def: %s)\n"
0510           "  --read-simtrack-states   read in simTrackStates for pulls in validation (def: %s)\n"
0511           "  --num-events     <int>   number of events to run over or simulate (def: %d)\n"
0512           "                             if using --input-file, must be enabled AFTER on command line\n"
0513           "  --start-event    <int>   event number to start at when reading from a file (def: %d)\n"
0514           "  --loop-over-file         after reaching the end of the file, start over from the beginning until "
0515           "<num-events> events have been processed\n"
0516           "\n"
0517           "If no --input-file is specified, will trigger simulation\n"
0518           "  --num-tracks     <int>   number of tracks to generate for each event (def: %d)\n"
0519           "\n----------------------------------------------------------------------------------------------------------"
0520           "\n\n"
0521           "Threading related options\n\n"
0522           "  --num-thr-sim    <int>   number of threads for simulation (def: %d)\n"
0523           "  --num-thr        <int>   number of threads for track finding (def: %d)\n"
0524           "  --num-thr-ev     <int>   number of threads to run the event loop (def: %d)\n"
0525           "  --seeds-per-task <int>   number of seeds to process in a tbb task (def: %d)\n"
0526           "  --hits-per-task  <int>   number of layer1 hits per task when using find seeds (def: %d)\n"
0527           "\n----------------------------------------------------------------------------------------------------------"
0528           "\n\n"
0529           "FittingTestMPlex options\n\n"
0530           "  --fit-std                run standard fitting test (def: %s)\n"
0531           "  --fit-std-only           run only standard fitting test (def: %s)\n"
0532           "  --cf-fitting             enable conformal fit before fitting tracks to get initial estimate of track "
0533           "parameters and errors (def: %s)\n"
0534           "  --fit-val                enable ROOT based validation for fittingMPlex  (def: %s)\n"
0535           "\n----------------------------------------------------------------------------------------------------------"
0536           "\n\n"
0537           "BuildingTestMPlex options\n\n"
0538           " **Specify which building routine you would like to run\n"
0539           "  --build-cmssw            run dummy validation of CMSSW tracks with MkBuilder stuff (def: %s)\n"
0540           "  --build-bh               run best-hit building test (def: %s)\n"
0541           "  --build-std              run standard combinatorial building test (def: %s)\n"
0542           "  --build-ce               run clone engine combinatorial building test (def: %s)\n"
0543           "  --build-mimi             run clone engine on multiple-iteration test (def: %s)\n"
0544           "  --num-iters-cmssw <int>  number of mimi iterations to run (def: set to 3 when --build-mimi is in effect, "
0545           "0 otherwise)\n"
0546           "\n"
0547           " **Seeding options\n"
0548           "  --seed-input     <str>   which seed collecion used for building (def: %s)\n"
0549           "  --seed-cleaning  <str>   which seed cleaning to apply if using cmssw seeds (def: %s)\n"
0550           "  --cf-seeding             enable conformal fit over seeds (def: %s)\n"
0551           "\n"
0552           " **Duplicate removal options\n"
0553           "  --remove-dup            run duplicate removal after building, using both hit and kinematic criteria (def: "
0554           "%s)\n"
0555           "  --remove-dup-no-hit     run duplicate removal after building, using kinematic criteria only (def: %s)\n"
0556           "\n"
0557           " **Dead module (strip) option\n"
0558           "  --use-dead-modules          run duplicate removal after building, using both hit and kinematic criteria "
0559           "(def: %s)\n"
0560           "\n"
0561           " **Additional options for building\n"
0562           "  --use-phiq-arr           use phi-Q arrays in select hit indices (def: %s)\n"
0563           "  --kludge-cms-hit-errors  make sure err(xy) > 15 mum, err(z) > 30 mum (def: %s)\n"
0564           "  --backward-fit           perform backward fit during building (def: %s)\n"
0565           "  --no-backward-search     do not do backward search after backward fit\n"
0566           "                           (def: do search if backward-fit is enabled and available in given iteration)\n"
0567           "  --include-pca            do the backward fit to point of closest approach, does not imply "
0568           "'--backward-fit' (def: %s)\n"
0569           "\n----------------------------------------------------------------------------------------------------------"
0570           "\n\n"
0571           "Validation options\n\n"
0572           " **Text file based options\n"
0573           "  --quality-val            enable printout validation for MkBuilder (def: %s)\n"
0574           "                             must enable: --dump-for-plots\n"
0575           "  --dump-for-plots         make shell printouts for plots (def: %s)\n"
0576           "  --mtv-like-val           configure validation to emulate CMSSW MultiTrackValidator (MTV) (def: %s)\n"
0577           "  --mtv-require-seeds      configure validation to emulate MTV but require sim tracks to be matched to "
0578           "seeds (def: %s)\n"
0579           "\n"
0580           " **ROOT based options\n"
0581           "  --sim-val-for-cmssw      enable ROOT based validation for CMSSW tracks with simtracks as reference [eff, "
0582           "FR, DR] (def: %s)\n"
0583           "  --sim-val                enable ROOT based validation for seeding, building, and fitting with simtracks "
0584           "as reference [eff, FR, DR] (def: %s)\n"
0585           "  --cmssw-val              enable ROOT based validation for building and fitting with CMSSW tracks as "
0586           "reference [eff, FR, DR] (def: %s)\n"
0587           "                             must enable: --geom CMS-2017 --read-cmssw-tracks\n"
0588           "  --cmssw-match-fw  <str>  which cmssw track matching routine to use if validating against CMSSW tracks, "
0589           "forward built tracks only (def: %s)\n"
0590           "                             must enable: --geom CMS-2017 --cmssw-val --read-cmssw-tracks\n"
0591           "  --cmssw-match-bk  <str>  which cmssw track matching routine to use if validating against CMSSW tracks, "
0592           "backward fit tracks only (def: %s)\n"
0593           "                             must enable: --geom CMS-2017 --cmssw-val --read-cmssw-tracks --backward-fit "
0594           "--backward-fit-pca\n"
0595           "  --inc-shorts             include short reco tracks into FR (def: %s)\n"
0596           "  --keep-hit-info          keep vectors of hit idxs and branches in trees (def: %s)\n"
0597           "  --try-to-save-sim-info   two options for this flag [related to validation with simtracks as reference "
0598           "collection] (def: %s)\n"
0599           "                              a) IF (--read-simtrack-states is enabled)\n"
0600           "                                    If a sim track is associated to a reco track, but it does not contain "
0601           "the last found on the reco track\n"
0602           "                                    still save sim track kinematic info from generator position\n"
0603           "                              b) ELSE (--read-simtrack-states is NOT enabled)\n"
0604           "                                    Save sim track kinematic info from generator position if matched to "
0605           "reco track\n"
0606           "\n----------------------------------------------------------------------------------------------------------"
0607           "\n\n"
0608           "Combo spaghetti, that's with cole slaw:\n\n"
0609           " **Building and fitting combo options\n"
0610           "  --backward-fit-pca       perform backward fit to point of closest approach during building\n"
0611           "                             == --backward-fit --include-pca\n"
0612           " **Seed combo options\n"
0613           "  --cmssw-simseeds         use CMS geom with simtracks for seeds\n"
0614           "                             == --geom CMS-2017 --seed-input %s\n"
0615           "  --cmssw-stdseeds         use CMS geom with CMSSW seeds uncleaned\n"
0616           "                             == --geom CMS-2017 --seed-input %s --seed-cleaning %s\n"
0617           "  --cmssw-n2seeds          use CMS geom with CMSSW seeds cleaned with N^2 routine\n"
0618           "                             == --geom CMS-2017 --seed-input %s --seed-cleaning %s\n"
0619           "  --cmssw-pureseeds        use CMS geom with pure CMSSW seeds (seeds which produced CMSSW reco tracks), "
0620           "enable read of CMSSW tracks\n"
0621           "                             == --geom CMS-2017 --seed-input %s --seed-cleaning %s --read-cmssw-tracks\n"
0622           "  --cmssw-goodlabelseeds   use CMS geom with CMSSW seeds with label() >= 0\n"
0623           "                             == --geom CMS-2017 --seed-input %s --seed-cleaning %s\n"
0624           "\n"
0625           " **CMSSW validation combo options\n"
0626           "  --cmssw-val-fhit-bhit    use CMSSW validation with hit based matching (50 percent after seed) for forward "
0627           "built tracks\n"
0628           "                           use CMSSW validation with hit based matching (50 percent after seed) for "
0629           "backward fit tracks\n"
0630           "                             == --cmssw-val --read-cmssw-tracks --cmssw-match-fw %s --cmssw-match-bk %s\n"
0631           "                             must enable: --backward-fit-pca\n"
0632           "  --cmssw-val-fhit-bprm    use CMSSW validation with hit based matching (50 percent after seed) for forward "
0633           "built tracks\n"
0634           "                           use CMSSW validation with track parameter based matching for backward fit "
0635           "tracks\n"
0636           "                             == --cmssw-val --read-cmssw-tracks --cmssw-match-fw %s --cmssw-match-bk %s\n"
0637           "                             must enable: --backward-fit-pca\n"
0638           "  --cmssw-val-fprm-bhit    use CMSSW validation with track parameter based matching for forward built "
0639           "tracks\n"
0640           "                           use CMSSW validation with hit based matching (50 percent after seed) for "
0641           "backward fit tracks\n"
0642           "                             == --cmssw-val --read-cmssw-tracks --cmssw-match-fw %s --cmssw-match-bk %s\n"
0643           "                             must enable: --backward-fit-pca\n"
0644           "  --cmssw-val-fprm-bprm    use CMSSW validation with track parameter based matching for forward built "
0645           "tracks\n"
0646           "                           use CMSSW validation with track parameter based matching for backward fit "
0647           "tracks\n"
0648           "                             == --cmssw-val --read-cmssw-tracks --cmssw-match-fw %s --cmssw-match-bk %s\n"
0649           "                             must enable: --backward-fit-pca\n"
0650           "  --cmssw-val-label        use CMSSW validation with stricter hit based matching for both forward built and "
0651           "backward fit tracks, enable read of CMSSW tracks\n"
0652           "                             == --cmssw-val --read-cmssw-tracks --cmssw-match-fw %s --cmssw-match-bk %s\n"
0653           "                             must enable: --cmssw-pureseeds --backward-fit-pca\n"
0654           "\n----------------------------------------------------------------------------------------------------------"
0655           "\n\n"
0656           "JSON config patcher options:\n\n"
0657           "  --json-load  <filename>  load single IterationConfig from given JSON file (def: do not load)\n"
0658           "                           can be specified multiple times for several files\n"
0659           "  --json-patch <filename>  patch IterationsInfo from given JSON file (def: do not patch)\n"
0660           "                           can be specified multiple times for several files\n"
0661           "  --json-save-iterations <fname-fmt> save per iteration json files\n"
0662           "                           %%d in fname-fmt gets replaced with iteration index\n"
0663           "                           %%s in fname-fmt gets replaced with iteration algorithm name\n"
0664           "                           exactly one of %%d and %%s must be specified\n"
0665           "  --json-save-iterations-include-iter-info-preamble (def: %s)\n"
0666           "  --json-verbose     print each patch assignment as it is being made (def: %s)\n"
0667           "  --json-dump-before print iteration config before patching (def: %s)\n"
0668           "  --json-dump-after  print iteration config after  patching (def: %s)\n"
0669           "\n----------------------------------------------------------------------------------------------------------"
0670           "\n\n",
0671           argv[0],
0672 
0673           Config::geomPlugin.c_str(),
0674           b2a(Config::silent),
0675           Config::finderReportBestOutOfN,
0676           g_input_file.c_str(),
0677           g_output_file.c_str(),
0678           b2a(Config::readCmsswTracks),
0679           b2a(Config::readSimTrackStates),
0680           Config::nEvents,
0681           g_start_event,
0682           Config::nTracks,
0683 
0684           Config::numThreadsSimulation,
0685           Config::numThreadsFinder,
0686           Config::numThreadsEvents,
0687           Config::numSeedsPerTask,
0688           Config::numHitsPerTask,
0689 
0690           b2a(g_run_fit_std),
0691           b2a(g_run_fit_std &&
0692               !(g_run_build_all || g_run_build_cmssw || g_run_build_bh || g_run_build_std || g_run_build_ce)),
0693           b2a(Config::cf_fitting),
0694           b2a(Config::fit_val),
0695 
0696           b2a(g_run_build_all || g_run_build_cmssw),
0697           b2a(g_run_build_all || g_run_build_bh),
0698           b2a(g_run_build_all || g_run_build_std),
0699           b2a(g_run_build_all || g_run_build_ce),
0700           b2a(g_run_build_all || g_run_build_mimi),
0701 
0702           getOpt(Config::seedInput, g_seed_opts).c_str(),
0703           getOpt(Config::seedCleaning, g_clean_opts).c_str(),
0704           b2a(Config::cf_seeding),
0705 
0706           b2a(Config::removeDuplicates && Config::useHitsForDuplicates),
0707           b2a(Config::removeDuplicates && !Config::useHitsForDuplicates),
0708 
0709           b2a(Config::useDeadModules),
0710 
0711           b2a(Config::usePhiQArrays),
0712           b2a(Config::kludgeCmsHitErrors),
0713           b2a(Config::backwardFit),
0714           b2a(Config::includePCA),
0715 
0716           b2a(Config::quality_val),
0717           b2a(Config::dumpForPlots),
0718           b2a(Config::mtvLikeValidation),
0719           b2a(Config::mtvRequireSeeds),
0720 
0721           b2a(Config::sim_val_for_cmssw),
0722           b2a(Config::sim_val),
0723           b2a(Config::cmssw_val),
0724           getOpt(Config::cmsswMatchingFW, g_match_opts).c_str(),
0725           getOpt(Config::cmsswMatchingBK, g_match_opts).c_str(),
0726           b2a(Config::inclusiveShorts),
0727           b2a(Config::keepHitInfo),
0728           b2a(Config::tryToSaveSimInfo),
0729 
0730           getOpt(simSeeds, g_seed_opts).c_str(),
0731           getOpt(cmsswSeeds, g_seed_opts).c_str(),
0732           getOpt(noCleaning, g_clean_opts).c_str(),
0733           getOpt(cmsswSeeds, g_seed_opts).c_str(),
0734           getOpt(cleanSeedsN2, g_clean_opts).c_str(),
0735           getOpt(cmsswSeeds, g_seed_opts).c_str(),
0736           getOpt(cleanSeedsPure, g_clean_opts).c_str(),
0737           getOpt(cmsswSeeds, g_seed_opts).c_str(),
0738           getOpt(cleanSeedsBadLabel, g_clean_opts).c_str(),
0739 
0740           getOpt(hitBased, g_match_opts).c_str(),
0741           getOpt(hitBased, g_match_opts).c_str(),
0742           getOpt(hitBased, g_match_opts).c_str(),
0743           getOpt(trkParamBased, g_match_opts).c_str(),
0744           getOpt(trkParamBased, g_match_opts).c_str(),
0745           getOpt(hitBased, g_match_opts).c_str(),
0746           getOpt(trkParamBased, g_match_opts).c_str(),
0747           getOpt(trkParamBased, g_match_opts).c_str(),
0748           getOpt(labelBased, g_match_opts).c_str(),
0749           getOpt(labelBased, g_match_opts).c_str(),
0750 
0751           b2a(Config::json_verbose),
0752           b2a(Config::json_save_iters_include_iter_info_preamble),
0753           b2a(Config::json_dump_before),
0754           b2a(Config::json_dump_after));
0755 
0756       printf("List of options for string based inputs \n");
0757       printf(
0758           "--geom \n"
0759           "  CMS-2017 \n"
0760           "  CylCowWLids \n"
0761           "\n");
0762 
0763       printf("--seed-input \n");
0764       listOpts(g_seed_opts);
0765       printf("\n");
0766 
0767       printf("--seed-cleaning \n");
0768       listOpts(g_clean_opts);
0769       printf("\n");
0770 
0771       printf("--cmssw-matching \n");
0772       listOpts(g_match_opts);
0773       printf("\n");
0774 
0775       exit(0);
0776     }  // end of "help" block
0777 
0778     else if (*i == "--geom") {
0779       next_arg_or_die(mArgs, i);
0780       Config::geomPlugin = *i;
0781     } else if (*i == "--silent") {
0782       Config::silent = true;
0783     } else if (*i == "--best-out-of") {
0784       next_arg_or_die(mArgs, i);
0785       Config::finderReportBestOutOfN = atoi(i->c_str());
0786     } else if (*i == "--input-file") {
0787       next_arg_or_die(mArgs, i);
0788       g_input_file = *i;
0789       g_operation = "read";
0790       Config::nEvents = -1;
0791     } else if (*i == "--output-file") {
0792       next_arg_or_die(mArgs, i);
0793       g_output_file = *i;
0794       g_operation = "write";
0795     } else if (*i == "--read-cmssw-tracks") {
0796       Config::readCmsswTracks = true;
0797     } else if (*i == "--read-simtrack-states") {
0798       Config::readSimTrackStates = true;
0799     } else if (*i == "--num-events") {
0800       next_arg_or_die(mArgs, i);
0801       Config::nEvents = atoi(i->c_str());
0802     } else if (*i == "--start-event") {
0803       next_arg_or_die(mArgs, i);
0804       g_start_event = atoi(i->c_str());
0805     } else if (*i == "--loop-over-file") {
0806       Config::loopOverFile = true;
0807     } else if (*i == "--num-tracks") {
0808       next_arg_or_die(mArgs, i);
0809       Config::nTracks = atoi(i->c_str());
0810     } else if (*i == "--num-thr-sim") {
0811       next_arg_or_die(mArgs, i);
0812       Config::numThreadsSimulation = atoi(i->c_str());
0813     } else if (*i == "--num-thr") {
0814       next_arg_or_die(mArgs, i);
0815       Config::numThreadsFinder = atoi(i->c_str());
0816     } else if (*i == "--num-thr-ev") {
0817       next_arg_or_die(mArgs, i);
0818       Config::numThreadsEvents = atoi(i->c_str());
0819     } else if (*i == "--seeds-per-task") {
0820       next_arg_or_die(mArgs, i);
0821       Config::numSeedsPerTask = atoi(i->c_str());
0822     } else if (*i == "--hits-per-task") {
0823       next_arg_or_die(mArgs, i);
0824       Config::numHitsPerTask = atoi(i->c_str());
0825     } else if (*i == "--fit-std") {
0826       g_run_fit_std = true;
0827     } else if (*i == "--fit-std-only") {
0828       g_run_fit_std = true;
0829       g_run_build_all = false;
0830       g_run_build_bh = false;
0831       g_run_build_std = false;
0832       g_run_build_ce = false;
0833     } else if (*i == "--cf-fitting") {
0834       Config::cf_fitting = true;
0835     } else if (*i == "--fit-val") {
0836       Config::fit_val = true;
0837     } else if (*i == "--build-cmssw") {
0838       g_run_build_all = false;
0839       g_run_build_cmssw = true;
0840       g_run_build_bh = false;
0841       g_run_build_std = false;
0842       g_run_build_ce = false;
0843     } else if (*i == "--build-bh") {
0844       g_run_build_all = false;
0845       g_run_build_cmssw = false;
0846       g_run_build_bh = true;
0847       g_run_build_std = false;
0848       g_run_build_ce = false;
0849     } else if (*i == "--build-std") {
0850       g_run_build_all = false;
0851       g_run_build_cmssw = false;
0852       g_run_build_bh = false;
0853       g_run_build_std = true;
0854       g_run_build_ce = false;
0855     } else if (*i == "--build-ce") {
0856       g_run_build_all = false;
0857       g_run_build_cmssw = false;
0858       g_run_build_bh = false;
0859       g_run_build_std = false;
0860       g_run_build_ce = true;
0861     } else if (*i == "--build-mimi") {
0862       g_run_build_all = false;
0863       g_run_build_cmssw = false;
0864       g_run_build_bh = false;
0865       g_run_build_std = false;
0866       g_run_build_ce = false;
0867       g_run_build_mimi = true;
0868       if (Config::nItersCMSSW == 0)
0869         Config::nItersCMSSW = 3;
0870     } else if (*i == "--num-iters-cmssw") {
0871       next_arg_or_die(mArgs, i);
0872       Config::nItersCMSSW = atoi(i->c_str());
0873     } else if (*i == "--seed-input") {
0874       next_arg_or_die(mArgs, i);
0875       setOpt(*i, Config::seedInput, g_seed_opts, "seed input collection");
0876     } else if (*i == "--seed-cleaning") {
0877       next_arg_or_die(mArgs, i);
0878       setOpt(*i, Config::seedCleaning, g_clean_opts, "seed cleaning");
0879     } else if (*i == "--cf-seeding") {
0880       Config::cf_seeding = true;
0881     } else if (*i == "--use-phiq-arr") {
0882 #ifdef CONFIG_PhiQArrays
0883       Config::usePhiQArrays = true;
0884 #else
0885       printf("--use-phiq-arr has no effect: recompile with CONFIG_PhiQArrays\n");
0886 #endif
0887     } else if (*i == "--remove-dup") {
0888       Config::removeDuplicates = true;
0889       Config::useHitsForDuplicates = true;
0890     } else if (*i == "--remove-dup-no-hit") {
0891       Config::removeDuplicates = true;
0892       Config::useHitsForDuplicates = false;
0893     } else if (*i == "--use-dead-modules") {
0894       Config::useDeadModules = true;
0895     } else if (*i == "--kludge-cms-hit-errors") {
0896       Config::kludgeCmsHitErrors = true;
0897     } else if (*i == "--backward-fit") {
0898       Config::backwardFit = true;
0899     } else if (*i == "--no-backward-search") {
0900       Config::backwardSearch = false;
0901     } else if (*i == "--include-pca") {
0902       Config::includePCA = true;
0903     } else if (*i == "--quality-val") {
0904       Config::quality_val = true;
0905     } else if (*i == "--dump-for-plots") {
0906       Config::dumpForPlots = true;
0907     } else if (*i == "--mtv-like-val") {
0908       Config::mtvLikeValidation = true;
0909       Config::cmsSelMinLayers = 0;
0910       Config::nMinFoundHits = 0;
0911     } else if (*i == "--mtv-require-seeds") {
0912       Config::mtvLikeValidation = true;
0913       Config::cmsSelMinLayers = 0;
0914       Config::nMinFoundHits = 0;
0915       Config::mtvRequireSeeds = true;
0916     } else if (*i == "--sim-val-for-cmssw") {
0917       Config::sim_val_for_cmssw = true;
0918     } else if (*i == "--sim-val") {
0919       Config::sim_val = true;
0920     } else if (*i == "--cmssw-val") {
0921       Config::cmssw_val = true;
0922     } else if (*i == "--cmssw-match-fw") {
0923       next_arg_or_die(mArgs, i);
0924       setOpt(*i, Config::cmsswMatchingFW, g_match_opts, "CMSSW validation track matching for forward built tracks");
0925     } else if (*i == "--cmssw-match-bk") {
0926       next_arg_or_die(mArgs, i);
0927       setOpt(*i, Config::cmsswMatchingBK, g_match_opts, "CMSSW validation track matching for backward fit tracks");
0928     } else if (*i == "--inc-shorts") {
0929       Config::inclusiveShorts = true;
0930     } else if (*i == "--keep-hit-info") {
0931       Config::keepHitInfo = true;
0932     } else if (*i == "--try-to-save-sim-info") {
0933       Config::tryToSaveSimInfo = true;
0934     } else if (*i == "--backward-fit-pca") {
0935       Config::backwardFit = true;
0936       Config::includePCA = true;
0937     } else if (*i == "--cmssw-simseeds") {
0938       Config::geomPlugin = "CMS-2017";
0939       Config::seedInput = simSeeds;
0940     } else if (*i == "--cmssw-stdseeds") {
0941       Config::geomPlugin = "CMS-2017";
0942       Config::seedInput = cmsswSeeds;
0943       Config::seedCleaning = noCleaning;
0944     } else if (*i == "--cmssw-n2seeds") {
0945       Config::geomPlugin = "CMS-2017";
0946       Config::seedInput = cmsswSeeds;
0947       Config::seedCleaning = cleanSeedsN2;
0948     } else if (*i == "--cmssw-pureseeds") {
0949       Config::geomPlugin = "CMS-2017";
0950       Config::seedInput = cmsswSeeds;
0951       Config::seedCleaning = cleanSeedsPure;
0952       Config::readCmsswTracks = true;
0953     } else if (*i == "--cmssw-goodlabelseeds") {
0954       Config::geomPlugin = "CMS-2017";
0955       Config::seedInput = cmsswSeeds;
0956       Config::seedCleaning = cleanSeedsBadLabel;
0957     } else if (*i == "--cmssw-val-fhit-bhit") {
0958       Config::cmssw_val = true;
0959       Config::readCmsswTracks = true;
0960       Config::cmsswMatchingFW = hitBased;
0961       Config::cmsswMatchingBK = hitBased;
0962     } else if (*i == "--cmssw-val-fhit-bprm") {
0963       Config::cmssw_val = true;
0964       Config::readCmsswTracks = true;
0965       Config::cmsswMatchingFW = hitBased;
0966       Config::cmsswMatchingBK = trkParamBased;
0967     } else if (*i == "--cmssw-val-fprm-bhit") {
0968       Config::cmssw_val = true;
0969       Config::readCmsswTracks = true;
0970       Config::cmsswMatchingFW = trkParamBased;
0971       Config::cmsswMatchingBK = hitBased;
0972     } else if (*i == "--cmssw-val-fprm-bprm") {
0973       Config::cmssw_val = true;
0974       Config::readCmsswTracks = true;
0975       Config::cmsswMatchingFW = trkParamBased;
0976       Config::cmsswMatchingBK = trkParamBased;
0977     } else if (*i == "--cmssw-val-label") {
0978       Config::cmssw_val = true;
0979       Config::readCmsswTracks = true;
0980       Config::cmsswMatchingFW = labelBased;
0981       Config::cmsswMatchingBK = labelBased;
0982     } else if (*i == "--json-load") {
0983       next_arg_or_die(mArgs, i);
0984       Config::json_load_filenames.push_back(*i);
0985     } else if (*i == "--json-patch") {
0986       next_arg_or_die(mArgs, i);
0987       Config::json_patch_filenames.push_back(*i);
0988     } else if (*i == "--json-save-iterations") {
0989       next_arg_or_die(mArgs, i);
0990       Config::json_save_iters_fname_fmt = *i;
0991     } else if (*i == "--json-save-iterations-include-iter-info-preamble") {
0992       Config::json_save_iters_include_iter_info_preamble = true;
0993     } else if (*i == "--json-verbose") {
0994       Config::json_verbose = true;
0995     } else if (*i == "--json-dump-before") {
0996       Config::json_dump_before = true;
0997     } else if (*i == "--json-dump-after") {
0998       Config::json_dump_after = true;
0999     } else {
1000       fprintf(stderr, "Error: Unknown option/argument '%s'.\n", i->c_str());
1001       exit(1);
1002     }
1003 
1004     mArgs.erase(start, ++i);
1005   }
1006 
1007   // Do some checking of options before going...
1008   if (Config::seedCleaning != cleanSeedsPure &&
1009       (Config::cmsswMatchingFW == labelBased || Config::cmsswMatchingBK == labelBased)) {
1010     std::cerr << "What have you done?!? Can't mix cmssw label matching without pure seeds! Exiting..." << std::endl;
1011     exit(1);
1012   } else if (Config::mtvLikeValidation && Config::inclusiveShorts) {
1013     std::cerr
1014         << "What have you done?!? Short reco tracks are already accounted for in the MTV-Like Validation! Inclusive "
1015            "shorts is only an option for the standard simval, and will break the MTV-Like simval! Exiting..."
1016         << std::endl;
1017     exit(1);
1018   }
1019 
1020   Config::recalculateDependentConstants();
1021 
1022   printf("Running with n_threads=%d, best_out_of=%d\n", Config::numThreadsFinder, Config::finderReportBestOutOfN);
1023 
1024   test_standard();
1025 
1026   return 0;
1027 }