k4SimGeant4
Loading...
Searching...
No Matches
SimG4Alg Class Reference

Geant simulation algorithm. More...

#include <SimG4Alg.h>

Inheritance diagram for SimG4Alg:
Collaboration diagram for SimG4Alg:

Public Member Functions

 SimG4Alg (const std::string &, ISvcLocator *)
 
virtual ~SimG4Alg ()
 
virtual StatusCode initialize () final
 Initialize.
 
virtual StatusCode execute (const EventContext &) const final
 Execute the simulation.
 
virtual StatusCode finalize () final
 Finalize.
 

Private Attributes

ServiceHandle< ISimG4Svcm_geantSvc
 Pointer to the interface of Geant simulation service.
 
PublicToolHandleArray< ISimG4SaveOutputToolm_saveTools
 Handle to the tools saving the output.
 
ToolHandle< ISimG4EventProviderToolm_eventTool
 Handle for the tool that creates the G4Event.
 

Detailed Description

Geant simulation algorithm.

Controls the event flow: translates the EDM event to G4Event, passes it to SimG4Svc, retrieves it after the finished simulation, and stores the output as specified in tools. It takes MCParticleCollection ('genParticles') as the input as well as a list of names of tools that define the EDM output ('outputs'). For more information please see.

Author
Anna Zaborowska

Constructor & Destructor Documentation

◆ SimG4Alg()

SimG4Alg::SimG4Alg ( const std::string & aName,
ISvcLocator * aSvcLoc )
explicit

◆ ~SimG4Alg()

SimG4Alg::~SimG4Alg ( )
virtual

Member Function Documentation

◆ execute()

StatusCode SimG4Alg::execute ( const EventContext & ) const
finalvirtual

Execute the simulation.

Translation of MCParticleCollection to G4Event is done using EDM2G4() method. Then, G4Event is passed to SimG4Svc for the simulation and retrieved afterwards. The tools m_saveTools are used to save the output from the retrieved events. Finally, the event is terminated.

Returns
status code

◆ finalize()

StatusCode SimG4Alg::finalize ( )
finalvirtual

Finalize.

Returns
status code

◆ initialize()

StatusCode SimG4Alg::initialize ( )
finalvirtual

Initialize.

Returns
status code

Member Data Documentation

◆ m_eventTool

ToolHandle<ISimG4EventProviderTool> SimG4Alg::m_eventTool
mutableprivate
Initial value:
{
"SimG4PrimariesFromEdmTool", this}

Handle for the tool that creates the G4Event.

◆ m_geantSvc

ServiceHandle<ISimG4Svc> SimG4Alg::m_geantSvc
private

Pointer to the interface of Geant simulation service.

◆ m_saveTools

PublicToolHandleArray<ISimG4SaveOutputTool> SimG4Alg::m_saveTools
mutableprivate
Initial value:
{
this, "outputs", {}}

Handle to the tools saving the output.


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