00001 // $Id: SlicMain.cc,v 1.1 2007/04/27 01:54:35 jeremy Exp $ 00002 00003 #include "SlicMain.hh" 00004 00005 // slic 00006 #include "SlicApplication.hh" 00007 #include "TimeUtil.hh" 00008 00009 // geant4 00010 #include "G4RunManager.hh" 00011 00012 namespace slic 00013 { 00014 SlicMain::SlicMain() 00015 : Module( "SlicMain" ) 00016 {;} 00017 00018 SlicMain::~SlicMain() 00019 {;} 00020 00021 int SlicMain::main(int argc, char** argv) 00022 { 00023 // Default return code. 00024 int returnCode = 0; 00025 00026 SlicApplication* slicApp = 0; 00027 00028 // Top-level try block. 00029 try { 00030 00031 // Create the SLIC application using singleton function. 00032 slicApp = SlicApplication::instance(); 00033 00034 // Setup the command line arguments. 00035 slicApp->initialize(argc, argv); 00036 00037 // Run the simulator. 00038 slicApp->run(); 00039 00040 // Get the application return code. 00041 returnCode = slicApp->getReturnCode(); 00042 } 00043 // Catch an std::exception. 00044 catch(std::exception& stde) { 00045 log() << LOG::error << stde.what() << LOG::done; 00046 } 00047 // Catch an unknown exception. 00048 catch(...) { 00049 log() << LOG::error << "Top-level flak catcher caught unknown exception!" << LOG::done; 00050 } 00051 00052 if ( slicApp ) { 00053 delete slicApp; 00054 } 00055 00056 return returnCode; 00057 } 00058 }
1.5.4