19 #include "DD4hep/CartesianGridXY.h"
20 #include "DD4hep/Segmentations.h"
22 using namespace ActsExamples::DD4hep;
24 std::shared_ptr<const Acts::DigitizationModule>
26 double halflengthX,
double halflengthY,
double thickness,
30 halflengthX *= scalor;
31 halflengthY *= scalor;
35 std::make_shared<const Acts::RectangleBounds>(halflengthX, halflengthY);
36 dd4hep::CartesianGridXY cartesianGrid = segmentation;
37 if (cartesianGrid.isValid()) {
39 double gridSizeX = cartesianGrid.gridSizeX() * scalor;
40 double gridSizeY = cartesianGrid.gridSizeY() * scalor;
41 size_t bins0 = (cartesianGrid.gridSizeX() != 0)
42 ? static_cast<size_t>((2 * halflengthX) / gridSizeX)
44 size_t bins1 = (cartesianGrid.gridSizeY() != 0)
45 ? static_cast<size_t>((2 * halflengthY) / gridSizeY)
48 std::shared_ptr<const Acts::CartesianSegmentation> actsSegmentation =
49 std::make_shared<const Acts::CartesianSegmentation>(
bounds, bins0,
53 return (std::make_shared<const Acts::DigitizationModule>(actsSegmentation,
59 std::shared_ptr<const Acts::DigitizationModule>
61 double minHalflengthX,
double maxHalflengthX,
double halflengthY,
65 minHalflengthX *= scalor;
66 maxHalflengthX *= scalor;
67 halflengthY *= scalor;
70 auto bounds = std::make_shared<const Acts::TrapezoidBounds>(
71 minHalflengthX, maxHalflengthX, halflengthY);
73 dd4hep::CartesianGridXY cartesianGrid = segmentation;
74 if (cartesianGrid.isValid()) {
76 double gridSizeX = cartesianGrid.gridSizeX() * scalor;
77 double gridSizeY = cartesianGrid.gridSizeY() * scalor;
78 size_t bins0 = (cartesianGrid.gridSizeX() != 0)
79 ? static_cast<size_t>((2 * maxHalflengthX) / gridSizeX)
81 size_t bins1 = (cartesianGrid.gridSizeY() != 0)
82 ? static_cast<size_t>((2 * halflengthY) / gridSizeY)
85 std::shared_ptr<const Acts::CartesianSegmentation> actsSegmentation =
86 std::make_shared<const Acts::CartesianSegmentation>(
bounds, bins0,
90 return (std::make_shared<const Acts::DigitizationModule>(actsSegmentation,