Logo ROOT   6.12/07
Reference Guide
Classes | Typedefs | Functions
ROOT::Internal::TDF Namespace Reference

Classes

class  CacheColumnHolder
 
class  TAction
 
class  TActionBase
 
class  TColumnValue
 Helper class that updates and returns TTree branches as well as TDataFrame temporary columns. More...
 
struct  TMinReturnType
 The contained type alias is double if T == TInferType, U if T == std::container<U>, T otherwise. More...
 
struct  TMinReturnType< T, true >
 
struct  TMinReturnType< TDFDetail::TInferType, false >
 
class  TSlotStack
 
struct  TTDFValueTuple
 
struct  TTDFValueTuple< TypeList< BranchTypes... > >
 

Typedefs

template<typename BranchType >
using TDFValueTuple_t = typename TTDFValueTuple< BranchType >::type
 
using TmpBranchBasePtr_t = std::shared_ptr< TCustomColumnBase >
 

Functions

bool AtLeastOneEmptyString (const std::vector< std::string_view > strings)
 
template<typename... BranchTypes, typename ActionType , typename ActionResultType , typename PrevNodeType >
TActionBaseBuildAndBook (const ColumnNames_t &bl, const std::shared_ptr< ActionResultType > &h, const unsigned int nSlots, TLoopManager &loopManager, PrevNodeType &prevNode, ActionType *)
 
template<typename... BranchTypes, typename PrevNodeType >
TActionBaseBuildAndBook (const ColumnNames_t &bl, const std::shared_ptr<::TH1D > &h, const unsigned int nSlots, TLoopManager &loopManager, PrevNodeType &prevNode, ActionTypes::Histo1D *)
 
template<typename BranchType , typename PrevNodeType , typename ActionResultType >
TActionBaseBuildAndBook (const ColumnNames_t &bl, const std::shared_ptr< ActionResultType > &minV, const unsigned int nSlots, TLoopManager &loopManager, PrevNodeType &prevNode, ActionTypes::Min *)
 
template<typename BranchType , typename PrevNodeType , typename ActionResultType >
TActionBaseBuildAndBook (const ColumnNames_t &bl, const std::shared_ptr< ActionResultType > &maxV, const unsigned int nSlots, TLoopManager &loopManager, PrevNodeType &prevNode, ActionTypes::Max *)
 
template<typename BranchType , typename PrevNodeType , typename ActionResultType >
TActionBaseBuildAndBook (const ColumnNames_t &bl, const std::shared_ptr< ActionResultType > &sumV, const unsigned int nSlots, TLoopManager &loopManager, PrevNodeType &prevNode, ActionTypes::Sum *)
 
template<typename BranchType , typename PrevNodeType >
TActionBaseBuildAndBook (const ColumnNames_t &bl, const std::shared_ptr< double > &meanV, const unsigned int nSlots, TLoopManager &loopManager, PrevNodeType &prevNode, ActionTypes::Mean *)
 
template<typename ActionType , typename... BranchTypes, typename PrevNodeType , typename ActionResultType >
void CallBuildAndBook (PrevNodeType &prevNode, const ColumnNames_t &bl, const unsigned int nSlots, const std::shared_ptr< ActionResultType > *rOnHeap, const std::shared_ptr< TActionBase *> *actionPtrPtrOnHeap)
 Convenience function invoked by jitted code to build action nodes at runtime. More...
 
void CheckCustomColumn (std::string_view definedCol, TTree *treePtr, const ColumnNames_t &customCols, const ColumnNames_t &dataSourceColumns)
 
void CheckSnapshot (unsigned int nTemplateParams, unsigned int nColumnNames)
 
std::string ColumnName2ColumnTypeName (const std::string &colName, TTree *tree, TCustomColumnBase *tmpBranch, TDataSource *ds)
 Return a string containing the type of the given branch. More...
 
template<typename... ColumnTypes, int... S>
void DefineDataSourceColumns (const std::vector< std::string > &columns, TLoopManager &lm, StaticSeq< S... >, TTraits::TypeList< ColumnTypes... >, TDataSource &ds)
 Take a list of data-source column names and define the ones that haven't been defined yet. More...
 
template<typename T >
void DefineDSColumnHelper (std::string_view name, TLoopManager &lm, TDataSource &ds)
 Helper function to be used by DefineDataSourceColumns More...
 
std::vector< bool > FindUndefinedDSColumns (const ColumnNames_t &requestedCols, const ColumnNames_t &definedCols)
 Return a bitset each element of which indicates whether the corresponding element in selectedColumns is the name of a column that must be defined via datasource. More...
 
ColumnNames_t FindUnknownColumns (const ColumnNames_t &requiredCols, TTree *tree, const ColumnNames_t &definedCols, const ColumnNames_t &dataSourceColumns)
 
std::vector< std::string > FindUsedColumnNames (std::string_view expression, const ColumnNames_t &branches, const ColumnNames_t &customColumns, const ColumnNames_t &dsColumns, const std::map< std::string, std::string > &aliasMap)
 
std::vector< std::string > FindUsedColumnNames (std::string_view, TObjArray *, const std::vector< std::string > &)
 
ColumnNames_t GetBranchNames (TTree &t)
 Get all the branches names, including the ones of the friend trees. More...
 
void GetBranchNamesImpl (TTree &t, std::set< std::string > &bNamesReg, ColumnNames_t &bNames, std::set< TTree *> &analysedTrees)
 
unsigned int GetNSlots ()
 
ColumnNames_t GetValidatedColumnNames (TLoopManager &lm, const unsigned int nColumns, const ColumnNames_t &columns, const ColumnNames_t &validCustomColumns, TDataSource *ds)
 Given the desired number of columns and the user-provided list of columns: More...
 
bool IsInternalColumn (std::string_view colName)
 
std::string JitBuildAndBook (const ColumnNames_t &bl, const std::string &prevNodeTypename, void *prevNode, const std::type_info &art, const std::type_info &at, const void *r, TTree *tree, const unsigned int nSlots, const std::map< std::string, TmpBranchBasePtr_t > &customColumns, TDataSource *ds, const std::shared_ptr< TActionBase *> *const actionPtrPtr)
 
Long_t JitTransformation (void *thisPtr, std::string_view methodName, std::string_view interfaceTypeName, std::string_view name, std::string_view expression, const std::map< std::string, std::string > &aliasMap, const ColumnNames_t &branches, const std::vector< std::string > &customColumns, const std::map< std::string, TmpBranchBasePtr_t > &tmpBookedBranches, TTree *tree, std::string_view returnTypeName, TDataSource *ds)
 
template<typename T >
std::shared_ptr< T > * MakeSharedOnHeap (const std::shared_ptr< T > &shPtr)
 
template<typename ValueTuple , int... S>
void ResetTDFValueTuple (ValueTuple &values, StaticSeq< S... >)
 Clear the proxies of a tuple of TColumnValues. More...
 
const ColumnNames_t SelectColumns (unsigned int nRequiredNames, const ColumnNames_t &names, const ColumnNames_t &defaultNames)
 Choose between local column names or default column names, throw in case of errors. More...
 
const char * ToConstCharPtr (const char *s)
 
const char * ToConstCharPtr (const std::string &s)
 
std::string TypeID2TypeName (const std::type_info &id)
 Returns the name of a type starting from its type_info An empty string is returned in case of failure References and pointers are not supported since those cannot be stored in columns. More...
 
char TypeName2ROOTTypeName (const std::string &b)
 Convert type name (e.g. More...
 
const std::type_info & TypeName2TypeID (const std::string &name)
 Return the type_info associated to a name. More...
 
std::shared_ptr< TFilterBaseUpcastNode (const std::shared_ptr< TFilterBase > ptr)
 
std::shared_ptr< TCustomColumnBaseUpcastNode (const std::shared_ptr< TCustomColumnBase > ptr)
 
std::shared_ptr< TRangeBaseUpcastNode (const std::shared_ptr< TRangeBase > ptr)
 
std::shared_ptr< TLoopManagerUpcastNode (const std::shared_ptr< TLoopManager > ptr)
 

Typedef Documentation

◆ TDFValueTuple_t

template<typename BranchType >
using ROOT::Internal::TDF::TDFValueTuple_t = typedef typename TTDFValueTuple<BranchType>::type

Definition at line 340 of file TDFNodes.hxx.

◆ TmpBranchBasePtr_t

Definition at line 163 of file TDFInterface.hxx.

Function Documentation

◆ AtLeastOneEmptyString()

bool ROOT::Internal::TDF::AtLeastOneEmptyString ( const std::vector< std::string_view strings)

Definition at line 279 of file TDFInterface.cxx.

◆ BuildAndBook() [1/6]

template<typename... BranchTypes, typename ActionType , typename ActionResultType , typename PrevNodeType >
TActionBase* ROOT::Internal::TDF::BuildAndBook ( const ColumnNames_t &  bl,
const std::shared_ptr< ActionResultType > &  h,
const unsigned int  nSlots,
TLoopManager loopManager,
PrevNodeType &  prevNode,
ActionType *   
)

Definition at line 74 of file TDFInterface.hxx.

◆ BuildAndBook() [2/6]

template<typename... BranchTypes, typename PrevNodeType >
TActionBase* ROOT::Internal::TDF::BuildAndBook ( const ColumnNames_t &  bl,
const std::shared_ptr<::TH1D > &  h,
const unsigned int  nSlots,
TLoopManager loopManager,
PrevNodeType &  prevNode,
ActionTypes::Histo1D *   
)

Definition at line 86 of file TDFInterface.hxx.

◆ BuildAndBook() [3/6]

template<typename BranchType , typename PrevNodeType , typename ActionResultType >
TActionBase* ROOT::Internal::TDF::BuildAndBook ( const ColumnNames_t &  bl,
const std::shared_ptr< ActionResultType > &  minV,
const unsigned int  nSlots,
TLoopManager loopManager,
PrevNodeType &  prevNode,
ActionTypes::Min *   
)

Definition at line 112 of file TDFInterface.hxx.

◆ BuildAndBook() [4/6]

template<typename BranchType , typename PrevNodeType , typename ActionResultType >
TActionBase* ROOT::Internal::TDF::BuildAndBook ( const ColumnNames_t &  bl,
const std::shared_ptr< ActionResultType > &  maxV,
const unsigned int  nSlots,
TLoopManager loopManager,
PrevNodeType &  prevNode,
ActionTypes::Max *   
)

Definition at line 125 of file TDFInterface.hxx.

◆ BuildAndBook() [5/6]

template<typename BranchType , typename PrevNodeType , typename ActionResultType >
TActionBase* ROOT::Internal::TDF::BuildAndBook ( const ColumnNames_t &  bl,
const std::shared_ptr< ActionResultType > &  sumV,
const unsigned int  nSlots,
TLoopManager loopManager,
PrevNodeType &  prevNode,
ActionTypes::Sum *   
)

Definition at line 138 of file TDFInterface.hxx.

◆ BuildAndBook() [6/6]

template<typename BranchType , typename PrevNodeType >
TActionBase* ROOT::Internal::TDF::BuildAndBook ( const ColumnNames_t &  bl,
const std::shared_ptr< double > &  meanV,
const unsigned int  nSlots,
TLoopManager loopManager,
PrevNodeType &  prevNode,
ActionTypes::Mean *   
)

Definition at line 150 of file TDFInterface.hxx.

◆ CallBuildAndBook()

template<typename ActionType , typename... BranchTypes, typename PrevNodeType , typename ActionResultType >
void ROOT::Internal::TDF::CallBuildAndBook ( PrevNodeType &  prevNode,
const ColumnNames_t &  bl,
const unsigned int  nSlots,
const std::shared_ptr< ActionResultType > *  rOnHeap,
const std::shared_ptr< TActionBase *> *  actionPtrPtrOnHeap 
)

Convenience function invoked by jitted code to build action nodes at runtime.

Definition at line 233 of file TDFInterface.hxx.

◆ CheckCustomColumn()

void ROOT::Internal::TDF::CheckCustomColumn ( std::string_view  definedCol,
TTree treePtr,
const ColumnNames_t &  customCols,
const ColumnNames_t &  dataSourceColumns 
)

Definition at line 274 of file TDFUtils.cxx.

◆ CheckSnapshot()

void ROOT::Internal::TDF::CheckSnapshot ( unsigned int  nTemplateParams,
unsigned int  nColumnNames 
)

Definition at line 300 of file TDFUtils.cxx.

◆ ColumnName2ColumnTypeName()

std::string ROOT::Internal::TDF::ColumnName2ColumnTypeName ( const std::string &  colName,
TTree tree,
TCustomColumnBase tmpBranch,
TDataSource ds 
)

Return a string containing the type of the given branch.

Works both with real TTree branches and with temporary column created by Define. Returns an empty string if type name deduction fails.

Definition at line 123 of file TDFUtils.cxx.

◆ DefineDataSourceColumns()

template<typename... ColumnTypes, int... S>
void ROOT::Internal::TDF::DefineDataSourceColumns ( const std::vector< std::string > &  columns,
TLoopManager lm,
StaticSeq< S... >  ,
TTraits::TypeList< ColumnTypes... >  ,
TDataSource ds 
)

Take a list of data-source column names and define the ones that haven't been defined yet.

Definition at line 216 of file TDFInterface.hxx.

◆ DefineDSColumnHelper()

template<typename T >
void ROOT::Internal::TDF::DefineDSColumnHelper ( std::string_view  name,
TLoopManager lm,
TDataSource ds 
)

Helper function to be used by DefineDataSourceColumns

Definition at line 205 of file TDFInterface.hxx.

◆ FindUndefinedDSColumns()

std::vector< bool > ROOT::Internal::TDF::FindUndefinedDSColumns ( const ColumnNames_t &  requestedCols,
const ColumnNames_t &  definedCols 
)

Return a bitset each element of which indicates whether the corresponding element in selectedColumns is the name of a column that must be defined via datasource.

All elements of the returned vector are false if no data-source is present.

Definition at line 349 of file TDFInterface.cxx.

◆ FindUnknownColumns()

ColumnNames_t ROOT::Internal::TDF::FindUnknownColumns ( const ColumnNames_t &  requiredCols,
TTree tree,
const ColumnNames_t &  definedCols,
const ColumnNames_t &  dataSourceColumns 
)

Definition at line 339 of file TDFUtils.cxx.

◆ FindUsedColumnNames() [1/2]

std::vector<std::string> ROOT::Internal::TDF::FindUsedColumnNames ( std::string_view  expression,
const ColumnNames_t &  branches,
const ColumnNames_t &  customColumns,
const ColumnNames_t &  dsColumns,
const std::map< std::string, std::string > &  aliasMap 
)

Definition at line 36 of file TDFInterface.cxx.

◆ FindUsedColumnNames() [2/2]

std::vector<std::string> ROOT::Internal::TDF::FindUsedColumnNames ( std::string_view  ,
TObjArray ,
const std::vector< std::string > &   
)

◆ GetBranchNames()

ColumnNames_t ROOT::Internal::TDF::GetBranchNames ( TTree t)

Get all the branches names, including the ones of the friend trees.

Definition at line 265 of file TDFUtils.cxx.

◆ GetBranchNamesImpl()

void ROOT::Internal::TDF::GetBranchNamesImpl ( TTree t,
std::set< std::string > &  bNamesReg,
ColumnNames_t &  bNames,
std::set< TTree *> &  analysedTrees 
)

Definition at line 234 of file TDFUtils.cxx.

◆ GetNSlots()

unsigned int ROOT::Internal::TDF::GetNSlots ( )

Definition at line 222 of file TDFUtils.cxx.

◆ GetValidatedColumnNames()

ColumnNames_t ROOT::Internal::TDF::GetValidatedColumnNames ( TLoopManager lm,
const unsigned int  nColumns,
const ColumnNames_t &  columns,
const ColumnNames_t &  validCustomColumns,
TDataSource ds 
)

Given the desired number of columns and the user-provided list of columns:

  • fallback to using the first nColumns default columns if needed (or throw if nColumns > nDefaultColumns)
  • check that selected column names refer to valid branches, custom columns or datasource columns (throw if not) Return the list of selected column names.

Definition at line 312 of file TDFInterface.cxx.

◆ IsInternalColumn()

bool ROOT::Internal::TDF::IsInternalColumn ( std::string_view  colName)

Definition at line 359 of file TDFUtils.cxx.

◆ JitBuildAndBook()

std::string ROOT::Internal::TDF::JitBuildAndBook ( const ColumnNames_t &  bl,
const std::string &  prevNodeTypename,
void prevNode,
const std::type_info &  art,
const std::type_info &  at,
const void r,
TTree tree,
const unsigned int  nSlots,
const std::map< std::string, TmpBranchBasePtr_t > &  customColumns,
TDataSource ds,
const std::shared_ptr< TActionBase *> *const  actionPtrPtr 
)

Definition at line 214 of file TDFInterface.cxx.

◆ JitTransformation()

Long_t ROOT::Internal::TDF::JitTransformation ( void thisPtr,
std::string_view  methodName,
std::string_view  interfaceTypeName,
std::string_view  name,
std::string_view  expression,
const std::map< std::string, std::string > &  aliasMap,
const ColumnNames_t &  branches,
const std::vector< std::string > &  customColumns,
const std::map< std::string, TmpBranchBasePtr_t > &  tmpBookedBranches,
TTree tree,
std::string_view  returnTypeName,
TDataSource ds 
)

Definition at line 93 of file TDFInterface.cxx.

◆ MakeSharedOnHeap()

template<typename T >
std::shared_ptr<T>* ROOT::Internal::TDF::MakeSharedOnHeap ( const std::shared_ptr< T > &  shPtr)

Definition at line 184 of file TDFInterface.hxx.

◆ ResetTDFValueTuple()

template<typename ValueTuple , int... S>
void ROOT::Internal::TDF::ResetTDFValueTuple ( ValueTuple &  values,
StaticSeq< S... >   
)

Clear the proxies of a tuple of TColumnValues.

Definition at line 344 of file TDFNodes.hxx.

◆ SelectColumns()

const ColumnNames_t ROOT::Internal::TDF::SelectColumns ( unsigned int  nRequiredNames,
const ColumnNames_t &  names,
const ColumnNames_t &  defaultNames 
)

Choose between local column names or default column names, throw in case of errors.

Definition at line 314 of file TDFUtils.cxx.

◆ ToConstCharPtr() [1/2]

const char* ROOT::Internal::TDF::ToConstCharPtr ( const char *  s)

Definition at line 212 of file TDFUtils.cxx.

◆ ToConstCharPtr() [2/2]

const char* ROOT::Internal::TDF::ToConstCharPtr ( const std::string &  s)

Definition at line 217 of file TDFUtils.cxx.

◆ TypeID2TypeName()

std::string ROOT::Internal::TDF::TypeID2TypeName ( const std::type_info &  id)

Returns the name of a type starting from its type_info An empty string is returned in case of failure References and pointers are not supported since those cannot be stored in columns.

Definition at line 85 of file TDFUtils.cxx.

◆ TypeName2ROOTTypeName()

char ROOT::Internal::TDF::TypeName2ROOTTypeName ( const std::string &  b)

Convert type name (e.g.

"Float_t") to ROOT type code (e.g. 'F') – see TBranch documentation. Return a space ' ' in case no match was found.

Definition at line 185 of file TDFUtils.cxx.

◆ TypeName2TypeID()

const std::type_info& ROOT::Internal::TDF::TypeName2TypeID ( const std::string &  name)

Return the type_info associated to a name.

If the association fails, an exception is thrown. References and pointers are not supported since those cannot be stored in columns.

Definition at line 43 of file TDFUtils.cxx.

◆ UpcastNode() [1/4]

std::shared_ptr< TFilterBase > ROOT::Internal::TDF::UpcastNode ( const std::shared_ptr< TFilterBase ptr)

Definition at line 288 of file TDFInterface.cxx.

◆ UpcastNode() [2/4]

std::shared_ptr< TCustomColumnBase > ROOT::Internal::TDF::UpcastNode ( const std::shared_ptr< TCustomColumnBase ptr)

Definition at line 293 of file TDFInterface.cxx.

◆ UpcastNode() [3/4]

std::shared_ptr< TRangeBase > ROOT::Internal::TDF::UpcastNode ( const std::shared_ptr< TRangeBase ptr)

Definition at line 298 of file TDFInterface.cxx.

◆ UpcastNode() [4/4]

std::shared_ptr< TLoopManager > ROOT::Internal::TDF::UpcastNode ( const std::shared_ptr< TLoopManager ptr)

Definition at line 303 of file TDFInterface.cxx.