19#ifndef ROOT_RDFOPERATIONS
20#define ROOT_RDFOPERATIONS
82 std::vector<TBranch *> fBranches;
83 std::vector<std::string> fNames;
88 auto it = std::find(fNames.begin(), fNames.end(),
name);
89 if (it == fNames.end())
91 return fBranches[std::distance(fNames.begin(), it)];
94 void Insert(
const std::string &
name,
TBranch *address)
96 if (address ==
nullptr) {
97 throw std::logic_error(
"Trying to insert a null branch address.");
99 if (std::find(fBranches.begin(), fBranches.end(), address) != fBranches.end()) {
100 throw std::logic_error(
"Trying to insert a branch address that's already present.");
102 if (std::find(fNames.begin(), fNames.end(),
name) != fNames.end()) {
103 throw std::logic_error(
"Trying to insert a branch name that's already present.");
105 fNames.emplace_back(
name);
106 fBranches.emplace_back(address);
119 [](
TBranch *
b) { return b->GetAddress() == nullptr; });
128 std::string
msg =
"RDataFrame::Snapshot:";
131 " is needed as it provides the size for one or more branches containing dynamically sized arrays, but "
137 msg.resize(
msg.size() - 2);
139 " are needed as they provide the size of other branches containing dynamically sized arrays, but they are";
141 msg +=
" not part of the set of branches that are being written out.";
142 throw std::runtime_error(
msg);
151using Results = std::conditional_t<std::is_same<T, bool>::value, std::deque<T>, std::vector<T>>;
165 template <
typename... Args>
166 void Exec(
unsigned int slot, Args &&... args)
169 static_assert(std::is_same<TypeList<std::decay_t<Args>...>, ColumnTypes_t>
::value,
"");
177 std::string GetActionName() {
return "ForeachSlot"; }
197 return std::make_unique<RMergeableCount>(*
fResultCount);
202 std::string GetActionName() {
return "Count"; }
211template <
typename RNode_t>
213 std::shared_ptr<RCutFlowReport>
fReport;
226 void Exec(
unsigned int ) {}
234 std::string GetActionName() {
return "Report"; }
238 auto &&
result = *
static_cast<std::shared_ptr<RCutFlowReport> *
>(
newResult);
240 std::static_pointer_cast<RNode_t>(fNode->GetVariedFilter(std::string(
variation))).get(),
256 using Buf_t = std::vector<BufEl_t>;
258 std::vector<Buf_t> fBuffers;
261 unsigned int fNSlots;
262 unsigned int fBufSize;
276 void Exec(
unsigned int slot,
double v,
double w);
290 void Exec(
unsigned int slot,
const T &
vs,
const W &ws)
319 void Exec(
unsigned int slot,
const T
v,
const W &ws)
329 Hist_t &PartialUpdate(
unsigned int);
338 return std::make_unique<RMergeableFill<Hist_t>>(*fResultHist);
341 std::string GetActionName()
350 result->SetDirectory(
nullptr);
361 using iterator_category = std::forward_iterator_tag;
362 using difference_type = std::ptrdiff_t;
363 using value_type = T;
365 using reference = T &;
375 if constexpr (IsDataContainer<T>::value) {
376 return std::begin(val);
384std::size_t GetSize(
const T &val)
386 if constexpr (IsDataContainer<T>::value) {
387 return std::size(val);
408template <
typename HIST = Hist_t>
410 std::vector<HIST *> fObjects;
414 auto Merge(std::vector<H *> &
objs,
int )
424 template <
typename H>
425 auto Merge(std::vector<H *> &
objs,
double )
426 ->
decltype(
objs[0]->Merge(std::vector<HIST *>{}),
void())
432 template <
typename T>
435 static_assert(
sizeof(T) < 0,
436 "The type passed to Fill does not provide a Merge(TCollection*) or Merge(const std::vector&) method.");
439 template <std::size_t
ColIdx,
typename End_t,
typename...
Its>
453 fObjects[0] =
h.get();
455 for (
unsigned int i = 1; i <
nSlots; ++i) {
456 fObjects[i] =
new HIST(*fObjects[0]);
464 template <
typename...
ValTypes, std::enable_if_t<!Disjunction<IsDataContainer<ValTypes>...>
::value,
int> = 0>
467 fObjects[
slot]->Fill(
x...);
471 template <
typename...
Xs, std::enable_if_t<Disjunction<IsDataContainer<Xs>...>
::value,
int> = 0>
475 constexpr std::array<
bool,
sizeof...(Xs)>
isContainer{IsDataContainer<Xs>::value...};
480 static_assert(
colidx <
sizeof...(Xs),
"Error: index of collection-type argument not found.");
486 std::array<std::size_t,
sizeof...(xs)>
sizes = {{GetSize(
xs)...}};
488 for (std::size_t i = 0; i <
sizeof...(xs); ++i) {
490 throw std::runtime_error(
"Cannot fill histogram with values in containers of different sizes.");
497 template <
typename T = HIST>
500 static_assert(
sizeof(T) < 0,
501 "When filling an object with RDataFrame (e.g. via a Fill action) the number or types of the "
502 "columns passed did not match the signature of the object's `Fill` method.");
509 if (fObjects.size() == 1)
515 for (
auto it = ++fObjects.begin(); it != fObjects.end(); ++it)
519 HIST &PartialUpdate(
unsigned int slot) {
return *fObjects[
slot]; }
524 return std::make_unique<RMergeableFill<HIST>>(*fObjects[0]);
529 std::string GetActionName()
531 return std::string(fObjects[0]->
IsA()->GetName()) +
"\\n" + std::string(fObjects[0]->GetName());
536 std::string GetActionName()
538 return "Fill custom object";
541 template <
typename H = HIST>
556 std::vector<::TGraph *> fGraphs;
564 fGraphs[0] =
g.get();
566 for (
unsigned int i = 1; i <
nSlots; ++i) {
567 fGraphs[i] =
new TGraph(*fGraphs[0]);
575 template <
typename X0,
typename X1,
576 std::enable_if_t<IsDataContainer<X0>::value && IsDataContainer<X1>::value,
int> = 0>
579 if (
x0s.size() !=
x1s.size()) {
580 throw std::runtime_error(
"Cannot fill Graph with values in containers of different sizes.");
592 template <
typename X0,
typename X1,
593 std::enable_if_t<!IsDataContainer<X0>::value && !IsDataContainer<X1>::value,
int> = 0>
605 throw std::runtime_error(
"Graph was applied to a mix of scalar values and collections. This is not supported.");
610 const auto nSlots = fGraphs.size();
615 l.Add(fGraphs[
slot]);
623 return std::make_unique<RMergeableFill<Result_t>>(*fGraphs[0]);
626 std::string GetActionName() {
return "Graph"; }
628 Result_t &PartialUpdate(
unsigned int slot) {
return *fGraphs[
slot]; }
655 for (
unsigned int i = 1; i <
nSlots; ++i) {
665 typename X,
typename Y,
typename EXL,
typename EXH,
typename EYL,
typename EYH,
666 std::enable_if_t<IsDataContainer<X>::value && IsDataContainer<Y>::value && IsDataContainer<EXL>::value &&
667 IsDataContainer<EXH>::value && IsDataContainer<EYL>::value && IsDataContainer<EYH>::value,
672 if ((
xs.size() !=
ys.size()) || (
xs.size() !=
exls.size()) || (
xs.size() !=
exhs.size()) ||
673 (
xs.size() !=
eyls.size()) || (
xs.size() !=
eyhs.size())) {
674 throw std::runtime_error(
"Cannot fill GraphAsymmErrors with values in containers of different sizes.");
677 auto xsIt = std::begin(
xs);
678 auto ysIt = std::begin(
ys);
683 while (
xsIt != std::end(
xs)) {
692 typename X,
typename Y,
typename EXL,
typename EXH,
typename EYL,
typename EYH,
693 std::enable_if_t<!IsDataContainer<X>::value && !IsDataContainer<Y>::value && !IsDataContainer<EXL>::value &&
694 !IsDataContainer<EXH>::value && !IsDataContainer<EYL>::value && !IsDataContainer<EYH>::value,
706 template <
typename X,
typename Y,
typename EXL,
typename EXH,
typename EYL,
typename EYH,
710 throw std::runtime_error(
711 "GraphAsymmErrors was applied to a mix of scalar values and collections. This is not supported.");
732 std::string GetActionName() {
return "GraphAsymmErrors"; }
738 auto &
result = *
static_cast<std::shared_ptr<TGraphAsymmErrors> *
>(
newResult);
745template <
typename HIST>
747 std::vector<std::shared_ptr<HIST>> fObjects;
748 std::vector<std::unique_ptr<std::mutex>>
fMutexPtrs;
751 template <
typename T,
typename... Args>
758 template <
typename T,
typename... Args>
761 std::scoped_lock lock{mutex};
762 object.Fill(args...);
765 template <std::size_t
ColIdx,
typename End_t,
typename...
Its>
781 fObjects.front() =
h;
783 std::generate(fObjects.begin() + 1, fObjects.end(), [
h]() {
784 auto hist = std::make_shared<HIST>(*h);
785 UnsetDirectoryIfPossible(hist.get());
795 template <
typename...
ValTypes, std::enable_if_t<!Disjunction<IsDataContainer<ValTypes>...>
::value,
int> = 0>
803 template <
typename...
Xs, std::enable_if_t<Disjunction<IsDataContainer<Xs>...>
::value,
int> = 0>
807 constexpr std::array<
bool,
sizeof...(Xs)>
isContainer{IsDataContainer<Xs>::value...};
812 static_assert(
colidx <
sizeof...(Xs),
"Error: index of collection-type argument not found.");
818 std::array<std::size_t,
sizeof...(xs)>
sizes = {{GetSize(
xs)...}};
820 for (std::size_t i = 0; i <
sizeof...(xs); ++i) {
822 throw std::runtime_error(
"Cannot fill histogram with values in containers of different sizes.");
829 template <
typename T = HIST>
832 static_assert(
sizeof(T) < 0,
833 "When filling an object with RDataFrame (e.g. via a Fill action) the number or types of the "
834 "columns passed did not match the signature of the object's `FillThreadSafe` method.");
841 if (fObjects.size() > 1) {
843 for (
auto it = fObjects.cbegin() + 1; it != fObjects.end(); ++it) {
846 fObjects[0]->Merge(&list);
856 return std::make_unique<RMergeableFill<HIST>>(*fObjects[0]);
861 std::string GetActionName()
863 return std::string(fObjects[0]->
IsA()->GetName()) +
"\\n" + std::string(fObjects[0]->GetName());
866 template <
typename H = HIST>
882template <
typename V,
typename COLL>
888template <
typename COLL>
895template <
typename RealT_t,
typename T,
typename COLL>
904 for (
unsigned int i = 1; i <
nSlots; ++i)
905 fColls.emplace_back(std::make_shared<COLL>());
919 for (
unsigned int i = 1; i <
fColls.size(); ++i) {
932 std::string GetActionName() {
return "Take"; }
944template <
typename RealT_t,
typename T>
946 :
public RActionImpl<TakeHelper<RealT_t, T, std::vector<T>>> {
954 for (
unsigned int i = 1; i <
nSlots; ++i) {
955 auto v = std::make_shared<std::vector<T>>();
977 for (
unsigned int i = 1; i <
fColls.size(); ++i) {
983 std::vector<T> &PartialUpdate(
unsigned int slot) {
return *
fColls[
slot]; }
985 std::string GetActionName() {
return "Take"; }
989 auto &
result = *
static_cast<std::shared_ptr<std::vector<T>
> *>(
newResult);
997template <
typename RealT_t,
typename COLL>
999 :
public RActionImpl<TakeHelper<RealT_t, RVec<RealT_t>, COLL>> {
1007 for (
unsigned int i = 1; i <
nSlots; ++i)
1008 fColls.emplace_back(std::make_shared<COLL>());
1022 for (
unsigned int i = 1; i <
fColls.size(); ++i) {
1024 for (
auto &
v : *
coll) {
1030 std::string GetActionName() {
return "Take"; }
1042template <
typename RealT_t>
1044 :
public RActionImpl<TakeHelper<RealT_t, RVec<RealT_t>, std::vector<RealT_t>>> {
1053 for (
unsigned int i = 1; i <
nSlots; ++i) {
1054 auto v = std::make_shared<std::vector<RealT_t>>();
1076 for (
unsigned int i = 1; i <
fColls.size(); ++i) {
1082 std::string GetActionName() {
return "Take"; }
1095template <
typename RealT_t,
typename T,
typename COLL>
1097template <
typename RealT_t,
typename T>
1099template <
typename RealT_t,
typename COLL>
1101template <
typename RealT_t>
1117template <
typename ResultType>
1144 *
fResultMin = std::numeric_limits<ResultType>::max();
1152 return std::make_unique<RMergeableMin<ResultType>>(*fResultMin);
1157 std::string GetActionName() {
return "Min"; }
1161 auto &
result = *
static_cast<std::shared_ptr<ResultType> *
>(
newResult);
1166template <
typename ResultType>
1193 *
fResultMax = std::numeric_limits<ResultType>::lowest();
1202 return std::make_unique<RMergeableMax<ResultType>>(*fResultMax);
1207 std::string GetActionName() {
return "Max"; }
1211 auto &
result = *
static_cast<std::shared_ptr<ResultType> *
>(
newResult);
1216template <
typename ResultType>
1225 template <
typename T = ResultType>
1231 template <
typename T = ResultType,
typename Dummy =
int>
1259 for (
auto &&
v :
vs) {
1285 return std::make_unique<RMergeableSum<ResultType>>(*fResultSum);
1290 std::string GetActionName() {
return "Sum"; }
1294 auto &
result = *
static_cast<std::shared_ptr<ResultType> *
>(
newResult);
1302 std::vector<ULong64_t> fCounts;
1303 std::vector<double>
fSums;
1317 for (
auto &&
v :
vs) {
1335 const ULong64_t counts = std::accumulate(fCounts.begin(), fCounts.end(), 0ull);
1339 double &PartialUpdate(
unsigned int slot);
1341 std::string GetActionName() {
return "Mean"; }
1352 unsigned int fNSlots;
1355 std::vector<ULong64_t> fCounts;
1357 std::vector<double> fMeans;
1371 for (
auto &&
v :
vs) {
1383 const ULong64_t counts = std::accumulate(fCounts.begin(), fCounts.end(), 0ull);
1385 std::inner_product(fMeans.begin(), fMeans.end(), fCounts.begin(), 0.) /
static_cast<Double_t>(
counts);
1389 std::string GetActionName() {
return "StdDev"; }
1398template <
typename PrevNodeType>
1403 std::shared_ptr<PrevNodeType> fPrevNode;
1404 size_t fEntriesToProcess;
1407 DisplayHelper(
size_t nRows,
const std::shared_ptr<Display_t> &
d,
const std::shared_ptr<PrevNodeType> &prevNode)
1411 DisplayHelper(DisplayHelper &&) =
default;
1412 DisplayHelper(
const DisplayHelper &) =
delete;
1415 template <
typename...
Columns>
1418 if (fEntriesToProcess == 0)
1422 --fEntriesToProcess;
1424 if (fEntriesToProcess == 0) {
1429 fPrevNode->StopProcessing();
1437 std::string GetActionName() {
return "Display"; }
1440template <
typename T>
1446template <
typename T>
1452template <
typename T>
1518template <
typename T>
1537 "Branch \"%s\" contains TClonesArrays but the type specified to Snapshot was RVec<T>. The branch will "
1538 "be written out as a RVec instead of a TClonesArray. Specify that the type of the branch is "
1539 "TClonesArray as a Snapshot template parameter to write out a TClonesArray instead.",
1579 const auto bname =
leaf->GetName();
1596 const auto btype =
leaf->GetTypeName();
1600 "RDataFrame::Snapshot: could not correctly construct a leaflist for C-style array in column %s. This "
1601 "column will not be written out.",
1624 const std::string &fileName);
1629 std::string fFileName;
1630 std::string fDirName;
1631 std::string fTreeName;
1633 std::unique_ptr<TFile> fOutputFile;
1640 std::vector<TBranch *> fBranches;
1641 std::vector<void *> fBranchAddresses;
1643 std::vector<bool> fIsDefine;
1672 if (!fTreeName.empty() && !fOutputFile && fOptions.
fLazy) {
1676 return checkupdate ==
"update" ?
"updated" :
"created";
1679 "A lazy Snapshot action was booked but never triggered. The tree '%s' in output file '%s' was not %s. "
1680 "In case it was desired instead, remember to trigger the Snapshot operation, by storing "
1681 "its result in a variable and for example calling the GetValue() method on it.",
1706 template <std::size_t...
S>
1715 int expander[] = {(fBranches[
S] && fBranchAddresses[
S] != GetData(values)
1716 ? fBranches[
S]->SetAddress(GetData(values)),
1717 fBranchAddresses[
S] = GetData(values), 0 : 0, 0)...,
1722 template <std::size_t...
S>
1735 template <std::size_t...
S>
1753 throw std::runtime_error(
"Snapshot: could not create output file " + fFileName);
1756 if (!fDirName.empty()) {
1760 outputDir = fOutputFile->mkdir(fDirName.c_str(),
"",
true);
1762 outputDir = fOutputFile->mkdir(fDirName.c_str());
1766 std::make_unique<TTree>(fTreeName.c_str(), fTreeName.c_str(), fOptions.
fSplitLevel,
outputDir);
1775 assert(fOutputFile !=
nullptr);
1787 fOutputFile->Close();
1790 auto fullTreeName = fDirName.empty() ? fTreeName : fDirName +
'/' + fTreeName;
1794 std::string GetActionName() {
return "Snapshot"; }
1814 const std::string
finalName = *
reinterpret_cast<const std::string *
>(
newName);
1821 std::vector<bool>(fIsDefine),
1830 unsigned int fNSlots;
1831 std::unique_ptr<ROOT::TBufferMerger> fMerger;
1832 std::vector<std::shared_ptr<ROOT::TBufferMergerFile>>
fOutputFiles;
1835 std::string fFileName;
1836 std::string fDirName;
1837 std::string fTreeName;
1841 std::vector<TTree *> fInputTrees;
1843 std::vector<std::vector<TBranch *>> fBranches;
1845 std::vector<std::vector<void *>> fBranchAddresses;
1847 std::vector<bool> fIsDefine;
1869 fInputTrees(fNSlots),
1871 fBranchAddresses(fNSlots, std::vector<void *>(
vbnames.
size(), nullptr)),
1888 return checkupdate ==
"update" ?
"updated" :
"created";
1891 "A lazy Snapshot action was booked but never triggered. The tree '%s' in output file '%s' was not %s. "
1892 "In case it was desired instead, remember to trigger the Snapshot operation, by storing "
1893 "its result in a variable and for example calling the GetValue() method on it.",
1906 if (!fDirName.empty()) {
1921 fInputTrees[
slot] =
r->GetTree();
1953 template <std::size_t...
S>
1962 int expander[] = {(fBranches[
slot][
S] && fBranchAddresses[
slot][
S] != GetData(values)
1963 ? fBranches[
slot][
S]->SetAddress(GetData(values)),
1964 fBranchAddresses[
slot][
S] = GetData(values), 0 : 0, 0)...,
1970 template <std::size_t...
S>
1983 template <std::size_t...
S>
1998 auto outFile = std::unique_ptr<TFile>{
2001 throw std::runtime_error(
"Snapshot: could not create output file " + fFileName);
2003 fMerger = std::make_unique<ROOT::TBufferMerger>(std::move(
outFile));
2019 auto fullTreeName = fDirName.empty() ? fTreeName : fDirName +
'/' + fTreeName;
2020 assert(fOutputFile &&
"Missing output file in Snapshot finalization.");
2025 if (!fDirName.empty()) {
2036 fOutputFile->
Write();
2047 std::string GetActionName() {
return "Snapshot"; }
2067 const std::string
finalName = *
reinterpret_cast<const std::string *
>(
newName);
2075 std::vector<bool>(fIsDefine),
2085 const std::string &fileName);
2088template <
typename T>
2097 std::string fFileName;
2098 std::string fDirName;
2099 std::string fNTupleName;
2101 std::unique_ptr<TFile> fOutputFile{
nullptr};
2107 std::unique_ptr<ROOT::RNTupleWriter> fWriter{
nullptr};
2111 std::vector<bool> fIsDefine;
2137 Warning(
"Snapshot",
"A lazy Snapshot action was booked but never triggered.");
2150 template <std::size_t...
S>
2170 throw std::runtime_error(
"Snapshot: could not create output file " + fFileName);
2173 if (!fDirName.empty()) {
2185 template <std::size_t...
S>
2197 std::make_unique<ROOT::RDF::RNTupleDS>(fDirName +
"/" + fNTupleName, fFileName));
2200 std::string GetActionName() {
return "Snapshot"; }
2220 const std::string
finalName = *
reinterpret_cast<const std::string *
>(
newName);
2227 std::vector<bool>(fIsDefine)};
2231template <
typename Acc,
typename Merge,
typename R,
typename T,
typename U,
2234 :
public RActionImpl<AggregateHelper<Acc, Merge, R, T, U, MustCopyAssign>> {
2237 std::shared_ptr<U> fResult;
2258 template <
bool MustCopyAssign_ = MustCopyAssign, std::enable_if_t<MustCopyAssign_,
int> = 0>
2264 template <
bool MustCopyAssign_ = MustCopyAssign, std::enable_if_t<!MustCopyAssign_,
int> = 0>
2273 bool MergeAll = std::is_same<void, MergeRet>::value>
2274 std::enable_if_t<MergeAll, void>
Finalize()
2282 std::enable_if_t<MergeTwoByTwo, void>
Finalize(...)
2285 *fResult = fMerge(*fResult,
acc);
2290 std::string GetActionName() {
return "Aggregate"; }
Handle_t Display_t
Display handle.
#define R(a, b, c, d, e, f, g, h, i)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
unsigned long long ULong64_t
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
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 filename
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 r
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 result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char x1
void operator=(const TProof &)
Int_t Exec(const char *cmd, ESlaves list, Bool_t plusMaster)
Long64_t Finalize(Int_t query=-1, Bool_t force=kFALSE)
TClass * IsA() const override
TTime operator*(const TTime &t1, const TTime &t2)
Base class for action helpers, see RInterface::Book() for more information.
The head node of a RDF computation graph.
This class is the textual representation of the content of a columnar dataset.
This type represents a sample identifier, to be used in conjunction with RDataFrame features such as ...
The REntry is a collection of values in an RNTuple corresponding to a complete row in the data set.
The RNTupleModel encapulates the schema of an RNTuple.
static std::unique_ptr< RNTupleModel > Create()
std::shared_ptr< T > MakeField(std::string_view name, std::string_view description="")
Creates a new field given a name or {name, description} pair and a corresponding, default-constructed...
Common user-tunable settings for storing RNTuples.
static std::unique_ptr< RNTupleWriter > Append(std::unique_ptr< ROOT::RNTupleModel > model, std::string_view ntupleName, TDirectory &fileOrDirectory, const ROOT::RNTupleWriteOptions &options=ROOT::RNTupleWriteOptions())
Throws an exception if the model is null.
const_iterator begin() const
const_iterator end() const
A "std::vector"-like collection of values implementing handy operation to analyse them.
A TTree is a list of TBranches.
TClassRef is used to implement a permanent reference to a TClass object.
Collection abstract base class.
TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE) override
Create a sub-directory "a" or a hierarchy of sub-directories "a/b/c/...".
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
TDirectory::TContext keeps track and restore the current directory.
Describe directory structure in memory.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsiz=0) override
Write memory objects to this file.
TGraph with asymmetric error bars.
A TGraph is an object made of two arrays X and Y with npoints each.
1-D histogram with a double per channel (see TH1 documentation)
TH1 is the base class of all histogram classes in ROOT.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
void Add(TObject *obj) override
Statistical variable, defined by its mean and variance (RMS).
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
A TTree represents a columnar dataset.
@ kEntriesReshuffled
If set, signals that this TTree is the output of the processing of another TTree, and the entries are...
RooCmdArg Columns(Int_t ncol)
std::unique_ptr< RMergeableVariations< T > > GetMergeableValue(ROOT::RDF::Experimental::RResultMap< T > &rmap)
Retrieve mergeable values after calling ROOT::RDF::VariationsFor .
std::vector< std::string > ReplaceDotWithUnderscore(const std::vector< std::string > &columnNames)
Replace occurrences of '.
char TypeName2ROOTTypeName(const std::string &b)
Convert type name (e.g.
void ResetIfPossible(TStatistic *h)
void EnsureValidSnapshotRNTupleOutput(const RSnapshotOptions &opts, const std::string &ntupleName, const std::string &fileName)
void EnsureValidSnapshotTTreeOutput(const RSnapshotOptions &opts, const std::string &treeName, const std::string &fileName)
constexpr std::size_t FindIdxTrue(const T &arr)
void UnsetDirectoryIfPossible(TH1 *h)
auto FillThreadSafe(T &histo, Args... args) -> decltype(histo.FillThreadSafe(args...), void())
Entrypoint for thread-safe filling from RDataFrame.
std::function< void(unsigned int, const ROOT::RDF::RSampleInfo &)> SampleCallback_t
The type of a data-block callback, registered with an RDataFrame computation graph via e....
ROOT type_traits extensions.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
int CompressionSettings(RCompressionSetting::EAlgorithm::EValues algorithm, int compressionLevel)
RooArgSet S(Args_t &&... args)
ROOT::ESTLType STLKind(std::string_view type)
Converts STL container name to number.
ROOT::ESTLType IsSTLCont(std::string_view type)
type : type name: vector<list<classA,allocator>,allocator> result: 0 : not stl container code of cont...
void Initialize(Bool_t useTMVAStyle=kTRUE)
A collection of options to steer the creation of the dataset on file.
int fAutoFlush
AutoFlush value for output tree.
std::string fMode
Mode of creation of output file.
ECAlgo fCompressionAlgorithm
Compression algorithm of output file.
int fSplitLevel
Split level of output tree.
int fBasketSize
Set a custom basket size option.
bool fLazy
Do not start the event loop when Snapshot is called.
int fCompressionLevel
Compression level of output file.
Lightweight storage for a collection of types.
static uint64_t sum(uint64_t i)