ATLAS Offline Software
Loading...
Searching...
No Matches
TrigAnalysisSteps.py
Go to the documentation of this file.
2# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3#
4
5'''
6Definitions of additional validation steps in Trigger ART tests relevant only for TrigAnalysisTest.
7The main common check steps are defined in the TrigValSteering.CheckSteps module.
8'''
9
10from TrigValTools.TrigValSteering.CheckSteps import CheckFileStep, InputDependentStep, LogMergeStep
11
12
15
16class TrigDecChecker(InputDependentStep):
17 def __init__(self, name='TrigDecChecker', in_file='AOD.pool.root'):
18 super().__init__(name)
19 self.input_file = in_file
20 self.executable = 'dumpTriggerInfo.py'
21
22 def configure(self, test):
23 self.args = f' --filesInput {self.input_file}'
24 super().configure(test)
25
26class TrigEDMChecker(InputDependentStep):
27 def __init__(self, name='TrigEDMChecker', in_file='AOD.pool.root'):
28 super().__init__(name)
29 self.input_file = in_file
30 self.executable = 'trigEDMChecker.py'
31
32 def configure(self, test):
33 self.args = f' --filesInput {self.input_file}'
34 super().configure(test)
35
36
37
40
41class CheckFileTrigSizeStep(CheckFileStep):
42 '''
43 Execute checkFileTrigSize.py for POOL files.
44 '''
45 # TODO: Avoid rerunning checkFile.py even when *checkFile output already produced.
46 def __init__(self, name='CheckFileTrigSize', input_file='AOD.pool.root'):
47 super(CheckFileTrigSizeStep, self).__init__(name)
48 self.input_file = 'AOD.pool.root,ESD.pool.root,RDO_TRIG.pool.root,DAOD_PHYS.DAOD.pool.root,'+input_file
49 self.executable = 'checkFileTrigSize.py'
50
51
52
55
56def trig_analysis_exec_steps(input_file='AOD.pool.root'):
57 # TODO: add TrigNavSlimming test
58 tests = []
59 tests.append(TrigDecChecker(name="TrigDecChecker", in_file=input_file))
60 if 'DAOD' not in input_file: # DAOD won't have full trigger EDM
61 tests.append(TrigEDMChecker(name="TrigEDMChecker",in_file=input_file))
62
63 return tests
64
66 return [CheckFileTrigSizeStep(name='CheckFileTrigSize', input_file=input_file)]
67
68def add_analysis_steps(test, input_file='AOD.pool.root'):
69 analysis_exec_steps = trig_analysis_exec_steps(input_file)
70 test.exec_steps.extend(analysis_exec_steps)
71 test.check_steps.extend(trig_analysis_check_steps(input_file))
72
73 # Add the analysis exec step logs for merging
74 logmerge = test.get_step_by_type(LogMergeStep)
75 if not logmerge:
76 test.log.warning('LogMerge step not found, cannot add TrigAnalysisSteps exec step log files for merging')
77 else:
78 for step in analysis_exec_steps:
79 logmerge.log_files.append(step.get_log_file_name())
__init__(self, name='CheckFileTrigSize', input_file='AOD.pool.root')
__init__(self, name='TrigDecChecker', in_file='AOD.pool.root')
__init__(self, name='TrigEDMChecker', in_file='AOD.pool.root')
add_analysis_steps(test, input_file='AOD.pool.root')
trig_analysis_exec_steps(input_file='AOD.pool.root')