Feature #22806

DAQInterface should provide a hook to allow an arbitrary experiment-provided function to run periodically

Added by John Freeman over 1 year ago. Updated about 1 year ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Wes pointed out it would be useful for SBND if, as part of operations, a hook was available in DAQInterface to periodically query and report the individual statuses of artdaq processes. A way to do this should be provided which is backwards compatible, doesn't by default slow things down, and doesn't interfere with other experiment's workflow.

Associated revisions

Revision 6dd8da4a (diff)
Added by John Freeman almost 1 year ago

JCF: Issue #22806: remove redundant imports of unimplemented hook functions


#1 Updated by John Freeman over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from New to Resolved

Using DAQInterface at the head of feature/issue22806_provide_experiment_hooks, commit bae537b08e7e4e8369896d65a0b5365308446bb6, you can implement a function which executes once a second in DAQInterface of the form

def perform_periodic_action_base(self):

as long as it's (A) defined in a file called, and (B) before you launch DAQInterface, you've pointed an environment variable "DAQINTERFACE_OVERRIDES_FOR_EXPERIMENT_MODULE_DIR" to the directory in which is located. Note that in the example above, you'd replace "pass" with useful code, and that any code in that function has access to DAQInterface member variables such as self.procinfos.

Incidentally, the same also applies to functions "start_datataking_base", "stop_datataking_base", "do_enable_base" and "do_disable_base".

#2 Updated by John Freeman over 1 year ago

After discussion at today's meeting, added the possibility to implement a check_config_base function, which should throw an exception if a problem's observed just before DAQInterface proceeds to send the init transition to the artdaq processes. If an exception is thrown, DAQInterface goes back to "booted" from "configuring". Commit c6d70bd8827525135f0135c91f8f4e8fab70d221 at the head of feature/issue22806_provide_experiment_hooks.

#3 Updated by Eric Flumerfelt about 1 year ago

  • Status changed from Resolved to Reviewed

Code reviewed and tested. I have added a small python file to the docs directory as a guide for experiments wishing to use this functionality.

Also available in: Atom PDF