allpix::DummyModule
Module: Modules
Module which serves as a demonstrator and wireframe for new modules. More…
#include <DummyModule.hpp>
Inherits from allpix::Module
Public Functions
Name | |
---|---|
DummyModule(Configuration & config, Messenger * messenger, GeometryManager * geo_manager) Constructor for this unique module. |
|
virtual void | initialize() override Initialization method of the module. |
virtual void | run(Event * event) override Run method of the module. |
virtual void | finalize() override Finalization method of the module. |
Additional inherited members
Public Functions inherited from allpix::Module
Name | |
---|---|
Module(const Module & ) =delete Copying a module is not allowed. |
|
Module & | operator=(const Module & ) =delete Copying a module is not allowed. |
Module(Module && ) =delete Disallow move behaviour (not possible with references) |
|
Module & | operator=(Module && ) =delete Disallow move behaviour (not possible with references) |
Module(Configuration & config) Base constructor for unique modules. |
|
Module(Configuration & config, std::shared_ptr< Detector > detector) Base constructor for detector modules. |
|
virtual | ~Module() Essential virtual destructor. |
std::shared_ptr< Detector > | getDetector() const Get the detector linked to this module. |
std::string | getUniqueName() const Get the unique name of this module. |
std::string | createOutputFile(const std::string & pathname, const std::string & extension ="", bool global =false, bool delete_file =false) Create and return an absolute path to be used for output from a relative path. |
TDirectory * | getROOTDirectory() const Get ROOT directory which should be used to output histograms et cetera. |
ConfigManager * | getConfigManager() const Get the config manager object to allow to read the global and other module configurations. |
bool | multithreadingEnabled() const Returns if multithreading of this module is enabled. |
virtual void | initializeThread() Initialize the module for each thread after the global initialization. |
virtual void | finalizeThread() Finalize the module after the event sequence for each thread. |
Protected Functions inherited from allpix::Module
Name | |
---|---|
void | allow_multithreading() Enable multithreading for this module. |
Configuration & | get_configuration() Get the module configuration for internal use. |
Protected Attributes inherited from allpix::Module
Name | |
---|---|
Configuration & | config_ |
Friends inherited from allpix::Module
Name | |
---|---|
class | Event |
class | ModuleManager |
class | Messenger |
class | LocalMessenger |
Detailed Description
class allpix::DummyModule;
Module which serves as a demonstrator and wireframe for new modules.
This module is only a dummy and here to demonstrate the general structure of a module with its different member methods, the messenger and event interfaces. It also serves as wireframe for new modules, which can take the structure for a quicker start.
Public Functions Documentation
function DummyModule
DummyModule(
Configuration & config,
Messenger * messenger,
GeometryManager * geo_manager
)
Constructor for this unique module.
Parameters:
- config Configuration object for this module as retrieved from the steering file
- messenger Pointer to the messenger object to allow binding to messages on the bus
- geo_manager Pointer to the geometry manager, containing the detectors
The constructor of the module is called right after the module has been instantiated. It has access to the module configuration and can set defaults and retrieve values from the config. The constructor is also the place where multithreading capabilities of the module need to be announced, and where the messenger should be notified about desired input messages that should be relayed to this module.
function initialize
virtual void initialize() override
Initialization method of the module.
Reimplements: allpix::Module::initialize
This method is called during the initialization phase of the framework. In this method, all necessary setup steps for this module should be conducted, such that the module is ready to perform simulations. Typically at this stage additional checks on compatibility of the user-configured parameters and the information such as fields and maps obtained from the detector models are implemented.
This method is called once per simulation run, before the event loop is started.
Implementing this method is optional, if no initialization is required there is no need to override and implement this method.
function run
virtual void run(
Event * event
) override
Run method of the module.
Reimplements: allpix::Module::run
This is the event processing method of the module and is called for every single event in the event loop once. The method should retrieve potentially registered messages, process them, dispatch possible output messages to the messenger of the framework, and the return control to the caller by ending the method.
function finalize
virtual void finalize() override
Finalization method of the module.
Reimplements: allpix::Module::finalize
In this method, finalization steps of the module can be performed after the event loop has been finished. This could for example comprise aggregation of final histograms, the calculation of a final value averaged over all events, or the closing of an output file.
This method is called once per simulation run, after the event loop has been finished.
Implementing this method is optional, if no finalization is required there is no need to override and implement this method.
Updated on 2025-02-27 at 14:14:46 +0000