SH::SampleHist Class Reference

A sample that represents a single histogram file. More...

#include <SampleHist.h>

Inheritance diagram for SH::SampleHist:
SH::Sample

List of all members.

Public Member Functions

void testInvariant () const
 test the invariant of this object
 SampleHist ()
 standard constructor
 SampleHist (const std::string &name, const std::string &file)
 standard constructor

Protected Member Functions

virtual std::size_t getNumFiles () const
virtual std::string getFileName (std::size_t index) const
virtual SamplePtr doMakeLocal () const
virtual std::vector< std::string > doMakeFileList () const
virtual void doUpdateLocation (const std::string &from, const std::string &to)
virtual TObject * doReadHist (const std::string &name) const

Detailed Description

A sample that represents a single histogram file.

This sample is kind of unusual, the main purpose for having it is to describe the histogram files produced by EventLoop together with all their meta-data.


Constructor & Destructor Documentation

SH::SampleHist::SampleHist (  ) 

standard constructor

Guarantee
strong
Failures
out of memory I
Warning:
only to be used by serialization code
SH::SampleHist::SampleHist ( const std::string &  name,
const std::string &  file 
)

standard constructor

Parameters:
name the name of the sample
file the histogram file
Guarantee
strong
Failures
out of memory II

Member Function Documentation

virtual std::vector<std::string> SH::SampleHist::doMakeFileList (  )  const [protected, virtual]

make a list of all files, prestaging them if necessary

Guarantee
basic
Failures
out of memory III
file catalogue failures
prestaging failures

Rationale
the virtual part of Sample::makeFileList

Implements SH::Sample.

virtual SamplePtr SH::SampleHist::doMakeLocal (  )  const [protected, virtual]

Make this a local sample, i.e. one which can be directly opened with TFile::Open.

Returns:
the local sample, or "this" if this already is a local sample
Guarantee
strong
Failures
out of memory III
can not make local sample

Rationale
the virtual part of SH::Sample::makeLocal()

Implements SH::Sample.

virtual TObject* SH::SampleHist::doReadHist ( const std::string &  name  )  const [protected, virtual]

read an object from a histogram file

Returns
the object read or NULL if it was not found
Guarantee
strong
Failures
out of memory II
i/o errors

Rationale
the virtual part of SH::Sample::readHist()

Reimplemented from SH::Sample.

virtual void SH::SampleHist::doUpdateLocation ( const std::string &  from,
const std::string &  to 
) [protected, virtual]

update all file references starting with from to to

Parameters:
from the original path to the data area
to the new path to the data area
Guarantee
basic, may update partially
Failures
out of memory II
Precondition:
!from.empty()
Postcondition:
!to.empty()
Rationale
this is needed when moving data around without recreating the samples from scratch

Rationale
the virtual part of SH::Sample::updateLocation()

Reimplemented from SH::Sample.

virtual std::string SH::SampleHist::getFileName ( std::size_t  index  )  const [protected, virtual]

the name of the file with the given index

Parameters:
index the index of the file
Guarantee
no-fail
Precondition:
index < numFiles()
Postcondition:
!result.empty()
Warning:
this is meant more for debugging and may or may not do what you want, e.g. if this is a grid dataset the file may not be directly accessible.

Rationale
the virtual part of Sample::fileName()

Implements SH::Sample.

virtual std::size_t SH::SampleHist::getNumFiles (  )  const [protected, virtual]

the number of files in the sample

Guarantee
no-fail

Rationale
the virtual part of Sample::numFiles()

Implements SH::Sample.

void SH::SampleHist::testInvariant (  )  const

test the invariant of this object

Guarantee
no-fail

Reimplemented from SH::Sample.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 1 Dec 2017 for RootCore Packages by  doxygen 1.6.1