Uploaded image for project: 'VecGeom'
  1. VecGeom
  2. VECGEOM-570

Using UnplacedScaledShape to implement G4ReflectedSolid gives negative safety

    XMLWordPrintable

Details

    • Improvement
    • Status: Done (View Workflow)
    • High
    • Resolution: Done
    • None
    • 2022/06
    • volumes
    • 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.

       

      Attachments

        Activity

          People

            agheata Andrei Gheata
            japost John Apostolakis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: