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

ROOT object IO interface for QA. More...

#include <CbmQaIO.h>

Inheritance diagram for CbmQaIO:
[legend]

Public Types

enum class  EStoringMode { kSAMEDIR , kSUBDIR }
 
using ObjList_t = std::vector<std::pair<TObject*, TString>>
 

Public Member Functions

 CbmQaIO (TString prefixName, std::shared_ptr< ObjList_t > pObjList=nullptr)
 Constructor.
 
virtual ~CbmQaIO ()
 Destructor.
 
 CbmQaIO (const CbmQaIO &)=delete
 Copy constructor.
 
 CbmQaIO (CbmQaIO &&)=delete
 Move constructor.
 
CbmQaIOoperator= (const CbmQaIO &)=delete
 Copy assignment operator.
 
CbmQaIOoperator= (CbmQaIO &&)=delete
 Move assignment operator.
 
const char * GetConfigName () const
 Gets config name.
 
template<typename T , typename... Args>
T * MakeQaObject (TString sName, TString sTitle, Args... args)
 
void MakeQaDirectory (TString sName)
 
void SetConfigName (const char *path)
 Creates a ROOT object.
 
void SetRootFolderName (const TString &path)
 Sets a common root path to the objects in the output file.
 
void SetStoringMode (EStoringMode mode)
 Set storing mode.
 

Protected Member Functions

template<typename T >
void CheckProperty (T &&property, const char *name) const
 Function to check, if a property is defined.
 
template<class Config >
std::optional< Config > ReadSpecificConfig () const
 Reads the specific configuration structure from the YAML node.
 
virtual void SetTH1Properties (TH1 *pHist) const
 Applies properties on the histogram created with the MakeQaObject function.
 
virtual void SetTH2Properties (TH2 *pHist) const
 Applies properties on the histogram created with the MakeQaObject function.
 
virtual void SetTProfile2DProperties (TProfile2D *pHist) const
 Applies properties on the profile 2D created with the MakeQaObject function.
 
virtual void SetCanvasProperties (TCanvas *pCanv) const
 Applies properties on the canvas created with the MakeQaObject funciton.
 
void WriteToFile (TFile *pOutFile) const
 Writes objects into file.
 

Protected Attributes

TString fsRootFolderName = ""
 Name of root folder.
 
TString fsConfigName = ""
 Name of configuration file.
 
TString fsPrefix = ""
 Unique prefix for all writeable root.
 
EStoringMode fStoringMode = EStoringMode::kSUBDIR
 Objects storing mode.
 
std::shared_ptr< ObjList_tfpvObjList = nullptr
 List of registered ROOT objects.
 
YAML::Node fConfigNode {}
 Configuration node.
 

Private Member Functions

template<typename T , typename... Args>
T * ConstructAndRegisterQaObject (TString name, Args... args)
 Creates and registers a ROOT object.
 

Detailed Description

ROOT object IO interface for QA.

The class provides interface to write ROOT object into resulted files

Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 44 of file CbmQaIO.h.

Member Typedef Documentation

◆ ObjList_t

using CbmQaIO::ObjList_t = std::vector<std::pair<TObject*, TString>>
Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 46 of file CbmQaIO.h.

Member Enumeration Documentation

◆ EStoringMode

enum class CbmQaIO::EStoringMode
strong
Enumerator
kSAMEDIR 

Objects of different type will be stored to root directory.

kSUBDIR 

Objects of different type will be stored in different subdirectories like histograms/ canvases/.

Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 48 of file CbmQaIO.h.

Constructor & Destructor Documentation

◆ CbmQaIO() [1/3]

CbmQaIO::CbmQaIO ( TString prefixName,
std::shared_ptr< ObjList_t > pObjList = nullptr )

Constructor.

Parameters
prefixNameName of the unique prefix
pObjListList of already created objects
Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 19 of file CbmQaIO.cxx.

References fpvObjList, and fsPrefix.

◆ ~CbmQaIO()

CbmQaIO::~CbmQaIO ( )
virtual

Destructor.

Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 31 of file CbmQaIO.cxx.

◆ CbmQaIO() [2/3]

CbmQaIO::CbmQaIO ( const CbmQaIO & )
delete

Copy constructor.

◆ CbmQaIO() [3/3]

CbmQaIO::CbmQaIO ( CbmQaIO && )
delete

Move constructor.

Member Function Documentation

◆ CheckProperty()

template<typename T >
void CbmQaIO::CheckProperty ( T && property,
const char * name ) const
protected

Function to check, if a property is defined.

Parameters
propertyA property to be tested
nameA name of property (used for logging)
Note
Throws an exception, if property is undefined
Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 178 of file CbmQaIO.h.

Referenced by MakeQaObject().

◆ ConstructAndRegisterQaObject()

template<typename T , typename... Args>
T * CbmQaIO::ConstructAndRegisterQaObject ( TString name,
Args... args )
private

