CbmRoot
Loading...
Searching...
No Matches
algo/base/Options.h
Go to the documentation of this file.
1/* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Felix Weiglhofer [committer] */
4#ifndef CBM_ALGO_BASE_OPTIONS_H
5#define CBM_ALGO_BASE_OPTIONS_H
6
8#include "Definitions.h"
9#include "compat/Filesystem.h"
10#include "util/ProfilingLevel.h"
11
12#include <set>
13#include <string>
14#include <vector>
15
16namespace cbm::algo
17{
18
19 class Options {
20
21 public:
22 Options() = default;
23 Options(int argc, char** argv);
24
25 fs::path ParamsDir() const { return fParamsDir; }
26 const std::string& InputLocator() const { return fInputLocator; }
27 fs::path OutputFile() const { return fOutputFile; }
28#ifndef CBM_ONLINE_USE_FAIRLOGGER
29 severity_level LogLevel() const { return fLogLevel; }
30#endif // Not CBM_ONLINE_USE_FAIRLOGGER
31 fs::path LogFile() const { return fLogFile; }
32 const std::string& Device() const { return fDevice; }
33 const std::string& MonitorUri() const { return fMonitorUri; }
34 const std::string& HistogramUri() const { return fHistogramUri; }
35 const int32_t& HistogramHwm() const { return fHistogramHwm; }
36 bool CollectAuxData() const { return fCollectAuxData; }
37 const bool& CompressHistograms() const { return fCompressHistograms; }
40 fs::path TimingsFile() const { return fTimingsFile; }
41 int NumTimeslices() const { return fNumTimeslices; }
42 int SkipTimeslices() const { return fSkipTimeslices; }
43
44 std::optional<int> NumOMPThreads() const
45 {
46 // omp doesn't allow negative number of threads, so we use -1 to indicate that the user didn't specify a number
47 // and omp should use OMP_NUM_THREADS environment variable or the default instead
48 return fNumOMPThreads > 0 ? std::make_optional(fNumOMPThreads) : std::nullopt;
49 }
50 const std::string& ChildId() const { return fChildId; }
51 uint64_t RunId() const { return fRunId; }
52 uint64_t RunStart() const { return fRunStartTime; }
53 bool DumpArchive() const { return fDumpArchive; }
54 bool ReleaseMode() const { return fReleaseMode; }
55
56 const std::vector<Step>& Steps() const { return fRecoSteps; }
57
58 const std::vector<RecoData>& OutputTypes() const { return fOutputTypes; }
59 bool HasOutput(RecoData recoData) const;
60
61 bool CompressArchive() const { return fCompressArchive; }
62
63 const std::vector<fles::Subsystem>& Detectors() const { return fDetectors; }
64
65 bool Has(fles::Subsystem detector) const;
66
67 bool Has(Step step) const;
68
69 bool Has(QaStep qastep) const;
70
71 private: // members
72 std::string fParamsDir; // TODO: can we make this a std::path?
73 std::string fInputLocator;
74 std::string fOutputFile;
75#ifndef CBM_ONLINE_USE_FAIRLOGGER
76 severity_level fLogLevel;
77#endif // Not CBM_ONLINE_USE_FAIRLOGGER
78 std::string fLogFile;
79 std::string fDevice;
80 std::string fMonitorUri;
81 std::string fHistogramUri;
83 bool fCompressHistograms = false;
84 std::vector<QaStep> fQaSteps;
85 bool fDumpArchive = false;
86 bool fReleaseMode = false;
88 std::string fTimingsFile;
92 std::vector<Step> fRecoSteps;
93 std::vector<RecoData> fOutputTypes;
94 bool fCompressArchive = false;
95 std::vector<fles::Subsystem> fDetectors;
96 std::string fChildId = "00";
97 uint64_t fRunId = 2391;
98 uint64_t fRunStartTime = 0;
99 bool fCollectAuxData = false;
100 };
101
102} // namespace cbm::algo
103
104#endif
std::vector< fles::Subsystem > fDetectors
const std::string & Device() const
const std::vector< Step > & Steps() const
const std::vector< RecoData > & OutputTypes() const
const std::string & MonitorUri() const
fs::path ParamsDir() const
const std::string & HistogramUri() const
uint64_t RunStart() const
bool CompressArchive() const
const int32_t & HistogramHwm() const
std::optional< int > NumOMPThreads() const
std::vector< RecoData > fOutputTypes
fs::path TimingsFile() const
std::vector< Step > fRecoSteps
uint64_t RunId() const
const std::vector< fles::Subsystem > & Detectors() const
ProfilingLevel Profiling() const
const bool & CompressHistograms() const
bool CollectKernelTimes() const
fs::path LogFile() const
fs::path OutputFile() const
const std::string & InputLocator() const
bool HasOutput(RecoData recoData) const
severity_level fLogLevel
bool CollectAuxData() const
bool Has(fles::Subsystem detector) const
ProfilingLevel fProfilingLevel
std::vector< QaStep > fQaSteps
const std::string & ChildId() const
severity_level LogLevel() const