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

Extend JOmniFactory-style interface to other JANA components #276

Open
DraTeots opened this issue Mar 12, 2024 · 7 comments
Open

Extend JOmniFactory-style interface to other JANA components #276

DraTeots opened this issue Mar 12, 2024 · 7 comments

Comments

@DraTeots
Copy link
Collaborator

DraTeots commented Mar 12, 2024

For the record, OmniFactories are completely broken for outside of PodIO cases and if one uses Parameter and not ParameterRef. I actually took OmniFactory code and made my own theme park such factory but without input-output tag names and idea of underlying independant algorithm+config struct for each factory. There are some other improvements.

Not to intersect with OmniFactoris I called it CozyFactory

Fun fact. "Cozy" sounds close to "Kozeey" which translates as "goat", which gives us The GOAT Factory

Working with the GOAT/Omni factories instead of usual JFactories:

Pros:

  1. Much more fun and easier to handle
  2. Like those declarations and use of things like values = m_whatever_input()
  3. Even more like outputs streamlined m_my_output().push_back(result)
  4. In real data apps where events might be different in terms what data is in, it is good to have fail-proof stub for when there is no input data.
  5. I feel like such declarative declarations of factory needs are more clean in terms of general architecture

Cons:

  1. Having hidden Process that catches exceptions and makes it harder to debug but that deserves a separate bug report for JException.
  2. I feel like such declarative declarations of factory needs are not fully inline with the overal current JANA2 design

Thoughts:

  1. After working with them you want such API to be consistent, firstable for Processors and EventSources level
  2. With the current paradigm, IDK how much Parameters are extensible for users
  3. I understand that both OmniFactories and CozyFactories are crafted for needs and designes of particular reconstruction software and creating such things on JANA2 level so that they are universal might be impossible. But the overal design pattern is good and plesant to use.
  4. With 3 one at least can put it to examples.
  5. How python would work with it?
@DraTeots DraTeots reopened this Mar 12, 2024
@DraTeots DraTeots changed the title Omny Cozy the GOAT factories on JANA2 level Omny, Cozy, the GOAT factories on JANA2 level Mar 12, 2024
@nathanwbrei
Copy link
Collaborator

What's wrong with Parameter? Can you provide a test case?

@nathanwbrei
Copy link
Collaborator

I'm working on upstreaming the omnifactory machinery (Parameter, Input, Output, Service, Resource) into JANA itself, uniformly across all components (EventSource, EventProcessor, EventUnfolder, JFactory, JMultiFactory)

@DraTeots
Copy link
Collaborator Author

DraTeots commented Mar 19, 2024

It is rather difficulties with parameter management I foresee than bugs. And basically goes about how users would write their own Parameter classes. If they want to extend the functinality.

@DraTeots
Copy link
Collaborator Author

Ah, and maybe it is a good idea to add ExistingParameter that will utilize a parameter that is known to be used somewhere else. How same parameters should properly be handled between classes of the same plugin or between plugins? E.g. in FL4FPGA we have a a parameter number of SRS timebins, which should be provided for EVIO reader, DQM processor and GEM reconstruction. And it should be the same value to function properly.

@nathanwbrei
Copy link
Collaborator

nathanwbrei commented Jun 22, 2024

Breaking this conversation down into actionable items so that I can close the issue someday:

  • Improve exception handling in omnifactories and multifactories, delegating to a common mechanism
  • Add ExistingParameter flag in order to escape Omni's strict namespacing
  • Demonstrate using Omni's Parameter helper with custom types. Challenge mode: Types that need to be parsed several different ways, e.g. nthreads
  • Deprecate JEventProcessorSequential and JEventProcessorSequentialRoot, demonstrating that 100% of their functionality is present in the Omni-fied JEventProcessor now.
  • Make JFactory/JMultiFactory/JEventSource fully Omni-fied

@DraTeots
Copy link
Collaborator Author

Can we add this to examples in particular to PODIO

https://github.com/JeffersonLab/JANA2/blob/master/src/examples/PodioExample/PodioExampleProcessor.cc

@nathanwbrei
Copy link
Collaborator

Absolutely!

@nathanwbrei nathanwbrei changed the title Omny, Cozy, the GOAT factories on JANA2 level Extend JOmniFactory-style interface to other JANA components Jul 17, 2024
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

No branches or pull requests

2 participants