Skip to content

Commit df30b72

Browse files
committed
Apply keys from generic config if applicable
Improvement for configuration: Apply the key-values from the generic config on top of the anchorConfig, if the anchorConfig does not have these keys themselves. Useful for key-values in the digitization space for instance since they are not mentioned in async reco workflows. In addition, actually apply FT0DigParam and FV0DigParam to the digitization of FIT. This didn't have any effect so far.
1 parent ebc64ac commit df30b72

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,21 @@ def load_external_config(configfile):
200200
return config
201201

202202
anchorConfig = {}
203+
anchorConfig_generic = { "ConfigParams": create_sim_config(args) }
203204
if args.anchor_config != '':
204205
print ("** Using external config **")
205206
anchorConfig = load_external_config(args.anchor_config)
207+
# adjust the anchorConfig with keys from the generic config, not mentioned in the external config
208+
# (useful for instance for digitization parameters or others not usually mentioned in async reco)
209+
for key in anchorConfig_generic["ConfigParams"]:
210+
if not key in anchorConfig["ConfigParams"]:
211+
print (f"Transcribing key {key} from generic config into final config")
212+
anchorConfig["ConfigParams"][key] = anchorConfig_generic["ConfigParams"][key]
213+
206214
else:
207215
# we load a generic config
208216
print ("** Using generic config **")
209-
anchorConfig = { "ConfigParams": create_sim_config(args) }
217+
anchorConfig = anchorConfig_generic
210218
# we apply additional external user choices for the configuration
211219
# this will overwrite config from earlier stages
212220
if args.overwrite_config != '':
@@ -1095,7 +1103,7 @@ def createRestDigiTask(name, det='ALLSMALLER'):
10951103
f'--interactionRate {INTRATE}',
10961104
f'--incontext {CONTEXTFILE}',
10971105
'--disable-write-ini',
1098-
putConfigValues(listOfMainKeys=['EMCSimParam'], localCF={"DigiParams.seed" : str(TFSEED)}),
1106+
putConfigValues(listOfMainKeys=['EMCSimParam','FV0DigParam','FT0DigParam'], localCF={"DigiParams.seed" : str(TFSEED)}),
10991107
('--combine-devices','')[args.no_combine_dpl_devices],
11001108
('',' --disable-mc')[args.no_mc_labels],
11011109
QEDdigiargs,

0 commit comments

Comments
 (0)