Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:10:09

0001 #!/usr/bin/env python3
0002 
0003 from pathlib import Path
0004 
0005 import acts
0006 import acts.examples
0007 
0008 from truth_tracking_kalman import runTruthTrackingKalman
0009 
0010 u = acts.UnitConstants
0011 
0012 srcdir = Path(__file__).resolve().parent.parent.parent.parent
0013 outputDir = Path.cwd()
0014 
0015 # detector, trackingGeometry, _ = getOpenDataDetector()
0016 detector, trackingGeometry, decorators = acts.examples.GenericDetector.create()
0017 field = acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T))
0018 
0019 s = runTruthTrackingKalman(
0020     trackingGeometry,
0021     field,
0022     digiConfigFile=srcdir
0023     / "Examples/Algorithms/Digitization/share/default-smearing-config-generic.json",
0024     # "thirdparty/OpenDataDetector/config/odd-digi-smearing-config.json",
0025     outputDir=outputDir,
0026 )
0027 
0028 gsfOptions = {
0029     "betheHeitlerApprox": acts.examples.AtlasBetheHeitlerApprox.makeDefault(),
0030     "maxComponents": 4,
0031     "abortOnError": False,
0032     "disableAllMaterialHandling": False,
0033     "finalReductionMethod": acts.examples.FinalReductionMethod.maxWeight,
0034     "weightCutoff": 1.0e-4,
0035     "level": acts.logging.INFO,
0036 }
0037 
0038 s.addAlgorithm(
0039     acts.examples.RefittingAlgorithm(
0040         acts.logging.INFO,
0041         inputTracks="kf_tracks",
0042         outputTracks="gsf_tracks",
0043         fit=acts.examples.makeGsfFitterFunction(trackingGeometry, field, **gsfOptions),
0044     )
0045 )
0046 
0047 s.addWriter(
0048     acts.examples.TrackFitterPerformanceWriter(
0049         level=acts.logging.INFO,
0050         inputTracks="tracks",
0051         inputParticles="truth_seeds_selected",
0052         inputTrackParticleMatching="track_particle_matching",
0053         filePath=str(outputDir / "performance_refitter.root"),
0054     )
0055 )
0056 
0057 s.run()