remage
Simulation framework for HPGe-based experiments
 
Loading...
Searching...
No Matches
RMGDefaultCli.hh
1// Copyright (C) 2022 Luigi Pertoldi <https://orcid.org/0000-0002-0467-2571>
2//
3// This program is free software: you can redistribute it and/or modify it under
4// the terms of the GNU Lesser General Public License as published by the Free
5// Software Foundation, either version 3 of the License, or (at your option) any
6// later version.
7//
8// This program is distributed in the hope that it will be useful, but WITHOUT
9// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11// details.
12//
13// You should have received a copy of the GNU Lesser General Public License
14// along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16#ifndef _RMG_DEFAULT_CLI_HH_
17#define _RMG_DEFAULT_CLI_HH_
18
19#include <vector>
20
21#include "RMGLog.hh"
22#include "RMGManager.hh"
23
24namespace CLI {
25 class App;
26}
32class RMGDefaultCli {
33
34 public:
35
36 RMGDefaultCli() = default;
37 virtual ~RMGDefaultCli() = default;
38
39 RMGDefaultCli(RMGDefaultCli const&) = delete;
40 RMGDefaultCli& operator=(RMGDefaultCli const&) = delete;
41 RMGDefaultCli(RMGDefaultCli&&) = delete;
42 RMGDefaultCli& operator=(RMGDefaultCli&&) = delete;
43
48 void ParseCliArgs(int argc, char** argv);
50 virtual void SetupCli(CLI::App&);
51
53 void SetupLoggingAndIpc();
54
60 int RunSimulation(int argc, char** argv);
62 virtual void SetupRuntime(RMGManager& manager);
64 virtual void SetupMacros(RMGManager& manager);
66 virtual void SetupOutput(RMGManager& manager);
68 virtual void SetupGeometry(RMGManager& manager);
69
70 protected:
71
72 int verbose = false;
73 bool quiet = false;
74 bool version = false;
75 bool version_rich = false;
76 bool no_banner = false;
77 int nthreads = 1;
78 int rand_seed = -1;
79 bool interactive = false;
80 bool overwrite_output = false;
81 int pipe_fd_out = -1, pipe_fd_in = -1;
82 int proc_num_offset = -1;
83 std::vector<std::string> gdmls;
84 std::vector<std::string> macros;
85 std::vector<std::string> macro_substitutions;
86 std::string output;
88};
89
90#endif
91
92// vim: tabstop=2 shiftwidth=2 expandtab
virtual void SetupRuntime(RMGManager &manager)
Set-up runtime properties (e.g., multithreading or -processing).
Definition RMGDefaultCli.cc:177
void ParseCliArgs(int argc, char **argv)
Parse the CLI arguments into class fields.
Definition RMGDefaultCli.cc:53
virtual void SetupOutput(RMGManager &manager)
Set-up the output file information from CLI args.
Definition RMGDefaultCli.cc:202
void SetupLoggingAndIpc()
Set-up logging from CLI args, setup signal handlers and IPC.
Definition RMGDefaultCli.cc:122
virtual void SetupGeometry(RMGManager &manager)
Load the experimental geometry (by default from GDML )
Definition RMGDefaultCli.cc:208
virtual void SetupCli(CLI::App &)
Set-up the CLI11 arguments.
Definition RMGDefaultCli.cc:66
int RunSimulation(int argc, char **argv)
Set-up and run the actual simulation.
Definition RMGDefaultCli.cc:213
virtual void SetupMacros(RMGManager &manager)
Load the macro file and substitutions from CLI args.
Definition RMGDefaultCli.cc:188
LogLevel
Definition RMGLog.hh:66
@ summary
Print only results summary, warnings, and errors.
Definition RMGLog.hh:70
Main manager class for the remage simulation.
Definition RMGManager.hh:47