CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
lhef::LHEReader::FileSource Class Reference
Inheritance diagram for lhef::LHEReader::FileSource:
lhef::LHEReader::Source

Public Member Functions

XMLDocumentcreateReader (XMLDocument::Handler &handler) override
 
 FileSource (const std::string &fileURL)
 
 ~FileSource () override
 
- Public Member Functions inherited from lhef::LHEReader::Source
 Source ()
 
virtual ~Source ()
 

Private Attributes

std::unique_ptr< StorageWrapfileStream
 

Detailed Description

Definition at line 47 of file LHEReader.cc.

Constructor & Destructor Documentation

◆ FileSource()

lhef::LHEReader::FileSource::FileSource ( const std::string &  fileURL)
inline

Definition at line 49 of file LHEReader.cc.

49  {
50  auto storage = StorageFactory::get()->open(fileURL, IOFlags::OpenRead);
51 
52  if (!storage)
53  throw cms::Exception("FileOpenError")
54  << "Could not open LHE file \"" << fileURL << "\" for reading" << std::endl;
55 
56  fileStream = std::make_unique<StorageWrap>(std::move(storage));
57  }

References Exception, fileStream, StorageFactory::get(), eostools::move(), StorageFactory::open(), and IOFlags::OpenRead.

◆ ~FileSource()

lhef::LHEReader::FileSource::~FileSource ( )
inlineoverride

Definition at line 59 of file LHEReader.cc.

59 {}

Member Function Documentation

◆ createReader()

XMLDocument* lhef::LHEReader::FileSource::createReader ( XMLDocument::Handler handler)
inlineoverridevirtual

Implements lhef::LHEReader::Source.

Definition at line 61 of file LHEReader.cc.

61 { return new XMLDocument(fileStream, handler); }

References fileStream, and lhef::LHEReader::handler.

Member Data Documentation

◆ fileStream

std::unique_ptr<StorageWrap> lhef::LHEReader::FileSource::fileStream
private

Definition at line 64 of file LHEReader.cc.

Referenced by createReader(), and FileSource().

StorageFactory::open
std::unique_ptr< Storage > open(const std::string &url, int mode=IOFlags::OpenRead) const
Definition: StorageFactory.cc:124
XMLDocument
Definition: HcalDbXml.cc:60
StorageFactory::get
static const StorageFactory * get(void)
Definition: StorageFactory.cc:28
IOFlags::OpenRead
Definition: IOFlags.h:7
lhef::LHEReader::FileSource::fileStream
std::unique_ptr< StorageWrap > fileStream
Definition: LHEReader.cc:64
eostools.move
def move(src, dest)
Definition: eostools.py:511
Exception
Definition: hltDiff.cc:245
lhef::LHEReader::handler
std::unique_ptr< XMLHandler > handler
Definition: LHEReader.h:41