Build the BeamPipe Blueprint Node.
52 {
53
54
55 if (child) {
56 ATH_MSG_ERROR(
"BeamPipeBlueprintNodeBuilder expects no child node");
57 throw std::runtime_error("Child node is not null");
58 }
59
60
61
62
65
67
68
69
70
73 beamPipeTopVolume =
75 }
76
77
78
79 beamPipeTransform =
81
82
83 const GeoLogVol* beamPipeLogVolume = beamPipeTopVolume->getLogVol();
84 if (beamPipeLogVolume == nullptr) {
86 throw std::runtime_error("Beam pipe volume has no log volume");
87 }
88
89 const GeoTube* beamPipeTube =
90 dynamic_cast<const GeoTube*>(beamPipeLogVolume->getShape());
91 if (beamPipeTube == nullptr) {
93 throw std::runtime_error{"BeamPipeLogVolume was not of type GeoTube"};
94 }
95
96
97
98 for (
unsigned int i = 0;
i < beamPipeTopVolume->getNChildVols();
i++) {
99 if (beamPipeTopVolume->getNameOfChildVol(i) != "SectionC03") {
100 continue;
101 }
102 PVConstLink childTopVolume = beamPipeTopVolume->getChildVol(i);
103 const GeoLogVol* childLogVolume = childTopVolume->getLogVol();
104 const GeoTube* childTube =
105 dynamic_cast<const GeoTube*>(childLogVolume->getShape());
106 if (childTube) {
107 beamPipeRadius = 0.5 * (childTube->getRMax() + childTube->getRMin());
108 break;
109 }
110 }
111
113 "BeamPipe constructed from database with radius = " << beamPipeRadius);
115 "BeamPipe shift : " << beamPipeTransform.translation().transpose());
116 } else {
118 "BeamPipe constructed from default parameters with radius = "
119 << beamPipeRadius);
121 "BeamPipe shift : " << beamPipeTransform.translation().transpose());
122 }
123
124
125
126
127
128
129 auto beamPipeNode =
130 std::make_shared<Acts::Experimental::GeometryIdentifierBlueprintNode>();
132
133 auto& beamPipeContainer =
134 beamPipeNode->addCylinderContainer("BeamPipeContainer", AxisR);
135 beamPipeContainer.setAttachmentStrategy(AttachmentStrategy::Gap);
136 beamPipeContainer.setResizeStrategy(ResizeStrategy::Gap);
137
138 beamPipeContainer.addMaterial("BeamPipe_Material", [&](auto& mat) {
139
140 mat.configureFace(OuterCylinder, {AxisRPhi, Closed, 20},
141 {AxisZ, Bound, 20});
142
143 mat.addStaticVolume(beamPipeTransform,
144 std::make_shared<Acts::CylinderVolumeBounds>(
145 0, beamPipeRadius * 1_mm, 3. * 1_m),
146 "BeamPipeVolume");
147 });
148
149 return beamPipeNode;
150}
#define ATH_MSG_VERBOSE(x)
Gaudi::Property< double > m_defaultInnerRadius
const BeamPipeDetectorManager * m_beamPipeMgr
Gaudi::Property< bool > m_loadfromDatabase
constexpr std::size_t s_beamPipeVolumeId
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis
Eigen::Affine3d Transform3D