slic/src
diff -u -r1.40 -r1.41
--- G4Application.cc 17 May 2005 19:06:33 -0000 1.40
+++ G4Application.cc 3 Aug 2005 23:17:11 -0000 1.41
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/G4Application.cc,v 1.40 2005/05/17 19:06:33 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/G4Application.cc,v 1.41 2005/08/03 23:17:11 jeremy Exp $
#include "G4Application.hh"
// SLIC
@@ -44,14 +44,14 @@
G4Application* G4Application::m_instance = 0 ;
- G4Application::G4Application()
+ G4Application::G4Application()
: m_runManager(0),
m_session(0),
m_mode(G4Application::eBatch),
m_returnCode(0),
m_setRunAbort(false)
{
- // set app instance var
+ // set app instance var
if ( 0 != m_instance ) {
G4Exception("G4Application constructed twice.");
}
@@ -62,18 +62,18 @@
// init log manager
LogManager::instance();
-
+
// init physics manager
PhysicsListManager::instance();
- // init cmd manager
+ // init cmd manager
CmdManager::instance();
// init event gen manager
EventSourceManager::instance();
}
-
- G4Application::~G4Application()
+
+ G4Application::~G4Application()
{
#ifdef G4VIS_USE
if ( sVisManager != 0 ) {
@@ -87,12 +87,12 @@
if ( m_runManager != 0 ) {
delete m_runManager;
- }
+ }
if ( m_appMessenger != 0 ) {
delete m_appMessenger;
}
-
+
delete CmdManager::instance();
delete PhysicsListManager::instance();
@@ -120,23 +120,15 @@
// tokenize args into std::string vector stored in command mgr
if ( argc > 1 ) {
- mgr->fillCmdArgs( argc, argv );
+ mgr->fillCmdArgs( argc, argv );
}
- // didn't get any arguments, so push some commands onto G4 command queue to boostrap
+ // didn't get any arguments, so just print usage
else {
- // try interactive mode if using G4UI
-#ifndef G4UI_NONE
- mgr->getG4CmdQueue()->addCmd("/slic/commands");
- mgr->getG4CmdQueue()->addCmd("/control/interactive");
-
-#else
- // or just print usage and exit
- mgr->getCmdArgs()->addToken("/slic/usage");
-#endif
+ mgr->getG4CmdQueue()->addCmd("/slic/usage");
}
// make a queue of G4 commands to execute
- mgr->fillG4CmdQueue();
+ mgr->fillG4CmdQueue();
}
void G4Application::initialize()
@@ -144,11 +136,11 @@
// create new Geant4 RunManager
m_runManager = new RunManager();
- // print app splash screen
+ // print app splash screen
printSplashScreen( std::cout );
-
+
// make sure LcioManager gets setup
- LcioManager::instance();
+ LcioManager::instance();
// visualization
#ifdef G4VIS_USE
@@ -158,18 +150,18 @@
// default user setups: DetConst, PrimGenAction, PhysicsList
initializeDefaultSetup();
- /*
- * After this, user must initialize Geant4
- * using /run/initialize macro command
+ /*
+ * After this, user must initialize Geant4
+ * using /run/initialize macro command
* or command line opts --initialize / -z.
*/
}
#ifndef G4UI_NONE
- void G4Application::initializeUI()
+ void G4Application::initializeUI()
{
// tcsh setup
-#ifdef G4UI_USE_TCSH
+#ifdef G4UI_USE_TCSH
m_session = new G4UIterminal(new G4UItcsh);
// csh setup
@@ -179,11 +171,11 @@
// Gag setup
#elif G4UI_USE_GAG
session = new G4UIGAG;
-
+
// Motif setup
#elif G4UI_USE_XM
m_session = new G4UIXm( 0, NULL );
-
+
// add file and exit buttons
if ( m_session ) {
G4UImanager* ui = G4UImanager::GetUIpointer();
@@ -204,7 +196,7 @@
#endif
#ifdef G4VIS_USE
- void G4Application::initializeVis()
+ void G4Application::initializeVis()
{
sVisManager = new VisManager();
sVisManager->Initialize();
@@ -218,7 +210,7 @@
}
}
- void G4Application::initializeDefaultSetup()
+ void G4Application::initializeDefaultSetup()
{
if ( m_runManager != 0 ) {
@@ -241,17 +233,17 @@
}
}
- void G4Application::setMode(G4Application::ERunMode rmode)
+ void G4Application::setMode(G4Application::ERunMode rmode)
{
m_mode = rmode;
}
-
- G4Application::ERunMode G4Application::getMode() const
+
+ G4Application::ERunMode G4Application::getMode() const
{
return m_mode;
}
- RunManager* G4Application::getRunManager()
+ RunManager* G4Application::getRunManager()
{
return m_runManager;
}
@@ -274,7 +266,7 @@
setReturnCode(0);
}
- void G4Application::printOutUsage(std::ostream& os)
+ void G4Application::printOutUsage(std::ostream& os)
{
CmdManager::instance()->getCmdRegistry()->printOut( os );
}
@@ -293,7 +285,7 @@
{
- // splash screen
+ // splash screen
os << "*************************************************************" << std::endl;
os << " App : " << getNameString() << " (" << getAbbrevString() << ")" << std::endl;
os << " Version : " << getVersionString() << std::endl;
@@ -306,7 +298,7 @@
os << std::endl;
}
- // print startup time
+ // print startup time
void G4Application::printStartTime(std::ostream& os)
{
os << "Start Time <" << TimeUtil::getAscTime() << ">" << std::endl;