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)
20  : pfn_(pfn), lfn_(lfn), fallbackPfn_(fallbackPfn) {}
21  std::string const& fileName() const { return pfn_; }
22  std::string const& logicalFileName() const { return lfn_; }
23  std::string const& fallbackFileName() const { return fallbackPfn_; }
24 
25  private:
29  };
30 
32  public:
33  InputFileCatalog(std::vector<std::string> const& fileNames,
34  std::string const& override,
35  bool useLFNasPFNifLFNnotFound = false);
36  InputFileCatalog(std::vector<std::string> const& fileNames,
37  std::string const& override,
38  std::string const& overrideFallback,
39  bool useLFNasPFNifLFNnotFound = false);
41  std::vector<FileCatalogItem> const& fileCatalogItems() const { return fileCatalogItems_; }
42  std::vector<std::string> const& logicalFileNames() const { return logicalFileNames_; }
43  std::vector<std::string> const& fileNames() const { return fileNames_; }
44  std::vector<std::string> const& fallbackFileNames() const { return fallbackFileNames_; }
45  bool empty() const { return fileCatalogItems_.empty(); }
46  static bool isPhysical(std::string const& name) { return (name.empty() || name.find(':') != std::string::npos); }
47 
48  private:
49  void init(std::string const& override, std::string const& overrideFallback, bool useLFNasPFNifLFNnotFound);
50  void findFile(std::string& pfn, std::string& fallbackPfn, std::string const& lfn, bool useLFNasPFNifLFNnotFound);
51  std::vector<std::string> logicalFileNames_;
52  std::vector<std::string> fileNames_;
53  std::vector<std::string> fallbackFileNames_;
54  std::vector<FileCatalogItem> fileCatalogItems_;
59  };
60 } // namespace edm
61 
62 #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