Commit d2ba9019 authored by Rafal Bielski's avatar Rafal Bielski 🏖 Committed by Adam Edward Barton
Browse files

Fix py3 issues and add unit test for the dumpHLTContentInBS_run3 script

parent 95bbaaca
......@@ -20,8 +20,13 @@ atlas_add_dictionary( TrigByteStreamToolsDict
# Install files from the package:
atlas_install_python_modules( python/*.py )
atlas_install_scripts( bin/*.py python/trigbs_modifyEvent.py python/trigbs_prescaleL1.py python/slimHLTBSFile.py )
atlas_install_data( share/*.ref )
# Check python syntax:
# Unit tests
atlas_add_test( dumpHLTContentInBS_run3
SCRIPT trigbs_dumpHLTContentInBS_run3.py -n 5 -s 105 --l1 --hlt --hltres --stag --sizes --sizeSummary
/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data20_test/data_test.00374861.physics_Main.daq.RAW._lb0004._SFO-1._0001.data
LOG_IGNORE_PATTERN "^----" )
atlas_add_test( flake8
SCRIPT flake8 --select=ATL,F,E7,E9,W6 ${CMAKE_CURRENT_SOURCE_DIR}
POST_EXEC_SCRIPT nopost.sh )
......@@ -74,11 +74,11 @@ def lvl1_bits(event):
'''Return a string with information about LVL1 bits (IDs of items passed at TBP, TAP, TAV)'''
info = event.lvl1_trigger_info()
nwords = len(info)/3 # TBP, TAP, TAV
nwords = len(info)//3 # TBP, TAP, TAV
lvl1_bits = [decodeTriggerBits(info[i*nwords:(i+1)*nwords]) for i in range(3)]
info_str = 'L1 CTP IDs - TBP: {:s}\n'.format(lvl1_bits[0])
info_str += 'L1 CTP IDs - TAP: {:s}\n'.format(lvl1_bits[1])
info_str += 'L1 CTP IDs - TAV: {:s}'.format(lvl1_bits[2])
info_str = 'L1 CTP IDs - TBP: {:s}\n'.format(str(lvl1_bits[0]))
info_str += 'L1 CTP IDs - TAP: {:s}\n'.format(str(lvl1_bits[1]))
info_str += 'L1 CTP IDs - TAV: {:s}'.format(str(lvl1_bits[2]))
return info_str
......@@ -88,14 +88,14 @@ def hlt_bits(event, l2=False):
info = event.lvl2_trigger_info() if l2 else event.event_filter_info()
hlt_bits = decodeTriggerBits(info)
info_str = 'L2' if l2 else 'EF'
info_str += ' passed chain IDs: {:s}'.format(hlt_bits)
info_str += ' passed chain IDs: {:s}'.format(str(hlt_bits))
return info_str
def stream_tags(event):
info_str = 'Stream Tags: '
stags = [('{}_{}'.format(s.type, s.name)) for s in event.stream_tag()]
info_str += '{:s}'.format(stags)
info_str += '{:s}'.format(str(stags))
return info_str
......@@ -106,7 +106,7 @@ def hlt_result(event, print_sizes=False):
for rob in hlt_robs:
info_str += '\n-- {:s} SourceID: {:s}, Size: {:d} bytes'.format(
rob.__class__.__name__,
rob.source_id(),
rob.source_id().human(),
rob.fragment_size_word()*4
)
if print_sizes:
......@@ -114,7 +114,7 @@ def hlt_result(event, print_sizes=False):
collections = hltResultMT.get_collections(rob.rod_data())
for coll in collections:
indent = '----' if not coll.is_xAOD_decoration() else '------'
info_str += '\n{:s} {:s}'.format(indent, coll)
info_str += '\n{:s} {:s}'.format(indent, str(coll))
return info_str
......
Py:dumpHLTContentInBS INFO Opening /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data20_test/data_test.00374861.physics_Main.daq.RAW._lb0004._SFO-1._0001.data
==================== Event: 1, RunNumber: 374861, LB: 4, Global_ID: 43743, LVL1_ID: 1828817582, BC_ID: 2812, TT: x84 ====================
L1 CTP IDs - TBP: [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 23, 29, 30, 45, 47, 49, 50, 51, 53, 56, 68, 82, 84, 85, 86, 87, 91, 92, 93, 94, 95, 138, 139, 143, 144, 145, 152, 154, 155, 157, 158, 159, 160, 200, 203, 205, 207, 250, 279, 280, 281, 286, 288, 293, 294, 295, 322, 344, 349, 380, 384, 390, 392, 402, 417, 423, 424, 501, 506]
L1 CTP IDs - TAP: [3, 8, 10, 11, 29, 30, 49, 50, 51, 56, 68, 82, 86, 87, 91, 138, 139, 143, 152, 157, 158, 159, 160, 203, 250, 279, 280, 281, 286, 293, 294, 322, 344, 349, 380, 384, 390, 392, 402, 417, 423, 424, 501, 506]
L1 CTP IDs - TAV: [11, 392, 402]
EF passed chain IDs: [1, 116]
Stream Tags: ['calibration_CostMonitoring', 'physics_Main']
Found 2 HLT ROBs
-- ROBFragment SourceID: TDAQ_HLT, module=0 (opt=0), Size: 148532 bytes
-- ROBFragment SourceID: TDAQ_HLT, module=1 (opt=0), Size: 6736 bytes
==================== Event: 2, RunNumber: 374861, LB: 4, Global_ID: 43874, LVL1_ID: 1829041034, BC_ID: 1807, TT: x84 ====================
L1 CTP IDs - TBP: [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 23, 29, 30, 45, 47, 49, 50, 51, 56, 68, 82, 84, 86, 87, 91, 92, 93, 94, 138, 143, 152, 154, 157, 158, 159, 160, 200, 203, 205, 207, 279, 280, 281, 286, 288, 295, 330, 349, 380, 390, 392, 417, 423, 424, 501, 506]
L1 CTP IDs - TAP: [3, 8, 10, 11, 29, 30, 49, 50, 51, 56, 68, 82, 86, 87, 91, 138, 143, 152, 157, 158, 159, 160, 203, 279, 280, 281, 286, 330, 349, 380, 390, 392, 417, 423, 424, 501, 506]
L1 CTP IDs - TAV: [11, 392]
EF passed chain IDs: [1, 116]
Stream Tags: ['calibration_CostMonitoring', 'physics_Main']
Found 2 HLT ROBs
-- ROBFragment SourceID: TDAQ_HLT, module=0 (opt=0), Size: 145656 bytes
-- ROBFragment SourceID: TDAQ_HLT, module=1 (opt=0), Size: 7624 bytes
==================== Event: 3, RunNumber: 374861, LB: 4, Global_ID: 40645, LVL1_ID: 1745098512, BC_ID: 508, TT: x8c ====================
L1 CTP IDs - TBP: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 23, 24, 25, 27, 28, 29, 30, 31, 42, 43, 44, 45, 47, 49, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 70, 72, 73, 74, 76, 78, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 107, 108, 126, 127, 129, 133, 134, 137, 138, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 157, 158, 159, 160, 175, 176, 177, 184, 200, 203, 205, 207, 223, 238, 246, 254, 255, 256, 258, 259, 260, 261, 266, 267, 268, 269, 270, 272, 275, 278, 279, 280, 281, 286, 288, 290, 291, 292, 295, 303, 316, 320, 329, 330, 333, 334, 337, 340, 342, 345, 346, 347, 348, 349, 350, 353, 356, 357, 358, 377, 378, 380, 382, 385, 386, 387, 390, 392, 399, 400, 401, 402, 408, 409, 416, 417, 423, 424, 428, 429, 430, 431, 432, 433, 454, 458, 470, 481, 482, 483, 484, 485, 497, 498, 499, 500, 501, 502, 503, 506, 507, 508]
L1 CTP IDs - TAP: [3, 5, 8, 10, 11, 17, 18, 25, 28, 29, 30, 31, 42, 43, 44, 49, 50, 51, 52, 55, 56, 59, 61, 62, 64, 67, 68, 72, 73, 74, 76, 78, 81, 82, 83, 86, 90, 91, 100, 101, 107, 108, 126, 127, 129, 133, 134, 138, 141, 143, 147, 148, 149, 150, 151, 152, 157, 158, 159, 160, 175, 176, 177, 184, 203, 238, 246, 254, 255, 258, 259, 260, 261, 266, 267, 268, 269, 270, 272, 278, 279, 280, 281, 286, 290, 291, 292, 303, 316, 330, 337, 342, 346, 349, 350, 353, 356, 358, 377, 378, 380, 385, 386, 390, 392, 399, 400, 401, 402, 408, 409, 417, 423, 424, 428, 429, 430, 431, 432, 433, 454, 458, 470, 481, 482, 483, 484, 485, 497, 498, 499, 500, 501, 502, 503, 506, 507, 508]
L1 CTP IDs - TAV: [5, 11, 17, 18, 43, 44, 52, 61, 64, 67, 72, 74, 76, 78, 81, 90, 100, 101, 108, 141, 147, 148, 149, 150, 151, 175, 176, 184, 255, 259, 278, 316, 342, 346, 350, 356, 377, 385, 392, 400, 402, 428, 429, 430, 431, 433, 454, 458, 482, 483, 484]
EF passed chain IDs: [1, 3, 4, 27, 31, 32, 36, 38, 49, 51, 74, 75, 76, 77, 84, 109, 110, 116]
Stream Tags: ['physics_Main', 'calibration_RPCSecondaryReadout', 'calibration_CostMonitoring']
Found 2 HLT ROBs
-- ROBFragment SourceID: TDAQ_HLT, module=0 (opt=0), Size: 567444 bytes
-- ROBFragment SourceID: TDAQ_HLT, module=1 (opt=0), Size: 22548 bytes
==================== Event: 4, RunNumber: 374861, LB: 4, Global_ID: 43833, LVL1_ID: 1812336401, BC_ID: 1094, TT: x84 ====================
L1 CTP IDs - TBP: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 23, 24, 25, 26, 27, 28, 29, 30, 31, 41, 45, 47, 49, 50, 51, 53, 54, 56, 58, 59, 60, 61, 62, 68, 69, 70, 71, 78, 80, 82, 83, 84, 85, 86, 91, 92, 93, 94, 95, 96, 97, 110, 126, 128, 131, 132, 137, 138, 143, 144, 152, 154, 157, 158, 159, 160, 172, 200, 203, 205, 207, 254, 260, 261, 275, 279, 280, 281, 286, 288, 290, 291, 295, 316, 333, 334, 336, 337, 342, 345, 346, 347, 348, 349, 350, 353, 357, 373, 378, 380, 383, 386, 387, 390, 392, 398, 400, 402, 408, 409, 417, 423, 424, 479, 481, 486, 501, 502, 503, 504, 505, 506, 507]
L1 CTP IDs - TAP: [3, 5, 8, 10, 11, 25, 28, 29, 30, 31, 41, 49, 50, 51, 56, 59, 61, 62, 68, 69, 78, 82, 83, 86, 91, 110, 126, 128, 131, 132, 138, 143, 152, 157, 158, 159, 160, 172, 203, 254, 260, 261, 279, 280, 281, 286, 290, 291, 316, 337, 342, 346, 349, 350, 353, 373, 378, 380, 386, 390, 392, 398, 400, 402, 408, 409, 417, 423, 424, 479, 481, 486, 501, 502, 503, 504, 505, 506, 507]
L1 CTP IDs - TAV: [5, 11, 41, 61, 69, 78, 131, 132, 172, 316, 342, 346, 350, 392, 398, 400, 402]
EF passed chain IDs: [1, 116]
Stream Tags: ['calibration_CostMonitoring', 'physics_Main']
Found 2 HLT ROBs
-- ROBFragment SourceID: TDAQ_HLT, module=0 (opt=0), Size: 357964 bytes
-- ROBFragment SourceID: TDAQ_HLT, module=1 (opt=0), Size: 7208 bytes
==================== Event: 5, RunNumber: 374861, LB: 4, Global_ID: 43989, LVL1_ID: 1845635169, BC_ID: 3023, TT: x84 ====================
L1 CTP IDs - TBP: [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 23, 29, 30, 45, 47, 49, 50, 51, 56, 68, 82, 84, 86, 87, 91, 92, 93, 94, 138, 139, 152, 154, 155, 157, 158, 159, 160, 200, 203, 205, 207, 250, 279, 280, 281, 286, 288, 293, 294, 295, 322, 330, 344, 349, 380, 384, 390, 392, 402, 417, 423, 424, 474, 501, 506]
L1 CTP IDs - TAP: [3, 8, 10, 11, 29, 30, 49, 50, 51, 56, 68, 82, 86, 87, 91, 138, 139, 152, 157, 158, 159, 160, 203, 250, 279, 280, 281, 286, 293, 294, 322, 330, 344, 349, 380, 384, 390, 392, 402, 417, 423, 424, 474, 501, 506]
L1 CTP IDs - TAV: [11, 392, 402]
EF passed chain IDs: [1, 116]
Stream Tags: ['calibration_CostMonitoring', 'physics_Main']
Found 2 HLT ROBs
-- ROBFragment SourceID: TDAQ_HLT, module=0 (opt=0), Size: 150808 bytes
-- ROBFragment SourceID: TDAQ_HLT, module=1 (opt=0), Size: 7624 bytes
====================
Size summary:
====================
-- TDAQ_HLT module 0 total size 1370404 bytes, 274080.800 bytes/event
-- TDAQ_HLT module 1 total size 51740 bytes, 10348.000 bytes/event
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment