ROOT 6.14/05 Reference Guide |
Helper class that updates and returns TTree branches as well as RDataFrame temporary columns.
T | The type of the column |
RDataFrame nodes must access two different types of values during the event loop: values of real branches, for which TTreeReader{Values,Arrays} act as proxies, or temporary columns whose values are generated on the fly. While the type of the value is known at compile time (or just-in-time), it is only at runtime that nodes can check whether a certain value is generated on the fly or not.
TColumnValue abstracts this difference by providing the same interface for both cases and handling the reading or generation of new values transparently. Only one of the two data members fReaderProxy or fValuePtr will be non-null for a given TColumnValue, depending on whether the value comes from a real TTree branch or from a temporary column respectively.
RDataFrame nodes can store tuples of TColumnValues and retrieve an updated value for the column via the Get
method.
Definition at line 243 of file RDFNodes.hxx.
Public Member Functions | |
TColumnValue ()=default | |
template<typename U = T, typename std::enable_if<!TColumnValue< U >::fgMustUseRVec, int >::type = 0> | |
T & | Get (Long64_t entry) |
This overload is used to return scalar quantities (i.e. types that are not read into a RVec) More... | |
template<typename U = T, typename std::enable_if< TColumnValue< U >::fgMustUseRVec, int >::type = 0> | |
T & | Get (Long64_t entry) |
This overload is used to return arrays (i.e. More... | |
void | MakeProxy (TTreeReader *r, const std::string &bn) |
void | Reset () |
void | SetTmpColumn (unsigned int slot, RCustomColumnBase *tmpColumn) |
Static Public Attributes | |
static constexpr bool | fgMustUseRVec = MustUseRVec |
Private Types | |
using | ColumnValue_t = typename std::conditional< MustUseRVec, TakeFirstParameter_t< T >, T >::type |
enum | EColumnKind { EColumnKind::kTree, EColumnKind::kCustomColumn, EColumnKind::kDataSource, EColumnKind::kInvalid } |
TColumnValue has a slightly different behaviour whether the column comes from a TTreeReader, a RDataFrame Define or a RDataSource. More... | |
enum | EStorageType : char { EStorageType::kContiguous, EStorageType::kUnknown, EStorageType::kSparse } |
Enumerator for the different properties of the branch storage in memory. More... | |
using | TreeReader_t = typename std::conditional< MustUseRVec, TTreeReaderArray< ColumnValue_t >, TTreeReaderValue< ColumnValue_t > >::type |
Private Attributes | |
EColumnKind | fColumnKind = EColumnKind::kInvalid |
bool | fCopyWarningPrinted = false |
std::vector< RCustomColumnBase * > | fCustomColumns |
Non-owning ptrs to the node responsible for the custom column. Needed when querying custom values. More... | |
std::vector< T * > | fCustomValuePtrs |
Non-owning ptrs to the value of a custom column. More... | |
std::vector< T ** > | fDSValuePtrs |
Non-owning ptrs to the value of a data-source column. More... | |
RVec< ColumnValue_t > | fRVec |
If MustUseRVec, i.e. we are reading an array, we return a reference to this RVec to clients. More... | |
unsigned int | fSlot = std::numeric_limits<unsigned int>::max() |
The slot this value belongs to. Only needed when querying custom column values, it is set in SetTmpColumn . More... | |
EStorageType | fStorageType = EStorageType::kUnknown |
Signal whether we ever checked that the branch we are reading with a TTreeReaderArray stores array elements in contiguous memory. More... | |
std::vector< std::unique_ptr< TreeReader_t > > | fTreeReaders |
Owning ptrs to a TTreeReaderValue or TTreeReaderArray. Only used for Tree columns. More... | |
#include <ROOT/RDFNodes.hxx>
|
private |
Definition at line 245 of file RDFNodes.hxx.
|
private |
Definition at line 247 of file RDFNodes.hxx.
|
strongprivate |
TColumnValue has a slightly different behaviour whether the column comes from a TTreeReader, a RDataFrame Define or a RDataSource.
It stores which it is as an enum.
Enumerator | |
---|---|
kTree | |
kCustomColumn | |
kDataSource | |
kInvalid |
Definition at line 251 of file RDFNodes.hxx.
|
strongprivate |
Enumerator for the different properties of the branch storage in memory.
Enumerator | |
---|---|
kContiguous | |
kUnknown | |
kSparse |
Definition at line 270 of file RDFNodes.hxx.
|
default |
T & ROOT::Internal::RDF::TColumnValue< T, B >::Get | ( | Long64_t | entry | ) |
This overload is used to return scalar quantities (i.e. types that are not read into a RVec)
This overload is used to return arrays (i.e. types that are read into a RVec)
Definition at line 852 of file RDFNodes.hxx.
T& ROOT::Internal::RDF::TColumnValue< T, MustUseRVec >::Get | ( | Long64_t | entry | ) |
This overload is used to return arrays (i.e.
types that are read into a RVec). In this case the returned T is always a RVec<ColumnValue_t>.
|
inline |
Definition at line 285 of file RDFNodes.hxx.
|
inline |
Definition at line 300 of file RDFNodes.hxx.
void ROOT::Internal::RDF::TColumnValue< T, B >::SetTmpColumn | ( | unsigned int | slot, |
RCustomColumnBase * | tmpColumn | ||
) |
Definition at line 829 of file RDFNodes.hxx.
|
private |
Definition at line 253 of file RDFNodes.hxx.
|
private |
Definition at line 276 of file RDFNodes.hxx.
|
private |
Non-owning ptrs to the node responsible for the custom column. Needed when querying custom values.
Definition at line 268 of file RDFNodes.hxx.
|
private |
Non-owning ptrs to the value of a custom column.
Definition at line 264 of file RDFNodes.hxx.
|
private |
Non-owning ptrs to the value of a data-source column.
Definition at line 266 of file RDFNodes.hxx.
|
static |
Definition at line 279 of file RDFNodes.hxx.
|
private |
If MustUseRVec, i.e. we are reading an array, we return a reference to this RVec to clients.
Definition at line 275 of file RDFNodes.hxx.
|
private |
The slot this value belongs to. Only needed when querying custom column values, it is set in SetTmpColumn
.
Definition at line 255 of file RDFNodes.hxx.
|
private |
Signal whether we ever checked that the branch we are reading with a TTreeReaderArray stores array elements in contiguous memory.
Only used when T == RVec<U>.
Definition at line 273 of file RDFNodes.hxx.
|
private |
Owning ptrs to a TTreeReaderValue or TTreeReaderArray. Only used for Tree columns.
Definition at line 262 of file RDFNodes.hxx.