Skip to content

Re-create GDML file at each execution #14

@mvicenzi

Description

@mvicenzi

G4GDMLWrite::Write() complains if the GDML file already exists. This means running with /det/saveGdml true works only once, then the user is forced to set it back to false. And it gets somewhat annoying.

Exporting geometry to FLArE_only_newBabyMIND.gdml
G4GDML: Writing 'FLArE_only_newBabyMIND.gdml'...

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : InvalidSetup
      issued by : G4GDMLWrite::Write()
File 'FLArE_only_newBabyMIND.gdml' already exists!
*** Fatal Exception *** core dump ***
 **** Track information is not available at this moment
 **** Step information is not available at this moment

-------- EEEE -------- G4Exception-END --------- EEEE -------

Proposed solution: if file exists, delete it before writing a new one (re-create behaviour).

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions