Skip to content
Snippets Groups Projects
Commit efab3620 authored by Felix Weiglhofer's avatar Felix Weiglhofer Committed by Volker Friese
Browse files

algo: Add UnpackChain to use algo::Unpack.

parent 36f057f8
No related branches found
No related tags found
1 merge request!1201cbmreco: Integrate algo::Unpack
......@@ -19,6 +19,7 @@ set(SRCS
trigger/TimeClusterTrigger.cxx
evselector/DigiEventSelector.cxx
unpack/Unpack.cxx
unpack/UnpackChain.cxx
detectors/sts/ReadoutConfig.cxx
detectors/sts/StsHitfinderChain.cxx
detectors/sts/StsReadoutConfigLegacy.cxx
......
......@@ -56,12 +56,8 @@ void Reco::Init(const Options& opts)
YAML::Node yaml = YAML::LoadFile(recoParamsPath.string());
fContext.recoParams = config::Read<RecoParams>(yaml);
// STS Unpacker
fs::path stsUnpackParamsPath = opts.ParamsDir() / "StsReadout.yaml";
yaml = YAML::LoadFile(stsUnpackParamsPath.string());
sts::ReadoutSetup readoutConfig = config::Read<sts::ReadoutSetup>(yaml);
sts::ReadoutConfig mapping(readoutConfig);
fUnpack.Init(mapping);
// Unpackers
fUnpack.Init();
// STS Hitfinder
fs::path stsHitfinderParamsPath = opts.ParamsDir() / "StsHitfinder.yaml";
......@@ -95,7 +91,7 @@ void Reco::Run(const fles::Timeslice& ts)
throw std::runtime_error("XPU unpacker currently not implemented");
break;
default:
case RecoParams::UnpackMode::CPU: digis = fUnpack.Run(ts); break;
case RecoParams::UnpackMode::CPU: digis = fUnpack.Run(ts).first.fData.fSts.fDigis; break;
}
fStsHitFinder(digis);
......
......@@ -7,8 +7,8 @@
#include <xpu/host.h>
#include "SubChain.h"
#include "UnpackChain.h"
#include "sts/StsHitfinderChain.h"
#include "sts/StsUnpackChain.h"
namespace fles
{
......@@ -40,7 +40,7 @@ namespace cbm::algo
xpu::timings fTimesliceTimesAcc;
// STS
sts::UnpackChain fUnpack;
UnpackChain fUnpack;
sts::HitfinderChain fStsHitFinder;
void Validate(const Options& opts);
......
/* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
SPDX-License-Identifier: GPL-3.0-only
Authors: Felix Weiglhofer [committer] */
#include "UnpackChain.h"
using namespace cbm::algo;
void UnpackChain::Init()
{
bool ok = fUnpack.Init();
if (!ok) throw std::runtime_error("Unpack::Init failed");
}
Unpack::resultType UnpackChain::Run(const fles::Timeslice& timeslice) { return fUnpack(&timeslice); }
/* 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_UNPACK_UNPACKCHAIN_H
#define CBM_ALGO_UNPACK_UNPACKCHAIN_H
#include "SubChain.h"
#include "Unpack.h"
namespace cbm::algo
{
class UnpackChain : public SubChain {
public:
void Init();
Unpack::resultType Run(const fles::Timeslice&);
private:
Unpack fUnpack;
};
} // namespace cbm::algo
#endif //CBM_ALGO_UNPACK_UNPACKCHAIN_H
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