Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RDataFrame.hxx
Go to the documentation of this file.
1// Author: Enrico Guiraud, Danilo Piparo CERN 12/2016
2
3/*************************************************************************
4 * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11/**
12 \defgroup dataframe Dataframe
13ROOT's RDataFrame allows to analyse data stored in TTrees with a high level interface.
14*/
15
16#ifndef ROOT_RDATAFRAME
17#define ROOT_RDATAFRAME
18
19#include "TROOT.h" // To allow ROOT::EnableImplicitMT without including ROOT.h
22#include "ROOT/RDF/Utils.hxx"
23#include <string_view>
24#include "RtypesCore.h"
25
26#include <initializer_list>
27#include <memory>
28#include <string>
29#include <vector>
30
31class TDirectory;
32class TTree;
33
34namespace ROOT {
35namespace RDF {
36class RDataSource;
37}
38
40
41class RDataFrame : public ROOT::RDF::RInterface<RDFDetail::RLoopManager> {
42public:
44 RDataFrame(std::string_view treeName, std::string_view filenameglob, const ColumnNames_t &defaultColumns = {});
45 RDataFrame(std::string_view treename, const std::vector<std::string> &filenames,
46 const ColumnNames_t &defaultColumns = {});
47 RDataFrame(std::string_view treename, std::initializer_list<std::string> filenames,
48 const ColumnNames_t &defaultColumns = {}):
49 RDataFrame(treename, std::vector<std::string>(filenames), defaultColumns) {}
50 RDataFrame(std::string_view treeName, ::TDirectory *dirPtr, const ColumnNames_t &defaultColumns = {});
51 RDataFrame(TTree &tree, const ColumnNames_t &defaultColumns = {});
52 RDataFrame(ULong64_t numEntries);
53 RDataFrame(std::unique_ptr<ROOT::RDF::RDataSource>, const ColumnNames_t &defaultColumns = {});
55
56 // Rule of five
57
58 RDataFrame(const RDataFrame &) = default;
59 RDataFrame &operator=(const RDataFrame &) = default;
60 RDataFrame(RDataFrame &&) = default;
63};
64
65namespace RDF {
66namespace Experimental {
67
68////////////////////////////////////////////////////////////////////////////////////////////////
69/// \brief Factory method to create an RDataFrame from a JSON specification file.
70/// \param[in] jsonFile Path of the JSON file, which should follow the format described in
71/// https://github.com/root-project/root/issues/11624
72ROOT::RDataFrame FromSpec(const std::string &jsonFile);
73
74} // namespace Experimental
75} // namespace RDF
76
77} // ns ROOT
78
79/// Print a RDataFrame at the prompt
80namespace cling {
81std::string printValue(ROOT::RDataFrame *tdf);
82} // ns cling
83
84#endif // ROOT_RDATAFRAME
unsigned long long ULong64_t
Definition RtypesCore.h:70
The dataset specification for RDataFrame.
The public interface to the RDataFrame federation of classes.
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
RDataFrame(std::string_view treename, std::initializer_list< std::string > filenames, const ColumnNames_t &defaultColumns={})
RDataFrame(std::string_view treeName, ::TDirectory *dirPtr, const ColumnNames_t &defaultColumns={})
RDataFrame(std::string_view treeName, std::string_view filenameglob, const ColumnNames_t &defaultColumns={})
Build the dataframe.
ROOT::RDF::ColumnNames_t ColumnNames_t
RDataFrame(RDataFrame &&)=default
RDataFrame(const RDataFrame &)=default
RDataFrame & operator=(const RDataFrame &)=default
RDataFrame & operator=(RDataFrame &&)=default
Describe directory structure in memory.
Definition TDirectory.h:45
A TTree represents a columnar dataset.
Definition TTree.h:79
ROOT::RDataFrame FromSpec(const std::string &jsonFile)
Factory method to create an RDataFrame from a JSON specification file.
std::vector< std::string > ColumnNames_t
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...