CbmRoot
Loading...
Searching...
No Matches
QaBase.h
Go to the documentation of this file.
1/* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#pragma once
11
12#include "Definitions.h"
13#include "PODVector.h"
14#include "QaData.h"
15
16#include <string>
17
18namespace cbm::algo::sts
19{
25 template<class Digi, class AuxData, class ReadoutSetup>
26 class QaBase {
27 public:
31 QaBase(std::shared_ptr<HistogramSender> pSender, const std::string& dirname) : fQaData(dirname), fpSender(pSender)
32 {
33 }
34
36 QaBase() = delete;
37
39 QaBase(const QaBase&) = delete;
40
42 QaBase(QaBase&&) = delete;
43
45 QaBase& operator=(const QaBase&) = delete;
46
48 QaBase& operator=(QaBase&&) = delete;
49
51 bool IsSenderDefined() const { return static_cast<bool>(fpSender.get()); }
52
54 void RegisterDigiData(const PODVector<Digi>* pvDigis) { fpvDigis = pvDigis; }
55
57 void RegisterAuxDigiData(const AuxData* pAuxDigis)
58 {
59 if (fbAux) {
60 fpAuxDigis = pAuxDigis;
61 }
62 else {
63 fpAuxDigis = nullptr;
64 }
65 }
66
68 void RegisterReadoutSetup(const ReadoutSetup& setup) { fpReadoutSetup = std::make_shared<ReadoutSetup>(setup); }
69
71 void SetUseAuxData(bool bAux = true) { fbAux = bAux; }
72
74 void SetTimesliceIndex(uint64_t tsIndex) { fQaData.SetTimesliceId(tsIndex); }
75
76 protected:
78 std::shared_ptr<HistogramSender> fpSender = nullptr;
79 std::shared_ptr<ReadoutSetup> fpReadoutSetup = nullptr;
80 const PODVector<Digi>* fpvDigis = nullptr;
81 const AuxData* fpAuxDigis = nullptr;
82 bool fbAux = false;
83 };
84} // namespace cbm::algo::sts
Class to handle QA-objects in the online reconstruction.
Definition QaData.h:28
void SetTimesliceId(uint64_t timesliceId)
Updates the timeslice index.
Definition QaData.h:74
QA module for STS raw digis.
void RegisterAuxDigiData(const AuxData *pAuxDigis)
Register auxiliary digi data.
Definition QaBase.h:57
void RegisterReadoutSetup(const ReadoutSetup &setup)
Register read-out setup config.
Definition QaBase.h:68
std::shared_ptr< ReadoutSetup > fpReadoutSetup
Readout config instance.
Definition QaBase.h:79
QaBase(std::shared_ptr< HistogramSender > pSender, const std::string &dirname)
Constructor.
Definition QaBase.h:31
void SetTimesliceIndex(uint64_t tsIndex)
Sets timeslice index.
Definition QaBase.h:74
void RegisterDigiData(const PODVector< Digi > *pvDigis)
Register digi-qa data.
Definition QaBase.h:54
QaBase(QaBase &&)=delete
Move constructor.
std::shared_ptr< HistogramSender > fpSender
Histogram sender.
Definition QaBase.h:78
QaBase()=delete
Default constructor.
const AuxData * fpAuxDigis
Aux information on digis.
Definition QaBase.h:81
QaBase & operator=(const QaBase &)=delete
Copy assignment operator.
bool IsSenderDefined() const
Checks, if the histogram sender is defined.
Definition QaBase.h:51
qa::Data fQaData
QA data.
Definition QaBase.h:77
void SetUseAuxData(bool bAux=true)
Sets usage of auxiliary data.
Definition QaBase.h:71
QaBase & operator=(QaBase &&)=delete
Move assignment operator.
QaBase(const QaBase &)=delete
Copy constructor.
const PODVector< Digi > * fpvDigis
Digis input.
Definition QaBase.h:80
bool fbAux
Extra distributions (if the auxiliary data should be used)
Definition QaBase.h:82
std::vector< T, PODAllocator< T > > PODVector
PODVector is a std::vector that doesn't initialize its elements.
Definition PODVector.h:17
Readout setup / Hardware cabling for STS Used to create the hardware mapping for the STS unpacker.