Repository navigation
Add a projection of the spatial covariance to Intersection. - #239
brownd1978 wants to merge 7 commits into
Conversation
…d. Address KFTrack#237 in the process. Code by Claude
…ar helix and cylinder and frustrum axes. Add a unit test of this situation. Coded by Claude
|
Claude also addressed #238 and the CI failure in the Truncate test on MacOS. |
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #239
Reviewed at head 085d1998f9c09f50ecd8641c07b5a7379ff13f82. First pass. I reviewed the library change at bae8ab3; 085d1998 only changes a test.
Decision
- 🟢 approve. The new crossing-point covariance is right. It agrees to 5e-11 with Offline's independently written stand-in on 26,638 random cases, and the new toy test fails if the old projection is put back. Both issues are fixed. On the random cases from my #235 review, CentralHelix plane queries that return nothing drop from 1,944 to 18 of 19,770 (#237), and long-cylinder misses drop from 1,126 to 88 of 28,083 (#238). Every miss that is left is a stepping limit, not the new window or the new gate. The four findings are S2 and S3 and do not block.
085d1998only rewritesTests/Truncate_unit.cc, so the library code is the same as atbae8ab3and everything below applies to it. I built it and all 31 tests pass. GitHub Actions passed all four jobs at085d1998, macOS included.
Scope understood
Intersectiongainsudir_andvdir_, the U and V directions of the surface's tangent plane, andpcov_, the covariance (mm²) in U,V of where the trajectory crosses that plane.fillPlaneCovariancefills them for every on-surface result ofstepIntersectand of the KinematicLine intersection.planeCovariance(time,plane)in all three trajectories now projects along the particle direction,u - n (u·d)/(n·d). That gives the covariance of the crossing point instead of the plain projection at a fixed time.CentralHelix::axisis new.hpIntersectnow builds its search window from the helix axis for both helices (#237). For cylinders and frustums,canIntersectnow tests the larger end separation and allows for the field tilt (#238).- Two new tests:
IntersectionCovariance(toy MC) andIntersectTilt(random queries compared with stepping over the whole range).
Findings
- 🟡 [S2] The covariance is also computed for internal searches that only need a time, which makes cylinder intersections about 25% slower.
- Evidence:
fillPlaneCovarianceruns at the end of every convergedstepIntersect(Geometry/Intersect.hh:113). That includes the end-disk searches inhcIntersect(:192-193) andhfIntersect(:286-287), which use onlytime_. I timedintersecton my #235 cases (median ns per call, three alternating rounds,-O3). Cylinders: 2,885–3,135 onmain, 3,729–3,886 here, and 3,087–3,120 here with onlyfillPlaneCovarianceemptied. Planes: 1,706–1,789 onmain, 1,756–1,839 here, and 1,372–1,483 without the fill. - Suggested fix: fill the covariance once, in the public
intersectfunctions, on the result returned to the caller. I did not measure the effect on Mu2e reconstruction time.
- Evidence:
- 🟡 [S2] In Offline, intersections that Offline builds itself will be stored with
pcov_= 0.- Evidence: the comment at
Intersection.hh:25sayspcov_is filled for all on-surface intersections. Offline'sExtrapolateSweepfillsKinKal::Intersectionfield by field atMu2eKinKal/inc/ExtrapolateSweep.hh:273,:365and:406. The first of those handles every plane target: the ST foils, passive planes, calorimeter layers and calorimeter support front.KKFit.hh:1018then writes these into theKalSeed. Cylinder crossings come fromKinKal::intersectand will be filled. A zero matrix is then the only sign that the covariance is missing, and zero also means "parallel to the plane" or "no fit covariance". - Suggested fix: say in the
Intersection.hhcomment thatpcov_is zero when it is not computed. When Offline takes this tag, callKinKal::fillPlaneCovarianceat those three places.
- Evidence: the comment at
- ⚪ [S3] Two test details in
Tests/IntersectionCovariance_unit.cc.- Line 163 gives KinematicLine the errors
{0.1,0.1,0.0005,0.0005,0.005,0.05}, but its parameter order is d0, phi0, z0, theta, t0, mom (KinematicLine.hh:23-31). So phi0 gets 0.1 rad and z0 gets 0.0005 mm, which looks like positions and angles swapped. The 0.1 rad error dominates, and the two KinematicLine plane cases pass with the old projection too. The cylinder case still catches it. - The check against
planeCovariance(:72-82) repeats the same callfillPlaneCovariancemakes, so it cannot fail.
- Line 163 gives KinematicLine the errors
- ⚪ [S3] The new
planeCovariancecomment (LoopHelix.cc:139,CentralHelix.cc:170,KinematicLine.cc:138) says the result "includes the effect of the t0 (and other) errors on the position along the trajectory".- With this projection, a t0 error only moves the point along the trajectory, so it drops out exactly (
LoopHelix.cc:356:dX_dt0 = -omval*mdir, along the motion). "Errors that only move the point along the trajectory, such as t0, drop out" would say it. - The
1.0e-10parallel cut is written four times (Intersect.hh:31and the threeplaneCovariancefunctions).fillPlaneCovarianceavoids the throw only while they agree, so one named constant would keep them together.
- With this projection, a t0 error only moves the point along the trajectory, so it drops out exactly (
Checked, no action needed
- 🟢 The projection is right. A change dx in position moves the crossing by dx − d (n·dx)/(n·d), which is what
uprojandvprojcompute. I checked it three ways.- Offline's stand-in
trkCrvPlaneCovariance(CRVReco/inc/TrkCrvPlaneError.hh:31) was written independently and uses the same projector, applied to the Cartesian state covariance. I compared it withpcov_on 26,638 random cases: full correlated parameter covariances, fields tilted up to 0.3 rad, random planes for all three trajectories, and cylinder tangent planes for LoopHelix. The largest difference is 4.6e-11 of sqrt(uu·vv). - With the old
planeCovariancerestored in the three.ccfiles,IntersectionCovariancefails 6 of its 8 cases. For example, LoopHelix on the plane gives 98.7 mm² where the toy gives 1.00 mm². At this head it also passes with 20 other seeds. - No caller depends on the old meaning. The only KinKal caller,
Tests/Trajectory.hh:332, uses a plane normal to the momentum, where the two projections agree. GitHub code search finds no caller in any Mu2e repository.
- Offline's stand-in
- 🟢 #237 is fixed.
CentralHelix::center(t)has the same coordinate along the field asposition3(t)(CentralHelix.cc:487and:205). So the newaxisis the true helix axis, and theR·tanθwindow holds every crossing. LoopHelix is unchanged, because itslinearizealready returnedaxis.- On my #235 cases, CentralHelix planes return nothing for 1,944 of 19,770 queries on
mainand for 18 here. The 1,930 of 19,887 quoted in #237 came from my earlier count; 19,887 is the LoopHelix total. All 18 that remain go less thantolpast the plane. - The tests cover it: with only this change undone,
IntersectTiltandIntersectionCovarianceboth fail.
- 🟢 #238 is fixed, and the new
canIntersectnever rejects a range the old one passed.- The old cylinder test needed both ends unnested; the new one needs either end. Its cut,
rbend*cos(tilt) − R, is never larger than the old|R − rbend|. The same holds for the frustum. - The bounds are right. The helix centre moves linearly along the field, so its distance from the axis is convex in time and largest at an end. The tilted circle projects to an ellipse whose minor axis is
rbend*cos(tilt), and it spans±rbend*sin(tilt)along the axis. - Brute force on 166,910 random queries (both helices, cylinders and frustums along z, field tilted up to 0.45 rad, 0.5 to 2 T): there are 91,423 ranges where the helix goes more than
tolpast the surface on both sides. The old test rejects 22,516 of them and the new one rejects none. - On my #235 cases, long-cylinder queries that return nothing drop from 1,126 to 88 of 28,083. The old test caused 1,049 of the 1,126, all with a tilted field (median 163 mrad, minimum 1.2 mrad). All 88 that remain pass the new test, and stepping over the whole query misses them too. 78 go less than
tolpast the surface. The other 10 go 1.1 to 9.6toldeep, and six of those are cylinders of 7 to 26 mm radius. In all of them both crossings fall inside one step.
- The old cylinder test needed both ends unnested; the new one needs either end. Its cut,
- 🟢 The frustum change also fixes cones with no field tilt, where the nesting changes along the axis.
IntersectTiltrun againstmainmisses 99 of 265 and 17 of 40 crossings at zero tilt. On my #235 frustum cases, misses drop from 1,283 to 39 of 14,383. Mu2e's OPA is a frustum (GeometryService/src/KinKalGeomMaker.cc:375). - 🟢 What changes for the worse is limited to crossings the stepping is not meant to catch.
- Of the 94,383 cases, 5 that
maingets right are wrong here. All are CentralHelix planes whose crossing goes only 0.24 to 0.58tolpast the plane, and the new window steps over it. - Four queries that returned nothing now return a later root. Three are crossings shallower than
tol. The fourth is a 1 mm cut through a cylinder attol= 0.1 mm, with both crossings inside one 11 mm step. - The 10 new results on finite surfaces with no in-bounds crossing are out-of-bounds crossings, correctly flagged with
inbounds_false.
- Of the 94,383 cases, 5 that
- 🟢 The other tests are unchanged. Every other test binary prints the same output in both builds, apart from paths and fit times. The one exception is a CentralHelix time in
IntersectReturn, which moves by 7e-13 ns and now equals the expected value. - 🟢 Offline can read old files, and old code can read new ones.
RecoDataProducts/src/classes_def.xml:225declaresKinKal::Intersectionwith no ClassVersion. ROOT therefore versions it by checksum, and no version bump is needed.- I built genreflex dictionaries with that selection from the base headers and from the head headers. A file written with either layout reads correctly with the other, split and unsplit, with no warnings. The new members read as zero from old files.
- ROOT's
libSmatrix.rootmapprovides the dictionary for the 2x2 symmetric matrix. - Offline has no aggregate initialisation or structured bindings of
Intersection.
- 🟢 The macOS CI failure at
bae8ab3was not from this PR. It isTruncatefailing with "FAILED: LoopHelix bfcorr inactive hits event 1 effects kept", the same failure as onmainsince #236 merged (906c4ce, 17 November) and at3a6860b.085d1998replaces that count withcheckCut, which is stricter: it requires that exactly the domains beyond the cut and their DomainWalls are removed.
Validation check
- Build/tests run: yes. KinKal standalone, CMake Release, Mu2e envset p111 (GCC 13.3, ROOT 6.38). I built the merge base
3a6860b, this head and085d1998, with no warnings under-Wall -Werror.ctestpasses 29 of 29 at the base, 31 of 31 here and 31 of 31 at085d1998. I also ran each test binary on its own in the base and head builds and compared the outputs. The harness, scripts, cases and logs are under/exp/mu2e/data/users/oksuzian/claude-scratch/kinkal239_review/. - CI: GitHub Actions at
bae8ab3passed Ubuntu Debug and Release and failed macOS Debug and Release, with theTruncatefailure above. At085d1998all four jobs passed. - Sourced numbers: none in the diff.
- Cross-repo consistency: needs a follow-up in Offline when it takes this tag (finding 2). Nothing breaks at compile or read time.
Residual risk
- Not checked: an Offline build against this KinKal and a Mu2e reconstruction job. So I have neither the Mu2e CPU cost of finding 1 nor the number of Mu2e intersections that move. I also did not run a Debug build or a macOS build myself; CI covers both.
- Each persisted
KalIntersectiongrows by 9 doubles (72 bytes before compression). It already stores the full state covariance inpstate_, and the same projection follows from that, which is what the CRV stand-in does. Whether Offline needspcov_on file is worth deciding when it takes the tag. - Thin cylinders cut by much larger helix circles can still be missed by the stepping. That is independent of this PR.
Author follow-ups
- Optional: fill
pcov_only on the result returned to the caller (finding 1). - Note in
Intersection.hhthatpcov_is zero when it is not computed. When Offline takes this tag, fill it in Offline'sExtrapolateSweep(finding 2). - Optional: fix the KinematicLine errors in
IntersectionCovarianceand the comments in finding 4. - The body says the PR "addresses" #237, which GitHub does not treat as a closing keyword, and it does not name #238 or the
Truncatefix. "Fixes #237, fixes #238" in the body would close both issues on merge.
…t. Re-enable that test at Mu2e tracker gradient. Fixed by Claude.
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #239
Reviewed at head 33f4bbdef7b6e819b57180b386ac4f2506557039. Re-review of 085d1998.
Decision
- 🟢 approve. The new commit only changes tests. It fixes the toy MC so the gradient-field fit tests can run again, and turns those tests back on. All four GitHub Actions jobs pass at this head, Ubuntu and macOS, Debug and Release. My four findings from the review at
085d1998(6001853059) are unchanged and still do not block.
Scope understood
33f4bbdechangesTests/ToyMC.hh,Tests/LoopHelixFit_unit.ccandTests/CentralHelixFit_unit.cc. No library code changes.createTrajnow returns the end of the full simulation time, andsimulateParticlespreads the hits over that whole range. In a gradient field the first piece covers only the time the field stays within tolerance. Before, all the hits were packed into that short first piece.createStrawMaterialcovers one step past the crossing when the crossing is at or past the end simulated so far. It now usesappend(newend,true)to drop pieces past the crossing, which were simulated with the old momentum.- The two
*Fit_unittests again run with--Bgrad -0.036, theseedfit.txtschedule and--extend driftextend.txt. They were turned off inb6e53d91(2024-03-14, "the MC is broken").
Findings
- No new findings. Status of the four from the review at
085d1998:- 🟡 [S2] The covariance is filled during internal searches too, so cylinder intersections are about 25% slower: open.
- 🟡 [S2] Offline builds some intersections itself, and those will be stored with
pcov_= 0: open, as an Offline follow-up when it takes the tag. - ⚪ [S3] The KinematicLine errors in
IntersectionCovariance_unit.cc:163look swapped, and the check at:72-82cannot fail: open. - ⚪ [S3] The t0 comment, and the
1.0e-10cut written four times: open.
Checked, no action needed
- 🟢 Uniform-field tests simulate the same events as before.
- In a uniform field,
rangeInTolerancereturns the trajectory's own range (General/BFieldMap.hh:93-94). So the first piece still spans the fulltmax, and the hit times are unchanged. - Each straw crossing there is appended at the last piece, so
append(...,true)removes nothing (Trajectory/PiecewiseTrajectory.hh:158-164). The oldappend(...,false)would have thrown otherwise, and it never did.
- In a uniform field,
- 🟢 In a gradient field the new code is consistent.
extendTrajstops exactly at the hit time (Tests/ToyMC.hh:261), so a straw crossing is at most a little past the simulated end, and the new branch covers that case.append(newend,true)keeps the old end time when it is later (PiecewiseTrajectory.hh:169).
- 🟢 The re-enabled tests can fail.
FitTestexits non-zero when more than 10% of fits fail or diverge (Tests/FitTest.hh:1027-1028), or when the fitted momentum bias or resolution is out of tolerance (:1043-1046). It ends withexit(retval)(:1166), which ctest reads.
Validation check
- Build/tests run: no local build for this commit. GitHub Actions passed all four
Testsjobs at33f4bbde, finishing 02:26:48Z to 02:29:36Z (read 2026-11-21T05:40Z). My earlier local build at085d1998(31 of 31 tests passing) covers the library code, which is unchanged. - Sourced numbers: none in the diff.
-0.036is the existing Mu2e-like gradient the tests used before 2024. - Cross-repo consistency: test-only change. Offline is not affected.
Residual risk
- I did not run the re-enabled gradient tests locally or check how stable they are across seeds. CI runs one seed.
Author follow-ups
- The follow-ups from my review at
085d1998still apply. The two marked optional remain optional.
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #239
Reviewed at head 862cc6f76abbb27063eaf7746357555bb060269d. Re-review of 33f4bbde.
Decision
- 🟢 approve.
862cc6f7makes the covariance projection optional and off by default. That fixes both of my S2 findings: internal searches no longer pay for it, and the newhascov_flag says whetherpcov_was filled. One new S2:fillPlaneCovariancenow relies on the U direction already being set, which matters only for code outside KinKal that builds its own intersections. All four GitHub Actions jobs pass at this head. Nothing here blocks.
Scope understood
fillPlaneFrame(surf,inter)setsudir_andvdir_for every on-surface result ofstepIntersectand of the KinematicLine intersection.fillPlaneCovariance(ktraj,inter)fillspcov_and setshascov_only when asked.- Every public
intersectgainsbool pcov=falseaftertdir. When it is true, the covariance is filled once, on the returned result.ParticleTrajectoryfills it from the piece holding the final intersection. IntersectFlaggainshascov_, which==,!=and the printouts include.- Both tests check that a default call returns the same intersection with no covariance.
Findings
- 🟡 [S2] (new)
fillPlaneCovariancenow takes the plane's U direction frominter.udir_instead of from the surface. An intersection whose frame was never set therefore gets a zero covariance marked as valid.- Evidence:
Geometry/Intersect.hh:40buildsPlane(inter.norm_,inter.udir_,inter.pos_)and setshascov_ = trueat:42. Inside KinKal every on-surface result passesfillPlaneFramefirst (:124,:371), so this is safe there. - An
Intersectionfilled by hand, as Offline'sExtrapolateSweepdoes (Mu2eKinKal/inc/ExtrapolateSweep.hh:273-283,:406-412at0f6b4ad0), hasudir_= 0. ROOT'sUnit()returns a zero vector unchanged (Math/GenVector/DisplacementVector3D.h:337-338, ROOT 6.38), soPlane.cc:6does not throw andvdir_is zero too.planeCovariancethen projects onto zero vectors (LoopHelix.cc:145-146), and the result ispcov_= 0 withhascov_true. - Impact: none inside KinKal. It affects the Offline follow-up I suggested in my first review. Calling
fillPlaneCovarianceat those places would needfillPlaneFrame(surf,inter)first. Without it, the result is silently zero. - Suggested fix: return with
hascov_false whenudir_is zero. Or keep the surface argument and callfillPlaneFrameinside, as the085d1998version did.
- Evidence:
Findings from my earlier reviews
- 🟡 [S2] The covariance was computed for internal searches too: fixed. Only the public
intersectfunctions fill it, on request and on the final result (Intersect.hh:324-351,:372;ParticleTrajectoryIntersect.hh:20,:50). Internal searches set only the frame, from onetangentPlanecall. I did not re-time it. - 🟡 [S2] Offline's hand-built intersections would be stored with
pcov_= 0: fixed on the KinKal side. TheIntersection.hh:25-26comment now says the covariance is filled only on request, andhascov_records whether it was. With the default off, Offline's own intersections and those fromKinKal::intersectnow agree: none carries a covariance unless Offline asks. If Offline wants it, see new finding 1. - ⚪ [S3] Test details in
IntersectionCovariance_unit.cc: half fixed.- The KinematicLine errors still look swapped (
:174). - The check against
planeCovariance(:83-93) can now fail. It compares the plane built frominter.norm_/udir_withsurf.tangentPlane, two separate constructions.
- The KinematicLine errors still look swapped (
- ⚪ [S3] The t0 comment (
LoopHelix.cc:139,CentralHelix.cc:170,KinematicLine.cc:138) and the1.0e-10cut written four times (Intersect.hh:39and the threeplaneCovariancefunctions): open.
Checked, no action needed
- 🟢 The default path is unchanged apart from the covariance.
- The new check in
IntersectionCovariance_unit.cc:61-66requirespcov=falseto give the same flags, time and U and V directions aspcov=true, withhascov_false andpcov_zero. It runs for all eight surface and trajectory cases. ParticleTrajectoryTest.hh:274-287checks that the piecewise version fills nothing unless asked. When asked, it must matchplaneCovarianceon the piece at the crossing.
- The new check in
- 🟢 Source compatible for Offline. The new argument is last and has a default.
fillPlaneCovarianceis new in this PR, so no Offline code calls it yet; Offlinemain0f6b4ad0has no use of it or ofhascov_. - 🟢 Persistence. Offline writes
KinKal::IntersectFlagwith noClassVersion(RecoDataProducts/src/classes_def.xml:224). The newhascov_member is versioned by checksum, the same way as the members my first review tested by reading files back. I did not repeat that read-back test for this layout.
Validation check
- Build/tests run: no local build for this commit. GitHub Actions passed all four
Testsjobs at862cc6f7, finishing 07:08:02Z to 07:13:31Z (read 2026-11-21T08:56Z). I read the diff and the head files through the GitHub API. - Sourced numbers: none in the diff.
- Cross-repo consistency: no Offline change needed to build. Offline wants a change only if it chooses to fill the covariance (new finding 1).
Residual risk
- Not measured at this head: intersection timing, and reading old and new
IntersectFlaglayouts back.
Author follow-ups
…surface bounds to the Intersection payload. Allow out-of-bounds cylinder and frustrum intersections. Ensure hand-built intersections produce the same plane intersections. Code by Claude.
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #239
Reviewed at head d426035c5380ed16e9f7e5202c1e9862e4fe92b5. Re-review of 862cc6f7.
Decision
- 🔴 request changes. Both Debug jobs in GitHub Actions fail at this head. The new
IntersectionBoundstest runs past ctest's 250 s limit on macOS and on Ubuntu. The test is correct and passes when it has time: 622 s in my Debug build. A looser toy tolerance fixes it. At 1e-4 mm it passes in 7.7 s in Release. - The second S1 does not block merging KinKal.
intersectnow returns out-of-bounds crossings for finite cylinder and frustum searches that find no in-bounds crossing. Offline'sKKShellXingtakes any on-surface, in-range crossing as the new material crossing. In a reproduction with Mu2e-like tracks, this switches the material off where862cc6f7returned nothing and Offline went on to search the next piece. I could not measure how often this happens in Mu2e reconstruction. Offline needs a small change before it takes this tag. - The rest checks out. The hand-built intersection problem from my last review is fixed and tested. The in-bounds fraction is computed correctly, and its test fails when the integral is broken. Old and new files read back.
Scope understood
fillPlaneCovariance(ktraj,surf,inter,tol)now rebuilds the normal and the U and V directions fromsurf.tangentPlane(inter.pos_)(Geometry/Intersect.hh:126-129). It then fillsinbfrac_, the fraction of the projected Gaussian that falls inside the surface bounds (:135).- The cylinder and frustum searches now share
hbIntersect(:275-306). If the search restricted to the surface's length finds no in-bounds crossing, it returns the first crossing over the whole range (:305), usually out of bounds. Before, it returned nothing. gap_moves fromIntersectiontoIntersectFlag, andIntersectiongainsinbfrac_.- A new test,
IntersectionBounds, comparesinbfrac_with a toy MC and with exact results for 60 surface and trajectory cases.
Findings
- 🟠 [S1] (new) Both Debug CI jobs fail. The new
IntersectionBoundstest runs past the 250 s ctest limit.- Evidence: run 44937146321. macOS Debug:
29/32 Test #29: IntersectionBounds ...............***Timeout 250.02 sec. Ubuntu Debug: the same line at250.10 sec. All 31 other tests pass in both jobs. The limit isTests/CMakeLists.txt:59. In Release the test takes 50.50 s (macOS) and 67.33 s (Ubuntu). The next slowest intersection test takes 5.93 to 8.06 s. - Not flaky, and caused by this commit. The test is new, and all four jobs passed at
862cc6f7(run 44878594310). Locally the Debug ctest times out the same way at 250.10 s. Run alone with no limit, the Debug test takes 622 s and passes. Release passes with the default seed and with seeds 1 to 5. - Cause: the toy loop. With
--ntoy 0the test runs in 0.12 s. The default is 20,000 toys for each of 60 cases (:204), so 1.2 millionintersectcalls attol = 1.0e-6mm (:45). That tolerance limits the helix step to about 0.04 mm, so each toy call takes about 56 µs. - Suggested fix: use a looser tolerance for the toy intersections. I tried only changing
:45. At 1e-4 mm the test passes in 7.7 s in Release, and at 1e-3 mm in 3.4 s. The projected errors in the test are 0.38 to 1.16 mm, so this does not change what the test measures. Raising the timeout would also work, but every Debug run would then spend about 10 minutes on this test.
- Evidence: run 44937146321. macOS Debug:
- 🟠 [S1] (new) Out-of-bounds cylinder crossings now reach an Offline caller that adopts them:
KKShellXing::updateReference.-
Evidence (Offline
main0f6b4ad0): when a crossing's piece changes,Mu2eKinKal/inc/KKShellXing.hh:88searches the whole piece.:91and:97accept the result ononsurface_ && inrange_with noinbounds_check. Only when nothing is found does:93search ±1 ns over the full trajectory, which returns onlygood()crossings when the window spans more than one piece (ParticleTrajectoryIntersect.hh:48).updateStatethen needsgood()(KKShellXing.hh:107). So an adopted out-of-bounds crossing switches the material off, and later searches start from that crossing's time. -
When it is reached: the drift fit sets
AddCaloMaterial : true(Mu2eKinKal/fcl/prolog.fcl:505). That puts the calorimeter inner-support cylinder crossings into the fit (KKFit.hh:457-477), and every refit re-references them (KinKalFit/Track.hh:402,:637). An active material crossing starts a new piece at its own time (KinKalFit/Material.hh:75-90). So it sits on a piece boundary, which is the case the comment atKKShellXing.hh:89-90describes. IPA crossings come from the drift-fit extrapolation withMaxDtStep : 1.0ns (prolog.fcl:385). Pieces that short are not affected (below). -
Reproduction: I ran the
:88search on the piece just after or just before an in-bounds crossing, with the crossing 0.02 ns outside the piece. The tracks are conversion-electron-like (95 to 105 MeV, cos θ 0.45 to 0.70, starting in the target region, 1 T along z, t0 = 500 ns).surface (searches) piece adopted at 862cc6f7adopted here IPA, r 300 mm, z −3270 to −2270 (13,780) 1 or 2 ns 0 0 5 ns 37 (0.27%) 5,273 (38.3%) 10 ns 38 (0.28%) 5,382 (39.1%) ring-like, r 350 mm, 200 mm long (2,084) 1 or 2 ns 0 0 5 or 10 ns 0 1,462 (70.2%) In those cases
862cc6f7returns nothing, soKKShellXinggoes on to search the neighbouring piece. The IPA geometry is fromGeometryService/src/KinKalGeomMaker.cc:372. The ring stands in for the calorimeter inner support; I did not take its exact size from the geometry. -
Impact: for an affected track, the energy loss in the calorimeter inner-support ring is dropped from the fit. I did not measure how long the fit pieces are near the calorimeter, so I do not know how often this happens. Merging KinKal does not change Offline until Offline takes the new tag.
-
Suggested fix: either keep the old empty result unless the caller asks for out-of-bounds crossings, or ask that Offline check
inbounds_atKKShellXing.hh:91,:94and:97before it takes this tag. A short-range search could already return out-of-bounds crossings before this commit, so the Offline check is worth adding either way.
-
- ⚪ [S3] (new; the code is older)
Intersect.hh:291-292uses an end-disk crossing time without checkingonsurface_. A failed search leavestime_at 0, which passestrange.inRangewhenever the query spans t = 0. For one helix,862cc6f7returns an out-of-bounds crossing (t 1.190 ns, z −3878 mm) for the query [−0.05, 4.95] ns, but nothing once the same helix is shifted to t0 = 500 ns. Mu2e times are far from 0, but KinKal's unit tests use ranges around 0. Checkingfrontinter.onsurface_andbackinter.onsurface_there fixes it.
Findings from my earlier reviews
- 🟢 [was S2] A hand-built
Intersection(U direction zero, as in Offline'sExtrapolateSweep.hh:273-283and:406-412) gotpcov_= 0 withhascov_true: fixed ind426035c, verified.fillPlaneCovariancenow takes the frame from the surface (Intersect.hh:126-129).IntersectionBounds_unit.cc:61-77builds an intersection from position, time and flags only. It requires the same normal, U and V directions,pcov_andinbfrac_asintersect(...,pcov=true)to 1e-9, in all 60 cases. The signature now takes the surface and tolerance. Nothing in Offline calls it yet. - ⚪ [S3] KinematicLine errors in
IntersectionCovariance_unit.cc: still open, carried over.:174still gives{0.1,0.1,0.0005,0.0005,0.005,0.05}. The new test has the right order for d0, phi0, z0, theta, t0, mom (IntersectionBounds_unit.cc:230). - ⚪ [S3] The t0 comment and the
1.0e-10cut: still open, carried over. The comment is atLoopHelix.cc:139,CentralHelix.cc:170andKinematicLine.cc:138. The cut is atIntersect.hh:131,LoopHelix.cc:143,CentralHelix.cc:174andKinematicLine.cc:142.
- My first two findings stay fixed. The covariance is filled only on request (
Intersect.hh:386-411,:433;ParticleTrajectoryIntersect.hh:50).
Checked, no action needed
- 🟢 What changes in
intersect. I ran my #235 cases with brute-force truth at862cc6f7and at this head.862cc6f7gives the same results asbae8ab3on all 94,383. Here 792 change, all on bounded cylinders and frustums (26,643 cases). Planes (39,657) and long cylinders (28,083) do not change.- 695 return an out-of-bounds crossing where
862cc6f7returned nothing. In 692 of them it is the first crossing that brute-force stepping finds. In 8 of the 695 the truth also has an in-bounds crossing, which both versions miss. - 74 return a different out-of-bounds crossing. In 44 it is an earlier crossing, 130 to 3,316 mm earlier along the path. In 30 it is the same crossing, moved by less than the tolerance.
- 11 now find an in-bounds crossing that
862cc6f7missed, each matching the truth. 5 find one just past the end of the query, flaggedinrange_false. - 7 frustum results move by 1.5e-9 to 6.6e-7 mm. The frustum end-disk searches now use
tdir. - No in-bounds result that
862cc6f7returned is lost or replaced.
- 695 return an out-of-bounds crossing where
- 🟢 The other Offline callers are safe.
CaloMaterialLayers.hh:60,:66,:75,KKFit.hh:449andKKExtrap.hh:107requiregood().ExtrapolateSweep.hh:430checksinbounds_itself and steps past out-of-bounds roots (at most 256 per target, piece and window,:148). Sampling withKKFit.hh:1056requiresinbounds_by default (prolog.fcl:38). The cosmic fits setSampleInBounds : false(prolog.fcl:454,:471) and accept out-of-bounds samples by design. KinematicLine searches do not change. EventNtuplemaina8e216fbhas nointersectcalls. - 🟢 The
inbfrac_integral is right. The Cholesky factor, the whitened rays and the radial massexp(−r1²/2) − exp(−r2²/2)integrated over angle and divided by 2π give the probability inside the bounds.- I compared
boundsFractionwith a direct 2D Monte Carlo of 2 million points in the tangent plane. Corners with correlation 0.9 and −0.95, a four-edge rectangle, an annulus hole and a cylinder end agree within 0.0015. A strip 0.1σ wide gives 0.0274 against 0.0351, which is the limit the comment atIntersect.hh:47-48states. - It is computed only when the covariance is requested. One call costs 18 to 141 µs, against about 3 µs for a cylinder
intersect.
- I compared
- 🟢 The new test catches a wrong integral. It fails if the toy (
:100) or the exact result (:104) disagrees. I broke the integral twice. Dropping the U-V correlation fails 8 of the 60 cases, the corner cases among them. Using the wrong Gaussian width fails 45. - 🟢 The default path costs a little more on bounded surfaces. Median ns per call without the covariance, three alternating rounds on one pinned core,
-O3: planes 1,331 to 1,417 at862cc6f7and 1,332 to 1,440 here. Finite cylinders 2,920 to 2,938 and 3,350 to 3,367 (+15%). Frustums 3,046 to 3,061 and 3,246 to 3,268 (+7%). All cylinders together +4%. The extra time is the second, full-range search when no in-bounds crossing is found. - 🟢 Old and new files read back. Offline writes
KinKal::IntersectFlagandKinKal::Intersectionwith noClassVersion(RecoDataProducts/src/classes_def.xml:224-225). I built genreflex dictionaries with that selection from the3a6860bheaders and from this head. Files written with either layout read with the other, split and unsplit, with no warnings. New code readsgap_correctly from old files. Old code reading new files getsgap_false. Nothing in KinKal or Offline setsgap_today, but EventNtuple copies it into the ntuple (InfoStructHelper.cc:138).IntersectFlag::operator==does not comparegap_.
Validation check
- Build/tests run: yes. KinKal standalone, CMake, Mu2e envset p111 (GCC 13.3, ROOT 6.38), built with no warnings.
- Release at this head: ctest 32 of 32 pass,
IntersectionBounds67.33 s. - Release at
862cc6f7: 31 of 31 pass. - Debug at this head: 31 of 32 pass, and
IntersectionBoundstimes out at 250.10 s. Run alone it passes in 622 s.
- Release at this head: ctest 32 of 32 pass,
- CI: GitHub Actions run 44937146321 at this head, read at 19:22Z. Release passes on macOS and Ubuntu. Debug fails on both (finding 1), finishing at 18:53:20Z and 18:55:19Z.
- Sourced numbers: none in the diff.
- Cross-repo consistency: Offline builds unchanged. Offline needs a follow-up before it takes this tag (finding 2).
Residual risk
- Not run: an Offline build and a Mu2e reconstruction job against this KinKal.
IntersectionandIntersectFlagchange layout, so that needs a full Offline rebuild. Without it I do not know how often finding 2 happens, or how many Mu2e intersections change. - The reproduction for finding 2 uses Mu2e-like tracks and surfaces, not Mu2e fit trajectories.
Author follow-ups
- Make
IntersectionBoundsfit the Debug time limit, for example with a looser toy tolerance (finding 1). - Decide whether out-of-bounds results should need an opt-in, or ask Offline to check
inbounds_inKKShellXing::updateReferencebefore it takes this tag (finding 2). - Optional: check
onsurface_on the end-disk searches (finding 3), and the test and comment items carried over. - As before, "Fixes #237, fixes #238" in the body would close both issues on merge.
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #239
Reviewed at head cb8107dc3571abe8edc2cf06d142c87a0dff2f45. Re-review of d426035c.
Decision
- 🟡 comment. Dave, thanks for "Small fixes". The Debug CI timeout is fixed, and so are the three small items. All four CI jobs pass at this head.
- One item from my last review is still open, and I can now measure it. Out-of-bounds cylinder crossings still reach Offline's
KKShellXing. In 2,000 Mu2e reconstruction events, this PR drops the calorimeter disk-1 inner-ring material from 5 tracks. Two simple Offline patches did not fix it. Merging KinKal alone changes nothing in Offline, so I would not hold the merge. But Offline should not take a tag with this PR until this is fixed, here or in Offline (finding 1). Offline#2204 does not change it. - The new early return in
Material::extrapolateis safe. It changes nothing in Offlinemain:d426035cand this head give identical reconstruction output. Offline#2204 depends on it. - Merge order: KinKal#239, then a KinKal tag and an envset that carries it, then Offline#2204. Finding 1 needs a fix before that tag reaches Offline.
Scope understood
- The increment since
d426035cis one commit, "Small fixes", 9 files. Material::extrapolatereturns early for an inactive crossing (Fit/Material.hh:106-108). It no longer splits the trajectory for a crossing that has no material effect.- The toy tolerance in
IntersectionBoundsgoes from 1e-6 mm to 1e-3 mm (Tests/IntersectionBounds_unit.cc:45). - The end-disk searches now check
onsurface_(Geometry/Intersect.hh:293-294). - The
1.0e-10cut becomes adirtolargument.fillPlaneCovariancekeeps 1e-10 as its default (Intersect.hh:122).planeCovariance(time,plane,dirtol)has no default in all three trajectories (LoopHelix.hh:84,CentralHelix.hh:78,KinematicLine.hh:78). - The KinematicLine errors in
IntersectionCovariance_unit.cc:174now follow the parameter order, and the t0 comments are fixed.
Findings
- 🟠 [S1] (carried over, now measured) Out-of-bounds cylinder crossings reach
KKShellXing::updateReference, and Mu2e reconstruction loses calorimeter material. Still open.-
Code, Offline
main0f6b4ad0: when a material crossing's piece changes,Mu2eKinKal/inc/KKShellXing.hh:88searches the new piece.:91and:97accept the result ononsurface_ && inrange_, with noinbounds_check.updateStatethen needsgood()(:107), so the material is switched off. Offline#2204 keeps this logic (KKShellXing.hh:93,:96,:99at49929928). -
Toy reproduction, rerun at this head: the same numbers as at
d426035c. With 5 ns pieces, 26,252 of 68,884 IPA searches (38.1%) adopt an out-of-bounds crossing. With 1 ns pieces, none do. Output:res/shellrepro3_cb8107dc.txt. -
In Mu2e reconstruction: I built Offline
main0f6b4ad0against KinKal3a6860b(this PR's base) and against this head, and ran the productionrecoMC/OnSpill.fclon 2,000 CeMLeadingLogMix1BB events withSaveMaterialXings : true. All 7,822 fitted tracks have the same status, active hits, chi2, t0 and momentum at the first segment. 6 calorimeter crossings in 5 tracks change from in bounds to out of bounds, and their energy loss goes to zero:event fit crossing dP at base momentum at EMC_Disk_1_Back, base to this head348 KKDe EMC_Disk_1_InnerRing4−9.31 MeV/c 79.06 to 88.32 MeV/c 2475 KKDe EMC_Disk_1_InnerRing2−1.53 MeV/c 85.16 to 86.68 MeV/c 3979 KKDe EMC_Disk_1_InnerRing1 and 2−9.30 and −1.23 MeV/c 86.93 to 97.42 MeV/c 3998 KKDmu EMC_Disk_1_InnerRing2−4.25 MeV/c 81.87 to 86.08 MeV/c 4742 KKDe EMC_Disk_1_InnerRing1−3.98 MeV/c 94.37 to 98.33 MeV/c That is 4 of 1,991 KKDe tracks and 1 of 1,955 KKDmu tracks. No KKUe or KKUmu track changes. Run 1430, subrun 1612. Outputs:
jobs/out/onspill.{base,cb8}_mx.0/ks_dump.txt. -
Impact: the fit is unchanged, because the ring sits after the last tracker hit. What changes is the track beyond the ring: the momentum at the calorimeter disk-1 surfaces, by 1.5 to 10.5 MeV/c in these 5 tracks. Anything that uses the extrapolated state at disk 1 sees this.
-
Where it happens: these crossings are made only when
good()(CaloMaterialLayers.hh:60,:66,:75), andKKShellXing::updateReferenceis the only place that moves them. So the change comes from whatintersectreturns there during a refit. -
I tried two local Offline patches to
updateReference, and neither is a fix:- Never replace an in-bounds crossing with an out-of-bounds one. This keeps stale crossings. Compared with the base, all 108 calorimeter material crossings that are out of bounds in the base stay in bounds, and 30 fits change (chi2 up to 39 different).
- When the piece search returns an out-of-bounds crossing for an in-bounds one, also search ±1 ns over the full trajectory and prefer an in-bounds result. All fits match the base. But the same 5 tracks still lose the ring, and 4 other tracks gain a ring crossing the base had out of bounds.
So the in-bounds crossing is not found within ±1 ns either. I did not trace these 5 events further. Patches:w_main_cb8/kkshell_test_patch1.diffandkkshell_test_patch.diff; outputsjobs/out/onspill.fix1_mx.0andonspill.fix_mx.0.
-
Options: make the out-of-bounds fallback in
hbIntersectopt-in, as I suggested last time. Or find, with these 5 events, what Offline should do instead. I would not hold this PR, because merging KinKal alone changes nothing in Offline. But please do not let Offline take a tag with it until this is understood.
-
Findings from my earlier reviews
- 🟢 [was S1] Debug CI timeout in
IntersectionBounds: fixed incb8107dc, verified. The toy tolerance is now 1e-3 mm (IntersectionBounds_unit.cc:45). CI run 44956448456 at this head: the test passes in 24.58 s (macOS Debug), 24.85 s (Ubuntu Debug), 2.70 s (macOS Release) and 3.48 s (Ubuntu Release). 32 of 32 tests pass in all four jobs. Locally, Debug takes 46.30 s and Release 3.48 s, 32 of 32 pass, and both builds have no warnings. The test still catches a broken integral at the new tolerance. Dropping the U-V correlation fails 8 of 60 cases, and using the wrong Gaussian width fails 45, as before. - 🟠 [was S1] Out-of-bounds crossings adopted by
KKShellXing: still open. See finding 1.- With KinKal#239 and Offline#2204 together: Offline#2204 changes only the search arguments in
updateReference, so the adoption is the same. The near-miss crossings Offline#2204 adds are inactive by design, so for them adopting an out-of-bounds crossing is fine. The problem is the in-bounds crossings. - With KinKal#239 and without Offline#2204: Offline
mainbuilds and runs against this head (no warnings). The only reconstruction change I found is finding 1. The early return inMaterial.hhhas no effect there (below).
- With KinKal#239 and Offline#2204 together: Offline#2204 changes only the search arguments in
- 🟢 [was S3] End-disk crossing times without
onsurface_: fixed incb8107dc.Intersect.hh:293-294now requirefrontinter.onsurface_andbackinter.onsurface_. My t=0 test helix gives the same result at both heads, because the full-range fallback returns the same crossing. So this is checked by reading the code, not by a failing case. - 🟢 [was S3] KinematicLine errors in
IntersectionCovariance_unit.cc: fixed incb8107dc.:174now reads{0.1,0.002,0.1,0.002,0.005,0.05}, in the order d0, phi0, z0, theta, t0, mom ofKinematicLine.hh:23-30. - 🟢 [was S3] The t0 comment and the
1.0e-10cut: fixed incb8107dc. The comments atLoopHelix.cc:139,CentralHelix.cc:170andKinematicLine.cc:138now say that errors along the direction drop out. The literal is thedirtolargument.
Checked, no action needed
- 🟢 The
Material::extrapolateearly return (Fit/Material.hh:106-108).- Which Mu2e crossings can be inactive: in Offline
main, none that reachextrapolate.KKExtrap::addCrossingbuilds aKKShellXingonly for crossings the sweep accepted in bounds, and the constructor makes the material wheninter.good()(KKShellXing.hh:75). Calorimeter crossings added byAddCaloMaterialgo through the fit, notextrapolate.processandappendalready skipped inactive crossings (Material.hh:57,:76). With Offline#2204, the near misses are inactive on purpose, and this return stops them splitting the trajectory. - Measured: Offline
mainagainstd426035cand against this head, same 2,000 OnSpill events. All 9 KalSeed collections are identical, every track and every intersection. The same holds for 10,000 CosmicCRYExtracted events (6,730 KKLine tracks) and their TrkCrvMatch output. Base3a6860bagainst this head is also identical there. - Offline#2204's
ExtrapolateSweepTestchecks that a near-miss material does not split the trajectory (ExtrapolateSweepTest_main.cc, "inactive material split the trajectory"). That check needs this commit, so Offline#2204 needs a tag atcb8107dcor later, notd426035c. I read this from the code; I did not build Offline#2204 againstd426035c.
- Which Mu2e crossings can be inactive: in Offline
- 🟢
planeCovariancehas no defaultdirtol. Nothing outside KinKal is broken. Offlinemain0f6b4ad0has no call toplaneCovarianceorfillPlaneCovariance, and EventNtuplea8e216fbhas none. Offline#2204 passesdirtolat every call (CRVReco/inc/TrkCrvGeom.hh:44,Mu2eKinKal/inc/ExtrapolateSweep.hh:353,:358) and uses the default only throughfillPlaneCovariance(:507).
Validation check
- Build/tests run: yes. KinKal standalone with CMake on the Mu2e p111 environment, Release and Debug, no warnings, ctest 32 of 32 (above).
- Offline
main0f6b4ad0with muse, against KinKal3a6860b,d426035cand this head: all three build with no warnings. - Jobs: production
recoMC/OnSpill.fclon 2,000 events ofdig.mu2e.CeMLeadingLogMix1BB.MDC2025au_best_v1_3.001430_00001612.art, andrecoMC/Extracted.fclplus TrkCrvMatcher on 10,000 events ofdig.mu2e.CosmicCRYExtracted.MDC2025bb_best_v1_5.001400_00017143.art. Both read in place from dCache. All jobs exit 0 with no exceptions. CPU per event is the same within 0.2% across the three KinKal versions (0.1758 to 0.1761 s, TimeTracker). - CI: GitHub Actions at this head, read at 2026-11-21 23:24Z. All four jobs pass: Release Ubuntu 22:26:28Z, Release macOS 22:26:41Z, Debug Ubuntu 22:29:56Z, Debug macOS 22:31:21Z.
- Sourced numbers: none in the diff.
- Cross-repo consistency: finding 1 needs a fix before Offline takes the tag. Offline#2204 needs this head or later.
- Paths in this review are under
/exp/mu2e/data/users/oksuzian/claude-scratch/kinkal239_offline2204_review/.
Residual risk
- I ran one OnSpill file (2,000 events) and one extracted cosmic file (10,000 events). Finding 1 shows up at about 0.2% of downstream electron tracks in that sample. Other samples (other momenta, upstream tracks, cosmics through the calorimeter) may differ.
- I did not run Offline's validation suite or valCompare.
Author follow-ups
- Before Offline takes a tag with this PR, fix finding 1: either make the out-of-bounds fallback opt-in, or find the right Offline change with the 5 events listed. Run 1430, subrun 1612 of the file named under Validation check.
- As before, "Fixes #237, fixes #238" in the PR body would close both issues on merge.
This PR also addresses #237 and #238
Summary of changes in #239
This PR adds an optional projection of the trajectory's spatial covariance onto the local plane at an
Intersection. It also adds the fraction of that covariance that lies inside the surface boundaries. Along the way it fixes several intersection and unit-test problems: #237, #238, the macOSTruncateCI failure and the gradient-field fit tests. The commits are 9cce2ac, bae8ab3, 085d199, 33f4bbd, 862cc6f, d426035 and cb8107d (the last one is local and not pushed yet).1. Projected covariance in the Intersection payload
Intersectiongains the local tangent-plane frame (udir_,vdir_; W =norm_).pcov_, the 2x2 spatial covariance of the trajectory projected onto that plane in UV coordinates.IntersectFlaggainshascov_, which records whetherpcov_was filled. It is independent ofgood()and is included in==and!=.intersect(...)overloads, including theParticleTrajectoryversion, take a trailingbool pcov = false. Existing callers are unchanged.fillPlaneCovariance(ktraj, surf, inter, tol, dirtol=1e-10)can be called on its own:pcov_andinbfrac_asintersect(..., pcov=true).hascov_false. The test is |cos(direction, normal)| <dirtol.planeCovariance(time, plane, dirtol)inLoopHelix,CentralHelixandKinematicLinenow projects along the particle direction. The result is the covariance of the point where the trajectory crosses the plane. Before, the 3D position covariance was projected orthogonally onto U and V. Errors along the particle direction, such as t0, drop out of this linear projection.dirtolargument rather than repeated 1e-10 literals.2. Covariance fraction inside the surface bounds
Intersection::inbfrac_(meaningful whenhascov_is set) is the approximate (~1%) fraction of the 2D Gaussian described bypcov_that lies inside the surface boundaries.boundsFraction):3. Intersection behaviour changes and fixes
inbounds_orgood().hpIntersect: build the CentralHelix plane window from the true helix axis #237:hpIntersectnow narrows its search window forCentralHelixwith the true helix axis (newCentralHelix::axis()) rather than the tangent line, so every plane crossing lies inside the window.canIntersect: miss cylinder crossings when the field is tilted from the cylinder axis #238:canIntersectfor cylinders and frustrums now finds glancing intersections when the field is tilted from the surface axis.time_at 0, which could otherwise fall inside query ranges that span t = 0.Material::extrapolate: it returns early for an inactive element crossing (for example an out-of-bounds one), so the trajectory is not split. As withprocessandappend, the effect is kept, and it contributes again if it becomes active on a refit.4. Unit tests
IntersectionCovariance(new): comparespcov_with a toy MC of trajectory crossings, for LoopHelix, CentralHelix and KinematicLine on plane, rectangle and cylinder surfaces. It also checks consistency withplaneCovariance, thatpcov_is filled only on request, and the out-of-bounds and parallel cases.IntersectionBounds(new): comparesinbfrac_with a toy MC, and with analytic values where they exist, for edges, corners and curved surfaces. It checks that hand-built intersections reproduceintersect(..., pcov=true). The intersection tolerance is 1e-3 mm, which is small next to the ~1 mm projected errors. The test runs in about 2 s optimized and about 30 s in an -O0 build, well inside the CI limit.IntersectTilt(new): covers the glancing tilted-axis cylinder and frustrum crossings fromcanIntersect: miss cylinder crossings when the field is tilted from the cylinder axis #238.ParticleTrajectoryTest: gains a check of the covariance on piecewise-trajectory intersections.Truncate: the macOS CI failure (LoopHelix bfcorr inactive hits ... effects kept) is fixed.LoopHelixFitandCentralHelixFitgradient tests are re-enabled at the Mu2e tracker gradient.5. Downstream (Offline)
intersectcallers compile and behave as before, because the covariance is off by default.KKShellXing::updateReference. That is intentional (review finding S2). In the companion Offline work, KKShellXing treats such crossings as inactive material.ExtrapolateSweepusespcov_andinbfrac_from this PR. It will be submitted as a separate Offline PR.— Claude (Opus 5.5, Anthropic), via Claude Code