Skip to content

Updates L1T OMTF for Phase 2#50032

Open
mbluj wants to merge 10 commits intocms-sw:masterfrom
mbluj:CMSSW_16_0_X_OMTF-KB_v1
Open

Updates L1T OMTF for Phase 2#50032
mbluj wants to merge 10 commits intocms-sw:masterfrom
mbluj:CMSSW_16_0_X_OMTF-KB_v1

Conversation

@mbluj
Copy link
Contributor

@mbluj mbluj commented Feb 4, 2026

PR description:

This PR introduces recent (as for beginning of 2026) changes in the L1T OMTF emulator for Phase2:

  • Algorithm adapted to the latest DT TPs;
  • Output candidates are returned as SAMuons (Phase 2 data format):
    • Conversion to the Phase 2 scales is implemented;
    • Some code refactoring was needed: an internal class FinalMuon was introduced that stores the candidate parameters in the output format. It can be either Phase 1 or Phase 2 scales. Then it is converted to RegionalMuonCands (Phase 1) or SAMuons (Phase 2);
  • Improvements and refactoring of CandidateSimMuonMatcher and DataROOTDumper2 used for developments and validations.

In addition the PR contains a fix of bugs found in DTTriggerPhase2 which are already included in #49589, but as it is not merged yet added here for self-consistency.

Details in this JIRA ticket and K. Bunkowski's presentation here.

This PR requires updated configuration files provided in cms-data/L1Trigger-L1TMuon#29.

PR validation:

Validated with Phase 2 workflows, e.g. 23634.0.

FYI, @akalinow, @kbunkow

Karol Bunkowski and others added 8 commits January 23, 2026 10:32
Changes from
https://github.com/kbunkow/cmssw/tree/from-CMSSW_14_2_0_pre2_KB_v1/L1Trigger/L1TMuonOverlapPhase1

Merged changes from the CMSSW master

L1TMuonOverlapPhase1:
OMTFConfiguration.h
Renaming and modifying several methods (e.g. for eta and phi
conversions), new methods, mb1W2Eta(),
mb2W2Eta(), etc.
Added parameter usePhase2DTPrimitives.

AlgoMuon
added quality, dxyNN and nnOutputs

Added class FinalMuon that stores the candidate parameters in the output
format.

IOMTFEmulationObserver::observeProcesorEmulation
FinalMuons instead of RegionalMuonCands in the argument list

OMTFProcessor:
run() returns now FinalMuons instead of RegionalMuonCands.
Added std::function<void(AlgoMuons::value_type& algoMuon)>
assignQuality, which is set to assignQualityPhase1 or
assignQualityPhase2
Methods OMTFProcessor::convertToGmtScalesPhase1 and
OmtfEmulation::convertToGmtScalesPhase2 set the values in the finalMuon,
then the values from the finalMuon are set in l1t::RegionalMuonCand (in
getRegionalMuonCands) or SAMuon (in  OmtfEmulation::run), respectively.
Added method OMTFProcessor<GoldenPatternType>::assignQualityPhase1
assignQuality is called in OMTFProcessor<GoldenPatternType>::run.
Adde option useStubQualInExtr - it refers to the ref hit quality.
targetStubR is used in extrapolateDtPhiBFixedPoint, instead of
targetStubEta

CscDigiToStubsConverter::makeStubs
Dumping cscDigis to xml.

GhostBusterPreferRefDt.cc: added customByRefLayerAndHitQual sorting
function, for which the quality of the DT ref hit is the first
criterion, not used a.t.m.eicihdebihcfnvlecdgjbekcdnekdlegevvbevejrguf

GoldenPatternBase and GoldenPattern::propagateRefPhi
adedd iLayer as an argument

StubResult.h - added field deltaPhi that stores:
deltaPhi = hitPhi - extrapolatedPhi[iStub] - phiRefHit
in GoldenPatternBase::process1Layer1RefLayer
and is dumped in DataROOTDumper2::observeEventEnd as hit.phiDist .

CandidateSimMuonMatcher
Removing OMTFConfiguration so that it can be used in the analyzer
outside the OMTF package.
Added MatchingType enum.
reworked CandidateSimMuonMatcher::match.
MatchingType::simplePropagation is now propagating the muon to the muon
station with the use of the provided histogram of medianDelta, minDelta,
and maxDelta.
Added method CandidateSimMuonMatcher::propagate which does both
propagation withPropagator and simplePropagation.
CandidateSimMuonMatcher::propagate:
when propagation fails, doSimplePropagation is called for muonRho < 40
added CandidateSimMuonMatcher::collectMuonCands - no matching, just
collecting the MuonCands, useful e..g. in minBIas sample, when there is
no gen info.
match(const l1t::RegionalMuonCand* omtfCand, const AlgoMuonPtr&
procMuon, MatchingResult& result, TrajectoryStateOnSurface& tsof) - is
used both for the simeTrack and trackingParticle.
Added method atStation1.
Deleting deltaPhiPropCandMean and deltaPhiPropCandStdDev in destructor.
ghostBust - increasing deltaPhi margin from 8 to 10, to reduce the ghost
for the displaced muons.
match - result.matchingLikelihood = 1. / ( std::abs(result.deltaPhi) +
0.001) as normal_pdf geves nan for low pt muons. mean set to 0
setting result.propagatedPhi and propagatedEta.

DataROOTDumper2
Setting omtfEvent.muonEvent = -2 when ResultType::propagationFailed.
Fixed setting of omtfEvent.omtfPt.
Added rootTree->Write() in DataROOTDumper2::endJob()  as it seems it
fixes the job crashes.
Added vertexEta and vertexPhi.
Dumping hit.etaHw instead of hit.z, deltaR insted of eta

L1TMuonOverlapPhase2:
InputMakerPhase2.h:
using L1Phase2MuDTThDigi in the OMTF phase2 algorithm
merged from
https://github.com/folguera/cmssw/tree/omtf_dtphase2theta_cmssw14_0_0_pre3
DtPhase2DigiToStubsConverterOmtf::addDTphiDigi: R is set for the DT
segments.

implemented OmtfPhase2AngleConverter::getGlobalEta().

OMTFReconstruction
Constructor -  using edmParameterSet.copyForModify, as it was suspected
that ordinary copying of parameterSet was sometimes causing crashes.
FinalMuons are used in reconstruct()

PtAssignmentBase
Renamed getPts to run.

EmulationObserverBase.h
changing ParameterSet to reference

L1TMuonOverlapPhase2TrackProducer::produce -  produces SAMuonCollection

OmtfEmulation:
Added OmtfEmulation::getQualityFromFiredLayers with firedLayersToQuality
tuned for the phase2 OMTF patterns.
Added OmtfEmulation::convertToGmtScalesPhase2().
Added OmtfEmulation::getSAMuons().

LutNetworkFixedPointRegressionMultipleOutputs - the new version of the
neural network, with multiple outputs. The neurons of the last layer are
not fully connected to the last-but-one layer.

PtAssignmentNNRegression adapted to the
LutNetworkFixedPointRegressionMultipleOutputs with
lutNN_omtfRegression_v430_FP.xml
omtfHitWithQualAndRToEventInput,
OmtfHit now has r instead of eta,
no pt calibration,
the second pt returned by the NN is not used yet
hit.z is not used
in OmtfHit deltaR instad of r

LutNeuronLayerFixedPoint.h - in floorlog2 and ceillog2
removed throw cms::Exception as it should be const expressions, so
runtime throws have no sense.
Added template parameter output_F
added valueP2Scale i.e. option ot use the phase-2 GMT eta scale

IProcessorEmulator
removed setAssignQualityFunction.

OMTFProcessor.h
assignQualityPhase1 changed to assignQuality.
Removed ptAssignment.

PatternGenerator.cc
removed reCalibratePt().

