CbmRoot
Loading...
Searching...
No Matches
SubChain.h
Go to the documentation of this file.
1/* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Felix Weiglhofer [committer] */
4#ifndef CBM_ALGO_BASE_SUBCHAIN_H
5#define CBM_ALGO_BASE_SUBCHAIN_H
6
7#include "ChainContext.h"
8
9#include <gsl/pointers>
10
11namespace cbm::algo
12{
13 class SubChain {
14
15 public:
16 const ChainContext* GetContext() { return fContext; }
17
18 void SetContext(const ChainContext* ctx) { fContext = ctx; }
19
20 const Options& Opts() const { return gsl::make_not_null(fContext)->opts; }
21 const RecoParams& Params() const { return gsl::make_not_null(fContext)->recoParams; }
22
23 bool HasMonitor() const { return gsl::make_not_null(fContext)->monitor != nullptr; }
24
25 Monitor& GetMonitor() const
26 {
27 // Need Get-prefix to avoid conflict with Monitor-class name
28 if (!HasMonitor()) throw std::runtime_error("No monitor available");
29 return *gsl::make_not_null(fContext)->monitor;
30 }
31
32
33 private:
34 const ChainContext* fContext = nullptr;
35 };
36} // namespace cbm::algo
37
38#endif
const RecoParams & Params() const
Definition SubChain.h:21
Monitor & GetMonitor() const
Definition SubChain.h:25
const ChainContext * GetContext()
Definition SubChain.h:16
bool HasMonitor() const
Definition SubChain.h:23
const ChainContext * fContext
Definition SubChain.h:34
void SetContext(const ChainContext *ctx)
Definition SubChain.h:18
const Options & Opts() const
Definition SubChain.h:20
RecoParams contains all parameters to configure reconstruction.
Definition RecoParams.h:20