hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Private Attributes | List of all members
Event Class Reference

#include <Event.h>

Inheritance diagram for Event:
IEvent

Public Member Functions

 Event ()
 Constructor.
 
 ~Event ()
 Destructor.
 
virtual void add (const std::string name, TObject *object)
 
void addCollection (const std::string name, TClonesArray *collection)
 
template<typename T >
void addCollection (const std::string &name, std::vector< T * > *collection)
 
TClonesArray * getCollection (const std::string name)
 
bool exists (const std::string name)
 
void Clear ()
 
EventHeadergetEventHeaderMutable () const
 
void setTree (TTree *tree)
 
TTree * getTree ()
 
void setLCEvent (EVENT::LCEvent *lc_event)
 
EVENT::LCEvent * getLCEvent ()
 
EVENT::LCCollection * getLCCollection (std::string name)
 
bool hasLCCollection (const std::string name)
 
void setEntry (const int entry)
 
- Public Member Functions inherited from IEvent
virtual ~IEvent ()
 

Private Attributes

EventHeaderevent_header_ {nullptr}
 
TTree * tree_ {nullptr}
 
EVENT::LCEvent * lc_event_ {nullptr}
 
std::map< std::string, TObject * > objects_
 
std::map< std::string, TBranch * > branches_
 
int entry_ {0}
 

Detailed Description

Definition at line 35 of file Event.h.

Constructor & Destructor Documentation

◆ Event()

Event ( )

Constructor.

Definition at line 15 of file Event.cxx.

◆ ~Event()

~Event ( )

Destructor.

Definition at line 24 of file Event.cxx.

Member Function Documentation

◆ add()

void add ( const std::string  name,
TObject *  object 
)
virtual

Add a TObject to the event.

Implements IEvent.

Definition at line 26 of file Event.cxx.

◆ addCollection() [1/2]

template<typename T >
void addCollection ( const std::string &  name,
std::vector< T * > *  collection 
)
inline

TODO fix docu Add a collection (std::vector) of objects to the event.

Definition at line 62 of file Event.h.

◆ addCollection() [2/2]

void addCollection ( const std::string  name,
TClonesArray *  collection 
)

Add a collection (TClonesArray) of objects to the event.

Parameters
nameName of the collection
collectionThe TClonesArray containing the object.

Definition at line 45 of file Event.cxx.

◆ Clear()

void Clear ( )

Clear all of the collections in the event

Definition at line 82 of file Event.cxx.

◆ exists()

bool exists ( const std::string  name)

Checks if a collection already exist.

Parameters
nameCollection name
Returns
True if the collection exist, false otherwise.

Definition at line 73 of file Event.cxx.

◆ getCollection()

TClonesArray * getCollection ( const std::string  name)
Parameters
nameName of the collection
Returns
Get a collection from the event.

Definition at line 57 of file Event.cxx.

◆ getEventHeaderMutable()

EventHeader & getEventHeaderMutable ( ) const
inline
Returns
Get a mutable copy of the EventHeader.

Definition at line 87 of file Event.h.

◆ getLCCollection()

EVENT::LCCollection * getLCCollection ( std::string  name)
inline

Get the LCIO event.

Definition at line 102 of file Event.h.

◆ getLCEvent()

EVENT::LCEvent * getLCEvent ( )
inline
Returns
LCIO event.

Definition at line 99 of file Event.h.

◆ getTree()

TTree * getTree ( )
inline
Returns
The ROOT tree containing the event.

Definition at line 93 of file Event.h.

◆ hasLCCollection()

bool hasLCCollection ( const std::string  name)

Check if an LCEvent has a collection of the given name.

Returns
True if the collection exists, False otherwise.

Definition at line 89 of file Event.cxx.

◆ setEntry()

void setEntry ( const int  entry)
inline

Set the current entry.

Parameters
Thecurrent entry.

Definition at line 118 of file Event.h.

◆ setLCEvent()

void setLCEvent ( EVENT::LCEvent *  lc_event)
inline

Set the LCIO event.

Definition at line 96 of file Event.h.

◆ setTree()

void setTree ( TTree *  tree)
inline

Definition at line 90 of file Event.h.

Member Data Documentation

◆ branches_

std::map<std::string, TBranch*> branches_
private

Container will all branches.

Definition at line 135 of file Event.h.

◆ entry_

int entry_ {0}
private

The current entry.

Definition at line 138 of file Event.h.

◆ event_header_

EventHeader* event_header_ {nullptr}
private

The event headeer object (as pointer).

Definition at line 123 of file Event.h.

◆ lc_event_

EVENT::LCEvent* lc_event_ {nullptr}
private

Object used to load all of current LCIO event information.

Definition at line 129 of file Event.h.

◆ objects_

std::map<std::string, TObject*> objects_
private

Container with all TClonesArray collections.

Definition at line 132 of file Event.h.

◆ tree_

TTree* tree_ {nullptr}
private

The ROOT tree containing the event.

Definition at line 126 of file Event.h.


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