Repository navigation
TrkCrvMatcher: refuse Sigma* lists that do not describe the CRV geometry - #2147
Conversation
With DoGeometric true, TrkCrvMatchTool::beginRun checks SigmaV, SigmaU and SigmaT against the sector types of the loaded CosmicRayShield: one entry for all types, or one per sector type 1 to N; otherwise a CONFIG exception names the list and the geometry's sector types. Follow-up to Mu2e/Production#595.
|
☀️ The build tests passed at 4914d1d.
N.B. These results were obtained from a build of this Pull Request at 4914d1d after being merged into the base branch at 30088f3. For more information, please check the job page here. |
oksuzian
left a comment
There was a problem hiding this comment.
PR Review Summary — #2147
Reviewed at head 4914d1de3d62f83bbe8ad0d9017326544a4796e7. First pass.
Decision
- 🟢 approve. The check does what the description says. It runs only where the lists are used, and every job that schedules a geometric matcher today passes it. FNALbuild build 3604 built this head, merged on
main30088f39. The prof build and all validation jobs passed.triggershows "Return Code 2", but its log has only the fourapr_protonrename messages from mu2e-trig-config#191, which merged before the reference was regenerated.
Scope understood
- With
DoGeometric: true,TrkCrvMatchTool::beginRunnow requiresSigmaV,SigmaUandSigmaTto have either one entry or one entry per sector type of the loaded CRV geometry. Otherwise it throwsCONFIGwith the list and the geometry's sector types. - Time-only instances are not checked. The comments in
TrkCrvMatchTool.hhandprolog_v12.fclstate the rule.
Checked
- 🟢 The lists enter only the geometric χ².
resolution()is called only insideif(doGeometric_)(CRVReco/src/TrkCrvMatchTool.cc:227,:299-300), so skipping the check for time-only instances loses nothing. - 🟢 The check reads the same sector types the matcher uses. Both come from
CosmicRayShield::getCRSScintillatorShields(), and the check runs inbeginRunbecause the geometry is not available before then. - 🟢 The sector types in the description match the geometry files:
crv_counters_run1a_v01.txthas T1 and T2 both type 1. Run 1A, Run 1B v40 (geom_run1_b_v40.txtincludesgeom_run1_a_stickman.txt) and today'sgeom_common.txtall load it.crv_counters_extracted_v01tov03have types 1-3.v04adds the muon taggers as type 4. Today'sgeom_common_extracted.txtisv06, which includesv04.crv_counters_v10.txthas types 1-7.
- 🟢 Every geometric matcher scheduled today passes the check:
- EventNtuple
main428345c:TrkCrvMatchLineNtuplekeeps the 4-entry default and runs infrom_mcs-extracted.fclandfrom_rec-combined.fcl. Both loadgeom_cosmic_extracted.txt, which has 4 sector types.TrkCrvMatchCHmuNtuplesetsSigmaV: [ 13 ].- The four LoopHelix matchers are time only.
- Production#595 at
cb49c71a:TrkCrvMatchLineandTrkCrvMatchCHmusetSigmaV: [ 13 ]for Run 1.reco/Extracted.fclandrecoMC/Extracted.fclput the 4-entry list back on the extracted geometry.- The LoopHelix matchers are time only.
- Production
maindoes not schedule the matcher yet.
- EventNtuple
- As the description says, the 4-entry default now stops a geometric matcher on
crv_counters_extracted_v01tov03, even though its first three entries would be right there. No current job uses those geometries with a geometric matcher;from_rec-crv-kpp-MC.fclloadsv02but schedules no matcher. Requiring the exact count is what catches the Run 1 case, so this looks like the right trade.
Validation check
- Build/tests run: no local build or jobs. I read the code at this head and the geometry include chains, and grepped Offline, Production (
mainand #595), EventNtuple and mu2e-trig-config for everyTrkCrvMatcheruse. FNALbuild build 3604 (15:50 UTC) is green apart from thetriggerrow explained above. Its clang-tidy error is in cetlib'sLibraryManager.h. The one new warning on changed lines is cosmetic: a C-style array atTrkCrvMatchTool.cc:49. - Config contract check: pass.
- Cross-repo consistency: pass. Production#595 and EventNtuple
mainalready set lists that pass the check.
Residual risk
- Not re-run by me: your mismatched-list jobs and the bit-identical comparison of
TrkCrvMatchs.
|
📝 The HEAD of |
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for 4914d1d: build (Build queue - API unavailable) |
|
☀️ The build tests passed at 4914d1d.
N.B. These results were obtained from a build of this Pull Request at 4914d1d after being merged into the base branch at 7024300. For more information, please check the job page here. |
brownd1978
left a comment
There was a problem hiding this comment.
This is a good added check.
Outside the scope of this PR; While track matching is clearly the prime use case for CRV spatial resolution, it is not tied to this algorithm and seems more natural to be described as an intrinsic property of CRV clusters. I suggest moving these resolutions to a more general class, perhaps CrvCoincidenceCluster itself.
What
With
DoGeometric: true,TrkCrvMatcher(throughTrkCrvMatchTool::beginRun) now checksSigmaV,SigmaUandSigmaTagainst the sector types of the loadedCosmicRayShield. Each list must have either one entry, used for everysector type, or one entry per sector type 1 to N, type 1 first. Otherwise the job stops with a
CONFIGexception thatnames the list, its entries and the geometry's sector types:
Time-only instances (
DoGeometric: false) do not use the lists and are not checked. TheSigmaVcomment inTrkCrvMatchTool.hhand theTrkCrvMatchercomment inprolog_v12.fclstate the rule.Why
The lists are indexed by
sectorType - 1, and the last entry covers higher types, so a list written for one geometryruns silently on another. The defaults (
SigmaV: [ 7, 13, 7, 17 ]) describe the extracted geometry (EX, T1, T2, muontaggers). In the Run 1 geometries T1 and T2 are both sector type 1, so they took the EX value, 7 mm. That was found in
the review of Mu2e/Production#595 and fixed there by configuration (
SigmaV: [ 13 ]). This PR is the follow-up promisedin that thread: the module now refuses such a configuration.
Sector types of the geometries in use: Run 1A/1B (
crv_counters_run1a_v01.txt): 1; extracted v04 and later: 1-4;extracted v01-v03: 1-3; Run 2 (
crv_counters_v10.txt): 1-7. So the 4-entry default would now throw on extracted v01-v03and on Run 2 if a job ran the geometric matcher there with it; none of the Production or EventNtuple jobs does.
Tests (Offline main
30088f39, the CI build as base; Production#595 with its reco cluster-tag fix in both arms)TrkCrvMatcherinstance in the Production reco and recoMC configurations, with its geometry, fromfhicl-dump:all accepted. The geometric ones have
SigmaV: [ 13 ]on Run 1A/1B or the 4-entry list on extracted v04; theLoopHelix ones are time only.
OffSpill(300 events, MDC2025an CosmicSignalOffSpill),NoFieldand recoMCNoFieldRun1B(300 events of the same digis),Extracted(300 events, MDC2025auCosmicCRYExtracted) and recoMC
OnSpill(100 events, MDC2025au CeMLeadingLogMix1BB). Every job exits with status 0.Every
TrkCrvMatchscollection is bit-identical. So is every other product, apart fromRecoCount::_nccand_ccein the input
RecoCount_*__Digitizeproducts, which are not initialised and differ between two runs of the same code.SigmaVonTrkCrvMatchCHmu, extracted with a 3-entrySigmaVand with a 2-entrySigmaTonTrkCrvMatchLine: each stops at the firstbeginRunwith the message above(exit status 1). Extracted with
SigmaV: [ 10 ], and Run 1A with the 4-entry list onTrkCrvMatchCHmuwithDoGeometric: false, both run. On main, the first case runs silently.Related: Mu2e/Production#595, #2106.
🤖 Generated with Claude Code