ATLAS Offline Software
StreamInfo.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 import eformat
4 from AthenaCommon.Logging import logging
5 log = logging.getLogger( __name__ )
6 
7 _allowed_tag_types = [eformat.helper.tagtype_to_string(t) for t in eformat.helper.TagType.values.values()]
8 
10  def __init__(self, name, streamType, obeysLumiBlock, forceFullEventBuilding):
11  assert type(name) is str, "name has to be str"
12  assert type(streamType) is str, "streamType has to be str"
13  assert streamType in _allowed_tag_types, "streamType '"+streamType+"' is not one of "+\
14  "the allowed types: "+str(_allowed_tag_types)
15  assert type(obeysLumiBlock) is bool, "obeysLumiBlock has to be bool"
16  assert type(forceFullEventBuilding) is bool, "forceFullEventBuilding has to be bool"
17  self.__data = [name, streamType, obeysLumiBlock, forceFullEventBuilding]
18 
19  def __str__(self):
20  return '({}, obeysLumiBlock={}, forceFullEventBuilding={})'.format(
21  self.typeName(), self.obeysLumiBlock(), self.forceFullEventBuilding())
22 
23  def name(self):
24  return self.__data[0]
25 
26  def type(self):
27  return self.__data[1]
28 
29  def obeysLumiBlock(self):
30  return self.__data[2]
31 
33  return self.__data[3]
34 
35  def typeName(self):
36  return '{:s}_{:s}'.format(self.type(), self.name())
37 
38 
39 _all_streams = [
40  # PHYSICS STREAMS
41  StreamInfo('Main', 'physics', True, True),
42  StreamInfo('CosmicMuons', 'physics', True, True),
43  StreamInfo('CosmicCalo', 'physics', True, True),
44  StreamInfo('IDCosmic', 'physics', True, True),
45  StreamInfo('ZeroBias', 'physics', True, True),
46  StreamInfo('Background', 'physics', True, True),
47  StreamInfo('Standby', 'physics', True, True),
48  StreamInfo('L1Calo', 'physics', True, True),
49  StreamInfo('EnhancedBias', 'physics', True, True),
50  StreamInfo('Late', 'physics', True, True),
51  StreamInfo('Mistimed', 'physics', True, True),
52  # TLA/PEB/DATA SCOUTING (physics) STREAMS
53  StreamInfo('TLA','physics',True,False),
54  StreamInfo('DarkJetPEBTLA', 'physics', True, False),
55  StreamInfo('FTagPEBTLA', 'physics', True, False),
56  StreamInfo('EgammaPEBTLA', 'physics', True, False),
57  StreamInfo('AFPPEB','physics',True,False),
58  # EXPRESS STREAM
59  StreamInfo('express', 'express', True, True),
60  # MONITORING STREAMS
61  StreamInfo('IDMonitoring', 'monitoring', True, True),
62  StreamInfo('CSC', 'monitoring', True, False),
63  # CALIBRATION STREAMS
64  StreamInfo('Muon_Calibration','calibration',False,True),
65  StreamInfo('BphysPEB','calibration',True,False),
66  StreamInfo('BeamSpot', 'calibration', True, False),
67  StreamInfo('LArCells', 'calibration', False, False),
68  StreamInfo('LArCellsEmpty', 'calibration', False, False),
69  StreamInfo('LArNoiseBurst', 'calibration', False, True),
70  StreamInfo('TgcNoiseBurst', 'calibration', False, True),
71  StreamInfo('CostMonitoring', 'calibration', False, False),
72  StreamInfo('SCTNoise', 'calibration', False, False),
73  StreamInfo('PixelNoise', 'calibration', False, False),
74  StreamInfo('Tile', 'calibration', False, False),
75  StreamInfo('LArPEB', 'calibration', False, False),
76  StreamInfo('LArPEBDigitalTrigger', 'calibration', False, False),
77  StreamInfo('L1TopoMismatches', 'calibration', False, True),
78  StreamInfo('ZDCCalib', 'calibration', False, False),
79  StreamInfo('ZDCLEDCalib', 'calibration', False, False),
80  StreamInfo('ZDCInjCalib', 'calibration', False, False),
81  StreamInfo('IDCalib', 'calibration', True, False),
82  StreamInfo('AFPCalib', 'calibration', False, False),
83  StreamInfo('PixelBeam', 'calibration', True, False),
84  StreamInfo('VdM', 'calibration', True, False),
85  StreamInfo('L1CaloCalib', 'calibration', False, False),
86  StreamInfo('NSWTriggerMonitor', 'calibration', False, True),
87  # HI STREAMS
88  StreamInfo('HardProbes', 'physics', True, True),
89  StreamInfo('MinBias', 'physics', True, True),
90  StreamInfo('UPC', 'physics', True, True),
91  StreamInfo('MinBiasOverlay', 'physics', True, True),
92  StreamInfo('PC', 'physics', True, True),
93  StreamInfo('CC', 'physics', True, True),
94  StreamInfo('UCC', 'physics', True, True),
95  # DELAYED STREAMS
96  StreamInfo('VBFDelayed' , 'physics', True, True),
97  StreamInfo('BphysDelayed', 'physics', True, True),
98  # Special stream to be used only for special chains rejecting all events like timeburner
99  StreamInfo('DISCARD', 'unknown', False, True),
100 
101  # Add new streams grouped by type as above, not at the end of the list
102 ]
103 
104 
106  return _all_streams
107 
108 
109 def getStreamTag(streamName):
110  matches = [s for s in _all_streams if s.name() == streamName]
111  if len(matches) == 0:
112  log.error('Stream %s is not defined in StreamInfo', streamName)
113  return None
114  elif len(matches) > 1:
115  log.error('Stream %s has multiple definitions in StreamInfo', streamName)
116  return None
117  else:
118  return matches[0]
119 
120 
121 def getStreamTags(streamNames):
122  return [getStreamTag(name) for name in streamNames]
python.HLT.Menu.StreamInfo.StreamInfo.__str__
def __str__(self)
Definition: StreamInfo.py:19
vtune_athena.format
format
Definition: vtune_athena.py:14
python.HLT.Menu.StreamInfo.StreamInfo.__data
__data
Definition: StreamInfo.py:17
python.HLT.Menu.StreamInfo.StreamInfo.name
def name(self)
Definition: StreamInfo.py:23
python.HLT.Menu.StreamInfo.StreamInfo.obeysLumiBlock
def obeysLumiBlock(self)
Definition: StreamInfo.py:29
python.HLT.Menu.StreamInfo.StreamInfo.type
def type(self)
Definition: StreamInfo.py:26
python.HLT.Menu.StreamInfo.StreamInfo.forceFullEventBuilding
def forceFullEventBuilding(self)
Definition: StreamInfo.py:32
python.HLT.Menu.StreamInfo.getStreamTag
def getStreamTag(streamName)
Definition: StreamInfo.py:109
python.HLT.Menu.StreamInfo.getAllStreams
def getAllStreams()
Definition: StreamInfo.py:105
python.HLT.Menu.StreamInfo.getStreamTags
def getStreamTags(streamNames)
Definition: StreamInfo.py:121
pickleTool.object
object
Definition: pickleTool.py:30
str
Definition: BTagTrackIpAccessor.cxx:11
python.HLT.Menu.StreamInfo.StreamInfo
Definition: StreamInfo.py:9
python.HLT.Menu.StreamInfo.StreamInfo.typeName
def typeName(self)
Definition: StreamInfo.py:35
python.HLT.Menu.StreamInfo.StreamInfo.__init__
def __init__(self, name, streamType, obeysLumiBlock, forceFullEventBuilding)
Definition: StreamInfo.py:10