Belle II Software  release-05-01-25
basf2_mva_upload.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 
14 #include <iostream>
15 
16 namespace po = boost::program_options;
17 using namespace Belle2::MVA;
18 
19 int main(int argc, char* argv[])
20 {
21 
22  std::string identifier;
23  std::string db_identifier;
24 
25  int exp1 = 0;
26  int exp2 = -1;
27  int run1 = 0;
28  int run2 = -1;
29 
30  po::options_description description("Options");
31  description.add_options()
32  ("help", "print this message")
33  ("identifier", po::value<std::string>(&identifier)->required(), "Identifier produced by basf2_mva_teacher")
34  ("db_identifier", po::value<std::string>(&db_identifier)->required(), "New database identifier for the method")
35  ("begin_experiment", po::value<int>(&exp1), "First experiment for which the weightfile is valid")
36  ("end_experiment", po::value<int>(&exp2), "Last experiment for which the weightfile is valid")
37  ("begin_run", po::value<int>(&run1), "First run for which the weightfile is valid")
38  ("end_run", po::value<int>(&run2), "Last run for which the weightfile is valid");
39  po::variables_map vm;
40 
41  try {
42  po::parsed_options parsed = po::command_line_parser(argc, argv).options(description).run();
43  po::store(parsed, vm);
44 
45  if (vm.count("help")) {
46  std::cout << description << std::endl;
47  return 1;
48  }
49  po::notify(vm);
50  } catch (po::error& err) {
51  std::cerr << "Error: " << err.what() << "\n";
52  return 1;
53  }
54 
55  Belle2::MVA::upload(identifier, db_identifier, exp1, run1, exp2, run2);
56 
57 
58 }
main
int main(int argc, char **argv)
Run all tests.
Definition: test_main.cc:77