Select Git revision
Felix Weiglhofer authored
SubChain.h 990 B
/* 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_SUBCHAIN_H
#define CBM_ALGO_BASE_SUBCHAIN_H
#include <gsl/pointers>
#include "ChainContext.h"
namespace cbm::algo
{
class SubChain {
public:
void SetContext(ChainContext* ctx) { fContext = ctx; }
const Options& Opts() const { return gsl::make_not_null(fContext)->opts; }
const RecoParams& Params() const { return gsl::make_not_null(fContext)->recoParams; }
bool HasMonitor() const { return gsl::make_not_null(fContext)->monitor != nullptr; }
Monitor& GetMonitor() const
{
// Need Get-prefix to avoid conflict with Monitor-class name
if (!HasMonitor()) throw std::runtime_error("No monitor available");
return *gsl::make_not_null(fContext)->monitor;
}
private:
ChainContext* fContext = nullptr;
};
} // namespace cbm::algo
#endif