CbmRoot
Loading...
Searching...
No Matches
cbm::qa::checker::ObjectDB Class Reference

A data base class for processed objects. More...

#include <CbmQaCheckerObjectDB.h>

Collaboration diagram for cbm::qa::checker::ObjectDB:
[legend]

Public Member Functions

 ObjectDB ()=default
 Default constructor.
 
 ~ObjectDB ()=default
 Destructor.
 
 ObjectDB (const ObjectDB &)=delete
 Copy constructor.
 
 ObjectDB (ObjectDB &&)=delete
 Move constructor.
 
ObjectDBoperator= (const ObjectDB &)=delete
 Copy assignment operator.
 
ObjectDBoperator= (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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ObjectDB() [1/3]

cbm::qa::checker::ObjectDB::ObjectDB ( )
default

Default constructor.

◆ ~ObjectDB()

cbm::qa::checker::ObjectDB::~ObjectDB ( )
default

Destructor.

◆ ObjectDB() [2/3]

cbm::qa::checker::ObjectDB::ObjectDB ( const ObjectDB & )
delete

Copy constructor.

◆ ObjectDB() [3/3]

cbm::qa::checker::ObjectDB::ObjectDB ( ObjectDB && )
delete

Move constructor.

Member Function Documentation

◆ AddDataset()

void ObjectDB::AddDataset ( const char * dataset)

Adds dataset.

Parameters
datasetName of dataset

Definition at line 49 of file CbmQaCheckerObjectDB.cxx.

References fvDatasets.

◆ AddVersion()

void ObjectDB::AddVersion ( const char * label,
const char * path )

Adds version.

Parameters
labelLabel of version
pathPath to output files made for this version

Definition at line 41 of file CbmQaCheckerObjectDB.cxx.

References fvVersionLabels, and fvVersionPaths.

◆ Clear()

void ObjectDB::Clear ( )

◆ CollectObjectPaths()

void ObjectDB::CollectObjectPaths ( TDirectory * pDir,
const TString & parentPah,
std::set< std::string > & paths )
staticprivate

Loops over ROOT-file and collects object paths.

Parameters
[in]pDirPointer on directory
[in]parentPathParent path within file
[out]pathsA set of object paths

Definition at line 244 of file CbmQaCheckerObjectDB.cxx.

References CollectObjectPaths().

Referenced by CollectObjectPaths(), and ReadObjectList().

◆ GetDataset()

const std::string & cbm::qa::checker::ObjectDB::GetDataset ( int iDataset) const
inline

Gets name of dataset.

Parameters
iDatasetIndex of dataset
Returns
Name of dataset

Definition at line 63 of file CbmQaCheckerObjectDB.h.

References fvDatasets.

◆ GetDefaultID()

int cbm::qa::checker::ObjectDB::GetDefaultID ( ) const
inline

Gets index of default version.

Returns
Index of default version

Definition at line 67 of file CbmQaCheckerObjectDB.h.

References fDefVersionID.

◆ GetFileLabel()

const std::string & cbm::qa::checker::ObjectDB::GetFileLabel ( int iFile) const
inline

Gets label of file.

Parameters
iFileIndex of file
Returns
Label of file

Definition at line 72 of file CbmQaCheckerObjectDB.h.

References fvFileLabels.

◆ GetInputFileName()

std::string ObjectDB::GetInputFileName ( int iVersion,
int iFile,
int iDataset ) const

Gets name of file from indexes of version, file and dataset.

Parameters
iVersionIndex of version
iFileIndex of file
iDatasetIndex of dataset
Returns
Name of input file

Definition at line 53 of file CbmQaCheckerObjectDB.cxx.

References fvDatasets, fvFiles, and fvVersionPaths.

Referenced by ReadObjectList().

◆ GetNofDatasets()

int cbm::qa::checker::ObjectDB::GetNofDatasets ( ) const
inline

Gets number of datasets.

Definition at line 88 of file CbmQaCheckerObjectDB.h.

References fvDatasets.

Referenced by Init().

◆ GetNofFiles()

int cbm::qa::checker::ObjectDB::GetNofFiles ( ) const
inline

Gets number of files.

Definition at line 98 of file CbmQaCheckerObjectDB.h.

References fvFiles.

◆ GetNofObjects() [1/2]

int cbm::qa::checker::ObjectDB::GetNofObjects ( ) const
inline

Gets total number of objects.

Definition at line 91 of file CbmQaCheckerObjectDB.h.

References fvObjects.

Referenced by Init().

◆ GetNofObjects() [2/2]

int cbm::qa::checker::ObjectDB::GetNofObjects ( int iFile) const
inline

Gets number of objects in file.

Parameters
iFileIndex of file

Definition at line 95 of file CbmQaCheckerObjectDB.h.

References fvObjects.

◆ GetNofVersions()

int cbm::qa::checker::ObjectDB::GetNofVersions ( ) const
inline

Gets number of versions.

Definition at line 101 of file CbmQaCheckerObjectDB.h.

References fvVersionLabels.

Referenced by Init().

◆ GetObject()

const std::string & cbm::qa::checker::ObjectDB::GetObject ( int iFile,
int iObject ) const
inline

Gets object name by its local index and index of file.

Parameters
iFileIndex of file
iObjectIndex of object for a given file
Returns
Name of object

Definition at line 85 of file CbmQaCheckerObjectDB.h.

References fvObjects.

◆ GetOutputPath()

const std::string & cbm::qa::checker::ObjectDB::GetOutputPath ( ) const
inline

Gets output path.

Definition at line 104 of file CbmQaCheckerObjectDB.h.

References fsOutputPath.

◆ GetPvalThreshold()

double cbm::qa::checker::ObjectDB::GetPvalThreshold ( ) const
inline

Gets p-value threshold.

Definition at line 107 of file CbmQaCheckerObjectDB.h.

References fPvalThresh.

◆ GetRatioRangeMax()

double cbm::qa::checker::ObjectDB::GetRatioRangeMax ( ) const
inline

Gets upper bound of the accepted ratio range.

Definition at line 110 of file CbmQaCheckerObjectDB.h.

References fRatioMax.

◆ GetRatioRangeMin()

double cbm::qa::checker::ObjectDB::GetRatioRangeMin ( ) const
inline

Gets lower bound of the accepted ratio range.

Definition at line 113 of file CbmQaCheckerObjectDB.h.

References fRatioMin.

◆ GetVersionLabel()

const std::string & cbm::qa::checker::ObjectDB::GetVersionLabel ( int iVersion) const
inline

Gets version label.

Parameters
iVersionIndex of version

Definition at line 117 of file CbmQaCheckerObjectDB.h.

References fvVersionLabels.

◆ GetVersionPath()

const std::string & cbm::qa::checker::ObjectDB::GetVersionPath ( int iVersion) const
inline

Gets version path.

Parameters
iVersionIndex of version

Definition at line 121 of file CbmQaCheckerObjectDB.h.

References fvVersionPaths.

◆ Init()

◆ operator=() [1/2]

ObjectDB & cbm::qa::checker::ObjectDB::operator= ( const ObjectDB & )
delete

Copy assignment operator.

◆ operator=() [2/2]

ObjectDB & cbm::qa::checker::ObjectDB::operator= ( ObjectDB && )
delete

Move assignment operator.

◆ ReadFromYAML()

void ObjectDB::ReadFromYAML ( const char * configName)

◆ ReadObjectList()

void ObjectDB::ReadObjectList ( int iFile)
private

Reads list of histograms from file.

Parameters
iFileIndex of file
Note
Accumulates all possible histograms for different datasets

Definition at line 259 of file CbmQaCheckerObjectDB.cxx.

References CollectObjectPaths(), fDefVersionID, fvDatasets, fvObjects, and GetInputFileName().

Referenced by Init().

◆ SetDefaultLabel()

void cbm::qa::checker::ObjectDB::SetDefaultLabel ( const char * defaultLabel)
inline

Sets default version label.

Parameters
defaultLabelName 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().

◆ SetInputRootPath()

void cbm::qa::checker::ObjectDB::SetInputRootPath ( const char * pathName)
inline

Sets root path to input files.

Parameters
pathNameRelative or absolute root path to input the input directories

Definition at line 147 of file CbmQaCheckerObjectDB.h.

References fsInputRootPath.

◆ SetOutputPath()

void cbm::qa::checker::ObjectDB::SetOutputPath ( const char * path)
inline

Sets the output path.

Parameters
pathPath to the output ROOT-file

Definition at line 151 of file CbmQaCheckerObjectDB.h.

References fsOutputPath.

◆ SetPvalThreshold()

void ObjectDB::SetPvalThreshold ( double pVal)

Sets P-value threshold.

Parameters
pValP-value threshold

Definition at line 280 of file CbmQaCheckerObjectDB.cxx.

References fPvalThresh.

Referenced by ReadFromYAML().

◆ SetRatioRange()

void ObjectDB::SetRatioRange ( double min,
double max )

Sets ratio accepted range.

Parameters
minLower boundary
maxUpper boundary

Definition at line 290 of file CbmQaCheckerObjectDB.cxx.

References fRatioMax, fRatioMin, max(), and min().

Referenced by ReadFromYAML().

◆ ToString()

std::string ObjectDB::ToString ( int verbose = 1) const

String representation of the content.

Parameters
verboseVerbosity level: 0: no output, 1: minimal output (versions, datasets and file names), 2: objects as well
Returns
A string representation of the DB contents

Definition at line 303 of file CbmQaCheckerObjectDB.cxx.

References fDefVersionID, fvDatasets, fvFiles, fvObjects, fvVersionLabels, and fvVersionPaths.

Referenced by Init().

Member Data Documentation

◆ fDefVersionID

int cbm::qa::checker::ObjectDB::fDefVersionID = -1
private

Index of default version.

Definition at line 174 of file CbmQaCheckerObjectDB.h.

Referenced by GetDefaultID(), Init(), ReadObjectList(), and ToString().

◆ fPvalThresh

double cbm::qa::checker::ObjectDB::fPvalThresh {0.05}
private

P-value threshold for histograms equality.

Definition at line 189 of file CbmQaCheckerObjectDB.h.

Referenced by GetPvalThreshold(), ReadFromYAML(), and SetPvalThreshold().

◆ fRatioMax

double cbm::qa::checker::ObjectDB::fRatioMax {1.05}
private

Upper boundary for ratio deviation.

Definition at line 190 of file CbmQaCheckerObjectDB.h.

Referenced by GetRatioRangeMax(), ReadFromYAML(), and SetRatioRange().

◆ fRatioMin

double cbm::qa::checker::ObjectDB::fRatioMin {0.95}
private

Lower boundary for ratio deviation.

Definition at line 191 of file CbmQaCheckerObjectDB.h.

Referenced by GetRatioRangeMin(), ReadFromYAML(), and SetRatioRange().

◆ fsDefaultLabel

std::string cbm::qa::checker::ObjectDB::fsDefaultLabel = ""
private

Name of default version label.

Definition at line 178 of file CbmQaCheckerObjectDB.h.

Referenced by Init(), and SetDefaultLabel().

◆ fsInputRootPath

std::string cbm::qa::checker::ObjectDB::fsInputRootPath = ""
private

Root path for input files.

Definition at line 176 of file CbmQaCheckerObjectDB.h.

Referenced by Init(), and SetInputRootPath().

◆ fsOutputPath

std::string cbm::qa::checker::ObjectDB::fsOutputPath = ""
private

Path to the output file.

Definition at line 177 of file CbmQaCheckerObjectDB.h.

Referenced by GetOutputPath(), Init(), and SetOutputPath().

◆ fvbProcessWholeFile

std::vector<char> cbm::qa::checker::ObjectDB::fvbProcessWholeFile
private

If the whole file should be processed.

Definition at line 182 of file CbmQaCheckerObjectDB.h.

◆ fvDatasets

std::vector<std::string> cbm::qa::checker::ObjectDB::fvDatasets
private

Container of dataset names.

Definition at line 180 of file CbmQaCheckerObjectDB.h.

Referenced by AddDataset(), Clear(), GetDataset(), GetInputFileName(), GetNofDatasets(), ReadFromYAML(), ReadObjectList(), and ToString().

◆ fvFileLabels

std::vector<std::string> cbm::qa::checker::ObjectDB::fvFileLabels
private

Container of file labels (used in output)

Definition at line 184 of file CbmQaCheckerObjectDB.h.

Referenced by Clear(), GetFileLabel(), and ReadFromYAML().

◆ fvFiles

std::vector<std::string> cbm::qa::checker::ObjectDB::fvFiles
private

Container of file names.

Definition at line 181 of file CbmQaCheckerObjectDB.h.

Referenced by Clear(), GetInputFileName(), GetNofFiles(), ReadFromYAML(), and ToString().

◆ fvObjectFirstGlobIndex

std::vector<int> cbm::qa::checker::ObjectDB::fvObjectFirstGlobIndex
private

First global index of object in a file.

Definition at line 183 of file CbmQaCheckerObjectDB.h.

Referenced by Clear(), Init(), and ReadFromYAML().

◆ fvObjects

std::vector<std::vector<std::string> > cbm::qa::checker::ObjectDB::fvObjects
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().

◆ fvVersionLabels

std::vector<std::string> cbm::qa::checker::ObjectDB::fvVersionLabels
private

Container of version labels.

Definition at line 186 of file CbmQaCheckerObjectDB.h.

Referenced by AddVersion(), Clear(), GetNofVersions(), GetVersionLabel(), Init(), ReadFromYAML(), and ToString().

◆ fvVersionPaths

std::vector<std::string> cbm::qa::checker::ObjectDB::fvVersionPaths
private

Container of version paths.

Definition at line 187 of file CbmQaCheckerObjectDB.h.

Referenced by AddVersion(), Clear(), GetInputFileName(), GetVersionPath(), Init(), ReadFromYAML(), and ToString().


The documentation for this class was generated from the following files: