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

online: Add support for 2024 setup files.

parent a18234e0
Branches
Tags
1 merge request!1786online: Add support for 2024 setup files.
Pipeline #29109 passed
......@@ -135,6 +135,7 @@ set(SRCS
detectors/rich/ReadoutConfig.cxx
detectors/rich/Unpack.cxx
detectors/rich/UnpackMS.cxx
global/ParFiles.cxx
global/Reco.cxx
global/RecoResultsInputArchive.cxx
global/RecoResultsOutputArchive.cxx
......
......@@ -13,6 +13,7 @@
#include "CaHit.h"
#include "CaInitManager.h"
#include "CaParameters.h"
#include "ParFiles.h"
#include "compat/OpenMP.h"
#include "yaml/Yaml.h"
......@@ -56,7 +57,8 @@ void TrackingChain::Init()
// ------ Read tracking chain parameters from the config
fConfig = yaml::ReadFromFile<TrackingChainConfig>(Opts().ParamsDir() / "TrackingChainConfig.yaml");
ParFiles parFiles(Opts().RunId());
fConfig = yaml::ReadFromFile<TrackingChainConfig>(Opts().ParamsDir() / parFiles.ca.mainConfig);
// ------ Read parameters from binary
auto geomCfgFile = (Opts().ParamsDir() / fConfig.fsGeomConfig).string();
......
......@@ -11,6 +11,7 @@
#include "CbmTofAddress.h"
#include "HitfindSetup.h"
#include "ParFiles.h"
#include "fmt/format.h"
#include "log.hpp"
......@@ -57,7 +58,8 @@ void TrackingInterface::Init()
fvTrackingStationId[9] = {1, 2, 3, 4};
}
else {
auto setup = yaml::ReadFromFile<HitfindSetup>(Opts().ParamsDir() / "TofHitfinderPar.yaml");
ParFiles parFiles(Opts().RunId());
auto setup = yaml::ReadFromFile<HitfindSetup>(Opts().ParamsDir() / parFiles.tof.hitfinder);
fvNofSm = std::move(setup.NbSm);
fvNofRpc = std::move(setup.NbRpc);
assert(fvNofSm.size() == fvNofRpc.size());
......
/* Copyright (C) 2024 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
SPDX-License-Identifier: GPL-3.0-only
Authors: Felix Weiglhofer [committer] */
#include "ParFiles.h"
using namespace cbm::algo;
ParFiles::ParFiles(uint32_t runId)
{
bool is2024 = 2724 <= runId;
if (is2024) {
sts.readout = "StsReadout_mcbm2024.yaml";
sts.chanMask = "StsChannelMaskSet_mcbm2024.yaml";
sts.walkMap = "StsWalkMap_mcbm2024.yaml";
sts.hitfinder = "StsHitfinder_mcbm2024.yaml";
tof.calibrate = "TofCalibratePar_mcbm2024.yaml";
tof.hitfinder = "TofHitfinderPar_mcbm2024.yaml";
trd.readout = "TrdReadoutSetup_mcbm2024.yaml";
trd.readout2d = "TrdReadout2DSetup_mcbm2022.yaml"; // TODO: no new readout for TRD2D?
trd.hitfinder = "TrdHitfinderPar_mcbm2024.yaml";
trd.hitfinder2d = "TrdHitfinder2DPar_mcbm2024.yaml";
ca.mainConfig = "TrackingChainConfig_mcbm2024.yaml";
}
else { // Assume 2022 setup
sts.readout = "StsReadout_mcbm2022.yaml";
sts.chanMask = "StsChannelMaskSet_mcbm2022.yaml";
sts.walkMap = "StsWalkMap_mcbm2022.yaml";
sts.hitfinder = "StsHitfinder_mcbm2022.yaml";
tof.calibrate = "TofCalibratePar_mcbm2022.yaml";
tof.hitfinder = "TofHitfinderPar_mcbm2022.yaml";
trd.readout = "TrdReadoutSetup_mcbm2022.yaml";
trd.readout2d = "TrdReadout2DSetup_mcbm2022.yaml";
trd.hitfinder = "TrdHitfinderPar_mcbm2022.yaml";
trd.hitfinder2d = "TrdHitfinder2DPar_mcbm2022.yaml";
ca.mainConfig = "TrackingChainConfig_mcbm2022.yaml";
}
}
/* Copyright (C) 2024 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
SPDX-License-Identifier: GPL-3.0-only
Authors: Felix Weiglhofer [committer] */
#pragma once
/**
* @file ParFiles.h
* @brief This file contains the definition of the ParFiles class.
*/
#include "compat/Filesystem.h"
namespace cbm::algo
{
/**
* @class ParFiles
* @brief Class to hold the paths to the parameter files for the different detectors.
**/
struct ParFiles {
ParFiles(uint32_t runId);
struct {
fs::path readout;
fs::path chanMask;
fs::path walkMap;
fs::path hitfinder;
} sts;
struct {
fs::path calibrate;
fs::path hitfinder;
} tof;
struct {
fs::path readout;
fs::path readout2d;
fs::path hitfinder;
fs::path hitfinder2d;
} trd;
struct {
fs::path mainConfig;
} ca;
};
} // namespace cbm::algo
......@@ -8,6 +8,7 @@
#include "EventbuildChain.h"
#include "Exceptions.h"
#include "HistogramSender.h"
#include "ParFiles.h"
#include "StsDigiQa.h"
#include "TrackingSetup.h"
#include "bmon/Unpack.h"
......@@ -96,6 +97,8 @@ void Reco::Init(const Options& opts)
// Reco Params
fContext.recoParams = yaml::ReadFromFile<RecoParams>(opts.ParamsDir() / "RecoParams.yaml");
ParFiles parFiles(opts.RunId());
// Unpackers
if (Opts().Has(Subsystem::BMON) && Opts().Has(Step::Unpack)) {
bmon::ReadoutConfig cfg{};
......@@ -113,18 +116,9 @@ void Reco::Init(const Options& opts)
}
if (Opts().Has(Subsystem::STS) && Opts().Has(Step::Unpack)) {
fs::path readoutFile = "StsReadout_mcbm2022.yaml";
fs::path chanMaskFile = "StsChannelMaskSet_mcbm2022.yaml";
fs::path walkFile = "StsWalkMap_mcbm2022.yaml";
if (2724 <= Opts().RunId()) {
readoutFile = "StsReadout_mcbm2024.yaml";
chanMaskFile = "StsChannelMaskSet_mcbm2024.yaml";
walkFile = "StsWalkMap_mcbm2024.yaml";
}
sts::ReadoutSetup readoutSetup = yaml::ReadFromFile<sts::ReadoutSetup>(Opts().ParamsDir() / readoutFile);
auto chanMask = yaml::ReadFromFile<sts::ChannelMaskSet>(Opts().ParamsDir() / chanMaskFile);
auto walkMap = yaml::ReadFromFile<sts::WalkMap>(Opts().ParamsDir() / walkFile);
sts::ReadoutSetup readoutSetup = yaml::ReadFromFile<sts::ReadoutSetup>(Opts().ParamsDir() / parFiles.sts.readout);
auto chanMask = yaml::ReadFromFile<sts::ChannelMaskSet>(Opts().ParamsDir() / parFiles.sts.chanMask);
auto walkMap = yaml::ReadFromFile<sts::WalkMap>(Opts().ParamsDir() / parFiles.sts.walkMap);
sts::ReadoutConfig readout{readoutSetup, chanMask};
sts::Unpack::Config cfg{.readout = readout, .walkMap = walkMap};
......@@ -143,13 +137,12 @@ void Reco::Init(const Options& opts)
}
if (Opts().Has(Subsystem::TRD) && Opts().Has(Step::Unpack)) {
fs::path readoutFile = 2724 <= Opts().RunId() ? "TrdReadoutSetup_mcbm2024.yaml" : "TrdReadoutSetup_mcbm2022.yaml";
auto cfg = yaml::ReadFromFile<trd::ReadoutConfig>(Opts().ParamsDir() / readoutFile);
auto cfg = yaml::ReadFromFile<trd::ReadoutConfig>(Opts().ParamsDir() / parFiles.trd.readout);
fTrdUnpack = std::make_unique<trd::Unpack>(cfg);
}
if (Opts().Has(Subsystem::TRD2D) && Opts().Has(Step::Unpack)) {
auto cfg = yaml::ReadFromFile<trd2d::ReadoutConfig>(Opts().ParamsDir() / "Trd2dReadoutSetup.yaml");
auto cfg = yaml::ReadFromFile<trd2d::ReadoutConfig>(Opts().ParamsDir() / parFiles.trd.readout2d);
fTrd2dUnpack = std::make_unique<trd2d::Unpack>(cfg);
}
......@@ -169,7 +162,8 @@ void Reco::Init(const Options& opts)
// STS Hitfinder
if (Opts().Has(fles::Subsystem::STS) && Opts().Has(Step::LocalReco)) {
sts::HitfinderPars hitFinderSetup = yaml::ReadFromFile<sts::HitfinderPars>(opts.ParamsDir() / "StsHitfinder.yaml");
sts::HitfinderPars hitFinderSetup =
yaml::ReadFromFile<sts::HitfinderPars>(opts.ParamsDir() / parFiles.sts.hitfinder);
hitFinderSetup.landauTable = sts::LandauTable::FromFile(opts.ParamsDir() / "LandauWidthTable.txt");
sts::HitfinderChainPars hitFinderPars;
hitFinderPars.setup = std::move(hitFinderSetup);
......@@ -182,17 +176,16 @@ void Reco::Init(const Options& opts)
// TOF Hitfinder
if (Opts().Has(fles::Subsystem::TOF) && Opts().Has(Step::LocalReco)) {
auto calibSetup = yaml::ReadFromFile<tof::CalibrateSetup>(opts.ParamsDir() / "TofCalibratePar.yaml");
auto calibSetup = yaml::ReadFromFile<tof::CalibrateSetup>(opts.ParamsDir() / parFiles.tof.calibrate);
fTofCalibrator = std::make_unique<tof::Calibrate>(calibSetup);
auto hitfindSetup = yaml::ReadFromFile<tof::HitfindSetup>(opts.ParamsDir() / "TofHitfinderPar.yaml");
auto hitfindSetup = yaml::ReadFromFile<tof::HitfindSetup>(opts.ParamsDir() / parFiles.tof.hitfinder);
fTofHitFinder = std::make_unique<tof::Hitfind>(hitfindSetup);
}
if (Opts().Has(fles::Subsystem::TRD) && Opts().Has(Step::LocalReco)) {
// TODO load setup files!!!
auto setup = yaml::ReadFromFile<trd::HitfindSetup>(opts.ParamsDir() / "TrdHitfinderPar.yaml");
auto setup2d = yaml::ReadFromFile<trd::Hitfind2DSetup>(opts.ParamsDir() / "TrdHitfinder2DPar.yaml");
auto setup = yaml::ReadFromFile<trd::HitfindSetup>(opts.ParamsDir() / parFiles.trd.hitfinder);
auto setup2d = yaml::ReadFromFile<trd::Hitfind2DSetup>(opts.ParamsDir() / parFiles.trd.hitfinder2d);
fTrdHitfind = std::make_unique<trd::Hitfind>(setup, setup2d);
}
......
set(PARAMETER_VERSION 356c63407315fdf944f45e1351237ea4efe41faf) # 2024-04-25
set(PARAMETER_VERSION 208494d2f668ff0fc349180008279739a7da864e) # 2024-04-27
set(PARAMETER_SRC_URL "https://git.cbm.gsi.de/CbmSoft/cbmroot_parameter.git")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment