Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
JSONIOUtils.h File Reference
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <type_traits>
#include <utility>
#include <vector>
#include <RooFit/Detail/JSONInterface.h>
#include <RooFitHS3/JSONIO.h>
#include "HS3Document.h"
Include dependency graph for JSONIOUtils.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  ArrayComponentInfo
 
class  FuncExporter< RooArg_t, Func >
 
class  FuncImporter< ImportFunc >
 

Typedefs

template<class RooArg_t >
using ExportFunc = void (*)(RooJSONFactoryWSTool *, RooArg_t const &, RooFit::Detail::JSONNode &)
 

Functions

std::optional< ArrayComponentInfo > arrayComponentInfo (RooAbsPdf const &pdf, std::string const *observable=nullptr, RooJSONFactoryWSTool *tool=nullptr)
 
void checkParamHistFuncOrderIsDefined (RooFit::HS3::Version const &version, RooAbsCollection const &vars, std::string const &context)
 
bool endsWith (std::string_view str, std::string_view suffix)
 
std::unique_ptr< RooArgSet > histogramVariablesNamedAfterObservables (RooDataHist const &dh, RooArgSet const &histObs, RooArgSet const &funcObs)
 
bool isLiteralConstVar (RooAbsArg const &arg)
 
bool isLiteralIdentifier (std::string_view name)
 
bool isSkippedHelper (RooAbsArg const &arg, RooWorkspace const &ws)
 
std::vector< RooAbsReal * > paramHistFuncParamsInBinOrder (ParamHistFunc const &func)
 
template<class RooArg_t , class Func >
void registerExporter (std::string key, Func func, bool autoExportDependants=true)
 
template<class ImportFunc >
void registerImporter (const std::string &key, ImportFunc func)
 
template<class ImportFunc , class RooArg_t >
void registerType (const std::string &key, ImportFunc importFunc, ExportFunc< RooArg_t > exportFunc, bool autoExportDependants=true)
 
std::string removeSuffix (std::string_view str, std::string_view suffix)
 
std::vector< RooCategory const * > selectionColumns (RooAbsCategory const &indexCat)
 
std::vector< RooCategory const * > selectionColumns (RooAbsCollection const &vars)
 
std::vector< std::vector< std::string > > selectionKeys (std::vector< RooCategory const * > const &columns)
 
std::string selectionKeyToString (std::vector< std::string > const &key)
 
std::string selectionLabel (RooAbsCategory const &indexCat, std::vector< RooCategory const * > const &columns, std::vector< std::string > const &key)
 
std::string selectionLabel (std::vector< std::string > const &key)
 
bool startsWith (std::string_view str, std::string_view prefix)
 
std::optional< double > toNumber (const std::string &str)
 
RooArgList toParamHistFuncOrder (RooArgList const &paramsInBinOrder, RooAbsCollection const &vars)
 
std::string transformedArgument (RooAbsReal const &param)
 
std::string transformedBaseName (RooAbsReal const &param)
 
std::string transformedOriginal (std::string_view name, std::string_view suffix)
 
void writeArrayDist (RooJSONFactoryWSTool &tool, RooFit::Detail::JSONNode &elem, std::string const &name, std::vector< RooAbsPdf const * > const &components)
 
void writeReference (RooFit::Detail::JSONNode &node, RooAbsArg const &arg)
 

Variables

constexpr const char * arrayDistTag = "hs3_array_dist"
 
constexpr const char * helperObjectTag = "hs3_helper"
 

Typedef Documentation

◆ ExportFunc

template<class RooArg_t >
using ExportFunc = void (*)(RooJSONFactoryWSTool *, RooArg_t const &, RooFit::Detail::JSONNode &)

Definition at line 160 of file JSONIOUtils.h.

Function Documentation

◆ arrayComponentInfo()

std::optional< ArrayComponentInfo > arrayComponentInfo ( RooAbsPdf const & pdf,
std::string const * observable = nullptr,
RooJSONFactoryWSTool * tool = nullptr )

Definition at line 1680 of file JSONFactories_RooFitCore.cxx.

◆ checkParamHistFuncOrderIsDefined()

void checkParamHistFuncOrderIsDefined ( RooFit::HS3::Version const & version,
RooAbsCollection const & vars,
std::string const & context )

Definition at line 225 of file JSONIOUtils.cxx.

◆ endsWith()

bool endsWith ( std::string_view str,
std::string_view suffix )

Definition at line 55 of file JSONIOUtils.cxx.

◆ histogramVariablesNamedAfterObservables()

std::unique_ptr< RooArgSet > histogramVariablesNamedAfterObservables ( RooDataHist const & dh,
RooArgSet const & histObs,
RooArgSet const & funcObs )

Definition at line 182 of file JSONIOUtils.cxx.

◆ isLiteralConstVar()

bool isLiteralConstVar ( RooAbsArg const & arg)

Definition at line 35 of file JSONIOUtils.cxx.

◆ isLiteralIdentifier()

bool isLiteralIdentifier ( std::string_view name)

Definition at line 138 of file JSONIOUtils.cxx.

◆ isSkippedHelper()

bool isSkippedHelper ( RooAbsArg const & arg,
RooWorkspace const & ws )

Definition at line 1798 of file RooJSONFactoryWSTool.cxx.

◆ paramHistFuncParamsInBinOrder()

std::vector< RooAbsReal * > paramHistFuncParamsInBinOrder ( ParamHistFunc const & func)

Definition at line 198 of file JSONIOUtils.cxx.

◆ registerExporter()

template<class RooArg_t , class Func >
void registerExporter ( std::string key,
Func func,
bool autoExportDependants = true )

Definition at line 194 of file JSONIOUtils.h.

◆ registerImporter()

template<class ImportFunc >
void registerImporter ( const std::string & key,
ImportFunc func )

Definition at line 188 of file JSONIOUtils.h.

◆ registerType()

template<class ImportFunc , class RooArg_t >
void registerType ( const std::string & key,
ImportFunc importFunc,
ExportFunc< RooArg_t > exportFunc,
bool autoExportDependants = true )

Definition at line 203 of file JSONIOUtils.h.

◆ removeSuffix()

std::string removeSuffix ( std::string_view str,
std::string_view suffix )

Definition at line 60 of file JSONIOUtils.cxx.

◆ selectionColumns() [1/2]

std::vector< RooCategory const * > selectionColumns ( RooAbsCategory const & indexCat)

Definition at line 247 of file JSONIOUtils.cxx.

◆ selectionColumns() [2/2]

std::vector< RooCategory const * > selectionColumns ( RooAbsCollection const & vars)

Definition at line 270 of file JSONIOUtils.cxx.

◆ selectionKeys()

std::vector< std::vector< std::string > > selectionKeys ( std::vector< RooCategory const * > const & columns)

Definition at line 282 of file JSONIOUtils.cxx.

◆ selectionKeyToString()

std::string selectionKeyToString ( std::vector< std::string > const & key)

Definition at line 310 of file JSONIOUtils.cxx.

◆ selectionLabel() [1/2]

std::string selectionLabel ( RooAbsCategory const & indexCat,
std::vector< RooCategory const * > const & columns,
std::vector< std::string > const & key )

Definition at line 319 of file JSONIOUtils.cxx.

◆ selectionLabel() [2/2]

std::string selectionLabel ( std::vector< std::string > const & key)

Definition at line 298 of file JSONIOUtils.cxx.

◆ startsWith()

bool startsWith ( std::string_view str,
std::string_view prefix )

Definition at line 50 of file JSONIOUtils.cxx.

◆ toNumber()

std::optional< double > toNumber ( const std::string & str)

Definition at line 25 of file JSONIOUtils.cxx.

◆ toParamHistFuncOrder()

RooArgList toParamHistFuncOrder ( RooArgList const & paramsInBinOrder,
RooAbsCollection const & vars )

Definition at line 207 of file JSONIOUtils.cxx.

◆ transformedArgument()

std::string transformedArgument ( RooAbsReal const & param)

Definition at line 110 of file JSONIOUtils.cxx.

◆ transformedBaseName()

std::string transformedBaseName ( RooAbsReal const & param)

Definition at line 120 of file JSONIOUtils.cxx.

◆ transformedOriginal()

std::string transformedOriginal ( std::string_view name,
std::string_view suffix )

Definition at line 143 of file JSONIOUtils.cxx.

◆ writeArrayDist()

void writeArrayDist ( RooJSONFactoryWSTool & tool,
RooFit::Detail::JSONNode & elem,
std::string const & name,
std::vector< RooAbsPdf const * > const & components )

Definition at line 1719 of file JSONFactories_RooFitCore.cxx.

◆ writeReference()

void writeReference ( RooFit::Detail::JSONNode & node,
RooAbsArg const & arg )

Definition at line 41 of file JSONIOUtils.cxx.

Variable Documentation

◆ arrayDistTag

constexpr const char* arrayDistTag = "hs3_array_dist"
inlineconstexpr

Definition at line 34 of file JSONIOUtils.h.

◆ helperObjectTag

constexpr const char* helperObjectTag = "hs3_helper"
inlineconstexpr

Definition at line 45 of file JSONIOUtils.h.