Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/ROOT/RDataFrame.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Author: Enrico Guiraud, Danilo Piparo CERN  12/2016
0002 
0003 /*************************************************************************
0004  * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers.               *
0005  * All rights reserved.                                                  *
0006  *                                                                       *
0007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0009  *************************************************************************/
0010 
0011 /**
0012   \defgroup dataframe Dataframe
0013 ROOT's RDataFrame allows to analyse data stored in TTrees with a high level interface.
0014 */
0015 
0016 #ifndef ROOT_RDATAFRAME
0017 #define ROOT_RDATAFRAME
0018 
0019 #include "TROOT.h" // To allow ROOT::EnableImplicitMT without including ROOT.h
0020 #include "ROOT/RDF/RInterface.hxx"
0021 #include "ROOT/RDF/Utils.hxx"
0022 #include <string_view>
0023 #include "RtypesCore.h"
0024 
0025 #include <initializer_list>
0026 #include <memory>
0027 #include <string>
0028 #include <vector>
0029 
0030 class TDirectory;
0031 class TTree;
0032 
0033 namespace ROOT::RDF::Experimental{
0034 class RDatasetSpec;
0035 }
0036 
0037 namespace ROOT {
0038 namespace RDF {
0039 class RDataSource;
0040 }
0041 
0042 namespace RDFDetail = ROOT::Detail::RDF;
0043 
0044 class RDataFrame : public ROOT::RDF::RInterface<RDFDetail::RLoopManager> {
0045 public:
0046    using ColumnNames_t = ROOT::RDF::ColumnNames_t;
0047    RDataFrame(std::string_view treeName, std::string_view filenameglob, const ColumnNames_t &defaultColumns = {});
0048    RDataFrame(std::string_view treename, const std::vector<std::string> &filenames,
0049               const ColumnNames_t &defaultColumns = {});
0050    RDataFrame(std::string_view treename, std::initializer_list<std::string> filenames,
0051               const ColumnNames_t &defaultColumns = {}):
0052               RDataFrame(treename, std::vector<std::string>(filenames), defaultColumns) {}
0053    RDataFrame(std::string_view treeName, ::TDirectory *dirPtr, const ColumnNames_t &defaultColumns = {});
0054    RDataFrame(TTree &tree, const ColumnNames_t &defaultColumns = {});
0055    RDataFrame(ULong64_t numEntries);
0056    RDataFrame(std::unique_ptr<ROOT::RDF::RDataSource>, const ColumnNames_t &defaultColumns = {});
0057    RDataFrame(ROOT::RDF::Experimental::RDatasetSpec spec);
0058 
0059    // Rule of five
0060 
0061    RDataFrame(const RDataFrame &) = default;
0062    RDataFrame &operator=(const RDataFrame &) = default;
0063    RDataFrame(RDataFrame &&) = default;
0064    RDataFrame &operator=(RDataFrame &&) = default;
0065    ~RDataFrame();
0066 };
0067 
0068 namespace RDF {
0069 namespace Experimental {
0070 
0071 ////////////////////////////////////////////////////////////////////////////////////////////////
0072 /// \brief Factory method to create an RDataFrame from a JSON specification file.
0073 /// \param[in] jsonFile Path of the JSON file, which should follow the format described in
0074 ///                     https://github.com/root-project/root/issues/11624
0075 ROOT::RDataFrame FromSpec(const std::string &jsonFile);
0076 
0077 } // namespace Experimental
0078 } // namespace RDF
0079 
0080 } // ns ROOT
0081 
0082 /// Print a RDataFrame at the prompt
0083 namespace cling {
0084 std::string printValue(ROOT::RDataFrame *tdf);
0085 } // ns cling
0086 
0087 #endif // ROOT_RDATAFRAME