|
ATLAS Offline Software
|
Go to the documentation of this file.
46 if (
dynamic_cast<const SampleGrid*
>(&
obj))
60 for (std::size_t iter = 0,
end =
obj.numFiles();
98 name (std::string val_name)
104 m_name = std::move (val_name);
216 for (std::vector<std::string>::const_iterator
file =
files.begin(),
265 std::cout <<
dbg (*
this, 9999) << std::endl;
291 std::unique_ptr<TFile>
file (TFile::Open (
fileName->c_str(),
"READ"));
333 std::unique_ptr<TNamed> mymeta (meta_swallow);
408 : m_name (
name), m_meta (
new MetaObject),
424 RCU_THROW_MSG (
"reading histgrams from samples with multiple files is not (yet) implemented");
427 std::unique_ptr<TFile>
file (TFile::Open (
fileList[0].c_str(),
"READ"));
431 TObject *
object =
file->Get (
name.c_str());
432 if (
object !=
nullptr)
ClassImp(SH::Sample) namespace SH
std::size_t numFiles() const
the number of files in the sample
MetaObject * m_meta
the meta-information for this sample
TagList m_tags
the tag list we are using
void updateLocation(const std::string &from, const std::string &to)
update all file references starting with from to to
virtual SamplePtr doMakeLocal() const =0
Make this a local sample, i.e.
Long64_t getNumEntries() const
get the number of entries
std::string dbg(const Meta &, unsigned)
virtual TObject * doReadHist(const std::string &name) const
read an object from a histogram file
void addTag(const std::string &tag)
add a tag to the content of tags()
TObject * readHist(const std::string &name) const
read an object from a histogram file
TObject * getMeta(const std::string &name)
the meta-data object with the given name
void print() const
print the debugging output to the screen
std::string getMetaString(const std::string &name, const std::string &def_val="") const
the meta-data string with the given name
TCollection * metaDataList()
get the meta-data list
void addReplaceMeta(TNamed *meta_swallow)
add a meta-data object and remove any existing meta-data with the same name
void setMetaDouble(const std::string &name, double value)
set the meta-data double with the given name
void add(const std::string &tag)
add a tag to the list
std::vector< std::string > tags
#define RCU_REQUIRE_SOFT(x)
void fetchMeta(const Sample &source)
fetch the meta-data from the given sample.
#define RCU_REQUIRE2(x, y)
std::vector< std::string > makeFileList() const
make a list of all files, prestaging them if necessary
double getMetaDouble(const std::string &name, double def_val=0) const
the meta-data double with the given name
const TagList & tags() const
the tag list we are using
virtual bool getContains(const std::string &name) const
whether this sample contains a sample of the given name
virtual std::string getFileName(std::size_t index) const =0
the name of the file with the given index
void removeMeta(const std::string &name)
remove all meta-information with the given name
MetaObject * meta()
the meta-information for this sample
const std::string & name() const
the name of the sample we are using
void testInvariant() const
test the invariant of this object
void release() const
decrease the reference count by one
a base class that manages a set of files belonging to a particular data set and the associated meta-d...
std::string dbg(const Sample &obj, unsigned verbosity=0)
the debugging info of this object
virtual ~Sample()
standard destructor
bool contains(const std::string &name) const
whether this sample contains a sample of the given name
bool SetDirectory(TObject *object, TDirectory *directory)
effects: set the directory this object is associated with returns: whether the object type actively k...
SamplePtr makeLocal() const
Make this a local sample, i.e.
void printContent() const
print the debugging output to the screen
std::atomic< unsigned > m_references
the reference count
std::string fileName(std::size_t index) const
the name of the file with the given index
virtual void doAddSamples(SampleHandler &result)
add all samples this sample corresponds to to the given sample handler
TChain * makeTChain() const
create a TChain object, containing all these files
#define RCU_DESTROY_INVARIANT(x)
std::string m_name
the name of the sample we are using
Sample(const std::string &name)
standard constructor
#define RCU_CHANGE_INVARIANT(x)
virtual void doUpdateLocation(const std::string &from, const std::string &to)
update all file references starting with from to to
virtual std::size_t getNumFiles() const =0
the number of files in the sample
This module provides a lot of global definitions, forward declarations and includes that are used by ...
#define RCU_THROW_MSG(message)
void setMetaString(const std::string &name, const std::string &value)
set the meta-data string with the given name
virtual std::vector< std::string > doMakeFileList() const =0
make a list of all files, prestaging them if necessary
#define RCU_READ_INVARIANT(x)
void alloc() const
increase the reference count by one
void addSamples(SampleHandler &result)
add all samples this sample corresponds to to the given sample handler
#define RCU_NEW_INVARIANT(x)