EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
erhic::VirtualEventFactory Class Referenceabstract

#include <eic-smear/blob/master/include/eicsmear/erhic/EventFactory.h>

+ Inheritance diagram for erhic::VirtualEventFactory:
+ Collaboration diagram for erhic::VirtualEventFactory:

Public Types

typedef std::pair< TString,
TObject * > 
NamedObjects
 

Public Member Functions

virtual ~VirtualEventFactory ()
 
virtual VirtualEventCreate ()=0
 
virtual VirtualEventGetEvBufferPtr ()
 
virtual std::string EventName () const =0
 
virtual void FindFirstEvent ()
 
virtual TBranch * Branch (TTree &, const std::string &)
 
virtual void Fill (TBranch &)
 

Public Attributes

std::vector< NamedObjectsmObjectsToWriteAtTheEnd
 
std::map< std::string,
std::string > 
mAdditionalInformation
 

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 39 of file EventFactory.h.

View newest version in sPHENIX GitHub at line 39 of file EventFactory.h

Member Typedef Documentation

typedef std::pair<TString, TObject*> erhic::VirtualEventFactory::NamedObjects

run information (like cross section) is usually saved with a LogReader that parses a separate file and is completely independent from the factory, forester, Plant() mechanism, only connected in BuildTree.cxx. For some formats (like HepMC), that won't work; the best information is gained from the last event. A hacky but flexible fix: Allow factories to maintain a TObjArray of things to write at the end. Side effect: Could also be used for QA histos or the like.

Definition at line 91 of file EventFactory.h.

View newest version in sPHENIX GitHub at line 91 of file EventFactory.h

Constructor & Destructor Documentation

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

Destructor.

Definition at line 44 of file EventFactory.h.

View newest version in sPHENIX GitHub at line 44 of file EventFactory.h

Member Function Documentation

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 erhic::Pythia6EventBuilder, erhic::hadronic::Pythia6EventFactory, Smear::EventFactory< T >, Smear::EventFactory< erhic::hadronic::EventSmear >, and Smear::EventFactory< Smear::Event >.

Definition at line 74 of file EventFactory.h.

View newest version in sPHENIX GitHub at line 74 of file EventFactory.h

Referenced by EicSmearTask::Init(), and SmearTree().

+ Here is the caller graph for this function:

virtual VirtualEvent* erhic::VirtualEventFactory::Create ( )
pure virtual

Returns a new event instance.

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

Referenced by Poacher::GetNextEvent(), and erhic::Forester::Plant().

+ Here is the caller graph for this function:

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, Smear::EventFactory< T >, Smear::EventFactory< erhic::hadronic::EventSmear >, and Smear::EventFactory< Smear::Event >.

Referenced by Poacher::EventName().

+ Here is the caller graph for this function:

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 82 of file EventFactory.h.

View newest version in sPHENIX GitHub at line 82 of file EventFactory.h

Referenced by EicSmearTask::Exec(), and SmearTree().

+ Here is the caller graph for this function:

virtual void erhic::VirtualEventFactory::FindFirstEvent ( )
inlinevirtual

if we need to skip lines to get to the first event

Reimplemented in erhic::EventFromAsciiFactory< T >, and erhic::EventFromAsciiFactory< T >.

Definition at line 67 of file EventFactory.h.

View newest version in sPHENIX GitHub at line 67 of file EventFactory.h

Referenced by erhic::Forester::SetupOutput().

+ Here is the caller graph for this function:

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

Returns a pointer to the event buffer.

Reimplemented in Smear::EventDisFactory.

Definition at line 54 of file EventFactory.h.

View newest version in sPHENIX GitHub at line 54 of file EventFactory.h

Referenced by EicSmearTask::Exec().

+ Here is the caller graph for this function:

Member Data Documentation

std::map<std::string, std::string> erhic::VirtualEventFactory::mAdditionalInformation

Additional reader information as a name-value map. Also very hacky. But should at least have small footprint

Definition at line 97 of file EventFactory.h.

View newest version in sPHENIX GitHub at line 97 of file EventFactory.h

Referenced by erhic::Forester::OpenInput().

std::vector<NamedObjects> erhic::VirtualEventFactory::mObjectsToWriteAtTheEnd

Definition at line 92 of file EventFactory.h.

View newest version in sPHENIX GitHub at line 92 of file EventFactory.h

Referenced by erhic::Forester::Finish().


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