Skip to content

[skip-ci][hist] Document architecture for initial set of classes #19295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2025

Conversation

hahnjo
Copy link
Member

@hahnjo hahnjo commented Jul 7, 2025

To enable incremental review, the start of this architecture document is provided upfront. Further classes will be added when implemented.

@hahnjo hahnjo self-assigned this Jul 7, 2025
@hahnjo hahnjo added the in:Hist label Jul 7, 2025
@hahnjo hahnjo force-pushed the hist-architecture branch from 9fe64c0 to c62596f Compare July 7, 2025 19:02
To enable incremental review, the start of this architecture document
is provided upfront. Further classes will be added when implemented.
@hahnjo hahnjo force-pushed the hist-architecture branch from c62596f to 9d99ca1 Compare July 9, 2025 12:36
@hahnjo hahnjo merged commit 349085b into root-project:master Jul 16, 2025
7 checks passed
@hahnjo hahnjo deleted the hist-architecture branch July 16, 2025 06:40
```c++
RLinearizedIndex ComputeLinearizedIndex(double x);
```
The `bool` is used to indicate if the return value is valid.
Copy link
Member

@pcanal pcanal Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the switch from pair<size_t,bool> to RLinearizedIndex and with RLinearizedIndex not being described (at that point of reading). This sentence ("The bool ..") is lacking a bit of context.

For example, the argument may be outside the axis with the underflow and overflow bins disabled.
`RLinearizedIndex` is a simple struct with a `std::size_t index` and `bool valid`.
It is chosen over `std::optional` because it unifies the return value construction:
If outside the axis, the validity is just determined by the member property `fEnableFlowBins`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If outside the axis, the validity is still valid if flow bins have been enabled (as recorded by the member property `fEnableFlowBins`).

RLinearizedIndex ComputeGlobalIndex(const std::tuple<A...> &args) const;
```
that dispatches arguments to the individual `ComputeLinearizedIndex` and combines the results.
If any of the linearized indices is invalid, so will be the combination.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If any of the linearized indices is invalid, so is the combination.

maybe ... to match tenses.


This class combines an `RAxes` object and storage of bin contents in a `std::vector`.
During `Fill`, it calls `RAxes::ComputeLinearizedIndex` and then updates the bin content.
In contrast to `RHist`, this class supports direct concurrent filling via `FillAtomic`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use some more context and justification. (i.e. why this contrast/difference?).


### `RBinIndex`

A single bin index, which is just an integer for normal bins.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the relation ship with RLinearizedIndex?

### `RBinIndex`

A single bin index, which is just an integer for normal bins.
`Underflow()` and `Overflow()` are special values and not ordered with respect to others.
Copy link
Member

@pcanal pcanal Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not ordered with respect to others.

Why not? and/or why is it important?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants