#include "ROOT/RDataSource.hxx"#include "ROOT/RDF/ActionHelpers.hxx"#include "ROOT/RDF/HistoModels.hxx"#include "ROOT/RDF/InterfaceUtils.hxx"#include "ROOT/RDF/RColumnRegister.hxx"#include "ROOT/RDF/RDefine.hxx"#include "ROOT/RDF/RDefinePerSample.hxx"#include "ROOT/RDF/RFilter.hxx"#include "ROOT/RDF/RInterfaceBase.hxx"#include "ROOT/RDF/RVariation.hxx"#include "ROOT/RDF/RLazyDSImpl.hxx"#include "ROOT/RDF/RLoopManager.hxx"#include "ROOT/RDF/RRange.hxx"#include "ROOT/RDF/Utils.hxx"#include "ROOT/RDF/RDFDescription.hxx"#include "ROOT/RDF/RVariationsDescription.hxx"#include "ROOT/RResultPtr.hxx"#include "ROOT/RSnapshotOptions.hxx"#include <string_view>#include "ROOT/RVec.hxx"#include "ROOT/TypeTraits.hxx"#include "RtypesCore.h"#include "TDirectory.h"#include "TH1.h"#include "TH2.h"#include "TH3.h"#include "THn.h"#include "TProfile.h"#include "TProfile2D.h"#include "TStatistic.h"#include <algorithm>#include <cstddef>#include <initializer_list>#include <iterator>#include <limits>#include <memory>#include <set>#include <sstream>#include <stdexcept>#include <string>#include <type_traits>#include <typeinfo>#include <unordered_set>#include <utility>#include <vector>Classes | |
| class | ROOT::RDF::RInterface< Proxied, DataSource > |
| The public interface to the RDataFrame federation of classes. More... | |
Namespaces | |
| namespace | ROOT |
| tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tbb::task_arena without forward declaring tbb::interface7 | |
| namespace | ROOT::Internal |
| namespace | ROOT::Internal::RDF |
| namespace | ROOT::RDF |
Typedefs | |
| using | DS_t = DataSource |
| using | RFilterBase = RDFDetail::RFilterBase |
| using | RLoopManager = RDFDetail::RLoopManager |
| using | RRangeBase = RDFDetail::RRangeBase |
Functions | |
| template<typename AccFun, typename MergeFun, typename R = typename TTraits::CallableTraits<AccFun>::ret_type, typename ArgTypes = typename TTraits::CallableTraits<AccFun>::arg_types, typename ArgTypesNoDecay = typename TTraits::CallableTraits<AccFun>::arg_types_nodecay, typename U = TTraits::TakeFirstParameter_t<ArgTypes>, typename T = TTraits::TakeFirstParameter_t<TTraits::RemoveFirstParameter_t<ArgTypes>>> | |
| RResultPtr< U > | ROOT::RDF::Aggregate (AccFun aggregator, MergeFun merger, std::string_view columnName, const U &aggIdentity) |
| Execute a user-defined accumulation operation on the processed column values in each processing slot. | |
| template<typename AccFun, typename MergeFun, typename R = typename TTraits::CallableTraits<AccFun>::ret_type, typename ArgTypes = typename TTraits::CallableTraits<AccFun>::arg_types, typename U = TTraits::TakeFirstParameter_t<ArgTypes>, typename T = TTraits::TakeFirstParameter_t<TTraits::RemoveFirstParameter_t<ArgTypes>>> | |
| RResultPtr< U > | ROOT::RDF::Aggregate (AccFun aggregator, MergeFun merger, std::string_view columnName="") |
| Execute a user-defined accumulation operation on the processed column values in each processing slot. | |
| RInterface< Proxied, DS_t > | ROOT::RDF::Alias (std::string_view alias, std::string_view columnName) |
| Allow to refer to a column with a different name. | |
| template<typename FirstColumn = RDFDetail::RInferredType, typename... OtherColumns, typename Helper> | |
| RResultPtr< typename std::decay_t< Helper >::Result_t > | ROOT::RDF::Book (Helper &&helper, const ColumnNames_t &columns={}) |
| Book execution of a custom action using a user-defined helper object. | |
| template<typename... ColumnTypes> | |
| RInterface< RLoopManager > | ROOT::RDF::Cache (const ColumnNames_t &columnList) |
| Save selected columns in memory. | |
| RInterface< RLoopManager > | ROOT::RDF::Cache (const ColumnNames_t &columnList) |
| Save selected columns in memory. | |
| RInterface< RLoopManager > | ROOT::RDF::Cache (std::initializer_list< std::string > columnList) |
| Save selected columns in memory. | |
| RInterface< RLoopManager > | ROOT::RDF::Cache (std::string_view columnNameRegexp="") |
| Save selected columns in memory. | |
| template<typename... ColTypes, std::size_t... S> | |
| RInterface< RLoopManager > | ROOT::RDF::CacheImpl (const ColumnNames_t &columnList, std::index_sequence< S... >) |
| Implementation of cache. | |
| template<typename Helper, typename ActionResultType, typename... Others> | |
| RResultPtr< ActionResultType > | ROOT::RDF::CallCreateActionWithoutColsIfPossible (const std::shared_ptr< ActionResultType > &, const std::shared_ptr< Helper > &, Others...) |
| template<typename Helper, typename ActionResultType> | |
| auto | ROOT::RDF::CallCreateActionWithoutColsIfPossible (const std::shared_ptr< ActionResultType > &resPtr, const std::shared_ptr< Helper > &hPtr, TTraits::TypeList< RDFDetail::RInferredType >) -> decltype(hPtr->Exec(0u), RResultPtr< ActionResultType >{}) |
| void | ROOT::Internal::RDF::ChangeEmptyEntryRange (const ROOT::RDF::RNode &node, std::pair< ULong64_t, ULong64_t > &&newRange) |
| void | ROOT::Internal::RDF::ChangeSpec (const ROOT::RDF::RNode &node, ROOT::RDF::Experimental::RDatasetSpec &&spec) |
| Changes the input dataset specification of an RDataFrame. | |
| RResultPtr< ULong64_t > | ROOT::RDF::Count () |
| Return the number of entries processed (lazy action). | |
| template<typename F, typename std::enable_if_t<!std::is_convertible< F, std::string >::value, int > = 0> | |
| RInterface< Proxied, DS_t > | Define (std::string_view name, F expression, const ColumnNames_t &columns={}) |
| Define a new column. | |
| RInterface< Proxied, DS_t > | Define (std::string_view name, std::string_view expression) |
| Define a new column. | |
| template<typename F, typename DefineType, typename RetType = typename TTraits::CallableTraits<F>::ret_type> | |
| std::enable_if_t< std::is_default_constructible< RetType >::value, RInterface< Proxied, DS_t > > | ROOT::RDF::DefineImpl (std::string_view name, F &&expression, const ColumnNames_t &columns, const std::string &where) |
| template<typename F, typename DefineType, typename RetType = typename TTraits::CallableTraits<F>::ret_type, bool IsFStringConv = std::is_convertible<F, std::string>::value, bool IsRetTypeDefConstr = std::is_default_constructible<RetType>::value> | |
| std::enable_if_t<!IsFStringConv &&!IsRetTypeDefConstr, RInterface< Proxied, DS_t > > | ROOT::RDF::DefineImpl (std::string_view, F, const ColumnNames_t &, const std::string &) |
| template<typename F, typename RetType_t = typename TTraits::CallableTraits<F>::ret_type> | |
| RInterface< Proxied, DS_t > | DefinePerSample (std::string_view name, F expression) |
| Define a new column that is updated when the input sample changes. | |
| RInterface< Proxied, DS_t > | DefinePerSample (std::string_view name, std::string_view expression) |
| Define a new column that is updated when the input sample changes. | |
| template<typename F> | |
| RInterface< Proxied, DS_t > | DefineSlot (std::string_view name, F expression, const ColumnNames_t &columns={}) |
| Define a new column with a value dependent on the processing slot. | |
| template<typename F> | |
| RInterface< Proxied, DS_t > | DefineSlotEntry (std::string_view name, F expression, const ColumnNames_t &columns={}) |
| Define a new column with a value dependent on the processing slot and the current entry. | |
| void | ROOT::DisableImplicitMT () |
| Disables the implicit multi-threading in ROOT (see EnableImplicitMT). | |
| template<typename... ColumnTypes> | |
| RResultPtr< RDisplay > | ROOT::RDF::Display (const ColumnNames_t &columnList, size_t nRows=5, size_t nMaxCollectionElements=10) |
| Provides a representation of the columns in the dataset. | |
| RResultPtr< RDisplay > | ROOT::RDF::Display (const ColumnNames_t &columnList, size_t nRows=5, size_t nMaxCollectionElements=10) |
| Provides a representation of the columns in the dataset. | |
| RResultPtr< RDisplay > | ROOT::RDF::Display (std::initializer_list< std::string > columnList, size_t nRows=5, size_t nMaxCollectionElements=10) |
| Provides a representation of the columns in the dataset. | |
| RResultPtr< RDisplay > | ROOT::RDF::Display (std::string_view columnNameRegexp="", size_t nRows=5, size_t nMaxCollectionElements=10) |
| Provides a representation of the columns in the dataset. | |
| void | ROOT::EnableImplicitMT (UInt_t numthreads=0) |
| Enable ROOT's implicit multi-threading for all objects and methods that provide an internal parallelisation mechanism. | |
| template<typename FirstColumn = RDFDetail::RInferredType, typename... OtherColumns, typename T> | |
| RResultPtr< std::decay_t< T > > | ROOT::RDF::Fill (T &&model, const ColumnNames_t &columnList) |
Return an object of type T on which T::Fill will be called once per event (lazy action). | |
| template<typename F, std::enable_if_t<!std::is_convertible< F, std::string >::value, int > = 0> | |
| RInterface< RDFDetail::RFilter< F, Proxied >, DS_t > | Filter (F f, const ColumnNames_t &columns={}, std::string_view name="") |
| Append a filter to the call graph. | |
| template<typename F> | |
| RInterface< RDFDetail::RFilter< F, Proxied >, DS_t > | Filter (F f, const std::initializer_list< std::string > &columns) |
| Append a filter to the call graph. | |
| template<typename F, std::enable_if_t<!std::is_convertible< F, std::string >::value, int > = 0> | |
| RInterface< RDFDetail::RFilter< F, Proxied >, DS_t > | Filter (F f, std::string_view name) |
| Append a filter to the call graph. | |
| RInterface< RDFDetail::RJittedFilter, DS_t > | Filter (std::string_view expression, std::string_view name="") |
| Append a filter to the call graph. | |
| template<typename F> | |
| void | ROOT::RDF::Foreach (F f, const ColumnNames_t &columns={}) |
| Execute a user-defined function on each entry (instant action). | |
| template<typename F> | |
| void | ROOT::RDF::ForeachSlot (F f, const ColumnNames_t &columns={}) |
| Execute a user-defined function requiring a processing slot index on each entry (instant action). | |
| std::vector< std::string > | ROOT::RDF::GetFilterNames () |
| Returns the names of the filters created. | |
| const std::shared_ptr< Proxied > & | ROOT::RDF::GetProxiedPtr () const |
| template<typename X = RDFDetail::RInferredType, typename Y = RDFDetail::RInferredType> | |
| RResultPtr<::TGraph > | ROOT::RDF::Graph (std::string_view x="", std::string_view y="") |
| Fill and return a TGraph object (lazy action). | |
| template<typename X = RDFDetail::RInferredType, typename Y = RDFDetail::RInferredType, typename EXL = RDFDetail::RInferredType, typename EXH = RDFDetail::RInferredType, typename EYL = RDFDetail::RInferredType, typename EYH = RDFDetail::RInferredType> | |
| RResultPtr<::TGraphAsymmErrors > | ROOT::RDF::GraphAsymmErrors (std::string_view x="", std::string_view y="", std::string_view exl="", std::string_view exh="", std::string_view eyl="", std::string_view eyh="") |
| Fill and return a TGraphAsymmErrors object (lazy action). | |
| template<typename V = RDFDetail::RInferredType, typename W = RDFDetail::RInferredType> | |
| RResultPtr<::TH1D > | ROOT::RDF::Histo1D (const TH1DModel &model, std::string_view vName, std::string_view wName) |
| Fill and return a one-dimensional histogram with the weighted values of a column (lazy action). | |
| template<typename V, typename W> | |
| RResultPtr<::TH1D > | ROOT::RDF::Histo1D (const TH1DModel &model={"", "", 128u, 0., 0.}) |
| Fill and return a one-dimensional histogram with the weighted values of a column (lazy action). | |
| template<typename V = RDFDetail::RInferredType> | |
| RResultPtr<::TH1D > | ROOT::RDF::Histo1D (const TH1DModel &model={"", "", 128u, 0., 0.}, std::string_view vName="") |
| Fill and return a one-dimensional histogram with the values of a column (lazy action). | |
| template<typename V = RDFDetail::RInferredType> | |
| RResultPtr<::TH1D > | ROOT::RDF::Histo1D (std::string_view vName) |
| Fill and return a one-dimensional histogram with the values of a column (lazy action). | |
| template<typename V = RDFDetail::RInferredType, typename W = RDFDetail::RInferredType> | |
| RResultPtr<::TH1D > | ROOT::RDF::Histo1D (std::string_view vName, std::string_view wName) |
| Fill and return a one-dimensional histogram with the weighted values of a column (lazy action). | |
| template<typename V1, typename V2, typename W> | |
| RResultPtr<::TH2D > | ROOT::RDF::Histo2D (const TH2DModel &model) |
| template<typename V1 = RDFDetail::RInferredType, typename V2 = RDFDetail::RInferredType, typename W = RDFDetail::RInferredType> | |
| RResultPtr<::TH2D > | ROOT::RDF::Histo2D (const TH2DModel &model, std::string_view v1Name, std::string_view v2Name, std::string_view wName) |
| Fill and return a weighted two-dimensional histogram (lazy action). | |
| template<typename V1 = RDFDetail::RInferredType, typename V2 = RDFDetail::RInferredType> | |
| RResultPtr<::TH2D > | ROOT::RDF::Histo2D (const TH2DModel &model, std::string_view v1Name="", std::string_view v2Name="") |
| Fill and return a two-dimensional histogram (lazy action). | |
| template<typename V1, typename V2, typename V3, typename W> | |
| RResultPtr<::TH3D > | ROOT::RDF::Histo3D (const TH3DModel &model) |
| template<typename V1 = RDFDetail::RInferredType, typename V2 = RDFDetail::RInferredType, typename V3 = RDFDetail::RInferredType, typename W = RDFDetail::RInferredType> | |
| RResultPtr<::TH3D > | ROOT::RDF::Histo3D (const TH3DModel &model, std::string_view v1Name, std::string_view v2Name, std::string_view v3Name, std::string_view wName) |
| Fill and return a three-dimensional histogram (lazy action). | |
| template<typename V1 = RDFDetail::RInferredType, typename V2 = RDFDetail::RInferredType, typename V3 = RDFDetail::RInferredType> | |
| RResultPtr<::TH3D > | ROOT::RDF::Histo3D (const TH3DModel &model, std::string_view v1Name="", std::string_view v2Name="", std::string_view v3Name="") |
| Fill and return a three-dimensional histogram (lazy action). | |
| template<typename FirstColumn, typename... OtherColumns> | |
| RResultPtr<::THnD > | ROOT::RDF::HistoND (const THnDModel &model, const ColumnNames_t &columnList) |
| Fill and return an N-dimensional histogram (lazy action). | |
| RResultPtr<::THnD > | ROOT::RDF::HistoND (const THnDModel &model, const ColumnNames_t &columnList) |
| Fill and return an N-dimensional histogram (lazy action). | |
| Bool_t | ROOT::IsImplicitMTEnabled () |
| Returns true if the implicit multi-threading in ROOT is enabled. | |
| RInterface< Proxied, DS_t > | ROOT::RDF::JittedVaryImpl (const std::vector< std::string > &colNames, std::string_view expression, const std::vector< std::string > &variationTags, std::string_view variationName, bool isSingleColumn) |
| template<typename T = RDFDetail::RInferredType> | |
| RResultPtr< RDFDetail::MaxReturnType_t< T > > | ROOT::RDF::Max (std::string_view columnName="") |
| Return the maximum of processed column values (lazy action). | |
| template<typename T = RDFDetail::RInferredType> | |
| RResultPtr< double > | ROOT::RDF::Mean (std::string_view columnName="") |
| Return the mean of processed column values (lazy action). | |
| template<typename T = RDFDetail::RInferredType> | |
| RResultPtr< RDFDetail::MinReturnType_t< T > > | ROOT::RDF::Min (std::string_view columnName="") |
| Return the minimum of processed column values (lazy action). | |
| operator RNode () const | |
| Cast any RDataFrame node to a common type ROOT::RDF::RNode. | |
| RInterface & | operator= (const RInterface &)=default |
| Copy-assignment operator for RInterface. | |
| RInterface & | operator= (RInterface &&)=default |
| Move-assignment operator for RInterface. | |
| template<typename V1, typename V2, typename W> | |
| RResultPtr<::TProfile > | ROOT::RDF::Profile1D (const TProfile1DModel &model) |
| Fill and return a one-dimensional profile (lazy action). See the first Profile1D() overload for more details. | |
| template<typename V1 = RDFDetail::RInferredType, typename V2 = RDFDetail::RInferredType, typename W = RDFDetail::RInferredType> | |
| RResultPtr<::TProfile > | ROOT::RDF::Profile1D (const TProfile1DModel &model, std::string_view v1Name, std::string_view v2Name, std::string_view wName) |
| Fill and return a one-dimensional profile (lazy action). | |
| template<typename V1 = RDFDetail::RInferredType, typename V2 = RDFDetail::RInferredType> | |
| RResultPtr<::TProfile > | ROOT::RDF::Profile1D (const TProfile1DModel &model, std::string_view v1Name="", std::string_view v2Name="") |
| Fill and return a one-dimensional profile (lazy action). | |
| template<typename V1, typename V2, typename V3, typename W> | |
| RResultPtr<::TProfile2D > | ROOT::RDF::Profile2D (const TProfile2DModel &model) |
| Fill and return a two-dimensional profile (lazy action). See the first Profile2D() overload for more details. | |
| template<typename V1 = RDFDetail::RInferredType, typename V2 = RDFDetail::RInferredType, typename V3 = RDFDetail::RInferredType, typename W = RDFDetail::RInferredType> | |
| RResultPtr<::TProfile2D > | ROOT::RDF::Profile2D (const TProfile2DModel &model, std::string_view v1Name, std::string_view v2Name, std::string_view v3Name, std::string_view wName) |
| Fill and return a two-dimensional profile (lazy action). | |
| template<typename V1 = RDFDetail::RInferredType, typename V2 = RDFDetail::RInferredType, typename V3 = RDFDetail::RInferredType> | |
| RResultPtr<::TProfile2D > | ROOT::RDF::Profile2D (const TProfile2DModel &model, std::string_view v1Name="", std::string_view v2Name="", std::string_view v3Name="") |
| Fill and return a two-dimensional profile (lazy action). | |
| RInterface< RDFDetail::RRange< Proxied >, DS_t > | ROOT::RDF::Range (unsigned int begin, unsigned int end, unsigned int stride=1) |
| Creates a node that filters entries based on range: [begin, end). | |
| RInterface< RDFDetail::RRange< Proxied >, DS_t > | ROOT::RDF::Range (unsigned int end) |
| Creates a node that filters entries based on range. | |
| template<typename F, std::enable_if_t<!std::is_convertible< F, std::string >::value, int > = 0> | |
| RInterface< Proxied, DS_t > | Redefine (std::string_view name, F expression, const ColumnNames_t &columns={}) |
| Overwrite the value and/or type of an existing column. | |
| RInterface< Proxied, DS_t > | Redefine (std::string_view name, std::string_view expression) |
| Overwrite the value and/or type of an existing column. | |
| template<typename F> | |
| RInterface< Proxied, DS_t > | RedefineSlot (std::string_view name, F expression, const ColumnNames_t &columns={}) |
| Overwrite the value and/or type of an existing column. | |
| template<typename F> | |
| RInterface< Proxied, DS_t > | RedefineSlotEntry (std::string_view name, F expression, const ColumnNames_t &columns={}) |
| Overwrite the value and/or type of an existing column. | |
| template<typename F, typename T = typename TTraits::CallableTraits<F>::ret_type> | |
| RResultPtr< T > | ROOT::RDF::Reduce (F f, std::string_view columnName, const T &redIdentity) |
| Execute a user-defined reduce operation on the values of a column. | |
| template<typename F, typename T = typename TTraits::CallableTraits<F>::ret_type> | |
| RResultPtr< T > | ROOT::RDF::Reduce (F f, std::string_view columnName="") |
| Execute a user-defined reduce operation on the values of a column. | |
| RResultPtr< RCutFlowReport > | ROOT::RDF::Report () |
| Gather filtering statistics. | |
| RInterface (const RInterface &)=default | |
| Copy-ctor for RInterface. | |
| template<typename T = Proxied, typename = std::enable_if_t<std::is_same<T, RLoopManager>::value, int>> | |
| RInterface (const std::shared_ptr< RLoopManager > &proxied) | |
| Build a RInterface from a RLoopManager. | |
| RInterface (RInterface &&)=default | |
| Move-ctor for RInterface. | |
| ROOT::RDF::RInterface (const std::shared_ptr< Proxied > &proxied, RLoopManager &lm, const RDFInternal::RColumnRegister &colRegister) | |
| template<typename... ColumnTypes> | |
| RResultPtr< RInterface< RLoopManager > > | ROOT::RDF::Snapshot (std::string_view treename, std::string_view filename, const ColumnNames_t &columnList, const RSnapshotOptions &options=RSnapshotOptions()) |
Save selected columns to disk, in a new TTree treename in file filename. | |
| RResultPtr< RInterface< RLoopManager > > | ROOT::RDF::Snapshot (std::string_view treename, std::string_view filename, const ColumnNames_t &columnList, const RSnapshotOptions &options=RSnapshotOptions()) |
Save selected columns to disk, in a new TTree treename in file filename. | |
| RResultPtr< RInterface< RLoopManager > > | ROOT::RDF::Snapshot (std::string_view treename, std::string_view filename, std::initializer_list< std::string > columnList, const RSnapshotOptions &options=RSnapshotOptions()) |
Save selected columns to disk, in a new TTree treename in file filename. | |
| RResultPtr< RInterface< RLoopManager > > | ROOT::RDF::Snapshot (std::string_view treename, std::string_view filename, std::string_view columnNameRegexp="", const RSnapshotOptions &options=RSnapshotOptions()) |
Save selected columns to disk, in a new TTree treename in file filename. | |
| template<typename... ColumnTypes> | |
| RResultPtr< RInterface< RLoopManager > > | ROOT::RDF::SnapshotImpl (std::string_view fullTreeName, std::string_view filename, const ColumnNames_t &columnList, const RSnapshotOptions &options) |
| template<typename V = RDFDetail::RInferredType, typename W = RDFDetail::RInferredType> | |
| RResultPtr< TStatistic > | ROOT::RDF::Stats (std::string_view value, std::string_view weight) |
| Return a TStatistic object, filled once per event (lazy action). | |
| template<typename V = RDFDetail::RInferredType> | |
| RResultPtr< TStatistic > | ROOT::RDF::Stats (std::string_view value="") |
| Return a TStatistic object, filled once per event (lazy action). | |
| template<typename T = RDFDetail::RInferredType> | |
| RResultPtr< double > | ROOT::RDF::StdDev (std::string_view columnName="") |
| Return the unbiased standard deviation of processed column values (lazy action). | |
| template<typename T = RDFDetail::RInferredType> | |
| RResultPtr< RDFDetail::SumReturnType_t< T > > | ROOT::RDF::Sum (std::string_view columnName="", const RDFDetail::SumReturnType_t< T > &initValue=RDFDetail::SumReturnType_t< T >{}) |
| Return the sum of processed column values (lazy action). | |
| template<typename T, typename COLL = std::vector<T>> | |
| RResultPtr< COLL > | ROOT::RDF::Take (std::string_view column="") |
| Return a collection of values of a column (lazy action, returns a std::vector by default). | |
| void | ROOT::Internal::RDF::TriggerRun (ROOT::RDF::RNode node) |
| Trigger the execution of an RDataFrame computation graph. | |
| RInterface< Proxied, DS_t > | ROOT::RDF::Vary (const std::vector< std::string > &colNames, std::string_view expression, const std::vector< std::string > &variationTags, std::string_view variationName) |
| Register systematic variations for multiple existing columns using custom variation tags. | |
| RInterface< Proxied, DS_t > | ROOT::RDF::Vary (const std::vector< std::string > &colNames, std::string_view expression, std::size_t nVariations, std::string_view variationName) |
| Register systematic variations for multiple existing columns using auto-generated variation tags. | |
| RInterface< Proxied, DS_t > | ROOT::RDF::Vary (std::initializer_list< std::string > colNames, std::string_view expression, std::size_t nVariations, std::string_view variationName) |
| Register systematic variations for multiple existing columns using auto-generated variation tags. | |
| template<typename Proxied, typename DataSource = void> | |
| ROOT::RDF::RInterface RInterfaceBase | ROOT::RDF::Vary (std::string_view colName, std::string_view expression, std::size_t nVariations, std::string_view variationName="") |
| template<typename F> | |
| RInterface< Proxied, DS_t > | Vary (const std::vector< std::string > &colNames, F &&expression, const ColumnNames_t &inputColumns, const std::vector< std::string > &variationTags, std::string_view variationName) |
| Register systematic variations for multiple existing columns using custom variation tags. | |
| template<typename F> | |
| RInterface< Proxied, DS_t > | Vary (std::initializer_list< std::string > colNames, F &&expression, const ColumnNames_t &inputColumns, const std::vector< std::string > &variationTags, std::string_view variationName) |
| Register systematic variations for multiple existing columns using custom variation tags. | |
| template<typename F> | |
| RInterface< Proxied, DS_t > | Vary (std::string_view colName, F &&expression, const ColumnNames_t &inputColumns, const std::vector< std::string > &variationTags, std::string_view variationName="") |
| Register systematic variations for a single existing column using custom variation tags. | |
| template<typename F> | |
| RInterface< Proxied, DS_t > | Vary (std::string_view colName, F &&expression, const ColumnNames_t &inputColumns, std::size_t nVariations, std::string_view variationName="") |
| Register systematic variations for a single existing column using auto-generated variation tags. | |
| template<bool IsSingleColumn, typename F> | |
| RInterface< Proxied, DS_t > | ROOT::RDF::VaryImpl (const std::vector< std::string > &colNames, F &&expression, const ColumnNames_t &inputColumns, const std::vector< std::string > &variationTags, std::string_view variationName) |
Variables | |
| std::shared_ptr< Proxied > | fProxiedPtr |
| Smart pointer to the graph node encapsulated by this RInterface. | |
| ROOT::RDF::RInterface | ROOT::RDF::Proxied |
| Register systematic variations for a single existing column using auto-generated variation tags. | |
| true | |
| Register systematic variations for multiple existing columns using auto-generated tags. | |
| using DS_t = DataSource |
Definition at line 939 of file RInterface.hxx.
| using RFilterBase = RDFDetail::RFilterBase |
Definition at line 940 of file RInterface.hxx.
| using RLoopManager = RDFDetail::RLoopManager |
Definition at line 942 of file RInterface.hxx.
| using RRangeBase = RDFDetail::RRangeBase |
Definition at line 941 of file RInterface.hxx.
| RInterface< Proxied, DS_t > Vary::Define | ( | std::string_view | name, |
| F | expression, | ||
| const ColumnNames_t & | columns = {} ) |
Define a new column.
| [in] | name | The name of the defined column. |
| [in] | expression | Function, lambda expression, functor class or any other callable object producing the defined value. Returns the value that will be assigned to the defined column. |
| [in] | columns | Names of the columns/branches in input to the producer function. |
Define a column that will be visible from all subsequent nodes of the functional chain. The expression is only evaluated for entries that pass all the preceding filters. A new variable is created called name, accessible as if it was contained in the dataset from subsequent transformations/actions.
Use cases include:
An exception is thrown if the name of the new column is already in use in this branch of the computation graph.
return statement (even if it is in a nested scope), RDataFrame will not add another one in front of the expression. So this will not work: Definition at line 1166 of file RInterface.hxx.
| RInterface< Proxied, DS_t > Vary::Define | ( | std::string_view | name, |
| std::string_view | expression ) |
Define a new column.
| [in] | name | The name of the defined column. |
| [in] | expression | An expression in C++ which represents the defined value |
The expression is just-in-time compiled and used to produce the column entries. It must be valid C++ syntax in which variable names are substituted with the names of branches/columns.
return statement (even if it is in a nested scope), RDataFrame will not add another one in front of the expression. So this will not work: Refer to the first overload of this method for the full documentation.
Definition at line 1253 of file RInterface.hxx.
| RInterface< Proxied, DS_t > Vary::DefinePerSample | ( | std::string_view | name, |
| F | expression ) |
Define a new column that is updated when the input sample changes.
| [in] | name | The name of the defined column. |
| [in] | expression | A C++ callable that computes the new value of the defined column. |
The signature of the callable passed as second argument should be T(unsigned int slot, const ROOT::RDF::RSampleInfo &id) where:
T is the type of the defined columnslot is a number in the range [0, nThreads) that is different for each processing thread. This can simplify the definition of thread-safe callables if you are interested in using parallel capabilities of RDataFrame.id is an instance of a ROOT::RDF::RSampleInfo object which contains information about the sample which is being processed (see the class docs for more information).DefinePerSample() is useful to e.g. define a quantity that depends on which TTree in which TFile is being processed or to inject a callback into the event loop that is only called when the processing of a new sample starts rather than at every entry.
The callable will be invoked once per input TTree or once per multi-thread task, whichever is more often.
Definition at line 1394 of file RInterface.hxx.
| RInterface< Proxied, DS_t > Vary::DefinePerSample | ( | std::string_view | name, |
| std::string_view | expression ) |
Define a new column that is updated when the input sample changes.
| [in] | name | The name of the defined column. |
| [in] | expression | A valid C++ expression as a string, which will be used to compute the defined value. |
The expression is just-in-time compiled and used to produce the column entries. It must be valid C++ syntax and the usage of the special variable names rdfslot_ and rdfsampleinfo_ is permitted, where these variables will take the same values as the slot and id parameters described at the DefinePerSample(std::string_view name, F expression) overload. See the documentation of that overload for more information.
rdfslot_ and rdfsampleinfo_ as input parameters. This is for example the correct way to call this overload when working in PyROOT: Definition at line 1455 of file RInterface.hxx.
| RInterface< Proxied, DS_t > Vary::DefineSlot | ( | std::string_view | name, |
| F | expression, | ||
| const ColumnNames_t & | columns = {} ) |
Define a new column with a value dependent on the processing slot.
| [in] | name | The name of the defined column. |
| [in] | expression | Function, lambda expression, functor class or any other callable object producing the defined value. Returns the value that will be assigned to the defined column. |
| [in] | columns | Names of the columns/branches in input to the producer function (excluding the slot number). |
This alternative implementation of Define is meant as a helper to evaluate new column values in a thread-safe manner. The expression must be a callable of signature R(unsigned int, T1, T2, ...) where T1, T2... are the types of the columns that the expression takes as input. The first parameter is reserved for an unsigned integer representing a "slot number". RDataFrame guarantees that different threads will invoke the expression with different slot numbers - slot numbers will range from zero to ROOT::GetThreadPoolSize()-1.
The following two calls are equivalent, although DefineSlot is slightly more performant:
See Define() for more information.
Definition at line 1195 of file RInterface.hxx.
| RInterface< Proxied, DS_t > Vary::DefineSlotEntry | ( | std::string_view | name, |
| F | expression, | ||
| const ColumnNames_t & | columns = {} ) |
Define a new column with a value dependent on the processing slot and the current entry.
| [in] | name | The name of the defined column. |
| [in] | expression | Function, lambda expression, functor class or any other callable object producing the defined value. Returns the value that will be assigned to the defined column. |
| [in] | columns | Names of the columns/branches in input to the producer function (excluding slot and entry). |
This alternative implementation of Define is meant as a helper in writing entry-specific, thread-safe custom columns. The expression must be a callable of signature R(unsigned int, ULong64_t, T1, T2, ...) where T1, T2... are the types of the columns that the expression takes as input. The first parameter is reserved for an unsigned integer representing a "slot number". RDataFrame guarantees that different threads will invoke the expression with different slot numbers - slot numbers will range from zero to ROOT::GetThreadPoolSize()-1. The second parameter is reserved for a ULong64_t representing the current entry being processed by the current thread.
The following two Defines are equivalent, although DefineSlotEntry is slightly more performant:
See Define() for more information.
Definition at line 1225 of file RInterface.hxx.
| RInterface< RDFDetail::RFilter< F, Proxied >, DS_t > Vary::Filter | ( | F | f, |
| const ColumnNames_t & | columns = {}, | ||
| std::string_view | name = "" ) |
Append a filter to the call graph.
| [in] | f | Function, lambda expression, functor class or any other callable object. It must return a bool signalling whether the event has passed the selection (true) or not (false). |
| [in] | columns | Names of the columns/branches in input to the filter function. |
| [in] | name | Optional name of this filter. See Report. |
Append a filter node at the point of the call graph corresponding to the object this method is called on. The callable f should not have side-effects (e.g. modification of an external or static variable) to ensure correct results when implicit multi-threading is active.
RDataFrame only evaluates filters when necessary: if multiple filters are chained one after another, they are executed in order and the first one returning false causes the event to be discarded. Even if multiple actions or transformations depend on the same filter, it is executed once per entry. If its result is requested more than once, the cached result is served.
return statement (even if it is in a nested scope), RDataFrame will not add another one in front of the expression. So this will not work: Definition at line 1044 of file RInterface.hxx.
| RInterface< RDFDetail::RFilter< F, Proxied >, DS_t > Vary::Filter | ( | F | f, |
| const std::initializer_list< std::string > & | columns ) |
Append a filter to the call graph.
| [in] | f | Function, lambda expression, functor class or any other callable object. It must return a bool signalling whether the event has passed the selection (true) or not (false). |
| [in] | columns | Names of the columns/branches in input to the filter function. |
Refer to the first overload of this method for the full documentation.
Definition at line 1083 of file RInterface.hxx.
| RInterface< RDFDetail::RFilter< F, Proxied >, DS_t > Vary::Filter | ( | F | f, |
| std::string_view | name ) |
Append a filter to the call graph.
| [in] | f | Function, lambda expression, functor class or any other callable object. It must return a bool signalling whether the event has passed the selection (true) or not (false). |
| [in] | name | Optional name of this filter. See Report. |
Refer to the first overload of this method for the full documentation.
Definition at line 1067 of file RInterface.hxx.
| RInterface< RDFDetail::RJittedFilter, DS_t > Vary::Filter | ( | std::string_view | expression, |
| std::string_view | name = "" ) |
Append a filter to the call graph.
| [in] | expression | The filter expression in C++ |
| [in] | name | Optional name of this filter. See Report. |
The expression is just-in-time compiled and used to filter entries. It must be valid C++ syntax in which variable names are substituted with the names of branches/columns.
return statement (even if it is in a nested scope), RDataFrame will not add another one in front of the expression. So this will not work: Definition at line 1113 of file RInterface.hxx.
| Vary::operator RNode | ( | ) | const |
Cast any RDataFrame node to a common type ROOT::RDF::RNode.
Different RDataFrame methods return different C++ types. All nodes, however, can be cast to this common type at the cost of a small performance penalty. This allows, for example, storing RDataFrame nodes in a vector, or passing them around via (non-template, C++11) helper functions. Example usage:
Note that it is not a problem to pass RNode's by value.
Definition at line 998 of file RInterface.hxx.
|
default |
Copy-assignment operator for RInterface.
|
default |
Move-assignment operator for RInterface.
| RInterface< Proxied, DS_t > Vary::Redefine | ( | std::string_view | name, |
| F | expression, | ||
| const ColumnNames_t & | columns = {} ) |
Overwrite the value and/or type of an existing column.
| [in] | name | The name of the column to redefine. |
| [in] | expression | Function, lambda expression, functor class or any other callable object producing the defined value. Returns the value that will be assigned to the defined column. |
| [in] | columns | Names of the columns/branches in input to the expression. |
The old value of the column can be used as an input for the expression.
An exception is thrown in case the column to redefine does not already exist. See Define() for more information.
Definition at line 1285 of file RInterface.hxx.
| RInterface< Proxied, DS_t > Vary::Redefine | ( | std::string_view | name, |
| std::string_view | expression ) |
Overwrite the value and/or type of an existing column.
| [in] | name | The name of the column to redefine. |
| [in] | expression | An expression in C++ which represents the defined value |
The expression is just-in-time compiled and used to produce the column entries. It must be valid C++ syntax in which variable names are substituted with the names of branches/columns.
The old value of the column can be used as an input for the expression. An exception is thrown in case the column to re-define does not already exist.
Aliases cannot be overridden. See the corresponding Define() overload for more information.
Definition at line 1343 of file RInterface.hxx.
| RInterface< Proxied, DS_t > Vary::RedefineSlot | ( | std::string_view | name, |
| F | expression, | ||
| const ColumnNames_t & | columns = {} ) |
Overwrite the value and/or type of an existing column.
| [in] | name | The name of the column to redefine. |
| [in] | expression | Function, lambda expression, functor class or any other callable object producing the defined value. Returns the value that will be assigned to the defined column. |
| [in] | columns | Names of the columns/branches in input to the producer function (excluding slot). |
The old value of the column can be used as an input for the expression. An exception is thrown in case the column to redefine does not already exist.
See DefineSlot() for more information.
Definition at line 1304 of file RInterface.hxx.
| RInterface< Proxied, DS_t > Vary::RedefineSlotEntry | ( | std::string_view | name, |
| F | expression, | ||
| const ColumnNames_t & | columns = {} ) |
Overwrite the value and/or type of an existing column.
| [in] | name | The name of the column to redefine. |
| [in] | expression | Function, lambda expression, functor class or any other callable object producing the defined value. Returns the value that will be assigned to the defined column. |
| [in] | columns | Names of the columns/branches in input to the producer function (excluding slot and entry). |
The old value of the column can be used as an input for the expression. An exception is thrown in case the column to re-define does not already exist.
See DefineSlotEntry() for more information.
Definition at line 1323 of file RInterface.hxx.
|
default |
Copy-ctor for RInterface.
| Vary::RInterface | ( | const std::shared_ptr< RLoopManager > & | proxied | ) |
Build a RInterface from a RLoopManager.
This constructor is only available for RInterface<RLoopManager>.
Definition at line 976 of file RInterface.hxx.
|
default |
Move-ctor for RInterface.
| RInterface< Proxied, DS_t > Vary::Vary | ( | const std::vector< std::string > & | colNames, |
| F && | expression, | ||
| const ColumnNames_t & | inputColumns, | ||
| const std::vector< std::string > & | variationTags, | ||
| std::string_view | variationName ) |
Register systematic variations for multiple existing columns using custom variation tags.
| [in] | colNames | set of names of the columns for which varied values are provided. |
| [in] | expression | a callable that evaluates the varied values for the specified columns. The callable can take any column values as input, similarly to what happens during Filter and Define calls. It must return an RVec of varied values, one for each variation tag, in the same order as the tags. |
| [in] | inputColumns | the names of the columns to be passed to the callable. |
| [in] | variationTags | names for each of the varied values, e.g. "up" and "down". |
| [in] | variationName | a generic name for this set of varied values, e.g. "ptvariation" |
This overload of Vary takes a list of column names as first argument and requires that the expression returns an RVec of RVecs of values: one inner RVec for the variations of each affected column. The variationTags are defined as {"down", "up"}.
Example usage:
Definition at line 1609 of file RInterface.hxx.
| RInterface< Proxied, DS_t > Vary::Vary | ( | std::initializer_list< std::string > | colNames, |
| F && | expression, | ||
| const ColumnNames_t & | inputColumns, | ||
| const std::vector< std::string > & | variationTags, | ||
| std::string_view | variationName ) |
Register systematic variations for multiple existing columns using custom variation tags.
| [in] | colNames | set of names of the columns for which varied values are provided. |
| [in] | expression | a callable that evaluates the varied values for the specified columns. The callable can take any column values as input, similarly to what happens during Filter and Define calls. It must return an RVec of varied values, one for each variation tag, in the same order as the tags. |
| [in] | inputColumns | the names of the columns to be passed to the callable. |
| [in] | variationTags | names for each of the varied values, e.g. "up" and "down". |
| [in] | variationName | a generic name for this set of varied values, e.g. "ptvariation". colName is used if none is provided. |
Definition at line 1631 of file RInterface.hxx.
| RInterface< Proxied, DS_t > Vary::Vary | ( | std::string_view | colName, |
| F && | expression, | ||
| const ColumnNames_t & | inputColumns, | ||
| const std::vector< std::string > & | variationTags, | ||
| std::string_view | variationName = "" ) |
Register systematic variations for a single existing column using custom variation tags.
| [in] | colName | name of the column for which varied values are provided. |
| [in] | expression | a callable that evaluates the varied values for the specified columns. The callable can take any column values as input, similarly to what happens during Filter and Define calls. It must return an RVec of varied values, one for each variation tag, in the same order as the tags. |
| [in] | inputColumns | the names of the columns to be passed to the callable. |
| [in] | variationTags | names for each of the varied values, e.g. "up" and "down". |
| [in] | variationName | a generic name for this set of varied values, e.g. "ptvariation". |
Vary provides a natural and flexible syntax to define systematic variations that automatically propagate to Filters, Defines and results. RDataFrame usage of columns with attached variations does not change, but for results that depend on any varied quantity, a map/dictionary of varied results can be produced with ROOT::RDF::Experimental::VariationsFor (see the example below).
The dictionary will contain a "nominal" value (accessed with the "nominal" key) for the unchanged result, and values for each of the systematic variations that affected the result (via upstream Filters or via direct or indirect dependencies of the column values on some registered variations). The keys will be a composition of variation names and tags, e.g. "pt:up" and "pt:down" for the example below.
In the following example we add up/down variations of pt and fill a histogram with a quantity that depends on pt. We automatically obtain three histograms in output ("nominal", "pt:up" and "pt:down"):
RDataFrame computes all variations as part of a single loop over the data. In particular, this means that I/O and computation of values shared among variations only happen once for all variations. Thus, the event loop run-time typically scales much better than linearly with the number of variations.
RDataFrame lazily computes the varied values required to produce the outputs of VariationsFor(). If VariationsFor() was not called for a result, the computations are only run for the nominal case.
See other overloads for examples when variations are added for multiple existing columns, or when the tags are auto-generated instead of being directly defined.
Definition at line 1521 of file RInterface.hxx.
| RInterface< Proxied, DS_t > Vary::Vary | ( | std::string_view | colName, |
| F && | expression, | ||
| const ColumnNames_t & | inputColumns, | ||
| std::size_t | nVariations, | ||
| std::string_view | variationName = "" ) |
Register systematic variations for a single existing column using auto-generated variation tags.
| [in] | colName | name of the column for which varied values are provided. |
| [in] | expression | a callable that evaluates the varied values for the specified columns. The callable can take any column values as input, similarly to what happens during Filter and Define calls. It must return an RVec of varied values, one for each variation tag, in the same order as the tags. |
| [in] | inputColumns | the names of the columns to be passed to the callable. |
| [in] | nVariations | number of variations returned by the expression. The corresponding tags will be "0", "1", etc. |
| [in] | variationName | a generic name for this set of varied values, e.g. "ptvariation". colName is used if none is provided. |
This overload of Vary takes an nVariations parameter instead of a list of tag names. The varied results will be accessible via the keys of the dictionary with the form variationName:N where N is the corresponding sequential tag starting at 0 and going up to nVariations - 1.
Example usage:
Definition at line 1560 of file RInterface.hxx.
| std::shared_ptr<Proxied> fProxiedPtr |
Smart pointer to the graph node encapsulated by this RInterface.
Definition at line 953 of file RInterface.hxx.
| true |
Register systematic variations for multiple existing columns using auto-generated tags.
| [in] | colNames | set of names of the columns for which varied values are provided. |
| [in] | expression | a callable that evaluates the varied values for the specified columns. The callable can take any column values as input, similarly to what happens during Filter and Define calls. It must return an RVec of varied values, one for each variation tag, in the same order as the tags. |
| [in] | inputColumns | the names of the columns to be passed to the callable. |
| [in] | nVariations | number of variations returned by the expression. The corresponding tags will be "0", "1", etc. |
| [in] | variationName | a generic name for this set of varied values, e.g. "ptvariation". colName is used if none is provided. |
This overload of Vary takes a list of column names as first argument. It takes an nVariations parameter instead of a list of tag names (variationTags). Tag names will be auto-generated as the sequence 0...nVariations-1. / / Example usage: / ~~~{.cpp} / auto nominal_hx = / df.Vary({"pt", "eta"}, // the columns that will vary simultaneously / [](double pt, double eta) { return RVec<RVecF>{{pt*0.9, pt*1.1}, {eta*0.9, eta*1.1}}; }, / {"pt", "eta"}, // inputs to the Vary expression, independent of what columns are varied / 2, // auto-generated variation tags / "ptAndEta") // variation name / .Histo1D("pt", "eta"); / / auto hx = ROOT::RDF::Experimental::VariationsFor(nominal_hx); / hx["nominal"].Draw(); / hx["ptAndEta:0"].Draw("SAME"); / hx["ptAndEta:1"].Draw("SAME"); / ~~~ / /
std::vector<std::string> variationTags; variationTags.reserve(nVariations); for (std::size_t i = 0u; i < nVariations; ++i) variationTags.emplace_back(std::to_string(i));
return Vary(colNames, std::forward<F>(expression), inputColumns, std::move(variationTags), variationName); }
/ Register systematic variations for for multiple existing columns using custom variation tags. /
| [in] | colNames | set of names of the columns for which varied values are provided. / |
| [in] | expression | a callable that evaluates the varied values for the specified columns. The callable can / take any column values as input, similarly to what happens during Filter and Define calls. It must / return an RVec of varied values, one for each variation tag, in the same order as the tags. / |
| [in] | inputColumns | the names of the columns to be passed to the callable. / |
| [in] | inputColumns | the names of the columns to be passed to the callable. / |
| [in] | nVariations | number of variations returned by the expression. The corresponding tags will be "0", / "1", etc. / |
| [in] | variationName | a generic name for this set of varied values, e.g. "ptvariation". / colName is used if none is provided. / / |
/ Register systematic variations for a single existing column using custom variation tags. /
| [in] | colName | name of the column for which varied values are provided. / |
| [in] | expression | a string containing valid C++ code that evaluates to an RVec containing the varied / values for the specified column. / |
| [in] | variationTags | names for each of the varied values, e.g. "up" and "down". / |
| [in] | variationName | a generic name for this set of varied values, e.g. "ptvariation". / colName is used if none is provided. / / This overload adds the possibility for the expression used to evaluate the varied values to be just-in-time / compiled. The example below shows how Vary() is used while dealing with a single column. The variation tags are / defined as {"down", "up"}. / ~~~{.cpp} / auto nominal_hx = / df.Vary("pt", "ROOT::RVecD{pt*0.9, pt*1.1}", {"down", "up"}) / .Filter("pt > k") / .Define("x", someFunc, {"pt"}) / .Histo1D("x"); / / auto hx = ROOT::RDF::Experimental::VariationsFor(nominal_hx); / hx["nominal"].Draw(); / hx["pt:down"].Draw("SAME"); / hx["pt:up"].Draw("SAME"); / ~~~ / / |
return JittedVaryImpl(colNames, expression, variationTags, theVariationName, /*isSingleColumn=
Definition at line 1739 of file RInterface.hxx.