test_trigP1_FullMenu_preload_build.py 1.97 KB
Newer Older
1
2
#!/usr/bin/env python
#
3
# art-description: Full menu athenaHLT test imitating partition with preloaded data at P1
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# art-type: build
# art-include: master/Athena

from TrigValTools.TrigValSteering import Input, Test, Step, ExecStep, CheckSteps

# Input file
f = Input.get_input('data').paths[0].encode('ascii', 'ignore')

# Delete any previous bytestream file
ex_rm = ExecStep.ExecStep('cleanup')
ex_rm.type = 'other'
ex_rm.input = ''
ex_rm.executable = 'rm'
ex_rm.args = '-f raw._0001.data'
ex_rm.auto_report_result = False  # Do not set art-result for this step
ex_rm.output_stream = Step.Step.OutputStream.STDOUT_ONLY  # Do not create a log file for this step

# Create new bytestream file with future run number and renumber LBs
ex_bs = ExecStep.ExecStep('create_bs')
ex_bs.type = 'other'
ex_bs.input = ''
ex_bs.executable = 'trigbs_modifyEvent.py'
ex_bs.args = '-n 50 --runNumber 999999 --incLB 3 --firstLB 4 -o raw %s' % f

# Run athenaHLT forcing run and timestamp of original data file
import eformat
from TrigCommon import AthHLT
run = eformat.EventStorage.pickDataReader(f).runNumber()
sor = AthHLT.get_sor_params(run)['SORTime']

ex = ExecStep.ExecStep()
ex.type = 'athenaHLT'
36
ex.job_options = 'TriggerJobOpts/runHLT_standalone.py'
37
38
ex.input = ''
ex.explicit_input = True
39
40
41
42
43
ex.args = '-f ./raw._0001.data'
ex.args += ' -C "from AthenaCommon.AppMgr import ServiceMgr; ServiceMgr.HltEventLoopMgr.forceRunNumber=%d; ServiceMgr.HltEventLoopMgr.forceStartOfRunTime=%d"' % (run, sor)
ex.args += ' -R 999999 --sor-time=now --detector-mask=all'
ex.args += ' -M --dump-config'  # For SMK generation
ex.perfmon = False  # Cannot use PerfMon with -M
44
45
46
47
48
49

test = Test.Test()
test.art_type = 'build'
test.exec_steps = [ex_rm, ex_bs, ex]
test.check_steps = CheckSteps.default_check_steps(test)

50
51
52
53
# Overwrite default histogram file name for checks
for step in [test.get_step(name) for name in ['HistCount', 'RootComp', 'ChainDump']]:
  step.input_file = 'r0000999999_athenaHLT_HLT-Histogramming.root'

54
55
import sys
sys.exit(test.run())