LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
mu2eapp.cc File Reference
#include "art/Framework/Art/mu2eapp.h"
#include "art/Framework/Art/BasicOutputOptionsHandler.h"
#include "art/Framework/Art/BasicSourceOptionsHandler.h"
#include "art/Framework/Art/DebugOptionsHandler.h"
#include "art/Framework/Art/ProcessingOptionsHandler.h"
#include "art/Framework/Art/FileCatalogOptionsHandler.h"
#include "art/Framework/Art/OptionsHandlers.h"
#include "art/Framework/Art/run_art.h"
#include "cetlib/filepath_maker.h"
#include "boost/filesystem.hpp"
#include "boost/program_options.hpp"
#include <iostream>
#include <memory>
#include <string>

Go to the source code of this file.

Macros

#define ART_RETHROW_DEFAULT   1
 

Functions

int mu2eapp (int argc, char *argv[])
 
int mu2eapp_string_config (std::string const &config_string)
 

Macro Definition Documentation

#define ART_RETHROW_DEFAULT   1

Definition at line 21 of file mu2eapp.cc.

Referenced by mu2eapp().

Function Documentation

int mu2eapp ( int  argc,
char *  argv[] 
)

Definition at line 23 of file mu2eapp.cc.

References ART_RETHROW_DEFAULT, and art::run_art().

Referenced by art_ut(), and main().

24 {
25  // Configuration file lookup policy.
26  char const* fhicl_env = getenv("FHICL_FILE_PATH");
27  std::string search_path;
28  if (fhicl_env == nullptr) {
29  std::cerr << "Expected environment variable FHICL_FILE_PATH is "
30  << "missing or empty: using \".\"\n";
31  search_path = ".";
32  }
33  else {
34  search_path = std::string{fhicl_env};
35  }
36  cet::filepath_first_absolute_or_lookup_with_dot lookupPolicy{search_path};
37  // Empty options_description.
38  bpo::options_description all_desc;
39  // Create and store options handlers.
40  art::OptionsHandlers handlers;
41  handlers.reserve(5); // -ish.
42  // Add new handlers here. Do *not* add a BasicOptionsHandler: it will
43  // be done for you.
44  handlers.emplace_back(new art::BasicSourceOptionsHandler{all_desc});
45  handlers.emplace_back(new art::BasicOutputOptionsHandler{all_desc});
46  handlers.emplace_back(new art::ProcessingOptionsHandler{all_desc, ART_RETHROW_DEFAULT});
47  handlers.emplace_back(new art::DebugOptionsHandler{all_desc,
48  boost::filesystem::path(argv[0]).filename().native()});
49 
50  handlers.emplace_back(new art::FileCatalogOptionsHandler{all_desc});
51  return art::run_art(argc, argv, all_desc, lookupPolicy, std::move(handlers));
52 }
int run_art(int argc, char **argv, bpo::options_description &in_desc, cet::filepath_maker &lookupPolicy, OptionsHandlers &&handlers)
Definition: run_art.cc:123
std::vector< std::unique_ptr< art::OptionsHandler >> OptionsHandlers
#define ART_RETHROW_DEFAULT
Definition: mu2eapp.cc:21
int mu2eapp_string_config ( std::string const &  config_string)

Definition at line 54 of file mu2eapp.cc.

References art::run_art_string_config().

55 {
56  return art::run_art_string_config(config_string);
57 }
int run_art_string_config(std::string const &config_string)
Definition: run_art.cc:210