Skip to content

Commit

Permalink
feat: Perform the Greedy Solver after the ML Solver (#2434)
Browse files Browse the repository at this point in the history
This PR modify the odd full chain to call the Greedy solver on the output of the MLSolver. This has been tested on ttbar mu=200 PU and removes almost all the remaining duplicates at almost no cost in term of efficiency and speed.

This PR also change the full chain default back to mu=200 and the seeding range to match the  ODD eta range.
  • Loading branch information
Corentin-Allaire authored Sep 8, 2023
1 parent 03d2e5f commit 109fb7d
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 14 deletions.
Binary file modified CI/physmon/reference/performance_ambi_seeded.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ambi_ttbar.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_gridseeder_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_gridseeder_ttbar_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_ttbar_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ckf_seeded.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ckf_truth_smeared.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ckf_ttbar.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ivf_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_seeding_seeded.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_seeding_ttbar.root
Binary file not shown.
Binary file modified CI/physmon/reference/tracksummary_ckf_seeded_hist.root
Binary file not shown.
4 changes: 2 additions & 2 deletions Core/include/Acts/Seeding/SeedFinderConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ struct SeedFinderConfig {
// lower cutoff for seeds
float minPt = 400. * Acts::UnitConstants::MeV;
// cot of maximum theta angle
// equivalent to 2.7 eta (pseudorapidity)
float cotThetaMax = 7.40627;
// equivalent to 3 eta (pseudorapidity)
float cotThetaMax = 10.01788;
// minimum distance in r between two measurements within one seed
float deltaRMin = 5 * Acts::UnitConstants::mm;
// maximum distance in r between two measurements within one seed
Expand Down
24 changes: 19 additions & 5 deletions Examples/Python/python/acts/examples/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@

AmbiguityResolutionMLConfig = namedtuple(
"AmbiguityResolutionMLConfig",
["nMeasurementsMin"],
defaults=[None] * 1,
["maximumSharedHits", "nMeasurementsMin", "maximumIterations"],
defaults=[None] * 3,
)

AmbiguityResolutionMLDBScanConfig = namedtuple(
Expand Down Expand Up @@ -1341,10 +1341,11 @@ def addAmbiguityResolutionML(
logLevel: Optional[acts.logging.Level] = None,
) -> None:
from acts.examples.onnx import AmbiguityResolutionMLAlgorithm
from acts.examples import GreedyAmbiguityResolutionAlgorithm

customLogLevel = acts.examples.defaultLogging(s, logLevel)

alg = AmbiguityResolutionMLAlgorithm(
algML = AmbiguityResolutionMLAlgorithm(
level=customLogLevel(),
inputTracks="tracks",
inputDuplicateNN=onnxModelFile,
Expand All @@ -1353,11 +1354,24 @@ def addAmbiguityResolutionML(
nMeasurementsMin=config.nMeasurementsMin,
),
)
s.addAlgorithm(alg)

algGreedy = GreedyAmbiguityResolutionAlgorithm(
level=customLogLevel(),
inputTracks=algML.config.outputTracks,
outputTracks="filteredTrajectoriesMLGreedy",
**acts.examples.defaultKWArgs(
maximumSharedHits=config.maximumSharedHits,
nMeasurementsMin=config.nMeasurementsMin,
maximumIterations=config.maximumIterations,
),
)

s.addAlgorithm(algML)
s.addAlgorithm(algGreedy)

trackConverter = acts.examples.TracksToTrajectories(
level=customLogLevel(),
inputTracks=alg.config.outputTracks,
inputTracks=algGreedy.config.outputTracks,
outputTrajectories="trajectories-from-solved-tracks",
)
s.addAlgorithm(trackConverter)
Expand Down
8 changes: 4 additions & 4 deletions Examples/Python/tests/root_file_hashes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ test_digitization_example_input[smeared]__particles.root: 8549ba6e20338004ab8ba2
test_digitization_example_input[smeared]__measurements.root: df0e31749f64f52b7917e44c47fa1eda9e72ef53c44c0e09f3c75b7143b99d24
test_digitization_example_input[geometric]__particles.root: 8549ba6e20338004ab8ba299fc65e1ee5071985b46df8f77f887cb6fef56a8ec
test_digitization_example_input[geometric]__measurements.root: b4dba5bb5e60d4540c1d07fb297b2add19d779dfcd29737c8d44f208ff0c0522
test_ckf_tracks_example[generic-full_seeding]__trackstates_ckf.root: edf31a6280aa32b730b98d6867673e1bb33fa02838e8382f6bc68144ff5cfe5f
test_ckf_tracks_example[generic-full_seeding]__tracksummary_ckf.root: 975ce66c4607740661fbca038e69a1800dd2db9135fd893ec0dba706d34f5be2
test_ckf_tracks_example[generic-full_seeding]__trackstates_ckf.root: 9ddce4640414208c7cee1c5700c53e5529c14be7c29b7795ad5371693e0d47a3
test_ckf_tracks_example[generic-full_seeding]__tracksummary_ckf.root: 997ee4e49bfa0fb295fc26dcd2b92aab0ff8455510d517e3fd6c2501a26c8594
test_ckf_tracks_example[generic-full_seeding]__performance_seeding_trees.root: 0e0676ffafdb27112fbda50d1cf627859fa745760f98073261dcf6db3f2f991e
test_ckf_tracks_example[generic-truth_estimated]__trackstates_ckf.root: 94e208a458d4a45211a57290fc54313ae5d5e420b8ec514cca82e500f4320b7e
test_ckf_tracks_example[generic-truth_estimated]__tracksummary_ckf.root: 38ea5737418a1eb98f4cef4731ccdbb4ed009432d04c1fd42e176515bbafb897
test_ckf_tracks_example[generic-truth_estimated]__performance_seeding.root: 1facb05c066221f6361b61f015cdf0918e94d9f3fce2269ec7b6a4dffeb2bc7e
test_ckf_tracks_example[generic-truth_smeared]__trackstates_ckf.root: aae5f59b5bcf45558d8f12d204e34cf3d9ed4b8ca35278b688e5d99906b7670e
test_ckf_tracks_example[generic-truth_smeared]__tracksummary_ckf.root: ef3ce4ff96553f56866245353dfca17f9be93636c0b05bcc885e268b1bec1409
test_ckf_tracks_example[odd-full_seeding]__trackstates_ckf.root: ddd7ec1c7161f8daf8d3d00ceb14c39cbf8750e89c72d4c2fd0429e036f8ea9e
test_ckf_tracks_example[odd-full_seeding]__tracksummary_ckf.root: b9b563a319dc7f607c5668174129ed6e4465ba1897e54fbf0403b0ee93ac1492
test_ckf_tracks_example[odd-full_seeding]__trackstates_ckf.root: 6810c2aed6c70645c8a3188e3f4e24d2f567aa56c1dd7766df64683c2a093c6c
test_ckf_tracks_example[odd-full_seeding]__tracksummary_ckf.root: 86b980c3c22eefce44f514a8b817f251d535cb7992497777e1a4dcdb45b64d34
test_ckf_tracks_example[odd-full_seeding]__performance_seeding_trees.root: 43c58577aafe07645e5660c4f43904efadf91d8cda45c5c04c248bbe0f59814f
test_ckf_tracks_example[odd-truth_estimated]__trackstates_ckf.root: a86c6e6600dd31657092b6fd652c695f6281ffe03d83ef37a5ede704d0e0133b
test_ckf_tracks_example[odd-truth_estimated]__tracksummary_ckf.root: 1b28452dab3771b5668d77689d41addabb689fa836c9a9794473257620bf2226
Expand Down
8 changes: 5 additions & 3 deletions Examples/Scripts/Python/full_chain_odd.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
mean=acts.Vector4(0, 0, 0, 0),
stddev=acts.Vector4(0.0125 * u.mm, 0.0125 * u.mm, 55.5 * u.mm, 1.0 * u.ns),
),
multiplicity=50,
multiplicity=200,
rnd=rnd,
)
else:
Expand Down Expand Up @@ -181,7 +181,9 @@
if ambiguity_MLSolver:
addAmbiguityResolutionML(
s,
AmbiguityResolutionMLConfig(nMeasurementsMin=7),
AmbiguityResolutionMLConfig(
maximumSharedHits=3, maximumIterations=1000000, nMeasurementsMin=7
),
outputDirRoot=outputDir,
# outputDirCsv=outputDir,
onnxModelFile=os.path.dirname(__file__)
Expand All @@ -191,7 +193,7 @@
addAmbiguityResolution(
s,
AmbiguityResolutionConfig(
maximumSharedHits=3, maximumIterations=10000, nMeasurementsMin=7
maximumSharedHits=3, maximumIterations=1000000, nMeasurementsMin=7
),
outputDirRoot=outputDir,
# outputDirCsv=outputDir,
Expand Down

0 comments on commit 109fb7d

Please sign in to comment.