ATLAS Offline Software
Loading...
Searching...
No Matches
python.checkScenarioPresence Namespace Reference

Functions

 checkScenarioPresence (chain_parts, chain_name)

Detailed Description

Check that if a scenario apppears in a chain part name, that it also
is a key in the chain part dict. This is to catch errors whereby a
scenario is present in the chain name, but is is not present in the
SignatureDicts.JetChainParts[hypoScenario] list, in which case 
hypoScenario is set to the default. The ommision of the full scenario
name from the list is an easy mistake to make, but detecting the problem can be
difficult

Function Documentation

◆ checkScenarioPresence()

python.checkScenarioPresence.checkScenarioPresence ( chain_parts,
chain_name )

Definition at line 14 of file checkScenarioPresence.py.

14def checkScenarioPresence(chain_parts, chain_name):
15 full_scenarios = JetChainParts['hypoScenario']
16 headers = set([s.split('XX')[0] for s in full_scenarios])
17
18 headers_in_chain_name = {h: chain_name.count(h) for h in headers}
19
20 cp_scenarios = set([cp['hypoScenario'] for cp in chain_parts])
21
22 headers_in_cp = {h: 0 for h in headers}
23
24 for cps in cp_scenarios:
25 if cps == 'simple': continue # 'simple' not in chain name
26 for h in headers:
27 if cps.startswith(h):
28 headers_in_cp[h] += 1
29
30 bad_headers = [h for h in headers_in_chain_name.keys() if
31 headers_in_chain_name[h] != headers_in_cp[h]]
32
33 return bad_headers
34
STL class.