| Summary: | G4Scintillation does not update its physics tables when e.g. new G4Materials are added. | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | takazor |
| Component: | processes/electromagnetic | Assignee: | gum |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | P5 | ||
| Version: | 9.6 | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
takazor
2014-10-08 14:33:54 CEST
Hello, Please, be more precise in the description: 1) Geant4 version 9.10 does not exist, please, specify is it 9.6 or 9.6+patch, or what? 2) Please, be more specific - do you have several runs per job and you change materials between run, you add a material during the run, or what? 3) ideally you need to attach a tar with the application which crashes and with instructions how to get the crash; if you cannot do that try to use existing Geant4 examples where you reproduce the crash. This will speed up the fix or at least make a possibility to figure out how to get your application running without the crash. VI Thanks for the fast reply.
1) This is the output of geant:
*************************************************************
Geant4 version Name: geant4-09-06 (30-November-2012)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
*************************************************************
So, I guess it is indeed 9.6 and not 9.10.
2) The problem arises when a previously non-scintillating material becomes scintillating (i.e. the required entries are made in its G4MaterialPropertiesTable) or a scintillating material is created AFTER the G4Scintillation constructor is called. This does not depend on whether it happens during a run or in between runs, since G4Scintillation objects are usually created with all other processes.
The reason behind creating new scintillating materials is, that it is not possible to change a material's density. If I want to set the density via UI, the program has to create a new material with the exact properties as the old, except the density.
3) I got my application running by adding
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
{
if(theFastIntegralTable != NULL) theFastIntegralTable->clearAndDestroy();
delete theFastIntegralTable;
theFastIntegralTable = NULL;
if(theSlowIntegralTable != NULL) theSlowIntegralTable->clearAndDestroy();
delete theSlowIntegralTable;
theSlowIntegralTable = NULL;
BuildThePhysicsTable();
}
// build the physics table every time the physics get modified.
to the header file of G4Scintillation:
source/processes/electromagnetic/xrays/include/G4Scintillation.hh
This dirty fix overrides the BuildPhysicsTable() method, which gets called every time the physics have been modified before a run. It deletes the old integral tables and then calls the protected void BuildThePhysicsTable() to create new tables, which then incorporate any new materials.
Thank you for reporting this! I have adopted your fix with tag xrays-V10-00-05. |