Newer
Older
//====================================================================
Markus Frank
committed
// DDSim - LC simulation based on DD4hep
//--------------------------------------------------------------------
// F.Gaede, DESY
// $Id:$
//====================================================================
#include "DDG4/Geant4Config.h"
#include <iostream>
using namespace DD4hep::Simulation::Setup;
/** Simple main program to run a simulation with DDG4
* Loops over all xml files given on command line:
* - first file defines geometry
* - subsequent files configure the application
Markus Frank
committed
*/
int main(int argc, char** argv) {
if( argc < 2 ){
Markus Frank
committed
std::cout << " --- Usage example: \n "
<< " dd_sim ../ILD/compact/ILD_o1_v05.xml [sensitive_detectors.xml] sequences.xml physics.xml "
<< std::endl ;
Markus Frank
committed
DD4hep::Geometry::LCDD& lcdd = DD4hep::Geometry::LCDD::getInstance();
Markus Frank
committed
Markus Frank
committed
Markus Frank
committed
std::string geoFile = "file:" ;
geoFile += argv[1] ;
Markus Frank
committed
kernel.loadGeometry( geoFile ) ;
Markus Frank
committed
std::cout << " will open xml file " << argv[i] << " and load to kernel ..." << std::endl ;
kernel.loadXML( argv[i] ) ;
}
kernel.configure();
kernel.initialize();
kernel.run();
std::cout << "Successfully executed application .... " << std::endl;
kernel.terminate();
}