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::LogReaderFactory Class Reference

Factory class for LogReaders. More...

#include <File.h>

Public Member Functions

LogReaderCreateReader (const EventBase &event) const
 Returns a LogReader instance of the type for reading log files from the Monte Carlo generator event type 'event'. More...
 
LogReaderCreateReader (const std::string &name) const
 Returns a LogReader instance of the type for reading log files from the Monte Carlo generator named 'name'. More...
 
LogReaderCreateReader (std::istream &) const
 Returns a LogReader instance of the type for reading log files from the Monte Carlo generator which produced the content in an istream, by reading the first line of that stream. More...
 
std::string Locate (const std::string &mcFile) const
 Attempts to locate a log file corresponding to the named Monte Carlo file. More...
 

Static Public Member Functions

static LogReaderFactoryGetInstance ()
 Returns the single instance of LogReaderFactory. More...
 

Protected Types

typedef std::map< std::string, LogReader * > Map
 

Protected Member Functions

 LogReaderFactory ()
 Constructor. More...
 
 ~LogReaderFactory ()
 Destructor. More...
 

Protected Attributes

Map prototypes_
 

Detailed Description

Factory class for LogReaders.

Singleton class. Creates a LogReader instance corresponding to a Monte Carlo generator type.

Definition at line 360 of file File.h.

Member Typedef Documentation

◆ Map

typedef std::map<std::string, LogReader*> erhic::LogReaderFactory::Map
protected

Definition at line 413 of file File.h.

Constructor & Destructor Documentation

◆ LogReaderFactory()

erhic::LogReaderFactory::LogReaderFactory ( )
protected

Constructor.

Definition at line 474 of file File.cxx.

◆ ~LogReaderFactory()

erhic::LogReaderFactory::~LogReaderFactory ( )
protected

Destructor.

Definition at line 486 of file File.cxx.

Member Function Documentation

◆ CreateReader() [1/3]

LogReader * erhic::LogReaderFactory::CreateReader ( const EventBase event) const

Returns a LogReader instance of the type for reading log files from the Monte Carlo generator event type 'event'.

Returns NULL in the case of an unsupported generator. The LogReader must be deleted by the user.

Definition at line 371 of file File.cxx.

◆ CreateReader() [2/3]

LogReader * erhic::LogReaderFactory::CreateReader ( const std::string &  name) const

Returns a LogReader instance of the type for reading log files from the Monte Carlo generator named 'name'.

Returns NULL in the case of an unsupported generator. The LogReader must be deleted by the user.

Definition at line 387 of file File.cxx.

◆ CreateReader() [3/3]

LogReader * erhic::LogReaderFactory::CreateReader ( std::istream &  is) const

Returns a LogReader instance of the type for reading log files from the Monte Carlo generator which produced the content in an istream, by reading the first line of that stream.

Returns a LogReader instance of the type for reading log files from the Monte Carlo generator named 'name'.

Returns NULL in the case of an unsupported generator. The LogReader must be deleted by the user.

Definition at line 405 of file File.cxx.

◆ GetInstance()

LogReaderFactory & erhic::LogReaderFactory::GetInstance ( )
static

Returns the single instance of LogReaderFactory.

Definition at line 360 of file File.cxx.

◆ Locate()

std::string erhic::LogReaderFactory::Locate ( const std::string &  mcFile) const

Attempts to locate a log file corresponding to the named Monte Carlo file.

Searches for a file with the same base name and extension '.log'. Looks in the current directory and, if mcFile gives a path containing 'TXTFILES', in the corresonding directory substituting 'LOGFILES'.

Definition at line 429 of file File.cxx.

Member Data Documentation

◆ prototypes_

Map erhic::LogReaderFactory::prototypes_
protected

Definition at line 414 of file File.h.


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