13 #include <boost/algorithm/string.hpp> 21 bool useLFNasPFNifLFNnotFound,
23 : logicalFileNames_(
fileNames), fileNames_(
fileNames), fileCatalogItems_(), overrideFileLocator_() {
24 init(
override, useLFNasPFNifLFNnotFound, catType);
30 std::vector<std::string>
tmp;
33 tmp.push_back(
item.fileName(iCatalog));
39 bool useLFNasPFNifLFNnotFound,
41 typedef std::vector<std::string>::iterator iter;
46 std::make_unique<FileLocator>(inputOverride);
49 std::vector<std::string> tmps;
51 if (tmps.size() != 5) {
53 ex <<
"Trying to override input file catalog but invalid input override string " << inputOverride
54 <<
" (Should be site,subSite,storageSite,volume,protocol)";
55 ex.
addContext(
"Calling edm::InputFileCatalog::init()");
60 tmps[0], tmps[1], tmps[2], tmps[3], tmps[4]);
63 std::make_unique<FileLocator>(inputOverride_struct);
70 ex <<
"edm::SiteLocalConfigService is not available";
71 ex.
addContext(
"Calling edm::InputFileCatalog::init()");
76 std::vector<std::string>
const& tmp_dataCatalogs = localconfservice->trivialDataCatalogs();
83 for (
auto it = tmp_dataCatalogs.begin() + 1; it != tmp_dataCatalogs.end(); ++it) {
91 std::vector<edm::CatalogAttributes>
const& tmp_dataCatalogs = localconfservice->dataCatalogs();
95 fileLocators_.push_back(std::make_unique<FileLocator>(tmp_dataCatalogs.front()));
96 for (
auto it = tmp_dataCatalogs.begin() + 1; it != tmp_dataCatalogs.end(); ++it) {
105 ex <<
"Undefined catalog type";
106 ex.
addContext(
"Calling edm::InputFileCatalog::init()");
113 std::vector<std::string> pfns;
116 ex <<
"An empty string specified in the fileNames parameter for input source";
117 ex.
addContext(
"Calling edm::InputFileCatalog::init()");
121 if (it->back() ==
':') {
123 ex <<
"An empty physical file name specified in the fileNames parameter for input source";
124 ex.
addContext(
"Calling edm::InputFileCatalog::init()");
132 findFile(*lt, pfns, useLFNasPFNifLFNnotFound, catType);
140 std::vector<std::string>& pfns,
141 bool useLFNasPFNifLFNnotFound,
149 if (pfn.empty() && useLFNasPFNifLFNnotFound)
157 if (pfn.empty() && useLFNasPFNifLFNnotFound)
164 ex <<
"Undefined catalog type";
165 ex.
addContext(
"Calling edm::InputFileCatalog::findFile()");
static void trim(std::string &s)
def split(sequence, size)
void addContext(std::string const &context)