CbmRoot
Loading...
Searching...
No Matches
CbmQaCheckerFileHandler.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 CbmQaCheckerFileHandler_h
11#define CbmQaCheckerFileHandler_h 1
12
14#include "CbmQaCheckerResult.h"
16#include "TClonesArray.h"
17
18#include <memory>
19#include <vector>
20
21class TNamed;
22class TDirectory;
23class TFile;
24
26namespace cbm::qa::checker
27{
31 public:
36 FileHandler(std::shared_ptr<ObjectDB>& pObjDB, int iDataset, int iFile);
37
40
42 FileHandler(const FileHandler&) = delete;
43
46
49
52
55 int GetDatasetID() const { return fDatasetID; }
56
59 int GetFileID() const { return fFileID; }
60
69 std::vector<Result> Process();
70
71 private:
75 TDirectory* CreateNestedDirectory(const std::string& path);
76
78 void ReOpenOutputFile();
79
80 int fFileID = -1;
81 int fDatasetID = -1;
82
83 std::shared_ptr<ObjectDB> fpObjDB = nullptr;
84 TDirectory* fpOutDir = nullptr;
85 std::unique_ptr<TClonesArray> fpInputFiles = nullptr;
86 std::unique_ptr<TFile> fpOutputFile = nullptr;
87
88 // TODO: replace fpOutputFolder with shared_ptr
89 };
90} // namespace cbm::qa::checker
91
92#endif // CbmQaCheckerFileHandler_h
Database for processed objects in the QA checker framework (implementation)
Common definitions for QA-Checker framework.
TDirectory * CreateNestedDirectory(const std::string &path)
Creates nested directory from a given path.
std::unique_ptr< TClonesArray > fpInputFiles
Pointer to input files array.
std::vector< Result > Process()
Processes comparison.
FileHandler & operator=(const FileHandler &)=delete
Copy assignment operator.
FileHandler(std::shared_ptr< ObjectDB > &pObjDB, int iDataset, int iFile)
Constructor.
std::unique_ptr< TFile > fpOutputFile
Pointer to output file.
FileHandler(FileHandler &&)=delete
Move constructor.
int GetDatasetID() const
Gets index of dataset.
int GetFileID() const
Gets index of file.
FileHandler & operator=(FileHandler &&)=delete
Move assignment operator.
void ReOpenOutputFile()
Closes and opens output file.
TDirectory * fpOutDir
Pointer to output directory.
FileHandler(const FileHandler &)=delete
Copy constructor.
std::shared_ptr< ObjectDB > fpObjDB
Pointer to object database.
A storable result of the QA-checker comparison routine.