Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Detail::RDF Namespace Reference

Namespaces

namespace  CustomColExtraArgs
 

Classes

class  RColumnReaderBase
 
class  RDefine
 
class  RDefineBase
 
class  RFilter
 
class  RFilterBase
 
class  RJittedDefine
 A wrapper around a concrete RDefine, which forwards all calls to it RJittedDefine is a placeholder that is put in the collection of custom columns in place of a RDefine that will be just-in-time compiled. More...
 
class  RJittedFilter
 A wrapper around a concrete RFilter, which forwards all calls to it RJittedFilter is the type of the node returned by jitted Filter calls: the concrete filter can be created and set at a later time, from jitted code. More...
 
class  RLoopManager
 The head node of a RDF computation graph. More...
 
class  RMergeableCount
 Specialization of RMergeableValue for the Count action. More...
 
class  RMergeableFill
 Specialization of RMergeableValue for histograms and statistics. More...
 
class  RMergeableMax
 
class  RMergeableMean
 Specialization of RMergeableValue for the Mean action. More...
 
class  RMergeableMin
 
class  RMergeableStdDev
 Specialization of RMergeableValue for the StdDev action. More...
 
class  RMergeableSum
 
class  RMergeableValue
 A result of an RDataFrame execution, that knows how to merge with other results of the same type. More...
 
class  RMergeableValueBase
 Base class of RMergeableValue. More...
 
class  RNodeBase
 Base class for non-leaf nodes of the computational graph. More...
 
class  RRange
 
class  RRangeBase
 

Typedefs

using ColumnNames_t = std::vector< std::string >
 

Functions

template<typename T >
std::unique_ptr< RMergeableValue< T > > GetMergeableValue (RResultPtr< T > &rptr)
 Retrieve a mergeable value from an RDataFrame action.
 
template<typename T >
RResultPtr< T > MakeResultPtr (const std::shared_ptr< T > &r, RLoopManager &lm, std::shared_ptr< RDFInternal::RActionBase > actionPtr)
 Create a RResultPtr and set its pointer to the corresponding RAction This overload is invoked by non-jitted actions, as they have access to RAction before constructing RResultPtr.
 
template<typename T , typename... Ts>
void MergeValues (RMergeableValue< T > &OutputMergeable, const RMergeableValue< Ts > &... InputMergeables)
 Merge multiple RMergeableValue objects into one.
 
template<typename T , typename... Ts>
std::unique_ptr< RMergeableValue< T > > MergeValues (std::unique_ptr< RMergeableValue< T > > OutputMergeable, std::unique_ptr< RMergeableValue< Ts > >... InputMergeables)
 Merge multiple RMergeableValue objects into one.
 

Typedef Documentation

◆ ColumnNames_t

using ROOT::Detail::RDF::ColumnNames_t = typedef std::vector<std::string>

Definition at line 54 of file RLoopManager.hxx.

Function Documentation

◆ GetMergeableValue()

template<typename T >
std::unique_ptr< RMergeableValue< T > > ROOT::Detail::RDF::GetMergeableValue ( RResultPtr< T > &  rptr)

Retrieve a mergeable value from an RDataFrame action.

Parameters
[in]rptrlvalue reference of an RResultPtr object.
Returns
An RMergeableValue holding the result of the action, wrapped in an std::unique_ptr.

This function triggers the execution of the RDataFrame computation graph. Then retrieves an RMergeableValue object created with the result wrapped by the RResultPtr argument. The user obtains ownership of the mergeable, which in turn holds a copy of the result of the action. The RResultPtr is not destroyed in the process and will still retain (shared) ownership of the original result.

Example usage:

using namespace ROOT::Detail::RDF;
ROOT::RDataFrame d("myTree", "file_*.root");
auto h = d.Histo1D("Branch_A");
auto mergeablehisto = GetMergeableValue(h);
#define d(i)
Definition RSha256.hxx:102
#define h(i)
Definition RSha256.hxx:106
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTrees,...
std::unique_ptr< RMergeableValue< T > > GetMergeableValue(RResultPtr< T > &rptr)
Retrieve a mergeable value from an RDataFrame action.

Definition at line 439 of file RResultPtr.hxx.

◆ MakeResultPtr()

template<typename T >
RResultPtr< T > ROOT::Detail::RDF::MakeResultPtr ( const std::shared_ptr< T > &  r,
RLoopManager df,
std::shared_ptr< ROOT::Internal::RDF::RActionBase actionPtr 
)

Create a RResultPtr and set its pointer to the corresponding RAction This overload is invoked by non-jitted actions, as they have access to RAction before constructing RResultPtr.

Definition at line 413 of file RResultPtr.hxx.

◆ MergeValues() [1/2]

template<typename T , typename... Ts>
void ROOT::Detail::RDF::MergeValues ( RMergeableValue< T > &  OutputMergeable,
const RMergeableValue< Ts > &...  InputMergeables 
)

Merge multiple RMergeableValue objects into one.

Parameters
[in,out]OutputMergeableThe mergeable object where all the information will be aggregated.
[in]InputMergeablesOther mergeables containing the partial results.

This overload modifies the mergeable objects in-place. The ownership is left to the caller. The first argument to the function will get all the values contained in the other arguments merged into itself. This is a convenience overload introduced for the ROOT Python API.

Example usage:

// mh1, mh2, mh3 are std::unique_ptr<RMergeableValue<TH1D>>
const auto &mergedhisto = mh1->GetValue(); // Final merged histogram
// Do stuff with it
mergedhisto.Draw();
std::unique_ptr< RMergeableValue< T > > MergeValues(std::unique_ptr< RMergeableValue< T > > OutputMergeable, std::unique_ptr< RMergeableValue< Ts > >... InputMergeables)
Merge multiple RMergeableValue objects into one.

Definition at line 574 of file RMergeableValue.hxx.

◆ MergeValues() [2/2]

template<typename T , typename... Ts>
std::unique_ptr< RMergeableValue< T > > ROOT::Detail::RDF::MergeValues ( std::unique_ptr< RMergeableValue< T > >  OutputMergeable,
std::unique_ptr< RMergeableValue< Ts > >...  InputMergeables 
)

Merge multiple RMergeableValue objects into one.

Parameters
[in]OutputMergeableThe mergeable object where all the information will be aggregated.
[in]InputMergeablesOther mergeables containing the partial results.
Returns
An RMergeableValue holding the aggregated value wrapped in an std::unique_ptr.

This is the recommended way of merging multiple RMergeableValue objects. This overload takes ownership of the mergeables and gives back to the user a mergeable with the aggregated information. All the mergeables with the partial results get destroyed in the process.

Example usage:

using namespace ROOT::Detail::RDF;
// mh1, mh2, mh3 are std::unique_ptr<RMergeableValue<TH1D>>
auto mergedptr = MergeValues(std::move(mh1), std::move(mh2), std::move(mh3));
const auto &mergedhisto = mergedptr->GetValue(); // Final merged histogram
// Do stuff with it
mergedhisto.Draw();

Definition at line 540 of file RMergeableValue.hxx.