/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWStorage/Catalog/interface/FileLocator.h
48 строк
1 KB
W. David Dagenhart
Reduce the memory usage of the InputFileCatalog
18 май 2026, 23:53
18 май 2026, 23:53
7e6433c
Код
Авторство
О чём код?
#ifndef FWStorage_Catalog_FileLocator_h #define FWStorage_Catalog_FileLocator_h // Class FileLocator converts a Logical File Name (LFN) // to a Physical File Name (PFN) using rules from storage.json. // This is used by InputFileCatalog. #include <filesystem> #include <map> #include <regex> #include <string> #include <vector> #include <boost/property_tree/ptree.hpp> namespace edm { struct CatalogAttributes; class FileLocator { public: explicit FileLocator(CatalogAttributes const& catalogAttributes, std::filesystem::path const& filename_storage); std::string pfn(std::string const& lfn) const; private: struct Rule { std::regex pathMatch; std::string result; std::string chain; }; using Rules = std::vector<Rule>; using ProtocolRules = std::map<std::string, Rules>; void parseRule(boost::property_tree::ptree::value_type const& storageRule, std::string const& protocol, ProtocolRules& rules); std::string applyRules(ProtocolRules const& protocolRules, std::string const& protocol, std::string name) const; /** Direct rules are used to do the mapping from LFN to PFN and taken from storage.json*/ ProtocolRules m_directRules; std::string m_protocol; }; } // namespace edm #endif