Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
ROOT::Detail::RDF::RDefine< F, ExtraArgsTag > Class Template Referencefinal

template<typename F, typename ExtraArgsTag = ExtraArgsForDefine::None>
class ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >

Definition at line 46 of file RDefine.hxx.

Public Member Functions

 RDefine (const RDefine &)=delete
 
 RDefine (std::string_view name, std::string_view type, F expression, const ROOT::RDF::ColumnNames_t &columns, const RDFInternal::RColumnRegister &colRegister, RLoopManager &lm, const std::string &variationName="nominal")
 
 ~RDefine ()
 
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".
 
RDefineoperator= (const RDefine &)=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
 
using ColumnTypesTmp_t
 
using FunParamTypes_t = typename CallableTraits<F>::arg_types
 
using NoneTag = ExtraArgsForDefine::None
 
using ret_type = typename CallableTraits<F>::ret_type
 
using SlotAndEntryTag = ExtraArgsForDefine::SlotAndEntry
 
using SlotTag = ExtraArgsForDefine::Slot
 
using TypeInd_t = std::make_index_sequence<ColumnTypes_t::list_size>
 
using ValuesPerSlot_t
 

Private Member Functions

template<typename ColType >
auto GetValueChecked (unsigned int slot, std::size_t readerIdx, Long64_t entry) -> ColType &
 
template<typename... ColTypes, std::size_t... S>
void UpdateHelper (unsigned int slot, Long64_t entry, TypeList< ColTypes... >, std::index_sequence< S... >, NoneTag)
 
template<typename... ColTypes, std::size_t... S>
void UpdateHelper (unsigned int slot, Long64_t entry, TypeList< ColTypes... >, std::index_sequence< S... >, SlotAndEntryTag)
 
template<typename... ColTypes, std::size_t... S>
void UpdateHelper (unsigned int slot, Long64_t entry, TypeList< ColTypes... >, std::index_sequence< S... >, SlotTag)
 

Private Attributes

F fExpression
 
ValuesPerSlot_t fLastResults
 
std::vector< std::array< RColumnReaderBase *, ColumnTypes_t::list_size > > fValues
 Column readers per slot and per input column.
 
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/RDefine.hxx>

Inheritance diagram for ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >:
[legend]

Member Typedef Documentation

◆ ColumnTypes_t

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
using ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::ColumnTypes_t
private
Initial value:
RDFInternal::RemoveFirstParameterIf_t< std::is_same< ExtraArgsTag, SlotTag >::value, FunParamTypes_t > ColumnTypesTmp_t
Definition RDefine.hxx:53
typename RemoveFirstTwoParametersIf< MustRemove, TypeList >::type RemoveFirstTwoParametersIf_t
Definition Utils.hxx:165

Definition at line 55 of file RDefine.hxx.

◆ ColumnTypesTmp_t

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
using ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::ColumnTypesTmp_t
private
Initial value:
typename CallableTraits< F >::arg_types FunParamTypes_t
Definition RDefine.hxx:52
typename RemoveFirstParameterIf< MustRemove, TypeList >::type RemoveFirstParameterIf_t
Definition Utils.hxx:151

Definition at line 53 of file RDefine.hxx.

◆ FunParamTypes_t

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
using ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::FunParamTypes_t = typename CallableTraits<F>::arg_types
private

Definition at line 52 of file RDefine.hxx.

◆ NoneTag

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
using ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::NoneTag = ExtraArgsForDefine::None
private

Definition at line 48 of file RDefine.hxx.

◆ ret_type

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
using ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::ret_type = typename CallableTraits<F>::ret_type
private

Definition at line 58 of file RDefine.hxx.

◆ SlotAndEntryTag

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
using ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::SlotAndEntryTag = ExtraArgsForDefine::SlotAndEntry
private

Definition at line 50 of file RDefine.hxx.

◆ SlotTag

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
using ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::SlotTag = ExtraArgsForDefine::Slot
private

Definition at line 49 of file RDefine.hxx.

◆ TypeInd_t

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
using ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::TypeInd_t = std::make_index_sequence<ColumnTypes_t::list_size>
private

Definition at line 57 of file RDefine.hxx.

◆ ValuesPerSlot_t

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
using ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::ValuesPerSlot_t
private
Initial value:
std::conditional_t<std::is_same<ret_type, bool>::value, std::deque<ret_type>, std::vector<ret_type>>

Definition at line 60 of file RDefine.hxx.

Constructor & Destructor Documentation

◆ RDefine() [1/2]

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::RDefine ( std::string_view name,
std::string_view type,
F expression,
const ROOT::RDF::ColumnNames_t & columns,
const RDFInternal::RColumnRegister & colRegister,
RLoopManager & lm,
const std::string & variationName = "nominal" )
inline

Definition at line 110 of file RDefine.hxx.

◆ RDefine() [2/2]

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::RDefine ( const RDefine< F, ExtraArgsTag > & )
delete

◆ ~RDefine()

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::~RDefine ( )
inline

Definition at line 121 of file RDefine.hxx.

Member Function Documentation

◆ FinalizeSlot()

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
void ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::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 151 of file RDefine.hxx.

◆ GetTypeId()

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
const std::type_info & ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::GetTypeId ( ) const
inlinefinalvirtual

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

Definition at line 148 of file RDefine.hxx.

◆ GetValueChecked()

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
template<typename ColType >
auto ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::GetValueChecked ( unsigned int slot,
std::size_t readerIdx,
Long64_t entry ) -> ColType &
inlineprivate

Definition at line 74 of file RDefine.hxx.

◆ GetValuePtr()

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
void * ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::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 131 of file RDefine.hxx.

◆ GetVariedDefine()

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
RDefineBase & ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::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 180 of file RDefine.hxx.

◆ InitSlot()

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
void ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::InitSlot ( TTreeReader * r,
unsigned int slot )
inlinefinalvirtual

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

Definition at line 123 of file RDefine.hxx.

◆ MakeVariations()

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
void ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::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 160 of file RDefine.hxx.

◆ operator=()

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
RDefine & ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::operator= ( const RDefine< F, ExtraArgsTag > & )
delete

◆ Update() [1/2]

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
void ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::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 137 of file RDefine.hxx.

◆ Update() [2/2]

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
void ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::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 146 of file RDefine.hxx.

◆ UpdateHelper() [1/3]

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
template<typename... ColTypes, std::size_t... S>
void ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::UpdateHelper ( unsigned int slot,
Long64_t entry,
TypeList< ColTypes... > ,
std::index_sequence< S... > ,
NoneTag  )
inlineprivate

Definition at line 86 of file RDefine.hxx.

◆ UpdateHelper() [2/3]

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
template<typename... ColTypes, std::size_t... S>
void ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::UpdateHelper ( unsigned int slot,
Long64_t entry,
TypeList< ColTypes... > ,
std::index_sequence< S... > ,
SlotAndEntryTag  )
inlineprivate

Definition at line 103 of file RDefine.hxx.

◆ UpdateHelper() [3/3]

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
template<typename... ColTypes, std::size_t... S>
void ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::UpdateHelper ( unsigned int slot,
Long64_t entry,
TypeList< ColTypes... > ,
std::index_sequence< S... > ,
SlotTag  )
inlineprivate

Definition at line 94 of file RDefine.hxx.

Member Data Documentation

◆ fExpression

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
F ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::fExpression
private

Definition at line 63 of file RDefine.hxx.

◆ fLastResults

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
ValuesPerSlot_t ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::fLastResults
private

Definition at line 64 of file RDefine.hxx.

◆ fValues

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
std::vector<std::array<RColumnReaderBase *, ColumnTypes_t::list_size> > ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::fValues
private

Column readers per slot and per input column.

Definition at line 67 of file RDefine.hxx.

◆ fVariedDefines

template<typename F , typename ExtraArgsTag = ExtraArgsForDefine::None>
std::unordered_map<std::string, std::unique_ptr<RDefineBase> > ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::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 71 of file RDefine.hxx.

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