EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CommandLineArguments.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CommandLineArguments.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 // Local include(s).
10 #include "CommandLineArguments.hpp"
11 
12 // Boost include(s).
13 #include <boost/program_options.hpp>
14 
15 // System include(s).
16 #include <cstdlib>
17 #include <iostream>
18 #include <string>
19 
21 namespace po = boost::program_options;
22 
23 void CommandLineArguments::interpret(int argc, char* argv[]) {
24  // Declare the supported options.
25  po::options_description desc("Acts::Cuda::SeedFinder Test");
26  desc.add_options()("help,h", "Produce a help message")(
27  "spFile,f", po::value<std::string>()->default_value("sp.txt"),
28  "SpacePoint text file name")(
29  "quiet,q", po::bool_switch(),
30  "Do not print the properties of the reconstructed seeds")(
31  "onlyGPU,g", po::bool_switch(),
32  "Run the seed finding using only the GPU implementation")(
33  "groupsToIterate,n", po::value<unsigned int>()->default_value(500),
34  "The number of groups to process as a maximum")(
35  "filterDuplicates,d", po::bool_switch(),
36  "Look for spacepoint duplicates in the input file, and remove them "
37  "(slow!)");
38 
39  // Parse the command line arguments.
40  po::variables_map vm;
41  po::store(po::parse_command_line(argc, argv, desc), vm);
42  po::notify(vm);
43 
44  // Handle the --help flag.
45  if (vm.count("help")) {
46  std::cout << desc << std::endl;
47  exit(0);
48  }
49 
50  // Store the arguments in the member variables.
51  spFile = vm["spFile"].as<std::string>();
52  quiet = vm["quiet"].as<bool>();
53  onlyGPU = vm["onlyGPU"].as<bool>();
54  groupsToIterate = vm["groupsToIterate"].as<unsigned int>();
55  filterDuplicates = vm["filterDuplicates"].as<bool>();
56  return;
57 }