Skip to content

Extend functionality for finding overlapping tracks and printing KalSeeds - #1903

Merged
oksuzian merged 6 commits into
Mu2e:mainfrom
brownd1978:dups
Jul 31, 2026
Merged

Extend functionality for finding overlapping tracks and printing KalSeeds#1903
oksuzian merged 6 commits into
Mu2e:mainfrom
brownd1978:dups

Conversation

@brownd1978

Copy link
Copy Markdown
Collaborator

Add the ability to search for overlapping (ie duplicate) tracks in the same list to SelectSameTracks.
Add the ability to print KalSeedPtr collections to KalSeedPrinter.
This PR sits on top of PRs 1900 and 1899.

@FNALbuild

Copy link
Copy Markdown
Collaborator

Hi @brownd1978,
You have proposed changes to files in these packages:

  • KinKalGeom
  • Mu2eKinKal
  • DataProducts
  • TrkReco
  • Validation
  • Print

which require these tests: build.

@Mu2e/write, @Mu2e/fnalbuild-users have access to CI actions on main.

⌛ The following tests have been triggered for abd0b6d: build (Build queue - API unavailable)

About FNALbuild. Code review on Mu2e/Offline.

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at abd0b6d.

Test Result Details
test with Command did not list any other PRs to include
merge Merged abd0b6d at fc0f20b
build (prof) Log file. Build time: 04 min 20 sec
ceSimReco Log file.
g4test_03MT Log file.
transportOnly Log file.
POT Log file.
g4study Log file.
cosmicSimReco Log file.
cosmicOffSpill Log file.
ceSteps Log file.
ceDigi Log file.
muDauSteps Log file.
ceMix Log file.
rootOverlaps Log file.
g4surfaceCheck Log file.
trigger Log file. Return Code 1.
check_cmake Log file.
FIXME, TODO ➡️ TODO (22) FIXME (5) in 15 files
clang-tidy ➡️ 14 errors 253 warnings
whitespace check no whitespace errors found

N.B. These results were obtained from a build of this Pull Request at abd0b6d after being merged into the base branch at fc0f20b.

For more information, please check the job page here.
Build artifacts are deleted after 5 days. If this is not desired, select Keep this build forever on the job page.

@brownd1978
brownd1978 requested a review from rlcee July 27, 2026 20:18
@brownd1978

Copy link
Copy Markdown
Collaborator Author

Hi @michaelmackenzie now that PR 1900 is merged this PR should be reviewable.

@michaelmackenzie michaelmackenzie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me

@michaelmackenzie

Copy link
Copy Markdown
Contributor

@FNALbuild run build test

@FNALbuild

Copy link
Copy Markdown
Collaborator

⌛ The following tests have been triggered for 87a86ef: build (Build queue - API unavailable)

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at 87a86ef.

Test Result Details
test with Command did not list any other PRs to include
merge Merged 87a86ef at c961ce4
build (prof) Log file. Build time: 08 min 49 sec
ceSimReco Log file.
g4test_03MT Log file.
transportOnly Log file.
POT Log file.
g4study Log file.
cosmicSimReco Log file.
cosmicOffSpill Log file.
ceSteps Log file.
ceDigi Log file.
muDauSteps Log file.
ceMix Log file.
rootOverlaps Log file.
g4surfaceCheck Log file.
trigger Log file.
check_cmake Log file.
FIXME, TODO TODO (0) FIXME (0) in 5 files
clang-tidy ➡️ 6 errors 34 warnings
whitespace check no whitespace errors found

N.B. These results were obtained from a build of this Pull Request at 87a86ef after being merged into the base branch at c961ce4.

For more information, please check the job page here.
Build artifacts are deleted after 5 days. If this is not desired, select Keep this build forever on the job page.

@oksuzian

Copy link
Copy Markdown
Collaborator

1. [S2 — confirm intent] Same-list duplicate search double-counts every pair.
In samelist_ mode the loop skips only the diagonal (if(samelist_ && isec == ipri) continue;), not the lower triangle. So a duplicate pair (A,B) is found twice — once as ipri=A → sec=B (emits A,B) and once as ipri=B → sec=A (emits B,A) — so the output
KalSeedPtrCollection contains A and B each twice, and nref_ counts the pair twice. For a duplicate-finder that's probably not what you want (the "found N overlapping tracks" summary is then 2× the number of pairs). If each unordered pair should be reported once, skip
isec <= ipri instead of isec == ipri. If double-listing both members is intentional, a one-line comment (and a note on the doubled count) would clarify it.

2. [S3] KalSeedPrinter::ptrcol_ is uninitialized in the default constructor.
KalSeedPrinter() {} leaves bool ptrcol_; indeterminate; a default-constructed instance whose Print(event) runs would branch on garbage (UB). Only the KSConfig ctor is used today (PrintModule is the sole construction site), so it's latent — but give it an in-class
initializer: bool ptrcol_ = false;. Also ptrcol_ is a public data member; per convention it should be private (with an accessor if needed).

3. [S3] nmultref_ is declared and printed but never incremented.
The endJob line reports "… with nmultref_ multiple matchess", but nothing does ++nmultref_ — so that figure is always 0. Presumably it should increment inside if(matches.size() > 1).

4. [S3] endJob output: typos + unguarded print.
"overlaping" → "overlapping", "matchess" → "matches". The summary goes to std::cout unconditionally; a single per-job line is common, but strictly, production prints should be gated by a verbosity flag or use the message facility.

5. [S3 — confirm] The ComparisonDirection: "Unknown" ("test all") path may not do what the comment says.
The direction test is priinter.momentum3().Z() * compdir_.dzdt() > 0.0. If dzdt() is 0 for the unknown/mixed direction, that rejects every intersection, so "Unknown means test all" would actually match nothing. The shipped prolog uses "Downstream", so it's latent —
please confirm the Unknown path behaves as documented, and that "Downstream"/"TT_Front" are the exact accepted spellings (a mismatch would only surface at runtime, which CI doesn't cover here).

@FNALbuild

Copy link
Copy Markdown
Collaborator

📝 The HEAD of main has changed to f96d9fc. Tests are now out of date.

@oksuzian

Copy link
Copy Markdown
Collaborator

@FNALbuild run build test

@FNALbuild

Copy link
Copy Markdown
Collaborator

⌛ The following tests have been triggered for 87a86ef: build (Build queue - API unavailable)

@FNALbuild

Copy link
Copy Markdown
Collaborator

☔ The build tests failed for 87a86ef.

Test Result Details
test with Command did not list any other PRs to include
merge Merged 87a86ef at f96d9fc
build (prof) Log file. Build time: 08 min 47 sec
ceSimReco Log file. Return Code 9.
g4test_03MT Log file.
transportOnly Log file.
POT Log file.
g4study Log file.
cosmicSimReco Log file.
cosmicOffSpill Log file. Return Code 9.
ceSteps Log file.
ceDigi Log file. Return Code 9.
muDauSteps Log file.
ceMix Log file. Return Code 9.
rootOverlaps Log file.
g4surfaceCheck Log file.
trigger Log file.
check_cmake Log file.
FIXME, TODO TODO (0) FIXME (0) in 5 files
clang-tidy ➡️ 6 errors 34 warnings
whitespace check no whitespace errors found

N.B. These results were obtained from a build of this Pull Request at 87a86ef after being merged into the base branch at f96d9fc.

For more information, please check the job page here.
Build artifacts are deleted after 5 days. If this is not desired, select Keep this build forever on the job page.

@oksuzian

Copy link
Copy Markdown
Collaborator

@FNALbuild run build test

@FNALbuild

Copy link
Copy Markdown
Collaborator

⌛ The following tests have been triggered for c8dff7e: build (Build queue - API unavailable)

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at c8dff7e.

Test Result Details
test with Command did not list any other PRs to include
merge Merged c8dff7e at f96d9fc
build (prof) Log file. Build time: 04 min 19 sec
ceSimReco Log file.
g4test_03MT Log file.
transportOnly Log file.
POT Log file.
g4study Log file.
cosmicSimReco Log file.
cosmicOffSpill Log file.
ceSteps Log file.
ceDigi Log file.
muDauSteps Log file.
ceMix Log file.
rootOverlaps Log file.
g4surfaceCheck Log file.
trigger Log file.
check_cmake Log file.
FIXME, TODO TODO (0) FIXME (0) in 5 files
clang-tidy ➡️ 6 errors 34 warnings
whitespace check no whitespace errors found

N.B. These results were obtained from a build of this Pull Request at c8dff7e after being merged into the base branch at f96d9fc.

For more information, please check the job page here.
Build artifacts are deleted after 5 days. If this is not desired, select Keep this build forever on the job page.

@brownd1978

Copy link
Copy Markdown
Collaborator Author

1. [S2 — confirm intent] Same-list duplicate search double-counts every pair.
fixed
2. [S3] KalSeedPrinter::ptrcol_ is uninitialized in the default constructor. fixed **3. [S3]nmultref_is declared and printed but never incremented.** fixed **4. [S3]endJoboutput: typos + unguarded print.** fixed **5. [S3 — confirm] TheComparisonDirection: "Unknown"` ("test all") path may not do what the comment says.**
fixed

@brownd1978

Copy link
Copy Markdown
Collaborator Author

@FNALbuild run build test

@FNALbuild

Copy link
Copy Markdown
Collaborator

⌛ The following tests have been triggered for ded012f: build (Build queue - API unavailable)

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at ded012f.

Test Result Details
test with Command did not list any other PRs to include
merge Merged ded012f at f96d9fc
build (prof) Log file. Build time: 04 min 20 sec
ceSimReco Log file.
g4test_03MT Log file.
transportOnly Log file.
POT Log file.
g4study Log file.
cosmicSimReco Log file.
cosmicOffSpill Log file.
ceSteps Log file.
ceDigi Log file.
muDauSteps Log file.
ceMix Log file.
rootOverlaps Log file.
g4surfaceCheck Log file.
trigger Log file.
check_cmake Log file.
FIXME, TODO TODO (0) FIXME (0) in 5 files
clang-tidy ➡️ 6 errors 34 warnings
whitespace check no whitespace errors found

N.B. These results were obtained from a build of this Pull Request at ded012f after being merged into the base branch at f96d9fc.

For more information, please check the job page here.
Build artifacts are deleted after 5 days. If this is not desired, select Keep this build forever on the job page.

@oksuzian
oksuzian merged commit afcbaf1 into Mu2e:main Jul 31, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants