16 Get a list of RegionSelector tools for given detector look-up tables to build list of ROBs
17 in these detectors that intersect with the RoI. Special value 'All' can be also given
18 in the detNames list to include all detectors available in RegionSelector.
21 _regSelToDetFlagMap = {
30 _regSelToDetFlagMap |= dict([(d,d)
for d
in [
'Pixel',
'SCT',
'TRT']])
32 _regSelToDetFlagMap |= dict([(d,d)
for d
in [
'MDT',
'RPC',
'TGC',
'CSC',
'MM']])
33 _regSelToDetFlagMap[
'STGC'] =
'sTGC'
35 detNames = _regSelToDetFlagMap.keys()
42 if det
not in _regSelToDetFlagMap:
43 raise RuntimeError(
'Cannot add detector "' + det +
'" because it is not in _regSelToDetFlagMap')
44 detFlag =
'Enable'+_regSelToDetFlagMap[det]
45 detEnabled = getattr(flags.Detector, detFlag)
47 _log.debug(
'addRegSelDets: skip adding detector "%s" because the flag Detector.%s is False', det, detFlag)
49 funcName = f
'regSelTool_{det}_Cfg'
50 if not hasattr(RegSelToolConfig, funcName):
51 raise RuntimeError(
'Cannot add detector "' + det +
'", RegSelToolConfig does not have a function ' + funcName)
52 func = getattr(RegSelToolConfig, funcName)
53 if not callable(func):
54 raise RuntimeError(
'Cannot add detector "' + det +
'", RegSelToolConfig.' + funcName +
' is not callable')
55 regSelTools += [acc.popToolsAndMerge(func(flags))]
57 acc.setPrivateTools(regSelTools)