-
Notifications
You must be signed in to change notification settings - Fork 483
Make GeneratorHybrid a singleton #14737
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
Conversation
|
REQUEST FOR PRODUCTION RELEASES: This will add The following labels are available |
|
Error while checking build/O2/fullCI_slc9 for 4e4c801 at 2025-10-17 07:18: Full log here. |
sawenzel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This effectively makes the HybridGenerator a singleton since you can't have multiple instances in isolation (the generator members are global). I think it would then be better to just explicitly make the class a singleton to avoid static function annotations (or a mix between static and non-static).
Is there a concrete motivation behind this dev?
|
The idea is to make the generators declared in the hybrid configuration "environment"-aware. I thought of making it similar to the embedding mechanism we have right now (this would be the start of the development). An example of usage is shown in this external generator AliceO2Group/O2DPG#2159 which is the motivation behind this development. |
0bd91c5 to
e9538cd
Compare
|
Would this work? I tried to keep it as simple as possible. I ran some tests with o2-sim standalone, o2-sim-dpl-eventgen and with a full O2DPG workflow and didn't encounter any issue. |
e9538cd to
1002ed8
Compare
By making the generators list static we can provide info to the other generators in cocktails.
Currently each generator runs without knowing the information from the others in the hybrid configuration, but this will allow them to "communicate".
I tested it using an external generator which uses the GetParticles().size() as a baseline to change the number of generated particles (boxgen). It's only the first piece of the puzzle and more work is required to take care of different scenarios (like parallel simulations).