DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Types | Public Member Functions | Protected Attributes | List of all members
dd4hep::EventHandler Class Referenceabstract

Event handler base class: Interface to all DDEve I/O actions. More...

#include <EventHandler.h>

Inheritance diagram for dd4hep::EventHandler:
dd4hep::DDG4EventHandler dd4hep::GenericEventHandler dd4hep::LCIOEventHandler

Public Types

enum  CollectionType {
  NO_COLLECTION =1<<0, PARTICLE_COLLECTION =1<<1, TRACK_COLLECTION =1<<2, CALO_HIT_COLLECTION =1<<3,
  TRACKER_HIT_COLLECTION =1<<4, HIT_COLLECTION =CALO_HIT_COLLECTION|TRACKER_HIT_COLLECTION
}
 
typedef std::pair< const char *, size_t > Collection
 Collection definition: name, size. More...
 
typedef std::map< std::string, std::vector< Collection > > TypedEventCollections
 Types collection: collections are grouped by type (class name) More...
 

Public Member Functions

 EventHandler ()=default
 Standard constructor. More...
 
virtual ~EventHandler ()
 Default destructor. More...
 
virtual bool hasEvent () const
 Check if an event is present in memory. More...
 
virtual bool hasFile () const
 Check if a data file is connected to the handler. More...
 
virtual const TypedEventCollectionsdata () const =0
 Access the map of simulation data collections. More...
 
virtual long numEvents () const =0
 Access the number of events on the current input data source (-1 if no data source connected) More...
 
virtual std::string datasourceName () const =0
 Access the data source name. More...
 
virtual size_t collectionLoop (const std::string &collection, DDEveHitActor &actor)=0
 Loop over collection and extract hit data. More...
 
virtual size_t collectionLoop (const std::string &collection, DDEveParticleActor &actor)=0
 Loop over collection and extract particle data. More...
 
virtual CollectionType collectionType (const std::string &collection) const =0
 Access to the collection type by name. More...
 
virtual bool Open (const std::string &type, const std::string &file_name)=0
 Open a new event data file. More...
 
virtual bool NextEvent ()=0
 Load the next event. More...
 
virtual bool PreviousEvent ()=0
 User overloadable function: Load the previous event. More...
 
virtual bool GotoEvent (long event_number)=0
 Goto a specified event in the file. More...
 
 ClassDef (EventHandler, 0)
 

Protected Attributes

bool m_hasFile = false
 Flag to indicate that a file is opened. More...
 
bool m_hasEvent = false
 Flag to indicate that an event is loaded. More...
 

Detailed Description

Event handler base class: Interface to all DDEve I/O actions.

Author
M.Frank
Version
1.0

Definition at line 67 of file EventHandler.h.

Member Typedef Documentation

◆ Collection

typedef std::pair<const char*,size_t> dd4hep::EventHandler::Collection

Collection definition: name, size.

Definition at line 78 of file EventHandler.h.

◆ TypedEventCollections

typedef std::map<std::string,std::vector<Collection> > dd4hep::EventHandler::TypedEventCollections

Types collection: collections are grouped by type (class name)

Definition at line 80 of file EventHandler.h.

Member Enumeration Documentation

◆ CollectionType

Enumerator
NO_COLLECTION 
PARTICLE_COLLECTION 
TRACK_COLLECTION 
CALO_HIT_COLLECTION 
TRACKER_HIT_COLLECTION 
HIT_COLLECTION 

Definition at line 69 of file EventHandler.h.

Constructor & Destructor Documentation

◆ EventHandler()

dd4hep::EventHandler::EventHandler ( )
default

Standard constructor.

◆ ~EventHandler()

virtual dd4hep::EventHandler::~EventHandler ( )
virtual

Default destructor.

Member Function Documentation

◆ ClassDef()

dd4hep::EventHandler::ClassDef ( EventHandler  ,
 
)

◆ collectionLoop() [1/2]

virtual size_t dd4hep::EventHandler::collectionLoop ( const std::string &  collection,
DDEveHitActor actor 
)
pure virtual

Loop over collection and extract hit data.

Implemented in dd4hep::DDG4EventHandler, dd4hep::GenericEventHandler, and dd4hep::LCIOEventHandler.

◆ collectionLoop() [2/2]

virtual size_t dd4hep::EventHandler::collectionLoop ( const std::string &  collection,
DDEveParticleActor actor 
)
pure virtual

Loop over collection and extract particle data.

Implemented in dd4hep::DDG4EventHandler, dd4hep::GenericEventHandler, and dd4hep::LCIOEventHandler.

◆ collectionType()

virtual CollectionType dd4hep::EventHandler::collectionType ( const std::string &  collection) const
pure virtual

Access to the collection type by name.

Implemented in dd4hep::DDG4EventHandler, dd4hep::GenericEventHandler, and dd4hep::LCIOEventHandler.

◆ data()

virtual const TypedEventCollections& dd4hep::EventHandler::data ( ) const
pure virtual

Access the map of simulation data collections.

Implemented in dd4hep::DDG4EventHandler, dd4hep::GenericEventHandler, and dd4hep::LCIOEventHandler.

◆ datasourceName()

virtual std::string dd4hep::EventHandler::datasourceName ( ) const
pure virtual

Access the data source name.

Implemented in dd4hep::DDG4EventHandler, dd4hep::GenericEventHandler, and dd4hep::LCIOEventHandler.

◆ GotoEvent()

virtual bool dd4hep::EventHandler::GotoEvent ( long  event_number)
pure virtual

Goto a specified event in the file.

Implemented in dd4hep::DDG4EventHandler, dd4hep::GenericEventHandler, and dd4hep::LCIOEventHandler.

◆ hasEvent()

virtual bool dd4hep::EventHandler::hasEvent ( ) const
inlinevirtual

Check if an event is present in memory.

Definition at line 93 of file EventHandler.h.

◆ hasFile()

virtual bool dd4hep::EventHandler::hasFile ( ) const
inlinevirtual

Check if a data file is connected to the handler.

Definition at line 95 of file EventHandler.h.

◆ NextEvent()

virtual bool dd4hep::EventHandler::NextEvent ( )
pure virtual

◆ numEvents()

virtual long dd4hep::EventHandler::numEvents ( ) const
pure virtual

Access the number of events on the current input data source (-1 if no data source connected)

Implemented in dd4hep::DDG4EventHandler, dd4hep::GenericEventHandler, and dd4hep::LCIOEventHandler.

◆ Open()

virtual bool dd4hep::EventHandler::Open ( const std::string &  type,
const std::string &  file_name 
)
pure virtual

Open a new event data file.

Implemented in dd4hep::DDG4EventHandler, dd4hep::GenericEventHandler, and dd4hep::LCIOEventHandler.

◆ PreviousEvent()

virtual bool dd4hep::EventHandler::PreviousEvent ( )
pure virtual

User overloadable function: Load the previous event.

Implemented in dd4hep::DDG4EventHandler, dd4hep::GenericEventHandler, and dd4hep::LCIOEventHandler.

Member Data Documentation

◆ m_hasEvent

bool dd4hep::EventHandler::m_hasEvent = false
protected

Flag to indicate that an event is loaded.

Definition at line 86 of file EventHandler.h.

◆ m_hasFile

bool dd4hep::EventHandler::m_hasFile = false
protected

Flag to indicate that a file is opened.

Definition at line 84 of file EventHandler.h.


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