Belle II Software  release-08-01-10
basf2_mva_upload.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 
10 #include <mva/utility/Utility.h>
11 
12 #include <iostream>
13 
14 namespace po = boost::program_options;
15 using namespace Belle2::MVA;
16 
17 int main(int argc, char* argv[])
18 {
19 
20  std::string identifier;
21  std::string db_identifier;
22 
23  int exp1 = 0;
24  int exp2 = -1;
25  int run1 = 0;
26  int run2 = -1;
27 
28  po::options_description description("Options");
29  description.add_options()
30  ("help", "print this message")
31  ("identifier", po::value<std::string>(&identifier)->required(), "Identifier produced by basf2_mva_teacher")
32  ("db_identifier", po::value<std::string>(&db_identifier)->required(), "New database identifier for the method")
33  ("begin_experiment", po::value<int>(&exp1), "First experiment for which the weightfile is valid")
34  ("end_experiment", po::value<int>(&exp2), "Last experiment for which the weightfile is valid")
35  ("begin_run", po::value<int>(&run1), "First run for which the weightfile is valid")
36  ("end_run", po::value<int>(&run2), "Last run for which the weightfile is valid");
37  po::variables_map vm;
38 
39  try {
40  po::parsed_options parsed = po::command_line_parser(argc, argv).options(description).run();
41  po::store(parsed, vm);
42 
43  if (vm.count("help")) {
44  std::cout << description << std::endl;
45  return 1;
46  }
47  po::notify(vm);
48  } catch (po::error& err) {
49  std::cerr << "Error: " << err.what() << "\n";
50  return 1;
51  }
52 
53  Belle2::MVA::Utility::upload(identifier, db_identifier, exp1, run1, exp2, run2);
54 
55 
56 }
static void upload(const std::string &filename, const std::string &identifier, int exp1=0, int run1=0, int exp2=-1, int run2=-1)
Convenience function which uploads a given weightfile to the database.
Definition: Utility.cc:46
int main(int argc, char **argv)
Run all tests.
Definition: test_main.cc:91