Skip to content

Commit a7088e6

Browse files
sawenzelalcaliva
authored andcommitted
o2-sim: Ability to adjust default option values depending on Run5 or not
(cherry picked from commit a7150e2)
1 parent d9895b7 commit a7088e6

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Common/SimConfig/include/SimConfig/SimConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class SimConfig
118118
return SimConfig();
119119
}
120120

121-
static void initOptions(boost::program_options::options_description&);
121+
static void initOptions(boost::program_options::options_description&, bool isUpgrade = false);
122122

123123
// initializes the configuration from command line arguments
124124
// returns true of correctly initialized and not --help called

Common/SimConfig/src/SimConfig.cxx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@
2525
using namespace o2::conf;
2626
namespace bpo = boost::program_options;
2727

28-
void SimConfig::initOptions(boost::program_options::options_description& options)
28+
void SimConfig::initOptions(boost::program_options::options_description& options, bool isUpgrade)
2929
{
30+
// some default args might depend on whether Run3 or Run5
31+
// can be updated here:
32+
std::string defaultGeomList{"ALICE2"};
33+
if (isUpgrade == true) {
34+
defaultGeomList = "ALICE3";
35+
}
36+
3037
int nsimworkersdefault = std::max(1u, std::thread::hardware_concurrency() / 2);
3138
options.add_options()(
3239
"mcEngine,e", bpo::value<std::string>()->default_value("TGeant4"), "VMC backend to be used.")(
@@ -36,7 +43,7 @@ void SimConfig::initOptions(boost::program_options::options_description& options
3643
"skipModules", bpo::value<std::vector<std::string>>()->multitoken()->default_value(std::vector<std::string>({""}), ""), "list of modules excluded in geometry (precendence over -m")(
3744
"readoutDetectors", bpo::value<std::vector<std::string>>()->multitoken()->default_value(std::vector<std::string>(), ""), "list of detectors creating hits, all if not given; added to to active modules")(
3845
"skipReadoutDetectors", bpo::value<std::vector<std::string>>()->multitoken()->default_value(std::vector<std::string>(), ""), "list of detectors to skip hit creation (precendence over --readoutDetectors")(
39-
"detectorList", bpo::value<std::string>()->default_value("ALICE2"),
46+
"detectorList", bpo::value<std::string>()->default_value(defaultGeomList),
4047
"Use a specific version of ALICE, e.g., a predefined list."
4148
"There is an 'official' list provided with:"
4249
"\nALICE2 : The default configuration for Run 3"
@@ -489,7 +496,7 @@ bool SimConfig::resetFromArguments(int argc, char* argv[])
489496
bpo::variables_map vm;
490497
bpo::options_description desc("Allowed options");
491498
desc.add_options()("help,h", "Produce help message.");
492-
initOptions(desc);
499+
initOptions(desc, mConfigData.mIsUpgrade);
493500

494501
try {
495502
bpo::store(parse_command_line(argc, argv, desc), vm);

0 commit comments

Comments
 (0)