ATLAS Offline Software
|
A class that manages a list of Sample objects. More...
#include <SampleHandler.h>
Public Types | |
typedef std::vector< Sample * >::const_iterator | iterator |
the iterator to use More... | |
Public Member Functions | |
void | testInvariant () const |
test the invariant of this object More... | |
SampleHandler () | |
standard constructor More... | |
SampleHandler (const SampleHandler &that) | |
standard copy constructor More... | |
~SampleHandler () | |
standard destructor More... | |
SampleHandler & | operator= (const SampleHandler &that) |
standard assignment operator More... | |
void | add (Sample *sample) |
add a sample to the handler More... | |
void | add (std::unique_ptr< Sample > sample) |
add a sample to the handler More... | |
void | add (SamplePtr &sample) |
add a sample to the handler More... | |
void | add (SamplePtr &&sample) |
add a sample to the handler More... | |
void | add (const SampleHandler &sh) |
add all samples from the given SampleHandler to this one More... | |
void | addWithPrefix (const SampleHandler &sh, const std::string &prefix) |
add all samples from the given SampleHandler to this one, with prefix prepended to their name More... | |
void | remove (const std::string &name) |
remove the given sample More... | |
void | remove (const Sample *sample) |
remove the given sample More... | |
Sample * | get (const std::string &name) |
get the sample with the given name More... | |
const Sample * | get (const std::string &name) const |
get the sample with the given name More... | |
SampleHandler | find (const TagList &tags) const |
find all samples which have at least one of the given tags. More... | |
SampleHandler | find (const std::string &tags) const |
find all samples which have at least one of the given tags. More... | |
Sample * | findBySource (const std::string &name) const |
find a sample by the name in the source sample handler More... | |
SampleHandler | findByName (const std::string &pattern) const |
find samples by pattern on the name More... | |
void | print () const |
print the debugging output to the screen More... | |
void | printContent () const |
print the debugging output to the screen More... | |
void | save (const std::string &directory) const |
save the list of samples to the given directory More... | |
void | load (const std::string &directory) |
load all the samples from the given directory More... | |
void | updateLocation (const std::string &from, const std::string &to) |
update all file references starting with from to to More... | |
void | fetch (const SampleHandler &source) |
fetch the meta-data for all samples that are also in the source sample handler. More... | |
void | fetchDefaults (const SampleHandler &source) |
fetch the meta-data for all that samples that don't have it in this sample. More... | |
bool | check_complete (const SampleHandler &source) const |
whether we have all samples from the source SampleHandler. More... | |
void | setMetaDouble (const std::string &name, double value) |
set the meta-data double with the given name for all samples. More... | |
void | setMetaString (const std::string &name, const std::string &value) |
set the meta-data string with the given name for all samples. More... | |
void | setMetaDouble (const std::string &pattern, const std::string &name, double value) |
set the meta-data double with the given name for samples matching a pattern. More... | |
void | setMetaString (const std::string &pattern, const std::string &name, const std::string &value) |
set the meta-data double with the given name for samples matching a pattern. More... | |
iterator | begin () const |
the begin iterator to use More... | |
iterator | end () const |
the end iterator to use More... | |
std::size_t | size () const |
the number of samples contained More... | |
Sample * | operator[] (std::size_t index) const |
the sample with the given index More... | |
Sample * | at (std::size_t index) const |
the sample with the given index More... | |
Private Types | |
typedef std::vector< SH::Sample * >::const_iterator | SamplesIter |
the iterator for m_samples More... | |
typedef std::vector< SH::Sample * >::iterator | SamplesMIter |
the mutable iterator for m_samples More... | |
typedef std::map< std::string, SH::SamplePtr >::iterator | NamedIter |
the iterator for m_named More... | |
typedef std::map< std::string, SH::SamplePtr >::iterator | NamedMIter |
the mutable iterator for m_named More... | |
Private Attributes | |
std::vector< SH::Sample * > | m_samples |
the list of samples managed More... | |
std::map< std::string, SH::SamplePtr > | m_named |
the list of samples by name More... | |
Friends | |
void | swap (SampleHandler &a, SampleHandler &b) |
Related Functions | |
(Note that these are not member functions.) | |
std::string | dbg (const SampleHandler &obj, unsigned verbosity=0) |
the debugging info of this object More... | |
void | swap (SampleHandler &a, SampleHandler &b) |
standard swap More... | |
A class that manages a list of Sample objects.
This class is typically used either to hold a list of all samples known to the analyzer or to hold a list of samples produced by a search operation on another SampleHandler. It is also extensively used to manage the inputs and outputs of EventLoop.
Definition at line 59 of file SampleHandler.h.
typedef std::vector<Sample*>::const_iterator SH::SampleHandler::iterator |
the iterator to use
Definition at line 475 of file SampleHandler.h.
|
private |
the iterator for m_named
Definition at line 545 of file SampleHandler.h.
|
private |
the mutable iterator for m_named
Definition at line 549 of file SampleHandler.h.
|
private |
the iterator for m_samples
Definition at line 533 of file SampleHandler.h.
|
private |
the mutable iterator for m_samples
Definition at line 537 of file SampleHandler.h.
SH::SampleHandler::SampleHandler | ( | ) |
standard constructor
SH::SampleHandler::SampleHandler | ( | const SampleHandler & | that | ) |
standard copy constructor
SH::SampleHandler::~SampleHandler | ( | ) |
standard destructor
void SH::SampleHandler::add | ( | const SampleHandler & | sh | ) |
add all samples from the given SampleHandler to this one
void SH::SampleHandler::add | ( | Sample * | sample | ) |
add a sample to the handler
void SH::SampleHandler::add | ( | SamplePtr && | sample | ) |
add a sample to the handler
void SH::SampleHandler::add | ( | SamplePtr & | sample | ) |
add a sample to the handler
void SH::SampleHandler::add | ( | std::unique_ptr< Sample > | sample | ) |
add a sample to the handler
void SH::SampleHandler::addWithPrefix | ( | const SampleHandler & | sh, |
const std::string & | prefix | ||
) |
add all samples from the given SampleHandler to this one, with prefix prepended to their name
Sample* SH::SampleHandler::at | ( | std::size_t | index | ) | const |
iterator SH::SampleHandler::begin | ( | ) | const |
the begin iterator to use
bool SH::SampleHandler::check_complete | ( | const SampleHandler & | source | ) | const |
whether we have all samples from the source SampleHandler.
samples are identified by name in the source. the name is either taken from the meta-data field "nc_source" or (if not available) by the name of the sample.
source | the source SampleHandler |
iterator SH::SampleHandler::end | ( | ) | const |
the end iterator to use
void SH::SampleHandler::fetch | ( | const SampleHandler & | source | ) |
fetch the meta-data for all samples that are also in the source sample handler.
samples are identified by name in the source. the name is either taken from the meta-data field "nc_source" or (if not available) by the name of the sample. fields that have a name that starts with "nc_" are not copied.
void SH::SampleHandler::fetchDefaults | ( | const SampleHandler & | source | ) |
fetch the meta-data for all that samples that don't have it in this sample.
this ignores any meta-data without name and any samples not present in source.
SampleHandler SH::SampleHandler::find | ( | const std::string & | tags | ) | const |
find all samples which have at least one of the given tags.
this version uses a comma separated tag list instead of a TagList object.
SampleHandler SH::SampleHandler::find | ( | const TagList & | tags | ) | const |
find all samples which have at least one of the given tags.
SampleHandler SH::SampleHandler::findByName | ( | const std::string & | pattern | ) | const |
find samples by pattern on the name
pattern | the regular expression that's matched against the name |
find a sample by the name in the source sample handler
this means it needs to match the content of the meta-data field "nc_source" or if that is not present by its own name.
get the sample with the given name
get the sample with the given name
void SH::SampleHandler::load | ( | const std::string & | directory | ) |
load all the samples from the given directory
SampleHandler& SH::SampleHandler::operator= | ( | const SampleHandler & | that | ) |
standard assignment operator
Sample* SH::SampleHandler::operator[] | ( | std::size_t | index | ) | const |
void SH::SampleHandler::print | ( | ) | const |
print the debugging output to the screen
void SH::SampleHandler::printContent | ( | ) | const |
print the debugging output to the screen
remove the given sample
void SH::SampleHandler::remove | ( | const std::string & | name | ) |
void SH::SampleHandler::save | ( | const std::string & | directory | ) | const |
save the list of samples to the given directory
void SH::SampleHandler::setMetaDouble | ( | const std::string & | name, |
double | value | ||
) |
set the meta-data double with the given name for all samples.
name | the name of the meta-data |
value | the value to which it is set |
void SH::SampleHandler::setMetaDouble | ( | const std::string & | pattern, |
const std::string & | name, | ||
double | value | ||
) |
set the meta-data double with the given name for samples matching a pattern.
pattern | the regular expression against which the sample name is matched |
name | the name of the meta-data |
value | the value to which it is set |
set the meta-data string with the given name for all samples.
name | the name of the meta-data |
value | the value to which it is set |
void SH::SampleHandler::setMetaString | ( | const std::string & | pattern, |
const std::string & | name, | ||
const std::string & | value | ||
) |
set the meta-data double with the given name for samples matching a pattern.
pattern | the regular expression against which the sample name is matched |
name | the name of the meta-data |
value | the value to which it is set |
std::size_t SH::SampleHandler::size | ( | ) | const |
the number of samples contained
void SH::SampleHandler::testInvariant | ( | ) | const |
test the invariant of this object
update all file references starting with from to to
from | the original path to the data area |
to | the new path to the data area |
|
related |
the debugging info of this object
obj | the object to be presented |
verbosity | the level of verbosity (higher number -> more information) |
|
related |
standard swap
|
friend |
|
private |
the list of samples by name
Definition at line 541 of file SampleHandler.h.
|
private |
the list of samples managed
Definition at line 529 of file SampleHandler.h.