slic::SlicApplication Class Reference

#include <SlicApplication.hh>

Inheritance diagram for slic::SlicApplication:

Inheritance graph
Singleton\< slic::SlicApplication \>slic::Module
[legend]
Collaboration diagram for slic::SlicApplication:

Collaboration graph
slic::SlicApplicationMessengerSingleton\< slic::SlicApplication \>Singleton\< slic::FieldManager \>slic::Moduleslic::RunManagerslic::FieldManagerslic::LogStreamslic::LogMessengerslic::FieldMessenger
[legend]

List of all members.


Detailed Description

Singleton class for a Geant4 application.

Note:
Instantiates manager and messenger classes, including user actions, G4RunManager, GeneratorManager, and PhysicsListManager.

Definition at line 36 of file SlicApplication.hh.


Public Types

enum  ERunMode { eBatch = 1, eInteractive = 2 }
enum  ModuleStatus { eOkay = 0, eNotInitialized = 1, eBadState = 2, eFatalError = 3 }

Public Member Functions

 SlicApplication ()
virtual ~SlicApplication ()
RunManagergetRunManager ()
void initialize ()
void run ()
void printUsage ()
void printVersion ()
void printSplashScreen ()
void printStartTime ()
void printEndTime ()
int getReturnCode () const
ERunMode getMode () const
void setAborting (bool a=true)
bool isAborting () const
void setMode (ERunMode rmode)
const std::string & getBinaryName () const
const std::string & getBinaryBasename () const
void initialize (int, char **)
void setReturnCode (int rc)
std::string getGeant4VersionString ()
void release ()
const std::string & getName () const
const ModuleStatus getStatus () const
virtual void reset ()
virtual void cleanup ()
bool deleteOnExit ()
LogStreamlog ()
virtual void beginEvent (const G4Event *)
virtual void endEvent (const G4Event *)
virtual void beginRun (const G4Run *)
virtual void endRun (const G4Run *)
virtual void preTracking (const G4Track *)
virtual void postTracking (const G4Track *)
virtual void stepping (const G4Step *)
G4ClassificationOfNewTrack stackingClassifyNewTrack (const G4Track *)
void stackingNewStage ()
void stackingPrepareNewEvent ()

Static Public Member Functions

static T * instance ()

Public Attributes

ModuleStatus m_status
std::string m_name
LogStream m_log
bool m_deleteOnExit

Protected Attributes

G4UIsession * m_session
SlicApplicationMessengerm_appMessenger
FieldMessengerm_fieldMessenger
RunManagerm_runManager
ERunMode m_mode
int m_returnCode
bool m_setRunAbort
bool m_isInitialized
std::string m_binaryname
std::string m_binarybasename
std::string * m_geant4VersionString

Private Member Functions

void setBinaryBasename ()
void initializeUserActions ()
void initializeLCDD ()
void initializeNistWriter ()
void initializePrimaryGeneratorAction ()
void initializeUI ()

Member Enumeration Documentation

enum slic::SlicApplication::ERunMode

Indicates the run mode: batch or interactive.

Enumerator:
eBatch 
eInteractive 

Definition at line 44 of file SlicApplication.hh.

enum slic::Module::ModuleStatus [inherited]

Enumerator:
eOkay 
eNotInitialized 
eBadState 
eFatalError 

Definition at line 29 of file Module.hh.


Constructor & Destructor Documentation

slic::SlicApplication::SlicApplication (  ) 

The constructor.

Definition at line 60 of file SlicApplication.cc.

References LOG::done, LOG::head, slic::Module::log(), and LOG::okay.

slic::SlicApplication::~SlicApplication (  )  [virtual]

The destructor.

Definition at line 77 of file SlicApplication.cc.

References slic::LogStream::debug(), LOG::done, LOG::head, Singleton< T >::instance(), slic::Module::log(), m_appMessenger, m_session, and LOG::okay.


Member Function Documentation

RunManager * slic::SlicApplication::getRunManager (  ) 

Return SLIC's RunManager instance.

Definition at line 310 of file SlicApplication.cc.

References m_runManager.

void slic::SlicApplication::initialize (  )  [virtual]

Initialize the application.

Reimplemented from slic::Module.

Definition at line 116 of file SlicApplication.cc.

References slic::LogStream::always(), initializeLCDD(), initializeNistWriter(), initializePrimaryGeneratorAction(), initializeUI(), initializeUserActions(), Singleton< T >::instance(), slic::Module::log(), m_appMessenger, m_isInitialized, m_runManager, slic::LogStream::okay(), printSplashScreen(), and slic::LogStream::warning().

Referenced by slic::SlicMain::main(), and run().

void slic::SlicApplication::run (  ) 

Run the application.

Definition at line 315 of file SlicApplication.cc.

References slic::CommandQueue::clear(), eInteractive, slic::CommandQueue::execute(), getMode(), initialize(), Singleton< T >::instance(), slic::Module::log(), m_isInitialized, m_session, slic::CommandQueue::printOut(), and slic::LogStream::verbose().

Referenced by slic::SlicMain::main().

void slic::SlicApplication::printUsage (  ) 

Print the usage by calling the CommandLineProcessor.

Definition at line 361 of file SlicApplication.cc.

References Singleton< T >::instance().

Referenced by slic::SlicApplicationMessenger::SetNewValue().

void slic::SlicApplication::printVersion (  ) 

Print the version string.

Definition at line 342 of file SlicApplication.cc.

References Singleton< T >::instance().

Referenced by slic::SlicApplicationMessenger::SetNewValue().

void slic::SlicApplication::printSplashScreen (  ) 

Print SLIC's splash screen.

Definition at line 347 of file SlicApplication.cc.

References LOG::always, LOG::done, slic::PackageInfo::getAbbrevString(), slic::PackageInfo::getAuthorString(), slic::PackageInfo::getChangeDateString(), slic::PackageInfo::getEmail(), slic::PackageInfo::getInstitutionString(), slic::PackageInfo::getNameString(), slic::PackageInfo::getVersionString(), slic::PackageInfo::getWWW(), and slic::Module::log().

Referenced by initialize().

void slic::SlicApplication::printStartTime (  ) 

Print the start time.

void slic::SlicApplication::printEndTime (  ) 

Print the end time.

int slic::SlicApplication::getReturnCode (  )  const

Get the return code.

Definition at line 272 of file SlicApplication.cc.

References m_returnCode.

Referenced by slic::SlicMain::main().

SlicApplication::ERunMode slic::SlicApplication::getMode (  )  const

Get the run mode, interactive or batch.

Definition at line 290 of file SlicApplication.cc.

References m_mode.

Referenced by run().

void slic::SlicApplication::setAborting ( bool  a = true  ) 

Set abort state.

Definition at line 295 of file SlicApplication.cc.

References m_setRunAbort.

bool slic::SlicApplication::isAborting (  )  const

Check abort state.

Definition at line 305 of file SlicApplication.cc.

References m_setRunAbort.

void slic::SlicApplication::setMode ( SlicApplication::ERunMode  rmode  ) 

Set the run mode.

Definition at line 257 of file SlicApplication.cc.

References m_mode.

Referenced by slic::SlicApplicationMessenger::SetNewValue().

const std::string & slic::SlicApplication::getBinaryName (  )  const

Get the name of the binary as it was invoked.

Definition at line 262 of file SlicApplication.cc.

References m_binaryname.

const std::string & slic::SlicApplication::getBinaryBasename (  )  const

Get the base name of the binary (file name only).

Definition at line 267 of file SlicApplication.cc.

References m_binarybasename.

void slic::SlicApplication::initialize ( int  argc,
char **  argv 
)

Setup SLIC from command line arguments using the CommandLineProcessor.

Definition at line 105 of file SlicApplication.cc.

References Singleton< T >::instance(), m_binaryname, slic::CommandLineProcessor::process(), and setBinaryBasename().

void slic::SlicApplication::setReturnCode ( int  rc  ) 

Set the return code.

Definition at line 277 of file SlicApplication.cc.

References m_returnCode.

std::string slic::SlicApplication::getGeant4VersionString (  ) 

Get the Geant4 version string.

Definition at line 373 of file SlicApplication.cc.

References m_geant4VersionString.

void slic::SlicApplication::setBinaryBasename (  )  [private]

Set the binary base name from the full name.

Definition at line 282 of file SlicApplication.cc.

References m_binarybasename, and m_binaryname.

Referenced by initialize().

void slic::SlicApplication::initializeUserActions (  )  [private]

Register the Geant4 user action classes with the G4RunManager.

Definition at line 248 of file SlicApplication.cc.

References m_runManager.

Referenced by initialize().

void slic::SlicApplication::initializeLCDD (  )  [private]

Register the LCDDDetectorConstruction.

Definition at line 236 of file SlicApplication.cc.

References m_runManager.

Referenced by initialize().

void slic::SlicApplication::initializeNistWriter (  )  [private]

Setup the NistWriter.

Referenced by initialize().

void slic::SlicApplication::initializePrimaryGeneratorAction (  )  [private]

Register the PrimaryGeneratorAction.

Definition at line 242 of file SlicApplication.cc.

References m_runManager.

Referenced by initialize().

void slic::SlicApplication::initializeUI (  )  [private]

Initialize the Geant4 user interface.

Definition at line 192 of file SlicApplication.cc.

References slic::LogStream::fatal(), slic::Module::log(), and m_session.

Referenced by initialize().

template<class T>
T * Singleton< T >::instance (  )  [inline, static, inherited]

Definition at line 31 of file Singleton.hh.

References Singleton< T >::m_singleton.

Referenced by slic::LcioManager::addInitialMCParticleCollection(), slic::StdHepEventSource::beginEvent(), slic::LcioEventSource::beginEvent(), slic::EventAction::BeginOfEventAction(), slic::RunAction::BeginOfRunAction(), slic::EventSourceWithInputFile::beginRun(), slic::LcioMcpFactory::createFinalMcpCollection(), slic::LcioMcpFactory::createMcpFromPrimary(), slic::LcioManager::createRunHeader(), slic::LcioEventSource::dumpCurrentEvent(), slic::LcioManager::endEvent(), slic::EventAction::EndOfEventAction(), slic::RunAction::EndOfRunAction(), slic::LcioManager::endRun(), slic::StdHepEventSource::generate(), slic::LcioEventSource::generate(), slic::PrimaryGeneratorAction::GeneratePrimaries(), slic::LcioEventSource::getCurrentMcpLCCollection(), slic::LcioFileNamer::getFieldValue(), initialize(), slic::RunManager::InitializePhysics(), slic::PhysicsListManager::initializePhysicsList(), slic::LcioHitsCollectionBuilder::LcioHitsCollectionBuilder(), slic::LcioManager::LcioManager(), slic::LcioPrimaryGenerator::LcioPrimaryGenerator(), slic::SlicMain::main(), slic::LcioFileNamer::makeEventName(), slic::LcioFileNamer::makeEventNumberString(), slic::LcioFileNamer::makeFileBasedName(), slic::LcioFileNamer::makeGPSName(), slic::LcioFileNamer::makeGunName(), slic::Module::Module(), slic::PhysicsListManager::PhysicsListManager(), printUsage(), printVersion(), run(), slic::PhysicsMessenger::SetNewValue(), slic::LcioMcpMessenger::SetNewValue(), slic::GeneratorMessenger::SetNewValue(), slic::FieldMessenger::SetNewValue(), slic::EventDebuggerMessenger::SetNewValue(), slic::TrackingAction::TrackingAction(), slic::SteppingAction::UserSteppingAction(), slic::Module::~Module(), and ~SlicApplication().

template<class T>
void Singleton< T >::release (  )  [inline, inherited]

Definition at line 40 of file Singleton.hh.

References Singleton< T >::m_singleton.

const std::string& slic::Module::getName (  )  const [inline, inherited]

