18 namespace po = boost::program_options;
20 namespace au = Acts::units;
27 std::vector<dd4hep::DetElement> tracker;
28 std::vector<dd4hep::DetElement> eCal;
29 std::vector<dd4hep::DetElement> hCal;
30 std::vector<dd4hep::DetElement> muon;
31 for (
auto& detElement : det) {
32 std::string detName = detElement.name();
33 if (detName.find(
"Muon") != std::string::npos)
34 muon.push_back(detElement);
35 else if (detName.find(
"ECal") != std::string::npos)
36 eCal.push_back(detElement);
37 else if (detName.find(
"HCal") != std::string::npos)
38 hCal.push_back(detElement);
40 tracker.push_back(detElement);
42 sort(muon.begin(), muon.end(),
43 [](
const dd4hep::DetElement&
a,
const dd4hep::DetElement&
b) {
44 return (a.id() <
b.id());
46 sort(eCal.begin(), eCal.end(),
47 [](
const dd4hep::DetElement&
a,
const dd4hep::DetElement&
b) {
48 return (a.id() <
b.id());
50 sort(hCal.begin(), hCal.end(),
51 [](
const dd4hep::DetElement&
a,
const dd4hep::DetElement&
b) {
52 return (a.id() <
b.id());
54 sort(tracker.begin(), tracker.end(),
55 [](
const dd4hep::DetElement&
a,
const dd4hep::DetElement&
b) {
56 return (a.id() <
b.id());
61 det.insert(det.end(), eCal.begin(), eCal.end());
62 det.insert(det.end(), hCal.begin(), hCal.end());
63 det.insert(det.end(), muon.begin(), muon.end());
67 template <
typename aopt_t>
71 po::value<read_strings>()->multitoken()->default_value(
72 {
"file:Detectors/DD4hepDetector/compact/OpenDataDetector/"
73 "OpenDataDetector.xml"}),
74 "The locations of the input DD4hep files, use 'file:foo.xml'. In case "
75 "you want to read in multiple files, just seperate the strings by "
76 "space.")(
"dd4hep-envelopeR",
78 "The envelop cover in R for DD4hep volumes.")(
81 "The tolerance added to the geometrical extension in r of the "
82 "layers contained to build the volume envelope around in mm.")(
85 "The tolerance added to the geometrical extension in z of the "
86 "layers contained to build the volume envelope around in mm.")(
87 "dd4hep-layerThickness", po::value<double>()->default_value(10
e-10),
88 "In case no surfaces (to be contained by the layer) are handed over, "
89 "the layer thickness will be set to this value.")(
90 "dd4hep-buildFCChh", po::value<bool>()->default_value(
true),
91 "If you are not building the FCChh detector please set this flag to "
92 "false.")(
"dd4hep-loglevel", po::value<size_t>()->default_value(2),
93 "The output log level of the geometry building. Please set the "
95 "number (0 = VERBOSE, 1 = "
96 "DEBUG, 2 = INFO, 3 = WARNING, 4 = ERROR, 5 = FATAL).");
100 template <
typename amap_t>
105 gsConfig.
xmlFileNames = vm[
"dd4hep-input"].template as<read_strings>();
109 gsConfig.
envelopeR = vm[
"dd4hep-envelopeR"].template as<double>();
110 gsConfig.
envelopeZ = vm[
"dd4hep-envelopeZ"].template as<double>();
112 vm[
"dd4hep-layerThickness"].template as<double>();
113 if (vm[
"dd4hep-buildFCChh"].
template as<bool>()) {