Belle II Software  release-05-01-25
basf2_mva_download.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Thomas Keck *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 
12 #include <mva/utility/Utility.h>
13 #include <iostream>
14 
15 namespace po = boost::program_options;
16 
17 int main(int argc, char* argv[])
18 {
19 
20  std::string identifier;
21  std::string db_identifier;
22 
23  int event = 0;
24  int run = 0;
25  int experiment = 0;
26 
27  po::options_description description("Options");
28  description.add_options()
29  ("help", "print this message")
30  ("identifier", po::value<std::string>(&identifier)->required(), "Identifier produced by basf2_mva_teacher")
31  ("db_identifier", po::value<std::string>(&db_identifier)->required(), "Database identifier")
32  ("experiment", po::value<int>(&experiment), "Experiment for which the weightfile should be valid")
33  ("run", po::value<int>(&run), "Run for which the weightfile should be valid")
34  ("event", po::value<int>(&event), "Experiment for which the weightfile should be valid");
35  po::variables_map vm;
36 
37  try {
38  po::parsed_options parsed = po::command_line_parser(argc, argv).options(description).run();
39  po::store(parsed, vm);
40 
41  if (vm.count("help")) {
42  std::cout << description << std::endl;
43  return 1;
44  }
45  po::notify(vm);
46  } catch (po::error& err) {
47  std::cerr << "Error: " << err.what() << "\n";
48  return 1;
49  }
50 
51  Belle2::MVA::download(db_identifier, identifier, experiment, run, event);
52 
53 }
main
int main(int argc, char **argv)
Run all tests.
Definition: test_main.cc:77