allpix::DatabaseWriterModule

Module: Modules

Module to write object data to PostgreSQL databases. More…

#include <DatabaseWriterModule.hpp>

Inherits from allpix::SequentialModule, allpix::Module

Public Functions

Name
DatabaseWriterModule(Configuration & config, Messenger * messenger, GeometryManager * geo_mgr)
Constructor for this unique module.
bool filter(const std::shared_ptr< BaseMessage > & message, const std::string & name) const
Receive a single message containing objects of arbitrary type.
virtual void initializeThread() override
Initialize per-thread database connections.
virtual void run(Event * event) override
Writes the objects fetched to their specific tree, constructing trees on the fly for new objects.
virtual void finalizeThread() override
CLose database connections from each of the threads.
virtual void finalize() override
Add the main configuration and the detector setup to the data file and write it, also write statistics information.

Additional inherited members

Public Functions inherited from allpix::SequentialModule

Name
SequentialModule(Configuration & config)
SequentialModule(Configuration & config, std::shared_ptr< Detector > detector)

Protected Functions inherited from allpix::SequentialModule

Name
void waive_sequence_requirement(bool waive =true)
Release strict sequence processing requirement.

Friends inherited from allpix::SequentialModule

Name
class Event
class ModuleManager
class Messenger

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 initialize()
Initialize the module before the event sequence.

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::DatabaseWriterModule;

Module to write object data to PostgreSQL databases.

Listens to all objects dispatched in the framework and stores a representation of every object to the specified database.

Public Functions Documentation

function DatabaseWriterModule

DatabaseWriterModule(
    Configuration & config,
    Messenger * messenger,
    GeometryManager * geo_mgr
)

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_mgr Pointer to the geometry manager, containing the detectors

function filter

bool filter(
    const std::shared_ptr< BaseMessage > & message,
    const std::string & name
) const

Receive a single message containing objects of arbitrary type.

Parameters:

  • message Message dispatched in the framework
  • name Name of the message

function initializeThread

virtual void initializeThread() override

Initialize per-thread database connections.

Reimplements: allpix::Module::initializeThread

function run

virtual void run(
    Event * event
) override

Writes the objects fetched to their specific tree, constructing trees on the fly for new objects.

Reimplements: allpix::Module::run

function finalizeThread

virtual void finalizeThread() override

CLose database connections from each of the threads.

Reimplements: allpix::Module::finalizeThread

function finalize

virtual void finalize() override

Add the main configuration and the detector setup to the data file and write it, also write statistics information.

Reimplements: allpix::Module::finalize


Updated on 2024-12-13 at 08:31:37 +0000