Belle II Software development
basf2_mva_available.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
14namespace po = boost::program_options;
15
16int main(int argc, char* argv[])
17{
18
19 std::string 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(), "Database identifier or weightfile")
29 ("experiment", po::value<int>(&experiment), "Experiment for which the weightfile should be valid")
30 ("run", po::value<int>(&run), "Run for which the weightfile should be valid")
31 ("event", po::value<int>(&event), "Experiment for which the weightfile should be valid");
32 po::variables_map vm;
33
34 try {
35 po::parsed_options parsed = po::command_line_parser(argc, argv).options(description).run();
36 po::store(parsed, vm);
37
38 if (vm.count("help")) {
39 std::cout << description << std::endl;
40 return 1;
41 }
42 po::notify(vm);
43 } catch (po::error& err) {
44 std::cerr << "Error: " << err.what() << "\n";
45 return 1;
46 }
47
48 bool isAvailable = Belle2::MVA::Utility::available(identifier, experiment, run, event);
49 return (isAvailable) ? 0 : 1;
50
51}
static bool available(const std::string &filename, int experiment=0, int run=0, int event=0)
Convenience function which checks if an experise is available.
Definition: Utility.cc:126