ATLAS Offline Software
LVL1CaloRun2ByteStreamConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from TriggerJobOpts.TriggerByteStreamConfig import ByteStreamReadCfg
6 
7 
9  type_names = [
10  # ===== PPM ================================================================
11  "xAOD::TriggerTowerContainer/xAODTriggerTowers",
12  "xAOD::TriggerTowerAuxContainer/xAODTriggerTowersAux.",
13  "xAOD::TriggerTowerContainer/xAODTriggerTowersMuon",
14  "xAOD::TriggerTowerAuxContainer/xAODTriggerTowersMuonAux.",
15  "xAOD::TriggerTowerContainer/xAODTriggerTowersSpare",
16  "xAOD::TriggerTowerAuxContainer/xAODTriggerTowersSpareAux.",
17  # without prefix
18  "xAOD::TriggerTowerContainer/TriggerTowers",
19  "xAOD::TriggerTowerAuxContainer/TriggerTowersAux.",
20  "xAOD::TriggerTowerContainer/TriggerTowersMuon",
21  "xAOD::TriggerTowerAuxContainer/TriggerTowersMuonAux.",
22  "xAOD::TriggerTowerContainer/TriggerTowersSpare",
23  "xAOD::TriggerTowerAuxContainer/TriggerTowersSpareAux.",
24  # ZDC
25  # ===== CPM ================================================================
26  "xAOD::CPMTowerContainer/CPMTowers",
27  "xAOD::CPMTowerAuxContainer/CPMTowersAux.",
28  "xAOD::CPMTowerContainer/CPMTowersOverlap",
29  "xAOD::CPMTowerAuxContainer/CPMTowersOverlapAux.",
30  # ===== CMXCPTOB ===========================================================
31  "xAOD::CMXCPTobContainer/CMXCPTobs",
32  "xAOD::CMXCPTobAuxContainer/CMXCPTobsAux.",
33  # ===== CMXCPHITS ==========================================================
34  "xAOD::CMXCPHitsContainer/CMXCPHits",
35  "xAOD::CMXCPHitsAuxContainer/CMXCPHitsAux.",
36  # ===== CMXJETTOB ==========================================================
37  "xAOD::CMXJetTobContainer/CMXJetTobs",
38  "xAOD::CMXJetTobAuxContainer/CMXJetTobsAux.",
39  # ===== CMXJETHITS =========================================================
40  "xAOD::CMXJetHitsContainer/CMXJetHits",
41  "xAOD::CMXJetHitsAuxContainer/CMXJetHitsAux.",
42  # ===== CMXETSUMS ==========================================================
43  "xAOD::CMXEtSumsContainer/CMXEtSums",
44  "xAOD::CMXEtSumsAuxContainer/CMXEtSumsAux.",
45  # ===== JEMETSUMS ==========================================================
46  "xAOD::JEMEtSumsContainer/JEMEtSums",
47  "xAOD::JEMEtSumsAuxContainer/JEMEtSumsAux.",
48  # ===== CPMTOBROIS =========================================================
49  "xAOD::CPMTobRoIContainer/CPMTobRoIs",
50  "xAOD::CPMTobRoIAuxContainer/CPMTobRoIsAux.",
51  "xAOD::CPMTobRoIContainer/CPMTobRoIsRoIB",
52  "xAOD::CPMTobRoIAuxContainer/CPMTobRoIsRoIBAux.",
53  # ===== JEMTOBROIS =========================================================
54  "xAOD::JEMTobRoIContainer/JEMTobRoIs",
55  "xAOD::JEMTobRoIAuxContainer/JEMTobRoIsAux.",
56  "xAOD::JEMTobRoIContainer/JEMTobRoIsRoIB",
57  "xAOD::JEMTobRoIAuxContainer/JEMTobRoIsRoIBAux.",
58  # ===== JETELEMENT =========================================================
59  "xAOD::JetElementContainer/JetElements",
60  "xAOD::JetElementAuxContainer/JetElementsAux.",
61  "xAOD::JetElementContainer/JetElementsOverlap",
62  "xAOD::JetElementAuxContainer/JetElementsOverlapAux.",
63  # ===== CMXROI =============================================================
64  "xAOD::CMXRoIContainer/CMXRoIs",
65  "xAOD::CMXRoIAuxContainer/CMXRoIsAux.",
66  "xAOD::CMXRoIContainer/CMXRoIsRoIB",
67  "xAOD::CMXRoIAuxContainer/CMXRoIsRoIBAux.",
68  # ===== RODHEADER ==========================================================
69  "xAOD::RODHeaderContainer/RODHeaders",
70  "xAOD::RODHeaderAuxContainer/RODHeadersAux.",
71  "xAOD::RODHeaderContainer/RODHeadersPP",
72  "xAOD::RODHeaderAuxContainer/RODHeadersPPAux.",
73  "xAOD::RODHeaderContainer/RODHeadersCP",
74  "xAOD::RODHeaderAuxContainer/RODHeadersCPAux.",
75  "xAOD::RODHeaderContainer/RODHeadersCPRoI",
76  "xAOD::RODHeaderAuxContainer/RODHeadersCPRoIAux.",
77  "xAOD::RODHeaderContainer/RODHeadersJEP",
78  "xAOD::RODHeaderAuxContainer/RODHeadersJEPAux.",
79  "xAOD::RODHeaderContainer/RODHeadersJEPRoI",
80  "xAOD::RODHeaderAuxContainer/RODHeadersJEPRoIAux.",
81  "xAOD::RODHeaderContainer/RODHeadersCPRoIB",
82  "xAOD::RODHeaderAuxContainer/RODHeadersCPRoIBAux.",
83  "xAOD::RODHeaderContainer/RODHeadersJEPRoIB",
84  "xAOD::RODHeaderAuxContainer/RODHeadersJEPRoIBAux.",
85  "std::vector<unsigned int>/L1CaloUnpackingErrors",
86  ]
87  return type_names
88 
89 
91  type_names = [
92  # ===== CPM ================================================================
93  "xAOD::CPMTowerContainer/CPMTowers",
94  "xAOD::CPMTowerAuxContainer/CPMTowersAux.",
95  # ===== JETELEMENT =========================================================
96  "xAOD::JetElementContainer/JetElements",
97  "xAOD::JetElementAuxContainer/JetElementsAux.",
98  ]
99  if flags.Trigger.enableL1CaloPhase1:
100  type_names += [
101  # ===== PPM ============================================================
102  "xAOD::TriggerTowerContainer/xAODTriggerTowers",
103  "xAOD::TriggerTowerAuxContainer/xAODTriggerTowersAux.",
104  ]
105  return type_names
106 
107 
109  acc = ComponentAccumulator()
110  cpmReadTool = CompFactory.getComp('LVL1BS::CpByteStreamV2Tool')(
111  name='CpByteStreamV2Tool',
112  enableEncoding = False)
113  acc.addPublicTool(cpmReadTool)
114  jepReadTool = CompFactory.getComp('LVL1BS::JepByteStreamV2Tool')(
115  name='JepByteStreamV2Tool',
116  enableEncoding = False)
117  acc.addPublicTool(jepReadTool)
118  return acc
119 
120 
121 def LVL1CaloRun2ReadBSCfg(flags, forRoIBResultToxAOD=False):
122  acc = ComponentAccumulator()
123  typeNamesToDecode = []
124 
125  if flags.Trigger.doLVL1 or forRoIBResultToxAOD:
126  # Rerun L1Calo simulation on data or run RoIBResultToxAOD - only need a few inputs from data
127  typeNamesToDecode = typeNamesToDecodeForRerunLVL1(flags)
128  else:
129  # Configure the full list of objects to decode
130  typeNamesToDecode = typeNamesToDecodeAll()
131 
132  acc.merge(ByteStreamReadCfg(flags, type_names=typeNamesToDecode))
133 
134  # need to set UseSWROD property of the decoder tools that are sensitive to it (crates 6 and 7) ....
135  acc.addPublicTool(CompFactory.LVL1BS.RodHeaderByteStreamTool("RodHeaderByteStreamTool",UseSWROD=(max(flags.Input.RunNumbers+[0])>=484848)))
136  acc.addPublicTool(CompFactory.LVL1BS.PpmByteStreamReadV1V2Tool("PpmByteStreamReadV1V2Tool",UseSWROD=(max(flags.Input.RunNumbers+[0])>=484848)))
137 
138  if flags.Trigger.Online.isPartition:
139  acc.merge(readOnlyToolsForRerunLVL1(flags))
140 
141  return acc
142 
LVL1CaloRun2ByteStreamConfig.typeNamesToDecodeForRerunLVL1
def typeNamesToDecodeForRerunLVL1(flags)
Definition: LVL1CaloRun2ByteStreamConfig.py:90
max
#define max(a, b)
Definition: cfImp.cxx:41
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
LVL1CaloRun2ByteStreamConfig.typeNamesToDecodeAll
def typeNamesToDecodeAll()
Definition: LVL1CaloRun2ByteStreamConfig.py:8
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
LVL1CaloRun2ByteStreamConfig.LVL1CaloRun2ReadBSCfg
def LVL1CaloRun2ReadBSCfg(flags, forRoIBResultToxAOD=False)
Definition: LVL1CaloRun2ByteStreamConfig.py:121
LVL1CaloRun2ByteStreamConfig.readOnlyToolsForRerunLVL1
def readOnlyToolsForRerunLVL1(flags)
Definition: LVL1CaloRun2ByteStreamConfig.py:108