ATLAS Offline Software
Functions | Variables
TrigPartialEventBuildingConfig Namespace Reference

Functions

def getRegSelTools (flags, detNames)
 
def RoIPEBInfoWriterToolCfg (flags, name='RoIPEBInfoWriterTool', list[str] regSelDets=[], list[SourceIdentifier] ROBs=[], list[SubDetector] subDets=[], **kwargs)
 
def StaticPEBInfoWriterToolCfg (flags, name='StaticPEBInfoWriterTool', list[SourceIdentifier] ROBs=[], list[SubDetector] subDets=[], **kwargs)
 

Variables

 _log
 
 flags
 
 Files
 
 AtlasVersion
 
 cfg
 
 acc
 
 regSelDets
 
 subDets
 
 ROBs
 

Function Documentation

◆ getRegSelTools()

def TrigPartialEventBuildingConfig.getRegSelTools (   flags,
  detNames 
)
Get a list of RegionSelector tools for given detector look-up tables to build list of ROBs
in these detectors that intersect with the RoI. Special value 'All' can be also given
in the detNames list to include all detectors available in RegionSelector.

Definition at line 14 of file TrigPartialEventBuildingConfig.py.

14 def getRegSelTools(flags, detNames):
15  '''
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.
19  '''
20  # To check Detector flags before adding RegSel tool configs, we need to map RegSel det names to Detector flag names
21  _regSelToDetFlagMap = {
22  # Calo
23  'TTEM': 'Calo',
24  'TTHEC': 'Calo',
25  'FCALEM': 'LAr',
26  'FCALHAD': 'LAr',
27  'TILE': 'Tile',
28  }
29  # ID
30  _regSelToDetFlagMap |= dict([(d,d) for d in ['Pixel', 'SCT', 'TRT']])
31  # Muon
32  _regSelToDetFlagMap |= dict([(d,d) for d in ['MDT', 'RPC', 'TGC', 'CSC', 'MM']])
33  _regSelToDetFlagMap['STGC'] = 'sTGC' # inconsistent capitalisation, regSelTool_STGC_Cfg should be regSelTool_sTGC_Cfg
34  if 'All' in detNames:
35  detNames = _regSelToDetFlagMap.keys()
36 
37  acc = ComponentAccumulator()
38  regSelTools = []
39  for det in detNames:
40  if det=='sTGC':
41  det='STGC' # inconsistent capitalisation, regSelTool_STGC_Cfg should be regSelTool_sTGC_Cfg
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)
46  if not detEnabled:
47  _log.debug('addRegSelDets: skip adding detector "%s" because the flag Detector.%s is False', det, detFlag)
48  continue
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))]
56 
57  acc.setPrivateTools(regSelTools)
58  return acc
59 
60 

◆ RoIPEBInfoWriterToolCfg()

def TrigPartialEventBuildingConfig.RoIPEBInfoWriterToolCfg (   flags,
  name = 'RoIPEBInfoWriterTool',
list[str]   regSelDets = [],
list[SourceIdentifier]   ROBs = [],
list[SubDetector]   subDets = [],
**  kwargs 
)
Configure the RoIPEBInfoWriterTool

Definition at line 61 of file TrigPartialEventBuildingConfig.py.

61 def RoIPEBInfoWriterToolCfg(flags, name='RoIPEBInfoWriterTool',
62  regSelDets : list[str] = [],
63  ROBs: list[SourceIdentifier] = [],
64  subDets: list[SubDetector] = [],
65  **kwargs):
66  """Configure the RoIPEBInfoWriterTool"""
67 
68  acc = ComponentAccumulator()
69  acc_regsel = getRegSelTools(flags, regSelDets)
70 
71  kwargs.setdefault("MatchTriggerType", [])
72 
73  tool = CompFactory.RoIPEBInfoWriterTool(
74  name,
75  RegionSelectorTools = acc_regsel.popPrivateTools(),
76  ExtraROBs = [int(robid) for robid in ROBs],
77  ExtraSubDets = [int(detid) for detid in subDets],
78  **kwargs )
79 
80  acc.merge(acc_regsel)
81  acc.setPrivateTools(tool)
82  return acc
83 
84 

◆ StaticPEBInfoWriterToolCfg()

def TrigPartialEventBuildingConfig.StaticPEBInfoWriterToolCfg (   flags,
  name = 'StaticPEBInfoWriterTool',
list[SourceIdentifier]   ROBs = [],
list[SubDetector]   subDets = [],
**  kwargs 
)
Configure the StaticPEBInfoWriterTool

Definition at line 85 of file TrigPartialEventBuildingConfig.py.

85 def StaticPEBInfoWriterToolCfg(flags, name='StaticPEBInfoWriterTool',
86  ROBs: list[SourceIdentifier] = [],
87  subDets : list[SubDetector] = [],
88  **kwargs):
89  """Configure the StaticPEBInfoWriterTool"""
90 
91  acc = ComponentAccumulator()
92 
93  kwargs.setdefault("MatchTriggerType", [])
94 
95  tool = CompFactory.StaticPEBInfoWriterTool(
96  name,
97  ROBList = [int(robid) for robid in ROBs],
98  SubDetList = [int(detid) for detid in subDets],
99  **kwargs )
100 
101  acc.setPrivateTools(tool)
102  return acc
103 
104 

Variable Documentation

◆ _log

TrigPartialEventBuildingConfig._log
private

Definition at line 11 of file TrigPartialEventBuildingConfig.py.

◆ acc

TrigPartialEventBuildingConfig.acc

Definition at line 114 of file TrigPartialEventBuildingConfig.py.

◆ AtlasVersion

TrigPartialEventBuildingConfig.AtlasVersion

Definition at line 110 of file TrigPartialEventBuildingConfig.py.

◆ cfg

TrigPartialEventBuildingConfig.cfg

Definition at line 113 of file TrigPartialEventBuildingConfig.py.

◆ Files

TrigPartialEventBuildingConfig.Files

Definition at line 109 of file TrigPartialEventBuildingConfig.py.

◆ flags

TrigPartialEventBuildingConfig.flags

Definition at line 108 of file TrigPartialEventBuildingConfig.py.

◆ regSelDets

TrigPartialEventBuildingConfig.regSelDets

Definition at line 115 of file TrigPartialEventBuildingConfig.py.

◆ ROBs

TrigPartialEventBuildingConfig.ROBs

Definition at line 122 of file TrigPartialEventBuildingConfig.py.

◆ subDets

TrigPartialEventBuildingConfig.subDets

Definition at line 116 of file TrigPartialEventBuildingConfig.py.

TrigPartialEventBuildingConfig.RoIPEBInfoWriterToolCfg
def RoIPEBInfoWriterToolCfg(flags, name='RoIPEBInfoWriterTool', list[str] regSelDets=[], list[SourceIdentifier] ROBs=[], list[SubDetector] subDets=[], **kwargs)
Definition: TrigPartialEventBuildingConfig.py:61
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TrigPartialEventBuildingConfig.getRegSelTools
def getRegSelTools(flags, detNames)
Definition: TrigPartialEventBuildingConfig.py:14
TrigPartialEventBuildingConfig.StaticPEBInfoWriterToolCfg
def StaticPEBInfoWriterToolCfg(flags, name='StaticPEBInfoWriterTool', list[SourceIdentifier] ROBs=[], list[SubDetector] subDets=[], **kwargs)
Definition: TrigPartialEventBuildingConfig.py:85