Problem 2547 - G4GenericTrap returns overestimated safety
Summary: G4GenericTrap returns overestimated safety
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/solids (show other problems)
Version: 11.1
Hardware: All All
: P4 normal
Assignee: Evgueni.Tcherniaev
URL:
Depends on:
Blocks:
 
Reported: 2023-06-07 15:08 CEST by Evgueni.Tcherniaev
Modified: 2024-06-03 21:03 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Evgueni.Tcherniaev 2023-06-07 15:08:17 CEST
G4GenericTrap in most of cases returns an overestimated safety.

The problem has been spotted of the following test. DistanceToIn(p) and DistanceToOut(p) were invoked for 10К random points generated on the surface of G4genericTrap constructed as follows:

  std::vector<G4TwoVector> vv(8);
  vv[0].set(-80*mm,-60*mm);
  vv[1].set(-80*mm, 60*mm);
  vv[2].set( 80*mm, 60*mm);
  vv[3].set( 80*mm,-60*mm);
  vv[4].set(-50*mm, 40*mm);
  vv[5].set( 50*mm, 40*mm);
  vv[6].set( 50*mm,-40*mm);
  vv[7].set(-50*mm,-40*mm);
  G4VSolid* solid = new G4GenericTrap("GenTrap", dz = 50*mm, vv);

The calculated distances were not zero in 7.3K cases for DistanceToIn(p) and 6.2K cases for DistanceToOut(p). The maximum returned values were 153 mm and 33 mm respectively.

Then, the points were moved outside the solid by 10 mm to check the values returned by DistanceToIn(p). The calculated distances were again overestimated in 7.3K cases. The maximum returned value was 159 mm instead of 10 mm.

An finally, the points were moved inside the solid by 1 mm to check the values returned by DistanceToOut(p). The calculated distances were overestimated in 5.1K cases. The maximum returned value was 32 mm instead of 1 mm.
Comment 1 Evgueni.Tcherniaev 2024-06-03 21:03:22 CEST
G4GenericTrap has been completely revised, see tag geom-specific-V11-02-03. The test now works correctly.