EventHandler Class Reference
[modules - functions to process raw data in series]

Master class which controls processing events by enabled modules. More...

#include <EventHandler.hh>

Inheritance diagram for EventHandler:
ParameterList VParameterNode

List of all members.

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.
BaseModuleGetModule (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.
runinfoGetRunInfo ()
 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 EventHandlerGetInstance ()
 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.
EventHandleroperator= (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

Detailed Description

Master class which controls processing events by enabled modules.

Definition at line 23 of file EventHandler.hh.


Member Function Documentation

template<class Module >
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.

Todo:
: should we get rid of this?

Definition at line 20 of file AddCommonModules.cc.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 20 Jun 2014 for daqman by  doxygen 1.6.1