Master class which controls processing events by enabled modules. More...
#include <EventHandler.hh>
Public Member Functions | |
~EventHandler () | |
Destructor. | |
int | AddModule (BaseModule *mod, bool processme=true, bool registerme=true) |
Add a new module to handle. If !processme, assume it's called outside. | |
BaseModule * | GetModule (const std::string &modname) |
Get a module by name, return 0 if doesn't exist. | |
template<class Module > | |
Module * | AddModule (const std::string &name=Module::GetDefaultName(), bool processme=true, bool registerme=true) |
template<class Module > | |
Module * | GetModule (const std::string &name=Module::GetDefaultName()) |
Get an already registered module by class; return null if not found. | |
int | AddCommonModules () |
Add all of the processing modules, but not writers or viewers. | |
void | AddAsyncReceiver (AsyncEventHandler *handler) |
Add an asynchronous event handler to receive processed events. | |
void | ClearAsyncReceivers () |
Clear all async receivers. | |
int | Initialize () |
Initialize all registered modules. | |
int | Process (RawEventPtr raw) |
Create an Event and process it with all enabled modules. | |
int | Process (EventPtr evt) |
Process externally created event on all enabled modules. | |
int | Finalize () |
Finalize all registered and enabled modules. | |
EventPtr | GetCurrentEvent () |
Get a pointer to the current event being processed. | |
const std::vector< BaseModule * > * | GetListOfModules () const |
Get the list of all defined modules const-ly. | |
std::vector< BaseModule * > * | GetListOfModules () |
Get the list of all defined modules. | |
const std::vector< BaseModule * > * | GetProcessingModules () const |
Get only modules that we call Process on const-ly. | |
std::vector< BaseModule * > * | GetProcessingModules () |
Get only modules that we call Process on. | |
void | SetRunID (int id) |
Set the ID number of this run. | |
int | SetRunIDFromFilename (const std::string &filename) |
Set the ID number of this run based on a filename. | |
int | GetRunID () |
Get the ID number of this run. | |
runinfo * | GetRunInfo () |
Get the database info about the run. | |
void | AllowDatabaseAccess (bool setval) |
Set whether to load calibration info from database at initialize. | |
bool | GetFailOnBadCal () const |
Check whether we are supposed to fail on bad calibration. | |
Static Public Member Functions | |
static EventHandler * | GetInstance () |
Get the global singleton pointer. | |
Private Member Functions | |
EventHandler () | |
EventHandler is singleton, so no public constructor. | |
EventHandler (const EventHandler &right) | |
EventHandler is singleton, so no public constructor. | |
EventHandler & | operator= (const EventHandler &right) |
Copy constructor private. | |
Private Attributes | |
std::vector< BaseModule * > | _modules |
std::vector< BaseModule * > | _processing_modules |
std::vector< AsyncEventHandler * > | _async_receivers |
EventPtr | _current_event |
bool | _is_initialized |
are the modules initialized? | |
int | run_id |
runinfo | _runinfo |
general metadata about the run | |
bool | _access_database |
do we query the database for missing info? | |
bool | _fail_on_bad_cal |
Fail to initialize if no calibration data found. | |
bool | _run_parallel |
process modules in parallel | |
std::vector< AsyncEventHandler * > | _para_handlers |
Master class which controls processing events by enabled modules.
Definition at line 23 of file EventHandler.hh.
Module * EventHandler::AddModule | ( | const std::string & | name = Module::GetDefaultName() , |
|
bool | processme = true , |
|||
bool | registerme = true | |||
) | [inline] |
Keep the template methods for compatibility Add a module by class
Definition at line 118 of file EventHandler.hh.
int EventHandler::AddCommonModules | ( | ) |
Add all of the processing modules, but not writers or viewers.
Definition at line 20 of file AddCommonModules.cc.