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

Add a metadata service and a test #215

Merged
merged 22 commits into from
Aug 8, 2024
Merged

Add a metadata service and a test #215

merged 22 commits into from
Aug 8, 2024

Conversation

jmcarcell
Copy link
Contributor

@jmcarcell jmcarcell commented Jul 22, 2024

BEGINRELEASENOTES

  • Add a metadata service that is automatically added when importing IOSvc from k4FWCore, if no metadata is added then the service won't do anything. If metadata is added, the metadata service will hold a podio::Frame with the metadata that the Writer will write. The metadata service only works when there is an output file.
  • Add a test showing an example of its usage
  • Make changes in the MetadaHandle to make it possible to save and read metadata from DataHandle-based algorithms, so that when switching to IOSvc metadata for existing DataHandle algorithms will keep working. Add a test using IOSvc with DataHandle algorithms that write and read metadata.

ENDRELEASENOTES

}

edm4hep::MCParticleCollection operator()() const override {
k4FWCore::putParameter("EventMetadataInt", 5, this);
Copy link
Contributor

Choose a reason for hiding this comment

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

Where do these parameters go? To the event frame or to the metadata frame? If the latter, I think this should be impossible. At least with the MetaDataHandle we went to some length to make this fail (at runtime), because if something is "true metadata" then it should be constant at file level. Hence, there should be no need to make it possible to even set this during event processing. If we can make this call go to the event frame, then it would be OK, I suppose, but it might be a bit confusing to have only one interface for doing both.

The notable exception for setting metadata during event processing is obviously the MarlinWrapper, but I don't think we should make this easily possible here, just because it's needed there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now changed to prevent from putting parameters in the metadata frame as it was being done for the handle-based algorithms, it's literally the same mechanism so I think it should work for MarlinWrapper.

@jmcarcell jmcarcell force-pushed the metadata-functional branch 2 times, most recently from 4ae46c7 to b7641c8 Compare July 26, 2024 14:57
@jmcarcell
Copy link
Contributor Author

This should now be ready and when using IOSvc it also works fine with DataHandle algorithms. I didn't bother with making it work when using PodioInput or PodioOutput and functional algorithms since that shouldn't be the case anyway.

@jmcarcell jmcarcell merged commit bcb3f15 into main Aug 8, 2024
4 of 9 checks passed
@jmcarcell jmcarcell deleted the metadata-functional branch August 8, 2024 15:10
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.

3 participants