Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::RDF::Experimental::RMetaData Class Reference

Class behaving as a heterogenuous dictionary to store the metadata of a dataset.

The supported types of the metadata are: std::string, int and double. An example of creating the RMetaData object:

meta.Add("sample_name", "name"");
meta.Add("luminosity", 10064);
meta.Add("xsecs", 1.0);
Class behaving as a heterogenuous dictionary to store the metadata of a dataset.
Definition RMetaData.hxx:50
void Add(const std::string &key, int val)
Add an RMetaData class instance.
Definition RMetaData.cxx:42

The RMetaData object is passed to an RSample object which represents a single dataset sample.

A dataframe built with the RMetaData object can be accessed with the ROOT::RDF::RInterface< Proxied, DS_t>::DefinePerSample "DefinePerSample()" method.

Definition at line 50 of file RMetaData.hxx.

Public Member Functions

 RMetaData ()
 
 RMetaData (RMetaData &&)
 
 RMetaData (RMetaData const &)
 
 ~RMetaData ()
 
void Add (const std::string &key, const std::string &val)
 Add an RMetaData class instance.
 
void Add (const std::string &key, double val)
 Add an RMetaData class instance.
 
void Add (const std::string &key, int val)
 Add an RMetaData class instance.
 
std::string Dump (const std::string &key) const
 Dump the value of the metadata value given the key.
 
double GetD (const std::string &key) const
 Return the metadata value of type double given the key, or an error if the metadata value is of a non-double type.
 
double GetD (const std::string &key, double defaultVal) const
 Return the metadata value of type int given the key, a default int metadata value if the key is not found, or an error if the metadata value is of a non-double type.
 
int GetI (const std::string &key) const
 Return the metadata value of type int given the key, or an error if the metadata value is of a non-int type.
 
int GetI (const std::string &key, int defaultVal) const
 Return the metadata value of type int given the key, a default int metadata value if the key is not found, or an error if the metadata value is of a non-int type.
 
std::string GetS (const std::string &key) const
 Return the metadata value of type string given the key, or an error if the metadata value is of a non-string type.
 
const std::string GetS (const std::string &key, const std::string &defaultVal) const
 Return the metadata value of type int given the key, a default int metadata value if the key is not found, or an error if the metadata value is of a non-string type.
 
RMetaDataoperator= (RMetaData &&)
 
RMetaDataoperator= (RMetaData const &)
 

Private Attributes

std::unique_ptr< Internal::RDF::RMetaDataJsonfJson
 

#include <ROOT/RDF/RMetaData.hxx>

Constructor & Destructor Documentation

◆ RMetaData() [1/3]

ROOT::RDF::Experimental::RMetaData::RMetaData ( )

Definition at line 23 of file RMetaData.cxx.

◆ RMetaData() [2/3]

ROOT::RDF::Experimental::RMetaData::RMetaData ( RMetaData const &  other)

Definition at line 25 of file RMetaData.cxx.

◆ RMetaData() [3/3]

ROOT::RDF::Experimental::RMetaData::RMetaData ( RMetaData &&  )
default

◆ ~RMetaData()

ROOT::RDF::Experimental::RMetaData::~RMetaData ( )
default

Member Function Documentation

◆ Add() [1/3]

void ROOT::RDF::Experimental::RMetaData::Add ( const std::string &  key,
const std::string &  val 
)

Add an RMetaData class instance.

Parameters
[in]keyinput key for a given RMetaData instance.
[in]valmetadata value for of type string.

Definition at line 58 of file RMetaData.cxx.

◆ Add() [2/3]

void ROOT::RDF::Experimental::RMetaData::Add ( const std::string &  key,
double  val 
)

Add an RMetaData class instance.

Parameters
[in]keyinput key for a given RMetaData instance.
[in]valmetadata value for a given RMetaData instance of type double.

Definition at line 50 of file RMetaData.cxx.

◆ Add() [3/3]

void ROOT::RDF::Experimental::RMetaData::Add ( const std::string &  key,
int  val 
)

Add an RMetaData class instance.

Parameters
[in]keyinput key for a given RMetaData instance.
[in]valvalue for a given RMetaData instance of type int.

Definition at line 42 of file RMetaData.cxx.

◆ Dump()

std::string ROOT::RDF::Experimental::RMetaData::Dump ( const std::string &  key) const

Dump the value of the metadata value given the key.

Parameters
[in]keyinput key for a given RMetaData instance.
Returns
metadata value (as a string) associated with the input key, irrelevant of the actual type of the metadata value.

Definition at line 67 of file RMetaData.cxx.

◆ GetD() [1/2]

double ROOT::RDF::Experimental::RMetaData::GetD ( const std::string &  key) const

Return the metadata value of type double given the key, or an error if the metadata value is of a non-double type.

Parameters
[in]keyinput key for a given RMetaData instance.

Definition at line 84 of file RMetaData.cxx.

◆ GetD() [2/2]

double ROOT::RDF::Experimental::RMetaData::GetD ( const std::string &  key,
double  defaultVal 
) const

Return the metadata value of type int given the key, a default int metadata value if the key is not found, or an error if the metadata value is of a non-double type.

Parameters
[in]keyinput key for a given RMetaData instance.
[in]defaultValmetadata value of type double which is read as default while a given key cannot be found in the dataset.

Definition at line 122 of file RMetaData.cxx.

◆ GetI() [1/2]

int ROOT::RDF::Experimental::RMetaData::GetI ( const std::string &  key) const

Return the metadata value of type int given the key, or an error if the metadata value is of a non-int type.

Parameters
[in]keyinput key for a given RMetaData instance.

Definition at line 73 of file RMetaData.cxx.

◆ GetI() [2/2]

int ROOT::RDF::Experimental::RMetaData::GetI ( const std::string &  key,
int  defaultVal 
) const

Return the metadata value of type int given the key, a default int metadata value if the key is not found, or an error if the metadata value is of a non-int type.

Parameters
[in]keyinput key for a given RMetaData instance.
[in]defaultValmetadata value of type int which is read as default while a given key cannot be found in the dataset.

Definition at line 109 of file RMetaData.cxx.

◆ GetS() [1/2]

std::string ROOT::RDF::Experimental::RMetaData::GetS ( const std::string &  key) const

Return the metadata value of type string given the key, or an error if the metadata value is of a non-string type.

Parameters
[in]keyinput key for a given RMetaData instance.

Definition at line 96 of file RMetaData.cxx.

◆ GetS() [2/2]

const std::string ROOT::RDF::Experimental::RMetaData::GetS ( const std::string &  key,
const std::string &  defaultVal 
) const

Return the metadata value of type int given the key, a default int metadata value if the key is not found, or an error if the metadata value is of a non-string type.

Parameters
[in]keyinput key for a given RMetaData instance.
[in]defaultValmetadata value of type string which is read as default while a given key cannot be found in the dataset.

Definition at line 136 of file RMetaData.cxx.

◆ operator=() [1/2]

RMetaData & ROOT::RDF::Experimental::RMetaData::operator= ( RMetaData &&  )
default

◆ operator=() [2/2]

RMetaData & ROOT::RDF::Experimental::RMetaData::operator= ( RMetaData const &  other)

Definition at line 29 of file RMetaData.cxx.

Member Data Documentation

◆ fJson

std::unique_ptr<Internal::RDF::RMetaDataJson> ROOT::RDF::Experimental::RMetaData::fJson
private

Definition at line 75 of file RMetaData.hxx.

Libraries for ROOT::RDF::Experimental::RMetaData:

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