Definition at line 48 of file Module.hh.

References slic::Module::m_name.

Referenced by slic::ModuleRegistry::deregisterModule(), slic::Module::Module(), slic::ModuleRegistry::registerModule(), and slic::Module::~Module().

const ModuleStatus slic::Module::getStatus (  )  const [inline, inherited]

Definition at line 52 of file Module.hh.

References slic::Module::m_status.

virtual void slic::Module::reset (  )  [inline, virtual, inherited]

Reimplemented in slic::EventSource, slic::EventSourceWithInputFile, slic::LcioManager, and slic::LcioMcpManager.

Definition at line 59 of file Module.hh.

virtual void slic::Module::cleanup ( void   )  [inline, virtual, inherited]

Definition at line 62 of file Module.hh.

bool slic::Module::deleteOnExit (  )  [inline, inherited]

Definition at line 65 of file Module.hh.

References slic::Module::m_deleteOnExit.

LogStream& slic::Module::log (  )  [inline, inherited]

Definition at line 70 of file Module.hh.

References slic::Module::m_log.

Referenced by slic::PhysicsListFactory::addBuilder(), slic::EventDebugger::addDebugEvent(), slic::LcioHitsCollectionBuilder::addMcpContribs(), slic::StdHepToLcioConvertor::addMcpDaughter(), slic::StdHepToLcioConvertor::addMcpParent(), slic::TrajectoryManager::addTrackIDToTrajectoryLink(), slic::EventAction::BeginOfEventAction(), slic::EventSourceWithInputFile::beginRun(), slic::StdHepToLcioConvertor::checkParentage(), slic::LcioMcpPrinter::colLabels(), slic::TrajectoryManager::copySecondaryTrackInformationFromParent(), slic::PhysicsListFactory::create(), slic::LcioMcpFactory::createDaughtersFromPrimary(), slic::EventSourceManager::createEventSource(), slic::LcioHitsCollectionBuilder::createHit(), slic::LcioHitsCollectionBuilder::createHitCollections(), slic::LcioMcpManager::createMcpCollection(), slic::LcioMcpFactory::createMcpFromInitialAndPrimary(), slic::StdHepToLcioConvertor::createMcpFromStdHep(), slic::StdHepLoader::dumpCurrentEvent(), slic::StdHepEventSource::dumpCurrentEvent(), slic::ParticleGunEventSource::dumpCurrentEvent(), slic::LcioEventSource::dumpCurrentEvent(), slic::GPSEventSource::dumpCurrentEvent(), slic::EventDebugger::execCleanupMacro(), slic::EventDebugger::execDebugMacro(), slic::StdHepToLcioConvertor::fillCurrentMcpCollectionFromStdHep(), slic::TrajectoryManager::fillTrackIDToTrajectoryMap(), slic::LcioMcpFilter::filterSimParticles(), slic::LcioHitsCollectionBuilder::findMcpHitContribByTrackID(), slic::TrajectoryManager::findTrajectory(), slic::LcioMcpPrinter::flagLabels(), slic::LcioMcpPrinter::foot(), slic::G4MagIntegratorStepperFactory::G4MagIntegratorStepperFactory(), slic::EventSourceManager::generate(), slic::LcioEventSource::getCurrentMcpLCCollection(), slic::LcioFileNamer::getFieldValue(), slic::TrajectoryManager::getNumberOfSecondariesAtEnd(), slic::EventSourceManager::getSourceTypeFromFileExtension(), slic::TrajectoryManager::handleSecondaryTrack(), slic::LcioMcpPrinter::head(), initialize(), slic::PhysicsListManager::initializePhysicsList(), initializeUI(), slic::LcioMcpPrinter::line(), slic::SlicMain::main(), slic::LcioManager::makeAutoname(), slic::StdHepToLcioConvertor::makeIndexVec(), slic::Module::Module(), slic::LcioEventSource::open(), slic::LcioManager::openLcioFile(), slic::StdHepLoader::openStdHepFile(), slic::TrajectoryManager::postTracking(), slic::TrajectoryManager::preTracking(), slic::ModuleRegistry::print(), slic::PhysicsListFactory::printAvailableLists(), slic::PrimaryGeneratorAction::printBeginEventMessage(), slic::RunAction::printBeginOfRunMessage(), slic::StdHepToLcioConvertor::printDaughters(), slic::EventAction::printEndEventMessage(), slic::RunAction::printEndOfRunMessage(), slic::StdHepToLcioConvertor::printIndex(), slic::LcioMcpMaps::printInitMcpToMcpMap(), slic::LcioMcpMaps::printMaps(), slic::LcioMcpPrinter::printMcp(), slic::LcioMcpPrinter::printMcpCollection(), slic::LcioMcpManager::printMcpCollection(), slic::LcioMcpMaps::printMcpToPrimaryMap(), slic::StdHepToLcioConvertor::printMothers(), slic::EventSourceManager::printNumEventsGenerated(), slic::CommandLineProcessor::printOptions(), slic::CommandQueue::printOut(), slic::TrajectoryManager::printPhysVolDbg(), slic::TrajectoryManager::printSecondaries(), printSplashScreen(), slic::TrajectoryManager::printStatusFlags(), slic::TrajectoryManager::printTrack(), slic::StdHepToLcioConvertor::printTrack(), slic::TrajectoryManager::printTrackIDToTrajectoryMap(), slic::LcioMcpMaps::printTrackToMcpMap(), slic::TrajectoryManager::printTrajectory(), slic::CommandLineProcessor::printUsage(), slic::CommandLineProcessor::printVersion(), slic::CommandLineProcessor::process(), slic::StdHepLoader::readNextEvent(), slic::LcioMcpManager::registerMcpCollection(), slic::ModuleRegistry::registerModule(), run(), slic::LcioMcpPrinter::sep(), slic::PhysicsListManager::setCurrentListName(), slic::LcioManager::setDetectorName(), slic::LcioManager::setFileExistsAction(), slic::EventSourceWithInputFile::setFilename(), slic::LcioHitsCollectionBuilder::setLongFlag(), slic::SlicApplicationMessenger::SetNewValue(), slic::PhysicsMessenger::SetNewValue(), slic::GeneratorMessenger::SetNewValue(), slic::FieldMessenger::SetNewValue(), slic::LcioHitsCollectionBuilder::setPDGFlag(), slic::LcioManager::setRunNumber(), slic::TrajectoryManager::setTrajectoryFinalStatus(), slic::StdHepToLcioConvertor::setupDaughters(), slic::EventSourceManager::setupEventSource(), slic::PhysicsListManager::setupOpticalProcesses(), slic::StdHepToLcioConvertor::setupParents(), slic::PhysicsListManager::setupUserLimitsProcesses(), SlicApplication(), slic::EventAction::startEventTimer(), slic::RunAction::startRunTimer(), slic::EventAction::stopEventTimer(), slic::RunAction::stopRunTimer(), slic::Module::~Module(), and ~SlicApplication().

virtual void slic::Module::beginEvent ( const G4Event *   )  [inline, virtual, inherited]

Reimplemented in slic::EventDebugger, slic::EventSource, slic::EventSourceManager, slic::EventSourceWithInputFile, slic::LcioEventSource, slic::LcioMcpManager, slic::StdHepEventSource, and slic::TrajectoryManager.

Definition at line 75 of file Module.hh.

virtual void slic::Module::endEvent ( const G4Event *   )  [inline, virtual, inherited]

Reimplemented in slic::EventDebugger, slic::EventSource, slic::EventSourceManager, slic::LcioManager, and slic::LcioMcpManager.

Definition at line 78 of file Module.hh.

virtual void slic::Module::beginRun ( const G4Run *   )  [inline, virtual, inherited]

Reimplemented in slic::EventDebugger, slic::EventSource, slic::EventSourceManager, slic::EventSourceWithInputFile, slic::LcioEventSource, slic::LcioManager, and slic::StdHepEventSource.

Definition at line 81 of file Module.hh.

virtual void slic::Module::endRun ( const G4Run *   )  [inline, virtual, inherited]

Reimplemented in slic::EventSource, slic::EventSourceManager, and slic::LcioManager.

Definition at line 84 of file Module.hh.

virtual void slic::Module::preTracking ( const G4Track *   )  [inline, virtual, inherited]

Reimplemented in slic::TrajectoryManager.

Definition at line 87 of file Module.hh.

virtual void slic::Module::postTracking ( const G4Track *   )  [inline, virtual, inherited]

Reimplemented in slic::TrajectoryManager.

Definition at line 90 of file Module.hh.

virtual void slic::Module::stepping ( const G4Step *   )  [inline, virtual, inherited]

Reimplemented in slic::TrajectoryManager.

Definition at line 93 of file Module.hh.

G4ClassificationOfNewTrack slic::Module::stackingClassifyNewTrack ( const G4Track *   )  [inline, inherited]

Definition at line 96 of file Module.hh.

void slic::Module::stackingNewStage (  )  [inline, inherited]

Definition at line 103 of file Module.hh.

void slic::Module::stackingPrepareNewEvent (  )  [inline, inherited]

Definition at line 106 of file Module.hh.


Member Data Documentation

G4UIsession* slic::SlicApplication::m_session [protected]

Initialize the Geant4 visualization subsystem.

Definition at line 192 of file SlicApplication.hh.

Referenced by initializeUI(), run(), and ~SlicApplication().

SlicApplicationMessenger* slic::SlicApplication::m_appMessenger [protected]

Definition at line 200 of file SlicApplication.hh.

Referenced by initialize(), and ~SlicApplication().

FieldMessenger* slic::SlicApplication::m_fieldMessenger [protected]

Definition at line 203 of file SlicApplication.hh.

RunManager* slic::SlicApplication::m_runManager [protected]

Definition at line 205 of file SlicApplication.hh.

Referenced by getRunManager(), initialize(), initializeLCDD(), initializePrimaryGeneratorAction(), and initializeUserActions().

ERunMode slic::SlicApplication::m_mode [protected]

Definition at line 208 of file SlicApplication.hh.

Referenced by getMode(), and setMode().

int slic::SlicApplication::m_returnCode [protected]

Definition at line 211 of file SlicApplication.hh.

Referenced by getReturnCode(), and setReturnCode().

bool slic::SlicApplication::m_setRunAbort [protected]

Definition at line 214 of file SlicApplication.hh.

Referenced by isAborting(), and setAborting().

bool slic::SlicApplication::m_isInitialized [protected]

Definition at line 217 of file SlicApplication.hh.

Referenced by initialize(), and run().

std::string slic::SlicApplication::m_binaryname [protected]

Definition at line 220 of file SlicApplication.hh.

Referenced by getBinaryName(), initialize(), and setBinaryBasename().

std::string slic::SlicApplication::m_binarybasename [protected]

Definition at line 221 of file SlicApplication.hh.

Referenced by getBinaryBasename(), and setBinaryBasename().

std::string* slic::SlicApplication::m_geant4VersionString [protected]

Definition at line 224 of file SlicApplication.hh.

Referenced by getGeant4VersionString().

ModuleStatus slic::Module::m_status [inherited]

Definition at line 110 of file Module.hh.

Referenced by slic::Module::getStatus().

std::string slic::Module::m_name [inherited]

Reimplemented in slic::EventSource.

Definition at line 111 of file Module.hh.

Referenced by slic::Module::getName(), and slic::Module::Module().

LogStream slic::Module::m_log [inherited]

Definition at line 112 of file Module.hh.

Referenced by slic::Module::log(), and slic::Module::Module().

bool slic::Module::m_deleteOnExit [inherited]

Definition at line 113 of file Module.hh.

Referenced by slic::Module::deleteOnExit().


The documentation for this class was generated from the following files:
Generated on Thu Nov 15 15:24:43 2007 for Simulator for the Linear Collider by  doxygen 1.5.4