17 bool is_remote(
const std::string&
file_name) {
19 if (std::regex_match(
file_name, remote_check)) {
38 throw std::logic_error(
file_name +
" doesn't exist");
42 throw std::logic_error(
"can't open " +
file_name);
44 std::set<std::string>
keys;
45 int n_keys =
file->GetListOfKeys()->GetSize();
47 throw std::logic_error(
"no keys found in file");
49 for (
int keyn = 0; keyn < n_keys; keyn++) {
50 keys.insert(
file->GetListOfKeys()->At(keyn)->GetName());
52 size_t n_unique =
keys.size();
54 std::string
prob =
"Can't decide which tree to use, choose one of {";
59 if (uniq_n < n_unique)
prob.append(
", ");
61 prob.append(
"} with the --tree-name option");
62 throw std::logic_error(
prob);
64 auto*
key =
dynamic_cast<TKey*
>(
file->GetListOfKeys()->At(0));
65 std::string
name =
key->GetName();