CbmRoot
|
ROOT object IO interface for QA. More...
#include <CbmQaIO.h>
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. | |
CbmQaIO & | operator= (const CbmQaIO &)=delete |
Copy assignment operator. | |
CbmQaIO & | operator= (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_t > | fpvObjList = 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. | |
ROOT object IO interface for QA.
The class provides interface to write ROOT object into resulted files
using CbmQaIO::ObjList_t = std::vector<std::pair<TObject*, TString>> |
|
strong |
CbmQaIO::CbmQaIO | ( | TString | prefixName, |
std::shared_ptr< ObjList_t > | pObjList = nullptr ) |
Constructor.
prefixName | Name of the unique prefix |
pObjList | List of already created objects |
Definition at line 19 of file CbmQaIO.cxx.
References fpvObjList, and fsPrefix.
|
virtual |
Destructor.
Definition at line 31 of file CbmQaIO.cxx.
|
delete |
Copy constructor.
|
delete |
Move constructor.
|
protected |
Function to check, if a property is defined.
property | A property to be tested |
name | A name of property (used for logging) |
Definition at line 178 of file CbmQaIO.h.
Referenced by MakeQaObject().
|
private |
Creates and registers a ROOT object.
name | A name of the ROOT object, which can contain a sub-directory |
args | Other arguments, passed to the ROOT object constructor |
Definition at line 198 of file CbmQaIO.h.
References fpvObjList, fsRootFolderName, fStoringMode, kSUBDIR, SetCanvasProperties(), SetTH1Properties(), SetTH2Properties(), and SetTProfile2DProperties().
Referenced by MakeQaObject().
|
inline |
void CbmQaIO::MakeQaDirectory | ( | TString | sName | ) |
Definition at line 132 of file CbmQaIO.cxx.
References fpvObjList, and fsRootFolderName.
Referenced by cbm::ca::InputQaSetup::InitQa(), and CbmCaInputQaTof::InitQa().
T * CbmQaIO::MakeQaObject | ( | TString | sName, |
TString | sTitle, | ||
Args... | args ) |
Definition at line 261 of file CbmQaIO.h.
References CheckProperty(), ConstructAndRegisterQaObject(), and fConfigNode.
Referenced by cbm::ca::OutputQa::Check(), cbm::ca::TrackFitQa::CreatePullPlot(), cbm::ca::TrackFitQa::CreateResidualPlot(), cbm::ca::InputQaSetup::CreateSummary(), cbm::ca::OutputQa::CreateSummary(), CbmCaInputQaSts::CreateSummary(), cbm::ca::OutputQa::DrawEvent(), cbm::ca::TrackFitQa::Init(), cbm::ca::TrackTypeQa::Init(), cbm::ca::InputQaSetup::InitQa(), CbmCaInputQaSts::InitQa(), and CbmCaInputQaTof::InitQa().
Copy assignment operator.
|
inlineprotected |
Reads the specific configuration structure from the YAML node.
Config | Type of the configuration class |
The function is to be called in the user-defined class method InitDataBranches
Definition at line 127 of file CbmQaIO.h.
References fConfigNode, and cbm::algo::yaml::Read().
|
protectedvirtual |
Applies properties on the canvas created with the MakeQaObject funciton.
pCanv | Pointer to the canvas |
Definition at line 84 of file CbmQaIO.cxx.
Referenced by ConstructAndRegisterQaObject().
void CbmQaIO::SetConfigName | ( | const char * | path | ) |
Creates a ROOT object.
Sets config name
name | A path to the config |
Definition at line 95 of file CbmQaIO.cxx.
References fConfigNode, fsConfigName, and fsPrefix.
|
inline |
Sets a common root path to the objects in the output file.
path | A path to the object |
Definition at line 109 of file CbmQaIO.h.
References fsRootFolderName.
Referenced by CbmQaTask::CbmQaTask().
|
inline |
Set storing mode.
Definition at line 112 of file CbmQaIO.h.
References fStoringMode.
Referenced by CbmCaInputQaBase< DetID >::CbmCaInputQaBase().
|
protectedvirtual |
Applies properties on the histogram created with the MakeQaObject function.
pHist | Pointer to the histogram |
Reimplemented in cbm::ca::TrackTypeQa.
Definition at line 36 of file CbmQaIO.cxx.
References cbm::qa::util::GetHistStats().
Referenced by ConstructAndRegisterQaObject().
|
protectedvirtual |
Applies properties on the histogram created with the MakeQaObject function.
pHist | Pointer to the histogram |
Definition at line 50 of file CbmQaIO.cxx.
Referenced by ConstructAndRegisterQaObject().
|
protectedvirtual |
Applies properties on the profile 2D created with the MakeQaObject function.
pHist | Pointer to the profile |
Definition at line 67 of file CbmQaIO.cxx.
Referenced by ConstructAndRegisterQaObject().
|
protected |
Writes objects into file.
pOutFile | Pointer to output ROOT file |
Definition at line 116 of file CbmQaIO.cxx.
References fpvObjList.
Referenced by CbmQaTask::Finish().
|
protected |
Configuration node.
Definition at line 164 of file CbmQaIO.h.
Referenced by CbmQaTask::CompareQaObjects(), MakeQaObject(), CbmQaTask::ReadCheckListFromConfig(), ReadSpecificConfig(), and SetConfigName().
|
protected |
List of registered ROOT objects.
Definition at line 162 of file CbmQaIO.h.
Referenced by CbmQaIO(), CbmQaTask::CompareQaObjects(), ConstructAndRegisterQaObject(), cbm::ca::TrackTypeQa::Init(), cbm::ca::OutputQa::InitQa(), MakeQaDirectory(), and WriteToFile().
|
protected |
Name of configuration file.
Definition at line 158 of file CbmQaIO.h.
Referenced by GetConfigName(), and SetConfigName().
|
protected |
Unique prefix for all writeable root.
Definition at line 159 of file CbmQaIO.h.
Referenced by CbmQaIO(), cbm::ca::TrackFitQa::CreatePullPlot(), cbm::ca::TrackTypeQa::Init(), cbm::ca::OutputQa::InitQa(), and SetConfigName().
|
protected |
Name of root folder.
Definition at line 157 of file CbmQaIO.h.
Referenced by CbmQaTask::CompareQaObjects(), ConstructAndRegisterQaObject(), cbm::ca::TrackTypeQa::Init(), cbm::ca::OutputQa::InitQa(), MakeQaDirectory(), and SetRootFolderName().
|
protected |
Objects storing mode.
Definition at line 161 of file CbmQaIO.h.
Referenced by CbmQaTask::CbmQaTask(), ConstructAndRegisterQaObject(), SetStoringMode(), cbm::ca::TrackFitQa::TrackFitQa(), and cbm::ca::TrackTypeQa::TrackTypeQa().