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 "ROOT/RStringView.hxx"
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>(std::move(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
57namespace RDF {
58namespace Experimental {
59
60////////////////////////////////////////////////////////////////////////////////////////////////
61/// \brief Factory method to create an RDataFrame from a JSON specification file.
62/// \param[in] jsonFile Path of the JSON file, which should follow the format described in
63/// https://github.com/root-project/root/issues/11624
64ROOT::RDataFrame FromSpec(const std::string &jsonFile);
65
66} // namespace Experimental
67} // namespace RDF
68
69} // ns ROOT
70
71/// Print a RDataFrame at the prompt
72namespace cling {
73std::string printValue(ROOT::RDataFrame *tdf);
74} // ns cling
75
76#endif // ROOT_RDATAFRAME
unsigned long long ULong64_t
Definition RtypesCore.h:81
A 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
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
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
Definition tree.py:1