MarlinMT  0.1.0
marlinmt::GeometryPlugin Class Referenceabstract

GeometryPlugin class Responsible for loading geometry in Marlin and providing access to it through the GeometryManager. More...

#include <GeometryPlugin.h>

Inherits marlinmt::Component.

Inherited by marlinmt::DD4hepGeometry, marlinmt::EmptyGeometry, and marlinmt::GearGeometry.

Public Member Functions

 GeometryPlugin ()=delete
 
virtual ~GeometryPlugin ()=default
 
 GeometryPlugin (const GeometryPlugin &)=delete
 
GeometryPluginoperator= (const GeometryPlugin &)=delete
 
virtual std::type_index typeIndex () const =0
 Get a type index object from the geometry handle. More...
 
virtual void dumpGeometry () const =0
 Dump the geometry in the console. More...
 
void print () const
 Print the complete geometry plugin description. More...
 
- Public Member Functions inherited from marlinmt::Component
 Component ()=delete
 No default constructor. More...
 
 Component (const Component &)=delete
 No copy or assignement. More...
 
Componentoperator= (const Component &)=delete
 
virtual ~Component ()=default
 Default destructor. More...
 
 Component (const std::string &type)
 Constructor with component type. More...
 
const std::string & type () const
 Get the component name. More...
 
const std::string & name () const
 Get the component name. More...
 
void setName (const std::string &n)
 Set the component name. More...
 
const std::string & description () const
 Get the component description. More...
 
void setDescription (const std::string &desc)
 Set the component description. More...
 
const Applicationapplication () const
 Get the application in which the component is registered. More...
 
Applicationapplication ()
 Get the application in which the component is registered. More...
 
template<class T >
Logging::StreamType log () const
 Log a message with specific log level. More...
 
Logging::StreamType debug () const
 Shortcut for log<DEBUG>() More...
 
Logging::StreamType message () const
 Shortcut for log<MESSAGE>() More...
 
Logging::StreamType warning () const
 Shortcut for log<WARNING>() More...
 
Logging::StreamType error () const
 Shortcut for log<ERROR>() More...
 
void setVerbosity (const std::string &level)
 Set the verbosity level. More...
 
const std::string & verbosity () const
 Get the verbosity level. More...
 
bool isInitialized () const
 Whether the component has been initialized. More...
 
void setup (Application *app)
 Setup the component. More...
 
void printParameters () const
 Print the component parameters. More...
 
template<class T >
void printParameters () const
 Print the component parameters at specific verbosity. More...
 
void setParameters (const ConfigSection &section, bool throwIfNotFound=false)
 Set the parameters from the configuration section. More...
 
void getParameters (ConfigSection &section, const std::set< std::string > &exclude={}) const
 Get the parameters from configurable object and populate the config section with. More...
 
- Public Member Functions inherited from marlinmt::Configurable
 Configurable ()=default
 
virtual ~Configurable ()=default
 
template<typename T >
std::shared_ptr< ParameterImpladdParameter (EParameterType paramType, const std::string &name, const std::string &desc, std::shared_ptr< T > value)
 Add a parameter. More...
 
template<typename T >
std::shared_ptr< ParameterImpladdParameter (EParameterType paramType, const std::string &name, const std::string &desc, std::shared_ptr< T > value, T defVal)
 Add a parameter. More...
 
template<typename T >
parameter (const std::string &name) const
 Get a parameter value. More...
 
template<typename T >
parameter (const std::string &name, const T &fallback) const
 Get a parameter value. More...
 
void checkParameter (const std::string &name) const
 Check if the parameter has been registered. More...
 
bool exists (const std::string &name) const
 Return true if the parameter has been registered. More...
 
bool isSet (const std::string &name) const
 Returns true if the parameter exists and is set, false otherwise. More...
 
void clear ()
 Remove all parameters. More...
 
void unset ()
 Unset all registered parameters. More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 

Protected Member Functions

 GeometryPlugin (const std::string &gtype)
 Constructor. More...
 
virtual void loadGeometry ()=0
 Load the geometry. More...
 
virtual const void * handle () const =0
 Get a handle on the geometry instance. More...
 
virtual void destroy ()=0
 Cleanup geometry. More...
 
virtual void initialize () override
 Init the geometry plugin. More...
 

Protected Attributes

BoolParameter _dumpGeometry {*this, "DumpGeometry", "Whether to dump the geometry on creation", false}
 Whether to dump the geometry on creation. More...
 
