Are constant material properties missing a hash in the name for GDML?

I am adding properties using AddConstProperty() to a number of different G4MaterialPropertiesTable().

Several of the constants have the same name, eg ELECTRICFIELD. So there is an ELECTRICFIELD for material1 and a different ELECTRICFIELD for material2 etc…
However, when writing out the created geometry to a GDML file, there is no distinction between these properties in the definitions. As such the GDML file can not then be read in, instead the following error is seen;

-------- EEEE ------- G4Exception-START -------- EEEE -------

*** ExceptionHandler is not defined ***
*** G4Exception : InvalidExpression
issued by : G4GDMLEvaluator::DefineConstant()
Redefinition of constant or variable: ELECTRICFIELD
*** Fatal Exception ***
-------- EEEE -------- G4Exception-END --------- EEEE -------

2 Likes

Hi,

thanks a lot for reporting this and sorry for the delay.

I have started debugging this and realized that there is more than one problem. The const properties are written out as constants (scalars), but the parser (reader) expects them to be matrices of dimensions 1x1. In other words, even if you have one const property, the generated GDML file (as far as I can see at the current moment) would not be possible to read it.

I will try to provide a fix to all those problems as soon as possible.

2 Likes