6 Definitions of additional validation steps in Trigger ART tests relevant only for TrigInDetValidation
7 The main common check steps are defined in the TrigValSteering.CheckSteps module.
14 from TrigValTools.TrigValSteering.ExecStep
import ExecStep
15 from TrigValTools.TrigValSteering.Step
import Step
16 from TrigValTools.TrigValSteering.CheckSteps
import RefComparisonStep
17 from TrigValTools.TrigValSteering.Common
import find_file
18 from AthenaCommon.Utils.unixtools
import FindFile
26 def __init__(self, name='TrigInDetReco', postinclude_file='', preinclude_file=''):
27 ExecStep.__init__(self, name)
33 self.concurrent_events = 1
35 self.timeout = 18*3600
37 self.preexec_trig =
''
38 self.postinclude_trig = postinclude_file
39 self.preinclude_trig = preinclude_file
40 self.release =
'current'
41 self.preexec_reco =
';'.
join([
42 'flags.Reco.EnableEgamma=True',
43 'flags.Reco.EnableCombinedMuon=True',
44 'flags.Reco.EnableJet=False',
45 'flags.Reco.EnableMet=False',
46 'flags.Reco.EnableBTagging=False',
47 'flags.Reco.EnablePFlow=False',
48 'flags.Reco.EnableTau=False',
49 'flags.Reco.EnablePostProcessing=False',
51 self.preexec_all =
';'.
join([
52 'flags.Trigger.AODEDMSet=\'ESD\'',
54 self.postexec_trig =
''
55 self.postexec_reco =
''
56 self.args =
'--outputAODFile=AOD.pool.root --steering "doRDO_TRIG"'
59 if ( self.postinclude_trig !=
'' ) :
60 print(
"postinclude_trig: ", self.postinclude_trig )
62 if ( self.preinclude_trig !=
'' ) :
63 print(
"preinclude_trig: ", self.preinclude_trig )
71 chains +=
"'HLT_mu20_LRT_idperf_L1MU14FCH',"
72 chains +=
"'HLT_mu6_LRT_idperf_L1MU5VF',"
73 chains +=
"'HLT_mu6_idperf_L1MU5VF',"
74 chains +=
"'HLT_mu24_idperf_L1MU14FCH',"
77 chains +=
"'HLT_fslrt0_L1J100',"
78 flags +=
"'UnconventionalTracking',"
80 chains +=
"'HLT_mu6_idperf_L1MU5VF',"
81 chains +=
"'HLT_mu24_idperf_L1MU14FCH',"
82 chains +=
"'HLT_mu26_ivarperf_L1MU14FCH',"
85 chains +=
"'HLT_mu14_mu14_idtp_idZmumu_L12MU8F',"
86 chains +=
"'HLT_mu14_mu14_idperf_50invmAB130_L12MU8F',"
88 if (i==
'L2electronLRT') :
89 chains +=
"'HLT_e20_idperf_loose_lrtloose_L1eEM18L',"
90 chains +=
"'HLT_e30_idperf_loose_lrtloose_L1eEM26M',"
91 chains +=
"'HLT_e26_lhtight_ivarloose_e5_idperf_loose_lrtloose_probe_L1eEM26M',"
92 chains +=
"'HLT_e5_idperf_loose_lrtloose_probe_g25_medium_L1eEM24L',"
98 chains +=
"'HLT_e26_idperf_loose_L1eEM26M',"
99 chains +=
"'HLT_e5_idperf_tight_L1eEM5',"
101 if (i==
'electron-tnp') :
102 chains +=
"'HLT_e26_lhtight_e14_idperf_tight_probe_50invmAB130_L1eEM26M',"
103 chains +=
"'HLT_e26_lhtight_e14_idperf_tight_nogsf_probe_50invmAB130_L1eEM26M',"
106 chains +=
"'HLT_tau25_idperf_tracktwoMVA_L1TAU12IM',"
107 chains +=
"'HLT_tau20_idperf_tracktwoMVA_L1eTAU12',"
108 chains +=
"'HLT_mu24_ivarmedium_tau25_idperf_tracktwoMVA_probe_03dRAB_L1MU14FCH',"
109 chains +=
"'HLT_mu24_ivarmedium_tau25_idperf_tracktwoMVA_probe_L1cTAU20M_03dRAB_L1MU14FCH',"
112 chains +=
"'HLT_tau25_idperf_tracktwoMVA_L1TAU12IM',"
113 chains +=
"'HLT_tau25_idperf_tracktwoLLP_L1TAU12IM',"
114 chains +=
"'HLT_tau25_idperf_trackLRT_L1TAU12IM',"
118 chains +=
"'HLT_j20_roiftf_preselj20_L1RD0_FILLED',"
119 chains +=
"'HLT_j45_pf_ftf_preselj20_L1jJ40',"
121 chains +=
"'HLT_j45_0eta290_020jvt_boffperf_pf_ftf_L1J20',"
125 if ( i==
'fsjet' or i==
'fs' or i==
'jet' ) :
126 chains +=
"'HLT_j45_pf_ftf_preselj20_L1jJ40',"
129 chains +=
"'HLT_beamspot_allTE_trkfast_BeamSpotPEB_L1J15','HLT_beamspot_trkFS_trkfast_BeamSpotPEB_L1J15',"
130 flags +=
"'Beamspot',"
132 chains +=
"'HLT_mb_sptrk_L1RD0_FILLED',"
133 flags +=
"'MinBias',"
134 self.preexec_trig +=
"flags.Trigger.triggerMenuSetup='PhysicsP1_pp_lowMu_run3_v1';"
135 if (i==
'minbias-pixonly') :
136 chains +=
"'HLT_mb_pixsptrk_nototpix20_q2_L1TRT_ZDC_A_C_VjTE10',"
137 flags +=
"'MinBias',"
138 self.preexec_trig +=
"flags.Trigger.triggerMenuSetup='PhysicsP1_HI_run3_v1';"
140 chains +=
"'HLT_mu4_cosmic_L1MU3V_EMPTY'"
141 flags +=
"'Muon','Cosmic',"
142 self.preexec_trig+=
"flags.Trigger.triggerMenuSetup='Cosmic_run3_v1';"
144 chains +=
"'HLT_mu6_idperf_L1MU5VF',"
145 chains +=
"'HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V',"
146 chains +=
"'HLT_mu11_mu6_bBmumux_Bidperf_L1MU8VF_2MU5VF',"
147 flags +=
"'Muon','Bphysics',"
149 print(
"ERROR: no chains configured" )
152 self.preexec_trig +=
"flags.Trigger.enabledSignatures=[" + flags +
"];flags.Trigger.selectChains="+chains
157 if (self.release !=
'current'):
160 DVERSION=os.getenv(
'Athena_VERSION')
161 if (self.release ==
'latest'):
162 if ( DVERSION
is None ) :
165 AVERSION=
str(subprocess.Popen([
"getrelease.sh",DVERSION],stdout=subprocess.PIPE).communicate()[0],
'utf-8')
167 print(
"cannot get last stable release - will use current release" )
169 AVERSION = self.release
174 self.args +=
' --asetup "RAWtoALL:Athena,'+AVERSION+
'" '
175 print(
"remapping athena base release version for offline Reco steps: ", DVERSION,
" -> ", AVERSION )
177 print(
"Using current release for offline Reco steps " )
179 if self.preexec_trig !=
'' or self.preexec_reco !=
'' or self.preexec_all !=
'':
180 self.args +=
' --preExec'
181 if self.preexec_trig !=
'':
182 self.args +=
' "RDOtoRDOTrigger:{:s};"'.
format(self.preexec_trig)
183 if self.preexec_reco !=
'':
184 self.args +=
' "RAWtoALL:{:s};"'.
format(self.preexec_reco)
185 if self.preexec_all !=
'':
186 self.args +=
' "all:{:s};"'.
format(self.preexec_all)
187 if self.postexec_trig !=
'' or self.postexec_reco !=
'':
188 self.args +=
' --postExec'
189 if self.postexec_trig !=
'':
190 self.args +=
' "RDOtoRDOTrigger:{:s};"'.
format(self.postexec_trig)
191 if self.postexec_reco !=
'':
192 self.args +=
' "RAWtoALL:{:s};"'.
format(self.postexec_reco)
193 if (self.postinclude_trig !=
''):
194 self.args +=
' --postInclude "{:s}"'.
format(self.postinclude_trig)
195 if (self.preinclude_trig !=
''):
196 self.args +=
' --preInclude "{:s}"'.
format(self.preinclude_trig)
197 super(TrigInDetReco, self).
configure(test)
205 def __init__(self, name='TrigInDetAna', extraArgs=None):
206 ExecStep.__init__(self, name )
209 self.
args =
' -m TrigInDetValidation.TrigInDetValidation_AODtoTrkNtuple_CA '
215 if extraArgs
is not None:
216 self.
args += extraArgs
225 super(TrigCostStep, self).
__init__(name)
229 self.
args =
' --monitorChainAlgorithm --MCCrossSection=0.5 Input.Files=\'["tmp.RDO_TRIG"]\' '
239 ExecStep.__init__(self, name)
251 self.
args =
'-c "setMenu=\'Cosmic_run3_v1\';doCosmics=True;doL1Sim=False;forceEnableAllChains=True;"'
252 self.
args =
'-c "flags.Trigger.forceEnableAllChains=True;flags.Trigger.triggerMenuSetup=\'Cosmic_run3_v1\';from AthenaConfiguration.Enums import BeamType;flags.Beam.Type=BeamType.Cosmics;"'
253 self.
args +=
' -o output'
262 super(TrigBSExtr, self).
__init__(name)
268 self.
args =
'-s Main ' +
'`find . -name "*_HLTMPPy_output.*.data"`'
277 super(TrigTZReco, self).
__init__(name)
279 tzrecoPreExec =
' '.
join([
280 "flags.Trigger.triggerMenuSetup=\'Cosmic_run3_v1\';",
281 "flags.Trigger.AODEDMSet=\'AODFULL\';",
288 self.
args =
'--inputBSFile=' +
find_file(
'*.physics_Main*._athenaHLT*.data')
289 self.
args +=
' --outputAODFile=AOD.pool.root'
290 self.
args +=
' --conditionsTag=\'CONDBR2-BLKPA-2023-05\' --geometryVersion=\'ATLAS-R3S-2021-03-02-00\''
291 self.
args +=
' --preExec="{:s}"'.
format(tzrecoPreExec)
301 Execute TIDArdict for TrkNtuple files.
303 def __init__(self, name='TrigInDetdict', args=None, testbin='Test_bin.dat', config=False ):
304 super(TrigInDetRdictStep, self).
__init__(name)
305 self.
args=args +
" -b " + testbin +
" "
314 os.system(
'get_files -data TIDAbeam.dat &> /dev/null' )
315 os.system(
'get_files -data Test_bin.dat &> /dev/null' )
316 os.system(
'get_files -data Test_bin_larged0.dat &> /dev/null' )
317 os.system(
'get_files -data Test_bin_lrt.dat &> /dev/null' )
318 os.system(
'get_files -data TIDAdata-run3.dat &> /dev/null' )
319 os.system(
'get_files -data TIDAdata-run3-larged0.dat &> /dev/null' )
320 os.system(
'get_files -data TIDAdata-run3-larged0-el.dat &> /dev/null' )
321 os.system(
'get_files -data TIDAdata-run3-lrt.dat &> /dev/null' )
322 os.system(
'get_files -data TIDAdata-run3-fslrt.dat &> /dev/null' )
323 os.system(
'get_files -data TIDAdata-run3-minbias.dat &> /dev/null' )
324 os.system(
'get_files -data TIDAdata_cuts.dat &> /dev/null' )
325 os.system(
'get_files -data TIDAdata-run3-offline.dat &> /dev/null' )
326 os.system(
'get_files -data TIDAdata-run3-offline-rzMatcher.dat &> /dev/null' )
327 os.system(
'get_files -data TIDAdata-run3-offline-vtxtrack.dat &> /dev/null' )
328 os.system(
'get_files -data TIDAdata-run3-offline-larged0.dat &> /dev/null' )
329 os.system(
'get_files -data TIDAdata-run3-offline-larged0-el.dat &> /dev/null' )
330 os.system(
'get_files -data TIDAdata-run3-offline-lrt.dat &> /dev/null' )
331 os.system(
'get_files -data TIDAdata-run3-offline-fslrt.dat &> /dev/null' )
332 os.system(
'get_files -data TIDAdata-run3-offline-vtx.dat &> /dev/null' )
333 os.system(
'get_files -data TIDAdata-run3-minbias-offline.dat &> /dev/null' )
334 os.system(
'get_files -data TIDAdata-run3-offline-cosmic.dat &> /dev/null' )
335 os.system(
'get_files -data TIDAdata_cuts-offline.dat &> /dev/null' )
336 os.system(
'get_files -data TIDAdata-chains-run3.dat &> /dev/null' )
337 os.system(
'get_files -data TIDAdata-chains-run3-lrt.dat &> /dev/null' )
338 os.system(
'get_files -data TIDAdata-run4.dat &> /dev/null' )
339 os.system(
'get_files -data TIDAdata-run4-offline.dat &> /dev/null' )
340 os.system(
'get_files -data TIDAdata-run4-offline-vtx.dat &> /dev/null' )
341 super(TrigInDetRdictStep, self).
configure(test)
345 json_file =
'TrigInDetValidation/comparitor.json'
346 json_fullpath =
FindFile(json_file, os.environ[
'DATAPATH'].
split(os.pathsep), os.R_OK)
348 if not json_fullpath:
349 print(
'Failed to determine full path for input JSON %s', json_file)
352 with open(json_fullpath)
as f:
355 except json.decoder.JSONDecodeError
as e:
356 print(f
"Failed to load json file {json_fullpath}")
359 chainmap = data[slice]
361 return chainmap[
'chains']
367 Execute TIDAcomparitor for data.root files.
369 def __init__( self, name='TrigInDetComp', slice=None, args=None, file=None ):
370 super(TrigInDetCompStep, self).
__init__(name)
378 os.system(
'get_files -data TIDAhisto-panel.dat &> /dev/null' )
379 os.system(
'get_files -data TIDAhisto-panel-vtx.dat &> /dev/null' )
380 os.system(
'get_files -data TIDAhistos-vtx.dat &> /dev/null' )
381 os.system(
'get_files -data TIDAhisto-panel-TnP.dat &> /dev/null' )
382 os.system(
'get_files -data TIDAhisto-tier0.dat &> /dev/null' )
383 os.system(
'get_files -data TIDAhisto-tier0-vtx.dat &> /dev/null' )
384 os.system(
'get_files -data TIDAhisto-tier0-TnP.dat &> /dev/null' )
387 RefComparisonStep.configure(self, test)
388 if self.reference
is None :
394 print(
"\033[0;32mTIDAcomparitor "+self.
args+
" \033[0m" )
395 Step.configure(self, test)
402 Execute TIDAcpucost for data.root files.
404 def __init__( self, name='TrigInDetCpuCost', outdir=None, infile=None, extra=None ):
405 super(TrigInDetCpuCostStep, self).
__init__(name)
416 RefComparisonStep.configure(self, test)
417 if self.reference
is None :
421 Step.configure(self, test)