ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalSimJsonConfig Namespace Reference

Functions

 get_all_vector_keys (conf)
 eEmEg1BDTMultCfg (flags, thrname, input, et_low, workingPoint, startbit, nbits, **kwargs)
 eEmEg1MultCfg (flags, thrname, input, et_low, workingPoint, startbit, nbits, **kwargs)
 commonMultCfg (flags, thrname, input, et_low, startbit, nbits, **kwargs)
 threshold_type_to_hypo_config (threshold)
 forward_to_subtool (substr, subval, props)
 GenericTOBProducerAlgCfg (flags, name, type, input, output, **params)
 GenericTOBProducerAlgToolCfg (flags, name, type, input, output, **params)
 TOBProvider_cfg_fn (name)
 expand_io (io)
 config_TOB_providers (flags, tobs_to_providers, input)
 L0HypoCfg (flags, threshold, hypo_specs, tobs_to_providers, triggerlines)
 GlobalSimJsonCfg (flags, json_name, ignore_menu_items=False, force_config_TOBs=[], txt_inputs={}, txt_outputs={}, print_detailed_config=False)
 main ()

Variables

dict threshold_type_configs
dict inputs_to_gsim

Function Documentation

◆ commonMultCfg()

commonMultCfg ( flags,
thrname,
input,
et_low,
startbit,
nbits,
** kwargs )

Definition at line 85 of file GlobalSimJsonConfig.py.

85def commonMultCfg(flags,thrname,input,et_low,startbit,nbits,**kwargs):
86 cfg = ComponentAccumulator()
87 alg = CompFactory.GlobalSim.GlobalSimulationAlg('GlobalSimulationAlg')
88 tool = CompFactory.GlobalSim.CommonMultAlgTool(
89 f'commonMult_{thrname}',
90 et_low = et_low,
91 TIPposition=startbit,
92 TIPwidth=nbits,
93 # Assume this is unique, otherwise we need a custom configurator
94 CommonTOBsKey = list(input.values())[0],
95 enable_dump=True,
96 )
97
98 alg.TIPwriters = [tool]
99 cfg.addEventAlgo(alg)
100
101 vector_outputs = get_all_vector_keys(tool)
102 return cfg, vector_outputs
103
104
105# Define the mapping to non-generic config functions

◆ config_TOB_providers()

config_TOB_providers ( flags,
tobs_to_providers,
input )

Definition at line 261 of file GlobalSimJsonConfig.py.

261def config_TOB_providers(flags, tobs_to_providers, input):
262 TOB_CAs = []
263 all_vector_outputs = set()
264
265 upstream_deps = set()
266 input_list = list(input)
267 while len(input_list)>0:
268 tob = input_list.pop()
269 # For now, the GlobalLArCells are the common input for everything, which are produced upstream.
270 # Specified explicitly in the menu to make it clear that the algorithm is at the start of Global
271 if tob in inputs_to_gsim:
272 continue
273 assert tob in tobs_to_providers, f"Configuration for {tob} provider not specified in L0 menu!"
274 provider = tobs_to_providers[tob]
275 cfg_fn = TOBProvider_cfg_fn(provider['type'])
276 assert cfg_fn is not None, f"No configuration available for {provider['type']}"
277 params = dict(provider['parameters'])
278 if '.' not in provider['type']:
279 params.update(dict(
280 name = provider['name'],
281 type = provider['type'],
282 input = provider['input'],
283 output = provider['output'],
284 ))
285 TOB_cfg, vector_outputs = cfg_fn(flags,**params)
286 TOB_CAs.append(TOB_cfg)
287 all_vector_outputs |= vector_outputs
288 log.debug(f"{provider['name']} needs:")
289 log.debug(pformat(provider['input']))
290 upstream_deps |= set(i[1] for i in provider['input'])
291
292 # Organised this way, we do tiers of inputs,
293 # prioritising those needed for the hypo first,
294 # then iterating backwards
295 # Mostly only for clarity in the sequence, but
296 # useful if setting threads=0 (but why?)
297 if upstream_deps:
298 upstream_CAs, upstream_vecs = config_TOB_providers(flags, tobs_to_providers, upstream_deps)
299 TOB_CAs += upstream_CAs
300 all_vector_outputs |= upstream_vecs
301
302 return TOB_CAs, all_vector_outputs
303
304
305# Configure the TIPWriter that evaluates a single threshold, and the TOB providers that
306# generate the necessary inputs to execute the TIPWriter
307# The prerequisites should be shared with any TIPWriter processing the same threshold type
STL class.

◆ eEmEg1BDTMultCfg()

eEmEg1BDTMultCfg ( flags,
thrname,
input,
et_low,
workingPoint,
startbit,
nbits,
** kwargs )

Definition at line 35 of file GlobalSimJsonConfig.py.

35def eEmEg1BDTMultCfg(flags,thrname,input,et_low,workingPoint,startbit,nbits,**kwargs):
36 cfg = ComponentAccumulator()
37 alg = CompFactory.GlobalSim.GlobalSimulationAlg('GlobalSimulationAlg')
38 # This is for a working point with no eta-dependence
39 # (Run 3 convention) Eta-dependent ones would require looping over eta ranges
40 # with individual priorities
41 tool = CompFactory.GlobalSim.eEmEg1BDTMultAlgTool(
42 f'Egamma1BDTAlgTool_{thrname}',
43 et_low=et_low,
44 Eg1BDT=workingPoint['value'],
45 Eg1BDT_op=workingPoint['compOp'],
46 eEmEg1BDTTOBContainerKey=input['eEmEg1BDTTOBContainer'],
47 TIPposition=startbit,
48 TIPwidth=nbits,
49 enable_dump=True,
50 )
51 alg.TIPwriters = [tool]
52 cfg.addEventAlgo(alg)
53
54 vector_outputs = get_all_vector_keys(tool)
55 return cfg, vector_outputs
56
57

◆ eEmEg1MultCfg()

eEmEg1MultCfg ( flags,
thrname,
input,
et_low,
workingPoint,
startbit,
nbits,
** kwargs )

Definition at line 58 of file GlobalSimJsonConfig.py.

58def eEmEg1MultCfg(flags,thrname,input,et_low,workingPoint,startbit,nbits,**kwargs):
59 cfg = ComponentAccumulator()
60 alg = CompFactory.GlobalSim.GlobalSimulationAlg('GlobalSimulationAlg')
61 # This is for a working point with no eta-dependence
62 # (Run 3 convention) Eta-dependent ones would require looping over eta ranges
63 # with individual priorities
64 tool = CompFactory.GlobalSim.eEmMultAlgTool(
65 f'eEmMultAlgTool_{thrname}',
66 et_low=et_low,
67 rhad=workingPoint['rhad'],
68 rhad_op=workingPoint['rhad_op'],
69 reta=workingPoint['reta'],
70 reta_op=workingPoint['reta_op'],
71 wstot=workingPoint['wstot'],
72 wstot_op=workingPoint['wstot_op'],
73 eEmTOBs=input['eEmTOBContainer'],
74 TIPposition=startbit,
75 TIPwidth=nbits,
76 enable_dump=True,
77 )
78 alg.TIPwriters = [tool]
79 cfg.addEventAlgo(alg)
80
81 vector_outputs = get_all_vector_keys(tool)
82 return cfg, vector_outputs
83
84

◆ expand_io()

expand_io ( io)

Definition at line 232 of file GlobalSimJsonConfig.py.

232def expand_io(io):
233 expanded = []
234 if isinstance(io,str):
235 expanded.append((io,io))
236 else:
237 if isinstance(io,list):
238 expanded += [(el,el) for el in io]
239 elif isinstance(io,dict):
240 expanded += [(ttype,tname) for ttype,tname in io.items()]
241 else:
242 raise TypeError(f"Unhandled type {type(io)} for I/O definition")
243 return tuple(expanded)
244
245
246# Configure the components necessary to generate a list of required input TOBs
247# Recurse through the prerequisites of these components to capture all requirements.
248# Another way to do this would be to construct a DAG from the inputs/outputs,
249# then iterate through the nodes and instantiate each component.
250#
251# No need to resolve objects created upstream of GSim

◆ forward_to_subtool()

forward_to_subtool ( substr,
subval,
props )

Definition at line 117 of file GlobalSimJsonConfig.py.

117def forward_to_subtool(substr, subval, props):
118 subname, subprop = substr.split('.')
119 if '/' in subname:
120 subtype, subname = subname.split('/')
121 else:
122 subtype = subname
123 if subname not in props:
124 props[subname] = CompFactory.getComp(f"GlobalSim::{subtype}")(
125 subtype,
126 **{subprop:subval}
127 )
128 else:
129 props[subname][subprop] = subval
130
131# Generic function to instantiate an Alg that does not need special config
132# Currently assumes one instance per type
133# If we wanted multiple instances, the type would have to be added to the menu
134@AccumulatorCache

◆ GenericTOBProducerAlgCfg()

GenericTOBProducerAlgCfg ( flags,
name,
type,
input,
output,
** params )

Definition at line 135 of file GlobalSimJsonConfig.py.

135def GenericTOBProducerAlgCfg(flags, name, type, input, output, **params):
136 cfg = ComponentAccumulator()
137
138 props = {}
139 for i in input:
140 if '.' in i[0]:
141 forward_to_subtool(i[0]+'Key',i[1],props)
142 else:
143 props[i[0]+'Key'] = i[1]
144 for o in output:
145 if '.' in o[0]:
146 forward_to_subtool(o[0]+'Key',o[1],props)
147 else:
148 props[o[0]+'Key'] = o[1]
149
150 for prop, val in params.items():
151 if '.' in prop:
152 forward_to_subtool(prop,val,props)
153 else:
154 props[prop] = val
155 # Hack to handle input/output properties that don't fit the naming convention '[Type]Key'
156 try:
157 alg = CompFactory.getComp(f"GlobalSim::{type}")(
158 name,
159 **props)
160 except AttributeError:
161 props_nokey = {k.replace('Key',''):v for k,v in props.items()}
162 alg = CompFactory.getComp(f"GlobalSim::{type}")(
163 name,
164 **props_nokey)
165 cfg.addEventAlgo(alg)
166
167 # At the moment it doesn't seem like we want to write anything but it might be more
168 # consistent if we just call the function anyway?
169 vector_outputs = get_all_vector_keys(alg)
170 return cfg, vector_outputs
171
172
173# Generic function to instantiate an Alg that does not need special config
174# Currently assumes one instance per type
175# If we wanted multiple instances, the type would have to be added to the menu
176@AccumulatorCache

◆ GenericTOBProducerAlgToolCfg()

GenericTOBProducerAlgToolCfg ( flags,
name,
type,
input,
output,
** params )

Definition at line 177 of file GlobalSimJsonConfig.py.

177def GenericTOBProducerAlgToolCfg(flags, name, type, input, output, **params):
178 cfg = ComponentAccumulator()
179
180 # Construct the tool and add it to a GlobalSimulationAlg
181 props = {}
182 for i in input:
183 if '.' in i[0]:
184 forward_to_subtool(i[0]+'Key',i[1],props)
185 else:
186 props[i[0]+'Key'] = i[1]
187 for o in output:
188 if '.' in o[0]:
189 forward_to_subtool(o[0]+'Key',o[1],props)
190 else:
191 props[o[0]+'Key'] = o[1]
192
193 for prop, val in params.items():
194 if '.' in prop:
195 forward_to_subtool(prop,val,props)
196 else:
197 props[prop] = val
198 algtool = CompFactory.getComp(f"GlobalSim::{type}")(
199 name,
200 **props)
201 alg = CompFactory.GlobalSim.GlobalSimulationAlg(
202 name.replace("AlgTool","Alg"),
203 globalsim_algs = [algtool]
204 )
205 cfg.addEventAlgo(alg)
206
207 vector_outputs = get_all_vector_keys(algtool)
208 return cfg, vector_outputs
209
210
211# Ideally we use the generic configuration for everything, working
212# from conventions in the json description, however some
213# custom configurator functions may be necessary.

◆ get_all_vector_keys()

get_all_vector_keys ( conf)

Definition at line 14 of file GlobalSimJsonConfig.py.

