| Summary: | kCarTolerance in G4VFacet should not be constant | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Pete Truscott <PRTruscott> |
| Component: | geometry/solids | Assignee: | Gabriele Cosmo <Gabriele.Cosmo> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | P4 | ||
| Version: | 10.5 | ||
| Hardware: | All | ||
| OS: | All | ||
Sorry, a correction to my initial description: kCarTolerance is used in the constructors of G4TriangularFact and G4QuadrangularFacet; there is no base contructor. Thanks for reporting this. The fix is now under testing and will be available in a next patch release. |
In G4VFacet.cc the variable kCarTolerance has been set to a static const since v9.6 of Geant4 (lines 47 & 48): const G4double G4VFacet::kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance(); During the geometry construction process ti is possible to change the tolerances in G4GeometryTolerance using the member function: G4GeometryManager::GetInstance()->SetWorldMaximumExtent(worldExtent); Obviously this will not modify the value of kCarTolerance used by G4VFact and its derivd classes. The consequence can be incorrect calculations and erroneous tracking of particles in the G4TessellatedSolid for small (microelectronics-scale) geometries. Since kCarTolerance is used by the constructors of G4VFacet and its derived classes, the brute-force approach is have kCarTolerance as non-const and initialised it in the G4VFacet constructor (with a warning if the SetWorldMaximumExtent(worldExtent) member function is executed after any facets are instantiated. An alternative (and more complicated) approach would be to modify the facet initialisation process and move it into a member function of G4VFacet/G4TriangularFacet/G4QuadrangularFacet, so that if the worldExtent is changed, the geometry manager knows to reinitialise the facets just before the geometry is closed.