54 inline void decorateJson<Acts::SurfaceAndMaterialWithContext>(
57 if (decorator !=
nullptr && std::get<0>(src) !=
nullptr) {
58 decorator->decorate(*std::get<0>(src),
dest);
62 inline void decorateJson<Acts::TrackingVolumeAndMaterial>(
65 if (decorator !=
nullptr && src.first !=
nullptr) {
66 decorator->decorate(*src.first,
dest);
71 inline void decorateJson<Acts::IVolumeMaterial>(
74 if (decorator !=
nullptr && src !=
nullptr) {
75 decorator->decorate(*src,
dest);
79 inline void decorateJson<Acts::ISurfaceMaterial>(
82 if (decorator !=
nullptr && src !=
nullptr) {
83 decorator->decorate(*src,
dest);
91 const std::shared_ptr<const Acts::Surface>&
surface,
93 if (surface->surfaceMaterialSharedPtr() !=
nullptr) {
94 return {
surface, surface->surfaceMaterialSharedPtr(), context};
110 if (radialBounds !=
nullptr) {
125 if (cylinderBounds !=
nullptr) {
142 if (annulusBounds !=
nullptr) {
150 if (rectangleBounds !=
nullptr) {
160 if (trapezoidBounds !=
nullptr) {
171 return {
surface, std::make_shared<Acts::ProtoSurfaceMaterial>(bUtility),
189 if (cyBounds !=
nullptr) {
207 if (cutcylBounds !=
nullptr) {
217 }
else if (cuBounds !=
nullptr) {
231 return {volume, std::make_shared<Acts::ProtoVolumeMaterial>(bUtility)};
251 std::vector<std::pair<GeometryIdentifier, const IVolumeMaterial*>>
253 for (
auto it = volumeMap.begin();
it != volumeMap.end();
it++) {
254 mapVolumeInit.push_back({
it->first,
it->second.get()});
258 nlohmann::json materialVolume =
261 std::vector<std::pair<GeometryIdentifier, const ISurfaceMaterial*>>
263 for (
auto it = surfaceMap.begin();
it != surfaceMap.end();
it++) {
264 mapSurfaceInit.push_back({
it->first,
it->second.get()});
268 nlohmann::json materialSurface =
270 nlohmann::json materialMap;
271 materialMap[
"Volumes"] = materialVolume;
272 materialMap[
"Surfaces"] = materialSurface;
278 const nlohmann::json& materialmap) {
279 nlohmann::json materialVolume = materialmap[
"Volumes"];
283 for (
size_t i = 0;
i < hierarchyVolumeMap.
size();
i++) {
284 std::shared_ptr<const IVolumeMaterial> volumePointer(
286 volumeMap.insert({hierarchyVolumeMap.
idAt(
i),
std::move(volumePointer)});
288 nlohmann::json materialSurface = materialmap[
"Surfaces"];
292 for (
size_t i = 0;
i < hierarchySurfaceMap.
size();
i++) {
293 std::shared_ptr<const ISurfaceMaterial> surfacePointer(
295 surfaceMap.insert({hierarchySurfaceMap.
idAt(
i),
std::move(surfacePointer)});
308 std::vector<std::pair<GeometryIdentifier, Acts::TrackingVolumeAndMaterial>>
311 std::pair<GeometryIdentifier, Acts::SurfaceAndMaterialWithContext>>
313 convertToHierarchy(volumeHierarchy, surfaceHierarchy,
317 nlohmann::json jsonVolumes =
321 nlohmann::json jsonSurfaces =
323 nlohmann::json hierarchyMap;
324 hierarchyMap[
"Volumes"] = jsonVolumes;
325 hierarchyMap[
"Surfaces"] = jsonSurfaces;
330 std::vector<std::pair<GeometryIdentifier, Acts::TrackingVolumeAndMaterial>>&
333 std::pair<GeometryIdentifier, Acts::SurfaceAndMaterialWithContext>>&
338 const std::pair<GeometryIdentifier, Acts::TrackingVolumeAndMaterial>&
339 pair) {
return (tVolume->
geometryId() == pair.first); };
340 if (std::find_if(volumeHierarchy.begin(), volumeHierarchy.end(), sameId) !=
341 volumeHierarchy.end()) {
346 m_cfg.processNonMaterial ==
true) &&
347 m_cfg.processVolumes ==
true) {
348 volumeHierarchy.push_back(
349 {tVolume->
geometryId(), defaultVolumeMaterial(tVolume)});
358 convertToHierarchy(volumeHierarchy, surfaceHierarchy, vol.get());
366 convertToHierarchy(volumeHierarchy, surfaceHierarchy, vol.get());
373 for (
auto& lay : layers) {
374 if (
m_cfg.processRepresenting ==
true) {
375 auto& layRep = lay->surfaceRepresentation();
376 if ((layRep.surfaceMaterial() !=
nullptr ||
377 m_cfg.processNonMaterial ==
true) &&
379 surfaceHierarchy.push_back(
380 {layRep.geometryId(),
381 defaultSurfaceMaterial(layRep.getSharedPtr(),
m_cfg.context)});
384 if (lay->approachDescriptor() !=
nullptr &&
385 m_cfg.processApproaches ==
true) {
386 for (
auto& asf : lay->approachDescriptor()->containedSurfaces()) {
387 if (asf->surfaceMaterial() !=
nullptr ||
388 m_cfg.processNonMaterial ==
true) {
389 surfaceHierarchy.push_back(
391 defaultSurfaceMaterial(asf->getSharedPtr(),
m_cfg.context)});
395 if (lay->surfaceArray() !=
nullptr &&
m_cfg.processSensitives ==
true) {
396 for (
auto& ssf : lay->surfaceArray()->surfaces()) {
397 if (ssf->surfaceMaterial() !=
nullptr ||
398 m_cfg.processNonMaterial ==
true) {
399 auto sp = ssf->getSharedPtr();
400 auto sm = defaultSurfaceMaterial(sp,
m_cfg.context);
401 auto id = ssf->geometryId();
404 surfaceHierarchy.push_back(
p);
413 auto& bssfRep = bsurf->surfaceRepresentation();
415 m_cfg.processBoundaries ==
true) {
416 if (bssfRep.surfaceMaterial() !=
nullptr ||
417 m_cfg.processNonMaterial ==
true) {
418 surfaceHierarchy.push_back(
419 {bssfRep.geometryId(),
420 defaultSurfaceMaterial(bssfRep.getSharedPtr(),
m_cfg.context)});