12 from TrigValTools.TrigValSteering
import Test, CheckSteps
13 from TrigInDetValidation.TrigInDetArtSteps
import TrigInDetReco, TrigInDetAna, TrigCostStep, TrigInDetRdictStep, TrigInDetCompStep, TrigInDetCpuCostStep, TrigInDetRecoData, TrigBSExtr, TrigTZReco
18 opts, args = getopt.getopt(sys.argv[1:],
"lcxptirmn:",[
"local",
"config"])
19 except getopt.GetoptError:
21 print(
"-l | --local run locally with input file from art eos grid-input")
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(
"-p run post-processing, even if -x is set")
25 print(
"-n N run only on N events per job")
26 print(
"-c | --config run with config_only and print to a pkl file")
27 print(
"-t test steering, dry run for all steps")
28 print(
"-i force the dry AbortDryRun flag to be False")
43 if "Art_type" not in locals(): Art_type =
'grid'
44 if "GridFiles" not in locals(): GridFiles=
False
45 if "Malloc" not in locals(): Malloc=
False
46 if "AbortDryRun" in locals(): abort_dry_run=AbortDryRun
47 if "MultipleLB" not in locals(): MultipleLB=
False
50 if opt
in (
"-l",
"--local"):
62 if opt
in (
"-c",
"--config"):
69 vdry_run = os.environ.get(
'TRIGVALSTEERING_DRY_RUN')
85 hlt = TrigInDetRecoData()
91 hlt.concurrent_events = Slots
92 hlt.config_only = testconfig
93 if 'Release' in dir():
97 if "Args" not in locals() :
103 if Events_local != 0 :
104 hlt.max_events = Events_local
106 hlt.max_events = Events
111 hlt.timeout = 18*3600
118 hlt.input = os.getenv(
'ArtInFile')
122 os.environ[
"MALLOC_CHECK_"] =
"3"
138 filter_bs = TrigBSExtr()
141 filter_bs.args +=
' -l 0'
143 tzreco = TrigTZReco()
148 if 'ExtraAna' not in locals() :
150 aod_to_ntup = TrigInDetAna(extraArgs = ExtraAna)
156 test.art_type = Art_type
165 test.exec_steps = [hlt, filter_bs, tzreco, aod_to_ntup ]
167 test.exec_steps = [aod_to_ntup]
168 test.check_steps = CheckSteps.default_check_steps(test)
172 if ((
not exclude)
or postproc ):
175 rdict = TrigInDetRdictStep( name=job[0], args=job[1], testbin=job[2], config=(testconfig
or dry_run) )
177 rdict = TrigInDetRdictStep( name=job[0], args=job[1], config=(testconfig
or dry_run) )
178 print(
"\n\033[0;32m TIDArdict "+job[1]+
" \033[0m" )
179 test.check_steps.append(rdict)
186 compstep = TrigInDetCompStep( name=_slice[0], slice=_slice[1], file=_slice[2], args=_slice[3] )
187 test.check_steps.append(compstep)
191 cputest = [ (
"CpuCostStep1",
" times ",
"expert-monitoring.root",
" --auto -p TIME" ),
192 (
"CpuCostStep2",
" times-FTF ",
"expert-monitoring.root",
" --auto -p TIME -d TrigFastTrackFinder_" ),
193 (
"CpuCostStep3",
" cost-perCall ",
"TrigCostRoot_Results.root",
" --auto -p _Time_perCall -d /Algorithm --logx " ),
194 (
"CpuCostStep4",
" cost-perEvent ",
"TrigCostRoot_Results.root",
" --auto -p _Time_perEvent -d /Algorithm --logx " ),
195 (
"CpuCostStep5",
" cost-perCall-chain ",
"TrigCostRoot_Results.root",
" --auto -p _Time_perCall -d /Chain_Algorithm --logx " ),
196 (
"CpuCostStep6",
" cost-perEvent-chain ",
"TrigCostRoot_Results.root",
" --auto -p _Time_perEvent -d /Chain_Algorithm --logx " ) ]