Repository navigation
Conversation
This fixes a problem in the Hyperloop expansion of an external generator, where a trigger given with -t was ignored. - Triggers from -t are only attached to non-hybrid generators, and the generated hybrid JSON had none. - An external trigger is now written into every sub-generator of the generated JSON. - With a particle trigger the plain external generator is kept, with a warning. - The hybrid generator now derives an empty trigger function name from the macro file name, as the plain path does. - A hybrid trigger that returns no trigger type is now fatal instead of being skipped. - A hybrid trigger mode without any trigger macro is now fatal. - A trigger given with -t to a user-configured hybrid generator now gives a warning. - A cocktail in parallel mode is now rejected, since it produced empty events and stalled. - A non-positive GeneratorHybrid.num_workers on Hyperloop now gives a warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the Hyperloop expansion of an external generator, which ignored a trigger given with
-t. Triggers from-tare attached only to non-hybrid generators, while the hybrid configuration generated for Hyperloop carried none, so withGeneratorHybrid.num_workers > 1every generated event was accepted.An external trigger is now written into each sub-generator of the generated configuration. Each clone gets its own trigger object, but the macro is loaded once, so its static state is shared between the worker threads and trigger macros must not keep state. A particle trigger has no JSON equivalent, and the plain external generator is kept for it, with a warning that parallel generation is lost. An external trigger without
TriggerExternal.fileNameis fatal.The trigger loading of the hybrid generator is brought closer to the plain path. An empty function name is now derived from the macro file name, as
GetFromMacrodoes for the plain generator. A macro that returns neither aTriggernor aDeepTrigger, and a trigger mode for which no trigger macro is given, are now fatal instead of running untriggered. A missing macro file or function was already fatal. In addition, a-ttrigger given to a user-configured hybrid generator gives a warning, a cocktail in parallel mode is rejected instead of producing empty events and stalling, and a non-positivenum_workersin the Hyperloop expansion gives a warning.The change was tested with
libO2Generatorsrebuilt against O2 daily-20261123 ando2-sim --noGeantwithIS_HYPERLOOP=1, 20 events of one pion with p = 0–10 GeV/c and a trigger requiring pT > 5 GeV/c.-t external,num_workers = 4-t external,num_workers = 1-t external, nofuncName,num_workers = 4-t external, nofileName,num_workers = 4-t particle,num_workers = 4The daily predates #16164 and always expanded to 8 sub-generators, which is why the single-worker row also fails there. A hybrid JSON with trigger mode
orand an empty macro is now fatal, while an empty placeholder spec next to a valid one still triggers correctly (0 / 20). No configuration in O2DPG or in the O2 examples is affected by the new fatal checks.Overall, a trigger given with
-tnow selects events on Hyperloop independently ofnum_workers.Assisted by Claude Code.