CbmRoot
Loading...
Searching...
No Matches
CbmQaManager.h
Go to the documentation of this file.
1/* Copyright (C) 2023 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 "FairTask.h"
13#include "TString.h"
14
15#include <TFile.h>
16
17#include <map>
18#include <string>
19
20class CbmQaManager : public FairTask {
21 public:
24 CbmQaManager(int verbose = 1);
25
27 virtual ~CbmQaManager() = default;
28
30 CbmQaManager(const CbmQaManager&) = delete;
31
34
37
40
42 void AddTask(FairTask* task) { this->Add(task); }
43
45 void Exec(Option_t*){};
46
48 void Finish();
49
51 bool GetStatus() const { return fStatus; }
52
54 const TString& GetConfigName() const { return fsConfigName; }
55
57 const TString& GetDefaultTag() const { return fsDefaultTag; }
58
60 const TString& GetVersionTag() const { return fsVersionTag; }
61
63 InitStatus Init();
64
66 InitStatus ReInit() { return Init(); }
67
69
74 void OpenBenchmarkInput(const TString& path);
75
78 void OpenBenchmarkOutput(const TString& path);
79
81 void SetConfigName(const TString& name) { fsConfigName = name; }
82
84 void SetVersionTag(const TString& tag) { fsVersionTag = tag; }
85
87 void SetDefaultTag(const TString& tag) { fsDefaultTag = tag; }
88
89 private:
90 bool fStatus = true;
91 TString fsConfigName = "";
92 TString fsVersionTag = "";
93 TString fsDefaultTag = "";
94
95 std::shared_ptr<TFile> fpBenchmarkInput =
96 nullptr;
97 std::shared_ptr<TFile> fpBenchmarkOutput = nullptr;
98};
bool Add(const std::vector< litfloat > &a, const std::vector< litfloat > &b, std::vector< litfloat > &c)
ClassDef(CbmQaManager, 0)
TString fsConfigName
Name of the configuration YAML file (passed to underlying QA tasks)
void SetConfigName(const TString &name)
Sets YAML config name.
void AddTask(FairTask *task)
Adds sub-task.
CbmQaManager & operator=(CbmQaManager &&)=delete
Move assignment operator.
CbmQaManager(CbmQaManager &&)=delete
Move constructor.
void Finish()
Action of the task in the end of the run.
std::shared_ptr< TFile > fpBenchmarkOutput
An output file for histograms cross-check.
void OpenBenchmarkInput(const TString &path)
Open cross-check file.
TString fsDefaultTag
Default tag (git SHA etc.)
void OpenBenchmarkOutput(const TString &path)
Open benchmark output file.
InitStatus Init()
Task initialization.
CbmQaManager(int verbose=1)
Constructor from parameters.
InitStatus ReInit()
Task re-initialization.
bool fStatus
Status of QA: true - all tasks passed, false - at least one of the task failed.
const TString & GetVersionTag() const
Gets version tag.
bool GetStatus() const
Gets status flag.
TString fsVersionTag
Version tag (git SHA etc.)
const TString & GetConfigName() const
Gets YAML config name.
void SetVersionTag(const TString &tag)
Sets version tag.
std::shared_ptr< TFile > fpBenchmarkInput
A benchmark file with default ROOT objects used for the cross-check.
const TString & GetDefaultTag() const
Gets default tag.
void SetDefaultTag(const TString &tag)
Sets default tag.
CbmQaManager(const CbmQaManager &)=delete
Copy constructor.
CbmQaManager & operator=(const CbmQaManager &)=delete
Copy assignment operator.
virtual ~CbmQaManager()=default
Destructor.
void Exec(Option_t *)
Action of the task in the time-slice.