![]() |
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 More... | |
OutputStreamData (const std::string &val_fileName, const std::string &mode) | |
open the given file and create an output stream for it More... | |
OutputStreamData (std::unique_ptr< TFile > val_file) | |
create this output stream for a pre-opened file More... | |
OutputStreamData (std::unique_ptr< SH::DiskWriter > val_writer) | |
create this output stream for a custom writer More... | |
const std::string & | mainStreamName () const noexcept |
the name of the main stream More... | |
void | setMainStreamName (const std::string &val_mainStreamName) |
TFile * | file () const noexcept |
the file we are writing to More... | |
void | saveOutput () |
write the list of output objects to disk and clear it More... | |
void | close () |
close this file More... | |
std::string | finalFileName () const |
the final path of the file created More... | |
void | addOutput (std::unique_ptr< TObject > outputObject) |
add the given output object to this stream More... | |
void | addClone (const TObject &prototypeObject) |
add a clone of the given object to the output More... | |
TDirectory * | makeDirectoryFor (std::string &name) |
make the directory for the object of the given name More... | |
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 More... | |
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 More... | |
Private Attributes | |
std::string | m_mainStreamName |
the name of the main stream More... | |
std::unique_ptr< SH::DiskWriter > | m_writer |
the writer we use More... | |
std::vector< std::unique_ptr< TObject > > | m_output |
the list of objects to write out at the end of job More... | |
std::unordered_map< std::string, TObject * > | m_outputHistMap |
the output histogram map More... | |
std::unordered_map< std::string, TTree * > | m_outputTreeMap |
the output tree map More... | |
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 |
test the invariant of this object
Definition at line 105 of file OutputStreamData.cxx.
|
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.