26 std::unique_ptr<const Acts::Logger>
logger)
29 std::vector<std::shared_ptr<const Acts::TGeoDetectorElement>>
32 std::shared_ptr<const Acts::TGeoDetectorElement> tgde)
const {
35 auto tgIdentifier = tgde->identifier();
36 const TGeoNode& tgNode = tgde->tgeoNode();
40 if (
m_cfg.discPhiSegments > 0 or
m_cfg.discRadialSegments > 0) {
44 ACTS_DEBUG(
"- splitting detected for a Disc shaped sensor.");
46 std::vector<std::shared_ptr<const Acts::TGeoDetectorElement>>
47 tgDetectorElements = {};
48 tgDetectorElements.reserve(std::abs(
m_cfg.discPhiSegments) *
49 std::abs(
m_cfg.discRadialSegments));
58 ActsScalar cosPhiHalf = std::cos(0.5 * phiStep);
59 ActsScalar sinPhiHalf = std::sin(0.5 * phiStep);
61 std::vector<ActsScalar> radialValues = {};
62 if (
m_cfg.discRadialSegments > 1) {
64 radialValues.reserve(
m_cfg.discRadialSegments);
65 for (
int ir = 0; ir <=
m_cfg.discRadialSegments; ++ir) {
66 radialValues.push_back(discMinR + ir * rStep);
69 radialValues = {discMinR, discMaxR};
72 for (
size_t ir = 1; ir < radialValues.size(); ++ir) {
85 std::make_shared<Acts::TrapezoidBounds>(hXminY, hXmaxY, hY);
87 for (
int im = 0; im <
m_cfg.discPhiSegments; ++im) {
93 AngleAxis3(phi - 0.5 * M_PI, Vector3::UnitZ()));
96 auto tgDetectorElement = std::make_shared<Acts::TGeoDetectorElement>(
97 tgIdentifier, tgNode, tgTransform, tgTrapezoid, tgThickness);
99 tgDetectorElements.push_back(tgDetectorElement);
103 return tgDetectorElements;
108 if (
m_cfg.cylinderPhiSegments > 0 or
m_cfg.cylinderLongitudinalSegments > 0) {
111 ACTS_DEBUG(
"- splitting detected for a Cylinder shaped sensor.");
113 std::vector<std::shared_ptr<const Acts::TGeoDetectorElement>>
114 tgDetectorElements = {};
115 tgDetectorElements.reserve(std::abs(
m_cfg.cylinderPhiSegments) *
116 std::abs(
m_cfg.cylinderLongitudinalSegments));
124 ActsScalar cosPhiHalf = std::cos(0.5 * phiStep);
125 ActsScalar sinPhiHalf = std::sin(0.5 * phiStep);
127 std::vector<ActsScalar> zValues = {};
128 if (
m_cfg.cylinderLongitudinalSegments > 1) {
130 2 * cylinderHalfZ /
m_cfg.cylinderLongitudinalSegments;
131 zValues.reserve(
m_cfg.cylinderLongitudinalSegments);
132 for (
int ir = 0; ir <=
m_cfg.cylinderLongitudinalSegments; ++ir) {
133 zValues.push_back(-cylinderHalfZ + ir * zStep);
136 zValues = {-cylinderHalfZ, cylinderHalfZ};
140 ActsScalar planeHalfX = cylinderR * sinPhiHalf;
142 for (
size_t iz = 1; iz < zValues.size(); ++iz) {
150 std::make_shared<Acts::RectangleBounds>(planeHalfX, planeHalfY);
152 for (
int im = 0; im <
m_cfg.cylinderPhiSegments; ++im) {
166 planeRotation.col(0) = planeAxisX;
167 planeRotation.col(1) = planeAxisY;
168 planeRotation.col(2) = planeAxisZ;
172 planeTransform.pretranslate(planeCenter);
177 auto tgDetectorElement = std::make_shared<Acts::TGeoDetectorElement>(
178 tgIdentifier, tgNode, tgTransform, tgRectangle, tgThickness);
180 tgDetectorElements.push_back(tgDetectorElement);
183 return tgDetectorElements;