MaCh3  2.8.0
Reference Guide
Functions
DiagMCMC.cpp File Reference
#include "Manager/MaCh3Logger.h"
#include "CLI/Modules/DiagMCMCModule.hpp"
Include dependency graph for DiagMCMC.cpp:

Go to the source code of this file.

Functions

int main (int argc, char const *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char const *  argv[] 
)

Definition at line 4 of file DiagMCMC.cpp.

4  {
5  MACH3LOG_WARN("Deprecation Warning: Use of the standalone executable will be deprecated in future releases.");
6  MACH3LOG_WARN(" : you can use 'mach3 diagnostics mcmc' as a direct replacement instead.");
7  argv[0] = "mcmc";
9  M3::MaCh3ArgumentParser* parser = proc.get_parser();
10 
11  // add compatibility layer for old binaries which have config file after input
12  // ////////////////////////////////////////////////////////////////////////////
13  if(argc > 2){
14  std::string arg1 = argv[1];
15  std::string arg2 = argv[2];
16  if(arg1.size() > 5 && arg1.substr(arg1.size() - 5) == ".root" &&
17  ((arg2.size() > 5 && arg2.substr(arg2.size() - 5) == ".yaml") ||
18  (arg2.size() > 4 && arg2.substr(arg2.size() - 4) == ".yml"))){
19  std::swap(argv[1], argv[2]);
20  }
21  }
22  // ////////////////////////////////////////////////////////////////////////////
23 
24  std::vector<std::string> args(argv, argv + argc);
25  parser->insert_default_subcommands(args); // The DiagMCMCModule parser doesn't automatically insert default subcommand so treats the first argument as a subcommand
26  parser->parse_args(args);
27  proc.Run();
28  MACH3LOG_WARN("Deprecation Warning: Use of the standalone executable will be deprecated in future releases.");
29  MACH3LOG_WARN(" : you can use 'mach3 diagnostics mcmc' as a direct replacement instead.");
30  return 0;
31 }
#define MACH3LOG_WARN
Definition: MaCh3Logger.h:36
Module for performing diagnostic analysis on MCMC chains.
MaCh3ArgumentParser * get_parser() override
Get the argument parser for this module.
int Run() override
Execute the MCMC diagnostics.
Extended ArgumentParser with MaCh3-specific functionality.
Definition: m3argparse.hpp:17
void insert_default_subcommands(std::vector< std::string > &args, std::size_t pos=0) const
Insert default subcommands into args where no explicit subcommand was given.
Definition: m3argparse.hpp:132