![]() |
ATLAS Offline Software
|
all data needed to manage a given output stream More...
#include <OutputStreamData.h>
Public Member Functions | |
| void | testInvariant () const |
| test the invariant of this object | |
| OutputStreamData (const std::string &val_fileName, const std::string &mode) | |
| open the given file and create an output stream for it | |
| OutputStreamData (std::unique_ptr< TFile > val_file) | |
| create this output stream for a pre-opened file | |
| OutputStreamData (std::unique_ptr< SH::DiskWriter > val_writer) | |
| create this output stream for a custom writer | |
| const std::string & | mainStreamName () const noexcept |
| the name of the main stream | |
| void | setMainStreamName (const std::string &val_mainStreamName) |
| TFile * | file () const noexcept |
| the file we are writing to | |
| void | saveOutput () |
| write the list of output objects to disk and clear it | |
| void | close () |
| close this file | |
| std::string | finalFileName () const |
| the final path of the file created | |
| void | addOutput (std::unique_ptr< TObject > outputObject) |
| add the given output object to this stream | |
| void | addClone (const TObject &prototypeObject) |
| add a clone of the given object to the output | |
| TDirectory * | makeDirectoryFor (std::string &name) |
| make the directory for the object of the given name | |
| TObject * | getOutputHist (const std::string &name) const noexcept |
| get the output histogram with the given name, or nullptr if there is no histogam with such a name | |
| TTree * | getOutputTree (const std::string &name) const noexcept |
| get the output tree with the given name, or nullptr if there is no tree with such a name | |
Private Attributes | |
| std::string | m_mainStreamName |
| the name of the main stream | |
| std::unique_ptr< SH::DiskWriter > | m_writer |
| the writer we use | |
| std::vector< std::unique_ptr< TObject > > | m_output |
| the list of objects to write out at the end of job | |
| std::unordered_map< std::string, TObject * > | m_outputHistMap |
| the output histogram map | |
| std::unordered_map< std::string, TTree * > | m_outputTreeMap |
| the output tree map | |
all data needed to manage a given output stream
Definition at line 29 of file OutputStreamData.h.
|
explicit |
open the given file and create an output stream for it
Definition at line 114 of file OutputStreamData.cxx.
|
explicit |
create this output stream for a pre-opened file
Definition at line 123 of file OutputStreamData.cxx.
|
explicit |
create this output stream for a custom writer
Definition at line 132 of file OutputStreamData.cxx.
| void EL::Detail::OutputStreamData::addClone | ( | const TObject & | prototypeObject | ) |
add a clone of the given object to the output
Definition at line 260 of file OutputStreamData.cxx.
| void EL::Detail::OutputStreamData::addOutput | ( | std::unique_ptr< TObject > | outputObject | ) |
add the given output object to this stream
While the caller transfers ownership to this object, he may retain a reference to the object until saveOutput or close is called.
Definition at line 223 of file OutputStreamData.cxx.
| void EL::Detail::OutputStreamData::close | ( | ) |
close this file
Definition at line 172 of file OutputStreamData.cxx.
|
noexcept |
the file we are writing to
Definition at line 161 of file OutputStreamData.cxx.
| std::string EL::Detail::OutputStreamData::finalFileName | ( | ) | const |
the final path of the file created
Definition at line 182 of file OutputStreamData.cxx.
|
noexcept |
get the output histogram with the given name, or nullptr if there is no histogam with such a name
Definition at line 312 of file OutputStreamData.cxx.
|
noexcept |
get the output tree with the given name, or nullptr if there is no tree with such a name
Definition at line 323 of file OutputStreamData.cxx.
|
noexcept |
the name of the main stream
Some streams are aliases for other streams. This is the name of the main stream in this case, otherwise it is the name of this stream.
Definition at line 141 of file OutputStreamData.cxx.
| TDirectory * EL::Detail::OutputStreamData::makeDirectoryFor | ( | std::string & | name | ) |
make the directory for the object of the given name
This will make sure that we pick the proper sub-directory if needed.
Definition at line 283 of file OutputStreamData.cxx.
| void EL::Detail::OutputStreamData::saveOutput | ( | ) |
write the list of output objects to disk and clear it
Definition at line 191 of file OutputStreamData.cxx.
| void EL::Detail::OutputStreamData::setMainStreamName | ( | const std::string & | val_mainStreamName | ) |
Definition at line 150 of file OutputStreamData.cxx.
| void EL::Detail::OutputStreamData::testInvariant | ( | ) | const |
|
private |
the name of the main stream
Definition at line 176 of file OutputStreamData.h.
|
private |
the list of objects to write out at the end of job
Definition at line 184 of file OutputStreamData.h.
|
private |
the output histogram map
Definition at line 188 of file OutputStreamData.h.
|
private |
the output tree map
Definition at line 192 of file OutputStreamData.h.
|
private |
the writer we use
Definition at line 180 of file OutputStreamData.h.