ATLAS Offline Software
SampleComposite.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef SAMPLE_HANDLER_SAMPLE_COMPOSITE_HH
6 #define SAMPLE_HANDLER_SAMPLE_COMPOSITE_HH
7 
8 //
9 // Distributed under the Boost Software License, Version 1.0.
10 // (See accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
12 
13 // Please feel free to contact me (krumnack@iastate.edu) for bug
14 // reports, feature suggestions, praise and complaints.
15 
16 
17 
18 #include <SampleHandler/Global.h>
19 
20 #include <string>
21 #include <vector>
22 #include <SampleHandler/Sample.h>
23 
24 namespace SH
25 {
30  class SampleComposite : public Sample
31  {
32  //
33  // public interface
34  //
35 
40  public:
41  void testInvariant () const;
42 
43 
51  public:
53 
54 
62  public:
63  SampleComposite (const std::string& name);
64 
65 
74  public:
75  void add (const SamplePtr& sample);
76 
77 
78 
79  //
80  // inherited interface
81  //
82 
84  protected:
85  virtual std::size_t getNumFiles () const;
86 
88  protected:
89  virtual std::string getFileName (std::size_t index) const;
90 
92  protected:
93  virtual SamplePtr doMakeLocal () const;
94 
96  protected:
97  virtual std::vector<std::string> doMakeFileList () const;
98 
100  protected:
101  virtual void
102  doUpdateLocation (const std::string& from, const std::string& to);
103 
105  protected:
106  virtual bool getContains (const std::string& name) const;
107 
109  protected:
111 
112 
113 
114  //
115  // private interface
116  //
117 
119  private:
120  std::vector<SamplePtr> m_samples;
121 
123  private:
124  typedef std::vector<SamplePtr>::const_iterator SamplesIter;
125 
127  };
128 }
129 
130 #endif
get_generator_info.result
result
Definition: get_generator_info.py:21
SH::SampleComposite::getNumFiles
virtual std::size_t getNumFiles() const
the number of files in the sample
SH::SampleComposite::SampleComposite
SampleComposite()
standard constructor
SH::SampleComposite::getContains
virtual bool getContains(const std::string &name) const
whether this sample contains a sample of the given name
index
Definition: index.py:1
SH::SampleComposite::testInvariant
void testInvariant() const
test the invariant of this object
SH::SampleComposite::SamplesIter
std::vector< SamplePtr >::const_iterator SamplesIter
the iterator for m_samples
Definition: SampleComposite.h:124
SH::SampleComposite::doAddSamples
virtual void doAddSamples(SampleHandler &result)
add all samples this sample corresponds to to the given sample handler
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:116
SH::SampleComposite::add
void add(const SamplePtr &sample)
add a sample to the list
SH::SampleComposite::doUpdateLocation
virtual void doUpdateLocation(const std::string &from, const std::string &to)
update all file references starting with from to to
SH::SampleComposite::getFileName
virtual std::string getFileName(std::size_t index) const
the name of the file with the given index
SH::SampleComposite::doMakeFileList
virtual std::vector< std::string > doMakeFileList() const
make a list of all files, prestaging them if necessary
SH::Sample::name
const std::string & name() const
the name of the sample we are using
SH::Sample
a base class that manages a set of files belonging to a particular data set and the associated meta-d...
Definition: Sample.h:54
SH::SamplePtr
A smart pointer class that holds a single Sample object.
Definition: SamplePtr.h:35
CxxUtils::to
CONT to(RANGE &&r)
Definition: ranges.h:39
SH::SampleComposite::doMakeLocal
virtual SamplePtr doMakeLocal() const
Make this a local sample, i.e.
SH::SampleComposite::ClassDef
ClassDef(SampleComposite, 1)
SH::SampleHandler
A class that manages a list of Sample objects.
Definition: SampleHandler.h:60
SH::SampleComposite::m_samples
std::vector< SamplePtr > m_samples
the list of samples we use
Definition: SampleComposite.h:120
SH
This module provides a lot of global definitions, forward declarations and includes that are used by ...
Definition: PrunDriver.h:15
SH::SampleComposite
This module defines an implementation of Sample that contains composite samples.
Definition: SampleComposite.h:31
SH::SampleComposite::SampleComposite
SampleComposite(const std::string &name)
standard constructor
Global.h
Sample.h