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.
 
const std::type_info & GetTypeId () const final
 
void * GetValuePtr (unsigned int slot) final
 Return the (type-erased) address of the Define'd value for the given processing slot.
 
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.
 
- Public Member Functions inherited from ROOT::Detail::RDF::RDefineBase
 RDefineBase (std::string_view name, std::string_view type, const RDFInternal::RColumnRegister &colRegister, RLoopManager &lm, const ColumnNames_t &columnNames, const std::string &variationName="nominal")
 
virtual ~RDefineBase ()
 
std::string GetName () const
 
std::string GetTypeName () const
 
const std::vector< std::string > & GetVariations () const
 
RDefineBaseoperator= (const RDefineBase &)=delete
 
RDefineBaseoperator= (RDefineBase &&)=delete
 

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.
 

Additional Inherited Members

- Protected Attributes inherited from ROOT::Detail::RDF::RDefineBase
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.
 

#include <ROOT/RDF/RDefaultValueFor.hxx>

Inheritance diagram for ROOT::Detail::RDF::RDefaultValueFor< T >:
[legend]

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 120 of file RDefaultValueFor.hxx.

◆ GetTypeId()

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

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

Definition at line 117 of file RDefaultValueFor.hxx.

◆ 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 100 of file RDefaultValueFor.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 148 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 129 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 106 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 115 of file RDefaultValueFor.hxx.

Member Data Documentation

◆ fDefaultValue

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

Definition at line 51 of file RDefaultValueFor.hxx.

◆ fLastResults

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

Definition at line 52 of file RDefaultValueFor.hxx.

◆ fValues

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

Definition at line 54 of file RDefaultValueFor.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.

  • tree/dataframe/inc/ROOT/RDF/RDefaultValueFor.hxx