DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Event I/O handler class for the dd4hep event display. More...
#include <DDG4EventHandler.h>
Public Types | |
typedef std::map< std::string, std::pair< TBranch *, void * > > | Branches |
typedef void *(* | ParticleAccessor_t) (void *, DDEveParticle *) |
typedef void *(* | HitAccessor_t) (void *, 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 | |
DDG4EventHandler () | |
Standard constructor. More... | |
virtual | ~DDG4EventHandler () |
Default destructor. More... | |
virtual const TypedEventCollections & | data () const override |
Access the map of simulation data collections. More... | |
virtual long | numEvents () const override |
Access the number of events on the current input data source (-1 if no data source connected) More... | |
std::string | datasourceName () const override |
Access the data source name. More... | |
virtual CollectionType | collectionType (const std::string &collection) const override |
Access to the collection type by name. More... | |
virtual size_t | collectionLoop (const std::string &collection, DDEveHitActor &actor) override |
Call functor on hit collection. More... | |
virtual size_t | collectionLoop (const std::string &collection, DDEveParticleActor &actor) override |
Loop over collection and extract particle data. More... | |
virtual bool | Open (const std::string &type, const std::string &file_name) override |
Open new data file. More... | |
virtual bool | NextEvent () override |
User overloadable function: Load the next event. More... | |
virtual bool | PreviousEvent () override |
User overloadable function: Load the previous event. More... | |
virtual bool | GotoEvent (long event_number) override |
Goto a specified event in the file. More... | |
Int_t | ReadEvent (Long64_t n) |
Load the specified event. More... | |
ClassDefOverride (DDG4EventHandler, 0) | |
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 | |
std::pair< TFile *, TTree * > | m_file |
Reference to data file. More... | |
Branches | m_branches |
Branch map. More... | |
Long64_t | m_entry |
File entry number. More... | |
HitAccessor_t | m_simhitConverter |
Function pointer to interprete hits. More... | |
ParticleAccessor_t | m_particleConverter |
Function pointer to interprete particles. 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... | |
Event I/O handler class for the dd4hep event display.
Definition at line 38 of file DDG4EventHandler.h.
typedef std::map<std::string,std::pair<TBranch*,void*> > dd4hep::DDG4EventHandler::Branches |
Definition at line 40 of file DDG4EventHandler.h.
typedef void*(* dd4hep::DDG4EventHandler::HitAccessor_t) (void *, DDEveHit *) |
Definition at line 42 of file DDG4EventHandler.h.
typedef void*(* dd4hep::DDG4EventHandler::ParticleAccessor_t) (void *, DDEveParticle *) |
Definition at line 41 of file DDG4EventHandler.h.
DDG4EventHandler::DDG4EventHandler | ( | ) |
Standard constructor.
Definition at line 47 of file DDG4EventHandler.cpp.
|
virtual |
Default destructor.
Definition at line 61 of file DDG4EventHandler.cpp.
dd4hep::DDG4EventHandler::ClassDefOverride | ( | DDG4EventHandler | , |
0 | |||
) |
|
overridevirtual |
Call functor on hit collection.
Implements dd4hep::EventHandler.
Definition at line 118 of file DDG4EventHandler.cpp.
|
overridevirtual |
Loop over collection and extract particle data.
Implements dd4hep::EventHandler.
Definition at line 138 of file DDG4EventHandler.cpp.
|
overridevirtual |
Access to the collection type by name.
Implements dd4hep::EventHandler.
Definition at line 102 of file DDG4EventHandler.cpp.
|
inlineoverridevirtual |
Access the map of simulation data collections.
Implements dd4hep::EventHandler.
Definition at line 63 of file DDG4EventHandler.h.
|
overridevirtual |
Access the data source name.
Implements dd4hep::EventHandler.
Definition at line 94 of file DDG4EventHandler.cpp.
|
overridevirtual |
Goto a specified event in the file.
Implements dd4hep::EventHandler.
Definition at line 81 of file DDG4EventHandler.cpp.
|
overridevirtual |
User overloadable function: Load the next event.
Load the next event.
Implements dd4hep::EventHandler.
Definition at line 71 of file DDG4EventHandler.cpp.
|
overridevirtual |
Access the number of events on the current input data source (-1 if no data source connected)
Implements dd4hep::EventHandler.
Definition at line 86 of file DDG4EventHandler.cpp.
|
overridevirtual |
Open new data file.
Implements dd4hep::EventHandler.
Definition at line 189 of file DDG4EventHandler.cpp.
|
overridevirtual |
User overloadable function: Load the previous event.
Load the previous event.
Implements dd4hep::EventHandler.
Definition at line 76 of file DDG4EventHandler.cpp.
Int_t DDG4EventHandler::ReadEvent | ( | Long64_t | n | ) |
Load the specified event.
Definition at line 158 of file DDG4EventHandler.cpp.
|
protected |
Branch map.
Definition at line 47 of file DDG4EventHandler.h.
|
protected |
Data collection map.
Definition at line 55 of file DDG4EventHandler.h.
|
protected |
File entry number.
Definition at line 49 of file DDG4EventHandler.h.
|
protected |
Reference to data file.
Definition at line 45 of file DDG4EventHandler.h.
|
protected |
Function pointer to interprete particles.
Definition at line 53 of file DDG4EventHandler.h.
|
protected |
Function pointer to interprete hits.
Definition at line 51 of file DDG4EventHandler.h.