Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
ROOT::Detail::RDF::RDefaultValueFor< T > Class Template Referencefinal

template<typename T>
class ROOT::Detail::RDF::RDefaultValueFor< T >

The implementation of the DefaultValueFor transformation.

The class takes in the default value provided by the user to fill-in missing values of the input column. During the Update step, the class checks for the presence of the value of the column at the current event. If that value is missing, it will return the default value to requesting nodes of the graph.

Definition at line 45 of file RDefaultValueFor.hxx.

Public Member Functions

 RDefaultValueFor (const RDefaultValueFor &)=delete
 RDefaultValueFor (RDefaultValueFor &&)=delete
 RDefaultValueFor (std::string_view name, std::string_view type, const T &defaultValue, const ROOT::RDF::ColumnNames_t &columns, const RDFInternal::RColumnRegister &colRegister, RLoopManager &lm, const std::string &variationName="nominal")
 ~RDefaultValueFor ()
void FinalizeSlot (unsigned int slot) final
 Clean-up operations to be performed at the end of a task.
std::string GetName () const
const std::type_info & GetTypeId () const final
std::string GetTypeName () const
void * GetValuePtr (unsigned int slot) final
 Return the (type-erased) address of the Define'd value for the given processing slot.
const std::vector< std::string > & GetVariations () const
RDefineBaseGetVariedDefine (const std::string &variationName) final
 Return a clone of this Define that works with values in the variationName "universe".
void InitSlot (TTreeReader *r, unsigned int slot) final
void MakeVariations (const std::vector< std::string > &variations) final
 Create clones of this Define that work with values in varied "universes".
RDefaultValueForoperator= (const RDefaultValueFor &)=delete
RDefaultValueForoperator= (RDefaultValueFor &&)=delete
void Update (unsigned int slot, Long64_t entry) final
 Update the value at the address returned by GetValuePtr with the content corresponding to the given entry.
void Update (unsigned int, const ROOT::RDF::RSampleInfo &) final
 Update function to be called once per sample, used if the derived type is a RDefinePerSample.

Protected Attributes

RDFInternal::RColumnRegister fColRegister
const ROOT::RDF::ColumnNames_t fColumnNames
ROOT::RVecB fIsDefine
 The nth flag signals whether the nth input column is a custom column or not.
std::vector< Long64_tfLastCheckedEntry
RLoopManagerfLoopManager
const std::string fName
 The name of the custom column.
const std::string fType
 The type of the custom column as a text string.
std::string fVariation
 This indicates for what variation this define evaluates values.
std::vector< std::string > fVariationDeps
 List of systematic variations that affect the value of this define.

Private Types

using ColumnTypes_t = ROOT::TypeTraits::TypeList<T>
using TypeInd_t = std::make_index_sequence<ColumnTypes_t::list_size>
using ValuesPerSlot_t = std::conditional_t<std::is_same<T, bool>::value, std::deque<T>, std::vector<T>>

Private Member Functions

T & GetValueOrDefault (unsigned int slot, Long64_t entry)

Private Attributes

fDefaultValue
ValuesPerSlot_t fLastResults
std::vector< RColumnReaderBase * > fValues
std::unordered_map< std::string, std::unique_ptr< RDefineBase > > fVariedDefines
 Define objects corresponding to systematic variations other than nominal for this defined column.

#include <ROOT/RDF/RDefaultValueFor.hxx>

Inheritance diagram for ROOT::Detail::RDF::RDefaultValueFor< T >:
ROOT::Detail::RDF::RDefineBase

Member Typedef Documentation

◆ ColumnTypes_t

template<typename T>
using ROOT::Detail::RDF::RDefaultValueFor< T >::ColumnTypes_t = ROOT::TypeTraits::TypeList<T>
private

Definition at line 46 of file RDefaultValueFor.hxx.

◆ TypeInd_t

template<typename T>
using ROOT::Detail::RDF::RDefaultValueFor< T >::TypeInd_t = std::make_index_sequence<ColumnTypes_t::list_size>
private

Definition at line 47 of file RDefaultValueFor.hxx.

◆ ValuesPerSlot_t

template<typename T>
using ROOT::Detail::RDF::RDefaultValueFor< T >::ValuesPerSlot_t = std::conditional_t<std::is_same<T, bool>::value, std::deque<T>, std::vector<T>>
private

Definition at line 49 of file RDefaultValueFor.hxx.

Constructor & Destructor Documentation

◆ RDefaultValueFor() [1/3]

template<typename T>
ROOT::Detail::RDF::RDefaultValueFor< T >::RDefaultValueFor ( std::string_view name,
std::string_view type,
const T & defaultValue,
const ROOT::RDF::ColumnNames_t & columns,
const RDFInternal::RColumnRegister & colRegister,
RLoopManager & lm,
const std::string & variationName = "nominal" )
inline

Definition at line 69 of file RDefaultValueFor.hxx.

◆ RDefaultValueFor() [2/3]

template<typename T>
ROOT::Detail::RDF::RDefaultValueFor< T >::RDefaultValueFor ( const RDefaultValueFor< T > & )
delete

◆ RDefaultValueFor() [3/3]

template<typename T>
ROOT::Detail::RDF::RDefaultValueFor< T >::RDefaultValueFor ( RDefaultValueFor< T > && )
delete

◆ ~RDefaultValueFor()

template<typename T>
ROOT::Detail::RDF::RDefaultValueFor< T >::~RDefaultValueFor ( )
inline

Definition at line 86 of file RDefaultValueFor.hxx.

Member Function Documentation

◆ FinalizeSlot()

template<typename T>
void ROOT::Detail::RDF::RDefaultValueFor< T >::FinalizeSlot ( unsigned int slot)
inlinefinalvirtual

Clean-up operations to be performed at the end of a task.

Implements ROOT::Detail::RDF::RDefineBase.

Definition at line 121 of file RDefaultValueFor.hxx.

◆ GetName()

std::string RDefineBase::GetName ( ) const
inherited

Definition at line 42 of file RDefineBase.cxx.

◆ GetTypeId()

template<typename T>
const std::type_info & ROOT::Detail::RDF::RDefaultValueFor< T >::GetTypeId ( ) const
inlinefinalvirtual

Implements ROOT::Detail::RDF::RDefineBase.

Definition at line 118 of file RDefaultValueFor.hxx.

◆ GetTypeName()

std::string RDefineBase::GetTypeName ( ) const
inherited

Definition at line 47 of file RDefineBase.cxx.

◆ GetValueOrDefault()

template<typename T>
T & ROOT::Detail::RDF::RDefaultValueFor< T >::GetValueOrDefault ( unsigned int slot,
Long64_t entry )
inlineprivate

Definition at line 60 of file RDefaultValueFor.hxx.

◆ GetValuePtr()

template<typename T>
void * ROOT::Detail::RDF::RDefaultValueFor< T >::GetValuePtr ( unsigned int slot)
inlinefinalvirtual

Return the (type-erased) address of the Define'd value for the given processing slot.

Implements ROOT::Detail::RDF::RDefineBase.

Definition at line 101 of file RDefaultValueFor.hxx.

◆ GetVariations()

const std::vector< std::string > & ROOT::Detail::RDF::RDefineBase::GetVariations ( ) const
inlineinherited

Definition at line 72 of file RDefineBase.hxx.

◆ GetVariedDefine()

template<typename T>
RDefineBase & ROOT::Detail::RDF::RDefaultValueFor< T >::GetVariedDefine ( const std::string & variationName)
inlinefinalvirtual

Return a clone of this Define that works with values in the variationName "universe".

Implements ROOT::Detail::RDF::RDefineBase.

Definition at line 149 of file RDefaultValueFor.hxx.

◆ InitSlot()

template<typename T>
void ROOT::Detail::RDF::RDefaultValueFor< T >::InitSlot ( TTreeReader * r,
unsigned int slot )
inlinefinalvirtual

Implements ROOT::Detail::RDF::RDefineBase.

Definition at line 92 of file RDefaultValueFor.hxx.

◆ MakeVariations()

template<typename T>
void ROOT::Detail::RDF::RDefaultValueFor< T >::MakeVariations ( const std::vector< std::string > & variations)
inlinefinalvirtual

Create clones of this Define that work with values in varied "universes".

Implements ROOT::Detail::RDF::RDefineBase.

Definition at line 130 of file RDefaultValueFor.hxx.

◆ operator=() [1/2]

template<typename T>
RDefaultValueFor & ROOT::Detail::RDF::RDefaultValueFor< T >::operator= ( const RDefaultValueFor< T > & )
delete

◆ operator=() [2/2]

template<typename T>
RDefaultValueFor & ROOT::Detail::RDF::RDefaultValueFor< T >::operator= ( RDefaultValueFor< T > && )
delete

◆ Update() [1/2]

template<typename T>
void ROOT::Detail::RDF::RDefaultValueFor< T >::Update ( unsigned int slot,
Long64_t entry )
inlinefinalvirtual

Update the value at the address returned by GetValuePtr with the content corresponding to the given entry.

Implements ROOT::Detail::RDF::RDefineBase.

Definition at line 107 of file RDefaultValueFor.hxx.

◆ Update() [2/2]

template<typename T>
void ROOT::Detail::RDF::RDefaultValueFor< T >::Update ( unsigned int ,
const ROOT::RDF::RSampleInfo &  )
inlinefinalvirtual

Update function to be called once per sample, used if the derived type is a RDefinePerSample.

Reimplemented from ROOT::Detail::RDF::RDefineBase.

Definition at line 116 of file RDefaultValueFor.hxx.

Member Data Documentation

◆ fColRegister

RDFInternal::RColumnRegister ROOT::Detail::RDF::RDefineBase::fColRegister
protectedinherited

Definition at line 44 of file RDefineBase.hxx.

◆ fColumnNames

const ROOT::RDF::ColumnNames_t ROOT::Detail::RDF::RDefineBase::fColumnNames
protectedinherited

Definition at line 46 of file RDefineBase.hxx.

◆ fDefaultValue

template<typename T>
T ROOT::Detail::RDF::RDefaultValueFor< T >::fDefaultValue
private

Definition at line 51 of file RDefaultValueFor.hxx.

◆ fIsDefine

ROOT::RVecB ROOT::Detail::RDF::RDefineBase::fIsDefine
protectedinherited

The nth flag signals whether the nth input column is a custom column or not.

Definition at line 48 of file RDefineBase.hxx.

◆ fLastCheckedEntry

std::vector<Long64_t> ROOT::Detail::RDF::RDefineBase::fLastCheckedEntry
protectedinherited

Definition at line 43 of file RDefineBase.hxx.

◆ fLastResults

template<typename T>
ValuesPerSlot_t ROOT::Detail::RDF::RDefaultValueFor< T >::fLastResults
private

Definition at line 52 of file RDefaultValueFor.hxx.

◆ fLoopManager

RLoopManager* ROOT::Detail::RDF::RDefineBase::fLoopManager
protectedinherited

Definition at line 45 of file RDefineBase.hxx.

◆ fName

const std::string ROOT::Detail::RDF::RDefineBase::fName
protectedinherited

The name of the custom column.

Definition at line 41 of file RDefineBase.hxx.

◆ fType

const std::string ROOT::Detail::RDF::RDefineBase::fType
protectedinherited

The type of the custom column as a text string.

Definition at line 42 of file RDefineBase.hxx.

◆ fValues

template<typename T>
std::vector<RColumnReaderBase *> ROOT::Detail::RDF::RDefaultValueFor< T >::fValues
private

Definition at line 54 of file RDefaultValueFor.hxx.

◆ fVariation

std::string ROOT::Detail::RDF::RDefineBase::fVariation
protectedinherited

This indicates for what variation this define evaluates values.

Definition at line 50 of file RDefineBase.hxx.

◆ fVariationDeps

std::vector<std::string> ROOT::Detail::RDF::RDefineBase::fVariationDeps
protectedinherited

List of systematic variations that affect the value of this define.

Definition at line 49 of file RDefineBase.hxx.

◆ fVariedDefines

template<typename T>
std::unordered_map<std::string, std::unique_ptr<RDefineBase> > ROOT::Detail::RDF::RDefaultValueFor< T >::fVariedDefines
private

Define objects corresponding to systematic variations other than nominal for this defined column.

The map key is the full variation name, e.g. "pt:up".

Definition at line 58 of file RDefaultValueFor.hxx.


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