DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
The DUNE DAQ data selection software separates physics algorithms (which make trigger activity and trigger candidate objects) from concerns about how the data objects are packaged and transported through the data selection system.
Physics algorithms are implemented in the triggeralgs
package. To create a new physics algorithm, create a class that derives from triggeralgs::TriggerActivityMaker
or triggeralgs::TriggerCandidateMaker
as appropriate. I'll use TriggerActivityMaker
for definiteness from here on: if you're writing a TriggerCandidateMaker
, make the appropriate substitutions.
In your derived class, you must implement one pure virtual function, namely:
This function will be called by the data selection framework once for each input TriggerPrimitive
. Your implementation should do whatever processing it wants, and if the addition of the latest TriggerPrimitive
causes a new output TriggerActivity
to be complete, add the TriggerActivity
to the output vector output_ta
.
The data selection framework will make calls to operator()
(with the TriggerPrimitive
s strictly ordered by start time), which in turn calls the user-defined process()
function. That is, once operator()
has been called with a TriggerPrimitive
whose start time is T
, it will not later be called with a TriggerPrimitive
whose start time is less than T
. (If two TriggerPrimitives
have exactly the same time, the relative order of the calls to operator()
is by channel number.)
You will of course need to store the state of your algorithm between calls to process()
: use member variables in your class for this.
It's recommended (but not strictly required) to also implement the flush()
function from TriggerActivityMaker
, whose signature is: