CMS 3D CMS Logo

InputFileCatalog.h
Go to the documentation of this file.
1 #ifndef FWCore_Catalog_InputFileCatalog_h
2 #define FWCore_Catalog_InputFileCatalog_h
3 //
5 // Class InputFileCatalog. Services to manage InputFile catalog
6 //
8 
9 #include <memory>
10 #include <string>
11 #include <vector>
14 
15 namespace edm {
17  public:
19  FileCatalogItem(std::string const& pfn, std::string const& lfn, std::string const& fallbackPfn) : pfn_(pfn), lfn_(lfn), fallbackPfn_(fallbackPfn) {}
20  std::string const& fileName() const {return pfn_;}
21  std::string const& logicalFileName() const {return lfn_;}
22  std::string const& fallbackFileName() const {return fallbackPfn_;}
23  private:
27  };
28 
30  public:
31  InputFileCatalog(std::vector<std::string> const& fileNames, std::string const& override, bool useLFNasPFNifLFNnotFound = false);
32  InputFileCatalog(std::vector<std::string> const& fileNames, std::string const& override, std::string const& overrideFallback, bool useLFNasPFNifLFNnotFound = false);
34  std::vector<FileCatalogItem> const& fileCatalogItems() const {return fileCatalogItems_;}
35  std::vector<std::string> const& logicalFileNames() const {return logicalFileNames_;}
36  std::vector<std::string> const& fileNames() const {return fileNames_;}
37  std::vector<std::string> const& fallbackFileNames() const {return fallbackFileNames_;}
38  bool empty() const {return fileCatalogItems_.empty();}
39  static bool isPhysical(std::string const& name) {
40  return (name.empty() || name.find(':') != std::string::npos);
41  }
42 
43  private:
44  void init(std::string const& override, std::string const& overrideFallback, bool useLFNasPFNifLFNnotFound);
45  void findFile(std::string & pfn, std::string & fallbackPfn, std::string const& lfn, bool useLFNasPFNifLFNnotFound);
46  std::vector<std::string> logicalFileNames_;
47  std::vector<std::string> fileNames_;
48  std::vector<std::string> fallbackFileNames_;
49  std::vector<FileCatalogItem> fileCatalogItems_;
54  };
55 }
56 
57 #endif
FileCatalogItem(std::string const &pfn, std::string const &lfn, std::string const &fallbackPfn)
int init
Definition: HydjetWrapper.h:67
std::vector< FileCatalogItem > fileCatalogItems_
std::vector< std::string > fileNames_
static bool isPhysical(std::string const &name)
edm::propagate_const< std::unique_ptr< FileLocator > > fileLocator_
std::vector< std::string > fallbackFileNames_
edm::propagate_const< std::unique_ptr< FileLocator > > overrideFallbackFileLocator_
std::string const & fallbackFileName() const
std::vector< std::string > const & fallbackFileNames() const
std::vector< std::string > const & logicalFileNames() const
edm::propagate_const< std::unique_ptr< FileLocator > > fallbackFileLocator_
std::vector< std::string > const & fileNames() const
std::string const & logicalFileName() const
std::string const & fileName() const
HLT enums.
edm::propagate_const< std::unique_ptr< FileLocator > > overrideFileLocator_
std::vector< std::string > logicalFileNames_
std::vector< FileCatalogItem > const & fileCatalogItems() const