Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
RDFUtils.cxx
Go to the documentation of this file.
1// Author: Enrico Guiraud, Danilo Piparo CERN 03/2017
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#include "RConfigure.h" // R__USE_IMT
12#include "ROOT/RDataSource.hxx"
15#include "ROOT/RDF/RSample.hxx"
17#include "ROOT/RDF/Utils.hxx"
18#include "ROOT/RLogger.hxx"
19#include "RtypesCore.h"
20#include "TBranch.h"
21#include "TBranchElement.h"
22#include "TClass.h"
23#include "TClassEdit.h"
24#include "TClassRef.h"
25#include "TError.h" // Info
26#include "TInterpreter.h"
27#include "TLeaf.h"
28#include "TROOT.h" // IsImplicitMTEnabled, GetThreadPoolSize
29#include "TTree.h"
30
31#include <stdexcept>
32#include <string>
33#include <cstring>
34#include <typeinfo>
35
36using namespace ROOT::Detail::RDF;
37using namespace ROOT::RDF;
38
40{
41 static RLogChannel c("ROOT.RDF");
42 return c;
43}
44
45namespace {
46using TypeInfoRef = std::reference_wrapper<const std::type_info>;
47struct TypeInfoRefHash {
48 std::size_t operator()(TypeInfoRef id) const { return id.get().hash_code(); }
49};
50
51struct TypeInfoRefEqualComp {
52 bool operator()(TypeInfoRef left, TypeInfoRef right) const { return left.get() == right.get(); }
53};
54} // namespace
55
56namespace ROOT {
57namespace Internal {
58namespace RDF {
59
60/// Return the type_info associated to a name. If the association fails, an
61/// exception is thrown.
62/// References and pointers are not supported since those cannot be stored in
63/// columns.
64const std::type_info &TypeName2TypeID(const std::string &name)
65{
66
67 const static std::unordered_map<std::string, TypeInfoRef> typeName2TypeIDMap{
68 {"char", typeid(char)},
69 {"Char_t", typeid(char)},
70 {"unsigned char", typeid(unsigned char)},
71 {"UChar_t", typeid(unsigned char)},
72 {"int", typeid(int)},
73 {"Int_t", typeid(int)},
74 {"unsigned", typeid(unsigned int)},
75 {"unsigned int", typeid(unsigned int)},
76 {"UInt_t", typeid(unsigned int)},
77 {"short", typeid(short)},
78 {"short int", typeid(short)},
79 {"Short_t", typeid(short)},
80 {"unsigned short", typeid(unsigned short)},
81 {"unsigned short int", typeid(unsigned short)},
82 {"UShort_t", typeid(unsigned short)},
83 {"long", typeid(long)},
84 {"long int", typeid(long)},
85 {"Long_t", typeid(long)},
86 {"unsigned long", typeid(unsigned long)},
87 {"unsigned long int", typeid(unsigned long)},
88 {"ULong_t", typeid(unsigned long)},
89 {"double", typeid(double)},
90 {"Double_t", typeid(double)},
91 {"float", typeid(float)},
92 {"Float_t", typeid(float)},
93 {"long long", typeid(long long)},
94 {"long long int", typeid(long long)},
95 {"Long64_t", typeid(long long)},
96 {"unsigned long long", typeid(unsigned long long)},
97 {"unsigned long long int", typeid(unsigned long long)},
98 {"ULong64_t", typeid(unsigned long long)},
99 {"bool", typeid(bool)},
100 {"Bool_t", typeid(bool)}};
101
102 if (auto it = typeName2TypeIDMap.find(name); it != typeName2TypeIDMap.end())
103 return it->second.get();
104
105 if (auto c = TClass::GetClass(name.c_str())) {
106 if (!c->GetTypeInfo()) {
107 throw std::runtime_error("Cannot extract type_info of type " + name + ".");
108 }
109 return *c->GetTypeInfo();
110 }
111
112 throw std::runtime_error("Cannot extract type_info of type " + name + ".");
113}
114
115/// Returns the name of a type starting from its type_info
116/// An empty string is returned in case of failure
117/// References and pointers are not supported since those cannot be stored in
118/// columns.
119/// Note that this function will take a lock and may be a potential source of
120/// contention in multithreaded execution.
121std::string TypeID2TypeName(const std::type_info &id)
122{
123 const static std::unordered_map<TypeInfoRef, std::string, TypeInfoRefHash, TypeInfoRefEqualComp> typeID2TypeNameMap{
124 {typeid(char), "char"}, {typeid(unsigned char), "unsigned char"},
125 {typeid(int), "int"}, {typeid(unsigned int), "unsigned int"},
126 {typeid(short), "short"}, {typeid(unsigned short), "unsigned short"},
127 {typeid(long), "long"}, {typeid(unsigned long), "unsigned long"},
128 {typeid(double), "double"}, {typeid(float), "float"},
129 {typeid(Long64_t), "Long64_t"}, {typeid(ULong64_t), "ULong64_t"},
130 {typeid(bool), "bool"}};
131
132 if (auto it = typeID2TypeNameMap.find(id); it != typeID2TypeNameMap.end())
133 return it->second;
134
135 if (auto c = TClass::GetClass(id)) {
136 return c->GetName();
137 }
138
139 return "";
140}
141
142std::string ComposeRVecTypeName(const std::string &valueType)
143{
144 return "ROOT::VecOps::RVec<" + valueType + ">";
145}
146
147std::string GetLeafTypeName(TLeaf *leaf, const std::string &colName)
148{
149 const char *colTypeCStr = leaf->GetTypeName();
150 std::string colType = colTypeCStr == nullptr ? "" : colTypeCStr;
151 if (colType.empty())
152 throw std::runtime_error("Could not deduce type of leaf " + colName);
153 if (leaf->GetLeafCount() != nullptr && leaf->GetLenStatic() == 1) {
154 // this is a variable-sized array
156 } else if (leaf->GetLeafCount() == nullptr && leaf->GetLenStatic() > 1) {
157 // this is a fixed-sized array (we do not differentiate between variable- and fixed-sized arrays)
159 } else if (leaf->GetLeafCount() != nullptr && leaf->GetLenStatic() > 1) {
160 // we do not know how to deal with this branch
161 throw std::runtime_error("TTree leaf " + colName +
162 " has both a leaf count and a static length. This is not supported.");
163 }
164
165 return colType;
166}
167
168/// Return the typename of object colName stored in t, if any. Return an empty string if colName is not in t.
169/// Supported cases:
170/// - leaves corresponding to single values, variable- and fixed-length arrays, with following syntax:
171/// - "leafname", as long as TTree::GetLeaf resolves it
172/// - "b1.b2...leafname", as long as TTree::GetLeaf("b1.b2....", "leafname") resolves it
173/// - TBranchElements, as long as TTree::GetBranch resolves their names
174std::string GetBranchOrLeafTypeName(TTree &t, const std::string &colName)
175{
176 // look for TLeaf either with GetLeaf(colName) or with GetLeaf(branchName, leafName) (splitting on last dot)
177 auto *leaf = t.GetLeaf(colName.c_str());
178 if (!leaf)
179 leaf = t.FindLeaf(colName.c_str()); // try harder
180 if (!leaf) {
181 // try splitting branchname and leafname
182 const auto dotPos = colName.find_last_of('.');
183 const auto hasDot = dotPos != std::string::npos;
184 if (hasDot) {
185 const auto branchName = colName.substr(0, dotPos);
186 const auto leafName = colName.substr(dotPos + 1);
187 leaf = t.GetLeaf(branchName.c_str(), leafName.c_str());
188 }
189 }
190 if (leaf)
191 return GetLeafTypeName(leaf, std::string(leaf->GetFullName()));
192
193 // we could not find a leaf named colName, so we look for a branch called like this
194 auto branch = t.GetBranch(colName.c_str());
195 if (!branch)
196 branch = t.FindBranch(colName.c_str()); // try harder
197 if (branch) {
198 static const TClassRef tbranchelement("TBranchElement");
199 if (branch->InheritsFrom(tbranchelement)) {
200 auto be = static_cast<TBranchElement *>(branch);
201 if (auto currentClass = be->GetCurrentClass())
202 return currentClass->GetName();
203 else {
204 // Here we have a special case for getting right the type of data members
205 // of classes sorted in TClonesArrays: ROOT-9674
206 auto mother = be->GetMother();
207 if (mother && mother->InheritsFrom(tbranchelement) && mother != be) {
208 auto beMom = static_cast<TBranchElement *>(mother);
209 auto beMomClass = beMom->GetClass();
210 if (beMomClass && 0 == std::strcmp("TClonesArray", beMomClass->GetName()))
211 return be->GetTypeName();
212 }
213 return be->GetClassName();
214 }
215 } else if (branch->IsA() == TBranch::Class() && branch->GetListOfLeaves()->GetEntriesUnsafe() == 1) {
216 // normal branch (not a TBranchElement): if it has only one leaf, we pick the type of the leaf:
217 // RDF and TTreeReader allow referring to branch.leaf as just branch if branch has only one leaf
218 leaf = static_cast<TLeaf *>(branch->GetListOfLeaves()->UncheckedAt(0));
219 return GetLeafTypeName(leaf, std::string(leaf->GetFullName()));
220 }
221 }
222
223 // we could not find a branch or a leaf called colName
224 return std::string();
225}
226
227/// Return a string containing the type of the given branch. Works both with real TTree branches and with temporary
228/// column created by Define. Throws if type name deduction fails.
229/// Note that for fixed- or variable-sized c-style arrays the returned type name will be RVec<T>.
230/// vector2RVec specifies whether typename 'std::vector<T>' should be converted to 'RVec<T>' or returned as is
231std::string ColumnName2ColumnTypeName(const std::string &colName, TTree *tree, RDataSource *ds, RDefineBase *define,
232 bool vector2RVec)
233{
234 std::string colType;
235
236 // must check defines first: we want Redefines to have precedence over everything else
237 if (define) {
238 colType = define->GetTypeName();
239 } else if (ds && ds->HasColumn(colName)) {
241 } else if (tree) {
244 std::vector<std::string> split;
245 int dummy;
246 TClassEdit::GetSplit(colType.c_str(), split, dummy);
247 auto &valueType = split[1];
249 }
250 }
251
252 if (colType.empty())
253 throw std::runtime_error("Column \"" + colName +
254 "\" is not in a dataset and is not a custom column been defined.");
255
256 return colType;
257}
258
259/// Convert type name (e.g. "Float_t") to ROOT type code (e.g. 'F') -- see TBranch documentation.
260/// Return a space ' ' in case no match was found.
261char TypeName2ROOTTypeName(const std::string &b)
262{
263 const static std::unordered_map<std::string, char> typeName2ROOTTypeNameMap{{"char", 'B'},
264 {"Char_t", 'B'},
265 {"unsigned char", 'b'},
266 {"UChar_t", 'b'},
267 {"int", 'I'},
268 {"Int_t", 'I'},
269 {"unsigned", 'i'},
270 {"unsigned int", 'i'},
271 {"UInt_t", 'i'},
272 {"short", 'S'},
273 {"short int", 'S'},
274 {"Short_t", 'S'},
275 {"unsigned short", 's'},
276 {"unsigned short int", 's'},
277 {"UShort_t", 's'},
278 {"long", 'G'},
279 {"long int", 'G'},
280 {"Long_t", 'G'},
281 {"unsigned long", 'g'},
282 {"unsigned long int", 'g'},
283 {"ULong_t", 'g'},
284 {"double", 'D'},
285 {"Double_t", 'D'},
286 {"float", 'F'},
287 {"Float_t", 'F'},
288 {"long long", 'L'},
289 {"long long int", 'L'},
290 {"Long64_t", 'L'},
291 {"unsigned long long", 'l'},
292 {"unsigned long long int", 'l'},
293 {"ULong64_t", 'l'},
294 {"bool", 'O'},
295 {"Bool_t", 'O'}};
296
297 if (auto it = typeName2ROOTTypeNameMap.find(b); it != typeName2ROOTTypeNameMap.end())
298 return it->second;
299
300 return ' ';
301}
302
303unsigned int GetNSlots()
304{
305 unsigned int nSlots = 1;
306#ifdef R__USE_IMT
309#endif // R__USE_IMT
310 return nSlots;
311}
312
313/// Replace occurrences of '.' with '_' in each string passed as argument.
314/// An Info message is printed when this happens. Dots at the end of the string are not replaced.
315/// An exception is thrown in case the resulting set of strings would contain duplicates.
316std::vector<std::string> ReplaceDotWithUnderscore(const std::vector<std::string> &columnNames)
317{
319 for (auto &col : newColNames) {
320 const auto dotPos = col.find('.');
321 if (dotPos != std::string::npos && dotPos != col.size() - 1 && dotPos != 0u) {
322 auto oldName = col;
323 std::replace(col.begin(), col.end(), '.', '_');
324 if (std::find(columnNames.begin(), columnNames.end(), col) != columnNames.end())
325 throw std::runtime_error("Column " + oldName + " would be written as " + col +
326 " but this column already exists. Please use Alias to select a new name for " +
327 oldName);
328 Info("Snapshot", "Column %s will be saved as %s", oldName.c_str(), col.c_str());
329 }
330 }
331
332 return newColNames;
333}
334
335void InterpreterDeclare(const std::string &code)
336{
337 R__LOG_DEBUG(10, RDFLogChannel()) << "Declaring the following code to cling:\n\n" << code << '\n';
338
339 if (!gInterpreter->Declare(code.c_str())) {
340 const auto msg =
341 "\nRDataFrame: An error occurred during just-in-time compilation. The lines above might indicate the cause of "
342 "the crash\n All RDF objects that have not run an event loop yet should be considered in an invalid state.\n";
343 throw std::runtime_error(msg);
344 }
345}
346
347void InterpreterCalc(const std::string &code, const std::string &context)
348{
349 if (code.empty())
350 return;
351
352 R__LOG_DEBUG(10, RDFLogChannel()) << "Jitting and executing the following code:\n\n" << code << '\n';
353
354 TInterpreter::EErrorCode errorCode(TInterpreter::kNoError); // storage for cling errors
355
356 auto callCalc = [&errorCode, &context](const std::string &codeSlice) {
357 gInterpreter->Calc(codeSlice.c_str(), &errorCode);
359 std::string msg = "\nAn error occurred during just-in-time compilation";
360 if (!context.empty())
361 msg += " in " + context;
362 msg +=
363 ". The lines above might indicate the cause of the crash\nAll RDF objects that have not run their event "
364 "loop yet should be considered in an invalid state.\n";
365 throw std::runtime_error(msg);
366 }
367 };
368
369 // Call Calc every 1000 newlines in order to avoid jitting a very large function body, which is slow:
370 // see https://github.com/root-project/root/issues/9312 and https://github.com/root-project/root/issues/7604
371 std::size_t substr_start = 0;
372 std::size_t substr_end = 0;
373 while (substr_end != std::string::npos && substr_start != code.size() - 1) {
374 for (std::size_t i = 0u; i < 1000u && substr_end != std::string::npos; ++i) {
375 substr_end = code.find('\n', substr_end + 1);
376 }
377 const std::string subs = code.substr(substr_start, substr_end - substr_start);
379
380 callCalc(subs);
381 }
382}
383
384bool IsInternalColumn(std::string_view colName)
385{
386 const auto str = colName.data();
387 const auto goodPrefix = colName.size() > 3 && // has at least more characters than {r,t}df
388 ('r' == str[0] || 't' == str[0]) && // starts with r or t
389 0 == strncmp("df", str + 1, 2); // 2nd and 3rd letters are df
390 return goodPrefix && '_' == colName.back(); // also ends with '_'
391}
392
393unsigned int GetColumnWidth(const std::vector<std::string>& names, const unsigned int minColumnSpace)
394{
395 auto columnWidth = 0u;
396 for (const auto& name : names) {
397 const auto length = name.length();
398 if (length > columnWidth)
400 }
402 return columnWidth;
403}
404
405void CheckReaderTypeMatches(const std::type_info &colType, const std::type_info &requestedType,
406 const std::string &colName)
407{
408 // We want to explicitly support the reading of bools as unsigned char, as
409 // this is quite common to circumvent the std::vector<bool> specialization.
410 const bool explicitlySupported = (colType == typeid(bool) && requestedType == typeid(unsigned char)) ? true : false;
411
412 // Here we compare names and not typeinfos since they may come from two different contexts: a compiled
413 // and a jitted one.
414 const auto diffTypes = (0 != std::strcmp(colType.name(), requestedType.name()));
415 auto inheritedType = [&]() {
417 return colTClass && colTClass->InheritsFrom(TClass::GetClass(requestedType));
418 };
419
421 const auto tName = TypeID2TypeName(requestedType);
422 const auto colTypeName = TypeID2TypeName(colType);
423 std::string errMsg = "RDataFrame: type mismatch: column \"" + colName + "\" is being used as ";
424 if (tName.empty()) {
425 errMsg += requestedType.name();
426 errMsg += " (extracted from type info)";
427 } else {
428 errMsg += tName;
429 }
430 errMsg += " but the Define or Vary node advertises it as ";
431 if (colTypeName.empty()) {
432 auto &id = colType;
433 errMsg += id.name();
434 errMsg += " (extracted from type info)";
435 } else {
437 }
438 throw std::runtime_error(errMsg);
439 }
440}
441
442bool IsStrInVec(const std::string &str, const std::vector<std::string> &vec)
443{
444 return std::find(vec.cbegin(), vec.cend(), str) != vec.cend();
445}
446
447auto RStringCache::Insert(const std::string &string) -> decltype(fStrings)::const_iterator
448{
449 {
450 std::shared_lock l{fMutex};
451 if (auto it = fStrings.find(string); it != fStrings.end())
452 return it;
453 }
454
455 // TODO: Would be nicer to use a lock upgrade strategy a-la TVirtualRWMutex
456 // but that is unfortunately not usable outside the already available ROOT mutexes
457 std::unique_lock l{fMutex};
458 if (auto it = fStrings.find(string); it != fStrings.end())
459 return it;
460
461 return fStrings.insert(string).first;
462}
463} // end NS RDF
464} // end NS Internal
465} // end NS ROOT
466
467std::string
472
474{
475 return df.GetTopLevelFieldNames();
476}
477
479{
480 return df.GetColumnNamesNoDuplicates();
481}
482
488
490{
491 return ds.DescribeDataset();
492}
493
496 const std::unordered_map<std::string, ROOT::RDF::Experimental::RSample *> &sampleMap)
497{
498 return ds.CreateSampleInfo(sampleMap);
499}
500
505
510
511std::unique_ptr<ROOT::Detail::RDF::RColumnReaderBase>
513 const std::type_info &tid, TTreeReader *treeReader)
514{
515 return ds.CreateColumnReader(slot, col, tid, treeReader);
516}
#define R__LOG_DEBUG(DEBUGLEVEL,...)
Definition RLogger.hxx:360
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
long long Long64_t
Definition RtypesCore.h:69
unsigned long long ULong64_t
Definition RtypesCore.h:70
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
char name[80]
Definition TGX11.cxx:110
#define gInterpreter
TRObject operator()(const T1 &t1) const
std::string GetTypeName() const
The head node of a RDF computation graph.
auto Insert(const std::string &string) -> decltype(fStrings)::const_iterator
Inserts the input string in the cache and returns an iterator to the cached string.
Definition RDFUtils.cxx:447
RDataSource defines an API that RDataFrame can use to read arbitrary data formats.
virtual const std::vector< std::string > & GetColumnNamesNoDuplicates() const
virtual std::string GetTypeNameWithOpts(std::string_view colName, bool) const
virtual const std::vector< std::string > & GetTopLevelFieldNames() const
This type represents a sample identifier, to be used in conjunction with RDataFrame features such as ...
A log configuration for a channel, e.g.
Definition RLogger.hxx:98
const_iterator begin() const
const_iterator end() const
A Branch for the case of an object.
static TClass * Class()
TClassRef is used to implement a permanent reference to a TClass object.
Definition TClassRef.h:29
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition TClass.cxx:3069
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition TLeaf.h:57
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
Definition TTreeReader.h:46
A TTree represents a columnar dataset.
Definition TTree.h:79
virtual TBranch * FindBranch(const char *name)
Return the branch that correspond to the path 'branchname', which can include the name of the tree or...
Definition TTree.cxx:4842
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
Definition TTree.cxx:5295
virtual TLeaf * GetLeaf(const char *branchname, const char *leafname)
Return pointer to the 1st Leaf named name in any Branch of this Tree or any branch in the list of fri...
Definition TTree.cxx:6198
virtual TLeaf * FindLeaf(const char *name)
Find leaf..
Definition TTree.cxx:4917
std::ostream & Info()
Definition hadd.cxx:171
ROOT::RLogChannel & RDFLogChannel()
Definition RDFUtils.cxx:39
void RunFinalChecks(const ROOT::RDF::RDataSource &ds, bool nodesLeftNotRun)
Definition RDFUtils.cxx:501
std::vector< std::string > ReplaceDotWithUnderscore(const std::vector< std::string > &columnNames)
Replace occurrences of '.
Definition RDFUtils.cxx:316
const std::type_info & TypeName2TypeID(const std::string &name)
Return the type_info associated to a name.
Definition RDFUtils.cxx:64
unsigned int GetNSlots()
Definition RDFUtils.cxx:303
std::string ComposeRVecTypeName(const std::string &valueType)
Definition RDFUtils.cxx:142
void CallInitializeWithOpts(ROOT::RDF::RDataSource &ds, const std::set< std::string > &suppressErrorsForMissingColumns)
Definition RDFUtils.cxx:483
std::string GetLeafTypeName(TLeaf *leaf, const std::string &colName)
Definition RDFUtils.cxx:147
const std::vector< std::string > & GetTopLevelFieldNames(const ROOT::RDF::RDataSource &ds)
Definition RDFUtils.cxx:473
char TypeName2ROOTTypeName(const std::string &b)
Convert type name (e.g.
Definition RDFUtils.cxx:261
std::string TypeID2TypeName(const std::type_info &id)
Returns the name of a type starting from its type_info An empty string is returned in case of failure...
Definition RDFUtils.cxx:121
bool IsStrInVec(const std::string &str, const std::vector< std::string > &vec)
Definition RDFUtils.cxx:442
unsigned int GetColumnWidth(const std::vector< std::string > &names, const unsigned int minColumnSpace=8u)
Get optimal column width for printing a table given the names and the desired minimal space between c...
Definition RDFUtils.cxx:393
std::string GetBranchOrLeafTypeName(TTree &t, const std::string &colName)
Return the typename of object colName stored in t, if any.
Definition RDFUtils.cxx:174
std::string DescribeDataset(ROOT::RDF::RDataSource &ds)
Definition RDFUtils.cxx:489
ROOT::RDF::RSampleInfo CreateSampleInfo(const ROOT::RDF::RDataSource &ds, const std::unordered_map< std::string, ROOT::RDF::Experimental::RSample * > &sampleMap)
Definition RDFUtils.cxx:494
std::unique_ptr< ROOT::Detail::RDF::RColumnReaderBase > CreateColumnReader(ROOT::RDF::RDataSource &ds, unsigned int slot, std::string_view col, const std::type_info &tid, TTreeReader *treeReader)
Definition RDFUtils.cxx:512
std::string ColumnName2ColumnTypeName(const std::string &colName, TTree *, RDataSource *, RDefineBase *, bool vector2RVec=true)
Return a string containing the type of the given branch.
Definition RDFUtils.cxx:231
void InterpreterCalc(const std::string &code, const std::string &context="")
Jit code in the interpreter with TInterpreter::Calc, throw in case of errors.
Definition RDFUtils.cxx:347
void CheckReaderTypeMatches(const std::type_info &colType, const std::type_info &requestedType, const std::string &colName)
Definition RDFUtils.cxx:405
bool IsInternalColumn(std::string_view colName)
Whether custom column with name colName is an "internal" column such as rdfentry_ or rdfslot_.
Definition RDFUtils.cxx:384
void ProcessMT(ROOT::RDF::RDataSource &ds, ROOT::Detail::RDF::RLoopManager &lm)
Definition RDFUtils.cxx:506
std::string GetTypeNameWithOpts(const ROOT::RDF::RDataSource &ds, std::string_view colName, bool vector2RVec)
Definition RDFUtils.cxx:468
void InterpreterDeclare(const std::string &code)
Declare code in the interpreter via the TInterpreter::Declare method, throw in case of errors.
Definition RDFUtils.cxx:335
const std::vector< std::string > & GetColumnNamesNoDuplicates(const ROOT::RDF::RDataSource &ds)
Definition RDFUtils.cxx:478
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.
Definition TROOT.cxx:570
UInt_t GetThreadPoolSize()
Returns the size of ROOT's thread pool.
Definition TROOT.cxx:577
@ kSTLvector
Definition ESTLType.h:30
ROOT::ESTLType IsSTLCont(std::string_view type)
type : type name: vector<list<classA,allocator>,allocator> result: 0 : not stl container code of cont...
int GetSplit(const char *type, std::vector< std::string > &output, int &nestedLoc, EModType mode=TClassEdit::kNone)
Stores in output (after emptying it) the split type.
TLine l
Definition textangle.C:4