261 extraOptions=None):
262 if not isinstance(blockConfig, list):
263 blockConfig = [blockConfig]
264
265 for options in blockConfig:
266
267 if 'containerName' in options:
268 containerName = options['containerName']
269 elif containerName is not None and 'containerName' not in options:
270 options['containerName'] = containerName
271
272 logCPAlgTextCfg.info(f"Configuring {block.algName}")
273 seq, funcOpts = block.makeConfig(options)
274 if not seq._blocks:
275 continue
276 algOpts = seq.setOptions(options)
277
278
279 if containerName is None:
280 for opt in algOpts:
281 if 'name' in opt and opt['name'] == 'containerName':
282 containerName = opt.get('value', None)
283 break
284
285 if configSeq is not None:
286 configSeq += seq
287
288
289 if extraOptions is None:
290 extraOptionsList = ["skipOnData", "skipOnMC", "onlyForDSIDs"]
291 for i in algOpts:
292 if i['name'] in extraOptionsList and i['defaultValue'] != i['value']:
293 if extraOptions is None:
294 extraOptions = {}
295 extraOptions[i['name']] = i['value']
296 else:
297 algOpts = seq.setOptions(extraOptions.copy())
298
299
300 algOpts = [i['name'] for i in algOpts]
301 expectedOptions =
set(funcOpts)
302 expectedOptions |=
set(algOpts)
303 expectedOptions |=
set(block.subAlgs)
304
305 difference =
set(options.keys()) - expectedOptions
306 difference.discard('__placeholder__')
307 if difference:
308 difference = "\n".join(difference)
309 raise ValueError(f"There are options set that are not used for "
310 f"{block.algName}:\n{difference}\n"
311 "Please check your configuration.")
312
313
314 for alg
in self._order.
get(block.algName, []):
315 if alg in options:
316 subAlg = block.subAlgs[alg]
317 self._configureAlg(subAlg, options[alg], configSeq, containerName, extraOptions)
318 return configSeq
319
320
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)