Creates and registers a ROOT object.

Parameters
nameA name of the ROOT object, which can contain a sub-directory
argsOther arguments, passed to the ROOT object constructor
Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 198 of file CbmQaIO.h.

References fpvObjList, fsRootFolderName, fStoringMode, kSUBDIR, SetCanvasProperties(), SetTH1Properties(), SetTH2Properties(), and SetTProfile2DProperties().

Referenced by MakeQaObject().

◆ GetConfigName()

const char * CbmQaIO::GetConfigName ( ) const
inline

Gets config name.

Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 76 of file CbmQaIO.h.

References fsConfigName.

◆ MakeQaDirectory()

void CbmQaIO::MakeQaDirectory ( TString sName)

◆ MakeQaObject()

◆ operator=() [1/2]

CbmQaIO & CbmQaIO::operator= ( CbmQaIO && )
delete

Move assignment operator.

◆ operator=() [2/2]

CbmQaIO & CbmQaIO::operator= ( const CbmQaIO & )
delete

Copy assignment operator.

Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

◆ ReadSpecificConfig()

template<class Config >
std::optional< Config > CbmQaIO::ReadSpecificConfig ( ) const
inlineprotected

Reads the specific configuration structure from the YAML node.

Template Parameters
ConfigType of the configuration class

The function is to be called in the user-defined class method InitDataBranches

Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 127 of file CbmQaIO.h.

References fConfigNode, and cbm::algo::yaml::Read().

◆ SetCanvasProperties()

void CbmQaIO::SetCanvasProperties ( TCanvas * pCanv) const
protectedvirtual

Applies properties on the canvas created with the MakeQaObject funciton.

Parameters
pCanvPointer to the canvas
Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 84 of file CbmQaIO.cxx.

Referenced by ConstructAndRegisterQaObject().

◆ SetConfigName()

void CbmQaIO::SetConfigName ( const char * path)

Creates a ROOT object.

Sets config name

Parameters
nameA path to the config
Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 95 of file CbmQaIO.cxx.

References fConfigNode, fsConfigName, and fsPrefix.

◆ SetRootFolderName()

void CbmQaIO::SetRootFolderName ( const TString & path)
inline

Sets a common root path to the objects in the output file.

Parameters
pathA path to the object
Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 109 of file CbmQaIO.h.

References fsRootFolderName.

Referenced by CbmQaTask::CbmQaTask().

◆ SetStoringMode()

void CbmQaIO::SetStoringMode ( EStoringMode mode)
inline

Set storing mode.

Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 112 of file CbmQaIO.h.

References fStoringMode.

Referenced by CbmCaInputQaBase< DetID >::CbmCaInputQaBase().

◆ SetTH1Properties()

void CbmQaIO::SetTH1Properties ( TH1 * pHist) const
protectedvirtual

Applies properties on the histogram created with the MakeQaObject function.

Parameters
pHistPointer to the histogram

Reimplemented in cbm::ca::TrackTypeQa.

Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 36 of file CbmQaIO.cxx.

References cbm::qa::util::GetHistStats().

Referenced by ConstructAndRegisterQaObject().

◆ SetTH2Properties()

void CbmQaIO::SetTH2Properties ( TH2 * pHist) const
protectedvirtual

Applies properties on the histogram created with the MakeQaObject function.

Parameters
pHistPointer to the histogram
Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 50 of file CbmQaIO.cxx.

Referenced by ConstructAndRegisterQaObject().

◆ SetTProfile2DProperties()

void CbmQaIO::SetTProfile2DProperties ( TProfile2D * pHist) const
protectedvirtual

Applies properties on the profile 2D created with the MakeQaObject function.

Parameters
pHistPointer to the profile
Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 67 of file CbmQaIO.cxx.

Referenced by ConstructAndRegisterQaObject().

◆ WriteToFile()

void CbmQaIO::WriteToFile ( TFile * pOutFile) const
protected

Writes objects into file.

Parameters
pOutFilePointer to output ROOT file
Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 116 of file CbmQaIO.cxx.

References fpvObjList.

Referenced by CbmQaTask::Finish().

Member Data Documentation

◆ fConfigNode

YAML::Node CbmQaIO::fConfigNode {}
protected

◆ fpvObjList

std::shared_ptr<ObjList_t> CbmQaIO::fpvObjList = nullptr
protected

◆ fsConfigName

TString CbmQaIO::fsConfigName = ""
protected

Name of configuration file.

Examples
/tmp/builds/computing/cbmroot/core/qa/CbmQaIO.h.

Definition at line 158 of file CbmQaIO.h.

Referenced by GetConfigName(), and SetConfigName().

◆ fsPrefix

TString CbmQaIO::fsPrefix = ""
protected

◆ fsRootFolderName

TString CbmQaIO::fsRootFolderName = ""
protected

◆ fStoringMode


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