32 PARTITION = "hsi_readout_test",
34 CONNECTIONS_FILE="${TIMING_SHARE}/config/etc/connections.xml",
36 HSI_DEVICE_NAME="BOREAS_FMC",
39 UHAL_LOG_LEVEL=
"notice",
44 nw_specs = [nwmgr.Connection(name=PARTITION +
".hsievent",topics=[], address=
"tcp://127.0.0.1:12344")]
48 app.QueueSpec(inst=
"trigger_candidate_q", kind=
'FollySPSCQueue', capacity=2000),
53 queue_specs = app.QueueSpecs(sorted(queue_bare_specs, key=
lambda x: x.inst))
56 mspec(
"hsi",
"HSIReadout", []),
58 mspec(
"ttcm",
"TimingTriggerCandidateMaker", [
59 app.QueueInfo(name=
"output", inst=
"trigger_candidate_q", dir=
"output"),
63 init_specs = app.Init(queues=queue_specs, modules=mod_specs, nwconnections=nw_specs)
65 jstr = json.dumps(init_specs.pod(), indent=4, sort_keys=
True)
68 initcmd = rcif.RCCommand(
69 id=cmdlib.CmdId(
"init"),
76 (
"hsi", hsi.ConfParams(
77 connections_file=CONNECTIONS_FILE,
78 readout_period=READOUT_PERIOD,
79 hsi_device_name=HSI_DEVICE_NAME,
80 uhal_log_level=UHAL_LOG_LEVEL,
81 hsievent_connection_name = f
"{PARTITION}.hsievent",
85 s1=ttcm.map_t(signal_type=TTCM_S1,
88 s2=ttcm.map_t(signal_type=TTCM_S2,
91 hsievent_connection_name = PARTITION+
".hsievent",
95 confcmd = mrccmd(
"conf",
"INITIAL",
"CONFIGURED", mods)
97 jstr = json.dumps(confcmd.pod(), indent=4, sort_keys=
True)
100 startpars = rcif.StartParams(run=1, disable_data_storage=
False)
102 startcmd = mrccmd(
"start",
"CONFIGURED",
"RUNNING", [
107 jstr = json.dumps(startcmd.pod(), indent=4, sort_keys=
True)
108 print(
"="*80+
"\nStart\n\n", jstr)
110 stopcmd = mrccmd(
"stop",
"RUNNING",
"CONFIGURED", [
115 jstr = json.dumps(stopcmd.pod(), indent=4, sort_keys=
True)
116 print(
"="*80+
"\nStop\n\n", jstr)
119 scrapcmd = mcmd(
"scrap", [
123 jstr = json.dumps(scrapcmd.pod(), indent=4, sort_keys=
True)
124 print(
"="*80+
"\nScrap\n\n", jstr)
127 cmd_seq = [initcmd, confcmd, startcmd, stopcmd]
130 jstr = json.dumps([c.pod()
for c
in cmd_seq], indent=4, sort_keys=
True)
150 def cli(partition, run_number, connections_file, readout_period, hsi_device_name, ttcm_s1, ttcm_s2, uhal_log_level, output_path, json_file):
152 JSON_FILE: Input raw data file.
153 JSON_FILE: Output json configuration file.
156 with open(json_file,
'w')
as f:
159 RUN_NUMBER = run_number,
160 CONNECTIONS_FILE=connections_file,
161 READOUT_PERIOD = readout_period,
162 HSI_DEVICE_NAME = hsi_device_name,
165 UHAL_LOG_LEVEL = uhal_log_level,
166 OUTPUT_PATH = output_path,
169 print(f
"'{json_file}' generation completed.")
cli(partition, run_number, connections_file, readout_period, hsi_device_name, ttcm_s1, ttcm_s2, uhal_log_level, output_path, json_file)