Non reproducible order of daughter volumes in Geant4 geometry. #1271
Labels
bug
Fixed
Problem is solved
Testing
Waiting for caller
Waiting for issue opener to respond to question
Check duplicate issues.
Goal
When the geometry is converted from TGeo to Geant4 the order in which the daughter volumes are attached to mother volumes is not preserved. This can be seen by using the
methods of G4LogicalVolume. Between two runs, the results can be different for each ‘i’ index.
This may be a source of non-reproducibility if an algorithm iterates over the daughter volumes, and in particular in the case of overlaps, this gives non-reproducibilty of potential crashes.
The source of the problem (thanks to Markus’ investigation) is in:
"""
DD4hep/DDCore/include/DD4hep/GeoHandler.h
Line 68 in 169fc4f
When scanning the ROOT geometry DD4hep stores the object handles to be converted in sets,
which are then indexed by the pointer values.
Depending on the value the OS returns pointers to the process, the order in the set is defined.
This order on moderns OSes in indeterministic due to address randomization.
This then leads to orders, which are not the same.
"""
The idea would be to find a way of preserving the order of TGeo daughter volumes when attaching daughter volumes in Geant4 geometry. This would guarantee the reproducibility between the runs.
Operating System and Version
any
compiler
any
ROOT Version
any
DD4hep Version
any
Reproducer
inline G4VPhysicalVolume* GetDaughter(const G4int i) const;
Additional context
No response
The text was updated successfully, but these errors were encountered: