Belle II Software light-2406-ragdoll
basf2_mva_download.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#include <iostream>
12
13namespace po = boost::program_options;
14
15int main(int argc, char* argv[])
16{
17
18 std::string identifier;
19 std::string db_identifier;
20
21 int event = 0;
22 int run = 0;
23 int experiment = 0;
24
25 po::options_description description("Options");
26 description.add_options()
27 ("help", "print this message")
28 ("identifier", po::value<std::string>(&identifier)->required(), "Identifier produced by basf2_mva_teacher")
29 ("db_identifier", po::value<std::string>(&db_identifier)->required(), "Database identifier")
30 ("experiment", po::value<int>(&experiment), "Experiment for which the weightfile should be valid")
31 ("run", po::value<int>(&run), "Run for which the weightfile should be valid")
32 ("event", po::value<int>(&event), "Experiment for which the weightfile should be valid");
33 po::variables_map vm;
34
35 try {
36 po::parsed_options parsed = po::command_line_parser(argc, argv).options(description).run();
37 po::store(parsed, vm);
38
39 if (vm.count("help")) {
40 std::cout << description << std::endl;
41 return 1;
42 }
43 po::notify(vm);
44 } catch (po::error& err) {
45 std::cerr << "Error: " << err.what() << "\n";
46 return 1;
47 }
48
49 Belle2::MVA::Utility::download(db_identifier, identifier, experiment, run, event);
50
51}
static void download(const std::string &identifier, const std::string &filename, int experiment=0, int run=0, int event=0)
Convenience function which downloads a given weightfile from the database.
Definition: Utility.cc:32