- Protected Attributes inherited from marlinmt::Component
std::string _type {}
 The component type. More...
 
std::string _name {}
 The component name. More...
 
std::string _description {"No description"}
 The component description. More...
 
Application_application {nullptr}
 The application in which the component has been registered. More...
 
LoggerPtr _logger {nullptr}
 The logger instance. More...
 
StringParameter _verbosity { *this, "Verbosity", "The component verbosity level", "MESSAGE" }
 The verbosity level of the logger (parameter) More...
 
- Protected Attributes inherited from marlinmt::Configurable
ParameterMap _parameters {}
 The parameter map. More...
 

Friends

class GeometryManager
 

Additional Inherited Members

- Public Types inherited from marlinmt::Component
using LoggerPtr = Logging::Logger
 
- Public Types inherited from marlinmt::Configurable
using ParameterMap = std::map< std::string, std::shared_ptr< ParameterImpl > >
 
using iterator = ParameterMap::iterator
 
using const_iterator = ParameterMap::const_iterator
 

Detailed Description

GeometryPlugin class Responsible for loading geometry in Marlin and providing access to it through the GeometryManager.

Definition at line 22 of file GeometryPlugin.h.

Constructor & Destructor Documentation

◆ GeometryPlugin() [1/3]

marlinmt::GeometryPlugin::GeometryPlugin ( )
delete

◆ ~GeometryPlugin()

virtual marlinmt::GeometryPlugin::~GeometryPlugin ( )
virtualdefault

◆ GeometryPlugin() [2/3]

marlinmt::GeometryPlugin::GeometryPlugin ( const GeometryPlugin )
delete

◆ GeometryPlugin() [3/3]

marlinmt::GeometryPlugin::GeometryPlugin ( const std::string &  gtype)
protected

Constructor.

To be called by sub classes

Parameters
gtypethe geometry type

Definition at line 9 of file GeometryPlugin.cc.

References marlinmt::Component::setName().

Member Function Documentation

◆ destroy()

virtual void marlinmt::GeometryPlugin::destroy ( )
protectedpure virtual

◆ dumpGeometry()

virtual void marlinmt::GeometryPlugin::dumpGeometry ( ) const
pure virtual

Dump the geometry in the console.

Implemented in marlinmt::DD4hepGeometry, marlinmt::GearGeometry, and marlinmt::EmptyGeometry.

Referenced by print().

◆ handle()

virtual const void* marlinmt::GeometryPlugin::handle ( ) const
protectedpure virtual

Get a handle on the geometry instance.

Implemented in marlinmt::DD4hepGeometry, marlinmt::GearGeometry, and marlinmt::EmptyGeometry.

Referenced by print().

◆ initialize()

void marlinmt::GeometryPlugin::initialize ( )
overrideprotectedvirtual

Init the geometry plugin.

Reimplemented from marlinmt::Component.

Definition at line 35 of file GeometryPlugin.cc.

References marlinmt::Component::application(), marlinmt::Application::configuration(), and marlinmt::Component::setParameters().

◆ loadGeometry()

virtual void marlinmt::GeometryPlugin::loadGeometry ( )
protectedpure virtual

◆ operator=()

GeometryPlugin& marlinmt::GeometryPlugin::operator= ( const GeometryPlugin )
delete

◆ print()

void marlinmt::GeometryPlugin::print ( ) const

Print the complete geometry plugin description.

Definition at line 16 of file GeometryPlugin.cc.

References _dumpGeometry, marlinmt::Component::description(), dumpGeometry(), handle(), marlinmt::Component::message(), marlinmt::Component::name(), and typeIndex().

◆ typeIndex()

virtual std::type_index marlinmt::GeometryPlugin::typeIndex ( ) const
pure virtual

Get a type index object from the geometry handle.

Implemented in marlinmt::DD4hepGeometry, marlinmt::GearGeometry, and marlinmt::EmptyGeometry.

Referenced by print().

Friends And Related Function Documentation

◆ GeometryManager

friend class GeometryManager
friend

Definition at line 23 of file GeometryPlugin.h.

Member Data Documentation

◆ _dumpGeometry

BoolParameter marlinmt::GeometryPlugin::_dumpGeometry {*this, "DumpGeometry", "Whether to dump the geometry on creation", false}
protected

Whether to dump the geometry on creation.

Definition at line 77 of file GeometryPlugin.h.

Referenced by print().


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