Skip to content

Commit

Permalink
implemented comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Jonas Berggren committed Sep 11, 2024
1 parent ab456fa commit f1feeb2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Plugins/GeoModel/src/GeoModelToDetectorVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace Acts::GeoModel {
Volume convertVolume(const Transform3& trf, const GeoShape& shape) {
std::shared_ptr<const VolumeBounds> bounds;
std::shared_ptr<VolumeBounds> bounds;
GeoTrf::Transform3D newTrf = trf;
if (shape.typeID() == GeoTube::getClassTypeID()) {
const GeoTube* tube = dynamic_cast<const GeoTube*>(&shape);
Expand All @@ -44,7 +44,7 @@ Volume convertVolume(const Transform3& trf, const GeoShape& shape) {
newTrf = trf * GeoTrf::RotateZ3D(tubs->getSPhi() + 0.5 * tubs->getDPhi());
} else if (shape.typeID() == GeoBox::getClassTypeID()) {
const GeoBox* box = dynamic_cast<const GeoBox*>(&shape);
bounds = std::make_shared<const CuboidVolumeBounds>(
bounds = std::make_shared<CuboidVolumeBounds>(
box->getXHalfLength(), box->getYHalfLength(), box->getZHalfLength());
} else if (shape.typeID() == GeoTrd::getClassTypeID()) {
const GeoTrd* trd = dynamic_cast<const GeoTrd*>(&shape);
Expand Down Expand Up @@ -121,7 +121,6 @@ Volume convertVolume(const Transform3& trf, const GeoShape& shape) {
} else {
throw std::runtime_error("FATAL: Unsupported GeoModel shape");
}

return Volume(newTrf, bounds);
}

Expand All @@ -140,8 +139,7 @@ std::shared_ptr<Experimental::DetectorVolume> convertDetectorVolume(
Volume vol = convertVolume(transform, shape);
// TODO change the casting //
return Experimental::DetectorVolumeFactory::construct(
portalGenerator, context, name, vol.transform(),
std::const_pointer_cast<VolumeBounds>(vol.volumeBoundsPtr()),
portalGenerator, context, name, vol.transform(), vol.volumeBoundsPtr(),
sensSurfaces,
std::vector<std::shared_ptr<Acts::Experimental::DetectorVolume>>{},
Experimental::tryNoVolumes(), Experimental::tryAllPortalsAndSurfaces());
Expand Down

0 comments on commit f1feeb2

Please sign in to comment.