Skip to content
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

fixes for random and custom TC maker plugins #384

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion python/daqconf/apps/trigger_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
moo.otypes.load_types('trigger/triggeractivitymaker.jsonnet')
moo.otypes.load_types('trigger/triggercandidatemaker.jsonnet')
moo.otypes.load_types('trigger/customtriggercandidatemaker.jsonnet')
moo.otypes.load_types('trigger/randomtriggercandidatemaker.jsonnet')
moo.otypes.load_types('trigger/triggerzipper.jsonnet')
moo.otypes.load_types('trigger/moduleleveltrigger.jsonnet')
moo.otypes.load_types('trigger/timingtriggercandidatemaker.jsonnet')
Expand All @@ -21,6 +22,7 @@
import dunedaq.trigger.triggeractivitymaker as tam
import dunedaq.trigger.triggercandidatemaker as tcm
import dunedaq.trigger.customtriggercandidatemaker as ctcm
import dunedaq.trigger.randomtriggercandidatemaker as rtcm
import dunedaq.trigger.triggerzipper as tzip
import dunedaq.trigger.moduleleveltrigger as mlt
import dunedaq.trigger.timingtriggercandidatemaker as ttcm
Expand Down Expand Up @@ -129,6 +131,11 @@ def get_trigger_app(
USE_CUSTOM_MAKER = trigger.use_custom_maker
CTCM_TYPES = trigger.ctcm_trigger_types
CTCM_INTERVAL = trigger.ctcm_trigger_intervals
CTCM_TIMESTAMP_METHOD = trigger.ctcm_timestamp_method
USE_RANDOM_MAKER = trigger.use_random_maker
RTCM_INTERVAL = trigger.rtcm_trigger_interval_ticks
RTCM_TIMESTAMP_METHOD = trigger.rtcm_timestamp_method
RTCM_DISTRIBUTION = trigger.rtcm_time_distribution
CHANNEL_MAP_NAME = detector.tpc_channel_map
DATA_REQUEST_TIMEOUT=trigger_data_request_timeout
HOST=trigger.host_trigger
Expand Down Expand Up @@ -310,7 +317,15 @@ def get_trigger_app(
conf=ctcm.Conf(trigger_types=CTCM_TYPES,
trigger_intervals=CTCM_INTERVAL,
clock_frequency_hz=CLOCK_SPEED_HZ,
timestamp_method="kSystemClock"))]
timestamp_method=CTCM_TIMESTAMP_METHOD))]

if USE_RANDOM_MAKER:
modules += [DAQModule(name = 'rtcm',
plugin = 'RandomTriggerCandidateMaker',
conf=rtcm.Conf(trigger_interval_ticks=RTCM_INTERVAL,
clock_frequency_hz=CLOCK_SPEED_HZ,
timestamp_method=RTCM_TIMESTAMP_METHOD,
time_distribution=RTCM_DISTRIBUTION))]

### get trigger bitwords for mlt
MLT_TRIGGER_FLAGS = get_trigger_bitwords(MLT_TRIGGER_BITWORDS)
Expand Down Expand Up @@ -347,6 +362,9 @@ def get_trigger_app(
if USE_CUSTOM_MAKER:
mgraph.connect_modules("ctcm.trigger_candidate_sink", "mlt.trigger_candidate_source", "TriggerCandidate", "tcs_to_mlt", size_hint=1000)

if USE_RANDOM_MAKER:
mgraph.connect_modules("rtcm.trigger_candidate_sink", "mlt.trigger_candidate_source", "TriggerCandidate", "tcs_to_mlt", size_hint=1000)

if len(TP_SOURCE_IDS) > 0:
mgraph.connect_modules("tazipper.output", "tcm.input", data_type="TASet", size_hint=1000)

Expand Down
7 changes: 7 additions & 0 deletions schema/daqconf/triggergen.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ local cs = {
tc_types: s.sequence( "TCTypes", self.tc_type, doc="List of TC types"),
tc_interval: s.number( "TCInterval", "i8", nc(minimum=1, maximum=30000000000), doc="The intervals between TCs that are inserted into MLT by CTCM, in clock ticks"),
tc_intervals: s.sequence( "TCIntervals", self.tc_interval, doc="List of TC intervals used by CTCM"),
timestamp_estimation: s.enum("timestamp_estimation", ["kTimeSync", "kSystemClock"]),
distribution_type: s.enum("distribution_type", ["kUniform", "kPoisson"]),
readout_time: s.number( "ROTime", "i8", doc="A readout time in ticks"),
bitword: s.string( "Bitword", doc="A string representing the TC type name, to be set in the trigger bitword."),
bitword_list: s.sequence( "BitwordList", self.bitword, doc="A sequence of bitword (TC type bits) forming a bitword."),
Expand Down Expand Up @@ -128,6 +130,11 @@ local cs = {
s.field( "use_custom_maker", types.flag, default=false, doc="Option to use a Custom Trigger Candidate Maker (plugin)"),
s.field( "ctcm_trigger_types", self.tc_types, default=[4], doc="Optional list of TC types to be used by the Custom Trigger Candidate Maker (plugin)"),
s.field( "ctcm_trigger_intervals", self.tc_intervals, default=[10000000], doc="Optional list of intervals (clock ticks) for the TC types to be used by the Custom Trigger Candidate Maker (plugin)"),
s.field( "ctcm_timestamp_method", self.timestamp_estimation, "kSystemClock", doc="Option to pick source for timing (system / timesync)"),
s.field( "use_random_maker", types.flag, default=false, doc="Option to use a Random Trigger Candidate Maker (plugin)"),
s.field( "rtcm_trigger_interval_ticks", self.tc_interval, default=62500000, doc="Interval between triggers in 16 ns time ticks (default 1.024 s)"),
s.field( "rtcm_timestamp_method", self.timestamp_estimation, "kSystemClock", doc="Option to pick source for timing (system / timesync)"),
s.field( "rtcm_time_distribution", self.distribution_type, "kUniform", doc="Type of distribution used for random timestamps (uniform or poisson)"),
]),

};
Expand Down