|
DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
13 #ifndef DD4HEP_DDG4_GEANT4GDMLWRITEACTION_H
14 #define DD4HEP_DDG4_GEANT4GDMLWRITEACTION_H
92 #ifndef GEANT4_NO_GDML
93 #include <G4GDMLParser.hh>
95 #include <G4Version.hh>
98 #include <sys/types.h>
133 if ( fname.empty() ) {
134 error(
"+++ No GDML file name given. Please set the output file (property Output)");
137 if ( (0 == ::stat(fname.c_str(), &buff)) && !
m_overWrite ) {
138 error(
"+++ GDML file %s elready exists. Please set another output file (property Output)",
142 else if ( 0 == ::stat(fname.c_str(), &buff) ) {
143 warning(
"+++ GDML file %s already exists. Overwriting existing file.", fname.c_str());
144 ::unlink(fname.c_str());
146 #ifdef GEANT4_NO_GDML
147 warning(
"+++ writeGDML: GDML not found in the present Geant4 build! Output: %s not written", fname.c_str());
149 std::unique_ptr<G4GDMLParser>
parser(
new G4GDMLParser());
152 #if G4VERSION_NUMBER>=1030
155 info(
"+++ Writing GDML file: %s", fname.c_str());
int m_exportRegions
Property: Export region information to the GDML.
bool m_needsControl
Default property: Flag to create control instance.
int m_exportEnergyCuts
Property: Export energy cut information to the GDML.
std::string m_output
Property: collection names to be dumped.
static void increment(T *)
Increment count according to type information.
int m_overWrite
Poprerty: Flag to overwrite existing files.
#define DECLARE_GEANT4ACTION(name)
Plugin defintion to create Geant4Action objects.
void warning(const char *fmt,...) const
Support of warning messages.
const Callback & make(R(T::*pmf)())
Callback setup function for Callbacks with member functions with explicit return type taking no argum...
int m_exportSensitiveDetectors
Property: Export sensitive detector information to the GDML.
void info(const char *fmt,...) const
Support of info messages.
void error(const char *fmt,...) const
Support of error messages.
virtual void installCommandMessenger() override
Install command control messenger if wanted.
Definition of the generic callback structure for member functions.
Geant4Action & declareProperty(const std::string &nam, T &val)
Declare property.
static void decrement(T *)
Decrement count according to type information.
virtual void writeGDML()
Write geometry to GDML.
virtual ~Geant4GDMLWriteAction()
Default destructor.
Geant4GDMLWriteAction(Geant4Context *context, const std::string &nam)
Standard constructor.
Default base class for all Geant 4 actions and derivates thereof.
Geant4UIMessenger * m_control
Control directory of this action.
Namespace for the Geant4 based simulation part of the AIDA detector description toolkit.
Namespace for the AIDA detector description toolkit.
void addCall(const std::string &name, const std::string &description, const Callback &cb, size_t npar=0)
Add a new callback structure.
Class to measure the energy of escaping tracks.
Generic context to extend user, run and event information.
Geant4Context * context() const
Access the context.