ROOT 6.12/07 Reference Guide |
Helper class that updates and returns TTree branches as well as TDataFrame temporary columns.
T | The type of the column |
TDataFrame 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.
TDataFrame nodes can store tuples of TColumnValues and retrieve an updated value for the column via the Get
method.
Definition at line 232 of file TDFNodes.hxx.
Public Member Functions | |
TColumnValue ()=default | |
template<typename U = T, typename std::enable_if< std::is_same< typename TColumnValue< U >::ProxyParam_t, U >::value, 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 TArrayBranch) More... | |
template<typename U = T, typename std::enable_if<!std::is_same< ProxyParam_t, U >::value, int >::type = 0> | |
TArrayBranch< ProxyParam_t > | Get (Long64_t) |
This overload is used to return arrays (i.e. types that are read into a TArrayBranch) More... | |
void | MakeProxy (TTreeReader *r, const std::string &bn) |
void | Reset () |
void | SetTmpColumn (unsigned int slot, TCustomColumnBase *tmpColumn) |
Private Types | |
enum | EColumnKind { EColumnKind::kTreeValue, EColumnKind::kTreeArray, EColumnKind::kCustomColumn, EColumnKind::kDataSource, EColumnKind::kInvalid } |
TColumnValue has a slightly different behaviour whether the column comes from a TTreeReader, a TDataFrame Define or a TDataSource. More... | |
using | ProxyParam_t = typename std::conditional< std::is_same< ReaderValueOrArray_t< T >, TTreeReaderValue< T > >::value, T, TakeFirstParameter_t< T > >::type |
Private Attributes | |
bool | fArrayHasBeenChecked = false |
Signal whether we ever checked that the branch we are reading with a TTreeReaderArray stores array elements in contiguous memory. More... | |
EColumnKind | fColumnKind = EColumnKind::kInvalid |
std::vector< TCustomColumnBase * > | 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... | |
std::vector< std::unique_ptr< TTreeReaderArray< ProxyParam_t > > > | fReaderArrays |
Owning ptrs to a TTreeReaderArray. Used for non-temporary columns when T == TArrayBranch<U>. More... | |
std::vector< std::unique_ptr< TTreeReaderValue< T > > > | fReaderValues |
Owning ptrs to a TTreeReaderValue. Used for non-temporary columns when T != TArrayBranch<U> 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... | |
#include <ROOT/TDFNodes.hxx>
|
private |
Definition at line 236 of file TDFNodes.hxx.
|
strongprivate |
TColumnValue has a slightly different behaviour whether the column comes from a TTreeReader, a TDataFrame Define or a TDataSource.
It stores which it is as an enum.
Enumerator | |
---|---|
kTreeValue | |
kTreeArray | |
kCustomColumn | |
kDataSource | |
kInvalid |
Definition at line 240 of file TDFNodes.hxx.
|
default |
T & ROOT::Internal::TDF::TColumnValue< T >::Get | ( | Long64_t | entry | ) |
This overload is used to return scalar quantities (i.e. types that are not read into a TArrayBranch)
Definition at line 835 of file TDFNodes.hxx.
|
inline |
This overload is used to return arrays (i.e. types that are read into a TArrayBranch)
Definition at line 288 of file TDFNodes.hxx.
|
inline |
Definition at line 269 of file TDFNodes.hxx.
|
inline |
Definition at line 312 of file TDFNodes.hxx.
void ROOT::Internal::TDF::TColumnValue< T >::SetTmpColumn | ( | unsigned int | slot, |
TCustomColumnBase * | tmpColumn | ||
) |
Definition at line 810 of file TDFNodes.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 == TArrayBranch<U>.
Definition at line 262 of file TDFNodes.hxx.
|
private |
Definition at line 242 of file TDFNodes.hxx.
|
private |
Non-owning ptrs to the node responsible for the custom column. Needed when querying custom values.
Definition at line 259 of file TDFNodes.hxx.
|
private |
Non-owning ptrs to the value of a custom column.
Definition at line 255 of file TDFNodes.hxx.
|
private |
Non-owning ptrs to the value of a data-source column.
Definition at line 257 of file TDFNodes.hxx.
|
private |
Owning ptrs to a TTreeReaderArray. Used for non-temporary columns when T == TArrayBranch<U>.
Definition at line 253 of file TDFNodes.hxx.
|
private |
Owning ptrs to a TTreeReaderValue. Used for non-temporary columns when T != TArrayBranch<U>
Definition at line 251 of file TDFNodes.hxx.
|
private |
The slot this value belongs to. Only needed when querying custom column values, it is set in SetTmpColumn
.
Definition at line 244 of file TDFNodes.hxx.