CbmRoot
Loading...
Searching...
No Matches
ObjectDB Class Reference

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

#include <CbmQaCheckerObjectDB.h>

Classes

struct  ObjectParameters
 

Public Member Functions

 ObjectDB ()=default
 Default constructor.
 
 ObjectDB (const ObjectDB &)=delete
 Copy constructor.
 
 ObjectDB (ObjectDB &&)=delete
 Move constructor.
 
 ~ObjectDB ()=default
 Destructor.
 
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::pair< std::string, uint32_t > & GetObject (int iFile, int iObject) const
 Gets object name by its local index and index of file.
 
const ObjectParametersGetObjectParameters (uint32_t paramIndex) const
 Gets object parameters by its local index.
 
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 GetNofObjectParameters () const
 Gets number of object parameters.
 
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::pair< std::string, uint32_t > > > fvObjects
 Container of object names and corresponding parameter IDs in fvObjectParameters.
 
std::vector< ObjectParametersfvObjectParameters
 Container of object parameters.
 
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() [2/3]

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

Copy constructor.

◆ ObjectDB() [3/3]

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

Move constructor.

◆ ~ObjectDB()

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

Destructor.

Member Function Documentation

◆ AddDataset()

void ObjectDB::AddDataset ( const char * dataset)

Adds dataset.

Parameters
datasetName of dataset

Definition at line 49 of file CbmQaCheckerObjectDB.cxx.

◆ 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.

◆ Clear()

void ObjectDB::Clear ( )

Clears content.

Definition at line 28 of file CbmQaCheckerObjectDB.cxx.

◆ 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 268 of file CbmQaCheckerObjectDB.cxx.

◆ 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 70 of file CbmQaCheckerObjectDB.h.

◆ GetDefaultID()

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

Gets index of default version.

Returns
Index of default version

Definition at line 74 of file CbmQaCheckerObjectDB.h.

◆ 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 79 of file CbmQaCheckerObjectDB.h.

◆ 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.

◆ GetNofDatasets()

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

Gets number of datasets.

Definition at line 103 of file CbmQaCheckerObjectDB.h.

◆ GetNofFiles()

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

Gets number of files.

Definition at line 116 of file CbmQaCheckerObjectDB.h.

◆ GetNofObjectParameters()

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

Gets number of object parameters.

Definition at line 113 of file CbmQaCheckerObjectDB.h.

◆ GetNofObjects() [1/2]

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

Gets total number of objects.

Definition at line 106 of file CbmQaCheckerObjectDB.h.

◆ 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 110 of file CbmQaCheckerObjectDB.h.

◆ GetNofVersions()

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

Gets number of versions.

Definition at line 119 of file CbmQaCheckerObjectDB.h.

◆ GetObject()

const std::pair< std::string, uint32_t > & 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 93 of file CbmQaCheckerObjectDB.h.

◆ GetObjectParameters()

const ObjectParameters & cbm::qa::checker::ObjectDB::GetObjectParameters ( uint32_t paramIndex) const
inline

Gets object parameters by its local index.

Parameters
paramIndexIndex of object parameters
Returns
ObjectParameters

Definition at line 101 of file CbmQaCheckerObjectDB.h.

◆ GetOutputPath()

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

Gets output path.

Definition at line 122 of file CbmQaCheckerObjectDB.h.

◆ GetPvalThreshold()

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

Gets p-value threshold.

Definition at line 125 of file CbmQaCheckerObjectDB.h.

◆ GetRatioRangeMax()

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

Gets upper bound of the accepted ratio range.

Definition at line 128 of file CbmQaCheckerObjectDB.h.

◆ GetRatioRangeMin()

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

Gets lower bound of the accepted ratio range.

Definition at line 131 of file CbmQaCheckerObjectDB.h.

◆ GetVersionLabel()

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

Gets version label.

Parameters
iVersionIndex of version

Definition at line 135 of file CbmQaCheckerObjectDB.h.

◆ GetVersionPath()

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

Gets version path.

Parameters
iVersionIndex of version

Definition at line 139 of file CbmQaCheckerObjectDB.h.

◆ Init()

void ObjectDB::Init ( )

Initializes the database.

Definition at line 64 of file CbmQaCheckerObjectDB.cxx.

◆ 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)

Reads DB from YAML node.

Parameters
configRoot node of the YAML file

Definition at line 128 of file CbmQaCheckerObjectDB.cxx.

◆ 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 284 of file CbmQaCheckerObjectDB.cxx.

◆ 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 161 of file CbmQaCheckerObjectDB.h.

◆ 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 165 of file CbmQaCheckerObjectDB.h.

◆ 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 169 of file CbmQaCheckerObjectDB.h.

◆ SetPvalThreshold()

void ObjectDB::SetPvalThreshold ( double pVal)

Sets P-value threshold.

Parameters
pValP-value threshold

Definition at line 316 of file CbmQaCheckerObjectDB.cxx.

◆ SetRatioRange()

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

Sets ratio accepted range.

Parameters
minLower boundary
maxUpper boundary

Definition at line 326 of file CbmQaCheckerObjectDB.cxx.

◆ 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 339 of file CbmQaCheckerObjectDB.cxx.

Member Data Documentation

◆ fDefVersionID

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

Index of default version.

Definition at line 192 of file CbmQaCheckerObjectDB.h.

◆ fPvalThresh

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

P-value threshold for histograms equality.

Definition at line 211 of file CbmQaCheckerObjectDB.h.

◆ fRatioMax

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

Upper boundary for ratio deviation.

Definition at line 212 of file CbmQaCheckerObjectDB.h.

◆ fRatioMin

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

Lower boundary for ratio deviation.

Definition at line 213 of file CbmQaCheckerObjectDB.h.

◆ fsDefaultLabel

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

Name of default version label.

Definition at line 196 of file CbmQaCheckerObjectDB.h.

◆ fsInputRootPath

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

Root path for input files.

Definition at line 194 of file CbmQaCheckerObjectDB.h.

◆ fsOutputPath

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

Path to the output file.

Definition at line 195 of file CbmQaCheckerObjectDB.h.

◆ fvbProcessWholeFile

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

If the whole file should be processed.

Definition at line 200 of file CbmQaCheckerObjectDB.h.

◆ fvDatasets

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

Container of dataset names.

Definition at line 198 of file CbmQaCheckerObjectDB.h.

◆ fvFileLabels

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

Container of file labels (used in output)

Definition at line 202 of file CbmQaCheckerObjectDB.h.

◆ fvFiles

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

Container of file names.

Definition at line 199 of file CbmQaCheckerObjectDB.h.

◆ fvObjectFirstGlobIndex

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

First global index of object in a file.

Definition at line 201 of file CbmQaCheckerObjectDB.h.

◆ fvObjectParameters

std::vector<ObjectParameters> cbm::qa::checker::ObjectDB::fvObjectParameters
private

Container of object parameters.

Definition at line 207 of file CbmQaCheckerObjectDB.h.

◆ fvObjects

std::vector<std::vector<std::pair<std::string, uint32_t> > > cbm::qa::checker::ObjectDB::fvObjects
private

Container of object names and corresponding parameter IDs in fvObjectParameters.

Definition at line 205 of file CbmQaCheckerObjectDB.h.

◆ fvVersionLabels

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

Container of version labels.

Definition at line 208 of file CbmQaCheckerObjectDB.h.

◆ fvVersionPaths

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

Container of version paths.

Definition at line 209 of file CbmQaCheckerObjectDB.h.


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