Error with SetSpline in detector build

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

Geant4 Version: 11.2.1
Operating System: Linux
Compiler/Version: GCC
CMake Version: 3.22.1

I am receiving errors concerning my Detector Construction file with the SetSpline function, included below

fPlastic_mt = new G4MaterialPropertiesTable();

fPlastic_mt->AddProperty(“RINDEX”, photonEnergy, refractiveIndex1,nEntries)->SetSpline(true);
fPlastic_mt->AddProperty(“ABSLENGTH”, photonEnergy, absorption, nEntries)->SetSpline(true);
fPlastic_mt->AddProperty(“FASTCOMPONENT”,photonEnergy, plasticFast, nEntries)->SetSpline(true);
fPlastic_mt->AddProperty(“SLOWCOMPONENT”,photonEnergy, plasticSlow, nEntries)->SetSpline(true);

When I run the make on the build, I get told: error: ‘using G4MaterialPropertyVector = class G4PhysicsFreeVector’ {aka ‘class G4PhysicsFreeVector’} has no member named ‘SetSpline’; did you mean ‘GetSpline’?

Does anyone know where SetSpline got moved to? I’m a novice so I’m figuring this out as I go but with all the changes I’m pretty turned around.

I also included ahead of the included code where fPlastic_mt gets declared:

NGnDetectorConstruction::NGnDetectorConstruction()
: fPlastic_mt(nullptr), fLXe_mt(nullptr), fMPTPStyrene(nullptr)


1 Like

Hello, I have also encountered the same problem. If your problem is resolved, can we discuss it together.

For sure, I’ll let you know if I hear anything