eic-smear  1.0.3
A collection of ROOT classes for Monte Carlo events and a fast-smearing code simulating detector effects for the Electron-Ion Collider task force
erhic::VirtualEventFactory Class Referenceabstract

Abstract base class for event builders. More...

#include <EventFactory.h>

Inheritance diagram for erhic::VirtualEventFactory:
erhic::EventFromAsciiFactory< T > erhic::hadronic::Pythia6EventFactory erhic::Pythia6EventBuilder Smear::EventFactory< erhic::hadronic::EventSmear > Smear::EventFactory< Smear::Event > Smear::EventFactory< T > Smear::HadronicEventBuilder Smear::EventDisFactory

Public Member Functions

virtual ~VirtualEventFactory ()
 Destructor. More...
 
virtual VirtualEventCreate ()=0
 Returns a new event instance. More...
 
virtual VirtualEventGetEvBufferPtr ()
 Returns a pointer to the event buffer. More...
 
virtual std::string EventName () const =0
 Returns a string with the full (including namespace) class name of the event type produced. More...
 
virtual TBranch * Branch (TTree &, const std::string &)
 Add a branch named "name" for the event type generated by this factory to a ROOT TTree. More...
 
virtual void Fill (TBranch &)
 Calls Create() to generate an event and fills the provided branch with that event. More...
 

Detailed Description

Abstract base class for event builders.

Due to how ROOT handles allocating branch objects, we take care of creating and filling branches in this class also.

Definition at line 35 of file erhic/EventFactory.h.

Constructor & Destructor Documentation

◆ ~VirtualEventFactory()

virtual erhic::VirtualEventFactory::~VirtualEventFactory ( )
inlinevirtual

Destructor.

Definition at line 40 of file erhic/EventFactory.h.

Member Function Documentation

◆ Branch()

virtual TBranch* erhic::VirtualEventFactory::Branch ( TTree &  ,
const std::string &   
)
inlinevirtual

Add a branch named "name" for the event type generated by this factory to a ROOT TTree.

Returns a pointer to the branch, or NULL in the case of an error.

Reimplemented in Smear::EventFactory< T >, Smear::EventFactory< erhic::hadronic::EventSmear >, Smear::EventFactory< Smear::Event >, erhic::hadronic::Pythia6EventFactory, and erhic::Pythia6EventBuilder.

Definition at line 65 of file erhic/EventFactory.h.

◆ Create()

◆ EventName()

virtual std::string erhic::VirtualEventFactory::EventName ( ) const
pure virtual

Returns a string with the full (including namespace) class name of the event type produced.

This is important for use with ROOT TTree to ensure the correct event type in branches.

Implemented in erhic::EventFromAsciiFactory< T >, erhic::Pythia6EventBuilder, erhic::hadronic::Pythia6EventFactory, and Smear::EventFactory< T >.

◆ Fill()

virtual void erhic::VirtualEventFactory::Fill ( TBranch &  )
inlinevirtual

Calls Create() to generate an event and fills the provided branch with that event.

Resets the branch address in doing so.

Reimplemented in Smear::EventFactory< T >, Smear::EventFactory< erhic::hadronic::EventSmear >, Smear::EventFactory< Smear::Event >, erhic::hadronic::Pythia6EventFactory, and erhic::Pythia6EventBuilder.

Definition at line 73 of file erhic/EventFactory.h.

◆ GetEvBufferPtr()

virtual VirtualEvent* erhic::VirtualEventFactory::GetEvBufferPtr ( )
inlinevirtual

Returns a pointer to the event buffer.

Reimplemented in Smear::EventDisFactory.

Definition at line 50 of file erhic/EventFactory.h.


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