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
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 fs::path MainConfigPath() const { return fMainConfigPath; }
27 const std::string& InputLocator() const { return fInputLocator; }
28 fs::path OutputFile() const { return fOutputFile; }
29 std::size_t OutputMaxSize() const { return fOutputMaxSize; }
30 std::size_t OutputMaxItems() const { return fOutputMaxItems; }
31 fs::path BatchQaOutput() const { return fBatchQaOutput; }
32#ifndef CBM_ONLINE_USE_FAIRLOGGER
33 severity_level LogLevel() const { return fLogLevel; }
34#endif // Not CBM_ONLINE_USE_FAIRLOGGER
35 fs::path LogFile() const { return fLogFile; }
36 const std::string& Device() const { return fDevice; }
37 const std::string& MonitorUri() const { return fMonitorUri; }
38 const std::string& HistogramUri() const { return fHistogramUri; }
39 const int32_t& HistogramHwm() const { return fHistogramHwm; }
40 bool CollectAuxData() const { return fCollectAuxData; }
41 const bool& CompressHistograms() const { return fCompressHistograms; }
44 fs::path TimingsFile() const { return fTimingsFile; }
45 int NumTimeslices() const { return fNumTimeslices; }
46 int SkipTimeslices() const { return fSkipTimeslices; }
47
48 std::optional<int> NumOMPThreads() const
49 {
50 // omp doesn't allow negative number of threads, so we use -1 to indicate that the user didn't specify a number
51 // and omp should use OMP_NUM_THREADS environment variable or the default instead
52 return fNumOMPThreads > 0 ? std::make_optional(fNumOMPThreads) : std::nullopt;
53 }
54 const std::string& ChildId() const { return fChildId; }
55 uint64_t RunId() const { return fRunId; }
56 uint64_t RunStart() const { return fRunStartTime; }
57 bool DumpBatchQaHistograms() const { return !fBatchQaOutput.empty(); }
58 bool DumpArchive() const { return fDumpArchive; }
59 bool ReleaseMode() const { return fReleaseMode; }
60
61 const std::vector<Step>& Steps() const { return fRecoSteps; }
62
63 const std::vector<RecoData>& OutputTypes() const { return fOutputTypes; }
64 bool HasOutput(RecoData recoData) const;
65
66 bool CompressArchive() const { return fCompressArchive; }
67
68 const std::vector<fles::Subsystem>& Detectors() const { return fDetectors; }
69
70 bool Has(fles::Subsystem detector) const;
71
72 bool Has(Step step) const;
73
74 bool Has(QaStep qastep) const;
75
77
78 private: // members
79 std::string fParamsDir;
80 std::string fMainConfigPath;
81 std::string fInputLocator;
82 std::string fOutputFile;
83 std::size_t fOutputMaxSize;
84 std::size_t fOutputMaxItems;
85 std::string fBatchQaOutput;
86#ifndef CBM_ONLINE_USE_FAIRLOGGER
87 severity_level fLogLevel;
88#endif // Not CBM_ONLINE_USE_FAIRLOGGER
89 std::string fLogFile;
90 std::string fDevice;
91 std::string fMonitorUri;
92 std::string fHistogramUri;
94 bool fCompressHistograms = false;
95 std::vector<QaStep> fQaSteps;
96 bool fDumpArchive = false;
97 bool fReleaseMode = false;
99 std::string fTimingsFile;
103 std::vector<Step> fRecoSteps;
104 std::vector<RecoData> fOutputTypes;
105 bool fCompressArchive = false;
106 std::vector<fles::Subsystem> fDetectors;
107 std::string fChildId = "00";
108 uint64_t fRunId = 2391;
109 uint64_t fRunStartTime = 0;
110 bool fCollectAuxData = false;
112 };
113
114} // namespace cbm::algo
115
116#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
std::size_t fOutputMaxItems
bool ReconstructDigiEvents() const
std::string fMainConfigPath
const std::string & HistogramUri() const
uint64_t RunStart() const
bool CompressArchive() const
const int32_t & HistogramHwm() const
bool DumpBatchQaHistograms() const
std::optional< int > NumOMPThreads() const
std::vector< RecoData > fOutputTypes
fs::path BatchQaOutput() const
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
std::size_t OutputMaxItems() const
ProfilingLevel fProfilingLevel
fs::path MainConfigPath() const
std::vector< QaStep > fQaSteps
const std::string & ChildId() const
std::size_t OutputMaxSize() const
severity_level LogLevel() const