Skip to content

Added some utility functions for, and documentation about, trigger types used in integtests#161

Open
bieryAtFnal wants to merge 27 commits into
developfrom
kbiery/integtest_trigger_choices
Open

Added some utility functions for, and documentation about, trigger types used in integtests#161
bieryAtFnal wants to merge 27 commits into
developfrom
kbiery/integtest_trigger_choices

Conversation

@bieryAtFnal

@bieryAtFnal bieryAtFnal commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

It is not always easy to determine which trigger type(s) are used in which integtests, nor how to specify the parameters for a given trigger type in a new integtest.

The changes in this PR attempt to help with that, and they provide several utility functions that can be used to enable Fake HSI triggers and/or set basic parameters associated with FakeHSI and/or RandomTriggerCandidateMaker triggers. This PR also include some preliminary documentation about which triggers are used in which integtests.

This PR is correlated with ones in several other repos:

To test these changes, the following steps can be used:

DATE_PREFIX=`date '+%d%b'`
TIME_SUFFIX=`date '+%H%M'`

source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh
setup_dbt latest
dbt-create -n NFD_DEV_260624_A9 ${DATE_PREFIX}FDDevIntegtestTriggerChoices_${TIME_SUFFIX}
cd ${DATE_PREFIX}FDDevIntegtestTriggerChoices_${TIME_SUFFIX}/sourcecode

git clone https://github.com/DUNE-DAQ/crtmodules.git -b kbiery/integtest_trigger_choices
git clone https://github.com/DUNE-DAQ/daqsystemtest.git -b kbiery/integtest_trigger_choices
git clone https://github.com/DUNE-DAQ/dfmodules.git -b kbiery/integtest_trigger_choices
git clone https://github.com/DUNE-DAQ/hsilibs.git -b develop
git clone https://github.com/DUNE-DAQ/listrev.git -b develop
git clone https://github.com/DUNE-DAQ/snbmodules.git -b develop
git clone https://github.com/DUNE-DAQ/trigger.git -b kbiery/integtest_trigger_choices
cd ..

cd pythoncode
git clone https://github.com/DUNE-DAQ/integrationtest.git -b kbiery/integtest_trigger_choices
cd ..

. ./env.sh
dbt-build -j 12
dbt-workarea-env

dunedaq_integtest_bundle.sh --verbosity 2 -r local --random 5

Type of change

  • Optimization (non-breaking change that improves code/performance)

Testing checklist

  • Full set of integration tests pass (dunedaq_integtest_bundle.sh)

Further checks

  • Code is commented where needed, particularly in hard-to-understand areas

Kurt Biery and others added 23 commits May 23, 2026 11:51
Updated the survey document to include an introduction and a summary table for integration tests.
Updated the integtest documentation to include WIB counts and trigger rates for various tests.
Updated descriptions of trigger sources and their configurations in the integration tests documentation.

@MRiganSUSX MRiganSUSX left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @bieryAtFnal,
Thanks for this updated, much cleaner, functionality.
I'm leaving several suggestions here and across the linked 5 PRs.

Don't think there are any glaring problems, some small style things and some places that could be tidied up.

# exists in the input/template DUNE-DAQ configuration, so there is the possibility of some
# confusion if a kRandom TCReadoutMap entry exists.
# ************************************************************
def set_RTCM_trigger_params(integtest_params: data_classes.integtest_param_base_class, trigger_rate: float = None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we be consistent here and keep the snake_case, ie set_rtcm_trigger_params ?
(It also breaks PEP 8 but I'm unsure whether we are adhering to that in out python repos)
If you agree, this will need to be addressed across the linked PRs as well.

Comment on lines +67 to +75
def set_fake_hsi_trigger_params(integtest_params: data_classes.integtest_param_base_class, trigger_rate: float = None,
readout_window_before_ticks: int = None, readout_window_after_ticks: int = None):
if trigger_rate is not None:
integtest_params.config_substitutions.append(
data_classes.attribute_substitution(
obj_class="FakeHSIEventGeneratorConf",
updates={"trigger_rate": trigger_rate},
)
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not immediately problematic, but the old places this is replacing (tpreplay_test.py, trigger_bitwords_test.py) were more specific in targeting obj_id="fakehsi".
If we ever have a situation where we have multiple FakeHSIEventGeneratorConf (not sure it is a concern), all would be affected.
The suggestion would be to add an optional obj_id: str = "*" so one can be more specific if needed, with the default doing what it is doing now.

def enable_fake_hsi_trigger(integtest_params: data_classes.integtest_param_base_class, trigger_rate: float = None,
readout_window_before_ticks: int = None, readout_window_after_ticks: int = None):
if not isinstance(integtest_params, data_classes.integtest_params_for_generated_dunedaq_config):
fail_msg = "The FakeHSI trigger can only be dynamically enabled in DUNE-DAQ configurations that are generated by the integration test infrastructure, not ones that are pre-defined."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

189 chars is above most PEP8 string limits.
If you'd like, this could be split across multiple lines, ie:

fail_msg = ("The FakeHSI trigger can only be dynamically enabled in DUNE-DAQ "
            "configurations that are generated by the integration test infrastructure, "
            "not ones that are pre-defined.")

except IsADirectoryError:
print(f"File {file} could not be deleted because it is actually a directory.")

# ************************************************************

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Most linters require 2 empty lines before any new def, as is the case earlier in this file.

integtest_params.fake_hsi_enabled = True
set_fake_hsi_trigger_params(integtest_params, trigger_rate, readout_window_before_ticks, readout_window_after_ticks)

# ************************************************************

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Most linters require 2 empty lines before any new def, as is the case earlier in this file.

integtest_params.config_substitutions.append(
data_classes.attribute_substitution(
obj_class="TCReadoutMap",
obj_id = "def-hsi-tc-map",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There should be no empty spaces around = in keyword arguments,
ie suggesting changing to obj_id="def-hsi-tc-map".

integtest_params.config_substitutions.append(
data_classes.attribute_substitution(
obj_class="RandomTCMakerConf",
obj_id = "random-tc-generator",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as before, empty spaces around =:
obj_id="random-tc-generator",

@@ -0,0 +1,75 @@
# Survey of trigger and readout window configurations that are used in existing integtests, Summer 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This documentation is GREAT.
My only concern is whether it makes sense to have the year in the filename instead (completely ok in the text), as updates later on can cause link breaks, or the file may look like it obsolete later on.

| long_window_readout_test.py | 0.05 Hz trigger rate, RWBT=-100000000, RWET=1000000, RWW=1.62 sec | - | - |
| minimal_system_quick_test.py | 1 Hz trigger rate, RWBT=-2000, RWET=5, RWW=32.1 usec | - | - |
| readout_type_scan_test.py | 1 Hz trigger rate, various readout window widths | - | various rates and readout window widths |
| sample_ehn1_multihost_test.py | - | - | - |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For a person not reading the whole documentation, it may suggest this test has no triggers.
Maybe we should add a note or legend distinguishing "set by integtest" from "inherited from predefined config"; or add a brief entry such as "1 Hz RTCM + 3 Hz FakeHSI (from predefined config local-1x1-config)".


### Other integtests:

| Integtest name | RTCM | FakeHSI | Triggers from TPs |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please remember to open an issue for these parts that need updating.

Kurt Biery and others added 2 commits July 1, 2026 09:54
Updated integration test details for trigger rates and configurations, including specific parameters for WIB and DAPHNE data. Clarified expected rates and added observed rates for various tests.
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