Skip to content

Commit

Permalink
fix: update full_chain_test.py to follow full_chain_odd.py (#3956)
Browse files Browse the repository at this point in the history
* 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`.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## 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.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
timadye authored Dec 11, 2024
1 parent 08a3953 commit 93e3b27
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Examples/Scripts/Python/full_chain_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -483,6 +492,7 @@ def full_chain(args):
postSelectParticles=postSelectParticles,
outputDirRoot=outputDirRoot,
outputDirCsv=outputDirCsv,
outputDirObj=outputDirObj,
)
else:
if s.config.numThreads != 1:
Expand All @@ -508,6 +518,7 @@ def full_chain(args):
killAfterTime=25 * u.ns,
outputDirRoot=outputDirRoot,
outputDirCsv=outputDirCsv,
outputDirObj=outputDirObj,
)

addDigitization(
Expand Down

0 comments on commit 93e3b27

Please sign in to comment.