Skip to content

DPL Analysis: Filling histograms in registry with expressions#4433

Merged
ktf merged 4 commits into
AliceO2Group:devfrom
saganatt:expressions-registry
Sep 24, 2020
Merged

DPL Analysis: Filling histograms in registry with expressions#4433
ktf merged 4 commits into
AliceO2Group:devfrom
saganatt:expressions-registry

Conversation

@saganatt

Copy link
Copy Markdown
Collaborator

No description provided.

@saganatt saganatt requested review from a team and jgrosseo as code owners September 24, 2020 13:42
@ktf

ktf commented Sep 24, 2020

Copy link
Copy Markdown
Member

Very nice. How difficult would it be to use FillN, rather than Fill()?

{
auto filtered = o2::soa::Filtered<T>{{table.asArrowTable()}, o2::framework::expressions::createSelection(table.asArrowTable(), filter)};
for (auto& t : filtered) {
hist->Fill(*(static_cast<C>(t).getIterator()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It may be more efficient to use FillN method of ROOT histogram, that allows to fill it from an array

@saganatt saganatt Sep 24, 2020

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ok, do I see well there is no FillN() for TH3?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure how it is implemented for dimensions > 1, I'll have to check. For 1-dimensional you can pass nullptr for the weights.

@saganatt

Copy link
Copy Markdown
Collaborator Author

Very nice. How difficult would it be to use FillN, rather than Fill()?

@ktf We would need still to copy filtered rows, and so iterate. There is no actual filtered table.

@ktf

ktf commented Sep 24, 2020

Copy link
Copy Markdown
Member

True for filtered tables, but not for unfiltered ones, though. That said, we could also try to suggest ROOT folks an extension.

@saganatt

Copy link
Copy Markdown
Collaborator Author

True for filtered tables, but not for unfiltered ones, though. That said, we could also try to suggest ROOT folks an extension.

Hm, but using expressions by principle creates filtered views ('tables')?

ROOT has RDataFrame that enables to filter and draw the data - but with filter from lambda / string.

@ktf

ktf commented Sep 24, 2020

Copy link
Copy Markdown
Member

Yes, I know. I wrote the arrow integration for RDataFrame... ;-) I meant that we could extend FillN to take a bitmap / selection vector for what to fill.

@ktf ktf merged commit 7a2b794 into AliceO2Group:dev Sep 24, 2020
@ktf

ktf commented Sep 24, 2020

Copy link
Copy Markdown
Member

Anyways, this is already very good. Let's merge this and continue the discussion on how to extend it.

@saganatt

Copy link
Copy Markdown
Collaborator Author

Yes, I know. I wrote the arrow integration for RDataFrame... ;-) I meant that we could extend FillN to take a bitmap / selection vector for what to fill.

hah, ok ;-)

@saganatt saganatt deleted the expressions-registry branch October 3, 2020 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants