19 #include <DD4hep/CartesianGridXZ.h>
20 #include <DD4hep/Segmentations.h>
21 #include <XML/XMLTags.h>
27 double halflengthX,
double halflengthZ,
double thickness,
31 halflengthX *= scalor;
32 halflengthZ *= scalor;
35 std::make_shared<const Acts::RectangleBounds>(halflengthX, halflengthZ);
36 dd4hep::CartesianGridXZ cartesianGrid = segmentation;
37 if (cartesianGrid.isValid()) {
39 double gridSizeX = cartesianGrid.gridSizeX() * scalor;
40 double gridSizeZ = cartesianGrid.gridSizeZ() * scalor;
41 size_t bins0 = (cartesianGrid.gridSizeX() != 0)
42 ? static_cast<size_t>((2 * halflengthX) / gridSizeX)
44 size_t bins1 = (cartesianGrid.gridSizeZ() != 0)
45 ? static_cast<size_t>((2 * halflengthZ) / gridSizeZ)
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,
60 double halflengthX,
double halflengthZ,
double thickness,
double gridSizeX,
64 halflengthX *= scalor;
65 halflengthZ *= scalor;
68 std::make_shared<const Acts::RectangleBounds>(halflengthX, halflengthZ);
72 ? static_cast<size_t>((2 * halflengthX) / (gridSizeX * scalor))
76 ? static_cast<size_t>((2 * halflengthZ) / (gridSizeZ * scalor))
79 std::shared_ptr<const Acts::CartesianSegmentation> actsSegmentation =
80 std::make_shared<const Acts::CartesianSegmentation>(
bounds, bins0, bins1);
84 return (std::make_shared<const Acts::DigitizationModule>(actsSegmentation,
89 double minHalflengthX,
double maxHalflengthX,
double halflengthZ,
93 minHalflengthX *= scalor;
94 maxHalflengthX *= scalor;
95 halflengthZ *= scalor;
98 auto bounds = std::make_shared<const Acts::TrapezoidBounds>(
99 minHalflengthX, maxHalflengthX, halflengthZ);
101 dd4hep::CartesianGridXZ cartesianGrid = segmentation;
102 if (cartesianGrid.isValid()) {
104 double gridSizeX = cartesianGrid.gridSizeX() * scalor;
105 double gridSizeZ = cartesianGrid.gridSizeZ() * scalor;
106 size_t bins0 = (cartesianGrid.gridSizeX() != 0)
107 ? static_cast<size_t>((2 * maxHalflengthX) / gridSizeX)
109 size_t bins1 = (cartesianGrid.gridSizeZ() != 0)
110 ? static_cast<size_t>((2 * halflengthZ) / gridSizeZ)
113 std::shared_ptr<const Acts::CartesianSegmentation> actsSegmentation =
114 std::make_shared<const Acts::CartesianSegmentation>(
bounds, bins0,
118 return (std::make_shared<const Acts::DigitizationModule>(actsSegmentation,
125 double minHalflengthX,
double maxHalflengthX,
double halflengthZ,
126 double thickness,
double gridSizeX,
double gridSizeZ) {
129 minHalflengthX *= scalor;
130 maxHalflengthX *= scalor;
131 halflengthZ *= scalor;
134 auto bounds = std::make_shared<const Acts::TrapezoidBounds>(
135 minHalflengthX, maxHalflengthX, halflengthZ);
140 ? static_cast<size_t>((2 * maxHalflengthX) / (gridSizeX * scalor))
144 ? static_cast<size_t>((2 * halflengthZ) / (gridSizeZ * scalor))
147 std::shared_ptr<const Acts::CartesianSegmentation> actsSegmentation =
148 std::make_shared<const Acts::CartesianSegmentation>(
bounds, bins0, bins1);
151 return (std::make_shared<const Acts::DigitizationModule>(actsSegmentation,
159 for (dd4hep::xml::Collection_t xCompColl(mother, nodeName.c_str());
160 nullptr != xCompColl; ++xCompColl) {
161 if (xCompColl.attr<
std::string>(attrName.c_str()) == attrValue) {
162 return static_cast<dd4hep::xml::Component
>(xCompColl);
166 return dd4hep::xml::Component(
nullptr);
171 const double& defaultValue) {
172 if (node.hasAttr(_Unicode(attrName.c_str()))) {
173 return node.attr<
double>(attrName.c_str());