Skip to content

Add all-event-weights functor and pp_hhh example analysis - #523

Draft
ZeynepEdaCabukoglu wants to merge 6 commits into
HEP-FCC:masterfrom
ZeynepEdaCabukoglu:feature/event-weight-functors
Draft

Add all-event-weights functor and pp_hhh example analysis#523
ZeynepEdaCabukoglu wants to merge 6 commits into
HEP-FCC:masterfrom
ZeynepEdaCabukoglu:feature/event-weight-functors

Conversation

@ZeynepEdaCabukoglu

@ZeynepEdaCabukoglu ZeynepEdaCabukoglu commented Jul 16, 2026

Copy link
Copy Markdown

This draft PR adds a pp_hhh event-weight example adapted from the existing
FCCAnalyses datasource example, together with a Definitions.h header.

It includes two functors:

  • GetAllWeights, which returns all numerical weights stored in the
    EventHeader.
  • GetWeightByName, which uses the EventWeightNames metadata exposed by
    podio::DataSource, resolves the requested label to an index, and returns
    the corresponding weight for each event.

GetAllWeights was initially tested successfully on 1,000 events. Both
functors were then tested on the five-event pp_hhh sample.

The implementation was also validated on the updated 10,000-event pp_hhh
sample containing EventWeightNames metadata. The rwgt_4 result matches
event_weights[4] for every tested event.

The implementation depends on a corresponding modification to
podio::DataSource that exposes file-level metadata to RDataFrame. A separate
draft PR against PODIO will be opened for discussion.

//constructor runs whenever a new GetWeightByName object is created
const std::string& requestedWeightName,
// type of the file is string since inputFile is not the file’s contents. It is the path/name used to locate the file. Then PODIO uses that string path to open the actual EDM4hep ROOT file
const std::string& inputFile)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The analyzer (struct) does not have access to the input file, it can only see the collections provided by the datasource.



//get the list of labels from metadataFrame
auto weightNames =

@kjvbrt kjvbrt Jul 21, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The way I understand it, this would be the job of the DataSource to pick up and add a this collection to the make it available among other regular collections.

@kjvbrt

kjvbrt commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

hi @ZeynepEdaCabukoglu, nice work :) Can you cut down a bit on the number of comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants