diff --git a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py index 25b27f48a2e18e54b42fcfafad4b39fca0963371..77bc6865110a7a907a2730a67c13e909061114a9 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py +++ b/Trigger/TrigValidation/TrigInDetValidation/share/TrigInDetValidation_Base.py @@ -19,20 +19,22 @@ from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, T import sys,getopt try: - opts, args = getopt.getopt(sys.argv[1:],"lxpn:",["local"]) + opts, args = getopt.getopt(sys.argv[1:],"lcxpn:",["local","config"]) except getopt.GetoptError: print("Usage: ") print("-l(--local) run locally with input file from art eos grid-input") print("-x don't run athena or post post-processing, only plotting") print("-p run post-processing, even if -x is set") - print("") print("-n N run only on N events per job") + print("-c(--config) run with config_only and print to a pkl file") + print("") Events_local = 0 local = False exclude = False postproc = False +testconfig = False lowpt_local = [] @@ -53,6 +55,9 @@ for opt,arg in opts: postproc=True if opt=="-n": Events_local=arg + if opt in ("-c", "--config"): + testconfig = True + if 'postinclude_file' in dir() : rdo2aod = TrigInDetReco( postinclude_file = postinclude_file ) @@ -64,6 +69,7 @@ else : rdo2aod.slices = Slices rdo2aod.threads = Threads rdo2aod.concurrent_events = Slots +rdo2aod.config_only = testconfig if "Lowpt" in locals() : if isinstance( Lowpt, list ) : @@ -108,8 +114,6 @@ if (not exclude): test.exec_steps.append(TrigInDetAna()) test.check_steps = CheckSteps.default_check_steps(test) - - # Run TIDArdict # first make sure that we have a proper list .. diff --git a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py index a84877afef6fb398bae9e28c5308db1025406a3a..3a9992acd16570b7a236adf060cfa170f61b99a7 100755 --- a/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py +++ b/Trigger/TrigValidation/TrigInDetValidation/test/test_trigID_bjet_pu40.py @@ -25,73 +25,15 @@ # art-output: cost-perEvent-chain # art-output: *.dat +Slices = ['bjet'] +RunEF = False +Events = 4000 +Threads = 4 +Slots = 4 +Input = 'ttbar_ID' # defined in TrigValTools/share/TrigValInputs.json -from TrigValTools.TrigValSteering import Test, CheckSteps -from TrigInDetValidation.TrigInDetArtSteps import TrigInDetReco, TrigInDetAna, TrigInDetdictStep, TrigInDetCompStep, TrigInDetCpuCostStep +TrackReference = [ 'Truth' ] -import sys,getopt - -try: - opts, args = getopt.getopt(sys.argv[1:],"lxp",["local"]) -except getopt.GetoptError: - print("Usage: ") - print("-l(--local) run locally with input file from art eos grid-input") - print("-x don't run athena or post post-processing, only plotting") - print("-p run post-processing, even if -x is set") - - -local=False -exclude=False -postproc=False -for opt,arg in opts: - if opt in ("-l", "--local"): - local=True - if opt=="-x": - exclude=True - if opt=="-p": - postproc=True - - - -rdo2aod = TrigInDetReco() -rdo2aod.slices = ['bjet'] -rdo2aod.max_events = 4000 -rdo2aod.threads = 4 -rdo2aod.concurrent_events = 4 -rdo2aod.perfmon = False -rdo2aod.timeout = 18*3600 -rdo2aod.input = 'ttbar_ID' # defined in TrigValTools/share/TrigValInputs.json - - -test = Test.Test() -test.art_type = 'grid' -if (not exclude): - test.exec_steps = [rdo2aod] - test.exec_steps.append(TrigInDetAna()) # Run analysis to produce TrkNtuple - test.check_steps = CheckSteps.default_check_steps(test) - -# Run Tidardict -if ((not exclude) or postproc ): - rdict = TrigInDetdictStep() - rdict.args='TIDAdata-run3.dat -f data-hists.root -b Test_bin.dat ' - test.check_steps.append(rdict) - - -# Now the comparitor steps -comp1=TrigInDetCompStep('Comp_L2bjet','L2','bjet') -test.check_steps.append(comp1) - -comp2=TrigInDetCompStep('Comp_EFbjet','EF','bjet') -test.check_steps.append(comp2) - - -# CPU cost steps -cpucost=TrigInDetCpuCostStep('CpuCostStep1', ftf_times=False) -test.check_steps.append(cpucost) - -cpucost2=TrigInDetCpuCostStep('CpuCostStep2') -test.check_steps.append(cpucost2) - -import sys -sys.exit(test.run()) +from AthenaCommon.Include import include +include("TrigInDetValidation/TrigInDetValidation_Base.py") \ No newline at end of file diff --git a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/ExecStep.py b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/ExecStep.py index b51719c9bc0e02ccfdf6f4c8500a8a3256184a36..a6b222f3bea78d529e8fd04fb5504a2d44d86f24 100644 --- a/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/ExecStep.py +++ b/Trigger/TrigValidation/TrigValTools/python/TrigValSteering/ExecStep.py @@ -34,6 +34,7 @@ class ExecStep(Step): self.imf = True self.perfmon = True self.prmon = True + self.config_only = False self.auto_report_result = True self.required = True self.depends_on_previous = True @@ -168,6 +169,20 @@ class ExecStep(Step): if self.perfmon: athenaopts += ' --perfmon' + # Run config-only if requested + if self.config_only : + + if self.type == 'athenaHLT' or (self.type == "other" and self.executable == "athenaHLT.py") : + athenaopts += ' --dump-config-exit' + + elif self.type == 'athena' or self.type == 'Reco_tf' or (self.type == "other" and self.executable == "athena.py") : + athenaopts += ' --config-only=' + self.name + '.pkl' + + # No current support if it isn't clear exactly what's being run + # This includes Trig_reco_tf and 'other' where the executable is not known + else : + self.misconfig_abort('Cannot determine what config-only option is needed. Consider adding the appropriate flag to "args" instead.') + # Default threads/concurrent_events/forks if test.package_name == 'TrigP1Test' and self.type == 'athenaHLT': if self.threads is None: