SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
Public Member Functions | Protected Attributes | List of all members
UserActionPlugin Class Referenceabstract

User simulation plugin. More...

#include <UserActionPlugin.hh>

Inheritance diagram for UserActionPlugin:
DummySimPlugin PairConvFilter StepPrinter

Public Member Functions

virtual ~UserActionPlugin ()
 
virtual void beginEvent (const G4Event *)
 
virtual void beginRun (const G4Run *)
 
virtual void endEvent (const G4Event *)
 
virtual void endRun (const G4Run *)
 
virtual void generatePrimary (G4Event *)
 
virtual std::string getName ()=0
 
int getVerboseLevel ()
 
virtual bool hasEventAction ()
 
virtual bool hasPrimaryGeneratorAction ()
 
virtual bool hasRunAction ()
 
virtual bool hasStackingAction ()
 
virtual bool hasSteppingAction ()
 
virtual bool hasTrackingAction ()
 
virtual void postTracking (const G4Track *)
 
virtual void preTracking (const G4Track *)
 
void setVerboseLevel (int verbose)
 
virtual G4ClassificationOfNewTrack stackingClassifyNewTrack (const G4Track *, const G4ClassificationOfNewTrack &currentTrackClass)
 
virtual void stackingNewStage ()
 
virtual void stackingPrepareNewEvent ()
 
virtual void stepping (const G4Step *)
 

Protected Attributes

int verbose_ { 1 }
 

Detailed Description

User simulation plugin.

Note
This class defines a plugin interface to the Geant4 simulation engine which is activated in the "user action" hooks. An implementation class must define "create" and "destroy" functions as entry points for the dynamic library loading. By default, the plugin does not activate any of the user actions, and the user should override the methods which return boolean flags to activate these hooks.
Here are examples of the static functions that should be defined for creating and destroying the plugin in the class's source file, assuming that the plugin is called DummySimPlugin.
Example create function:
Example destroy function:

Definition at line 44 of file UserActionPlugin.hh.

Constructor & Destructor Documentation

◆ ~UserActionPlugin()

virtual ~UserActionPlugin ( )
inlinevirtual

Class destructor.

Definition at line 51 of file UserActionPlugin.hh.

Member Function Documentation

◆ beginEvent()

virtual void beginEvent ( const G4Event *  )
inlinevirtual

Begin of event action.

Reimplemented in DummySimPlugin.

Definition at line 163 of file UserActionPlugin.hh.

◆ beginRun()

virtual void beginRun ( const G4Run *  )
inlinevirtual

Begin of run action.

Reimplemented in DummySimPlugin.

Definition at line 133 of file UserActionPlugin.hh.

◆ endEvent()

virtual void endEvent ( const G4Event *  )
inlinevirtual

End of event action.

Reimplemented in DummySimPlugin, and PairConvFilter.

Definition at line 169 of file UserActionPlugin.hh.

◆ endRun()

virtual void endRun ( const G4Run *  )
inlinevirtual

End of run action.

Reimplemented in PairConvFilter, and DummySimPlugin.

Definition at line 139 of file UserActionPlugin.hh.

◆ generatePrimary()

virtual void generatePrimary ( G4Event *  )
inlinevirtual

Generate primary action.

Reimplemented in DummySimPlugin.

Definition at line 175 of file UserActionPlugin.hh.

◆ getName()

virtual std::string getName ( )
pure virtual

Get the name of the plugin. The user must override this function.

Returns
The name of the plugin.

Implemented in DummySimPlugin, StepPrinter, and PairConvFilter.

Referenced by UserActionPluginMessenger::UserActionPluginMessenger(), PluginLoader::destroy(), and UserActionPluginMessenger::SetNewValue().

◆ getVerboseLevel()

int getVerboseLevel ( )
inline

Get the current verbose level.

Returns
The current verbose level.

Definition at line 78 of file UserActionPlugin.hh.

References UserActionPlugin::verbose_.

Referenced by UserActionPluginMessenger::SetNewValue().

◆ hasEventAction()

virtual bool hasEventAction ( )
inlinevirtual

Get whether this plugin implements the event action.

Returns
True if the plugin implements the event action.

Reimplemented in PairConvFilter, and DummySimPlugin.

Definition at line 110 of file UserActionPlugin.hh.

◆ hasPrimaryGeneratorAction()

virtual bool hasPrimaryGeneratorAction ( )
inlinevirtual

Get whether this plugin implements the primary generator action.

Returns
True if the plugin implements the primary generator action.

Reimplemented in DummySimPlugin.

Definition at line 126 of file UserActionPlugin.hh.

◆ hasRunAction()

virtual bool hasRunAction ( )
inlinevirtual

Get whether this plugin implements the run action.

Returns
True if the plugin implements the run action.

Reimplemented in PairConvFilter, and DummySimPlugin.

Definition at line 86 of file UserActionPlugin.hh.

◆ hasStackingAction()

virtual bool hasStackingAction ( )
inlinevirtual

Get whether this plugin implements the stacking action.

Returns
True if the plugin implements the stacking action.

Reimplemented in PairConvFilter, and DummySimPlugin.

Definition at line 118 of file UserActionPlugin.hh.

◆ hasSteppingAction()

virtual bool hasSteppingAction ( )
inlinevirtual

Get whether this plugin implements the stepping action.

Returns
True if the plugin implements the stepping action.

Reimplemented in PairConvFilter, DummySimPlugin, and StepPrinter.

Definition at line 94 of file UserActionPlugin.hh.

◆ hasTrackingAction()

virtual bool hasTrackingAction ( )
inlinevirtual

Get whether this plugin implements the tracking action.

Returns
True if the plugin implements the tracking action.

Reimplemented in DummySimPlugin.

Definition at line 102 of file UserActionPlugin.hh.

◆ postTracking()

virtual void postTracking ( const G4Track *  )
inlinevirtual

Post-tracking action.

Reimplemented in DummySimPlugin.

Definition at line 157 of file UserActionPlugin.hh.

◆ preTracking()

virtual void preTracking ( const G4Track *  )
inlinevirtual

Pre-tracking action.

Reimplemented in DummySimPlugin.

Definition at line 151 of file UserActionPlugin.hh.

◆ setVerboseLevel()

void setVerboseLevel ( int  verbose)
inline

Set the verbose level of the plugin (1-4).

Parameters
verboseThe verbose level of the plugin.

Definition at line 65 of file UserActionPlugin.hh.

References LOG::verbose, and UserActionPlugin::verbose_.

Referenced by UserActionPluginMessenger::SetNewValue().

◆ stackingClassifyNewTrack()

virtual G4ClassificationOfNewTrack stackingClassifyNewTrack ( const G4Track *  ,
const G4ClassificationOfNewTrack &  currentTrackClass 
)
inlinevirtual

Classify a new track.

Parameters
currentTrackClassThe current track classification.
Returns
The current track classification returned by default.

Reimplemented in DummySimPlugin, and PairConvFilter.

Definition at line 183 of file UserActionPlugin.hh.

◆ stackingNewStage()

virtual void stackingNewStage ( )
inlinevirtual

New stacking stage action.

Reimplemented in DummySimPlugin.

Definition at line 190 of file UserActionPlugin.hh.

◆ stackingPrepareNewEvent()

virtual void stackingPrepareNewEvent ( )
inlinevirtual

New event stacking action.

Reimplemented in DummySimPlugin.

Definition at line 196 of file UserActionPlugin.hh.

◆ stepping()

virtual void stepping ( const G4Step *  )
inlinevirtual

Stepping action.

Reimplemented in StepPrinter, PairConvFilter, and DummySimPlugin.

Definition at line 145 of file UserActionPlugin.hh.

Member Data Documentation

◆ verbose_

int verbose_ { 1 }
protected

Protected access to verbose level for convenience of sub-classes.

Definition at line 202 of file UserActionPlugin.hh.

Referenced by UserActionPlugin::getVerboseLevel(), and UserActionPlugin::setVerboseLevel().


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