2 from __future__
import print_function
3 from __future__
import absolute_import
5 """Check that if a scenario apppears in a chain part name, that it also
6 is a key in the chain part dict. This is to catch errors whereby a
7 scenario is present in the chain name, but is is not present in the
8 SignatureDicts.JetChainParts[hypoScenario] list, in which case
9 hypoScenario is set to the default. The ommision of the full scenario
10 name from the list is an easy mistake to make, but detecting the problem can be
14 from TriggerMenuMT.HLT.Menu.SignatureDicts
import JetChainParts
17 full_scenarios = JetChainParts[
'hypoScenario']
18 headers =
set([s.split(
'XX')[0]
for s
in full_scenarios])
20 headers_in_chain_name = {h: chain_name.count(h)
for h
in headers}
22 cp_scenarios =
set([cp[
'hypoScenario']
for cp
in chain_parts])
24 headers_in_cp = {h: 0
for h
in headers}
26 for cps
in cp_scenarios:
27 if cps ==
'simple':
continue
32 bad_headers = [h
for h
in headers_in_chain_name.keys()
if
33 headers_in_chain_name[h] != headers_in_cp[h]]