I started getting errors after introducing opticalPhysic.
*** G4Exception : mat202
issued by : G4MaterialPropertiesTable::GetConstProperty()
Constant Material Property Index 30 not found.
*** Fatal Exception *** core dump ***
G4WT0 > G4Track (0x7f2d74322df0) - track ID = 1, parent ID = 0
G4WT0 > Particle type : gamma - creator process : not available
G4WT0 > Kinetic energy : 674.497 keV - Momentum direction : (-0.491579,-0.60248,0.628783)
G4WT0 > Step length : 1.11078 cm - total energy deposit : 11.59 eV
G4WT0 > Pre-step point : (0,0,45) - Physical volume : Detector1 (LaBr3)
G4WT0 > - defined by : Transportation - step status : 1
G4WT0 > Post-step point : (0,0,56.1078) - Physical volume : Detector1 (LaBr3)
G4WT0 > - defined by : compt - step status : 4
G4WT0 > *** Note: Step information might not be properly updated.
G4WT0 >
I copy and pasted your material definition into my own optics simulation and I found swapping out “SCINTILLATIONRISETIME1” for “SCINTILLATIONTIMECONSTANT1” allowed my code to run without issue.
While I have never used it myself, I do see that the material constant property “SCINTILLATIONRISETIME1” is in the manual, but there is a specification that you must set the optical parameter “SetFiniteRiseTime” to true. I did not confirm it, but If I had to guess “AddProperty” is throwing an error because you never set the optical parameter “SetFiniteRiseTime” to true so “AddProperty” is not expecting you to define “SCINTILLATIONRISETIME1”.
So if you care about having a rise time I would set “SetFiniteRiseTime” to true, if not just swap out “SCINTILLATIONRISETIME1” for “SCINTILLATIONTIMECONSTANT1”.