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
......@@ -71,6 +71,7 @@ target_link_libraries(Algo
ROOT::GenVector
GSL
Boost::program_options
Boost::filesystem
xpu
external::yaml-cpp
INTERFACE FairLogger::FairLogger
......
......@@ -4,9 +4,10 @@
#ifndef CBM_ALGO_BASE_OPTIONS_H
#define CBM_ALGO_BASE_OPTIONS_H
#include <filesystem>
#include <string>
#include "compat/Filesystem.h"
namespace cbm::algo
{
......@@ -16,7 +17,7 @@ namespace cbm::algo
Options() = default;
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& LogLevel() const { return fLogLevel; }
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 @@
using namespace cbm::algo;
sts::LandauTable sts::LandauTable::FromFile(std::filesystem::path path)
sts::LandauTable sts::LandauTable::FromFile(fs::path path)
{
sts::LandauTable table;
......
......@@ -4,17 +4,17 @@
#ifndef CBM_ALGO_DATA_STS_LANDAUTABLE_H
#define CBM_ALGO_DATA_STS_LANDAUTABLE_H
#include <filesystem>
#include <vector>
#include "Prelude.h"
#include "compat/Filesystem.h"
namespace cbm::algo::sts
{
struct LandauTable {
static LandauTable FromFile(std::filesystem::path path);
static LandauTable FromFile(fs::path path);
std::vector<f32> values;
f32 stepSize = 0;
......
......@@ -26,8 +26,9 @@ void Reco::Init(const Options& opts)
LOG(info) << "Running CBM Reco on Device " << props.name();
// Reco Params
YAML::Node yaml = YAML::LoadFile(opts.ParamsDir() / "RecoParams.yaml");
fContext.recoParams = config::Read<RecoParams>(yaml);
fs::path recoParamsPath = opts.ParamsDir() / "Reco.yaml";
YAML::Node yaml = YAML::LoadFile(recoParamsPath.string());
fContext.recoParams = config::Read<RecoParams>(yaml);
// STS Unpacker
// yaml = YAML::LoadFile(opts.ParamsDir() / "StsReadout.yaml");
......@@ -36,7 +37,8 @@ void Reco::Init(const Options& opts)
fUnpack.Init(readoutConfig);
// 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);
hitFinderConfig.landauTable = sts::LandauTable::FromFile(opts.ParamsDir() / "LandauWidthTable.txt");
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