All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FileListSource.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <string>
6 #include <vector>
7 
8 namespace ana
9 {
10  /// Simple file source based on an explicit list provided by the user
12  {
13  public:
14  /// default offset and stride mean obey cmd-line options
15  FileListSource(const std::vector<std::string>& files,
16  int stride = -1, int offset = -1);
17  virtual ~FileListSource();
18 
19  virtual TFile* GetNextFile() override;
20  int NFiles() const override {return fN;}
21  protected:
22  std::vector<std::string> fFileNames; ///< The list of files
23  std::vector<std::string>::iterator fIt; ///< Iterator into \ref fFileNames
24  int fStride;
25  int fN; ///< Number of files that will actually be returned
26  TFile* fFile; ///< The most-recently-returned file
27  static bool fgGotTickets; ///< Have we renewed our tickets?
28  };
29 }
BEGIN_PROLOG TPC Trig offset(g4 rise time) ProjectToHeight
Definition: CORSIKAGen.fcl:7
std::vector< std::string >::iterator fIt
Iterator into fFileNames.
process_name opflashCryoW ana
int fN
Number of files that will actually be returned.
std::vector< std::string > fFileNames
The list of files.
Interface class for accessing ROOT files in sequence.
Definition: IFileSource.h:10
Simple file source based on an explicit list provided by the user.
FileListSource(const std::vector< std::string > &files, int stride=-1, int offset=-1)
default offset and stride mean obey cmd-line options
static bool fgGotTickets
Have we renewed our tickets?
int NFiles() const override
May return -1 indicating the number of files is not known.
virtual TFile * GetNextFile() override
Returns the next file in sequence, ready for reading.
TFile * fFile
The most-recently-returned file.