ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigValidation
TrigP1Test
python
DecodeBS.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
#
3
# Script to unpack (Run-3) HLT bytestream and write ESD file. Only to be used
4
# for validation purposes. For reconstruction use the full TriggerRecoConfig.
5
#
6
7
from
AthenaConfiguration.MainServicesConfig
import
MainServicesCfg
8
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
9
from
TriggerJobOpts.TriggerByteStreamConfig
import
ByteStreamReadCfg
10
from
TriggerJobOpts.TriggerRecoConfig
import
Run3TriggerBSUnpackingCfg, TriggerEDMCfg
11
12
# Set and parse flags
13
flags = initConfigFlags()
14
flags.parser().add_argument(
'--moduleID'
, type=int, default=0, help=
'HLT module ID to decode'
)
15
args = flags.fillFromArgs()
16
17
flags.Output.ESDFileName =
'ESD.pool.root'
if
args.moduleID==0
else
f
'ESD.Module{args.moduleID}.pool.root'
18
flags.lock()
19
20
cfg = MainServicesCfg(flags)
21
cfg.merge( ByteStreamReadCfg(flags) )
22
23
from
TrigEDMConfig.DataScoutingInfo
import
(
24
getAllDataScoutingResultIDs, getAllDataScoutingIdentifiers
25
)
26
# Map selected module ID to the data scouting type or default HLT result
27
id_to_dstype = {
28
id: dstype
for
id, dstype
in
zip(getAllDataScoutingResultIDs(), getAllDataScoutingIdentifiers())
29
}
30
id_to_dstype.update({0:
''
})
# Default HLT result
31
dstype = id_to_dstype[args.moduleID]
32
print
(f
'Expecting to deserialise {dstype if dstype else "default HLT result"}'
)
33
34
# Check that this is in fact what we autoconfigured from the stream info in the file
35
acc_bs = Run3TriggerBSUnpackingCfg(flags)
36
assert
acc_bs.getEventAlgo(f
'TrigDeserialiser{dstype}'
).ModuleID == args.moduleID
37
cfg.merge(acc_bs)
38
39
cfg.merge( TriggerEDMCfg(flags) )
40
41
import
sys
42
sys.exit(cfg.run().isFailure())
print
void print(char *figname, TCanvas *c1)
Definition
TRTCalib_StrawStatusPlots.cxx:26
Generated on
for ATLAS Offline Software by
1.17.0