Skip to content
Snippets Groups Projects
Commit 969d3d84 authored by jhrdinka's avatar jhrdinka
Browse files

Adapt program options in order to read in multiple dd4hep geometry description files

parent 56dca7fc
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,8 @@
#include <string>
using read_range = std::vector<double>;
using read_range = std::vector<double>;
using read_strings = std::vector<std::string>;
namespace std {
std::ostream&
......@@ -22,6 +23,15 @@ operator<<(std::ostream& os, const read_range& vec)
}
return os;
}
std::ostream&
operator<<(std::ostream& os, const read_strings& vec)
{
for (auto item : vec) {
os << item << " ";
}
return os;
}
}
#endif // ACTFW_OPTIONS_H
......@@ -31,12 +31,13 @@ namespace Options {
{
opt.add_options()(
"dd4hep-input",
po::value<std::string>()->default_value(
"file:Detectors/DD4hepDetector/compact/FCChhTrackerTkLayout.xml"),
"The location of the input DD4hep file, use 'file:foo.xml'")(
"dd4hep-envelopeR",
po::value<double>()->default_value(0.),
"The envelop cover in R for DD4hep volumes.")(
po::value<read_strings>()->multitoken()->default_value(
{"file:Detectors/DD4hepDetector/compact/FCChhTrackerTkLayout.xml"}),
"The locations of the input DD4hep files, use 'file:foo.xml'. In case "
"you want to read in multiple files, just seperate the strings by "
"space.")("dd4hep-envelopeR",
po::value<double>()->default_value(0.),
"The envelop cover in R for DD4hep volumes.")(
"dd4hep-envelopeZ",
po::value<double>()->default_value(0.),
"The envelop cover in z for DD4hep volumes.")(
......@@ -62,12 +63,12 @@ namespace Options {
// DETECTOR configuration:
// --------------------------------------------------------------------------------
FW::DD4hep::GeometryService::Config gsConfig("GeometryService", logLevel);
gsConfig.xmlFileName = vm["dd4hep-input"].template as<std::string>();
gsConfig.bTypePhi = Acts::equidistant;
gsConfig.bTypeR = Acts::arbitrary;
gsConfig.bTypeZ = Acts::equidistant;
gsConfig.envelopeR = vm["dd4hep-envelopeR"].template as<double>();
gsConfig.envelopeZ = vm["dd4hep-envelopeZ"].template as<double>();
gsConfig.xmlFileNames = vm["dd4hep-input"].template as<read_strings>();
gsConfig.bTypePhi = Acts::equidistant;
gsConfig.bTypeR = Acts::arbitrary;
gsConfig.bTypeZ = Acts::equidistant;
gsConfig.envelopeR = vm["dd4hep-envelopeR"].template as<double>();
gsConfig.envelopeZ = vm["dd4hep-envelopeZ"].template as<double>();
gsConfig.buildDigitizationModules
= vm["dd4hep-digitizationmodules"].template as<bool>();
return gsConfig;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment