Mixing optical and non-optical material properties?

For the CDMS detector simulation, we have leveraged the functionality of optical physics, especially surfaces, surface properties, and material properties, as part of our own simulation of the detector response. As such, we have, for instance, a material properties table attached to G4_Al with the following entries:

// Electronic properties of superconducting aluminum film
mpt->AddConstProperty("gapEnergy", 173.715e-6*eV);	// Single QP Delta
mpt->AddConstProperty("phononLifetime", 242*ps);
mpt->AddConstProperty("phononLifetimeSlope", 0.29);	// Unitless dtau/dE
mpt->AddConstProperty("vSound", 3.26*km/s);

with

G4Material* mat = ... "G4_Al" ...;
mat->SetMaterialPropertiesTable(mpt);

This has been working fine for a long time. Very recently, we added some true optical-physics support for our aluminum films, so the “mpt” code above now also includes code like

G4MaterialPropertyVector* REALR = ....;
mpt->AddProperty("REALRINDEX", REALR);

With those changes (adding regular optical properties to the same G4MaterialPropertiesTable instance), my detector simulation jobs are now failing with

*** G4Exception : mat202
      issued by : G4MaterialPropertiesTable::GetConstProperty()
Constant Material Property Index -1 not found.
*** Fatal Exception *** core dump ***

Is it not allowed to have a mix of optical and non-optical properties defined in the same table?

1 Like

Hi Mike,

Which version are you using?

In 11-beta, there is an error in G4MaterialPropertiesTable.cc, line 421 (line number in development version, beta version isn’t in LXR yet). In the method AddConstProperty(),

G4MaterialPropertyName.push_back(key);

should be

G4MaterialConstPropertyName.push_back(key);

As an aside, starting with 11-beta, the parameter createNewKey needs to be added to AddConstProperty and AddProperty when adding a new key (to prevent typos in key names).

So:

mpt->AddConstProperty("gapEnergy", 173.715e-6*eV, true);

That just might do it. I’ve been exercising several G4 versions recently. I don’t know when we’re going to move to G4 11 (interface changes are a huge pain), but that’s a nice feature addition to avoid the evil “RIDNEX” problem :smiley:

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