Details
-
Improvement
-
Status: Done (View Workflow)
-
High
-
Resolution: Done
-
None
-
None
Description
Converting Geant4 geometries to be used in VecGeom navigation, we (Sandro) chose to implement some reflections using UnplacedScaledShape:
if (auto p = dynamic_cast<G4ReflectedSolid const *>(shape)) {
auto t = p->GetDirectTransform3D();
if (t.getTranslation().mag2() == 0. && (t.xx() == -1. || t.yy() == -1. || t.zz() == -1.))
Unknown macro: { VUnplacedVolume *referenced_shape = Convert(p->GetConstituentMovedSolid()); unplaced_volume = GeoManager}...
}
When it's implementation of safety is called, a point is transformed to the coordinate system of the original solid. But when transforming the answer back, the result multiplies by fSclMaster which is -1 (that's likely for all pure reflections).
And the resulting value becomes negative, which is not correct.
I observed this only for ScaledShapeImplementation::SafetyToOut, as I call only this, but it seems clear that it applies also to ScaledShapeImplementation::SafetyToIn.