Logo ROOT   6.14/05
Reference Guide
RDataFrame.hxx
Go to the documentation of this file.
1 // Author: Enrico Guiraud, Danilo Piparo CERN 12/2016
2 
3 /*************************************************************************
4  * Copyright (C) 1995-2016, 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
13 ROOT'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 <sstream> // std::ostringstream
20 #include <memory>
21 #include <ostream>
22 #include <string>
23 #include <vector>
24 
25 #include "ROOT/RCutFlowReport.hxx"
26 #include "ROOT/RDFInterface.hxx"
27 #include "ROOT/RDFNodes.hxx"
28 #include "ROOT/RDFUtils.hxx"
29 #include "ROOT/RDataSource.hxx"
30 #include "ROOT/TypeTraits.hxx"
31 #include "ROOT/RStringView.hxx"
32 #include "RtypesCore.h"
33 #include "TTree.h"
34 
35 class TDirectory;
36 
37 namespace ROOT {
38 namespace RDFDetail = ROOT::Detail::RDF;
40 namespace TTraits = ROOT::TypeTraits;
41 
42 class RDataFrame : public ROOT::RDF::RInterface<RDFDetail::RLoopManager> {
43 
44 public:
45  using ColumnNames_t = RDFDetail::ColumnNames_t;
47  RDataFrame(std::string_view treeName, std::string_view filenameglob, const ColumnNames_t &defaultBranches = {});
48  RDataFrame(std::string_view treename, const std::vector<std::string> &filenames,
49  const ColumnNames_t &defaultBranches = {});
50  RDataFrame(std::string_view treeName, ::TDirectory *dirPtr, const ColumnNames_t &defaultBranches = {});
51  RDataFrame(TTree &tree, const ColumnNames_t &defaultBranches = {});
52  RDataFrame(ULong64_t numEntries);
53  RDataFrame(std::unique_ptr<RDataSource>, const ColumnNames_t &defaultBranches = {});
54 };
55 
56 } // end NS ROOT
57 
58 /// Print a RDataFrame at the prompt
59 namespace cling {
60 std::string printValue(ROOT::RDataFrame *tdf);
61 } // namespace cling
62 
63 #endif // ROOT_TDATAFRAME
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
The public interface to the RDataFrame federation of classes.
ROOT&#39;s RDataFrame offers a high level interface for analyses of data stored in TTrees, CSV&#39;s and other data formats.
Definition: RDataFrame.hxx:42
Describe directory structure in memory.
Definition: TDirectory.h:34
unsigned long long ULong64_t
Definition: RtypesCore.h:70
Print a TSeq at the prompt:
Definition: TDatime.h:115
basic_string_view< char > string_view
Definition: RStringView.hxx:35
ROOT type_traits extensions.
Definition: TypeTraits.hxx:23
RDataFrame(std::string_view treeName, std::string_view filenameglob, const ColumnNames_t &defaultBranches={})
Build the dataframe.
Definition: RDataFrame.cxx:718
Definition: tree.py:1
A TTree object has a header with a name and a title.
Definition: TTree.h:70
RDataSource defines an API that RDataFrame can use to read arbitrary data formats.
Definition: RDataSource.hxx:91
RDFDetail::ColumnNames_t ColumnNames_t
Definition: RDataFrame.hxx:45
std::string printValue(ROOT::RDataFrame *tdf)
Print a RDataFrame at the prompt.
Definition: RDataFrame.cxx:789