Skip to content

Commit 7b62dd9

Browse files
authored
Merge pull request #1 from alibuild/alibot-cleanup-ml-222
[MegaLinter] Apply linters automatic fixes to #222
2 parents 3491532 + b87c7a5 commit 7b62dd9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/tutorials/eventMixing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ for (auto& [c1, tracks1, c2, tracks2] : pair) {
101101

102102
The task demonstrates how to use FlexibleBinningPolicy if binning cannot be calculated straight from the collision columns, but is obtained from other variables in a user-defined function.<br>
103103
This is naturally implemented for mixing inside `process()`, as the helper lambda function is usually defined inside `process()`. For example:
104+
104105
```cpp
105106
void process(aod::Collisions& collisions, aod::Tracks& tracks) {
106107
auto getTracksSize =
@@ -111,16 +112,19 @@ void process(aod::Collisions& collisions, aod::Tracks& tracks) {
111112
```
112113
113114
The binning policy:
115+
114116
```cpp
115117
using BinningType = FlexibleBinningPolicy<std::tuple<decltype(getTracksSize)>, aod::collision::PosZ, decltype(getTracksSize)>;
116118
BinningType binningWithLambda{{getTracksSize}, {axisVertex, axisMultiplicity}, true};
117119
```
120+
118121
A tuple with types of all lambda functions must be first passed in the `BinningType` definition, before the rest of arguments follow in the order of usage.<br>
119122
Similarly, in `binningWithLambda` definition, one must first pass a tuple with all lambda functions before other arguments.<br>
120123
Note that binning with respect to z-vertex is calculated from column values as before, while the lambda is used only for the multiplicity axis. You must be careful to follow the same order of columns/lambdas in the `BinningType` definition and of the corresponding axes in binning instantation.
121124
Any combination of lambda- and column-based binning is possible.
122125

123126
Finally, the mixing structure is defined like in previous examples:
127+
124128
```cpp
125129
SameKindPair<aod::Collisions, aod::Tracks, BinningType> pair{binningWithLambda, 5, -1, collisions, tracksTuple, &cache};
126130
```

0 commit comments

Comments
 (0)