Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:22:12

0001 #!/usr/bin/env python3
0002 
0003 import tempfile
0004 from pathlib import Path
0005 import shutil
0006 
0007 import acts
0008 from truth_tracking_gsf_refitting import runRefittingGsf
0009 
0010 from physmon_common import makeSetup
0011 
0012 setup = makeSetup()
0013 
0014 # Paths to pre-simulated data (same as fitting workflow)
0015 simDir = (setup.outdir / "../simulation_gsf/simulation").resolve()
0016 particlesPath = simDir / "particles_simulation.root"
0017 simhitsPath = simDir / "hits.root"
0018 
0019 # Verify simulation files exist
0020 assert particlesPath.exists(), f"Simulation not found: {particlesPath}"
0021 assert simhitsPath.exists(), f"SimHits not found: {simhitsPath}"
0022 
0023 with tempfile.TemporaryDirectory() as temp:
0024     s = acts.examples.Sequencer(
0025         events=10000,
0026         numThreads=-1,
0027         logLevel=acts.logging.INFO,
0028     )
0029 
0030     tp = Path(temp)
0031     runRefittingGsf(
0032         trackingGeometry=setup.trackingGeometry,
0033         field=setup.field,
0034         digiConfigFile=setup.digiConfig,
0035         outputDir=tp,
0036         inputParticlePath=particlesPath,
0037         inputSimHitsPath=simhitsPath,
0038         decorators=setup.decorators,
0039         s=s,
0040     )
0041 
0042     s.run()
0043 
0044     perf_file = tp / "performance_gsf_refit.root"
0045     assert perf_file.exists(), "Performance file not found"
0046     shutil.copy(perf_file, setup.outdir / "performance_trackrefitting.root")