13 from TrigValTools.TrigValSteering
import Test, CheckSteps
14 from TrigInDetValidation.TrigInDetArtSteps
import TrigInDetReco, TrigInDetAna, TrigCostStep, TrigInDetRdictStep, TrigInDetCompStep, TrigInDetCpuCostStep
19 opts, args = getopt.getopt(sys.argv[1:],
"cxptirmn:",[
"config"])
20 except getopt.GetoptError:
22 print(
"-x don't run athena or post post-processing, only plotting")
23 print(
"-m run cost monitoring plotting, even if -x is set")
24 print(
"-r run only ntuple building stage")
25 print(
"-p run post-processing, even if -x is set")
26 print(
"-n N run only on N events per job")
27 print(
"-c | --config run with config_only and print to a pkl file")
28 print(
"-t test steering, dry run for all steps")
29 print(
"-i force the dry AbortDryRun flag to be False")
43 if "Art_type" not in locals(): Art_type =
'grid'
44 if "Malloc" not in locals(): Malloc=
False
45 if "AbortDryRun" in locals(): abort_dry_run=AbortDryRun
58 if opt
in (
"-c",
"--config"):
65 vdry_run = os.environ.get(
'TRIGVALSTEERING_DRY_RUN')
71 if 'postinclude_file' in dir() :
72 if 'preinclude_file' in dir() :
73 rdo2aod = TrigInDetReco( postinclude_file=postinclude_file, preinclude_file=preinclude_file )
75 rdo2aod = TrigInDetReco( postinclude_file=postinclude_file )
77 if 'preinclude_file' in dir() :
78 rdo2aod = TrigInDetReco( preinclude_file=preinclude_file )
80 rdo2aod = TrigInDetReco()
84 rdo2aod.slices = Slices
85 rdo2aod.threads = Threads
86 rdo2aod.concurrent_events = Slots
87 rdo2aod.config_only = testconfig
88 if 'Release' in dir():
89 rdo2aod.release = Release
92 if "Args" not in locals() :
98 if Events_local != 0 :
99 rdo2aod.max_events = Events_local
101 rdo2aod.max_events = Events
104 rdo2aod.perfmon =
False
105 rdo2aod.costmon =
True
106 rdo2aod.timeout = 18*3600
109 if os.getenv(
"ArtInFile",
None):
111 rdo2aod.args +=
' --inputRDOFile=$ArtInFile '
113 rdo2aod.input = Input
116 from AthenaConfiguration.TestDefaults
import defaultConditionsTags
118 if "conditionsOverride" not in locals():
119 rdo2aod.args += f
' --conditionsTag "default:{defaultConditionsTags.RUN3_MC}"'
120 elif conditionsOverride ==
"Run4":
121 rdo2aod.args += f
' --conditionsTag "default:{defaultConditionsTags.RUN4_MC}"'
126 os.environ[
"MALLOC_CHECK_"] =
"3"
127 rdo2aod.malloc =
True
129 for a
in [
"preexec_trig",
"preexec_reco",
"preexec_all",
"postexec_trig",
"postexec_reco"]:
133 v0 = getattr (rdo2aod, a)
134 if v0
is None or v0 ==
"":
138 setattr (rdo2aod, a, v0)
143 test.art_type = Art_type
146 if 'ExtraAna' not in locals() :
148 aod_to_ntup = TrigInDetAna(extraArgs = ExtraAna)
151 rdo_to_cost = TrigCostStep()
159 test.exec_steps = [rdo2aod, aod_to_ntup, rdo_to_cost]
161 test.exec_steps = [aod_to_ntup]
162 test.check_steps = CheckSteps.default_check_steps(test)
166 if ((
not exclude)
or postproc ):
169 rdict = TrigInDetRdictStep( name=job[0], args=job[1], testbin=job[2], config=(testconfig
or dry_run) )
171 rdict = TrigInDetRdictStep( name=job[0], args=job[1], config=(testconfig
or dry_run) )
172 print(
"\n\033[0;32m TIDArdict "+job[1]+
" \033[0m" )
173 test.check_steps.append(rdict)
180 compstep = TrigInDetCompStep( name=_slice[0], slice=_slice[1], file=_slice[2], args=_slice[3] )
181 test.check_steps.append(compstep)
185 cputest = [ (
"CpuCostStep1",
" times ",
"expert-monitoring.root",
" --auto -p TIME" ),
186 (
"CpuCostStep2",
" times-FTF ",
"expert-monitoring.root",
" --auto -p TIME -d TrigFastTrackFinder_" ),
187 (
"CpuCostStep3",
" cost-perCall ",
"TrigCostRoot_Results.root",
" --auto -p _Time_perCall -d /Algorithm --logx " ),
188 (
"CpuCostStep4",
" cost-perEvent ",
"TrigCostRoot_Results.root",
" --auto -p _Time_perEvent -d /Algorithm --logx " ),
189 (
"CpuCostStep5",
" cost-perCall-chain ",
"TrigCostRoot_Results.root",
" --auto -p _Time_perCall -d /Chain_Algorithm --logx " ),
190 (
"CpuCostStep6",
" cost-perEvent-chain ",
"TrigCostRoot_Results.root",
" --auto -p _Time_perEvent -d /Chain_Algorithm --logx " ) ]
193 if ((
not exclude)
or postproc
or costplot ):
195 cpucost = TrigInDetCpuCostStep( name=job[0], outdir=job[1], infile=job[2], extra=job[3] )
196 test.check_steps.append(cpucost)