Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-11-04 00:02:28

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