Logo ROOT  
Reference Guide
ROOT::Detail::RDF::RDefine< F, ExtraArgsTag > Class Template Referencefinal

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

Definition at line 45 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, unsigned int nSlots, const RDFInternal::RBookedDefines &defines, const std::map< std::string, std::vector< void * > > &DSValuePtrs, ROOT::RDF::RDataSource *ds)
 
void FinaliseSlot (unsigned int slot) final
 Clean-up operations to be performed at the end of a task. More...
 
const std::type_info & GetTypeId () const
 
voidGetValuePtr (unsigned int slot) final
 Return the (type-erased) address of the Define'd value for the given processing slot. More...
 
void InitSlot (TTreeReader *r, unsigned int slot) final
 
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. More...
 
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. More...
 
- Public Member Functions inherited from ROOT::Detail::RDF::RDefineBase
 RDefineBase (std::string_view name, std::string_view type, unsigned int nSlots, const RDFInternal::RBookedDefines &defines, const std::map< std::string, std::vector< void * > > &DSValuePtrs, ROOT::RDF::RDataSource *ds, const ColumnNames_t &columnNames)
 
virtual ~RDefineBase ()
 
virtual void FinaliseSlot (unsigned int slot)=0
 Clean-up operations to be performed at the end of a task. More...
 
std::string GetName () const
 
virtual const std::type_info & GetTypeId () const =0
 
std::string GetTypeName () const
 
virtual voidGetValuePtr (unsigned int slot)=0
 Return the (type-erased) address of the Define'd value for the given processing slot. More...
 
virtual void InitSlot (TTreeReader *r, unsigned int slot)=0
 
RDefineBaseoperator= (const RDefineBase &)=delete
 
RDefineBaseoperator= (RDefineBase &&)=delete
 
virtual void Update (unsigned int slot, Long64_t entry)=0
 Update the value at the address returned by GetValuePtr with the content corresponding to the given entry. More...
 
virtual void Update (unsigned int, const ROOT::RDF::RSampleInfo &)
 Update function to be called once per sample, used if the derived type is a RDefinePerSample. More...
 

Private Types

using ColumnTypes_t = RDFInternal::RemoveFirstTwoParametersIf_t< std::is_same< ExtraArgsTag, SlotAndEntryTag >::value, ColumnTypesTmp_t >
 
using ColumnTypesTmp_t = RDFInternal::RemoveFirstParameterIf_t< std::is_same< ExtraArgsTag, SlotTag >::value, FunParamTypes_t >
 
using FunParamTypes_t = typename CallableTraits< F >::arg_types
 
using NoneTag = CustomColExtraArgs::None
 
using ret_type = typename CallableTraits< F >::ret_type
 
using SlotAndEntryTag = CustomColExtraArgs::SlotAndEntry
 
using SlotTag = CustomColExtraArgs::Slot
 
using TypeInd_t = std::make_index_sequence< ColumnTypes_t::list_size >
 
using ValuesPerSlot_t = std::conditional_t< std::is_same< ret_type, bool >::value, std::deque< ret_type >, std::vector< ret_type > >
 

Private Member Functions

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< std::unique_ptr< RColumnReaderBase >, ColumnTypes_t::list_size > > fValues
 Column readers per slot and per input column. More...
 

Additional Inherited Members

- Protected Attributes inherited from ROOT::Detail::RDF::RDefineBase
const ROOT::RDF::ColumnNames_t fColumnNames
 
ROOT::RDF::RDataSourcefDataSource
 non-owning ptr to the RDataSource, if any. Used to retrieve column readers. More...
 
RDFInternal::RBookedDefines fDefines
 
const std::map< std::string, std::vector< void * > > & fDSValuePtrs
 
ROOT::RVecB fIsDefine
 The nth flag signals whether the nth input column is a custom column or not. More...
 
std::deque< bool > fIsInitialized
 
std::vector< Long64_tfLastCheckedEntry
 
const std::string fName
 The name of the custom column. More...
 
const std::string fType
 The type of the custom column as a text string. More...
 

#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 = CustomColExtraArgs::None>
using ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::ColumnTypes_t = RDFInternal::RemoveFirstTwoParametersIf_t<std::is_same<ExtraArgsTag, SlotAndEntryTag>::value, ColumnTypesTmp_t>
private

Definition at line 54 of file RDefine.hxx.

◆ ColumnTypesTmp_t

template<typename F , typename ExtraArgsTag = CustomColExtraArgs::None>
using ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::ColumnTypesTmp_t = RDFInternal::RemoveFirstParameterIf_t<std::is_same<ExtraArgsTag, SlotTag>::value, FunParamTypes_t>
private

Definition at line 52 of file RDefine.hxx.

◆ FunParamTypes_t

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

Definition at line 51 of file RDefine.hxx.

◆ NoneTag

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

Definition at line 47 of file RDefine.hxx.

◆ ret_type

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

Definition at line 57 of file RDefine.hxx.

◆ SlotAndEntryTag

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

Definition at line 49 of file RDefine.hxx.

◆ SlotTag

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

Definition at line 48 of file RDefine.hxx.

◆ TypeInd_t

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

Definition at line 56 of file RDefine.hxx.

◆ ValuesPerSlot_t

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

Definition at line 59 of file RDefine.hxx.

Constructor & Destructor Documentation

◆ RDefine() [1/2]

template<typename F , typename ExtraArgsTag = CustomColExtraArgs::None>
ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::RDefine ( std::string_view  name,
std::string_view  type,
F  expression,
const ROOT::RDF::ColumnNames_t columns,
unsigned int  nSlots,
const RDFInternal::RBookedDefines defines,
const std::map< std::string, std::vector< void * > > &  DSValuePtrs,
ROOT::RDF::RDataSource ds 
)
inline

Definition at line 100 of file RDefine.hxx.

◆ RDefine() [2/2]

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

Member Function Documentation

◆ FinaliseSlot()

template<typename F , typename ExtraArgsTag = CustomColExtraArgs::None>
void ROOT::Detail::RDF::RDefine< F, ExtraArgsTag >::FinaliseSlot ( unsigned int  slot)
inlinefinalvirtual

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

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

Definition at line 144 of file RDefine.hxx.

◆ GetTypeId()

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

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

Definition at line 141 of file RDefine.hxx.

◆ GetValuePtr()

template<typename F , typename ExtraArgsTag = CustomColExtraArgs::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 124 of file RDefine.hxx.

◆ InitSlot()

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

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

Definition at line 111 of file RDefine.hxx.

◆ operator=()

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

◆ Update() [1/2]

template<typename F , typename ExtraArgsTag = CustomColExtraArgs::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 130 of file RDefine.hxx.

◆ Update() [2/2]

template<typename F , typename ExtraArgsTag = CustomColExtraArgs::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 139 of file RDefine.hxx.

◆ UpdateHelper() [1/3]

template<typename F , typename ExtraArgsTag = CustomColExtraArgs::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 69 of file RDefine.hxx.

◆ UpdateHelper() [2/3]

template<typename F , typename ExtraArgsTag = CustomColExtraArgs::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 90 of file RDefine.hxx.

◆ UpdateHelper() [3/3]

template<typename F , typename ExtraArgsTag = CustomColExtraArgs::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 79 of file RDefine.hxx.

Member Data Documentation

◆ fExpression

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

Definition at line 62 of file RDefine.hxx.

◆ fLastResults

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

Definition at line 63 of file RDefine.hxx.

◆ fValues

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

Column readers per slot and per input column.

Definition at line 66 of file RDefine.hxx.


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