CbmRoot
|
A data base class for processed objects. More...
#include <CbmQaCheckerObjectDB.h>
Public Member Functions | |
ObjectDB ()=default | |
Default constructor. | |
~ObjectDB ()=default | |
Destructor. | |
ObjectDB (const ObjectDB &)=delete | |
Copy constructor. | |
ObjectDB (ObjectDB &&)=delete | |
Move constructor. | |
ObjectDB & | operator= (const ObjectDB &)=delete |
Copy assignment operator. | |
ObjectDB & | operator= (ObjectDB &&)=delete |
Move assignment operator. | |
void | AddVersion (const char *label, const char *path) |
Adds version. | |
void | AddDataset (const char *dataset) |
Adds dataset. | |
void | Clear () |
Clears content. | |
const std::string & | GetDataset (int iDataset) const |
Gets name of dataset. | |
int | GetDefaultID () const |
Gets index of default version. | |
const std::string & | GetFileLabel (int iFile) const |
Gets label of file. | |
std::string | GetInputFileName (int iVersion, int iFile, int iDataset) const |
Gets name of file from indexes of version, file and dataset. | |
const std::string & | GetObject (int iFile, int iObject) const |
Gets object name by its local index and index of file. | |
int | GetNofDatasets () const |
Gets number of datasets. | |
int | GetNofObjects () const |
Gets total number of objects. | |
int | GetNofObjects (int iFile) const |
Gets number of objects in file. | |
int | GetNofFiles () const |
Gets number of files. | |
int | GetNofVersions () const |
Gets number of versions. | |
const std::string & | GetOutputPath () const |
Gets output path. | |
double | GetPvalThreshold () const |
Gets p-value threshold. | |
double | GetRatioRangeMax () const |
Gets upper bound of the accepted ratio range. | |
double | GetRatioRangeMin () const |
Gets lower bound of the accepted ratio range. | |
const std::string & | GetVersionLabel (int iVersion) const |
Gets version label. | |
const std::string & | GetVersionPath (int iVersion) const |
Gets version path. | |
void | Init () |
Initializes the database. | |
void | ReadFromYAML (const char *configName) |
Reads DB from YAML node. | |
std::string | ToString (int verbose=1) const |
String representation of the content. | |
void | SetDefaultLabel (const char *defaultLabel) |
Sets default version label. | |
void | SetInputRootPath (const char *pathName) |
Sets root path to input files. | |
void | SetOutputPath (const char *path) |
Sets the output path. | |
void | SetPvalThreshold (double pVal) |
Sets P-value threshold. | |
void | SetRatioRange (double min, double max) |
Sets ratio accepted range. | |
Private Member Functions | |
void | ReadObjectList (int iFile) |
Reads list of histograms from file. | |
Static Private Member Functions | |
static void | CollectObjectPaths (TDirectory *pDir, const TString &parentPah, std::set< std::string > &paths) |
Loops over ROOT-file and collects object paths. | |
Private Attributes | |
int | fDefVersionID = -1 |
Index of default version. | |
std::string | fsInputRootPath = "" |
Root path for input files. | |
std::string | fsOutputPath = "" |
Path to the output file. | |
std::string | fsDefaultLabel = "" |
Name of default version label. | |
std::vector< std::string > | fvDatasets |
Container of dataset names. | |
std::vector< std::string > | fvFiles |
Container of file names. | |
std::vector< char > | fvbProcessWholeFile |
If the whole file should be processed. | |
std::vector< int > | fvObjectFirstGlobIndex |
First global index of object in a file. | |
std::vector< std::string > | fvFileLabels |
Container of file labels (used in output) | |
std::vector< std::vector< std::string > > | fvObjects |
Container of object names vs file id. | |
std::vector< std::string > | fvVersionLabels |
Container of version labels. | |
std::vector< std::string > | fvVersionPaths |
Container of version paths. | |
double | fPvalThresh {0.05} |
P-value threshold for histograms equality. | |
double | fRatioMax {1.05} |
Upper boundary for ratio deviation. | |
double | fRatioMin {0.95} |
Lower boundary for ratio deviation. | |
A data base class for processed objects.
The data base contains information on datasets, file-object pairs and versions, which are compared.
Definition at line 28 of file CbmQaCheckerObjectDB.h.
|
default |
Default constructor.
|
default |
Destructor.
|
delete |
Copy constructor.
|
delete |
Move constructor.
void ObjectDB::AddDataset | ( | const char * | dataset | ) |
Adds dataset.
dataset | Name of dataset |
Definition at line 49 of file CbmQaCheckerObjectDB.cxx.
References fvDatasets.
void ObjectDB::AddVersion | ( | const char * | label, |
const char * | path ) |
Adds version.
label | Label of version |
path | Path to output files made for this version |
Definition at line 41 of file CbmQaCheckerObjectDB.cxx.
References fvVersionLabels, and fvVersionPaths.
void ObjectDB::Clear | ( | ) |
Clears content.
Definition at line 28 of file CbmQaCheckerObjectDB.cxx.
References fvDatasets, fvFileLabels, fvFiles, fvObjectFirstGlobIndex, fvObjects, fvVersionLabels, and fvVersionPaths.
|
staticprivate |
Loops over ROOT-file and collects object paths.
[in] | pDir | Pointer on directory |
[in] | parentPath | Parent path within file |
[out] | paths | A set of object paths |
Definition at line 244 of file CbmQaCheckerObjectDB.cxx.
References CollectObjectPaths().
Referenced by CollectObjectPaths(), and ReadObjectList().
|
inline |
Gets name of dataset.
iDataset | Index of dataset |
Definition at line 63 of file CbmQaCheckerObjectDB.h.
References fvDatasets.
|
inline |
Gets index of default version.
Definition at line 67 of file CbmQaCheckerObjectDB.h.
References fDefVersionID.
|
inline |
Gets label of file.
iFile | Index of file |
Definition at line 72 of file CbmQaCheckerObjectDB.h.
References fvFileLabels.
std::string ObjectDB::GetInputFileName | ( | int | iVersion, |
int | iFile, | ||
int | iDataset ) const |
Gets name of file from indexes of version, file and dataset.
iVersion | Index of version |
iFile | Index of file |
iDataset | Index of dataset |
Definition at line 53 of file CbmQaCheckerObjectDB.cxx.
References fvDatasets, fvFiles, and fvVersionPaths.
Referenced by ReadObjectList().
|
inline |
Gets number of datasets.
Definition at line 88 of file CbmQaCheckerObjectDB.h.
References fvDatasets.
Referenced by Init().
|
inline |
|
inline |
Gets total number of objects.
Definition at line 91 of file CbmQaCheckerObjectDB.h.
References fvObjects.
Referenced by Init().
|
inline |
Gets number of objects in file.
iFile | Index of file |
Definition at line 95 of file CbmQaCheckerObjectDB.h.
References fvObjects.
|
inline |
Gets number of versions.
Definition at line 101 of file CbmQaCheckerObjectDB.h.
References fvVersionLabels.
Referenced by Init().
|
inline |
Gets object name by its local index and index of file.
iFile | Index of file |
iObject | Index of object for a given file |
Definition at line 85 of file CbmQaCheckerObjectDB.h.
References fvObjects.
|
inline |
|
inline |
Gets p-value threshold.
Definition at line 107 of file CbmQaCheckerObjectDB.h.
References fPvalThresh.
|
inline |
Gets upper bound of the accepted ratio range.
Definition at line 110 of file CbmQaCheckerObjectDB.h.
References fRatioMax.
|
inline |
Gets lower bound of the accepted ratio range.
Definition at line 113 of file CbmQaCheckerObjectDB.h.
References fRatioMin.
|
inline |
Gets version label.
iVersion | Index of version |
Definition at line 117 of file CbmQaCheckerObjectDB.h.
References fvVersionLabels.
|
inline |
Gets version path.
iVersion | Index of version |
Definition at line 121 of file CbmQaCheckerObjectDB.h.
References fvVersionPaths.
void ObjectDB::Init | ( | ) |
Initializes the database.
Definition at line 64 of file CbmQaCheckerObjectDB.cxx.
References fDefVersionID, fsDefaultLabel, fsInputRootPath, fsOutputPath, fvObjectFirstGlobIndex, fvObjects, fvVersionLabels, fvVersionPaths, GetNofDatasets(), GetNofObjects(), GetNofVersions(), ReadObjectList(), size(), and ToString().
Copy assignment operator.
void ObjectDB::ReadFromYAML | ( | const char * | configName | ) |
Reads DB from YAML node.
config | Root node of the YAML file |
Definition at line 125 of file CbmQaCheckerObjectDB.cxx.
References fPvalThresh, fRatioMax, fRatioMin, fvDatasets, fvFileLabels, fvFiles, fvObjectFirstGlobIndex, fvObjects, fvVersionLabels, fvVersionPaths, SetDefaultLabel(), SetPvalThreshold(), and SetRatioRange().
|
private |
Reads list of histograms from file.
iFile | Index of file |
Definition at line 259 of file CbmQaCheckerObjectDB.cxx.
References CollectObjectPaths(), fDefVersionID, fvDatasets, fvObjects, and GetInputFileName().
Referenced by Init().
|
inline |
Sets default version label.
defaultLabel | Name of default label |
If the default version is not provided as well as the provided, the first version will be used as the default one.
Definition at line 143 of file CbmQaCheckerObjectDB.h.
References fsDefaultLabel.
Referenced by ReadFromYAML().
|
inline |
Sets root path to input files.
pathName | Relative or absolute root path to input the input directories |
Definition at line 147 of file CbmQaCheckerObjectDB.h.
References fsInputRootPath.
|
inline |
Sets the output path.
path | Path to the output ROOT-file |
Definition at line 151 of file CbmQaCheckerObjectDB.h.
References fsOutputPath.
void ObjectDB::SetPvalThreshold | ( | double | pVal | ) |
Sets P-value threshold.
pVal | P-value threshold |
Definition at line 280 of file CbmQaCheckerObjectDB.cxx.
References fPvalThresh.
Referenced by ReadFromYAML().
void ObjectDB::SetRatioRange | ( | double | min, |
double | max ) |
Sets ratio accepted range.
min | Lower boundary |
max | Upper boundary |
Definition at line 290 of file CbmQaCheckerObjectDB.cxx.
References fRatioMax, fRatioMin, max(), and min().
Referenced by ReadFromYAML().
std::string ObjectDB::ToString | ( | int | verbose = 1 | ) | const |
String representation of the content.
verbose | Verbosity level: 0: no output, 1: minimal output (versions, datasets and file names), 2: objects as well |
Definition at line 303 of file CbmQaCheckerObjectDB.cxx.
References fDefVersionID, fvDatasets, fvFiles, fvObjects, fvVersionLabels, and fvVersionPaths.
Referenced by Init().
|
private |
Index of default version.
Definition at line 174 of file CbmQaCheckerObjectDB.h.
Referenced by GetDefaultID(), Init(), ReadObjectList(), and ToString().
|
private |
P-value threshold for histograms equality.
Definition at line 189 of file CbmQaCheckerObjectDB.h.
Referenced by GetPvalThreshold(), ReadFromYAML(), and SetPvalThreshold().
|
private |
Upper boundary for ratio deviation.
Definition at line 190 of file CbmQaCheckerObjectDB.h.
Referenced by GetRatioRangeMax(), ReadFromYAML(), and SetRatioRange().
|
private |
Lower boundary for ratio deviation.
Definition at line 191 of file CbmQaCheckerObjectDB.h.
Referenced by GetRatioRangeMin(), ReadFromYAML(), and SetRatioRange().
|
private |
Name of default version label.
Definition at line 178 of file CbmQaCheckerObjectDB.h.
Referenced by Init(), and SetDefaultLabel().
|
private |
Root path for input files.
Definition at line 176 of file CbmQaCheckerObjectDB.h.
Referenced by Init(), and SetInputRootPath().
|
private |
Path to the output file.
Definition at line 177 of file CbmQaCheckerObjectDB.h.
Referenced by GetOutputPath(), Init(), and SetOutputPath().
|
private |
If the whole file should be processed.
Definition at line 182 of file CbmQaCheckerObjectDB.h.
|
private |
Container of dataset names.
Definition at line 180 of file CbmQaCheckerObjectDB.h.
Referenced by AddDataset(), Clear(), GetDataset(), GetInputFileName(), GetNofDatasets(), ReadFromYAML(), ReadObjectList(), and ToString().
|
private |
Container of file labels (used in output)
Definition at line 184 of file CbmQaCheckerObjectDB.h.
Referenced by Clear(), GetFileLabel(), and ReadFromYAML().
|
private |
Container of file names.
Definition at line 181 of file CbmQaCheckerObjectDB.h.
Referenced by Clear(), GetInputFileName(), GetNofFiles(), ReadFromYAML(), and ToString().
|
private |
First global index of object in a file.
Definition at line 183 of file CbmQaCheckerObjectDB.h.
Referenced by Clear(), Init(), and ReadFromYAML().
|
private |
Container of object names vs file id.
Definition at line 185 of file CbmQaCheckerObjectDB.h.
Referenced by Clear(), GetNofObjects(), GetNofObjects(), GetObject(), Init(), ReadFromYAML(), ReadObjectList(), and ToString().
|
private |
Container of version labels.
Definition at line 186 of file CbmQaCheckerObjectDB.h.
Referenced by AddVersion(), Clear(), GetNofVersions(), GetVersionLabel(), Init(), ReadFromYAML(), and ToString().
|
private |
Container of version paths.
Definition at line 187 of file CbmQaCheckerObjectDB.h.
Referenced by AddVersion(), Clear(), GetInputFileName(), GetVersionPath(), Init(), ReadFromYAML(), and ToString().