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 RDataFrame
13This is an overview of classes that are part of the RDataFrame package.
14\note The main entry point for the RDataFrame API is \ref ROOT::RDataFrame.
15
16ROOT::RDataFrame allows to analyse data with a high-level interface.
17It reads TTree, RNTuple, and various other inputs (see \ref ROOT::RDF::RDataSource and
18its derived classes), and supports filtering events, computing new quantities, and producing
19output such as histograms and new datasets.
20*/
21
22#ifndef ROOT_RDATAFRAME
23#define ROOT_RDATAFRAME
24
25#include "TROOT.h" // To allow ROOT::EnableImplicitMT without including ROOT.h
27#include "ROOT/RDF/Utils.hxx"
28#include <string_view>
29#include "RtypesCore.h"
30
31#include <initializer_list>
32#include <memory>
33#include <string>
34#include <vector>
35
36class TDirectory;
37class TTree;
38
40class RDatasetSpec;
41}
42
43namespace ROOT {
44namespace RDF {
45class RDataSource;
46}
47
48namespace RDFDetail = ROOT::Detail::RDF;
49
50class RDataFrame : public ROOT::RDF::RInterface<RDFDetail::RLoopManager> {
51public:
53 RDataFrame(std::string_view treeName, std::string_view filenameglob, const ColumnNames_t &defaultColumns = {});
54 RDataFrame(std::string_view treename, const std::vector<std::string> &filenames,
55 const ColumnNames_t &defaultColumns = {});
56 RDataFrame(std::string_view treename, std::initializer_list<std::string> filenames,
57 const ColumnNames_t &defaultColumns = {}):
58 RDataFrame(treename, std::vector<std::string>(filenames), defaultColumns) {}
59 RDataFrame(std::string_view treeName, ::TDirectory *dirPtr, const ColumnNames_t &defaultColumns = {});
60 RDataFrame(TTree &tree, const ColumnNames_t &defaultColumns = {});
61 RDataFrame(ULong64_t numEntries);
62 RDataFrame(std::unique_ptr<ROOT::RDF::RDataSource>, const ColumnNames_t &defaultColumns = {});
63 RDataFrame(ROOT::RDF::Experimental::RDatasetSpec spec);
64};
65
66namespace RDF {
67namespace Experimental {
68
69////////////////////////////////////////////////////////////////////////////////////////////////
70/// \brief Factory method to create an RDataFrame from a JSON specification file.
71/// \param[in] jsonFile Path of the JSON file, which should follow the format described in
72/// https://github.com/root-project/root/issues/11624
73ROOT::RDataFrame FromSpec(const std::string &jsonFile);
74
75} // namespace Experimental
76} // namespace RDF
77
78} // ns ROOT
79
80/// Print a RDataFrame at the prompt
81namespace cling {
82std::string printValue(ROOT::RDataFrame *tdf);
83} // ns cling
84
85#endif // ROOT_RDATAFRAME
Basic types used by ROOT and required by TInterpreter.
unsigned long long ULong64_t
Portable unsigned long integer 8 bytes.
Definition RtypesCore.h:84
The dataset specification for RDataFrame.
RDataSource defines an API that RDataFrame can use to read arbitrary data formats.
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
Describe directory structure in memory.
Definition TDirectory.h:45
A TTree represents a columnar dataset.
Definition TTree.h:89
STL class.
STL class.
ROOT::RDataFrame FromSpec(const std::string &jsonFile)
Factory method to create an RDataFrame from a JSON specification file.
std::vector< std::string > ColumnNames_t