ATLAS Offline Software
SampleLocal.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_LOCAL_HH
6 #define SAMPLE_HANDLER_SAMPLE_LOCAL_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 {
37  class SampleLocal : public Sample
38  {
39  //
40  // public interface
41  //
42 
47  public:
48  void testInvariant () const;
49 
50 
58  public:
60 
61 
68  public:
69  SampleLocal (const std::string& name);
70 
71 
79  public:
80  void add (const std::string& file);
81 
82 
83 
84  //
85  // inherited interface
86  //
87 
89  protected:
90  virtual std::size_t getNumFiles () const;
91 
93  protected:
94  virtual std::string getFileName (std::size_t index) const;
95 
97  protected:
98  virtual SamplePtr doMakeLocal () const;
99 
101  protected:
102  virtual std::vector<std::string> doMakeFileList () const;
103 
105  protected:
106  virtual void
107  doUpdateLocation (const std::string& from, const std::string& to);
108 
109 
110 
111  //
112  // private interface
113  //
114 
116  private:
117  std::vector<std::string> m_files;
118 
120  private:
121  typedef std::vector<std::string>::const_iterator FilesIter;
122 
124  private:
126 
128  };
129 }
130 
131 #endif
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
SH::SampleLocal::SampleLocal
SampleLocal(const std::string &name)
standard constructor
index
Definition: index.py:1
SH::SampleLocal::getNumFiles
virtual std::size_t getNumFiles() const
the number of files in the sample
SH::SampleLocal::doUpdateLocation
virtual void doUpdateLocation(const std::string &from, const std::string &to)
update all file references starting with from to to
SH::SampleLocal::FilesMIter
std::vector< std::string >::iterator FilesMIter
the mutable iterator for m_files
Definition: SampleLocal.h:125
SH::SampleLocal::FilesIter
std::vector< std::string >::const_iterator FilesIter
the iterator for m_files
Definition: SampleLocal.h:121
SH::SampleLocal::doMakeLocal
virtual SamplePtr doMakeLocal() const
Make this a local sample, i.e.
SH::SampleLocal::m_files
std::vector< std::string > m_files
the list of files we use
Definition: SampleLocal.h:117
file
TFile * file
Definition: tile_monitor.h:29
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::SampleLocal::ClassDef
ClassDef(SampleLocal, 1)
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:32
SH::SampleLocal::testInvariant
void testInvariant() const
test the invariant of this object
SH::SampleLocal::doMakeFileList
virtual std::vector< std::string > doMakeFileList() const
make a list of all files, prestaging them if necessary
SH::SampleLocal::SampleLocal
SampleLocal()
standard constructor
SH::SampleLocal
A Sample based on a simple file list.
Definition: SampleLocal.h:38
SH
This module provides a lot of global definitions, forward declarations and includes that are used by ...
Definition: PrunDriver.h:15
SH::SampleLocal::add
void add(const std::string &file)
add a file to the list
Global.h
Sample.h
SH::SampleLocal::getFileName
virtual std::string getFileName(std::size_t index) const
the name of the file with the given index