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

LCIO input event handler for DDEve: Interface class for event I/O. More...

#include <DDEve/LCIOEventHandler.h>

Inheritance diagram for dd4hep::LCIOEventHandler:
dd4hep::EventHandler

Public Types

typedef std::map< std::string, lcio::LCCollection * > Branches
 
typedef const void *(* HitAccessor_t) (const lcio::LCObject *, DDEveHit *)
 
- Public Types inherited from dd4hep::EventHandler
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

 LCIOEventHandler ()
 Standard constructor. More...
 
virtual ~LCIOEventHandler ()
 Default destructor. More...
 
virtual const TypedEventCollectionsdata () const
 Access the map of simulation data collections. More...
 
std::string datasourceName () const
 Access the data source name. More...
 
virtual long numEvents () const
 Access the number of events on the current input data source (-1 if no data source connected) More...
 
virtual CollectionType collectionType (const std::string &collection) const
 Access to the collection type by name. More...
 
virtual size_t collectionLoop (const std::string &collection, DDEveHitActor &actor)
 Call functor on hit collection. More...
 
virtual size_t collectionLoop (const std::string &collection, DDEveParticleActor &actor)
 Loop over collection and extract particle data. More...
 
virtual bool Open (const std::string &type, const std::string &file_name)
 Open new data file. More...
 
virtual bool NextEvent ()
 User overloadable function: Load the next event. More...
 
virtual bool PreviousEvent ()
 User overloadable function: Load the previous event. More...
 
virtual bool GotoEvent (long event_number)
 Goto a specified event in the file. More...
 
- Public Member Functions inherited from dd4hep::EventHandler
 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...
 
 ClassDef (EventHandler, 0)
 

Protected Attributes

lcio::LCReader * m_lcReader
 Reference to data file reader. More...
 
lcio::LCEvent * m_event
 Reference to the current LCIO event. More...
 
std::string m_fileName
 Input file name. More...
 
Branches m_branches
 Branch map. More...
 
TypedEventCollections m_data
 Data collection map. More...
 
- Protected Attributes inherited from dd4hep::EventHandler
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

LCIO input event handler for DDEve: Interface class for event I/O.

Author
M.Frank
Version
1.0

Definition at line 37 of file LCIOEventHandler.h.

Member Typedef Documentation

◆ Branches

typedef std::map<std::string,lcio::LCCollection*> dd4hep::LCIOEventHandler::Branches

Definition at line 39 of file LCIOEventHandler.h.

◆ HitAccessor_t

typedef const void*(* dd4hep::LCIOEventHandler::HitAccessor_t) (const lcio::LCObject *, DDEveHit *)

Definition at line 40 of file LCIOEventHandler.h.

Constructor & Destructor Documentation

◆ LCIOEventHandler()

LCIOEventHandler::LCIOEventHandler ( )

Standard constructor.

Definition at line 75 of file LCIOEventHandler.cpp.

◆ ~LCIOEventHandler()

LCIOEventHandler::~LCIOEventHandler ( )
virtual

Default destructor.

Definition at line 80 of file LCIOEventHandler.cpp.

Member Function Documentation

◆ collectionLoop() [1/2]

size_t LCIOEventHandler::collectionLoop ( const std::string &  collection,
DDEveHitActor actor 
)
virtual

Call functor on hit collection.

Implements dd4hep::EventHandler.

Definition at line 104 of file LCIOEventHandler.cpp.

◆ collectionLoop() [2/2]

size_t LCIOEventHandler::collectionLoop ( const std::string &  collection,
DDEveParticleActor actor 
)
virtual

Loop over collection and extract particle data.

Implements dd4hep::EventHandler.

Definition at line 125 of file LCIOEventHandler.cpp.

◆ collectionType()

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

Access to the collection type by name.

Implements dd4hep::EventHandler.

Definition at line 93 of file LCIOEventHandler.cpp.

◆ data()

virtual const TypedEventCollections& dd4hep::LCIOEventHandler::data ( ) const
inlinevirtual

Access the map of simulation data collections.

Implements dd4hep::EventHandler.

Definition at line 60 of file LCIOEventHandler.h.

◆ datasourceName()

std::string dd4hep::LCIOEventHandler::datasourceName ( ) const
inlinevirtual

Access the data source name.

Implements dd4hep::EventHandler.

Definition at line 62 of file LCIOEventHandler.h.

◆ GotoEvent()

bool LCIOEventHandler::GotoEvent ( long  event_number)
virtual

Goto a specified event in the file.

Implements dd4hep::EventHandler.

Definition at line 188 of file LCIOEventHandler.cpp.

◆ NextEvent()

bool LCIOEventHandler::NextEvent ( )
virtual

User overloadable function: Load the next event.

Load the next event.

Implements dd4hep::EventHandler.

Definition at line 158 of file LCIOEventHandler.cpp.

◆ numEvents()

long LCIOEventHandler::numEvents ( ) const
virtual

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

Implements dd4hep::EventHandler.

Definition at line 85 of file LCIOEventHandler.cpp.

◆ Open()

bool LCIOEventHandler::Open ( const std::string &  type,
const std::string &  file_name 
)
virtual

Open new data file.

Implements dd4hep::EventHandler.

Definition at line 146 of file LCIOEventHandler.cpp.

◆ PreviousEvent()

bool LCIOEventHandler::PreviousEvent ( )
virtual

User overloadable function: Load the previous event.

Load the previous event.

Implements dd4hep::EventHandler.

Definition at line 182 of file LCIOEventHandler.cpp.

Member Data Documentation

◆ m_branches

Branches dd4hep::LCIOEventHandler::m_branches
protected

Branch map.

Definition at line 49 of file LCIOEventHandler.h.

◆ m_data

TypedEventCollections dd4hep::LCIOEventHandler::m_data
protected

Data collection map.

Definition at line 51 of file LCIOEventHandler.h.

◆ m_event

lcio::LCEvent* dd4hep::LCIOEventHandler::m_event
protected

Reference to the current LCIO event.

Definition at line 45 of file LCIOEventHandler.h.

◆ m_fileName

std::string dd4hep::LCIOEventHandler::m_fileName
protected

Input file name.

Definition at line 47 of file LCIOEventHandler.h.

◆ m_lcReader

lcio::LCReader* dd4hep::LCIOEventHandler::m_lcReader
protected

Reference to data file reader.

Definition at line 43 of file LCIOEventHandler.h.


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