You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's now consider the case in which "myTree" contains two quantities "x" and "y", but our analysis relies on a derived quantity `z = sqrt(x*x + y*y)`.
157
-
Using the `AddCol` transformation, we can create a new column in the data-set containing the variable "z":
157
+
Using the `AddColumn` transformation, we can create a new column in the data-set containing the variable "z":
`AddCol` creates the variable "z" by applying `sqrtSum` to "x" and "y". Later in the chain of calls we refer to variables created with `AddCol` as if they were actual tree branches, but they are evaluated on the fly, once per event. As with filters, `AddCol` calls can be chained with other transformations to create multiple temporary branches.
168
+
`AddColumn` creates the variable "z" by applying `sqrtSum` to "x" and "y". Later in the chain of calls we refer to variables created with `AddColumn` as if they were actual tree branches, but they are evaluated on the fly, once per event. As with filters, `AddColumn` calls can be chained with other transformations to create multiple temporary branches.
169
169
170
170
### Executing multiple actions
171
171
As a final example let us apply two different cuts on branch "MET" and fill two different histograms with the "pt\_v" of the filtered events.
@@ -197,7 +197,7 @@ You don't need to read all these to start using `TDataFrame`, but they are usefu
197
197
### Default branch lists
198
198
When constructing a `TDataFrame` object, it is possible to specify a **default branch list** for your analysis, in the usual form of a list of strings representing branch names. The default branch list will be used as fallback whenever one specific to the transformation/action is not present.
199
199
~~~{.cpp}
200
-
// use "b1" and "b2" as default branches for `Filter`, `AddCol` and actions
200
+
// use "b1" and "b2" as default branches for `Filter`, `AddColumn` and actions
auto h2 = newBranchFiltered.Filter(cut1).Histo1D("vec");
@@ -308,7 +308,7 @@ Statistics are retrieved through a call to the `Report` method:
308
308
Stats are printed in the same order as named filters have been added to the graph, and *refer to the latest event-loop* that has been run using the relevant `TDataFrame`. If `Report` is called before the event-loop has been run at least once, a run is triggered.
309
309
310
310
### Temporary branches
311
-
Temporary branches are created by invoking `AddCol(name, f, branchList)`. As usual, `f` can be any callable object (function, lambda expression, functor class...); it takes the values of the branches listed in `branchList` (a list of strings) as parameters, in the same order as they are listed in `branchList`. `f` must return the value that will be assigned to the temporary branch.
311
+
Temporary branches are created by invoking `AddColumn(name, f, branchList)`. As usual, `f` can be any callable object (function, lambda expression, functor class...); it takes the values of the branches listed in `branchList` (a list of strings) as parameters, in the same order as they are listed in `branchList`. `f` must return the value that will be assigned to the temporary branch.
312
312
313
313
A new variable is created called `name`, accessible as if it was contained in the dataset from subsequent transformations/actions.
314
314
@@ -351,8 +351,8 @@ In the following, whenever we say an action "returns" something, we always mean
351
351
As pointed out before in this document, `TDataFrame` can transparently perform multi-threaded event loops to speed up the execution of its actions. Users only have to call `ROOT::EnableImplicitMT()` *before* constructing the `TDataFrame` object to indicate that it should take advantage of a pool of worker threads. **Each worker thread processes a distinct subset of entries**, and their partial results are merged before returning the final values to the user.
352
352
353
353
### Thread safety
354
-
`Filter` and `AddCol` transformations should be inherently thread-safe: they have no side-effects and are not dependent on global state.
355
-
Most `Filter`/`AddCol` functions will in fact be pure in the functional programming sense.
354
+
`Filter` and `AddColumn` transformations should be inherently thread-safe: they have no side-effects and are not dependent on global state.
355
+
Most `Filter`/`AddColumn` functions will in fact be pure in the functional programming sense.
356
356
All actions are built to be thread-safe with the exception of `Foreach`, in which case users are responsible of thread-safety, see [here](#generic-actions).
0 commit comments