CbmRoot
Loading...
Searching...
No Matches
reco/offline/steer/Config.h
Go to the documentation of this file.
1/* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer] */
4
10#ifndef CBM_RECO_OFFLINE_STEER_CONFIG_H
11#define CBM_RECO_OFFLINE_STEER_CONFIG_H 1
12
14#include "CbmDefs.h"
15
16#include <array>
17#include <fstream>
18#include <sstream>
19#include <string>
20
21#include <yaml-cpp/yaml.h>
22
23namespace cbm::reco::offline
24{
25
26 enum class ECbmEvbuildType
27 {
28 Ideal,
29 Real,
31 };
32
33
41 class Config {
42 public:
44 Config() = default;
45
46
48 virtual ~Config() = default;
49
50
54 void LoadYaml(const std::string& filename);
55
56
58 std::string ToString()
59 {
60 std::stringstream out;
61 out << ToYaml();
62 return out.str();
63 }
64
65
69 void SaveYaml(const std::string& filename)
70 {
71 std::ofstream fout(filename);
72 fout << ToYaml();
73 }
74
75
76 private:
77 ECbmEvbuildType ToCbmEvbuildType(std::string tag);
78 ECbmRecoMode ToCbmRecoMode(std::string tag);
79 EOverlapModeRaw ToOverlapModeRaw(std::string tag);
80 std::string ToString(ECbmEvbuildType type);
81 std::string ToString(ECbmRecoMode mode);
82 std::string ToString(EOverlapModeRaw mode);
83
85 YAML::Node ToYaml();
86
87
88 public:
89 // --- Global settings
90 std::string f_glb_logLevel = "INFO";
91 std::string f_glb_logVerbose = "LOW";
92 std::string f_glb_logColor = "true";
94 Int_t f_glb_numTs = -1;
95 Int_t f_glb_firstTs = 0;
96
97 // --- Event builder
103 float f_evbuild_trigWinMin = std::nanf("undefined");
104 float f_evbuild_trigWinMax = std::nanf("undefined");
105
106 // --- STS
107 bool f_sts_usegpu = false;
108
109 // --- TRD
110 float f_trd_trigThresh = std::nanf("undefined");
111
112 // --- littrack
113 std::string f_lit_trackType = "";
114 std::string f_lit_mergeType = "";
115 };
116
117} // namespace cbm::reco::offline
118
119
120#endif /* CBM_RECO_OFFLINE_STEER_CONFIG_H */
ECbmRecoMode
Reconstruct the full time slice or event-by-event.
Definition CbmDefs.h:162
ECbmModuleId
Definition CbmDefs.h:39
@ kNotExist
If not found.
YAML::Node ToYaml()
Save to YAML node.
Config()=default
Constructor.
EOverlapModeRaw ToOverlapModeRaw(std::string tag)
std::string ToString()
String output (YAML format)
ECbmEvbuildType ToCbmEvbuildType(std::string tag)
ECbmRecoMode ToCbmRecoMode(std::string tag)
void LoadYaml(const std::string &filename)
Load from YAML file.
void SaveYaml(const std::string &filename)
Save to YAML file.
virtual ~Config()=default
Destructor.