17 if (csv_file_path.empty()) {
18 csv_file_path = std::string(getenv(
"SNDSW_ROOT")) +
"/analysis/tools/geo_paths.csv";
20 std::ifstream file(csv_file_path);
21 if (!file.is_open()) {
22 throw std::runtime_error(
"Could not open CSV file: " + csv_file_path);
26 std::getline(file, line);
28 while (std::getline(file, line)) {
29 std::istringstream ss(line);
32 std::getline(ss, token,
',');
33 int min_run = std::stoi(token);
35 std::getline(ss, token,
',');
36 int max_run = std::stoi(token);
38 std::getline(ss, token);
39 std::string path = token;
41 if (run_number >= min_run && run_number <= max_run) {
45 throw std::runtime_error(
"Run number not found in CSV mapping.");
51 TPython::Exec(
"import SndlhcGeo");
52 TPython::Exec((
"SndlhcGeo.GeoInterface('" + geometry_path +
"')").c_str());
59 scifi =
dynamic_cast<Scifi *
>(gROOT->GetListOfGlobals()->FindObject(
"Scifi"));
60 mufilter =
dynamic_cast<MuFilter *
>(gROOT->GetListOfGlobals()->FindObject(
"MuFilter"));
62 return std::make_pair(scifi, mufilter);