11 #include <boost/foreach.hpp>
12 #include <boost/tokenizer.hpp>
22 #include "XML/XMLElements.h"
25 const ActsExtension& actsExtension,
const std::string& valueTag,
26 const std::vector<std::pair<const std::string, Acts::BinningOption> >&
31 for (
auto&
bin : binning) {
44 int bins = actsExtension.
getValue(
bin.first, valueTag);
49 return std::make_shared<Acts::ProtoSurfaceMaterial>(bu);
54 const std::vector<std::pair<const std::string, Acts::BinningOption> >&
57 std::vector<std::string> materialOptions = {
"layer_material_representing"};
58 std::vector<const Surface*> materialSurfaces = {
62 if (aDescriptor !=
nullptr and aDescriptor->containedSurfaces().size() >= 2) {
64 const std::vector<const Surface*>& aSurfaces =
66 materialOptions.push_back(
"layer_material_inner");
67 materialSurfaces.push_back(aSurfaces[0]);
68 materialOptions.push_back(
"layer_material_outer");
69 materialSurfaces.push_back(aSurfaces[1]);
73 for (
unsigned int is = 0; is < materialOptions.size(); ++is) {
74 if (actsExtension.
hasValue(materialOptions[is])) {
91 "Translating DD4hep material into Acts material for CylinderLayer : "
92 << detElement.name());
95 if (actsExtension !=
nullptr and actsExtension->hasType(
"layer_material")) {
103 const std::string& baseTag) {
105 actsExtension.
addType(baseTag);
107 std::string
mSurface = x_material.attr<std::string>(
"surface");
108 std::string mBinning = x_material.attr<std::string>(
"binning");
109 boost::char_separator<char> sep(
",");
110 boost::tokenizer binTokens(mBinning, sep);
111 const auto n = std::distance(binTokens.begin(), binTokens.end());
114 auto bin = binTokens.begin();
115 std::string bin0 = *(
bin);
116 std::string bin1 = *(++
bin);
117 size_t nBins0 = x_material.attr<
int>(
"bins0");
118 size_t nBins1 = x_material.attr<
int>(
"bins1");
120 std::string btmSurface = baseTag + std::string(
"_") +
mSurface;
121 actsExtension.
addValue(nBins0, bin0, btmSurface);
122 actsExtension.
addValue(nBins1, bin1, btmSurface);
130 ACTS_VERBOSE(
"Translating DD4hep material into Acts material for DiscLayer : "
131 << detElement.name());
135 if (actsExtension !=
nullptr and actsExtension->hasType(
"layer_material")) {