16 #ifndef ROOT_TDATAFRAME
17 #define ROOT_TDATAFRAME
32 namespace Experimental {
33 namespace TDFDetail = ROOT::Detail::TDF;
34 namespace TDFInternal = ROOT::Internal::TDF;
40 TDataFrame(std::string_view treeName, std::string_view filenameglob,
const ColumnNames_t &defaultBranches = {});
52 template <
typename FILENAMESCOLL,
53 typename std::enable_if<TDFInternal::TIsContainer<FILENAMESCOLL>::fgValue,
int>
::type = 0>
54 TDataFrame(std::string_view treeName,
const FILENAMESCOLL &filenamescoll,
61 template <typename FILENAMESCOLL, typename std::enable_if<TDFInternal::TIsContainer<FILENAMESCOLL>::fgValue,
int>
::type>
66 const std::string treeNameInt(treeName);
67 auto chain =
new TChain(treeNameInt.c_str());
69 fProxiedPtr->SetTree(std::make_shared<TTree>(static_cast<TTree *>(chain)));
81 auto *
tree = df->GetTree();
82 auto defBranches = df->GetDefaultBranches();
83 auto tmpBranches = df->GetTmpBranches();
85 std::ostringstream ret;
87 ret <<
"A data frame built on top of the " <<
tree->GetName() <<
" dataset.";
88 if (!defBranches.empty()) {
89 if (defBranches.size() == 1)
90 ret <<
"\nDefault branch: " << defBranches[0];
92 ret <<
"\nDefault branches:\n";
93 for (
auto &&branch : defBranches) {
94 ret <<
" - " << branch <<
"\n";
99 ret <<
"A data frame that will create " << df->GetNEmptyEntries() <<
" entries\n";
106 #endif // ROOT_TDATAFRAME
TDataFrame(std::string_view treeName, std::string_view filenameglob, const ColumnNames_t &defaultBranches={})
Build the dataframe.
TDFDetail::ColumnNames_t ColumnNames_t
std::string printValue(const TDatime *val)
Print a TDatime at the prompt.
std::shared_ptr< TLoopManager > GetDataFrameChecked()
Get the TLoopManager if reachable. If not, throw.
const char * ToConstCharPtr(const char *s)
Describe directory structure in memory.
std::shared_ptr< TDFDetail::TLoopManager > fProxiedPtr
ROOT's TDataFrame offers a high level interface for analyses of data stored in TTrees.
A chain is a collection of files containing TTree objects.
A TTree object has a header with a name and a title.
The public interface to the TDataFrame federation of classes.
virtual Int_t Add(TChain *chain)
Add all files referenced by the passed chain to this chain.