Some issues about optical

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 >

_Geant4 Version:_11.1.3
_Operating System:_archlinux
_Compiler/Version:_13.2.1
_CMake Version:_3.28.3

ZjnDetectorConstruction.cc (9.3 KB)
main.cc (5.2 KB)


Supplement a required document

ZjnDetectorConstruction.hh (13.2 KB)

I would appreciate it if it could be solved.

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”.

I set the refractive index for each part and then there was no problem.
我给每一部分都设置了折射率后就没有问题了。

Thanks very much.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.