From 93e3b27d35b751a47f239997d44dcf768638ecf2 Mon Sep 17 00:00:00 2001 From: Tim Adye Date: Wed, 11 Dec 2024 13:07:28 +0000 Subject: [PATCH] fix: update full_chain_test.py to follow full_chain_odd.py (#3956) * support `--output-obj` like #3180. Can also still use `-cc` to output all formats. * Fuse initial and final sim particles when `--edm4hep` input specified (sync with #3804) Next, we should remove the command-line options for `full_chain_odd.py`. ## Summary by CodeRabbit - **New Features** - Introduced a new `--output-obj` argument for enabling object file output. - **Improvements** - Updated help text for the `--output-csv` argument to clarify output options. - Enhanced output directory handling to support multiple output formats. --- Examples/Scripts/Python/full_chain_test.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Examples/Scripts/Python/full_chain_test.py b/Examples/Scripts/Python/full_chain_test.py index e7c945094f6..f09be753d46 100755 --- a/Examples/Scripts/Python/full_chain_test.py +++ b/Examples/Scripts/Python/full_chain_test.py @@ -81,7 +81,12 @@ def parse_args(): "--output-csv", action="count", default=0, - help="Use CSV output instead of ROOT. Specify -cc to output both.", + help="Use CSV output instead of ROOT. Specify -cc to output all formats (ROOT, CSV, and obj).", + ) + parser.add_argument( + "--output-obj", + action="store_true", + help="Enable obj output", ) parser.add_argument( "-n", @@ -272,6 +277,11 @@ def full_chain(args): outputDirCsv = outputDir if args.output_csv != 0 else None outputDirLessCsv = outputDirLess if args.output_csv != 0 else None outputDirMoreCsv = outputDirMore if args.output_csv != 0 else None + outputDirObj = ( + outputDirLess + if args.output_obj + else outputDir if args.output_csv == 2 else None + ) # fmt: off if args.generic_detector: @@ -392,8 +402,7 @@ def full_chain(args): "LongStripEndcapReadout", ], outputParticlesGenerator="particles_input", - outputParticlesInitial="particles_initial", - outputParticlesFinal="particles_final", + outputParticlesSimulation="particles_simulated", outputSimHits="simhits", graphvizOutput="graphviz", dd4hepDetector=detector, @@ -483,6 +492,7 @@ def full_chain(args): postSelectParticles=postSelectParticles, outputDirRoot=outputDirRoot, outputDirCsv=outputDirCsv, + outputDirObj=outputDirObj, ) else: if s.config.numThreads != 1: @@ -508,6 +518,7 @@ def full_chain(args): killAfterTime=25 * u.ns, outputDirRoot=outputDirRoot, outputDirCsv=outputDirCsv, + outputDirObj=outputDirObj, ) addDigitization(