Newer
Older
Markus Frank
committed
//==========================================================================
Markus Frank
committed
//--------------------------------------------------------------------------
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
Markus Frank
committed
// All rights reserved.
//
// For the licensing terms see $DD4hepINSTALL/LICENSE.
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
//
// Author : M.Frank
//
//==========================================================================
// Framework include files
Markus Frank
committed
// C/C++ include files
#include <stdexcept>
#include <cerrno>
Markus Frank
committed
int setupG4_XML() {
dd4hep::Detector& description = dd4hep::Detector::getInstance();
Kernel& kernel = Kernel::instance(description);
kernel.loadGeometry("file:../DD4hep.trunk/DDExamples/CLICSiD/compact/compact.xml");
kernel.loadXML("DDG4_field.xml");
kernel.loadXML("sequences.xml");
kernel.loadXML("physics.xml");
kernel.configure();
kernel.initialize();
kernel.run();
std::cout << "Successfully executed application .... " << std::endl;
kernel.terminate();
/// Main entry point as a program
try {
return setupG4_XML();
}
catch(const std::exception& e) {
std::cout << "Got uncaught exception: " << e.what() << std::endl;
}
catch (...) {
std::cout << "Got UNKNOWN uncaught exception." << std::endl;
}
return EINVAL;