6 from TrigValTools.TrigValSteering
import Test, CheckSteps
7 from TrigInDetValidation.TrigInDetArtSteps
import TrigInDetAna, TrigCostStep, TrigInDetRdictStep, TrigInDetCompStep, TrigInDetCpuCostStep, TrigInDetRecoData, TrigBSExtr, TrigTZReco
12 opts, args = getopt.getopt(sys.argv[1:],
"lcxptirmn:",[
"local",
"config"])
13 except getopt.GetoptError:
15 print(
"-l | --local run locally with input file from art eos grid-input")
16 print(
"-x don't run athena or post post-processing, only plotting")
17 print(
"-m run cost monitoring plotting, even if -x is set")
18 print(
"-p run post-processing, even if -x is set")
19 print(
"-n N run only on N events per job")
20 print(
"-c | --config run with config_only and print to a pkl file")
21 print(
"-t test steering, dry run for all steps")
22 print(
"-i force the dry AbortDryRun flag to be False")
37 if "Art_type" not in locals(): Art_type =
'grid'
38 if "GridFiles" not in locals(): GridFiles=
False
39 if "Malloc" not in locals(): Malloc=
False
40 if "AbortDryRun" in locals(): abort_dry_run=AbortDryRun
41 if "MultipleLB" not in locals(): MultipleLB=
False
44 if opt
in (
"-l",
"--local"):
56 if opt
in (
"-c",
"--config"):
63 vdry_run = os.environ.get(
'TRIGVALSTEERING_DRY_RUN')
79 hlt = TrigInDetRecoData()
85 hlt.concurrent_events = Slots
86 hlt.config_only = testconfig
87 if 'Release' in dir():
91 if "Args" not in locals() :
97 if Events_local != 0 :
98 hlt.max_events = Events_local
100 hlt.max_events = Events
105 hlt.timeout = 18*3600
112 hlt.input = os.getenv(
'ArtInFile')
116 os.environ[
"MALLOC_CHECK_"] =
"3"
132 filter_bs = TrigBSExtr()
135 filter_bs.args +=
' -l 0'
138 tzreco = TrigTZReco()
139 tzreco.threads = Threads
140 tzreco.concurrent_events = Slots
143 if 'ExtraAna' not in locals() :
145 aod_to_ntup = TrigInDetAna(extraArgs = ExtraAna)
151 test.art_type = Art_type
160 test.exec_steps = [hlt, filter_bs, tzreco, aod_to_ntup ]
162 test.exec_steps = [aod_to_ntup]
163 test.check_steps = CheckSteps.default_check_steps(test)
167 if ((
not exclude)
or postproc ):
170 rdict = TrigInDetRdictStep( name=job[0], args=job[1], testbin=job[2], config=(testconfig
or dry_run) )
172 rdict = TrigInDetRdictStep( name=job[0], args=job[1], config=(testconfig
or dry_run) )
173 print(
"\n\033[0;32m TIDArdict "+job[1]+
" \033[0m" )
174 test.check_steps.append(rdict)
181 compstep = TrigInDetCompStep( name=_slice[0], slice=_slice[1], file=_slice[2], args=_slice[3] )
182 test.check_steps.append(compstep)
186 cputest = [ (
"CpuCostStep1",
" times ",
"expert-monitoring.root",
" --auto -p TIME" ),
187 (
"CpuCostStep2",
" times-FTF ",
"expert-monitoring.root",
" --auto -p TIME -d TrigFastTrackFinder_" ),
188 (
"CpuCostStep3",
" cost-perCall ",
"TrigCostRoot_Results.root",
" --auto -p _Time_perCall -d /Algorithm --logx " ),
189 (
"CpuCostStep4",
" cost-perEvent ",
"TrigCostRoot_Results.root",
" --auto -p _Time_perEvent -d /Algorithm --logx " ),
190 (
"CpuCostStep5",
" cost-perCall-chain ",
"TrigCostRoot_Results.root",
" --auto -p _Time_perCall -d /Chain_Algorithm --logx " ),
191 (
"CpuCostStep6",
" cost-perEvent-chain ",
"TrigCostRoot_Results.root",
" --auto -p _Time_perEvent -d /Chain_Algorithm --logx " ) ]