14#include "GaudiKernel/EventContext.h"
23#include "GeoModelKernel/GeoTube.h"
26#include "Acts/ActsVersion.hpp"
27#include "Acts/Geometry/Blueprint.hpp"
28#include "Acts/Geometry/ContainerBlueprintNode.hpp"
29#include "Acts/Geometry/CylinderVolumeBounds.hpp"
30#include "Acts/Geometry/CylinderVolumeBuilder.hpp"
31#include "Acts/Geometry/CylinderVolumeHelper.hpp"
32#include "Acts/Geometry/ITrackingVolumeBuilder.hpp"
33#include "Acts/Geometry/LayerArrayCreator.hpp"
34#include "Acts/Geometry/LayerCreator.hpp"
35#include "Acts/Geometry/SurfaceArrayCreator.hpp"
36#include "Acts/Geometry/TrackingGeometry.hpp"
37#include "Acts/Geometry/TrackingGeometryBuilder.hpp"
38#include "Acts/Geometry/TrackingVolume.hpp"
39#include "Acts/Geometry/TrackingVolumeArrayCreator.hpp"
40#include "Acts/Utilities/Logger.hpp"
41#include "Acts/Definitions/Units.hpp"
42#include "Acts/Geometry/PassiveLayerBuilder.hpp"
43#include <ActsPlugins/Detray/DetrayGeometryConverter.hpp>
44#include <ActsPlugins/Json/JsonMaterialDecorator.hpp>
45#include <ActsPlugins/Json/MaterialMapJsonConverter.hpp>
46#include <detray/geometry/surface.hpp>
47#include <detray/geometry/tracking_volume.hpp>
48#include <detray/utils/consistency_checker.hpp>
49#include <detray/utils/invalid_values.hpp>
50#include <traccc/geometry/host_detector.hpp>
55#include <Acts/Surfaces/PlanarBounds.hpp>
56#include <Acts/Surfaces/AnnulusBounds.hpp>
57#include <Acts/Surfaces/DiscSurface.hpp>
58#include <Acts/Surfaces/LineSurface.hpp>
59#include <Acts/Surfaces/RectangleBounds.hpp>
60#include <Acts/Visualization/ObjVisualization3D.hpp>
61#include <Acts/Visualization/ViewConfig.hpp>
62#include <Acts/Geometry/detail/TrackingGeometryPrintVisitor.hpp>
75#include <Acts/Utilities/AxisDefinitions.hpp>
83using namespace Acts::UnitLiterals;
88 Acts::ViewConfigFunc viewConfigFunc(
const Acts::ViewConfig& volumeCfg,
89 const Acts::ViewConfig& portalCfg,
90 const Acts::ViewConfig& sensitiveCfg) {
92 return [volumeCfg, portalCfg, sensitiveCfg](
const Acts::GeometryObject& geoObj) {
93 if (geoObj.geometryId().boundary() != 0) {
96 if (geoObj.geometryId().sensitive() != 0) {
103 inline Acts::GeometryIdentifier
volumeId(
const std::size_t volume) {
104 return Acts::GeometryIdentifier{}.withVolume(volume);
107 std::optional<Acts::SurfaceArray::NeighborWindow> toNeighborWindow(
108 const std::vector<unsigned int>& maxBins) {
109 constexpr unsigned int limit = std::numeric_limits<std::uint8_t>::max();
110 if (maxBins.size() != 2 || maxBins[0] > limit || maxBins[1] > limit) {
113 return Acts::SurfaceArray::NeighborWindow{
115 {
static_cast<std::uint8_t
>(maxBins[0]),
static_cast<std::uint8_t
>(maxBins[1])}};
122 : base_class(name, svc),
123 m_detStore(
"StoreGateSvc/DetectorStore", name),
137 return StatusCode::FAILURE;
145 m_autoRetrieveTools =
false;
146 m_checkToolDeps =
false;
149 << Acts::VersionMajor <<
"." << Acts::VersionMinor <<
"."
150 << Acts::VersionPatch <<
" [" << Acts::CommitHash.value_or(
"unknown hash") <<
"]");
155 ATH_MSG_INFO(
"Configured to build " << buildSubdet.size()
156 <<
" subdetectors:");
157 for (
const auto &s : buildSubdet) {
161 for (
const Gaudi::Property<std::vector<unsigned int>>* window :
165 if (!toNeighborWindow(window->value()).has_value()) {
167 <<
" must hold two bin counts of at most "
168 <<
static_cast<unsigned int>(std::numeric_limits<std::uint8_t>::max()));
169 return StatusCode::FAILURE;
174 <<
" exceeds " <<
static_cast<unsigned int>(std::numeric_limits<std::uint8_t>::max()));
175 return StatusCode::FAILURE;
179 if (buildSubdet.contains(
"Pixel") ) {
182 if (buildSubdet.contains(
"SCT") ) {
185 if (buildSubdet.contains(
"TRT") ) {
189 if (buildSubdet.contains(
"ITkPixel") ) {
192 if (buildSubdet.contains(
"ITkStrip") ) {
195 if (buildSubdet.contains(
"HGTD") ) {
207 ATH_MSG_FATAL(
"Consistency check for ITk inner pixel barrel passive layer construction failed. Please check your inputs! ");
208 return StatusCode::FAILURE;
213 ATH_MSG_FATAL(
"Consistency check for ITk outer pixel barrel passive layer construction failed. Please check your inputs! ");
214 return StatusCode::FAILURE;
219 ATH_MSG_FATAL(
"Consistency check for ITk strip barrel passive layer construction failed. Please check your inputs! ");
220 return StatusCode::FAILURE;
226 ATH_MSG_INFO(
"Using Blueprint API for geometry construction");
233 using enum Acts::AxisDirection;
235 std::vector<ActsTrk::IBlueprintNodeBuilder*> ptrBuilders;
237 std::back_inserter(ptrBuilders),
238 [](ToolHandle<ActsTrk::IBlueprintNodeBuilder>& b) { return b.get(); });
242 Acts::Blueprint::Config cfg;
243 cfg.envelope[AxisZ] = {20_mm, 20_mm};
244 cfg.envelope[AxisR] = {0_mm, 20_mm};
246 auto blueprint = std::make_unique<Acts::Blueprint>(cfg);
248 auto& root = blueprint->addCylinderContainer(
"Detector", AxisZ);
250 std::shared_ptr<Acts::BlueprintNode> currentTop{
nullptr};
252 for (
auto& builder : ptrBuilders) {
253 currentTop = builder->buildBlueprintNode(
getNominalContext().context(), std::move(currentTop));
257 root.addChild(std::move(currentTop));
259 Acts::BlueprintOptions blueprintOptions;
261 std::unique_ptr<Acts::TrackingGeometry>
trackingGeometry = blueprint->construct(
273 Acts::ObjVisualization3D vis;
275 viewConfigFunc({.visible =
true}, {.visible =
false}, {.visible =
false}));
276 vis.write(
"blueprint_envelopes.obj");
280 viewConfigFunc({.visible =
false}, {.visible =
true}, {.visible =
false}));
281 vis.write(
"blueprint_portals.obj");
284 viewConfigFunc({.visible =
false}, {.visible =
false}, {.visible =
true}));
285 vis.write(
"blueprint_sensitive.obj");
290 Acts::detail::TrackingGeometryPrintVisitor printer{
m_nominalContext.context()};
292 ATH_MSG_INFO(
"Built tracking geometry \n"<<printer.stream().str());
296 return StatusCode::FAILURE;
303 return StatusCode::SUCCESS;
308 Acts::LayerArrayCreator::Config lacCfg;
309 auto layerArrayCreator = std::make_shared<const Acts::LayerArrayCreator>(
312 Acts::TrackingVolumeArrayCreator::Config tvcCfg;
313 auto trackingVolumeArrayCreator =
314 std::make_shared<const Acts::TrackingVolumeArrayCreator>(
317 Acts::CylinderVolumeHelper::Config cvhConfig;
318 cvhConfig.layerArrayCreator = layerArrayCreator;
319 cvhConfig.trackingVolumeArrayCreator = trackingVolumeArrayCreator;
321 auto cylinderVolumeHelper =
322 std::make_shared<const Acts::CylinderVolumeHelper>(
325 Acts::TrackingGeometryBuilder::Config tgbConfig;
326 tgbConfig.trackingVolumeHelper = cylinderVolumeHelper;
329 std::shared_ptr<const Acts::IMaterialDecorator> matDeco =
nullptr;
332 if (matFileFullPath.empty()) {
334 return StatusCode::FAILURE;
336 ATH_MSG_INFO(
"Configured to use material input: " << matFileFullPath);
338 if (matFileFullPath.find(
".json") != std::string::npos) {
340 Acts::MaterialMapJsonConverter::Config jsonGeoConvConfig;
342 matDeco = std::make_shared<const Acts::JsonMaterialDecorator>(
345 tgbConfig.materialDecorator = std::move(matDeco);
348 std::array<double, 2> sctECEnvelopeZ{20_mm, 20_mm};
353 tgbConfig.trackingVolumeBuilders.push_back([&](
const auto &gctx,
357 Acts::CylinderVolumeBuilder::Config bpvConfig =
360 Acts::CylinderVolumeBuilder beamPipeVolumeBuilder {
363 return beamPipeVolumeBuilder.trackingVolume(gctx, inner);
370 if (buildSubdet.contains(
"Pixel")) {
371 tgbConfig.trackingVolumeBuilders.push_back([&](
const auto &gctx,
376 auto lb = std::make_shared<ActsLayerBuilder>(
378 Acts::CylinderVolumeBuilder::Config cvbConfig;
379 cvbConfig.layerEnvelopeR = {3_mm, 3_mm};
380 cvbConfig.layerEnvelopeZ = 1_mm;
381 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
382 cvbConfig.volumeName =
"Pixel";
383 cvbConfig.layerBuilder =
lb;
386 Acts::CylinderVolumeBuilder cvb(
389 return cvb.trackingVolume(gctx, inner);
394 if (buildSubdet.contains(
"ITkPixel") ) {
395 tgbConfig.trackingVolumeBuilders.push_back(
396 [&](
const auto &gctx,
const auto &inner,
const auto &) {
402 cfg.doEndcapLayerMerging =
true;
406 auto lb = std::make_shared<ActsLayerBuilder>(
409 Acts::CylinderVolumeBuilder::Config cvbConfig;
410 cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
411 cvbConfig.layerEnvelopeZ = 1_mm;
412 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
413 cvbConfig.volumeName =
"ITkPixelInner";
414 cvbConfig.layerBuilder =
lb;
417 Acts::CylinderVolumeBuilder cvb(
421 return cvb.trackingVolume(gctx, inner);
424 tgbConfig.trackingVolumeBuilders.push_back(
425 [&](
const auto &gctx,
const auto &inner,
const auto &) {
431 cfg.doEndcapLayerMerging =
false;
435 auto lb = std::make_shared<ActsLayerBuilder>(
438 Acts::CylinderVolumeBuilder::Config cvbConfig;
439 cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
440 cvbConfig.layerEnvelopeZ = 1_mm;
441 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
442 cvbConfig.volumeName =
"ITkPixelOuter";
443 cvbConfig.layerBuilder =
lb;
444 cvbConfig.buildToRadiusZero =
false;
445 cvbConfig.checkRingLayout =
true;
446 cvbConfig.ringTolerance = 10_mm;
448 Acts::CylinderVolumeBuilder cvb(
452 return cvb.trackingVolume(gctx, inner);
457 if (buildSubdet.contains(
"ITkStrip")) {
458 tgbConfig.trackingVolumeBuilders.push_back(
459 [&](
const auto &gctx,
const auto &inner,
const auto &) {
468 auto lb = std::make_shared<ActsLayerBuilder>(
471 Acts::CylinderVolumeBuilder::Config cvbConfig;
472 cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
473 cvbConfig.layerEnvelopeZ = 1_mm;
474 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
475 cvbConfig.volumeName =
"ITkStrip";
476 cvbConfig.layerBuilder =
lb;
477 cvbConfig.buildToRadiusZero =
480 Acts::CylinderVolumeBuilder cvb(
484 return cvb.trackingVolume(gctx, inner);
488 bool buildSCT = buildSubdet.contains(
"SCT") ;
489 bool buildTRT = buildSubdet.contains(
"TRT");
491 if (buildSCT && buildTRT) {
493 tgbConfig.trackingVolumeBuilders.push_back(
494 [&](
const auto &gctx,
const auto &inner,
const auto &) {
497 cfg.endcapEnvelopeZ = sctECEnvelopeZ;
498 auto sct_lb = std::make_shared<ActsLayerBuilder>(
504 *cylinderVolumeHelper, inner);
507 }
else if (buildSCT) {
508 tgbConfig.trackingVolumeBuilders.push_back(
509 [&](
const auto &gctx,
const auto &inner,
const auto &) {
512 lbCfg.endcapEnvelopeZ = sctECEnvelopeZ;
513 auto lb = std::make_shared<ActsLayerBuilder>(
517 Acts::CylinderVolumeBuilder::Config cvbConfig;
518 cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
519 cvbConfig.layerEnvelopeZ = 2_mm;
520 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
521 cvbConfig.volumeName =
"SCT";
522 cvbConfig.layerBuilder =
lb;
523 cvbConfig.buildToRadiusZero =
false;
525 Acts::CylinderVolumeBuilder cvb(
529 return cvb.trackingVolume(gctx, inner);
531 }
else if (buildTRT) {
532 tgbConfig.trackingVolumeBuilders.push_back(
533 [&](
const auto &gctx,
const auto &inner,
const auto &) {
535 Acts::CylinderVolumeBuilder::Config cvbConfig;
536 cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
537 cvbConfig.layerEnvelopeZ = 2_mm;
538 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
539 cvbConfig.volumeName =
"TRT";
540 cvbConfig.layerBuilder = std::move(
lb);
541 cvbConfig.buildToRadiusZero =
false;
543 Acts::CylinderVolumeBuilder cvb(
547 return cvb.trackingVolume(gctx, inner);
552 if(buildSubdet.contains(
"HGTD") ) {
553 tgbConfig.trackingVolumeBuilders.push_back(
554 [&](
const auto &gctx,
const auto &inner,
const auto &) {
556 Acts::CylinderVolumeBuilder::Config cvbConfig;
557 cvbConfig.layerEnvelopeR = {5_mm, 5_mm};
558 cvbConfig.layerEnvelopeZ = 1_mm;
559 cvbConfig.trackingVolumeHelper = cylinderVolumeHelper;
560 cvbConfig.volumeName =
"HGTD";
561 cvbConfig.layerBuilder = std::move(
lb);
562 cvbConfig.buildToRadiusZero =
false;
564 Acts::CylinderVolumeBuilder cvb(
568 return cvb.trackingVolume(gctx, inner);
574 tgbConfig.trackingVolumeBuilders.push_back(
575 [&](
const auto &gctx,
const auto &inner,
const auto &) {
580 }
catch (
const std::exception &e) {
581 ATH_MSG_ERROR(
"Encountered error when building Acts tracking geometry");
583 return StatusCode::FAILURE;
586 auto trackingGeometryBuilder =
587 std::make_shared<const Acts::TrackingGeometryBuilder>(
596 ATH_MSG_ERROR(
"No ACTS tracking geometry was built. Cannot proceeed");
597 return StatusCode::FAILURE;
602 ATH_MSG_INFO(
"Running extra consistency check! (this is SLOW)");
604 ATH_MSG_ERROR(
"Consistency check has failed! Geometry is not consistent");
605 return StatusCode::FAILURE;
611 return StatusCode::FAILURE;
618 ATH_MSG_INFO(
"Acts TrackingGeometry construction completed");
620 return StatusCode::SUCCESS;
628 std::vector<Acts::Vector2> localPoints;
631 std::uniform_real_distribution<> dist(0.0, 1.0);
633 std::optional<std::ofstream> os;
637 throw std::runtime_error{
"Failed to open consistency check output file"};
642 (*os) <<
"geo_id,vol_id,lay_id,sen_id,type,acts_loc0,acts_loc1,acts_inside,trk_loc0,trk_loc1,trk_inside,x,y,z,g2l_loc0,g2l_loc1,trk_x,trk_y,trk_z" << std::endl;
645 localPoints.emplace_back(dist(gen), dist(gen));
650 size_t nTotalSensors = 0;
651 std::array<size_t,3> nInconsistent{0,0,0};
652 size_t nMismatchedCenters = 0;
653 size_t nMismatchedNormals = 0;
657 auto isApprox = [](
auto&
a,
auto& b) ->
bool {
658 return ((
a - b).array().abs() < 1e-5).all();
664 if(actsDetElem ==
nullptr) {
670 if(siDetElem ==
nullptr) {
674 const auto* regSurface =
dynamic_cast<const Acts::RegularSurface*
>(surface);
675 const auto& trkSurface = siDetElem->
surface();
676 if(regSurface ==
nullptr) {
682 Acts::Vector3 center{regSurface->center(gctx)};
684 if (
dynamic_cast<const Acts::AnnulusBounds *
>(&surface->bounds()))
689 center.head<2>() = trkCenter.head<2>();
692 if(!isApprox(trkCenter, center)) {
694 if (
auto idHelper = siDetElem->getIdHelper())
696 trkName = idHelper->show_to_string(siDetElem->identify());
699 << surface->geometryId()
700 <<
" center (" << center[0] <<
',' << center[1] <<
',' << center[2]
701 <<
") does not match Trk surface " << trkName
702 <<
" center (" << trkCenter[0] <<
',' << trkCenter[1] <<
',' << trkCenter[2] <<
')');
703 nMismatchedCenters++;
707 const auto* lineSurface =
dynamic_cast<const Acts::LineSurface*
>(surface);
708 if(lineSurface ==
nullptr) {
709 Acts::Vector3 norm{regSurface->normal(gctx, regSurface->center(gctx))};
711 if(!isApprox(trkNorm, norm)) {
713 if (
auto idHelper = siDetElem->getIdHelper())
715 trkName = idHelper->show_to_string(siDetElem->identify());
718 << surface->geometryId()
719 <<
" normal (" << norm[0] <<
',' << norm[1] <<
',' << norm[2]
720 <<
") does not match Trk surface " << trkName
721 <<
" normal (" << trkNorm[0] <<
',' << trkNorm[1] <<
',' << trkNorm[2] <<
')');
722 nMismatchedNormals++;
727 auto doPoints = [&](
unsigned int type,
const Acts::Vector2& loc) -> std::array<bool,3> {
728 Acts::Vector3 glb = surface->localToGlobal(gctx, loc, Acts::Vector3::Zero());
732 Acts::Vector2 locg2l = Acts::Vector2::Zero();
733 bool locg2lOk =
false;
734 auto locTrkRes = trkSurface.globalToLocal(glb);
736 locTrk = locTrkRes.value();
737 glbTrk = trkSurface.localToGlobal(locTrk);
739 auto locg2lRes = surface->globalToLocal(gctx, glbTrk, Acts::Vector3::Zero());
740 if (locg2lRes.ok()) {
742 locg2l = locg2lRes.value();
746 auto gId = surface->geometryId();
749 <<
"," << gId.volume()
750 <<
"," << gId.layer()
751 <<
"," << gId.sensitive()
755 <<
"," << surface->insideBounds(loc)
758 <<
"," << trkSurface.insideBounds(locTrk)
770 return {surface->insideBounds(loc) == trkSurface.insideBounds(locTrk),
771 locg2lOk ? isApprox(loc, locg2l) :
true,
772 locTrkRes ? isApprox(glb, glbTrk) :
true};
776 constexpr double envelope = 10.0 * Acts::UnitConstants::mm;
778 std::array<bool,3> allOk{
true,
true,
true};
779 if(
const auto* bounds =
dynamic_cast<const Acts::PlanarBounds*
>(&surface->bounds()); bounds) {
782 const Acts::RectangleBounds& boundingBox = bounds->boundingBox();
783 Acts::Vector2
min = boundingBox.min().array() - envelope;
784 Acts::Vector2
max = boundingBox.max().array() + envelope;
785 Acts::Vector2 diag =
max -
min;
787 for(
const auto& testPoint : localPoints) {
788 Acts::Vector2 loc =
min.array() + (testPoint.array() * diag.array());
789 auto pointOk = doPoints(0, loc);
790 for (
size_t i=0; i<pointOk.size(); ++i) {
799 else if(
const auto* bounds =
dynamic_cast<const Acts::AnnulusBounds*
>(&surface->bounds()); bounds) {
803 std::vector<Acts::Vector2> vertices = bounds->vertices(5);
804 Acts::Vector2
min{std::numeric_limits<double>::max(), std::numeric_limits<double>::max()};
805 Acts::Vector2
max{std::numeric_limits<double>::lowest(), std::numeric_limits<double>::lowest()};
806 for (
const auto& vtx : vertices) {
807 min =
min.array().min(vtx.array());
808 max =
max.array().max(vtx.array());
810 min.array() -= envelope;
811 max.array() += envelope;
812 Acts::Vector2 diag =
max -
min;
814 for(
const auto& testPoint : localPoints) {
815 Acts::Vector2 locXY =
min.array() + (testPoint.array() * diag.array());
816 Acts::Vector2 locPC =
dynamic_cast<const Acts::DiscSurface&
>(*surface).localCartesianToPolar(locXY);
818 auto pointOk = doPoints(1, locPC);
819 for (
size_t i=0; i<pointOk.size(); ++i) {
832 for (
size_t i=0; i<allOk.size(); ++i) {
840 ATH_MSG_INFO(
"Total number of sensors : " << nTotalSensors);
841 ATH_MSG_INFO(
"Number of sensors with mismatched centers : " << nMismatchedCenters);
842 ATH_MSG_INFO(
"Number of sensors with mismatched normals : " << nMismatchedNormals);
843 ATH_MSG_INFO(
"Number of sensors with inconsistent inside: " << nInconsistent[0]);
844 ATH_MSG_INFO(
"Number of sensors with inconsistent g2l : " << nInconsistent[1]);
845 ATH_MSG_INFO(
"Number of sensors with inconsistent l2g : " << nInconsistent[2]);
850std::shared_ptr<const Acts::TrackingGeometry>
857std::shared_ptr<const Acts::ILayerBuilder>
861 std::string managerName = manager->getName();
862 auto matcher = [](
const Acts::GeometryContext & ,
863 Acts::AxisDirection ,
const Acts::Surface * ,
864 const Acts::Surface *
865 ) ->
bool {
return false; };
867 Acts::SurfaceArrayCreator::Config sacCfg;
868 sacCfg.surfaceMatcher = matcher;
869 sacCfg.doPhiBinningOptimization =
false;
871 auto surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>(
874 Acts::LayerCreator::Config lcCfg;
875 lcCfg.surfaceArrayCreator = surfaceArrayCreator;
876 auto layerCreator = std::make_shared<Acts::LayerCreator>(
882 cfg.layerCreator = layerCreator;
884 return std::make_shared<const ActsStrawLayerBuilder>(
888std::shared_ptr<const Acts::ILayerBuilder>
892 std::string managerName = manager->getName();
893 auto matcher = [](
const Acts::GeometryContext & ,
894 Acts::AxisDirection ,
const Acts::Surface * ,
895 const Acts::Surface *
896 ) ->
bool {
return false; };
898 Acts::SurfaceArrayCreator::Config sacCfg;
899 sacCfg.surfaceMatcher = matcher;
900 sacCfg.doPhiBinningOptimization =
false;
902 auto surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>(
905 Acts::LayerCreator::Config lcCfg;
906 lcCfg.surfaceArrayCreator = surfaceArrayCreator;
907 auto layerCreator = std::make_shared<Acts::LayerCreator>(
913 cfg.layerCreator = layerCreator;
916 return std::make_shared<const ActsHGTDLayerBuilder>(
922 using enum Acts::AxisDirection;
924 std::string managerName = manager->getName();
926 std::shared_ptr<const Acts::ILayerBuilder> gmLayerBuilder;
927 auto matcher = [](
const Acts::GeometryContext & ,
928 Acts::AxisDirection aDir,
const Acts::Surface *aS,
929 const Acts::Surface *bS) ->
bool {
933 if ((not
a) or (not b)) {
934 throw std::runtime_error(
935 "Cast of surface associated element to ActsDetectorElement failed "
936 "in TrackingGeometrySvc::makeVolumeBuilder");
944 if (idA.
bec() != idB.
bec())
947 if (aDir == AxisPhi) {
966 Acts::SurfaceArrayCreator::Config sacCfg;
967 sacCfg.surfaceMatcher = matcher;
969 auto surfaceArrayCreator = std::make_shared<Acts::SurfaceArrayCreator>(
972 Acts::LayerCreator::Config lcCfg;
973 lcCfg.surfaceArrayCreator = surfaceArrayCreator;
974 auto layerCreator = std::make_shared<Acts::LayerCreator>(
978 cfg.surfaceMatcher = matcher;
982 throw std::invalid_argument(
"Number of barrel material bin counts != 2");
985 cfg.barrelMaterialBins = {brlBins.at(0), brlBins.at(1)};
988 throw std::invalid_argument(
"Number of endcap material bin counts != 2");
991 cfg.endcapMaterialBins = {ecBins.at(0), ecBins.at(1)};
996 cfg.layerCreator = layerCreator;
1009std::shared_ptr<Acts::TrackingVolume>
1011 const Acts::GeometryContext &gctx,
const Acts::ILayerBuilder &sct_lb,
1012 const Acts::ILayerBuilder &trt_lb,
const Acts::CylinderVolumeHelper &cvh,
1013 const std::shared_ptr<const Acts::TrackingVolume> &
pixel) {
1016 Acts::CylinderVolumeBuilder::Config cvbCfg;
1017 Acts::CylinderVolumeBuilder cvb(
1021 Acts::VolumeConfig sctNegEC =
1022 cvb.analyzeContent(gctx, sct_lb.negativeLayers(gctx), {});
1024 Acts::VolumeConfig sctPosEC =
1025 cvb.analyzeContent(gctx, sct_lb.positiveLayers(gctx), {});
1027 Acts::VolumeConfig sctBrl =
1028 cvb.analyzeContent(gctx, sct_lb.centralLayers(gctx), {});
1031 Acts::VolumeConfig trtNegEC =
1032 cvb.analyzeContent(gctx, trt_lb.negativeLayers(gctx), {});
1034 Acts::VolumeConfig trtPosEC =
1035 cvb.analyzeContent(gctx, trt_lb.positiveLayers(gctx), {});
1037 Acts::VolumeConfig trtBrl =
1038 cvb.analyzeContent(gctx, trt_lb.centralLayers(gctx), {});
1042 double absZMinEC = std::min(std::abs(trtNegEC.zMax), std::abs(trtPosEC.zMin));
1043 double absZMaxEC = std::max(std::abs(trtNegEC.zMin), std::abs(trtPosEC.zMax));
1045 trtNegEC.zMin = -absZMaxEC;
1046 trtNegEC.zMax = -absZMinEC;
1047 trtPosEC.zMin = absZMinEC;
1048 trtPosEC.zMax = absZMaxEC;
1050 using CVBBV = Acts::CylinderVolumeBounds::BoundValues;
1053 bool isSCTSmallerInZ =
false;
1055 ATH_MSG_VERBOSE(
"Shrinking SCT in R (and maybe in increase size in Z) to fit around Pixel");
1056 auto pixelBounds =
dynamic_cast<const Acts::CylinderVolumeBounds *
>(
1057 &
pixel->volumeBounds());
1059 throw std::runtime_error(
1060 "Pixel volume must have cylindrical bounds when building the SCT+TRT assembly");
1062 double sctNegECzMin = std::min(sctNegEC.zMin, -pixelBounds->get(CVBBV::eHalfLengthZ));
1063 double sctPosECzMax = std::max(sctPosEC.zMax, pixelBounds->get(CVBBV::eHalfLengthZ));
1065 ATH_MSG_VERBOSE(
"- SCT +-EC.rMin: " << sctNegEC.rMin <<
" -> " << pixelBounds->get(CVBBV::eMaxR));
1066 ATH_MSG_VERBOSE(
"- SCT BRL.rMin: " << sctBrl.rMin <<
" -> " << pixelBounds->get(CVBBV::eMaxR));
1067 ATH_MSG_VERBOSE(
"- SCT EC.zMin: " << sctNegEC.zMin <<
" -> " << sctNegECzMin);
1068 ATH_MSG_VERBOSE(
"- SCT EC.zMax: " << sctPosEC.zMax <<
" -> " << sctPosECzMax);
1070 sctNegEC.rMin = pixelBounds->get(CVBBV::eMaxR);
1071 sctPosEC.rMin = pixelBounds->get(CVBBV::eMaxR);
1072 sctBrl.rMin = pixelBounds->get(CVBBV::eMaxR);
1074 isSCTSmallerInZ = sctPosEC.zMax < pixelBounds->get(CVBBV::eHalfLengthZ);
1076 sctNegEC.zMin = sctNegECzMin;
1077 sctPosEC.zMax = sctPosECzMax;
1087 << sctNegEC.toString());
1088 ATH_MSG_VERBOSE(
"- SCT::Barrel: " << sctBrl.layers.size() <<
" layers, "
1089 << sctBrl.toString());
1092 << sctPosEC.toString());
1097 << trtNegEC.toString());
1098 ATH_MSG_VERBOSE(
"- TRT::Barrel: " << trtBrl.layers.size() <<
" layers, "
1099 << trtBrl.toString());
1102 << trtPosEC.toString());
1106 sctBrl.zMax = (sctBrl.zMax + sctPosEC.zMin) / 2.;
1107 sctBrl.zMin = -sctBrl.zMax;
1111 trtBrl.zMin = sctBrl.zMin;
1112 trtBrl.zMax = sctBrl.zMax;
1115 trtNegEC.zMin = sctNegEC.zMin;
1116 trtPosEC.zMax = sctPosEC.zMax;
1119 trtNegEC.zMax = trtBrl.zMin;
1120 sctNegEC.zMax = trtBrl.zMin;
1121 trtPosEC.zMin = trtBrl.zMax;
1122 sctPosEC.zMin = trtBrl.zMax;
1125 sctBrl.rMax = trtBrl.rMin;
1126 sctNegEC.rMax = trtNegEC.rMin;
1127 sctPosEC.rMax = trtPosEC.rMin;
1130 trtNegEC.rMax = trtBrl.rMax;
1131 trtPosEC.rMax = trtBrl.rMax;
1133 ATH_MSG_VERBOSE(
"Dimensions after synchronization between SCT and TRT");
1137 << sctNegEC.toString());
1138 ATH_MSG_VERBOSE(
"- SCT::Barrel: " << sctBrl.layers.size() <<
" layers, "
1139 << sctBrl.toString());
1142 << sctPosEC.toString());
1147 << trtNegEC.toString());
1148 ATH_MSG_VERBOSE(
"- TRT::Barrel: " << trtBrl.layers.size() <<
" layers, "
1149 << trtBrl.toString());
1152 << trtPosEC.toString());
1154 auto makeTVol = [&](
const auto &vConf,
const auto &name) {
1155 return cvh.createTrackingVolume(gctx, vConf.layers, {},
1157 vConf.rMin, vConf.rMax, vConf.zMin,
1162 auto tvSctNegEC = makeTVol(sctNegEC,
"SCT::NegativeEndcap");
1163 auto tvSctBrl = makeTVol(sctBrl,
"SCT::Barrel");
1164 auto tvSctPosEC = makeTVol(sctPosEC,
"SCT::PositiveEndcap");
1166 auto tvTrtNegEC = makeTVol(trtNegEC,
"TRT::NegativeEndcap");
1167 auto tvTrtBrl = makeTVol(trtBrl,
"TRT::Barrel");
1168 auto tvTrtPosEC = makeTVol(trtPosEC,
"TRT::PositiveEndcap");
1172 cvh.createContainerTrackingVolume(gctx, {tvSctNegEC, tvTrtNegEC});
1174 cvh.createContainerTrackingVolume(gctx, {tvSctPosEC, tvTrtPosEC});
1175 auto barrel = cvh.createContainerTrackingVolume(gctx, {tvSctBrl, tvTrtBrl});
1180 cvh.createContainerTrackingVolume(gctx, {negEC,
barrel, posEC});
1185 auto containerBounds =
dynamic_cast<const Acts::CylinderVolumeBounds *
>(
1186 &container->volumeBounds());
1187 if (!containerBounds) {
1188 throw std::runtime_error(
1189 "SCT+TRT container volume must have cylindrical bounds when wrapping Pixel");
1191 auto pixelBounds =
dynamic_cast<const Acts::CylinderVolumeBounds *
>(
1192 &
pixel->volumeBounds());
1194 throw std::runtime_error(
1195 "Pixel volume must have cylindrical bounds when wrapping it with the SCT+TRT assembly");
1197 std::vector<std::shared_ptr<Acts::TrackingVolume>> noVolumes;
1199 if(!isSCTSmallerInZ) {
1201 auto posGap = cvh.createGapTrackingVolume(
1204 pixelBounds->get(CVBBV::eMinR), pixelBounds->get(CVBBV::eMaxR),
1205 pixelBounds->get(CVBBV::eHalfLengthZ),
1206 containerBounds->get(CVBBV::eHalfLengthZ),
1209 "Pixel::PositiveGap");
1210 auto negGap = cvh.createGapTrackingVolume(
1213 pixelBounds->get(CVBBV::eMinR), pixelBounds->get(CVBBV::eMaxR),
1214 -containerBounds->get(CVBBV::eHalfLengthZ),
1215 -pixelBounds->get(CVBBV::eHalfLengthZ),
1218 "Pixel::NegativeGap");
1220 auto pixelContainer =
1221 cvh.createContainerTrackingVolume(gctx, {negGap,
pixel, posGap});
1224 cvh.createContainerTrackingVolume(gctx, {pixelContainer, container});
1229 cvh.createContainerTrackingVolume(gctx, {
pixel, container});
1238 ATH_MSG_DEBUG(
"Populate the alignment store with all detector elements");
1246Acts::CylinderVolumeBuilder::Config
1248 std::shared_ptr<const Acts::CylinderVolumeHelper> cvh)
const {
1252 PVConstLink beamPipeTopVolume =
p_beamPipeMgr->getTreeTop(0);
1255 beamPipeTopVolume =
p_beamPipeMgr->getTreeTop(0)->getChildVol(0)->getChildVol(0);
1258 Acts::Transform3 beamPipeTransform;
1259 beamPipeTransform.setIdentity();
1261 beamPipeTransform = Acts::Translation3(beamPipeTopVolume->getX().translation());
1263 double beamPipeRadius = 20;
1265 const GeoLogVol* beamPipeLogVolume = beamPipeTopVolume->getLogVol();
1266 const GeoTube* beamPipeTube =
nullptr;
1269 if (beamPipeLogVolume ==
nullptr) {
1271 throw std::runtime_error(
"Beam pip volume has no log volume");
1274 beamPipeTube =
dynamic_cast<const GeoTube*
>(beamPipeLogVolume->getShape());
1275 if (beamPipeTube ==
nullptr){
1277 throw std::runtime_error{
"BeamPipeLogVolume was not of type GeoTube"};
1280 for(
unsigned int i=0;i<beamPipeTopVolume->getNChildVols();i++) {
1282 if(beamPipeTopVolume->getNameOfChildVol(i) ==
"SectionC03"){
1284 PVConstLink childTopVolume = beamPipeTopVolume->getChildVol(i);
1285 const GeoLogVol* childLogVolume = childTopVolume->getLogVol();
1286 const GeoTube* childTube =
nullptr;
1288 if (childLogVolume){
1289 childTube =
dynamic_cast<const GeoTube*
>(childLogVolume->getShape());
1291 beamPipeRadius = 0.5 * (childTube->getRMax()+childTube->getRMin());
1300 ATH_MSG_VERBOSE(
"BeamPipe constructed from Database: translation (yes) - radius "
1301 << ( beamPipeTube ?
"(yes)" :
"(no)") <<
" - r = " << beamPipeRadius );
1305 Acts::CylinderVolumeBuilder::Config cfg;
1307 Acts::PassiveLayerBuilder::Config bplConfig;
1308 bplConfig.layerIdentification =
"BeamPipe";
1309 bplConfig.centralLayerRadii = {beamPipeRadius * 1_mm};
1310 bplConfig.centralLayerHalflengthZ = {3000_mm};
1311 bplConfig.centralLayerThickness = {1_mm};
1312 auto beamPipeBuilder = std::make_shared<const Acts::PassiveLayerBuilder>(
1316 cfg.trackingVolumeHelper = cvh;
1317 cfg.volumeName =
"BeamPipe";
1318 cfg.layerBuilder = beamPipeBuilder;
1319 cfg.layerEnvelopeR = {1_mm, 1_mm};
1320 cfg.buildToRadiusZero =
true;
1326const Acts::TrackingVolume*
1328 const Acts::TrackingVolume* retVol{
nullptr};
1361 return AthService::finalize();
1365 using DetrayDetector = traccc::itk_detector;
1366 using DetrayMetadata = detray::detector_metadata_t<DetrayDetector>;
1372 ATH_MSG_ERROR(
"BuildDetrayGeometry was requested, but no host memory "
1373 "resource tool was configured (HostMR)");
1374 return StatusCode::FAILURE;
1387 if (!beamPipeResult.ok()) {
1388 ATH_MSG_ERROR(
"BuildDetrayGeometry was requested, but the tracking volume "
1389 "containing the origin could not be resolved: "
1390 << beamPipeResult.error().message());
1391 return StatusCode::FAILURE;
1394 const Acts::TrackingVolume* beamPipeVolume = *beamPipeResult;
1395 if (beamPipeVolume ==
nullptr) {
1396 ATH_MSG_ERROR(
"BuildDetrayGeometry was requested, but no tracking volume "
1397 "contains the origin. Detray requires a beam pipe volume "
1398 "covering (0, 0, 0).");
1399 return StatusCode::FAILURE;
1403 << beamPipeVolume->volumeName() <<
"' ("
1404 << beamPipeVolume->geometryId()
1405 <<
"), is not part of the beam pipe subtree (expected "
1407 <<
"). Using it as the Detray beam pipe volume regardless.");
1409 ATH_MSG_INFO(
"Using '" << beamPipeVolume->volumeName() <<
"' ("
1410 << beamPipeVolume->geometryId() <<
") as the Detray beam pipe volume");
1412 ActsPlugins::DetrayPayloadConverter::Config payloadConfig{};
1413 payloadConfig.beampipeVolume = beamPipeVolume;
1415 auto payloadConverter = std::make_shared<const ActsPlugins::DetrayPayloadConverter>(
1419 ActsPlugins::DetrayGeometryConverter::Config converterConfig{};
1420 converterConfig.payloadConverter = std::move(payloadConverter);
1424 ActsPlugins::DetrayGeometryConverter converter(
1425 std::move(converterConfig),
1428 ActsPlugins::DetrayGeometryConverter::DetrayGeometry<DetrayMetadata>
detrayGeometry{};
1432 }
catch (
const std::exception& e) {
1433 ATH_MSG_ERROR(
"Failed to convert the Acts::TrackingGeometry into a Detray geometry: " << e.what());
1434 return StatusCode::FAILURE;
1438 ATH_MSG_ERROR(
"Detray geometry conversion did not produce a detector");
1439 return StatusCode::FAILURE;
1443 ATH_MSG_INFO(
"Checking the consistency of the converted Detray geometry");
1445 detray::detail::check_consistency(*
detrayGeometry.detector,
true,
1447 }
catch (
const std::exception& e) {
1448 ATH_MSG_ERROR(
"The converted Detray geometry is not consistent: " << e.what());
1449 return StatusCode::FAILURE;
1451 const auto reportDetrayPortalLinks = [
this](
1452 const auto& detector,
const detray::name_map& names) {
1453 const std::size_t nVolumes = detector.volumes().size();
1458 std::vector<std::set<detray::dindex>> outgoing(nVolumes);
1459 std::size_t nPortals{0};
1460 std::size_t nEndOfWorld{0};
1462 for (
const auto& volDesc : detector.volumes()) {
1463 const auto volume = detray::tracking_volume{detector, volDesc};
1464 const detray::dindex volIdx = volume.index();
1466 for (
const auto& sfDesc : volume.portals()) {
1467 const auto surface = detray::geometry::surface{detector, sfDesc};
1470 for (
const auto link : surface.volume_links()) {
1471 if (detray::detail::is_invalid_value(link)) {
1475 if (link == volIdx || link >= nVolumes) {
1478 outgoing[volIdx].insert(link);
1483 std::size_t nReciprocal{0};
1484 std::vector<std::pair<detray::dindex, detray::dindex>> oneWay;
1485 for (detray::dindex
a = 0;
a < nVolumes; ++
a) {
1486 for (
const detray::dindex b : outgoing[
a]) {
1490 oneWay.emplace_back(
a, b);
1495 auto volName = [&names](detray::dindex idx) -> std::string {
1496 return names.contains(idx) ? names.at(idx)
1497 : std::format(
"volume {:}", idx);
1501 <<
" portal surfaces, " << nEndOfWorld
1502 <<
" end-of-world links, " << (nReciprocal / 2)
1503 <<
" reciprocal volume interfaces, " << oneWay.size()
1504 <<
" one-directional");
1506 if (!oneWay.empty()) {
1508 <<
" portal links are one-directional: the neighbour "
1509 "volume has no portal linking back. Detray's "
1510 "check_consistency() does not catch this.");
1511 const std::size_t nShow =
1512 std::min<std::size_t>(oneWay.size(), 20);
1513 for (std::size_t i = 0; i < nShow; ++i) {
1515 << oneWay[i].first <<
") -> '"
1516 << volName(oneWay[i].second) <<
"' ("
1517 << oneWay[i].second <<
") with no return link");
1519 if (oneWay.size() > nShow) {
1527 auto hostDetector = std::make_unique<traccc::host_detector>();
1528 hostDetector->set<DetrayDetector>(std::move(*
detrayGeometry.detector));
1531 ATH_MSG_INFO(
"Successfully built the Detray geometry from the Acts::TrackingGeometry");
1532 return StatusCode::SUCCESS;
1535std::unique_ptr<ActsTrk::DetectorElementToActsGeometryIdMap>
1538 auto detector_element_to_geoid = std::make_unique<DetectorElementToActsGeometryIdMap>();
1541 unsigned n_sensitive_elements{0};
1542 unsigned n_detector_elements{0};
1543 unsigned n_wrong_type{0};
1546 trackingGeometry()->visitSurfaces([
this, &counter, &detector_element_to_geoid](
const Acts::Surface *surface) {
1547 if (!surface || !surface->isSensitive()) {
1548 ++counter.n_wrong_type;
1551 ++counter.n_sensitive_elements;
1552 const auto* placement =
dynamic_cast<const ISurfacePlacement*
>(surface->surfacePlacement());
1559 if (!possibleElement){
1562 auto hash = possibleElement->identifyHash();
1565 ++counter.n_detector_elements;
1567 switch(placement->detectorType()) {
1589 ++counter.n_detector_elements;
1594 counter.n_detector_elements = 0;
1598 ATH_MSG_INFO(
"Surfaces without associated detector elements " << (counter.n_sensitive_elements -counter.n_detector_elements)
1599 <<
" (with " << counter.n_detector_elements <<
")" );
1600 if (counter.n_sensitive_elements > 0 &&
1601 counter.n_detector_elements==0) {
1602 ATH_MSG_ERROR(
"No surface with associated detector element" );
1605 if (counter.n_wrong_type>0) {
1606 ATH_MSG_WARNING(
"Surfaces associated to detector elements not of type Trk::TrkDetElementBase :" << counter.n_wrong_type);
1608 return detector_element_to_geoid;
Acts::CylinderVolumeBounds::BoundValues CVBBV
const ActsDetectorElement * getActsDetectorElement(const Acts::Surface &surf)
Attempts to retrieve the ActsDetectorElement associated to the passed ActsSurface.
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
This is an Identifier helper class for the TRT subdetector.
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
Helper to hold elements for deletion.
Acts::GeometryContext context() const
Extension of the interface of the Acts::SurfacePlacementBase for ATLAS.
TrackingGeometryVisitor to load the aligned surface and volume transforms into the DetectorAlignStore...
unsigned alignedObjects() const
Returns how many transforms have been written into the store.
StatusCode buildDetrayGeometry()
Converts the built Acts::TrackingGeometry into a Detray geometry and stores it in m_detrayGeometry.
Gaudi::Property< std::vector< size_t > > m_endcapMaterialBins
const TRT_ID * m_TRT_idHelper
Gaudi::Property< std::vector< unsigned int > > m_itkStripBarrelNeighborWindow
StatusCode finalize() override
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry
const InDetDD::TRT_DetectorManager * p_TRTManager
bool runConsistencyChecks() const
Gaudi::Property< std::vector< std::string > > m_buildSubdetectors
Gaudi::Property< std::vector< unsigned int > > m_itkPixelInnerBarrelNeighborWindow
Most bins the surface array lookup serves on each side of the crossing, as {phi, z}...
const traccc::host_detector * detrayGeometry() const override
Returns the Detray geometry converted from the Acts::TrackingGeometry, or nullptr if none was built.
Gaudi::Property< bool > m_keepGoingOnMaterialMergeFailure
Gaudi::Property< std::vector< unsigned int > > m_itkPixelOuterBarrelNeighborWindow
Gaudi::Property< std::vector< unsigned int > > m_itkStripEndcapNeighborWindow
ActsTrk::GeometryContext m_nominalContext
Gaudi::Property< std::vector< float > > m_passiveITkInnerPixelBarrelLayerThickness
Gaudi::Property< bool > m_useBlueprint
ActsLayerBuilder::Config makeLayerBuilderConfig(const InDetDD::InDetDetectorManager *manager)
StatusCode initialize() override
Gaudi::Property< bool > m_buildDetrayGeometry
const InDetDD::SiDetectorManager * p_ITkStripManager
std::set< ActsTrk::DetectorType > m_subDetNoAlign
Gaudi::Property< std::vector< unsigned int > > m_subDetNoAlignProp
Define the subdetectors for which the tracking geometry does not expect a valid alignment store.
unsigned int populateAlignmentStore(ActsTrk::DetectorAlignStore &store) const override
Loops through the volumes of the tracking geometry and caches the aligned transforms in the store.
Gaudi::Property< std::vector< float > > m_passiveITkOuterPixelBarrelLayerThickness
ToolHandleArray< ActsTrk::IRefineTrackingGeoTool > m_refineVisitors
Gaudi::Property< std::vector< float > > m_passiveITkOuterPixelBarrelLayerHalflengthZ
Gaudi::Property< bool > m_checkDetrayGeometry
Acts::CylinderVolumeBuilder::Config makeBeamPipeConfig(std::shared_ptr< const Acts::CylinderVolumeHelper > cvh) const
BooleanProperty m_runConsistencyChecks
Gaudi::Property< std::vector< unsigned int > > m_itkPixelOuterEndcapNeighborWindow
Gaudi::Property< std::vector< float > > m_passiveITkStripBarrelLayerRadii
Gaudi::Property< bool > m_buildBeamPipe
Gaudi::Property< std::string > m_materialMapCalibFolder
ToolHandle< AthDevice::IMemoryResourceTool > m_hostMR
Tool providing the memory resource that the Detray geometry is allocated from.
Gaudi::Property< std::vector< float > > m_passiveITkStripBarrelLayerThickness
const BeamPipeDetectorManager * p_beamPipeMgr
std::shared_ptr< const Acts::ILayerBuilder > makeHGTDLayerBuilder(const HGTD_DetectorManager *manager)
Gaudi::Property< bool > m_buildDetraySurfaceGrids
Gaudi::Property< double > m_numberOfHgtdBinsFactor
Special treatment for hgtd layers as well.
std::unique_ptr< const ActsTrk::DetectorElementToActsGeometryIdMap > m_detIdMap
Gaudi::Property< bool > m_printGeo
Print the assembled tracking geometry after building.
Gaudi::Property< std::string > m_materialMapInputFileBase
Gaudi::Property< unsigned int > m_surfaceArrayOverfill
Extra cells per direction and axis that each surface fills around its footprint.
Gaudi::Property< std::vector< float > > m_passiveITkInnerPixelBarrelLayerRadii
the specifications for building additional passive cylinders in the barrel region: for each cylinder ...
const ActsTrk::GeometryContext & getNominalContext() const override
Returns an empty nominal context without any alignment caches.
std::shared_ptr< const Acts::ILayerBuilder > makeStrawLayerBuilder(const InDetDD::InDetDetectorManager *manager)
Gaudi::Property< std::vector< size_t > > m_barrelMaterialBins
ToolHandleArray< ActsTrk::IBlueprintNodeBuilder > m_blueprintNodeBuilders
virtual const ActsTrk::DetectorElementToActsGeometryIdMap * surfaceIdMap() const override
Returns the pointer to the identifier mapping between Acts::surface ID & IdentifierHash of the ITk su...
ToolHandle< IActsTrackingVolumeBuilder > m_caloVolumeBuilder
const InDetDD::SiDetectorManager * p_SCTManager
std::unique_ptr< ActsTrk::DetectorElementToActsGeometryIdMap > createDetectorElementToGeoIdMap() const
Creates and popules the DetectorElement -> Acts::Surface geo identifier map from the geometry service...
Gaudi::Property< bool > m_useMaterialMap
~TrackingGeometrySvc() override
const HGTD_DetectorManager * p_HGTDManager
StringProperty m_consistencyCheckOutput
Gaudi::Property< size_t > m_consistencyCheckPoints
std::shared_ptr< const Acts::TrackingGeometry > trackingGeometry() const override
Returns a pointer to the internal ACTS tracking geometry.
std::unique_ptr< traccc::host_detector > m_detrayGeometry
Gaudi::Property< std::vector< float > > m_passiveITkOuterPixelBarrelLayerRadii
const Acts::TrackingVolume * getEnvelope(const ActsTrk::SystemEnvelope envType) const override
Returns the envelope volume from the tracking geometry that's containing all volumes of the subsystem...
Gaudi::Property< std::vector< float > > m_passiveITkInnerPixelBarrelLayerHalflengthZ
std::shared_ptr< ActsElementVector > m_elementStore
Gaudi::Property< std::vector< float > > m_passiveITkStripBarrelLayerHalflengthZ
Gaudi::Property< bool > m_objDebugOutput
const HGTD_ID * m_HGTD_idHelper
TrackingGeometrySvc(const std::string &name, ISvcLocator *pSvcLocator)
ServiceHandle< StoreGateSvc > m_detStore
Gaudi::Property< double > m_numberOfBinsFactor
controls how many bins are created for the sensitive surface grid.
Gaudi::Property< bool > m_buildDetrayMaterial
Gaudi::Property< std::vector< unsigned int > > m_itkPixelInnerEndcapNeighborWindow
const InDetDD::SiDetectorManager * p_ITkPixelManager
const InDetDD::SiDetectorManager * p_pixelManager
std::shared_ptr< Acts::TrackingVolume > makeSCTTRTAssembly(const Acts::GeometryContext &gctx, const Acts::ILayerBuilder &sct_lb, const Acts::ILayerBuilder &trt_lb, const Acts::CylinderVolumeHelper &cvh, const std::shared_ptr< const Acts::TrackingVolume > &pixel)
The Detector manager has methods to retrieve the Identifier helper and methods to retrieve the detect...
Virtual base class for all ID detector managers.
Class to hold geometrical description of a silicon detector element.
Base class for Pixel and SCT Detector managers.
Trk::Surface & surface()
Element Surface.
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
static Root::TMsgLogger logger("iLumiCalc")
Define the volume parts of the GeometryIdentifier for each ATLAS subsystem centrally.
constexpr std::size_t s_hgtdEnvelopeId
constexpr std::size_t s_hgtdNegVolumeId
constexpr std::size_t s_caloEnvelopeID
Volume Ids ofthe Calorimeter.
constexpr std::size_t s_hgtdPosVolumeId
HGTD volume IDs.
constexpr std::size_t s_beamPipeVolumeId
constexpr std::size_t s_ITkEnvelopeId
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
@ Mm
Maybe not needed in the migration.
@ Tgc
Resitive Plate Chambers.
@ Rpc
Monitored Drift Tubes.
@ UnDefined
Small Thing Gap chambers (NSW).
DetectorElementKey makeDetectorElementKey(xAOD::UncalibMeasType meas_type, unsigned int identifier_hash)
Acts::Logging::Level actsLevelVector(MSG::Level lvl)
SystemEnvelope
Define an enumeration to retrieve the envelope tracking volume from.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Acts::GeometryIdentifier volumeId(const Acts::Surface &surface)
Returns the identifier of the volume in which the surface is embedded.
UncalibMeasType
Define the type of the uncalibrated measurement.
nested configuration struct for steering of the layer builder
nested configuration struct for steering of the layer builder
static DetectorElementGeoInfo makeValue(const Acts::GeometryIdentifier &geo_id, const Acts::Surface *surface=nullptr)