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::EventFromAsciiFactory< T > Class Template Reference

Creates events from an input plain text file containing appropriately formatted data. More...

#include <EventFactory.h>

Inheritance diagram for erhic::EventFromAsciiFactory< T >:
erhic::VirtualEventFactory

Public Member Functions

 EventFromAsciiFactory ()
 Constructor. More...
 
virtual ~EventFromAsciiFactory ()
 Destructor. More...
 
 EventFromAsciiFactory (std::istream &is)
 Initialise the factory from an input stream. More...
 
virtual T * Create ()
 Returns a new event instance. More...
 
virtual std::string EventName () const
 Returns the name of the event class created by this factory. More...
 
- Public Member Functions inherited from erhic::VirtualEventFactory
virtual ~VirtualEventFactory ()
 Destructor. More...
 
virtual VirtualEventGetEvBufferPtr ()
 Returns a pointer to the event buffer. 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...
 

Public Attributes

std::istream * mInput
 
std::string mLine
 
std::auto_ptr< T > mEvent
 

Protected Member Functions

bool AtEndOfEvent () const
 Returns true when an end-of-event marker is encountered in the input stream. More...
 
Int_t FinishEvent ()
 Perform end-of-event operations. More...
 
bool AddParticle ()
 Create a new particle from the last data read from the input stream. More...
 

Detailed Description

template<typename T>
class erhic::EventFromAsciiFactory< T >

Creates events from an input plain text file containing appropriately formatted data.

Templated for all the types inheriting from EventMC (any event class implementing a Parse() method to populate the event's variables from a string will work.)

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

Constructor & Destructor Documentation

◆ EventFromAsciiFactory() [1/2]

template<typename T >
erhic::EventFromAsciiFactory< T >::EventFromAsciiFactory ( )
inline

Constructor.

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

◆ ~EventFromAsciiFactory()

template<typename T >
virtual erhic::EventFromAsciiFactory< T >::~EventFromAsciiFactory ( )
inlinevirtual

Destructor.

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

◆ EventFromAsciiFactory() [2/2]

template<typename T >
erhic::EventFromAsciiFactory< T >::EventFromAsciiFactory ( std::istream &  is)
inlineexplicit

Initialise the factory from an input stream.

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

Member Function Documentation

◆ AddParticle()

template<typename T >
bool erhic::EventFromAsciiFactory< T >::AddParticle
protected

Create a new particle from the last data read from the input stream.

Definition at line 157 of file EventFactory.cxx.

◆ AtEndOfEvent()

template<typename T >
bool erhic::EventFromAsciiFactory< T >::AtEndOfEvent
protected

Returns true when an end-of-event marker is encountered in the input stream.

Definition at line 35 of file EventFactory.cxx.

◆ Create()

template<typename T >
T * erhic::EventFromAsciiFactory< T >::Create
virtual

Returns a new event instance.

Implements erhic::VirtualEventFactory.

Definition at line 57 of file EventFactory.cxx.

◆ EventName()

template<typename T >
std::string erhic::EventFromAsciiFactory< T >::EventName
virtual

Returns the name of the event class created by this factory.

Implements erhic::VirtualEventFactory.

Definition at line 178 of file EventFactory.cxx.

◆ FinishEvent()

template<typename T >
Int_t erhic::EventFromAsciiFactory< T >::FinishEvent
protected

Perform end-of-event operations.

Definition at line 116 of file EventFactory.cxx.

Member Data Documentation

◆ mEvent

template<typename T >
std::auto_ptr<T> erhic::EventFromAsciiFactory< T >::mEvent

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

◆ mInput

template<typename T >
std::istream* erhic::EventFromAsciiFactory< T >::mInput

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

◆ mLine

template<typename T >
std::string erhic::EventFromAsciiFactory< T >::mLine

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


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