20 #include <boost/foreach.hpp>
21 #include <boost/tokenizer.hpp>
23 #include "XML/XMLElements.h"
26 const ActsExtension& actsExtension,
const std::string& valueTag,
27 const std::vector<std::pair<const std::string, Acts::BinningOption> >&
32 for (
auto& bin : binning) {
50 return std::make_shared<Acts::ProtoSurfaceMaterial>(bu);
55 const std::vector<std::pair<const std::string, Acts::BinningOption> >&
58 std::vector<std::string> materialOptions = {
"layer_material_representing"};
59 std::vector<const Surface*> materialSurfaces = {
63 if (aDescriptor !=
nullptr and aDescriptor->containedSurfaces().size() >= 2) {
65 const std::vector<const Surface*>& aSurfaces =
67 materialOptions.push_back(
"layer_material_inner");
68 materialSurfaces.push_back(aSurfaces[0]);
69 materialOptions.push_back(
"layer_material_outer");
70 materialSurfaces.push_back(aSurfaces[1]);
74 for (
unsigned int is = 0; is < materialOptions.size(); ++is) {
75 if (actsExtension.
hasValue(materialOptions[is])) {
92 "Translating DD4hep material into Acts material for CylinderLayer : "
93 << detElement.name());
96 if (actsExtension !=
nullptr and actsExtension->hasType(
"layer_material")) {
104 const std::string& baseTag) {
106 actsExtension.
addType(baseTag);
108 std::string
mSurface = x_material.attr<std::string>(
"surface");
109 std::string mBinning = x_material.attr<std::string>(
"binning");
110 boost::char_separator<char> sep(
",");
111 boost::tokenizer binTokens(mBinning, sep);
112 const auto n = std::distance(binTokens.begin(), binTokens.end());
115 auto bin = binTokens.begin();
116 std::string bin0 = *(bin);
117 std::string bin1 = *(++bin);
118 size_t nBins0 = x_material.attr<
int>(
"bins0");
119 size_t nBins1 = x_material.attr<
int>(
"bins1");
121 std::string btmSurface = baseTag + std::string(
"_") +
mSurface;
122 actsExtension.
addValue(nBins0, bin0, btmSurface);
123 actsExtension.
addValue(nBins1, bin1, btmSurface);
131 ACTS_VERBOSE(
"Translating DD4hep material into Acts material for DiscLayer : "
132 << detElement.name());
136 if (actsExtension !=
nullptr and actsExtension->hasType(
"layer_material")) {