Skip to content

Commit

Permalink
Fix outdated sliceBy usage
Browse files Browse the repository at this point in the history
  • Loading branch information
aalkin committed Jul 9, 2024
1 parent 0c85409 commit 8cbf7ae
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docs/tutorials/indexTables.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,17 @@ struct ConsumeColExtra {

### PartitionColExtra

Index columns allow to easily select e.g. all tracks belonging to a given collision using the sliceBy() method (see also [DECLARE_SOA_TABLE](creatingTables.md#declareTables)). groupedTracks contains only tracks which belong to Collision col.

Index columns allow to easily select e.g. all tracks belonging to a given collision using the `sliceBy()` method (see also [DECLARE_SOA_TABLE](creatingTables.md#declareTables)). groupedTracks contains only tracks which belong to Collision col.
The slicing needs to be pre-declared using `Preslice` (or `PresliceUnsorted` if the index is not sorted) so that the framework can prepare and add it to the internal cache.
```cpp
auto groupedTracks = tracks.sliceBy(aod::track::collisionId, col.globalIndex());
struct Task {
Preslice<aod::Tracks> perCol = aod::track::collisionId;
void proces(aod::Collisions const & cols, aod::Tracks const& tracks) {
for (auto& col : cols) {

Check failure on line 74 in docs/tutorials/indexTables.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Tab characters found

Indent code using spaces instead of tabs.
auto groupedTracks = tracks.sliceBy(perCol, col.globalIndex());

Check failure on line 75 in docs/tutorials/indexTables.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Tab characters found

Indent code using spaces instead of tabs.
}

Check failure on line 76 in docs/tutorials/indexTables.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Tab characters found

Indent code using spaces instead of tabs.
}
}
```
<a name="hmpidtask"></a>
Expand Down

0 comments on commit 8cbf7ae

Please sign in to comment.