Skip to content
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

feat: EDM4HEPSchema and Newstyle FCCSChema #1245

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

prayagyadav
Copy link
Contributor

@lgray @davidlange6 @gomber

Here is a clean draft for the EDM4HEPSchema (edm4hep1) and FCCSchema based on the same. I have not yet managed to add many comments and descriptions, but I plan to add them eventually.

Workings:

  • The EDM4HEPSchema reads the edm4hep.yaml file from the assets directory. I felt this was necessary to add maximum functionality to the schema. Reading the specifications of all the 'components' and 'datatypes' from the yaml file helps to identify the 'members' (example, energy is a member of edm4hep::ReconstructedParticle datatype) and which members correspond to the various types of cross-branch relations in EDM4HEP: vector members, OneToOneRelations, OneToManyRelations and Links.

  • The Schema fetches the comments in the edm4hep.yaml file and assigns them as docstrings to the relevant branches.

  • The EDM4HEPSchema supports all these relations (With Links needing some manual boilerplate code from the user).

  • The version of the edm4hep.yaml file used is here. Please note that the way Links are represented in EDM4HEP has changed in the latest commit. @tmadlener can comment more on this. In any case, it seems necessary to find a way to track the changes from edm4hep.yaml, so that the COFFEA EDM4HEPSchema does not become obsolete after a few version changes.

Link to example Notebooks:

Tests:

  • The test sample for EDM4HEP was obtained from here (which, I believe, was pointed out by @tmadlener).
  • The test sample for the Newstyle (edm4hep1) FCC was provided by @davidlange6
  • Both the schema pass the basic tests (the tests are similar to the ones that I wrote for the oldstyle (pre-edm4hep1) FCCSchema)

Other comments:

  • I understand that this commit includes a lot of code, and its purpose may not be immediately clear, but I can provide a detailed explanation for specific snippets if needed.
  • While I have tried to add most of the functionality to the schema, I cannot figure out how to add the ExtraCode sections mentioned in edm4hep.yaml. They appear to be declarations for C++ methods specific to certain collections.

@prayagyadav prayagyadav changed the title EDM4HEPSchema and Newstyle FCCSChema feat: EDM4HEPSchema and Newstyle FCCSChema Jan 15, 2025
assert field in delayed_fields


def test_MC_daughters(delayed_events):
Copy link
Collaborator

Choose a reason for hiding this comment

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

these tests should also check correctness!

assert field in delayed_fields


def test_MC_daughters(delayed_events):
Copy link
Collaborator

Choose a reason for hiding this comment

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

these tests should also check correctness!

#


def test_KaonParent_to_PionDaughters_Loop(eager_events):
Copy link
Collaborator

Choose a reason for hiding this comment

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

ah ok, I guess correctness is checked here in the end.

Perhaps some more basic checks in the prior tests would still be useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, test_KaonParent_to_PionDaughters_Loop attempts to check the correctness of Parents and Daughters relations. Sure, I can add more basic tests

@lgray
Copy link
Collaborator

lgray commented Jan 15, 2025

can you rebase all the commits into 1 so that that 12MB file isn't into the repo history at all? Thanks!

@prayagyadav
Copy link
Contributor Author

can you rebase all the commits into 1 so that that 12MB file isn't into the repo history at all? Thanks!

Done

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