Skip to content

material effects - #2081

Merged
oksuzian merged 4 commits into
Mu2e:mainfrom
sophiemiddleton:calo_ext
Nov 3, 2026
Merged

oksuzian merged 4 commits into
Mu2e:mainfrom
sophiemiddleton:calo_ext

Conversation

@sophiemiddleton

Copy link
Copy Markdown
Contributor

This pull request introduces support for modeling and tracking the calorimeter disk front panel material and embedded cooling pipes in the Mu2e simulation and reconstruction. The changes add new surface IDs for the front panel layers and pipes, implement a detailed geometric and material model for these components, and update the extrapolation and configuration logic to include them in fits and track propagation. This enables more accurate modeling of material effects for tracks passing through the calorimeter front panels.

Calorimeter front panel and cooling pipes modeling:

  • Added new surface IDs EMC_Disk_0_FrontPanel and EMC_Disk_1_FrontPanel to SurfaceIdEnum, updated the surface ID count, and registered their string names. [1] [2]
  • Introduced the CaloFrontPanelPipes class to represent the geometry and material of cooling pipes embedded in the calorimeter front panels, including methods to compute the material depth crossed by a track. [1] [2]
  • Updated KinKalGeom and KinKalGeomMaker to construct and store the front panel material layers and cooling pipes for each calorimeter disk, including detailed geometric construction and material assignment. [1] [2] [3] [4] [5] [6] [7]

Geometry and configuration enhancements:

  • Extended the calorimeter geometry configuration to include front panel material properties (material names for foam and carbon fiber).
  • Added FCL configuration options to enable extrapolation through the calorimeter front panel material and to include it in fits. [1] [2]

Extrapolation and material handling:

  • Added a uniform interface (CaloMaterialLayers) to access both fixed-thickness front panel layers and position-dependent cooling pipe material for use in extrapolation and fitting.
  • Updated the extrapolation logic to handle the new calorimeter front panel material layers and pipes in track propagation. [1] [2]

@sophiemiddleton
sophiemiddleton marked this pull request as draft October 29, 2026 19:57
@FNALbuild

Copy link
Copy Markdown
Collaborator

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

  • TrackerConditions
  • Mu2eKinKal
  • GeometryService
  • DataProducts
  • KinKalGeom

which require these tests: build.

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

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

About FNALbuild. Code review on Mu2e/Offline.

@sophiemiddleton
sophiemiddleton marked this pull request as ready for review October 29, 2026 23:54
@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at f00cd50.

Test Result Details
test with ✅ Command did not list any other PRs to include
merge ✅ Merged f00cd50 at a9ddd06
build (prof) ✅ Log file. Build time: 04 min 30 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 (19) FIXME (7) in 16 files
clang-tidy ➡️ 1 errors 168 warnings
whitespace check ✅ no whitespace errors found

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

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 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PR Review Summary — #2081

Reviewed at head f00cd50e59f3b7cb9a85a7c10a1713ff85694c1e. First pass.

Decision

  • 🟡 comment. The geometry, the materials and the new extrapolation code check out. With the two new options turned off, the output is identical to main on all 16508 events of the nightly reco_03 input. But both options are on by default in LHDriftFit, which production on-spill reconstruction uses. With them on, about 1% of the LoopHelix fits are lost and almost every fit changes (finding 1). Please settle that before merging: either show it is an improvement, or turn the defaults off.

Scope understood

  • What the PR adds:
    • KinKalGeom gets the calorimeter front panels as three layers each (carbon fiber, foam, carbon fiber), the cooling pipes as centerlines, and the crystal-case inner rings.
    • These get new surface IDs 320-323.
    • KKExtrap::extrapolateCaloMaterial adds them when a fit is extrapolated to the calorimeter (ToCaloMaterial).
    • KKFit::addCaloMaterial adds the ones inside the fit range and refits (AddCaloMaterial).
    • KKShellXing::updateReference now searches the neighbouring pieces when a crossing moves.
    • MaterialsList.data gets six materials.
  • Both options are set true in Mu2eKinKal/fcl/prolog.fcl, at :395 (LHDRIFTXTRAP) and :505 (LHDriftFit).
    • KKDe, KKUe, KKDmu and KKUmu in Production/JobConfig/reco/prolog.fcl:57-84 inherit them. So recoMC/OnSpill.fcl, which runs in 18 prodtools campaign entries, picks them up.
    • OffSpill (KKCHmu) and Extracted (KKLine) keep the C++ default of false.
    • The description mentions neither the production defaults nor the KKShellXing change.

Findings

  1. 🟠 [S1] The new options are on in production on-spill reconstruction. With them, about 1% of the LoopHelix fits are lost and almost every fit changes, and the PR has no validation.
    • Evidence: the nightly reco_03 input, all 16508 events, on main (the nightly build a9ddd063) and on this PR merged onto it. The track counts are:
fit main this PR
KKDe 16486 16362
KKUe 16303 16146
KKDmu 16316 16109
KKUmu 16043 15934
  • Of the 16252 matched KKDe tracks, 16134 change, and 2514 change their active hit count.
  • For conversion-like KKDe tracks (95-110 MeV at TT_Front, fit consistency above 1e-3, at least 20 hits; 10769 on main), the change in momentum at TT_Front is small: median 0.007 MeV, 99th percentile 0.34 MeV. 34 tracks move by more than 1 MeV, and 1 is lost.
  • Most of the lost tracks are poor fits: 101 of the 125 lost KKDe tracks have fewer than 20 hits. But good fits are lost too.
  • Example: event 1430:1065:1269, a 54 MeV KKDe track with 27 hits before extension.
    • On main: After extending the fit : goodFit = 1, fitcon = 0.9054, nHits = 30, 1 calo-hits.
    • At this head: the three disk-0 front panel layers are added (at 766.2 to 766.5 ns), then goodFit = 0, fitcon = 0.0000, and the track is not saved.
  • The refit is the cause. KKTrack::addFitMaterialXings calls extend with the full fit configuration (KKTrack.hh:334), which replays the whole extension schedule. In the printout, meta-iterations 13 to 21 follow the original 12. That replay is where hits change state and fits fail.
  • The replay also costs CPU. The four LoopHelix fits take 112.8 ms per event against 81.5 ms on main, and KKDe alone goes from 20.6 to 31.6 ms.
  • Control: with AddCaloMaterial and ToCaloMaterial set to false on the four fits, every KalSeed collection, with all its intersections, is identical to main in all 16508 events. So all of the change comes from these two options.
  • Suggested fix, any of these:
    • Set both defaults to false until validated, with momentum resolution and efficiency against MC truth on conversion electrons and on a background sample.
    • Or add the panel material in the same extension step that adds the CaloHit, rather than in a second full extension.
  • Either way, please say in the description that production output changes.
  1. ⚪ [S3] The pipe and ring layout is a second copy of the G4 construction.
    • KinKalGeomMaker::makeCaloPipes reproduces caloBuildFrontPlate in constructDiskCalorimeter.cc, including its 0.9975 angle factor, the 2 mm shortening and the - 0.1 manifold margin (KinKalGeomMaker.cc:199, :211, :215).
    • If the G4 layout changes, KinKal goes out of step without any error.
    • A description of the pipes kept once, in DiskCalorimeter, and used by both would avoid that. This does not gate.
  2. ⚪ [S3] Small items.
    • The front panel material names come straight from the geometry file and must exist in MaterialsList.data.
      • geom_common_trackerVST.txt:373-374 sets them to "G4_AIR", which is not there. MatDBInfo::findDetMaterial then throws Cannot find requested material G4_AIR at the first crossing.
      • The only user, Production/Processing/vstdata_epilog.fcl, runs line fits with the options off, so nothing fails today.
    • Regrown fits do not get the in-fit material (the TODO at KKFit.hh:418), while the regrow configurations use LHDRIFTXTRAP and so add it in the extrapolation. RefRegrow.fcl is in no campaign.
    • DiskCalorimeterMaker.cc:117 gives innerCFRingMaterial a default of "CarbonFiber". G4 reads the same key with no default, and both calorimeter geometry files set it, so the default can go.

Checked, no action needed

  • 🟢 The surface IDs are append-only.
    • The new values are 320-323, after EMC_Disk_1_Back (317), so no existing value moves.
    • SurfaceId is stored as the enum integer through EnumToStringSparse, so older files read the same.
    • nSurfaceIds is used only in the static_assert (SurfaceId.cc:95).
    • EventNtuple stores sid as an integer, with no calorimeter-specific list.
  • 🟢 Every new TimeRange is built from a time inside the range.
    • extrapolateCaloMaterial: tstart is clamped into the fit range (KKExtrap.hh:491) and later set from intersection times (:515). extrapolateCaloSupport (:572) does the same.
    • caloSupportXings (CaloMaterialLayers.hh:64, :74) starts from good() intersections, and good() requires the intersection to be in range.
    • KKFit::addCaloMaterial orders its ends (KKFit.hh:440). KKShellXing uses ±1 ns (:90).
    • The calorimeter material is added after the DS and CRV material passes and before the material-free disk extension (KKExtrap.hh:151). That is the order #2059 needed.
  • 🟢 The materials match G4's own definitions (ConstructMaterials.cc:1266-1295, :1372-1378):
    • CarbonFiber_resin: C5H5O2 at 1.1 g/cm³.
    • CarbonFiber: 46% fiber at 1.422 g/cm³. G4 computes the same weighted density.
    • AluminumHoneycomb: 0.03 g/cm³.
    • CaloPipeAl and CaloRingAl: G4_Al, as calorimeter.pipeMaterial and the aluminium rings use.
  • 🟢 The layer positions match G4.
    • The case front is frontFaceCenter - crystalCapZLength, because the crystal origin sits one cap length behind the case front (DiskCalorimeterMaker.cc:215). G4 places the front plate directly upstream of the case.
    • The 3 / 21.75 / 3 mm layers and the pipe plane, one pipe radius into the foam, follow caloBuildFrontPlate (ZposPipe).
  • 🟢 With the options off, the KKShellXing change and the new geometry leave every output unchanged (the control in finding 1).
  • 🟢 No crash. All 16508 reco_03 events run at this head with its defaults, and so do 200 ceSimReco events.

Validation check

  • Build: Offline main a9ddd063 merged with this head, with Production 94a4d81f and mu2e-trig-config 2b90c646, p109. These are the same three commits as the nightly build.
    • The merge is clean. The branch is based on #2059's head (0fd28482), and the merge keeps #2076's clamp.
    • Exit status 0, no warnings. FNALbuild passed at this head.
  • Production/Validation/nightly/reco_03.fcl on its two dig inputs, read in place, all 16508 events, with every KalSeed collection printed per event (PrintModule verbose 2: fit summary and all intersections). It was run three ways: main, this PR, and this PR with the two options off.
  • Production/Validation/ceSimReco.fcl, 200 events (baseSeed 8), main against this PR:
    • 84 of 85 KKDe tracks change.
    • The change in momentum at TT_Front has a median of 0.012 MeV and a maximum of 1.29 MeV.
    • No track is lost.
  • With KKDe printout on, over 100 events, front panel material was added about 290 times and inner-ring material 21 times. A second pass was needed 4 times.
  • Not checked:
    • Momentum resolution against MC truth.
    • The cooling-pipe wall depth (wallDepth) against G4, beyond reading the code.

Author follow-ups

  1. Settle finding 1. Either turn the defaults off until validated, or show resolution and efficiency against MC truth, and avoid the second full extension that loses fits.
  2. Say in the description that production output changes, and mention the KKShellXing change.

- KKTrack::addFitMaterialXings refits with a single meta-iteration at the
  final temperature and no hit updaters, instead of replaying the full
  extension schedule, which changed hit states and lost good fits
- ToCaloMaterial and AddCaloMaterial default to false in prolog.fcl until
  validated against MC truth, so production reco is unchanged
- drop the innerCFRingMaterial default, matching the G4 construction
- add G4_AIR to MaterialsList.data for geom_common_trackerVST.txt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@oksuzian oksuzian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PR Review Summary — #2081

Reviewed at head 495acb2f2286059d9fa85bc16a1111990f574e2e. Re-review of f00cd50.

Decision

  • 🟢 Approvable. The new commit settles my main finding: both options are now off by default, and with the PR's defaults every KalSeed collection is identical to main on all 16508 events of the nightly reco_03 input. The new refit also loses far fewer fits when the options are turned on. FNALbuild has not built this head yet (mu2e/buildtest: "This test has not been triggered yet"), so I am posting this as a comment and have asked for a build. I will approve once it is green. My local build of this head compiles without warnings.

What changed since f00cd50

  • One commit, "Address PR #2081 review: calo material refit and defaults". The branch was not rebased; the merge base is still f00cd50. It touches four files:
    • KKTrack.hh:336-338: addFitMaterialXings now refits with a one-entry schedule at the last temperature and no updaters, instead of replaying the whole extension schedule.
    • Mu2eKinKal/fcl/prolog.fcl:395 and :505: ToCaloMaterial and AddCaloMaterial are false.
    • DiskCalorimeterMaker.cc:117: the innerCFRingMaterial default is gone.
    • MaterialsList.data:9: a G4_AIR entry, a copy of air.

Prior findings

  • 🟢 [was 🟠 S1] The options were on in production on-spill reconstruction. FIXED in 495acb2, verified.
    • fhicl-dump at this head of Validation/nightly/reco_03.fcl and of JobConfig/recoMC/OnSpill.fcl, OffSpill.fcl and Extracted.fcl shows both options false on KKDe, KKUe, KKDmu, KKUmu and RegrowLH. Production 94a4d81f and mu2e-trig-config 2b90c646 set neither option.
    • I reran the same 16508 reco_03 events in the same six chunks, with every KalSeed collection printed per event. With the PR's defaults, every collection, including all intersections, is identical to main. The four LoopHelix fits take 81.8 ms per event, against 81.6 ms on main.
  • 🟢 [was ⚪ S3] Small items. FIXED.
    • G4_AIR is now in MaterialsList.data, so the VST geometries no longer name a material the KinKal material list lacks. I did not run a VST job.
    • The innerCFRingMaterial default is gone. This cannot break a working geometry: the same maker already reads calorimeter.FPCoolPipeRadius with no default, and the only two files that set it (calorimeter_CsI_v1.txt, calorimeter_CsI_v2.txt) also set innerCFRingMaterial. The production geometry includes calorimeter_CsI_v2.txt, and the 16508-event run built it.
    • The Regrow TODO (KKFit.hh:418) is unchanged. With the options off it has no effect.
  • ⚪ [S3, open] The pipe and ring layout is still a second copy of the G4 construction (KinKalGeomMaker.cc:199, :211, :215). This does not gate.

With the options turned on
These numbers are for whoever validates the options later; they do not gate this PR. On the same 16508 events, with both options true on the four LoopHelix fits:

fit main f00cd50 495acb2
KKDe 16486 16362 16478
KKUe 16303 16146 16294
KKDmu 16316 16109 16249
KKUmu 16043 15934 16033
  • Hit states are kept. 0 KKDe and 0 KKUmu tracks change their hit count, against 2514 and 4837 at f00cd50.
  • The CPU cost is small: 85.9 ms per event for the four fits, against 112.8 ms at f00cd50.
  • For conversion-like KKDe tracks, the momentum change at TT_Front has a median of 0.009 MeV and a 99th percentile of 0.15 MeV (0.34 MeV at f00cd50). 24 move by more than 1 MeV.
  • 🟡 [S2] Some good fits are still lost, through the parameter-divergence test. 4 conversion-like KKDe tracks and 9 conversion-like KKDmu tracks are lost, among 10 KKDe and 76 KKDmu losses in total.
    • Example: event 1430:1652:1372, a 99.4 MeV KKDe track with 34 hits. After the extension the fit has consistency 0.957. The material is then added: the three disk-0 front-panel layers at 1261.4 to 1261.5 ns, and two disk-1 inner-ring crossings. The single material iteration ends in Fit Status ParamsDiverged Meta-iteration 13 iteration 0 ... prob 0.955355, and the track is not saved. With the PR's defaults it is saved (goodFit = 1, fitcon = 0.9567).
    • 1430:1612:4983 KKDe (prob 0.853) and 1430:1652:560 KKDmu (0.774, after two disk-0 inner-ring crossings) fail the same way.
    • KinKal sets ParamsDiverged when the end parameters move by more than DivergenceDeltaParams (1e6, as a chi-squared) against the previous fit. The fit just before the material is added is converged. So a 3 mm carbon layer, or a few mm of aluminium ring, should not move the parameters by that much. The cause may be in how the new crossings are seeded, rather than in the one-iteration schedule. I did not find which.
    • Since the options are off by default, this does not affect production. It is worth settling before the options are turned on.
    • Please also mention in the description that both options are off by default. It still describes them only as added options.

Checked, no action needed

  • 🟢 The new refit keeps hit states by construction. With no updaters, KKStrawHit::updateWHS and KKStrawHitCluster::updateState leave the wire-hit states as they were. KKStrawXing keeps its cached updater settings.
  • 🟢 The increment adds no TimeRange. The windows in the calorimeter material code are unchanged from f00cd50, which I checked then, and no run raised an exception.
  • 🟢 Merge state: this head merges cleanly with current main (858d5f4d). It still conflicts with Offline#2084 (4afa41b1) in Mu2eKinKal/inc/KKExtrap.hh (git merge-tree). Whichever merges second needs a rebase.

Validation check

  • Build: Offline main a9ddd063 (the nightly build) merged with this head, with Production 94a4d81f and mu2e-trig-config 2b90c646, p109. It is an incremental muse build of the workspace from my first pass, with exit status 0 and no warnings.
  • Jobs:
    • Production/Validation/nightly/reco_03.fcl on its two dig inputs, read in place, all 16508 events in six chunks, every KalSeed collection printed per event. One run used the PR's defaults, and one had both options on for the four LoopHelix fits. All 12 chunks exited with status 0. Both runs are compared with the main outputs from my first pass.
    • Single-event debug reruns of 1430:1652:1372, 1430:1612:4983, 1430:967:4391 (KKDe) and 1430:1652:560 (KKDmu).
    • fhicl-dump of the four production and validation configurations above.
  • Not checked:
    • FNALbuild at this head.
    • Momentum resolution against MC truth.
    • A VST job with G4_AIR.
    • A Regrow job.
    • The cause of the ParamsDiverged failures.

Author follow-ups

  1. Before the options are turned on: find why the material refit fails the parameter-divergence test on converged fits, and show resolution and efficiency against MC truth.
  2. Mention in the description that both options are off by default.
  3. Coordinate the merge order with Offline#2084, since the two conflict in KKExtrap.hh.

@oksuzian

oksuzian commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

@FNALbuild run build test

1 similar comment
@oksuzian

oksuzian commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

@FNALbuild run build test

@sophiemiddleton

Copy link
Copy Markdown
Contributor Author

for this: Before the options are turned on: find why the material refit fails the parameter-divergence test on converged fits, and show resolution and efficiency against MC truth

I will show some plots in the Wednesday meeting. Should I post them here now?

@brownd1978

brownd1978 commented Nov 2, 2026 via email

Copy link
Copy Markdown
Collaborator

@FNALbuild

Copy link
Copy Markdown
Collaborator

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

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at 495acb2.

Test Result Details
test with ✅ Command did not list any other PRs to include
merge ✅ Merged 495acb2 at b227150
build (prof) ✅ Log file. Build time: 09 min 21 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 (19) FIXME (7) in 16 files
clang-tidy ➡️ 1 errors 168 warnings
whitespace check ✅ no whitespace errors found

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

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.

@sophiemiddleton

Copy link
Copy Markdown
Contributor Author

I agree Dave, it is different. Should the workflow be discussed offline or on Wednesday?

@oksuzian oksuzian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PR Review Summary — #2081

Reviewed at head 495acb2f2286059d9fa85bc16a1111990f574e2e. Approval following my re-review at this head.

Decision

  • 🟢 approve. FNALbuild build 3541 passed at this head when merged with main b2271506: the build, every validation job, POT, trigger, g4surfaceCheck, rootOverlaps, check_cmake and the whitespace check are green. My re-review at this head (review 5730873493) found the earlier S1 fixed: both options are off by default, and with the defaults every KalSeed collection is identical to main on all 16508 reco_03 events.

Before the options are turned on

  • The open items from the re-review still apply then, not now: the parameter-divergence failures on converged fits, resolution and efficiency against MC truth, and the workflow question Dave raised. Plots in a later PR that turns the options on, or in that PR's description, would be the natural place for them.

Merge order, unchanged

  • This PR still conflicts with #2084 in Mu2eKinKal/inc/KKExtrap.hh. Whichever merges second needs a rebase.

@brownd1978

brownd1978 commented Nov 2, 2026 via email

Copy link
Copy Markdown
Collaborator

@brownd1978 brownd1978 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall this looks very good, I just have some minor suggestions. Eventually we may want to run a dedicated schedule, not just the last step. And we might want to add more straws at the same time the calo material is added. Both of those are beyond the scope of this PR.

Comment thread Mu2eKinKal/inc/KKTrack.hh Outdated
matcylxings_.push_back(matxingptr);
}

template <class KTRAJ> void KKTrack<KTRAJ>::addFitMaterialXings(KKMATRECXINGCOL const& planexings, KKMATCYLXINGCOL const& cylxings) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I suggest naming this addCaloMaterialXings, to be more consistent with the other materials (IPA, ST, ...). The difference is that you need to extend the fit at the end, but that's OK.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I can do that

Comment thread Mu2eKinKal/inc/KKTrack.hh Outdated
matconfig.schedule_ = KinKal::Config::Schedule{KinKal::MetaIterConfig(matconfig.schedule().back().temperature())};
this->extend(matconfig,nohits,exings);
for(auto const& matxing : planexings)matrecxings_.emplace_back(matxing);
for(auto const& matxing : cylxings)matcylxings_.emplace_back(matxing);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I suggest to store these new xings in dedicated containers (calomatrecxings, etc), as these are used in the fit not purely in extrapolation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adding this in now

@sophiemiddleton

Copy link
Copy Markdown
Contributor Author

Thanks, I'll look into these changes

@oksuzian oksuzian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PR Review Summary — #2081

Reviewed at head 149c022858acf2fc949451d32386b8679f97f5ce. Re-review of 495acb2.

Decision

  • 🟡 comment now, approve when green. The new commit does what Dave asked and changes no fit result. On all 16508 nightly reco_03 events, every KalSeed collection prints line for line the same as at 495acb2, both with the PR's defaults and with both options on. My local build of this head has no warnings. FNALbuild has not built 149c022 (mu2e/buildtest: "This test has not been triggered yet"), so I will approve again once a build at this head is green.

What changed since 495acb2

  • One commit, "updated for Daves comments", touching three headers (+33 -13). The branch was not rebased; the merge base is still 495acb2.
    • KKTrack.hh: addFitMaterialXings is renamed addCaloMaterialXings. The calorimeter crossings it adds now go into two new containers, calomatrecxings_ and calomatcylxings_, with their own accessors. The cloning constructor copies them (:96-97).
    • KKFit.hh and KKExtrap.hh: the four "already in the fit" checks read the new containers. sampleFit saves the new containers when SaveMaterialXings is set (KKFit.hh:979-992).

Prior findings

  • 🟢 Dave's two inline suggestions, the rename and the dedicated containers. FIXED in 149c022, verified.
    • Nothing at this head still calls addFitMaterialXings. The only writers of the new containers are KKTrack.hh:345-346. The extrapolation still writes its own crossings to matrecxings_ and matcylxings_ (:332, :358).
    • The narrower checks skip exactly what they skipped before. The fit adds the calorimeter material inside extendTrack (KKFit.hh:407), before the module calls the extrapolation (LoopHelixFit_module.cc:361 then :412; RegrowLoopHelix_module.cc:300 then :303). extrapolateCaloMaterial runs once per track (KKExtrap.hh:151) and visits each layer and each ring once. So the old containers never held a front-panel or ring crossing that the new ones lack.
    • I reran the same 16508 events at this head. The printed KalSeed content, the fit summary and every intersection, matches 495acb2 line for line: about 1.86 million lines with the PR's defaults, and about 1.86 million with both options on for the four LoopHelix fits. The defaults run still matches main as well.
    • reco_03 does not set SaveMaterialXings, so that run does not exercise the new sampleFit loops. The only fit that sets it, KKCHmu in OffSpill and Extracted, leaves both calorimeter options off, so the new containers are empty there.
  • 🟢 [was 🟠 S1] The options were on by default. Still fixed: prolog.fcl:395 and :505 are unchanged and false. Production main has not moved since 94a4d81f, and none of mu2e-trig-config's four newer commits mention these options.
  • 🟡 [S2, carried over] With both options on, some converged fits are still lost through the parameter-divergence test: 4 conversion-like KKDe and 9 KKDmu tracks on the 16508 events. The commit does not change the refit, and the options-on run above reproduces the 495acb2 output exactly. Sophie plans to show plots at Wednesday's meeting. This does not gate while the options are off.
    • The description still does not say that both options are off by default.
  • ⚪ [S3, carried over] The pipe and ring layout is still a second copy of the G4 construction (KinKalGeomMaker.cc). The commit does not touch it, and it does not gate.
  • Dave's other points are not requests for this PR. In his approval he called a dedicated refit schedule and adding straws "beyond the scope of this PR". The workflow question, that the calorimeter hit lies after the material, is being discussed on the thread and at the meeting.

New in this increment

  • ⚪ [S3] Two small things, neither gating.
    • SaveMaterialXings now also controls the calorimeter crossings added in the fit, but its description still says "filled during extrapolation" (KKFitSettings.hh:108, prolog.fcl:42, KKFit.hh:170).
    • sampleFit now has seven copies of the same six-line block, one per crossing container (KKFit.hh:956-1006). One small helper taking the container would replace them.

Merge order, unchanged

  • This head merges cleanly with main 1d88a811. It still conflicts with Offline#2084 (4afa41b1) in Mu2eKinKal/inc/KKExtrap.hh (git merge-tree). Whichever merges second needs a rebase.

Validation check

  • Build: Offline nightly main a9ddd063 merged with this head, on the CI build museCIBuild/main/a9ddd063_94a4d81f_2b90c646 (Production 94a4d81f, mu2e-trig-config 2b90c646), p109. This is the same base as my 495acb2 runs. muse build finished with exit status 0 and no warnings. main has not changed Mu2eKinKal since a9ddd063.
  • Jobs: Production/Validation/nightly/reco_03.fcl on its two dig inputs, read in place, 16508 events in six chunks, with the same job file as before. One run used the PR's defaults, and one had both options on for KKDe, KKUe, KKDmu and KKUmu. All 12 chunks exited with status 0 and no exceptions.
  • The comparison drops one stdout line, KalSegment: Invalid time range, tmin 2.68e16 tmax 0, which KalSegment::timeRange() prints while the input trigger collection TrigMprKSFDe is being printed. It appears in some runs and not others on the same input, at 495acb2 as well, so it does not come from this commit.
  • Config contract: this increment changes no fcl and no fhicl parameter.

Not checked

  • FNALbuild at this head.
  • A job with SaveMaterialXings and the calorimeter options both on, which is the only case the new sampleFit loops change.
  • A Regrow job, a VST job, and resolution against MC truth, as before.

@oksuzian

oksuzian commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

@FNALbuild run build test

@FNALbuild

Copy link
Copy Markdown
Collaborator

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

@FNALbuild

Copy link
Copy Markdown
Collaborator

☀️ The build tests passed at 149c022.

Test Result Details
test with ✅ Command did not list any other PRs to include
merge ✅ Merged 149c022 at ffcc1a5
build (prof) ✅ Log file. Build time: 09 min 13 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 (19) FIXME (7) in 16 files
clang-tidy ➡️ 1 errors 168 warnings
whitespace check ✅ no whitespace errors found

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

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 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PR Review Summary — #2081

Reviewed at head 149c022858acf2fc949451d32386b8679f97f5ce. Follow-up to my comment review at the same head.

Decision

  • 🟢 approve. FNALbuild has now built this head, and every test passed: the prof build, all twelve validation jobs, trigger, rootOverlaps, g4surfaceCheck, check_cmake and the whitespace check. This is the approval my comment review promised once the build was green. The open 🟡 about the fits lost when both calorimeter options are on, and the two ⚪ items, stand and do not block while the options are off by default.

@oksuzian
oksuzian merged commit 5629b9f into Mu2e:main Nov 3, 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