LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
artapp.cc File Reference
#include "art/Framework/Art/artapp.h"
#include "art/Framework/Art/BasicOptionsHandler.h"
#include "art/Framework/Art/BasicOutputOptionsHandler.h"
#include "art/Framework/Art/BasicPostProcessor.h"
#include "art/Framework/Art/BasicSourceOptionsHandler.h"
#include "art/Framework/Art/DebugOptionsHandler.h"
#include "art/Framework/Art/FileCatalogOptionsHandler.h"
#include "art/Framework/Art/OptionsHandlers.h"
#include "art/Framework/Art/ProcessingOptionsHandler.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 <string>

Go to the source code of this file.

Functions

int artapp (int argc, char *argv[], bool report_unused)
 

Function Documentation

int artapp ( int  argc,
char *  argv[],
bool  report_unused 
)

Definition at line 26 of file artapp.cc.

References art::run_art().

Referenced by art_ut(), and main().

27 {
28  // Configuration file lookup policy.
29  string search_path;
30  if (char const* fhicl_env = std::getenv("FHICL_FILE_PATH")) {
31  search_path = string{fhicl_env};
32  } else {
33  cerr << "Expected environment variable FHICL_FILE_PATH is missing or "
34  "empty: using \".\"\n";
35  search_path = ".";
36  }
37  cet::filepath_first_absolute_or_lookup_with_dot lookupPolicy{search_path};
38 
39  // Create and store options handlers.
40  ostringstream descstr;
41  descstr << "\nUsage: " << boost::filesystem::path(argv[0]).filename().native()
42  << " <-c <config-file>> <other-options> [<source-file>]+\n\n"
43  << "Basic options";
44  bpo::options_description all_desc{descstr.str()};
45  art::OptionsHandlers handlers;
46  handlers.reserve(7);
47  // BasicOptionsHandler should always be first in the list!
48  handlers.emplace_back(
49  new art::BasicOptionsHandler{all_desc, lookupPolicy, report_unused});
50  // Additional options
51  handlers.emplace_back(new art::BasicSourceOptionsHandler{all_desc});
52  handlers.emplace_back(new art::BasicOutputOptionsHandler{all_desc});
53  handlers.emplace_back(new art::ProcessingOptionsHandler{all_desc});
54  handlers.emplace_back(new art::DebugOptionsHandler{all_desc});
55  handlers.emplace_back(new art::FileCatalogOptionsHandler{all_desc});
56  // BasicPostProcessor should be last.
57  handlers.emplace_back(new art::BasicPostProcessor);
58  return art::run_art(argc, argv, all_desc, std::move(handlers));
59 }
std::vector< std::unique_ptr< art::OptionsHandler >> OptionsHandlers
int run_art(int argc, char **argv, bpo::options_description &all_desc, OptionsHandlers &&handlers)
Definition: run_art.cc:142