Skip to content

Updates L1T OMTF for Phase 2 [20_0_X]#51474

Open
mbluj wants to merge 16 commits into
cms-sw:CMSSW_20_0_Xfrom
mbluj:CMSSW_16_0_X_OMTF-KB_v1_200X
Open

Updates L1T OMTF for Phase 2 [20_0_X]#51474
mbluj wants to merge 16 commits into
cms-sw:CMSSW_20_0_Xfrom
mbluj:CMSSW_16_0_X_OMTF-KB_v1_200X

Conversation

@mbluj

@mbluj mbluj commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

PR description:

This PR is a backport of #50032 to 20_0_X and 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.

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 wf 36034.0 (TTbar_14TeV+Run4D125)

If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:

It is a backport of #50032 to 20_0_X for the new phase-2 MC campaign.

Karol Bunkowski and others added 16 commits July 13, 2026 14:11
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.
The bug has had no impact as it was part of the final, redundant condition in an "else if" statement
e.g. better use of const, cout=>MessageLogs, additional comments, etc.
OMTFProcessor.cc and OmtfProcessorPhase2.cc
Fixing the condition to assign minimum pT (0 or 1 GeV) for the muons
that have only unconstrained pt valid. Checking getFiredLayerCntConstr
was missing.

updating runMuonOverlap_run3_mc.py and runMuonOverlap.py
RegionalMuonCandBxCollection is no longer produced by
L1TMuonOverlapPhase2TrackProducer, RegionalMuonCand are not created by
the OmtfEmulation. Only SAMuonCollection (OMTFconstr and OMTFunconstr)
are produced now.

L1Trigger/Phase2L1GMT/plugins/Phase2L1TGMTFwdMuonTranslator.cc was
modified to avoid using RegionalMuonCand and instead use SAMuon from
OMTF.

L1Trigger/L1TMuonOverlapPhase1/src/Omtf/OMTFConfiguration.cc: fix in
procPhiOmtfToGlobalPhiOmtf
…n to match those defined in the upstream producer
@cmsbuild

Copy link
Copy Markdown
Contributor

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

It involves the following packages:

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

@BenjaminRS, @cmsbuild, @quinnanm can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @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

@cmsbuild

cmsbuild commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

cms-bot internal usage

@BenjaminRS

Copy link
Copy Markdown
Contributor

test parameters:

@BenjaminRS

Copy link
Copy Markdown
Contributor

please test

@cmsbuild

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 16KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-ae9318/54742/summary.html
COMMIT: ea9dce7
CMSSW: CMSSW_20_0_X_2026-07-14-1100/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/51474/54742/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 8 lines to the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 46
  • DQMHistoTests: Total histograms compared: 3535474
  • DQMHistoTests: Total failures: 37
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3535419
  • DQMHistoTests: Total skipped: 18
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 45 files compared)
  • Checked 200 log files, 167 edm output root files, 46 DQM output files
  • TriggerResults: no differences found

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