14def get_all_vector_keys(conf):
15 key_props = set()
16 vector_outputs = set()
17 for pname,pdef in conf.getDefaultProperties().items():
18 if pname.endswith('Key'):
19 key_props.add(pname)
20 for key in key_props:
21 prop = getattr(conf,key)
22 if prop.type().startswith('std::vector') and \
23 prop.mode()=='W':
24 vector_outputs.add(f'{prop.type()}#{prop.path}')
25 return vector_outputs
26
27
28# The alg is shared between all hypo tools in order to merge the TIP word
29# For now, expect a dict extracted from json
30# Might be a threshold class later
31# The alg instantiation could also be pulled out into the upper level loop
32# The kwargs can absorb any other info in the threshold, but it seems better to
33# name all required properties explicitly
34# No need to cache, we should just be doing a series of unique thresholds

◆ GlobalSimJsonCfg()

GlobalSimJsonCfg ( flags,
json_name,
ignore_menu_items = False,
force_config_TOBs = [],
txt_inputs = {},
txt_outputs = {},
print_detailed_config = False )

Definition at line 369 of file GlobalSimJsonConfig.py.

377 ):
378 menu = json.load(open(json_name))
379
380 gsim_alg_prefix = "GlobalSim_"
381
382 cfg = ComponentAccumulator()
383 # This is for placing any algorithms that produce inputs required by Global
384 # that happen upstream of the hardware system
385 cfg.addSequence(CompFactory.AthSequencer('GlobalSimPrereqs'))
386 # Generate LAr Cells a la FEB2/LASP/MUX
387 cfg.addSequence(CompFactory.AthSequencer('LArPreprocessing'), parentName='GlobalSimPrereqs')
388 from GlobalSimulation.LArCellPreparationAlgConfig import LArCellPreparationAlgCfg
389 cfg.merge( LArCellPreparationAlgCfg(
390 flags,
391 name = gsim_alg_prefix+'LArCellPreparationAlg',
392 GlobalLArCellsKey='GlobalLArCells',
393 ),
394 sequenceName='LArPreprocessing'
395 )
396
397 cfg.addSequence(CompFactory.AthSequencer('GlobalSimulation'))
398
399 cfg.addService( CompFactory.GlobalSim.GraphSvc(SequenceNameFilter='GlobalSimulation'), create=True )
400
401 all_vector_outputs = set()
402
403 # Map output TOBs to their providers
404 # Where necessary, the input property name minus 'Key', which hints at the type, is specified
405 # in the json -- make a tuple with the type and name in all cases
406 # This is probably more common for inputs...
407 tobs_to_providers = {}
408 for pname, provider in menu['algorithms'].items():
409 log.debug(f"{pname} --> {provider}")
410 output = expand_io(provider['output'])
411 log.debug('Outputs:')
412 log.debug(pformat(output))
413 _provider = dict(provider)
414 if '/' in pname:
415 _provider['type'], _provider['name'] = pname.split('/',1)
416 else:
417 _provider['type'] = _provider['name'] = pname
418 if gsim_alg_prefix:
419 _provider['name'] = gsim_alg_prefix + _provider['name']
420 _provider['input'] = expand_io(provider['input'])
421 _provider['output'] = output
422 _provider['parameters'] = {}
423 _provider['parameters'].update(provider.get('parameters',{}))
424 for otuple in output:
425 assert otuple[1] not in tobs_to_providers, f"Duplicate provider for {otuple}"
426 tobs_to_providers[otuple[1]] = _provider
427
428 log.debug(pformat(tobs_to_providers))
429
430 # Replace providers by text file readers if provided
431 if txt_inputs:
432 for key, (bitspec, filepath) in txt_inputs.items():
433 if key in tobs_to_providers:
434 log.warning(f"Replacing {key} algorithm of type {tobs_to_providers[key]} with text reader")
435 else:
436 log.info(f"Inserting text reader to provide {key}")
437 tobs_to_providers[key] = {
438 'type': 'TOBTextReader',
439 'name': f'{key}_{bitspec}_from_txt',
440 'input': [],
441 'output': [('Output',key)],
442 'parameters': {
443 'BitSpec': bitspec,
444 'InputFile': filepath
445 }
446 }
447
448 # Get L1 items (never mind CTP logic for now) and run configuration for each threshold
449 # Let CA merging sort out all overlaps (add caching a la HLT later)
450 active_thresholds = set()
451 TIP_bits = 0
452 if not ignore_menu_items:
453 for item, item_dict in menu['items'].items():
454 for threshold in item_dict['thresholds']:
455 active_thresholds.add(threshold)
456
457 for threshold in active_thresholds:
458 hypo_ca, vector_outputs, hypo_dict = L0HypoCfg(
459 flags,
460 threshold,
461 hypo_specs = menu['hypotheses'],
462 tobs_to_providers = tobs_to_providers,
463 triggerlines = menu['connectors']['L0Global']['triggerlines']
464 )
465 cfg.merge(hypo_ca,'GlobalSimulation')
466 all_vector_outputs |= vector_outputs
467
468 # Check that the TIP bits don't overlap
469 hypo_bits = sum([1<<i for i in range(hypo_dict['startbit'],hypo_dict['startbit']+hypo_dict['nbits'])])
470 assert TIP_bits & hypo_bits == 0, f"TIP bits for {threshold} overlap other thresholds"
471 TIP_bits = TIP_bits + hypo_bits
472
473 # Explicitly requested TOBproviders
474 for tob in force_config_TOBs:
475 log.info(f"Explicitly configuring {tob} from menu")
476 tob_cfgs, vector_outputs = config_TOB_providers(flags,tobs_to_providers,{tob})
477 # Try to put in serial execution order, no guarantees
478 for ca in reversed(tob_cfgs):
479 cfg.merge(ca,'GlobalSimulation')
480 all_vector_outputs |= vector_outputs
481
482
483 # Replace providers by text file readers if provided
484 if txt_outputs:
485 for key, (bitspec, filepath) in txt_outputs.items():
486 log.info(f"Inserting text writer to record {key}")
487 cfg.addEventAlgo(
488 CompFactory.GlobalSim.TOBTextWriter(
489 f'{key}_{bitspec}_to_txt',
490 Input=key,
491 BitSpec=bitspec,
492 OutputFile=filepath
493 )
494 )
495
496 # Record diagnostic data to output stream (auto-extract from algs?)
497 from OutputStreamAthenaPool.OutputStreamConfig import addToAOD
498 cfg.merge(addToAOD(flags,all_vector_outputs))
499
500 if print_detailed_config:
501 cfg.printConfig(summariseProps=True)
502
503 return cfg
504
505

◆ L0HypoCfg()

L0HypoCfg ( flags,
threshold,
hypo_specs,
tobs_to_providers,
triggerlines )

Definition at line 308 of file GlobalSimJsonConfig.py.

308def L0HypoCfg(flags, threshold, hypo_specs, tobs_to_providers, triggerlines):
309
310 cfg = ComponentAccumulator()
311
312 # The menu describes the common properties of threshold types and specific instances
313 # Extract all information for the current threshold instance
314 hypo_dict = None
315 for hypo_type, hypo_type_dict in hypo_specs.items():
316 if threshold in hypo_type_dict['thresholds']:
317 this_thr = hypo_type_dict['thresholds'][threshold]
318 hypo_dict = dict(this_thr)
319 hypo_dict['type'] = hypo_type
320 hypo_dict['input'] = hypo_type_dict['input']
321 log.info(f" Menu contains specs for {threshold}: {this_thr}")
322 if 'workingPoint' in hypo_dict:
323 hypo_dict['workingPoint'] = hypo_type_dict['workingPoints'][this_thr['workingPoint']]
324
325 for line in triggerlines:
326 if threshold == line['name']:
327 hypo_dict['startbit'] = line['startbit']
328 hypo_dict['nbits'] = line['nbits']
329 break
330 break
331 assert hypo_dict is not None, f"Threshold {threshold} not in L0 menu"
332 assert 'startbit' in hypo_dict, f"Threshold {threshold} missing TIP position"
333
334 log.debug(pformat(hypo_dict))
335
336 # Put all the inputs in a supersequence to run before the single hypo alg
337 cfg.addSequence(CompFactory.AthSequencer('GlobalSimulationInputs'))
338 # This level mainly just makes clear which algs are needed for a given threshold
339 # Many algs will be shared
340 seqname = f"GlobalSimulationInputs_{hypo_dict['type']}"
341 cfg.addSequence(CompFactory.AthSequencer(seqname),parentName='GlobalSimulationInputs')
342
343 all_vector_outputs = set()
344 # Grab the corresponding configuration function
345 # This should interpret the threshold data to generate a single hypo instance
346 hypo, vector_outputs = threshold_type_to_hypo_config(hypo_dict['type'])(flags,threshold,**hypo_dict)
347 all_vector_outputs |= vector_outputs
348
349 # Configure input algs for multiplicity
350 # Iterate backwards to their prerequisites
351 # Collect the globalsim_algs (TOB writers) for GlobalSimulationAlg
352 # For aesthetic reasons (and for threads=0), collect the inputs and reverse order
353 # Expand here to treat all formats in the json consistently
354 inputs = expand_io(hypo_dict['input'])
355
356 all_input_CAs, input_vector_outputs = config_TOB_providers(flags, tobs_to_providers, [i[1] for i in inputs])
357 all_vector_outputs |= input_vector_outputs
358
359 for ca in reversed(all_input_CAs):
360 cfg.merge(ca,seqname)
361
362 # Merge one GlobalSimulationAlg that runs all TIP writers
363 cfg.merge(hypo)
364
365 # Keep the hypo_dict around for diagnostics
366 return cfg, all_vector_outputs, hypo_dict
367
368

◆ main()

main ( )

Definition at line 506 of file GlobalSimJsonConfig.py.

506def main():
507 from AthenaConfiguration.AllConfigFlags import initConfigFlags
508 flags = initConfigFlags()
509
510 # Standard argparse.ArgumentParser initialisation options can be provided here
511 parser = flags.getArgumentParser(
512 prog='GlobalSimJsonConfig',
513 description='Prototype Global Simulation steering from json menu',
514 epilog='Give us 25Gbps or give us ...'
515 )
516 parser.add_argument(
517 '-j','--config-json',
518 default='GlobalSimulation/L0GlobalTestMenuv1_Khoo.json',
519 help='The input json config (L0 menu prototype)'
520 )
521 parser.add_argument(
522 '--ignore-menu-items',
523 action='store_true',
524 help='Skip the L1 item thresholds for dependency resolution -- requires force-TOBs'
525 )
526 parser.add_argument(
527 '--force-TOBs',
528 default=[],
529 nargs='+',
530 help='List of TOBs to force on'
531 )
532 parser.add_argument(
533 '--txt-inputs',
534 default=[],
535 nargs='+',
536 help='''
537 List of text files to be read to provide inputs.
538 These will replace the standard prereq chains.
539 Format is bitspec:key:path.
540 '''
541 )
542 parser.add_argument(
543 '--txt-outputs',
544 default=[],
545 nargs='+',
546 help='''
547 List of text files into which containers should be written.
548 Format is bitspec:key:path.
549 '''
550 )
551 log.setLevel(INFO)
552
553 args = flags.fillFromArgs(parser=parser)
554 flags.lock()
555
556 if args.ignore_menu_items:
557 assert args.force_TOBs, "Ignored menu without force-TOBs list -- nothing to do!"
558
559 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
560 cfg = MainServicesCfg(flags)
561
562 from AthenaConfiguration.Enums import Format
563 if flags.Input.Format==Format.POOL:
564 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
565 cfg.merge(PoolReadCfg(flags))
566 elif flags.Input.Format==Format.BS:
567 from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
568 cfg.merge(ByteStreamReadCfg(flags))
569
570 from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg
571 cfg.merge(L1ConfigSvcCfg(flags))
572
573 from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import eFexByteStreamToolCfg, jFexRoiByteStreamToolCfg, gFexByteStreamToolCfg
574 decoderTools = []
575 if flags.Trigger.L1.doeFex: decoderTools += [cfg.popToolsAndMerge(eFexByteStreamToolCfg(flags=flags,name='eFexBSDecoderTool',writeBS=False))]
576 if flags.Trigger.L1.dojFex: decoderTools += [cfg.popToolsAndMerge(jFexRoiByteStreamToolCfg(flags=flags,name="jFexBSDecoderTool",writeBS=False))]
577 if flags.Trigger.L1.dogFex: decoderTools += [cfg.popToolsAndMerge(gFexByteStreamToolCfg(flags=flags,name="gFexBSDecoderTool",writeBS=False))]
578 cfg.addEventAlgo(CompFactory.L1TriggerByteStreamDecoderAlg(
579 name="L1TriggerByteStreamDecoder",
580 DecoderTools=decoderTools
581 ))
582 else:
583 raise RuntimeError(f'Unrecognised input file format {flags.Input.Format} for {flags.Input.Files}')
584
585 txt_inputs = {}
586 if args.txt_inputs:
587 try:
588 txt_inputs = {
589 k:(t,v) for t,k,v in [s.split(':') for s in args.txt_inputs]
590 }
591 except ValueError:
592 raise RuntimeError(f'Failed to interpret text input list {args.txt_inputs}')
593
594 txt_outputs = {}
595 if args.txt_outputs:
596 try:
597 txt_outputs = {
598 k:(t,v) for t,k,v in [s.split(':') for s in args.txt_outputs]
599 }
600 except ValueError:
601 raise RuntimeError(f'Failed to interpret text output list {args.txt_inputs}')
602
603 from TrigValTools.TrigValSteering.Common import find_file_in_path
604 jsonpath = find_file_in_path(args.config_json, 'DATAPATH')
605 cfg.merge( GlobalSimJsonCfg(
606 flags,
607 jsonpath,
608 args.ignore_menu_items,
609 args.force_TOBs,
610 txt_inputs,
611 txt_outputs,
612 print_detailed_config=True
613 ) )
614
615 cfg.run()
616
617
618
int main()
Definition hello.cxx:18

◆ threshold_type_to_hypo_config()

threshold_type_to_hypo_config ( threshold)

Definition at line 111 of file GlobalSimJsonConfig.py.

111def threshold_type_to_hypo_config(threshold):
112 return threshold_type_configs.get(threshold,commonMultCfg)
113
114
115# Forward configuration to a subtool
116# One level of nesting here, make recursive if we need more

◆ TOBProvider_cfg_fn()

TOBProvider_cfg_fn ( name)

Definition at line 214 of file GlobalSimJsonConfig.py.

214def TOBProvider_cfg_fn(name):
215 if '.' in name:
216 # Interpret as a python function in a specified module
217 modulename, cfgname = name.rsplit('.',1)
218 module = importlib.import_module(modulename)
219 return lambda flags, **params: (getattr(module,cfgname)(flags, **params), set())
220 elif name.endswith('AlgTool'):
221 return GenericTOBProducerAlgToolCfg
222 elif name.endswith('Alg') or name in ['TOBTextWriter','TOBTextReader']:
223 return GenericTOBProducerAlgCfg
224 else:
225 return None
226
227
228# Handle different ways of specifying input/output names for handle properties,
229# converting the menu representation into a list of pairs
230# - Defaults to assuming we set [TOBContainerName]Key = "[TOBContainerName]"
231# - If the property name does not match the container name, then use the menu mapping

Variable Documentation

◆ inputs_to_gsim

dict GlobalSimJsonConfig.inputs_to_gsim
Initial value:
= {
'AllCalo',
'GlobalLArCells',
'L1_eEMRoI',
'L1_eEMRoI_ReSim',
'L1_jFexSRJetRoI',
'L1_jFexSRJetRoI_ReSim',
'L1_gFexRhoRoI',
}

Definition at line 252 of file GlobalSimJsonConfig.py.

◆ threshold_type_configs

dict GlobalSimJsonConfig.threshold_type_configs
Initial value:
= {
'eEMBDT': eEmEg1BDTMultCfg,
'eEMBeeDeeTee': eEmEg1BDTMultCfg,
'eEMEg1': eEmEg1MultCfg,
}

Definition at line 106 of file GlobalSimJsonConfig.py.