k4SimGeant4
Loading...
Searching...
No Matches
sim::RunManager Class Reference

#include <SimG4Common/include/SimG4Common/RunManager.h>

Inheritance diagram for sim::RunManager:
Collaboration diagram for sim::RunManager:

Public Member Functions

 RunManager ()
 Constructor.
 
 ~RunManager ()
 Destructor.
 
StatusCode start ()
 Initialization.
 
StatusCode processEvent (G4Event &aEvent)
 Processing of the event.
 
StatusCode retrieveEvent (G4Event *&aEvent)
 Retrieves an event.
 
StatusCode terminateEvent ()
 Termination of the event processing.
 
void finalize ()
 Finalization.
 

Private Attributes

bool m_prevEventTerminated
 Flag indicating if the previous Event was terminated in Geant successfuly.
 
ServiceHandle< IMessageSvc > m_msgSvc
 Message Service.
 
MsgStream m_log
 Message Stream.
 

Constructor & Destructor Documentation

◆ RunManager()

RunManager::RunManager ( )

Constructor.

◆ ~RunManager()

RunManager::~RunManager ( )

Destructor.

Member Function Documentation

◆ finalize()

void RunManager::finalize ( )

Finalization.

◆ processEvent()

StatusCode RunManager::processEvent ( G4Event & aEvent)

Processing of the event.

It substitutes the G4RunManager::ProcessOneEvent(int) method (excluding the generation part). It checks if the previous event has been fully processed (including a call to terminateEvent()) and begins its simulation.

Warning
Each call to processEvent() should be followed by a call to terminateEvent().
Parameters
[in]aEventa generated event to be processed in a simulation
Returns
the status code

◆ retrieveEvent()

StatusCode RunManager::retrieveEvent ( G4Event *& aEvent)

Retrieves an event.

It allows to retrieve the event containing the data that may be stored (eg. collections of hits in the sensitive detectors). The lifetime of the pointer to G4Event ends when method terminateEvent() is called.

Parameters
[out]aEventa processed event
Returns
the status code

◆ start()

StatusCode RunManager::start ( )

Initialization.

It substitutes the G4RunManager::BeamOn() method (excluding the loop over the events). Checks on the state of the Geant4 (proper initialization of the geometry, physics list, kernel and also if no other simulation has been already running).

Warning
This method should be called after calling SetUserInitialization(G4VUserDetectorConstruction*) and SetUserInitialization(G4VUserPhysicsList*).
Returns
the status code

◆ terminateEvent()

StatusCode RunManager::terminateEvent ( )

Termination of the event processing.

Returns
the status code

Member Data Documentation

◆ m_log

MsgStream sim::RunManager::m_log
private

Message Stream.

◆ m_msgSvc

ServiceHandle<IMessageSvc> sim::RunManager::m_msgSvc
private

Message Service.

◆ m_prevEventTerminated

bool sim::RunManager::m_prevEventTerminated
private

Flag indicating if the previous Event was terminated in Geant successfuly.


The documentation for this class was generated from the following files: