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:
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. | |
RMetaData & | operator= (RMetaData &&) |
RMetaData & | operator= (RMetaData const &) |
Private Attributes | |
std::unique_ptr< Internal::RDF::RMetaDataJson > | fJson |
#include <ROOT/RDF/RMetaData.hxx>
ROOT::RDF::Experimental::RMetaData::RMetaData | ( | ) |
Definition at line 23 of file RMetaData.cxx.
ROOT::RDF::Experimental::RMetaData::RMetaData | ( | RMetaData const & | other | ) |
Definition at line 25 of file RMetaData.cxx.
|
default |
|
default |
void ROOT::RDF::Experimental::RMetaData::Add | ( | const std::string & | key, |
const std::string & | val | ||
) |
Add an RMetaData class instance.
[in] | key | input key for a given RMetaData instance. |
[in] | val | metadata value for of type string. |
Definition at line 58 of file RMetaData.cxx.
void ROOT::RDF::Experimental::RMetaData::Add | ( | const std::string & | key, |
double | val | ||
) |
Add an RMetaData class instance.
[in] | key | input key for a given RMetaData instance. |
[in] | val | metadata value for a given RMetaData instance of type double. |
Definition at line 50 of file RMetaData.cxx.
void ROOT::RDF::Experimental::RMetaData::Add | ( | const std::string & | key, |
int | val | ||
) |
Add an RMetaData class instance.
[in] | key | input key for a given RMetaData instance. |
[in] | val | value for a given RMetaData instance of type int. |
Definition at line 42 of file RMetaData.cxx.
std::string ROOT::RDF::Experimental::RMetaData::Dump | ( | const std::string & | key | ) | const |
Dump the value of the metadata value given the key.
[in] | key | input key for a given RMetaData instance. |
Definition at line 67 of file RMetaData.cxx.
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.
[in] | key | input key for a given RMetaData instance. |
Definition at line 84 of file RMetaData.cxx.
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.
[in] | key | input key for a given RMetaData instance. |
[in] | defaultVal | metadata 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.
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.
[in] | key | input key for a given RMetaData instance. |
Definition at line 73 of file RMetaData.cxx.
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.
[in] | key | input key for a given RMetaData instance. |
[in] | defaultVal | metadata 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.
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.
[in] | key | input key for a given RMetaData instance. |
Definition at line 96 of file RMetaData.cxx.
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.
[in] | key | input key for a given RMetaData instance. |
[in] | defaultVal | metadata 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.
Definition at line 29 of file RMetaData.cxx.
|
private |
Definition at line 75 of file RMetaData.hxx.