Skip to content

Commit

Permalink
refactor!: Remove implicit default layer from CuboidVolumeBuilder (#…
Browse files Browse the repository at this point in the history
…2681)

This is a pitfall and does not allow to build volumes without layers
  • Loading branch information
andiwand authored Dec 16, 2023
1 parent eeec852 commit 2dbf768
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
24 changes: 0 additions & 24 deletions Core/src/Geometry/CuboidVolumeBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,30 +152,6 @@ std::shared_ptr<Acts::TrackingVolume> Acts::CuboidVolumeBuilder::buildVolume(
auto bounds = std::make_shared<const CuboidVolumeBounds>(
cfg.length.x() * 0.5, cfg.length.y() * 0.5, cfg.length.z() * 0.5);

if (cfg.layerCfg.empty()) {
// Build dummy layer if no layer is given (tmp solution)
SurfaceConfig sCfg;
sCfg.position = cfg.position;
// Rotation of the surfaces: +pi/2 around axis y
Vector3 xPos(0., 0., 1.);
Vector3 yPos(0., 1., 0.);
Vector3 zPos(-1., 0., 0.);
sCfg.rotation.col(0) = xPos;
sCfg.rotation.col(1) = yPos;
sCfg.rotation.col(2) = zPos;
// Bounds
sCfg.rBounds = std::make_shared<const RectangleBounds>(
RectangleBounds(cfg.length.y() * 0.5, cfg.length.z() * 0.5));

LayerConfig lCfg;
lCfg.surfaceCfg = {sCfg};
lCfg.envelopeX = {0.1 * UnitConstants::mm, 0.1 * UnitConstants::mm};
lCfg.envelopeY = {0.1 * UnitConstants::mm, 0.1 * UnitConstants::mm};
lCfg.envelopeZ = {0.1 * UnitConstants::mm, 0.1 * UnitConstants::mm};

cfg.layerCfg.push_back(lCfg);
}

// Gather the layers
LayerVector layVec;
if (cfg.layers.empty()) {
Expand Down
2 changes: 1 addition & 1 deletion Core/src/Geometry/LayerArrayCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ std::unique_ptr<const Acts::LayerArray> Acts::LayerArrayCreator::layerArray(
double navigationValue =
0.5 * (boundaries.at(boundaries.size() - 1) + max);
// create navigation layer only when necessary
if (navigationValue != max) {
if (navigationValue != max && lastLayer != nullptr) {
// create the navigation layer surface from the layer
std::shared_ptr<const Surface> navLayerSurface =
createNavigationSurface(gctx, *lastLayer, bValue,
Expand Down

0 comments on commit 2dbf768

Please sign in to comment.