15 #include "DD4hep/CartesianGridXZ.h"
21 double halflengthX,
double halflengthZ,
double thickness,
25 halflengthX *= scalor;
26 halflengthZ *= scalor;
29 std::make_shared<const Acts::RectangleBounds>(halflengthX, halflengthZ);
30 dd4hep::CartesianGridXZ cartesianGrid = segmentation;
31 if (cartesianGrid.isValid()) {
33 double gridSizeX = cartesianGrid.gridSizeX() * scalor;
34 double gridSizeZ = cartesianGrid.gridSizeZ() * scalor;
36 (cartesianGrid.gridSizeX() != 0) ? (2 * halflengthX) / gridSizeX : 0;
38 (cartesianGrid.gridSizeZ() != 0) ? (2 * halflengthZ) / gridSizeZ : 0;
40 std::shared_ptr<const Acts::CartesianSegmentation> actsSegmentation =
41 std::make_shared<const Acts::CartesianSegmentation>(bounds, bins0,
45 return (std::make_shared<const Acts::DigitizationModule>(actsSegmentation,
52 double halflengthX,
double halflengthZ,
double thickness,
double gridSizeX,
56 halflengthX *= scalor;
57 halflengthZ *= scalor;
60 std::make_shared<const Acts::RectangleBounds>(halflengthX, halflengthZ);
63 (gridSizeX != 0) ? (2 * halflengthX) / (gridSizeX * scalor) : 0;
65 (gridSizeZ != 0) ? (2 * halflengthZ) / (gridSizeZ * scalor) : 0;
67 std::shared_ptr<const Acts::CartesianSegmentation> actsSegmentation =
68 std::make_shared<const Acts::CartesianSegmentation>(bounds, bins0, bins1);
72 return (std::make_shared<const Acts::DigitizationModule>(actsSegmentation,
77 double minHalflengthX,
double maxHalflengthX,
double halflengthZ,
81 minHalflengthX *= scalor;
82 maxHalflengthX *= scalor;
83 halflengthZ *= scalor;
86 auto bounds = std::make_shared<const Acts::TrapezoidBounds>(
87 minHalflengthX, maxHalflengthX, halflengthZ);
89 dd4hep::CartesianGridXZ cartesianGrid = segmentation;
90 if (cartesianGrid.isValid()) {
92 double gridSizeX = cartesianGrid.gridSizeX() * scalor;
93 double gridSizeZ = cartesianGrid.gridSizeZ() * scalor;
95 (cartesianGrid.gridSizeX() != 0) ? (2 * maxHalflengthX) / gridSizeX : 0;
97 (cartesianGrid.gridSizeZ() != 0) ? (2 * halflengthZ) / gridSizeZ : 0;
99 std::shared_ptr<const Acts::CartesianSegmentation> actsSegmentation =
100 std::make_shared<const Acts::CartesianSegmentation>(bounds, bins0,
104 return (std::make_shared<const Acts::DigitizationModule>(actsSegmentation,
111 double minHalflengthX,
double maxHalflengthX,
double halflengthZ,
112 double thickness,
double gridSizeX,
double gridSizeZ) {
115 minHalflengthX *= scalor;
116 maxHalflengthX *= scalor;
117 halflengthZ *= scalor;
120 auto bounds = std::make_shared<const Acts::TrapezoidBounds>(
121 minHalflengthX, maxHalflengthX, halflengthZ);
125 (gridSizeX != 0) ? (2 * maxHalflengthX) / (gridSizeX * scalor) : 0;
127 (gridSizeZ != 0) ? (2 * halflengthZ) / (gridSizeZ * scalor) : 0;
129 std::shared_ptr<const Acts::CartesianSegmentation> actsSegmentation =
130 std::make_shared<const Acts::CartesianSegmentation>(bounds, bins0, bins1);
133 return (std::make_shared<const Acts::DigitizationModule>(actsSegmentation,
138 const std::string& nodeName,
139 const std::string& attrName,
140 const std::string& attrValue) {
141 for (dd4hep::xml::Collection_t xCompColl(mother, nodeName.c_str());
142 nullptr != xCompColl; ++xCompColl) {
143 if (xCompColl.attr<std::string>(attrName.c_str()) == attrValue) {
144 return static_cast<dd4hep::xml::Component
>(xCompColl);
148 return dd4hep::xml::Component(
nullptr);
152 const std::string& attrName,
153 const double& defaultValue) {
154 if (node.hasAttr(_Unicode(attrName.c_str()))) {
155 return node.attr<
double>(attrName.c_str());