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='', useCA_Reco=False ):
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',
52 self._isCA = useCA_Reco
54 self.preexec_all =
';'.
join([
55 'flags.Trigger.AODEDMSet=\'ESD\'',
58 self.postexec_trig =
''
60 self.postexec_trig =
"from AthenaCommon.AppMgr import ServiceMgr; ServiceMgr.AthenaPoolCnvSvc.MaxFileSizes=['tmp.RDO_TRIG=100000000000']"
63 self.postexec_reco =
''
64 self.args =
'--outputAODFile=AOD.pool.root --steering "doRDO_TRIG"'
67 self.args +=
' "default:True"'
70 if ( self.postinclude_trig !=
'' ) :
71 print(
"postinclude_trig: ", self.postinclude_trig )
73 if ( self.preinclude_trig !=
'' ) :
74 print(
"preinclude_trig: ", self.preinclude_trig )
82 chains +=
"'HLT_mu20_LRT_idperf_L1MU14FCH',"
83 chains +=
"'HLT_mu6_LRT_idperf_L1MU5VF',"
84 chains +=
"'HLT_mu6_idperf_L1MU5VF',"
85 chains +=
"'HLT_mu24_idperf_L1MU14FCH',"
86 flags +=
"'Muon'," if self._isCA
else 'doMuonSlice=True;'
88 chains +=
"'HLT_fslrt0_L1J100',"
89 flags +=
"'UnconventionalTracking'," if self._isCA
else 'doUnconventionalTrackingSlice=True;'
91 chains +=
"'HLT_mu6_idperf_L1MU5VF',"
92 chains +=
"'HLT_mu24_idperf_L1MU14FCH',"
93 chains +=
"'HLT_mu26_ivarperf_L1MU14FCH',"
94 flags +=
"'Muon'," if self._isCA
else 'doMuonSlice=True;'
96 chains +=
"'HLT_mu14_mu14_idtp_idZmumu_L12MU8F',"
97 chains +=
"'HLT_mu14_mu14_idperf_50invmAB130_L12MU8F',"
98 flags +=
"'Muon'," if self._isCA
else 'doMuonSlice=True;'
99 if (i==
'L2electronLRT') :
100 chains +=
"'HLT_e20_idperf_loose_lrtloose_L1eEM18L',"
101 chains +=
"'HLT_e30_idperf_loose_lrtloose_L1eEM26M',"
102 chains +=
"'HLT_e26_lhtight_ivarloose_e5_idperf_loose_lrtloose_probe_L1eEM26M',"
103 chains +=
"'HLT_e5_idperf_loose_lrtloose_probe_g25_medium_L1eEM24L',"
104 flags +=
"'Egamma'," if self._isCA
else 'doEgammaSlice=True;'
109 chains +=
"'HLT_e26_idperf_loose_L1eEM26M',"
110 chains +=
"'HLT_e5_idperf_tight_L1eEM5',"
111 flags +=
"'Egamma'," if self._isCA
else 'doEgammaSlice=True;'
112 if (i==
'electron-tnp') :
113 chains +=
"'HLT_e26_lhtight_e14_idperf_tight_probe_50invmAB130_L1eEM26M',"
114 chains +=
"'HLT_e26_lhtight_e14_idperf_tight_nogsf_probe_50invmAB130_L1eEM26M',"
115 flags +=
"'Egamma'," if self._isCA
else 'doEgammaSlice=True;'
117 chains +=
"'HLT_tau25_idperf_tracktwoMVA_L1TAU12IM',"
118 chains +=
"'HLT_tau20_idperf_tracktwoMVA_L1eTAU12',"
119 chains +=
"'HLT_mu24_ivarmedium_tau25_idperf_tracktwoMVA_probe_03dRAB_L1MU14FCH',"
120 chains +=
"'HLT_mu24_ivarmedium_tau25_idperf_tracktwoMVA_probe_L1cTAU20M_03dRAB_L1MU14FCH',"
121 flags +=
"'Tau'," if self._isCA
else 'doTauSlice=True;'
123 chains +=
"'HLT_tau25_idperf_tracktwoMVA_L1TAU12IM',"
124 chains +=
"'HLT_tau25_idperf_tracktwoLLP_L1TAU12IM',"
125 chains +=
"'HLT_tau25_idperf_trackLRT_L1TAU12IM',"
126 flags +=
"'Tau'," if self._isCA
else 'doTauSlice=True;'
129 chains +=
"'HLT_j20_roiftf_preselj20_L1RD0_FILLED',"
130 chains +=
"'HLT_j45_pf_ftf_preselj20_L1jJ40',"
132 chains +=
"'HLT_j45_0eta290_020jvt_boffperf_pf_ftf_L1J20',"
134 chains +=
"'HLT_j75c_020jvt_j50c_020jvt_j25c_020jvt_j20c_020jvt_SHARED_2j20c_020jvt_bdl1d77_pf_ftf_presel2c20XX2c20b85_L1J45p0ETA21_3J15p0ETA25',"
135 flags +=
"'Bjet'," if self._isCA
else 'doBjetSlice=True;'
136 if ( i==
'fsjet' or i==
'fs' or i==
'jet' ) :
137 chains +=
"'HLT_j45_pf_ftf_preselj20_L1jJ40',"
138 flags +=
"'Jet'," if self._isCA
else 'doJetSlice=True;'
140 chains +=
"'HLT_beamspot_allTE_trkfast_BeamSpotPEB_L1J15','HLT_beamspot_trkFS_trkfast_BeamSpotPEB_L1J15',"
141 flags +=
"'Beamspot'," if self._isCA
else 'doBeamspotSlice=True;'
143 chains +=
"'HLT_mb_sptrk_L1RD0_FILLED',"
145 flags +=
"'MinBias',"
146 self.preexec_trig +=
"flags.Trigger.triggerMenuSetup='PhysicsP1_pp_lowMu_run3_v1';"
148 flags +=
"doMinBiasSlice=True;setMenu='PhysicsP1_pp_lowMu_run3_v1';"
150 chains +=
"'HLT_mu4_cosmic_L1MU3V_EMPTY'"
152 flags +=
"'Muon','Cosmic',"
153 self.preexec_trig+=
"flags.Trigger.triggerMenuSetup='Cosmic_run3_v1';"
155 flags +=
"doMuonSlice=True;doCosmics=True;setMenu='Cosmic_run3_v1';"
157 chains +=
"'HLT_mu6_idperf_L1MU5VF',"
158 chains +=
"'HLT_2mu4_bBmumux_BsmumuPhi_L12MU3V',"
159 chains +=
"'HLT_mu11_mu6_bBmumux_Bidperf_L1MU8VF_2MU5VF',"
160 flags +=
"'Muon','Bphysics'," if self._isCA
else 'doMuonSlice=True;doBphysicsSlice=True;'
162 print(
"ERROR: no chains configured" )
166 self.preexec_trig +=
"flags.Trigger.enabledSignatures=[" + flags +
"];flags.Trigger.selectChains="+chains
168 self.preexec_trig +=
'doEmptyMenu=True;'+flags+
'selectChains='+chains
173 if (self.release !=
'current'):
176 DVERSION=os.getenv(
'Athena_VERSION')
177 if (self.release ==
'latest'):
178 if ( DVERSION
is None ) :
181 AVERSION=
str(subprocess.Popen([
"getrelease.sh",DVERSION],stdout=subprocess.PIPE).communicate()[0],
'utf-8')
183 print(
"cannot get last stable release - will use current release" )
185 AVERSION = self.release
190 self.args +=
' --asetup "RAWtoALL:Athena,'+AVERSION+
'" '
191 print(
"remapping athena base release version for offline Reco steps: ", DVERSION,
" -> ", AVERSION )
193 print(
"Using current release for offline Reco steps " )
195 if self.preexec_trig !=
'' or self.preexec_reco !=
'' or self.preexec_all !=
'':
196 self.args +=
' --preExec'
197 if self.preexec_trig !=
'':
198 self.args +=
' "RDOtoRDOTrigger:{:s};"'.
format(self.preexec_trig)
199 if self.preexec_reco !=
'':
200 self.args +=
' "RAWtoALL:{:s};"'.
format(self.preexec_reco)
201 if self.preexec_all !=
'':
202 self.args +=
' "all:{:s};"'.
format(self.preexec_all)
203 if self.postexec_trig !=
'' or self.postexec_reco !=
'':
204 self.args +=
' --postExec'
205 if self.postexec_trig !=
'':
206 self.args +=
' "RDOtoRDOTrigger:{:s};"'.
format(self.postexec_trig)
207 if self.postexec_reco !=
'':
208 self.args +=
' "RAWtoALL:{:s};"'.
format(self.postexec_reco)
209 if (self.postinclude_trig !=
''):
210 self.args +=
' --postInclude "{:s}"'.
format(self.postinclude_trig)
211 if (self.preinclude_trig !=
''):
212 self.args +=
' --preInclude "{:s}"'.
format(self.preinclude_trig)
213 super(TrigInDetReco, self).
configure(test)
221 def __init__(self, name='TrigInDetAna', extraArgs=None):
222 ExecStep.__init__(self, name )
225 self.
args =
' -m TrigInDetValidation.TrigInDetValidation_AODtoTrkNtuple_CA '
231 if extraArgs
is not None:
232 self.
args += extraArgs
241 super(TrigCostStep, self).
__init__(name)
245 self.
args =
' --monitorChainAlgorithm --MCCrossSection=0.5 Input.Files=\'["tmp.RDO_TRIG"]\' '
255 ExecStep.__init__(self, name)
267 self.
args =
'-c "setMenu=\'Cosmic_run3_v1\';doCosmics=True;doL1Sim=False;forceEnableAllChains=True;"'
268 self.
args =
'-c "flags.Trigger.forceEnableAllChains=True;flags.Trigger.triggerMenuSetup=\'Cosmic_run3_v1\';from AthenaConfiguration.Enums import BeamType;flags.Beam.Type=BeamType.Cosmics;"'
269 self.
args +=
' -o output'
278 super(TrigBSExtr, self).
__init__(name)
284 self.
args =
'-s Main ' +
'`find . -name "*_HLTMPPy_output.*.data"`'
293 super(TrigTZReco, self).
__init__(name)
295 tzrecoPreExec =
' '.
join([
296 "flags.Trigger.triggerMenuSetup=\'Cosmic_run3_v1\';",
297 "flags.Trigger.AODEDMSet=\'AODFULL\';",
304 self.
args =
'--inputBSFile=' +
find_file(
'*.physics_Main*._athenaHLT*.data')
305 self.
args +=
' --outputAODFile=AOD.pool.root'
306 self.
args +=
' --conditionsTag=\'CONDBR2-BLKPA-2023-05\' --geometryVersion=\'ATLAS-R3S-2021-03-02-00\''
307 self.
args +=
' --preExec="{:s}"'.
format(tzrecoPreExec)
317 Execute TIDArdict for TrkNtuple files.
319 def __init__(self, name='TrigInDetdict', args=None, testbin='Test_bin.dat', config=False ):
320 super(TrigInDetRdictStep, self).
__init__(name)
321 self.
args=args +
" -b " + testbin +
" "
330 os.system(
'get_files -data TIDAbeam.dat &> /dev/null' )
331 os.system(
'get_files -data Test_bin.dat &> /dev/null' )
332 os.system(
'get_files -data Test_bin_larged0.dat &> /dev/null' )
333 os.system(
'get_files -data Test_bin_lrt.dat &> /dev/null' )
334 os.system(
'get_files -data TIDAdata-run3.dat &> /dev/null' )
335 os.system(
'get_files -data TIDAdata-run3-larged0.dat &> /dev/null' )
336 os.system(
'get_files -data TIDAdata-run3-larged0-el.dat &> /dev/null' )
337 os.system(
'get_files -data TIDAdata-run3-lrt.dat &> /dev/null' )
338 os.system(
'get_files -data TIDAdata-run3-fslrt.dat &> /dev/null' )
339 os.system(
'get_files -data TIDAdata-run3-minbias.dat &> /dev/null' )
340 os.system(
'get_files -data TIDAdata_cuts.dat &> /dev/null' )
341 os.system(
'get_files -data TIDAdata-run3-offline.dat &> /dev/null' )
342 os.system(
'get_files -data TIDAdata-run3-offline-rzMatcher.dat &> /dev/null' )
343 os.system(
'get_files -data TIDAdata-run3-offline-vtxtrack.dat &> /dev/null' )
344 os.system(
'get_files -data TIDAdata-run3-offline-larged0.dat &> /dev/null' )
345 os.system(
'get_files -data TIDAdata-run3-offline-larged0-el.dat &> /dev/null' )
346 os.system(
'get_files -data TIDAdata-run3-offline-lrt.dat &> /dev/null' )
347 os.system(
'get_files -data TIDAdata-run3-offline-fslrt.dat &> /dev/null' )
348 os.system(
'get_files -data TIDAdata-run3-offline-vtx.dat &> /dev/null' )
349 os.system(
'get_files -data TIDAdata-run3-minbias-offline.dat &> /dev/null' )
350 os.system(
'get_files -data TIDAdata-run3-offline-cosmic.dat &> /dev/null' )
351 os.system(
'get_files -data TIDAdata_cuts-offline.dat &> /dev/null' )
352 os.system(
'get_files -data TIDAdata-chains-run3.dat &> /dev/null' )
353 os.system(
'get_files -data TIDAdata-chains-run3-lrt.dat &> /dev/null' )
354 os.system(
'get_files -data TIDAdata-run4.dat &> /dev/null' )
355 os.system(
'get_files -data TIDAdata-run4-offline.dat &> /dev/null' )
356 os.system(
'get_files -data TIDAdata-run4-offline-vtx.dat &> /dev/null' )
357 super(TrigInDetRdictStep, self).
configure(test)
361 json_file =
'TrigInDetValidation/comparitor.json'
362 json_fullpath =
FindFile(json_file, os.environ[
'DATAPATH'].
split(os.pathsep), os.R_OK)
364 if not json_fullpath:
365 print(
'Failed to determine full path for input JSON %s', json_file)
368 with open(json_fullpath)
as f:
371 except json.decoder.JSONDecodeError
as e:
372 print(f
"Failed to load json file {json_fullpath}")
375 chainmap = data[slice]
377 return chainmap[
'chains']
383 Execute TIDAcomparitor for data.root files.
385 def __init__( self, name='TrigInDetComp', slice=None, args=None, file=None ):
386 super(TrigInDetCompStep, self).
__init__(name)
394 os.system(
'get_files -data TIDAhisto-panel.dat &> /dev/null' )
395 os.system(
'get_files -data TIDAhisto-panel-vtx.dat &> /dev/null' )
396 os.system(
'get_files -data TIDAhistos-vtx.dat &> /dev/null' )
397 os.system(
'get_files -data TIDAhisto-panel-TnP.dat &> /dev/null' )
398 os.system(
'get_files -data TIDAhisto-tier0.dat &> /dev/null' )
399 os.system(
'get_files -data TIDAhisto-tier0-vtx.dat &> /dev/null' )
400 os.system(
'get_files -data TIDAhisto-tier0-TnP.dat &> /dev/null' )
403 RefComparisonStep.configure(self, test)
404 if self.reference
is None :
410 print(
"\033[0;32mTIDAcomparitor "+self.
args+
" \033[0m" )
411 Step.configure(self, test)
418 Execute TIDAcpucost for data.root files.
420 def __init__( self, name='TrigInDetCpuCost', outdir=None, infile=None, extra=None ):
421 super(TrigInDetCpuCostStep, self).
__init__(name)
432 RefComparisonStep.configure(self, test)
433 if self.reference
is None :
437 Step.configure(self, test)