diff --git a/Framework/Utilities/CorsikaData.cc b/Framework/Utilities/CorsikaData.cc index 1d30f5132ba670d2c5b22d5617b809f3f078e7fd..5b0c1efc9a56cc60016e82152b95f676d9b1723f 100644 --- a/Framework/Utilities/CorsikaData.cc +++ b/Framework/Utilities/CorsikaData.cc @@ -1,12 +1,22 @@ +/* + * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu + * + * See file AUTHORS for a list of contributors. + * + * This software is distributed under the terms of the GNU General Public + * Licence version 3 (GPL Version 3). See file LICENSE for a full version of + * the license. + */ + #include <corsika/utl/CorsikaData.h> #include <cstdlib> #include <stdexcept> #include <string> -std::filesystem::path corsika::utl::CorsikaData(std::filesystem::path const& key) { +std::string corsika::utl::CorsikaData(std::string const& key) { if (auto const* p = std::getenv("CORSIKA_DATA"); p != nullptr) { - auto const path = std::filesystem::path(p) / key; + auto const path = std::string(p) + "/" + key; return path; } else { throw std::runtime_error("CORSIKA_DATA not set"); diff --git a/Framework/Utilities/CorsikaData.h b/Framework/Utilities/CorsikaData.h index 63e763aa6db1b6ba0e0cc19b4577616acdf8598a..7a381ca159fff356d2e3fc4b2da973b3562cf069 100644 --- a/Framework/Utilities/CorsikaData.h +++ b/Framework/Utilities/CorsikaData.h @@ -8,12 +8,12 @@ * the license. */ -#include <filesystem> +//#include <filesystem> #include <string> namespace corsika::utl { /** * returns the full path of the file \p filename within the CORSIKA_DATA directory */ - std::filesystem::path CorsikaData(std::filesystem::path const& filename); + std::string CorsikaData(std::string const& filename); } // namespace corsika::utl diff --git a/Processes/UrQMD/UrQMD.cc b/Processes/UrQMD/UrQMD.cc index ffa6593bb5d3679cfe7322ab4bc170b55e106395..09d171e26884f0ff7db40edcb5c4eaea424d2642 100644 --- a/Processes/UrQMD/UrQMD.cc +++ b/Processes/UrQMD/UrQMD.cc @@ -31,7 +31,7 @@ using SetupStack = corsika::setup::Stack; using SetupParticle = corsika::setup::Stack::StackIterator; using SetupProjectile = corsika::setup::StackView::StackIterator; -UrQMD::UrQMD(std::filesystem::path const& xs_file) { +UrQMD::UrQMD(std::string const& xs_file) { readXSFile(xs_file); iniurqmd_(); } @@ -435,11 +435,11 @@ std::pair<int, int> corsika::process::UrQMD::ConvertToUrQMD( return mapPDGToUrQMD.at(static_cast<int>(GetPDG(code))); } -void UrQMD::readXSFile(std::filesystem::path const& filename) { +void UrQMD::readXSFile(std::string const& filename) { std::ifstream file(filename, std::ios::in); if (!file.is_open()) { - throw std::runtime_error(filename.native() + " could not be opened."); + throw std::runtime_error(filename + " could not be opened."); } std::string line; diff --git a/Processes/UrQMD/UrQMD.h b/Processes/UrQMD/UrQMD.h index 893fe3697800a388a315663feb061212e612832d..1ec6e289b9f5ea09961702fb682e501f92220f81 100644 --- a/Processes/UrQMD/UrQMD.h +++ b/Processes/UrQMD/UrQMD.h @@ -21,15 +21,14 @@ #include <boost/multi_array.hpp> #include <array> -#include <filesystem> #include <random> +#include <string> #include <utility> namespace corsika::process::UrQMD { class UrQMD : public corsika::process::InteractionProcess<UrQMD> { public: - UrQMD( - std::filesystem::path const& path = utl::CorsikaData("UrQMD/UrQMD-1.3.1-xs.dat")); + UrQMD(std::string const& path = utl::CorsikaData("UrQMD/UrQMD-1.3.1-xs.dat")); void Init() {} corsika::units::si::GrammageType GetInteractionLength( corsika::setup::Stack::StackIterator const&) const; @@ -51,7 +50,7 @@ namespace corsika::process::UrQMD { bool CanInteract(particles::Code) const; private: - void readXSFile(std::filesystem::path const&); + void readXSFile(std::string const&); corsika::random::RNG& fRNG = corsika::random::RNGManager::GetInstance().GetRandomStream("UrQMD");