Bug #25016

Material reflectivity not supported in (legacy) LArG4

Added by Gianluca Petrillo 7 months ago. Updated 6 months ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Occurs In:


Specifying material reflectivity in LArPropertiesService triggers a GEANT4 initialisation error.
The error message is:

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : Run0041
      issued by : G4UserRunAction::G4UserRunAction()
 You are instantiating G4UserRunAction BEFORE your G4VUserPhysicsList is
instantiated and assigned to G4RunManager.
 Such an instantiation is prohibited by Geant4 version 8.0. To fix this problem,
please make sure that your main() instantiates G4VUserPhysicsList AND
set it to G4RunManager before instantiating other user action classes
such as G4UserRunAction.
*** Fatal Exception *** core dump ***
 **** Track information is not available at this moment
 **** Step information is not available at this moment

-------- EEEE -------- G4Exception-END --------- EEEE -------

This problem may have been here since ages.
It can be reproduced for example in icaruscode v09_03_00 running with the following configuration:

#include "standard_g4_icarus.fcl" 

services.LArPropertiesService: {


  ReflectiveSurfaceEnergies:     [ 1.77, 2.0675, 2.481, 2.819, 2.953, 3.1807, 3.54, 4.135, 4.962, 5.39, 7., 15. ]
  ReflectiveSurfaceNames:        [ "STEEL_STAINLESS_Fe7Cr2Ni", "copper", "G10", "vm2000", "ALUMINUM_Al" ]
  ReflectiveSurfaceReflectances: [
    [ 0.66, 0.64, 0.62, 0.60, 0.59, 0.57, 0.53, 0.47, 0.39, 0.36, 0.27, 0.25 ],         # STEEL_STAINLESS_Fe7Cr2Ni
    [ 0.902, 0.841, 0.464, 0.379, 0.345, 0.299, 0.287, 0.264, 0.337, 0.3, 0.0, 0.0 ],   # copper
    [ 0.393, 0.405, 0.404, 0.352, 0.323, 0.243, 0.127, 0.065, 0.068, 0.068, 0.0, 0.0 ], # "G10" 
    [ 0.93, 0.93, 0.93, 0.93, 0.93, 0.93, 0.1, 0.1, 0.7, 0.3, 0.0, 0.0 ],               # "vm2000" 
    [ 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.47, 0.39, 0.36, 0.27, 0.25 ]                 # "ALUMINUM_Al" 

physics.simulate: [ largeant ]

A suitable input file was provided in Redmine issue #24890.

Steps to reproduce from a GPVM:

source /cvmfs/
setup icaruscode v09_03_00 -q e19:prof
lar -c ./standard_g4_icarus_reflectivity.fcl prod_muon_0-1GeV_isotropic_icarus_20200831T231644_gen.root -n 1

standard_g4_icarus_reflectivity.fcl (917 Bytes) standard_g4_icarus_reflectivity.fcl Test configuration Gianluca Petrillo, 09/24/2020 02:49 PM


#2 Updated by Gianluca Petrillo 7 months ago

This may have something to do with when the MaterialPropertyLoader is pulled in.

#3 Updated by Gianluca Petrillo 7 months ago

Diego Garcia Gamez reports he does not see the error in sbndcode v08_55_01, which uses GEANT4 v4_10_3_p03e.
The version I am using is GEANT4 v4_10_6_p01.

#4 Updated by Gianluca Petrillo 7 months ago

Diego Garcia Gamez helped me.
It turns out that there are three possible modes for optical simulation:

  1. fast optical simulation (FastOptical physics) physics list: reflectivity is just ignored (it's included in the parametrised/precomputed visibility, or not at all)
  2. full optical simulation (Optical physics, if I recall right): simple boundaries algorithm (mentioned in "Reflectivity to optical photons" of LArG4 doxygen page and set via services.DetectorPropertiesService.SimpleBoundaryProcess) may be:
    1. enabled (true) the reported error is triggered
    2. disabled (false) initialisation correctly happens, GEANT4 does not even complain about missing reflectivity, all seems good

I am good (maybe, I am better with the GEANT4 model), but it would be good at least to have proper diagnostics when the configuration falls in the case 2.1., if this case is not going to be supported.

I have not enough expertise to offer an opinion on whether this should be supported.

#5 Updated by Lynn Garren 7 months ago

  • Status changed from New to Feedback

Gianluca, would you please test with v08_62_00 or v08_62_01? Those releases use geant4 v4_10_6_p01. We would like to understand whether the issue is related to the change in geant4 releases or the change going to v09. Thanks

#6 Updated by Gianluca Petrillo 7 months ago

I can reproduce it in v08_62_01 as well.

#7 Updated by Lynn Garren 7 months ago

So this problem is related to the geant4 update, then.

#8 Updated by Kyle Knoepfel 6 months ago

Gianluca, the use of G4VUserPhysicsList required some changes in the migration from G4 10.3 to 10.6. We expect this would not be an issue if larg4 were used instead of the legacy G4 facilities in larsim. Are you able to investigate the possibility of migrating to larg4? We strongly prefer to not continue patching legacy code that is intended to go away.

#9 Updated by Gianluca Petrillo 6 months ago

SBND and ICARUS are working on the migration, although it can take still a while.
I am not in a condition to test whether the tools in larg4 repository would solve the issue.
Feel free to mark this as WONTFIX and leave it as documentation.
(I just realised there is no "WONTFIX" status...)

#10 Updated by Kyle Knoepfel 6 months ago

  • Status changed from Feedback to Closed

Based on your response, we'll close this issue.

Also available in: Atom PDF