DAS  3.0
Das Analysis System
toolbox.h
Go to the documentation of this file.
1 #include <tuple>
2 #include <string>
3 #include <vector>
4 #include <filesystem>
5 
6 #include <boost/algorithm/string.hpp>
7 
8 #include <darwin.h>
9 
10 namespace DAS::Muon {
11 
12 std::tuple<std::filesystem::path, std::string> getLocation (const std::string& location)
13 {
14  using namespace std;
15  namespace al = boost::algorithm;
16  namespace fs = filesystem;
17 
18  vector<string> words;
19  al::split(words, location, al::is_any_of(":"), al::token_compress_on);
20  if (words.size() != 2)
21  BOOST_THROW_EXCEPTION( invalid_argument("Expecting `/path/to/file.ext:histname`") );
22  fs::path filename = words.front();
23  string histname = words.back();
24  return {filename, histname};
25 }
26 
27 } // end of DAS::Muon namespace
Darwin::Tools::split
@ split
activate -k and -j to define slice
Definition: Options.h:26
DAS::Muon::getLocation
std::tuple< std::filesystem::path, std::string > getLocation(const std::string &location)
Definition: toolbox.h:12
DAS::Muon
Definition: applyDimuonTriggerStrategy.cc:34