CbmRoot
Loading...
Searching...
No Matches
CbmQaCheckerObjectHandler.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#ifndef CbmQaCheckerObjectHandler_h
11#define CbmQaCheckerObjectHandler_h 1
12
15#include "Rtypes.h"
16
17#include <memory>
18#include <string>
19
20class TDirectory;
21class TNamed;
22class TObject;
23class TCanvas;
24
25namespace cbm::qa::checker
26{
32 public:
38 ObjectHandler(int iObject, int iFile, int iDataset, const char* objType = "");
39
41 virtual ~ObjectHandler();
42
45 void AddObjects(const std::vector<TNamed*>& vpObj);
46
49 virtual void CreateCanvases(Option_t*){};
50
54 virtual ECmpInference Compare(int iVersion) const = 0;
55
58 std::vector<ECmpInference> CompareWithDefault();
59
62 void SetOutputDirectory(TDirectory* pDir);
63
66 void SetObjectDB(std::shared_ptr<ObjectDB>& pObjDB) { fpObjDB = pObjDB; }
67
72 void SetComparisonMethod(ECmpMethod method) { fCmpBits.set(static_cast<uint8_t>(method)); }
73
75 void Write();
76
77 protected:
78 std::string fsObjType{""};
79 std::string fsBaseName{""};
80 std::vector<TNamed*> fvpObjects;
81 std::shared_ptr<ObjectDB> fpObjDB{nullptr};
82 std::shared_ptr<TCanvas> fpCanvas{nullptr};
83 TDirectory* fpOutDir{nullptr};
84 int fObjectID{-1};
85 int fFileID{-1};
86 int fDatasetID{-1};
87
88 std::bitset<static_cast<size_t>(ECmpMethod::END)> fCmpBits;
89 };
90} // namespace cbm::qa::checker
91
92#endif // CbmQaCheckerObjectHandler_h
Database for processed objects in the QA checker framework (implementation)
Common definitions for QA-Checker framework.
Base abstract class for object handler.
std::string fsObjType
Base type of the object to be handled.
virtual void CreateCanvases(Option_t *)
Creates object comparison canvas.
std::string fsBaseName
Base names of the object.
std::shared_ptr< TCanvas > fpCanvas
Comparison canvas.
std::shared_ptr< ObjectDB > fpObjDB
Pointer to object database.
virtual ECmpInference Compare(int iVersion) const =0
Compares objects to default.
void SetComparisonMethod(ECmpMethod method)
Sets bit flag to control handler behaviour.
std::vector< TNamed * > fvpObjects
Vector of objects.
ObjectHandler(int iObject, int iFile, int iDataset, const char *objType="")
Default constructor.
TDirectory * fpOutDir
Pointer to directory.
void AddObjects(const std::vector< TNamed * > &vpObj)
Adds vector of pointer to objects.
void SetOutputDirectory(TDirectory *pDir)
Sets folder to store output.
std::bitset< static_cast< size_t >(ECmpMethod::END)> fCmpBits
Bitset for comparison methods.
void SetObjectDB(std::shared_ptr< ObjectDB > &pObjDB)
Sets objects database.
std::vector< ECmpInference > CompareWithDefault()
Compares different versions with default.
ECmpInference
The object comparison inference.
ECmpMethod
Comparison method.
@ END
end of enumeration