PtAssignmentBase renamed to MlModelBase and moved to
L1Trigger/L1TMuonOverlapPhase2.

PtAssignmentNNRegression.h renamed to NNRegression.h.

Added class OmtfProcessorPhase2.

OmtfEmulation
added method beginRun.
A few methods and fields moved to OmtfProcessorPhase2.

L1Trigger/L1TMuonOverlapPhase2/python/simOmtfPhase2Digis_cfi.py
hwToLogicLayer_0x0210.xml - added ref hits from the processors' overlap
regions, to improve the efficiency at the processor boundaries.
Patterns_ExtraplMB1andMB2RFixedP_ValueP1Scale_DT_2_2_2_t35__classProb17.xml
- pattern without pt recalibration, besides the same as the previous
version (i.e.
Patterns_ExtraplMB1andMB2RFixedP_ValueP1Scale_DT_2_2_2_t35__classProb17_recalib2.xml).
AngleConverterBase was removed, the needed methods were moved to
OmtfAngleConverter. A few methods that were not used were dropped.

OmtfPhase2AngleConverter
method getGlobalEta renamed to getGlobalEtaPhase2, to avoid hiding
OmtfAngleConverter methods getGlobalEta.
added << operator to FinalMuon and MatchingResult

CandidateSimMuonMatcher.cc
Added protections against null simVertex pointer.
Added protections against null muonMatcherFile and histograms.
Removed cuts on candidates pt and quality.
Simplified LogTrace printouts.

OmtfProcessorPhase2.cc
A small fix in the assignQualityPhase2.
ProcConfigurationBase.h:
added dtBxShift.

InputMakerPhase2.h:
OMTFConfiguration moved from DtPhase2DigiToStubsConverterOmtf to
DtPhase2DigiToStubsConverter.

InputMakerPhase2.cc:
Using config->dtBxShift() instead of the hardcoded value 20.
@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 4, 2026

cms-bot internal usage

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 4, 2026

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-50032/47864

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 4, 2026

A new Pull Request was created by @mbluj for master.

It involves the following packages:

  • L1Trigger/DTTriggerPhase2 (l1)
  • L1Trigger/L1TMuonOverlapPhase1 (l1)
  • L1Trigger/L1TMuonOverlapPhase2 (l1)

@BenjaminRS, @cmsbuild, @quinnanm can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @battibass, @dinyar, @eyigitba, @missirol, @mmusich, @thomreis this is something you requested to watch as well.
@ftenchini, @mandrenguyen, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@quinnanm
Copy link
Contributor

quinnanm commented Feb 4, 2026

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 4, 2026

-1

Failed Tests: ClangBuild
Size: This PR adds an extra 16KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e571da/51110/summary.html
COMMIT: 255348b
CMSSW: CMSSW_16_1_X_2026-02-04-1100/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/50032/51110/install.sh to create a dev area with all the needed externals and cmssw changes.

Failed Clang Build

I found compilation warning while trying to compile with clang. Command used:

USER_CUDA_FLAGS='--expt-relaxed-constexpr' USER_CXXFLAGS='-Wno-register -fsyntax-only' /usr/bin/time -v scram build -k -j 32 COMPILER='llvm compile'

See details on the summary page.

mbluj added 2 commits February 5, 2026 14:45
The bug has had no impact as it was part of the final, redundant condition in an "else if" statement
@mbluj
Copy link
Contributor Author

mbluj commented Feb 5, 2026

Fixed issue found in tests with clang.

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 5, 2026

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-50032/47899

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 5, 2026

Pull request #50032 was updated. @BenjaminRS, @cmsbuild, @quinnanm can you please check and sign again.

@mbluj
Copy link
Contributor Author

mbluj commented Feb 5, 2026

Please test this PR with cms-data/L1Trigger-L1TMuon#29.

@mbluj
Copy link
Contributor Author

mbluj commented Feb 9, 2026

I'd like to ask to start tests and eventually the review, thank you.

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.

3 participants