Skip to content
Snippets Groups Projects
Commit a275a6d6 authored by Felix Weiglhofer's avatar Felix Weiglhofer
Browse files

algo: Replace std::filesystem with boost::filesystem.

parent 5a520f8e
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !1164. Comments created here will be created in the context of that merge request.
...@@ -71,6 +71,7 @@ target_link_libraries(Algo ...@@ -71,6 +71,7 @@ target_link_libraries(Algo
ROOT::GenVector ROOT::GenVector
GSL GSL
Boost::program_options Boost::program_options
Boost::filesystem
xpu xpu
external::yaml-cpp external::yaml-cpp
INTERFACE FairLogger::FairLogger INTERFACE FairLogger::FairLogger
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
#ifndef CBM_ALGO_BASE_OPTIONS_H #ifndef CBM_ALGO_BASE_OPTIONS_H
#define CBM_ALGO_BASE_OPTIONS_H #define CBM_ALGO_BASE_OPTIONS_H
#include <filesystem>
#include <string> #include <string>
#include "compat/Filesystem.h"
namespace cbm::algo namespace cbm::algo
{ {
...@@ -16,7 +17,7 @@ namespace cbm::algo ...@@ -16,7 +17,7 @@ namespace cbm::algo
Options() = default; Options() = default;
Options(int argc, char** argv); Options(int argc, char** argv);
std::filesystem::path ParamsDir() const { return fParamsDir; } fs::path ParamsDir() const { return fParamsDir; }
const std::string& InputLocator() const { return fInputLocator; } const std::string& InputLocator() const { return fInputLocator; }
const std::string& LogLevel() const { return fLogLevel; } const std::string& LogLevel() const { return fLogLevel; }
const std::string& Device() const { return fDevice; } const std::string& Device() const { return fDevice; }
......
/* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
SPDX-License-Identifier: GPL-3.0-only
Authors: Felix Weiglhofer [committer] */
#ifndef CBM_ALGO_BASE_FILESYSTEM_H
#define CBM_ALGO_BASE_FILESYSTEM_H
#include <boost/filesystem.hpp>
namespace cbm::algo
{
// Use boost::filesystem by default instead of std::filesystem for
// compatibility with older compilers and ROOT versions
namespace fs = boost::filesystem;
} // namespace cbm::algo
#endif // CBM_ALGO_BASE_FILESYSTEM_H
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
using namespace cbm::algo; using namespace cbm::algo;
sts::LandauTable sts::LandauTable::FromFile(std::filesystem::path path) sts::LandauTable sts::LandauTable::FromFile(fs::path path)
{ {
sts::LandauTable table; sts::LandauTable table;
......
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
#ifndef CBM_ALGO_DATA_STS_LANDAUTABLE_H #ifndef CBM_ALGO_DATA_STS_LANDAUTABLE_H
#define CBM_ALGO_DATA_STS_LANDAUTABLE_H #define CBM_ALGO_DATA_STS_LANDAUTABLE_H
#include <filesystem>
#include <vector> #include <vector>
#include "Prelude.h" #include "Prelude.h"
#include "compat/Filesystem.h"
namespace cbm::algo::sts namespace cbm::algo::sts
{ {
struct LandauTable { struct LandauTable {
static LandauTable FromFile(std::filesystem::path path); static LandauTable FromFile(fs::path path);
std::vector<f32> values; std::vector<f32> values;
f32 stepSize = 0; f32 stepSize = 0;
......
...@@ -26,8 +26,9 @@ void Reco::Init(const Options& opts) ...@@ -26,8 +26,9 @@ void Reco::Init(const Options& opts)
LOG(info) << "Running CBM Reco on Device " << props.name(); LOG(info) << "Running CBM Reco on Device " << props.name();
// Reco Params // Reco Params
YAML::Node yaml = YAML::LoadFile(opts.ParamsDir() / "RecoParams.yaml"); fs::path recoParamsPath = opts.ParamsDir() / "Reco.yaml";
fContext.recoParams = config::Read<RecoParams>(yaml); YAML::Node yaml = YAML::LoadFile(recoParamsPath.string());
fContext.recoParams = config::Read<RecoParams>(yaml);
// STS Unpacker // STS Unpacker
// yaml = YAML::LoadFile(opts.ParamsDir() / "StsReadout.yaml"); // yaml = YAML::LoadFile(opts.ParamsDir() / "StsReadout.yaml");
...@@ -36,7 +37,8 @@ void Reco::Init(const Options& opts) ...@@ -36,7 +37,8 @@ void Reco::Init(const Options& opts)
fUnpack.Init(readoutConfig); fUnpack.Init(readoutConfig);
// STS Hitfinder // STS Hitfinder
yaml = YAML::LoadFile(opts.ParamsDir() / "StsHitfinder.yaml"); fs::path stsHitfinderParamsPath = opts.ParamsDir() / "StsHitfinder.yaml";
yaml = YAML::LoadFile(stsHitfinderParamsPath.string());
sts::HitfinderPars hitFinderConfig = config::Read<sts::HitfinderPars>(yaml); sts::HitfinderPars hitFinderConfig = config::Read<sts::HitfinderPars>(yaml);
hitFinderConfig.landauTable = sts::LandauTable::FromFile(opts.ParamsDir() / "LandauWidthTable.txt"); hitFinderConfig.landauTable = sts::LandauTable::FromFile(opts.ParamsDir() / "LandauWidthTable.txt");
fStsHitFinder.SetParameters(hitFinderConfig); fStsHitFinder.SetParameters(hitFinderConfig);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment