Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches

When using RooFit, statistical models can be conveniently handled and stored as a RooWorkspace.

However, for the sake of interoperability with other statistical frameworks, and also ease of manipulation, it may be useful to store statistical models in text form.

The RooJSONFactoryWSTool is a helper class to achieve exactly this, exporting to and importing from JSON and YML.

In order to import a workspace from a JSON file, you can do

tool.importJSON("myjson.json")
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.

Similarly, in order to export a workspace to a JSON file, you can do

tool.exportJSON("myjson.json")

Analogously, in C++, you can do

// ...
RooWorkspace ws("ws");
tool.importJSON("myjson.json");
When using RooFit, statistical models can be conveniently handled and stored as a RooWorkspace.
Persistable container for RooFit projects.

and

// ...
tool.exportJSON("myjson.json");

For more details, consult the tutorial rf515_hfJSON.

In order to import and export YML files, ROOT needs to be compiled with the external dependency RapidYAML, which needs to be installed on your system when building ROOT.

The RooJSONFactoryWSTool only knows about a limited set of classes for import and export. If import or export of a class you're interested in fails, you might need to add your own importer or exporter. Please consult the relevant section in the RooFit Developer Documentation to learn how to do that (Implement JSON I/O for a RooFit class with RooFit HS3).

You can always get a list of all the available importers and exporters by calling the following functions:

Alternatively, you can generate a LaTeX version of the available importers and exporters by calling

Definition at line 38 of file RooJSONFactoryWSTool.h.

Classes

struct  CombinedData
 
class  DependencyMissingError
 

Public Member Functions

 RooJSONFactoryWSTool (RooWorkspace &ws)
 
 ~RooJSONFactoryWSTool ()
 
void exportCategory (RooAbsCategory const &cat, RooFit::Detail::JSONNode &node)
 Export a RooAbsCategory object to a JSONNode.
 
bool exportJSON (std::ostream &os)
 Export the workspace to JSON format and write to the output stream.
 
bool exportJSON (std::string const &fileName)
 Export the workspace to JSON format and write to the specified file.
 
std::string exportJSONtoString ()
 Export the workspace to a JSON string.
 
std::string exportTransformed (const RooAbsReal *original, const std::string &suffix, const std::string &formula)
 
bool exportYML (std::ostream &os)
 Export the workspace to YML format and write to the output stream.
 
bool exportYML (std::string const &fileName)
 Export the workspace to YML format and write to the specified file.
 
std::string exportYMLtoString ()
 Export the workspace to a YML string.
 
std::string getStringAttribute (const std::string &obj, const std::string &attrib)
 
bool hasAttribute (const std::string &obj, const std::string &attrib)
 
void importFunction (const RooFit::Detail::JSONNode &n, bool importAllDependants)
 Import a function from the JSONNode into the workspace.
 
void importFunction (const std::string &jsonString, bool importAllDependants)
 Import a function from a JSON string into the workspace.
 
bool importJSON (std::istream &os)
 Imports a JSON file from the given input stream to the workspace.
 
bool importJSON (std::string const &filename)
 Imports a JSON file from the given filename to the workspace.
 
void importJSONElement (const std::string &name, const std::string &jsonString)
 
bool importJSONfromString (const std::string &s)
 Import the workspace from a JSON string.
 
void importVariableElement (const RooFit::Detail::JSONNode &n)
 
bool importYML (std::istream &os)
 Imports a YML file from the given input stream to the workspace.
 
bool importYML (std::string const &filename)
 Imports a YML file from the given filename to the workspace.
 
bool importYMLfromString (const std::string &s)
 Import the workspace from a YML string.
 
void queueExport (RooAbsArg const &arg)
 
template<class T >
T * request (const std::string &objname, const std::string &requestAuthor)
 
template<class T >
T * requestArg (const RooFit::Detail::JSONNode &node, const std::string &key)
 
template<class T >
RooArgList requestArgList (const RooFit::Detail::JSONNode &node, const std::string &seqName)
 
template<class T >
RooArgSet requestArgSet (const RooFit::Detail::JSONNode &node, const std::string &seqName)
 
template<class T , class Coll_t >
Coll_t requestCollection (const RooFit::Detail::JSONNode &node, const std::string &seqName)
 
void setAttribute (const std::string &obj, const std::string &attrib)
 
void setStringAttribute (const std::string &obj, const std::string &attrib, const std::string &value)
 
RooWorkspaceworkspace ()
 
template<class Obj_t , typename... Args_t>
Obj_twsEmplace (RooStringView name, Args_t &&...args)
 
template<class Obj_t >
Obj_twsImport (Obj_t const &obj)
 

Static Public Member Functions

static RooFit::Detail::JSONNodeappendNamedChild (RooFit::Detail::JSONNode &node, std::string const &name)
 
static std::unique_ptr< RooFit::Detail::JSONTreecreateNewJSONTree ()
 Create a new JSON tree with version information.
 
static void error (const char *s)
 Writes an error message to the RooFit message service and throws a runtime_error.
 
static void error (const std::string &s)
 
static void exportArray (std::size_t n, double const *contents, RooFit::Detail::JSONNode &output)
 Export an array of doubles to a JSONNode.
 
static void exportHisto (RooArgSet const &vars, std::size_t n, double const *contents, RooFit::Detail::JSONNode &output)
 Export histogram data to a JSONNode.
 
static void fillSeq (RooFit::Detail::JSONNode &node, RooAbsCollection const &coll, size_t nMax=-1)
 
static RooFit::Detail::JSONNode constfindNamedChild (RooFit::Detail::JSONNode const &node, std::string const &name)
 
template<typename... Keys_t>
static RooFit::Detail::JSONNodegetRooFitInternal (RooFit::Detail::JSONNode &node, Keys_t const &...keys)
 
static bool isValidName (const std::string &str)
 Check if a string is a valid name.
 
static RooFit::Detail::JSONNodemakeVariablesNode (RooFit::Detail::JSONNode &rootNode)
 
static std::string name (const RooFit::Detail::JSONNode &n)
 
static RooArgSet readAxes (const RooFit::Detail::JSONNode &node)
 Read axes from the JSONNode and create a RooArgSet representing them.
 
static std::unique_ptr< RooDataHistreadBinnedData (const RooFit::Detail::JSONNode &n, const std::string &namecomp, RooArgSet const &vars)
 Read binned data from the JSONNode and create a RooDataHist object.
 
static bool testValidName (const std::string &str, bool forcError)
 
static std::ostream & warning (const std::string &s)
 Writes a warning message to the RooFit message service.
 

Static Public Attributes

static bool allowExportInvalidNames
 
static constexpr bool useListsInsteadOfDicts = true
 

Private Member Functions

void exportAllObjects (RooFit::Detail::JSONNode &n)
 Export all objects in the workspace to a JSONNode.
 
RooJSONFactoryWSTool::CombinedData exportCombinedData (RooAbsData const &data)
 Export combined data from the workspace to a custom struct.
 
void exportData (RooAbsData const &data)
 Export data from the workspace to a JSONNode.
 
void exportModelConfig (RooFit::Detail::JSONNode &rootnode, RooStats::ModelConfig const &mc, const std::vector< RooJSONFactoryWSTool::CombinedData > &d)
 
void exportObject (RooAbsArg const &func, std::set< std::string > &exportedObjectNames)
 Export an object from the workspace to a JSONNode.
 
template<class T >
void exportObjects (T const &args, std::set< std::string > &exportedObjectNames)
 
void exportSingleModelConfig (RooFit::Detail::JSONNode &rootnode, RooStats::ModelConfig const &mc, std::string const &analysisName, std::map< std::string, std::string > const *dataComponents)
 
void exportVariable (const RooAbsArg *v, RooFit::Detail::JSONNode &n)
 Export a variable from the workspace to a JSONNode.
 
void exportVariables (const RooArgSet &allElems, RooFit::Detail::JSONNode &n)
 Export variables from the workspace to a JSONNode.
 
void importAllNodes (const RooFit::Detail::JSONNode &n)
 Imports all nodes of the JSON data and adds them to the workspace.
 
void importDependants (const RooFit::Detail::JSONNode &n)
 Import all dependants (servers) of a node into the workspace.
 
void importVariable (const RooFit::Detail::JSONNode &n)
 Import a variable from the JSONNode into the workspace.
 
template<class T >
T * requestImpl (const std::string &objname)
 
template<>
RooRealVarrequestImpl (const std::string &objname)
 
template<>
RooAbsPdfrequestImpl (const std::string &objname)
 
template<>
RooAbsRealrequestImpl (const std::string &objname)
 

Private Attributes

const RooFit::Detail::JSONNode_attributesNode = nullptr
 
std::unique_ptr< RooFit::JSONIO::Detail::Domains_domains
 
const RooFit::Detail::JSONNode_rootnodeInput = nullptr
 
RooFit::Detail::JSONNode_rootnodeOutput = nullptr
 
std::vector< RooAbsArg const * > _serversToExport
 
RooFit::Detail::JSONNode_varsNode = nullptr
 
RooWorkspace_workspace
 

#include <RooFitHS3/RooJSONFactoryWSTool.h>

Constructor & Destructor Documentation

◆ RooJSONFactoryWSTool()

RooJSONFactoryWSTool::RooJSONFactoryWSTool ( RooWorkspace & ws)

Definition at line 793 of file RooJSONFactoryWSTool.cxx.

◆ ~RooJSONFactoryWSTool()

RooJSONFactoryWSTool::~RooJSONFactoryWSTool ( )

Definition at line 795 of file RooJSONFactoryWSTool.cxx.

Member Function Documentation

◆ appendNamedChild()

JSONNode & RooJSONFactoryWSTool::appendNamedChild ( RooFit::Detail::JSONNode & node,
std::string const & name )
static

Definition at line 817 of file RooJSONFactoryWSTool.cxx.

◆ createNewJSONTree()

std::unique_ptr< JSONTree > RooJSONFactoryWSTool::createNewJSONTree ( )
static

Create a new JSON tree with version information.

Returns
std::unique_ptr<JSONTree> A unique pointer to the created JSON tree.

Definition at line 1963 of file RooJSONFactoryWSTool.cxx.

◆ error() [1/2]

void RooJSONFactoryWSTool::error ( const char * s)
static

Writes an error message to the RooFit message service and throws a runtime_error.

Parameters
sThe error message to be logged and thrown.
Returns
void

Definition at line 2331 of file RooJSONFactoryWSTool.cxx.

◆ error() [2/2]

static void RooJSONFactoryWSTool::error ( const std::string & s)
inlinestatic

Definition at line 126 of file RooJSONFactoryWSTool.h.

◆ exportAllObjects()

void RooJSONFactoryWSTool::exportAllObjects ( RooFit::Detail::JSONNode & n)
private

Export all objects in the workspace to a JSONNode.

This function exports all the objects in the workspace to the provided JSONNode. The objects' information is added as key-value pairs to the JSONNode.

Parameters
nThe JSONNode to which the objects will be exported.
Returns
void

Definition at line 1830 of file RooJSONFactoryWSTool.cxx.

◆ exportArray()

void RooJSONFactoryWSTool::exportArray ( std::size_t n,
double const * contents,
RooFit::Detail::JSONNode & output )
static

Export an array of doubles to a JSONNode.

This function exports an array of doubles, represented by the provided size and contents, to a JSONNode. The array elements are added to the JSONNode as a sequence of values.

Parameters
nThe size of the array.
contentsA pointer to the array containing the double values.
outputThe JSONNode to which the array will be exported.
Returns
void

Definition at line 1341 of file RooJSONFactoryWSTool.cxx.

◆ exportCategory()

void RooJSONFactoryWSTool::exportCategory ( RooAbsCategory const & cat,
RooFit::Detail::JSONNode & node )

Export a RooAbsCategory object to a JSONNode.

This function exports a RooAbsCategory object, represented by the provided categories and indices, to a JSONNode. The category labels and corresponding indices are added to the JSONNode as key-value pairs.

Parameters
catThe RooAbsCategory object to be exported.
nodeThe JSONNode to which the category data will be exported.
Returns
void

Definition at line 1365 of file RooJSONFactoryWSTool.cxx.

◆ exportCombinedData()

RooJSONFactoryWSTool::CombinedData RooJSONFactoryWSTool::exportCombinedData ( RooAbsData const & data)
private

Export combined data from the workspace to a custom struct.

This function exports combined data from the workspace, represented by the provided RooAbsData object, to a CombinedData struct. The struct contains information such as variables, categories, and bin contents of the combined data.

Parameters
dataThe RooAbsData object representing the combined data to be exported.
Returns
CombinedData A custom struct containing the exported combined data.

Definition at line 1398 of file RooJSONFactoryWSTool.cxx.

◆ exportData()

void RooJSONFactoryWSTool::exportData ( RooAbsData const & data)
private

Export data from the workspace to a JSONNode.

This function exports data represented by the provided RooAbsData object, to a JSONNode. The data's information is added as key-value pairs to the JSONNode.

Parameters
dataThe RooAbsData object representing the data to be exported.
Returns
void

Definition at line 1473 of file RooJSONFactoryWSTool.cxx.

◆ exportHisto()

void RooJSONFactoryWSTool::exportHisto ( RooArgSet const & vars,
std::size_t n,
double const * contents,
RooFit::Detail::JSONNode & output )
static

Export histogram data to a JSONNode.

This function exports histogram data, represented by the provided variables and contents, to a JSONNode. The histogram's axes information and bin contents are added as key-value pairs to the JSONNode.

Parameters
varsThe RooArgSet representing the variables associated with the histogram.
nThe number of bins in the histogram.
contentsA pointer to the array containing the bin contents of the histogram.
outputThe JSONNode to which the histogram data will be exported.
Returns
void

Definition at line 1302 of file RooJSONFactoryWSTool.cxx.

◆ exportJSON() [1/2]

bool RooJSONFactoryWSTool::exportJSON ( std::ostream & os)

Export the workspace to JSON format and write to the output stream.

Parameters
osThe output stream to write the JSON data to.
Returns
bool Returns true on successful export, false otherwise.

Definition at line 1990 of file RooJSONFactoryWSTool.cxx.

◆ exportJSON() [2/2]

bool RooJSONFactoryWSTool::exportJSON ( std::string const & filename)

Export the workspace to JSON format and write to the specified file.

Parameters
filenameThe name of the JSON file to create and write the data to.
Returns
bool Returns true on successful export, false otherwise.

Definition at line 2005 of file RooJSONFactoryWSTool.cxx.

◆ exportJSONtoString()

std::string RooJSONFactoryWSTool::exportJSONtoString ( )

Export the workspace to a JSON string.

Returns
std::string The JSON string representing the exported workspace.

Definition at line 1939 of file RooJSONFactoryWSTool.cxx.

◆ exportModelConfig()

void RooJSONFactoryWSTool::exportModelConfig ( RooFit::Detail::JSONNode & rootnode,
RooStats::ModelConfig const & mc,
const std::vector< RooJSONFactoryWSTool::CombinedData > & d )
private

Definition at line 1715 of file RooJSONFactoryWSTool.cxx.

◆ exportObject()

void RooJSONFactoryWSTool::exportObject ( RooAbsArg const & func,
std::set< std::string > & exportedObjectNames )
private

Export an object from the workspace to a JSONNode.

This function exports an object, represented by the provided RooAbsArg, from the workspace to a JSONNode. The object's information is added to the JSONNode as key-value pairs.

Parameters
funcThe RooAbsArg representing the object to be exported.
exportedObjectNamesA set of strings containing names of previously exported objects to avoid duplicates. This set is updated with the name of the newly exported object.
Returns
void

Definition at line 1033 of file RooJSONFactoryWSTool.cxx.

◆ exportObjects()

template<class T >
void RooJSONFactoryWSTool::exportObjects ( T const & args,
std::set< std::string > & exportedObjectNames )
inlineprivate

Definition at line 202 of file RooJSONFactoryWSTool.h.

◆ exportSingleModelConfig()

void RooJSONFactoryWSTool::exportSingleModelConfig ( RooFit::Detail::JSONNode & rootnode,
RooStats::ModelConfig const & mc,
std::string const & analysisName,
std::map< std::string, std::string > const * dataComponents )
private

Definition at line 1737 of file RooJSONFactoryWSTool.cxx.

◆ exportTransformed()

std::string RooJSONFactoryWSTool::exportTransformed ( const RooAbsReal * original,
const std::string & suffix,
const std::string & formula )

Definition at line 1011 of file RooJSONFactoryWSTool.cxx.

◆ exportVariable()

void RooJSONFactoryWSTool::exportVariable ( const RooAbsArg * v,
RooFit::Detail::JSONNode & n )
private

Export a variable from the workspace to a JSONNode.

This function exports a variable, represented by the provided RooAbsArg pointer 'v', from the workspace to a JSONNode. The variable's information is added to the JSONNode as key-value pairs.

Parameters
vThe pointer to the RooAbsArg representing the variable to be exported.
nodeThe JSONNode to which the variable will be exported.
Returns
void

Definition at line 959 of file RooJSONFactoryWSTool.cxx.

◆ exportVariables()

void RooJSONFactoryWSTool::exportVariables ( const RooArgSet & allElems,
RooFit::Detail::JSONNode & n )
private

Export variables from the workspace to a JSONNode.

This function exports variables, represented by the provided RooArgSet, from the workspace to a JSONNode. The variables' information is added to the JSONNode as key-value pairs.

Parameters
allElemsThe RooArgSet representing the variables to be exported.
nThe JSONNode to which the variables will be exported.
Returns
void

Definition at line 1003 of file RooJSONFactoryWSTool.cxx.

◆ exportYML() [1/2]

bool RooJSONFactoryWSTool::exportYML ( std::ostream & os)

Export the workspace to YML format and write to the output stream.

Parameters
osThe output stream to write the YML data to.
Returns
bool Returns true on successful export, false otherwise.

Definition at line 2023 of file RooJSONFactoryWSTool.cxx.

◆ exportYML() [2/2]

bool RooJSONFactoryWSTool::exportYML ( std::string const & filename)

Export the workspace to YML format and write to the specified file.

Parameters
filenameThe name of the YML file to create and write the data to.
Returns
bool Returns true on successful export, false otherwise.

Definition at line 2038 of file RooJSONFactoryWSTool.cxx.

◆ exportYMLtoString()

std::string RooJSONFactoryWSTool::exportYMLtoString ( )

Export the workspace to a YML string.

Returns
std::string The YML string representing the exported workspace.

Definition at line 1951 of file RooJSONFactoryWSTool.cxx.

◆ fillSeq()

void RooJSONFactoryWSTool::fillSeq ( RooFit::Detail::JSONNode & node,
RooAbsCollection const & coll,
size_t nMax = -1 )
static

Definition at line 797 of file RooJSONFactoryWSTool.cxx.

◆ findNamedChild()

JSONNode const * RooJSONFactoryWSTool::findNamedChild ( RooFit::Detail::JSONNode const & node,
std::string const & name )
static

Definition at line 827 of file RooJSONFactoryWSTool.cxx.

◆ getRooFitInternal()

template<typename... Keys_t>
static RooFit::Detail::JSONNode & RooJSONFactoryWSTool::getRooFitInternal ( RooFit::Detail::JSONNode & node,
Keys_t const &... keys )
inlinestatic

Definition at line 173 of file RooJSONFactoryWSTool.h.

◆ getStringAttribute()

std::string RooJSONFactoryWSTool::getStringAttribute ( const std::string & obj,
const std::string & attrib )

Definition at line 2072 of file RooJSONFactoryWSTool.cxx.

◆ hasAttribute()

bool RooJSONFactoryWSTool::hasAttribute ( const std::string & obj,
const std::string & attrib )

Definition at line 2050 of file RooJSONFactoryWSTool.cxx.

◆ importAllNodes()

void RooJSONFactoryWSTool::importAllNodes ( const RooFit::Detail::JSONNode & n)
private

Imports all nodes of the JSON data and adds them to the workspace.

Parameters
nThe JSONNode representing the root node of the JSON data.
Returns
void

Definition at line 2100 of file RooJSONFactoryWSTool.cxx.

◆ importDependants()

void RooJSONFactoryWSTool::importDependants ( const RooFit::Detail::JSONNode & n)
private

Import all dependants (servers) of a node into the workspace.

This function imports all the dependants (servers) of the given JSONNode into the workspace. The dependants' information is read from the JSONNode and added to the workspace.

Parameters
nThe JSONNode representing the node whose dependants are to be imported.
Returns
void

Definition at line 1695 of file RooJSONFactoryWSTool.cxx.

◆ importFunction() [1/2]

void RooJSONFactoryWSTool::importFunction ( const RooFit::Detail::JSONNode & n,
bool importAllDependants )

Import a function from the JSONNode into the workspace.

This function imports a function from the given JSONNode into the workspace. The function's information is read from the JSONNode and added to the workspace.

Parameters
pThe JSONNode representing the function to be imported.
importAllDependantsA boolean flag indicating whether to import all dependants (servers) of the function.
Returns
void

Definition at line 1180 of file RooJSONFactoryWSTool.cxx.

◆ importFunction() [2/2]

void RooJSONFactoryWSTool::importFunction ( const std::string & jsonString,
bool importAllDependants )

Import a function from a JSON string into the workspace.

This function imports a function from the provided JSON string into the workspace. The function's information is read from the JSON string and added to the workspace.

Parameters
jsonStringThe JSON string containing the function information.
importAllDependantsA boolean flag indicating whether to import all dependants (servers) of the function.
Returns
void

Definition at line 1285 of file RooJSONFactoryWSTool.cxx.

◆ importJSON() [1/2]

bool RooJSONFactoryWSTool::importJSON ( std::istream & is)

Imports a JSON file from the given input stream to the workspace.

Parameters
isThe input stream containing the JSON data.
Returns
bool Returns true on successful import, false otherwise.

Definition at line 2195 of file RooJSONFactoryWSTool.cxx.

◆ importJSON() [2/2]

bool RooJSONFactoryWSTool::importJSON ( std::string const & filename)

Imports a JSON file from the given filename to the workspace.

Parameters
filenameThe name of the JSON file to import.
Returns
bool Returns true on successful import, false otherwise.

Definition at line 2212 of file RooJSONFactoryWSTool.cxx.

◆ importJSONElement()

void RooJSONFactoryWSTool::importJSONElement ( const std::string & name,
const std::string & jsonString )

Definition at line 2258 of file RooJSONFactoryWSTool.cxx.

◆ importJSONfromString()

bool RooJSONFactoryWSTool::importJSONfromString ( const std::string & s)

Import the workspace from a JSON string.

Parameters
sThe JSON string containing the workspace data.
Returns
bool Returns true on successful import, false otherwise.

Definition at line 1916 of file RooJSONFactoryWSTool.cxx.

◆ importVariable()

void RooJSONFactoryWSTool::importVariable ( const RooFit::Detail::JSONNode & n)
private

Import a variable from the JSONNode into the workspace.

This function imports a variable from the given JSONNode into the workspace. The variable's information is read from the JSONNode and added to the workspace.

Parameters
pThe JSONNode representing the variable to be imported.
Returns
void

Definition at line 1660 of file RooJSONFactoryWSTool.cxx.

◆ importVariableElement()

void RooJSONFactoryWSTool::importVariableElement ( const RooFit::Detail::JSONNode & n)

Definition at line 2276 of file RooJSONFactoryWSTool.cxx.

◆ importYML() [1/2]

bool RooJSONFactoryWSTool::importYML ( std::istream & is)

Imports a YML file from the given input stream to the workspace.

Parameters
isThe input stream containing the YML data.
Returns
bool Returns true on successful import, false otherwise.

Definition at line 2231 of file RooJSONFactoryWSTool.cxx.

◆ importYML() [2/2]

bool RooJSONFactoryWSTool::importYML ( std::string const & filename)

Imports a YML file from the given filename to the workspace.

Parameters
filenameThe name of the YML file to import.
Returns
bool Returns true on successful import, false otherwise.

Definition at line 2245 of file RooJSONFactoryWSTool.cxx.

◆ importYMLfromString()

bool RooJSONFactoryWSTool::importYMLfromString ( const std::string & s)

Import the workspace from a YML string.

Parameters
sThe YML string containing the workspace data.
Returns
bool Returns true on successful import, false otherwise.

Definition at line 1928 of file RooJSONFactoryWSTool.cxx.

◆ isValidName()

bool RooJSONFactoryWSTool::isValidName ( const std::string & str)
static

Check if a string is a valid name.

A valid name should start with a letter or an underscore, followed by letters, digits, or underscores. Only characters from the ASCII character set are allowed.

Parameters
strThe string to be checked.
Returns
bool Returns true if the string is a valid name; otherwise, returns false.

Definition at line 853 of file RooJSONFactoryWSTool.cxx.

◆ makeVariablesNode()

JSONNode & RooJSONFactoryWSTool::makeVariablesNode ( RooFit::Detail::JSONNode & rootNode)
static

Definition at line 893 of file RooJSONFactoryWSTool.cxx.

◆ name()

std::string RooJSONFactoryWSTool::name ( const RooFit::Detail::JSONNode & n)
static

Definition at line 888 of file RooJSONFactoryWSTool.cxx.

◆ queueExport()

void RooJSONFactoryWSTool::queueExport ( RooAbsArg const & arg)
inline

Definition at line 185 of file RooJSONFactoryWSTool.h.

◆ readAxes()

RooArgSet RooJSONFactoryWSTool::readAxes ( const RooFit::Detail::JSONNode & node)
static

Read axes from the JSONNode and create a RooArgSet representing them.

This function reads axes information from the given JSONNode and creates a RooArgSet with variables representing these axes.

Parameters
topNodeThe JSONNode containing the axes information to be read.
Returns
RooArgSet A RooArgSet containing the variables created from the JSONNode.

Definition at line 1567 of file RooJSONFactoryWSTool.cxx.

◆ readBinnedData()

std::unique_ptr< RooDataHist > RooJSONFactoryWSTool::readBinnedData ( const RooFit::Detail::JSONNode & n,
const std::string & name,
RooArgSet const & vars )
static

Read binned data from the JSONNode and create a RooDataHist object.

This function reads binned data from the given JSONNode and creates a RooDataHist object. The binned data is associated with the specified name and variables (RooArgSet) in the workspace.

Parameters
nThe JSONNode representing the binned data to be read.
nameThe name to be associated with the created RooDataHist object.
varsThe RooArgSet representing the variables associated with the binned data.
Returns
std::unique_ptr<RooDataHist> A unique pointer to the created RooDataHist object.

Definition at line 1608 of file RooJSONFactoryWSTool.cxx.

◆ request()

template<class T >
T * RooJSONFactoryWSTool::request ( const std::string & objname,
const std::string & requestAuthor )
inline

Definition at line 62 of file RooJSONFactoryWSTool.h.

◆ requestArg()

template<class T >
T * RooJSONFactoryWSTool::requestArg ( const RooFit::Detail::JSONNode & node,
const std::string & key )
inline

Definition at line 71 of file RooJSONFactoryWSTool.h.

◆ requestArgList()

template<class T >
RooArgList RooJSONFactoryWSTool::requestArgList ( const RooFit::Detail::JSONNode & node,
const std::string & seqName )
inline

Definition at line 105 of file RooJSONFactoryWSTool.h.

◆ requestArgSet()

template<class T >
RooArgSet RooJSONFactoryWSTool::requestArgSet ( const RooFit::Detail::JSONNode & node,
const std::string & seqName )
inline

Definition at line 99 of file RooJSONFactoryWSTool.h.

◆ requestCollection()

template<class T , class Coll_t >
Coll_t RooJSONFactoryWSTool::requestCollection ( const RooFit::Detail::JSONNode & node,
const std::string & seqName )
inline

Definition at line 81 of file RooJSONFactoryWSTool.h.

◆ requestImpl() [1/4]

template<class T >
T * RooJSONFactoryWSTool::requestImpl ( const std::string & objname)
private

◆ requestImpl() [2/4]

template<>
RooRealVar * RooJSONFactoryWSTool::requestImpl ( const std::string & objname)
private

Definition at line 899 of file RooJSONFactoryWSTool.cxx.

◆ requestImpl() [3/4]

template<>
RooAbsPdf * RooJSONFactoryWSTool::requestImpl ( const std::string & objname)
private

Definition at line 914 of file RooJSONFactoryWSTool.cxx.

◆ requestImpl() [4/4]

template<>
RooAbsReal * RooJSONFactoryWSTool::requestImpl ( const std::string & objname)
private

Definition at line 929 of file RooJSONFactoryWSTool.cxx.

◆ setAttribute()

void RooJSONFactoryWSTool::setAttribute ( const std::string & obj,
const std::string & attrib )

Definition at line 2064 of file RooJSONFactoryWSTool.cxx.

◆ setStringAttribute()

void RooJSONFactoryWSTool::setStringAttribute ( const std::string & obj,
const std::string & attrib,
const std::string & value )

Definition at line 2085 of file RooJSONFactoryWSTool.cxx.

◆ testValidName()

bool RooJSONFactoryWSTool::testValidName ( const std::string & str,
bool forcError )
static

Definition at line 873 of file RooJSONFactoryWSTool.cxx.

◆ warning()

std::ostream & RooJSONFactoryWSTool::warning ( const std::string & s)
static

Writes a warning message to the RooFit message service.

Parameters
strThe warning message to be logged.
Returns
std::ostream& A reference to the output stream.

Definition at line 2320 of file RooJSONFactoryWSTool.cxx.

◆ workspace()

RooWorkspace * RooJSONFactoryWSTool::workspace ( )
inline

Definition at line 110 of file RooJSONFactoryWSTool.h.

◆ wsEmplace()

template<class Obj_t , typename... Args_t>
Obj_t & RooJSONFactoryWSTool::wsEmplace ( RooStringView name,
Args_t &&... args )
inline

Definition at line 120 of file RooJSONFactoryWSTool.h.

◆ wsImport()

template<class Obj_t >
Obj_t & RooJSONFactoryWSTool::wsImport ( Obj_t const & obj)
inline

Definition at line 113 of file RooJSONFactoryWSTool.h.

Member Data Documentation

◆ _attributesNode

const RooFit::Detail::JSONNode* RooJSONFactoryWSTool::_attributesNode = nullptr
private

Definition at line 236 of file RooJSONFactoryWSTool.h.

◆ _domains

std::unique_ptr<RooFit::JSONIO::Detail::Domains> RooJSONFactoryWSTool::_domains
private

Definition at line 242 of file RooJSONFactoryWSTool.h.

◆ _rootnodeInput

const RooFit::Detail::JSONNode* RooJSONFactoryWSTool::_rootnodeInput = nullptr
private

Definition at line 235 of file RooJSONFactoryWSTool.h.

◆ _rootnodeOutput

RooFit::Detail::JSONNode* RooJSONFactoryWSTool::_rootnodeOutput = nullptr
private

Definition at line 237 of file RooJSONFactoryWSTool.h.

◆ _serversToExport

std::vector<RooAbsArg const *> RooJSONFactoryWSTool::_serversToExport
private

Definition at line 243 of file RooJSONFactoryWSTool.h.

◆ _varsNode

RooFit::Detail::JSONNode* RooJSONFactoryWSTool::_varsNode = nullptr
private

Definition at line 238 of file RooJSONFactoryWSTool.h.

◆ _workspace

RooWorkspace& RooJSONFactoryWSTool::_workspace
private

Definition at line 239 of file RooJSONFactoryWSTool.h.

◆ allowExportInvalidNames

bool RooJSONFactoryWSTool::allowExportInvalidNames
static

Definition at line 41 of file RooJSONFactoryWSTool.h.

◆ useListsInsteadOfDicts

constexpr bool RooJSONFactoryWSTool::useListsInsteadOfDicts = true
staticconstexpr

Definition at line 40 of file RooJSONFactoryWSTool.h.

Libraries for RooJSONFactoryWSTool:

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