SH::SampleLocal Class Reference

A Sample based on a simple file list. More...

#include <SampleLocal.h>

Inheritance diagram for SH::SampleLocal:
SH::Sample

List of all members.

Public Member Functions

void testInvariant () const
 test the invariant of this object
 SampleLocal ()
 standard constructor
 SampleLocal (const std::string &name)
 standard constructor
void add (const std::string &file)
 add a file to the list

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)

Detailed Description

A Sample based on a simple file list.

This is the archetypical implementation of a sample, which is really just a list of file names that can directly be passed to TFile::Open().

While you can in principle create these samples yourself, you will probably do better if you rely on the various data discovery methods to create the samples for you.

See also:
https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/SampleHandler#Data_Discovery

Constructor & Destructor Documentation

SH::SampleLocal::SampleLocal (  ) 

standard constructor

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

standard constructor

Guarantee
strong
Failures
out of memory II

Member Function Documentation

void SH::SampleLocal::add ( const std::string &  file  ) 

add a file to the list

Precondition:
!file.empty()
Guarantee
strong
Failures
low level errors II
virtual std::vector<std::string> SH::SampleLocal::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::SampleLocal::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 void SH::SampleLocal::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::SampleLocal::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::SampleLocal::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::SampleLocal::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