Skip to content

Commit

Permalink
format yet again
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Harris committed Jul 4, 2024
1 parent 35fbd02 commit 7c7c3c3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ class GeoMaterial;
namespace Acts {

namespace GeoModel {
/// @brief Convert GeoMaterial to Acts::Material
///
/// @param gm The GeoMaterial to be converted
/// @return the Acts::Material
Material geoMaterialConverter(const GeoMaterial* gm, bool useMolarDensity = true);
/// @brief Convert GeoMaterial to Acts::Material
///
/// @param gm The GeoMaterial to be converted
/// @return the Acts::Material
Material geoMaterialConverter(const GeoMaterial* gm,
bool useMolarDensity = true);

} // namespace GeoModel
} // namespace Acts
4 changes: 2 additions & 2 deletions Plugins/GeoModel/src/GeoModelMaterialConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
namespace {
constexpr double s_densityCnvFactor = 1. / GeoModelKernelUnits::gram;
}
Acts::Material Acts::GeoModel::geoMaterialConverter(
const GeoMaterial* gm, bool useMolarDensity) {
Acts::Material Acts::GeoModel::geoMaterialConverter(const GeoMaterial* gm,
bool useMolarDensity) {
double x0 = gm->getRadLength();
double l0 = gm->getIntLength();
double density = gm->getDensity() * s_densityCnvFactor;
Expand Down
26 changes: 18 additions & 8 deletions Plugins/GeoModel/src/GeoModelToDetVol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,17 @@ void convertVolume(
std::make_shared<CylinderVolumeBounds>(tubs->getRMin(), tubs->getRMax(),
tubs->getZHalfLength(),
tubs->getDPhi() / 2);
GeoTrf::Transform3D newTransform = transform * GeoTrf::RotateZ3D(tubs->getSPhi() + 0.5 * tubs->getDPhi());
GeoTrf::Transform3D newTransform =
transform * GeoTrf::RotateZ3D(tubs->getSPhi() + 0.5 * tubs->getDPhi());
volumes.emplace_back(Experimental::DetectorVolumeFactory::construct(
portalGenerator, context, name, newTransform, bounds,
Experimental::tryAllPortalsAndSurfaces()));
} else if (shape->typeID() == GeoBox::getClassTypeID()) {
const GeoBox* box = static_cast<const GeoBox*>(shape);
std::shared_ptr<CuboidVolumeBounds> bounds =
std::make_shared<CuboidVolumeBounds>(
box->getXHalfLength(), box->getYHalfLength(), box->getZHalfLength());
std::make_shared<CuboidVolumeBounds>(box->getXHalfLength(),
box->getYHalfLength(),
box->getZHalfLength());
volumes.emplace_back(Experimental::DetectorVolumeFactory::construct(
portalGenerator, context, name, transform, bounds,
Experimental::tryAllPortalsAndSurfaces()));
Expand Down Expand Up @@ -84,15 +86,18 @@ void convertVolume(
std::shared_ptr<TrapezoidVolumeBounds> bounds =
std::make_shared<TrapezoidVolumeBounds>(x1, x2, z, y1);
constexpr double rotationAngle = M_PI / 2;
GeoTrf::Transform3D newTransform = transform * GeoTrf::RotateX3D(rotationAngle);
GeoTrf::Transform3D newTransform =
transform * GeoTrf::RotateX3D(rotationAngle);
volumes.emplace_back(Experimental::DetectorVolumeFactory::construct(
portalGenerator, context, name, newTransform, bounds,
Experimental::tryAllPortalsAndSurfaces()));
} else {
std::shared_ptr<TrapezoidVolumeBounds> bounds =
std::make_shared<TrapezoidVolumeBounds>(x2, x1, z, y1);
constexpr double rotationAngle = M_PI;
GeoTrf::Transform3D newTransform = transform * GeoTrf::RotateY3D(rotationAngle) * GeoTrf::RotateZ3D(rotationAngle);
GeoTrf::Transform3D newTransform = transform *
GeoTrf::RotateY3D(rotationAngle) *
GeoTrf::RotateZ3D(rotationAngle);
volumes.emplace_back(Experimental::DetectorVolumeFactory::construct(
portalGenerator, context, name, newTransform, bounds,
Experimental::tryAllPortalsAndSurfaces()));
Expand All @@ -102,15 +107,20 @@ void convertVolume(
std::shared_ptr<TrapezoidVolumeBounds> bounds =
std::make_shared<TrapezoidVolumeBounds>(y1, y2, z, x1);
auto rotationAngle = M_PI / 2;
GeoTrf::Transform3D newTransform = transform * GeoTrf::RotateZ3D(rotationAngle) * GeoTrf::RotateX3D(rotationAngle);
GeoTrf::Transform3D newTransform = transform *
GeoTrf::RotateZ3D(rotationAngle) *
GeoTrf::RotateX3D(rotationAngle);
volumes.emplace_back(Experimental::DetectorVolumeFactory::construct(
portalGenerator, context, name, newTransform, bounds,
Experimental::tryAllPortalsAndSurfaces()));
} else {
std::shared_ptr<TrapezoidVolumeBounds> bounds =
std::make_shared<TrapezoidVolumeBounds>(y2, y1, z, x1);
auto rotationAngle = M_PI;
GeoTrf::Transform3D newTransform = transform * GeoTrf::RotateX3D(rotationAngle) * GeoTrf::RotateZ3D(rotationAngle / 2) * GeoTrf::RotateX3D(rotationAngle / 2);
GeoTrf::Transform3D newTransform =
transform * GeoTrf::RotateX3D(rotationAngle) *
GeoTrf::RotateZ3D(rotationAngle / 2) *
GeoTrf::RotateX3D(rotationAngle / 2);
volumes.emplace_back(Experimental::DetectorVolumeFactory::construct(
portalGenerator, context, name, newTransform, bounds,
Experimental::tryAllPortalsAndSurfaces()));
Expand Down Expand Up @@ -146,7 +156,7 @@ void convertVolume(
if (shape->typeID() == GeoShapeShift::getClassTypeID()) {
const GeoShapeShift* shiftShape = static_cast<const GeoShapeShift*>(shape);
const GeoShape* shapeOp = shiftShape->getOp();
GeoTrf::Transform3D newTransform = transform * shiftShape->getX();
GeoTrf::Transform3D newTransform = transform * shiftShape->getX();
convertVolume(context, shapeOp, name, newTransform, volumes);
}
}
Expand Down

0 comments on commit 7c7c3c3

Please sign in to comment.