Skip to content

add best track index to determine which electron charge to use in ScoutingDileptonMonitor#50474

Merged
cmsbuild merged 1 commit into
cms-sw:masterfrom
mmusich:ScoutingDileptonMonitor_bestTrack
Mar 23, 2026
Merged

add best track index to determine which electron charge to use in ScoutingDileptonMonitor#50474
cmsbuild merged 1 commit into
cms-sw:masterfrom
mmusich:ScoutingDileptonMonitor_bestTrack

Conversation

@mmusich

@mmusich mmusich commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

PR description:

This is PR is based off #50444.

  • Extend ScoutingDileptonMonitor to use a configurable “best track” per lepton instead of a single fixed track source.
  • Introduce logic to select the optimal track (e.g. best quality/fit) among available candidates.
  • Update invariant mass and kinematic calculatations to consistently use this chosen best track.
  • Improve handling of missing or invalid track references (safer fallback behavior).
  • Refactor code structure to separate track selection from monitoring logic.
  • Simplify and clean up duplicated code paths related to track access.
  • Update histogram filling to reflect the new best-track choice.
  • Adjust configuration parameters to allow flexibility in track selection.
  • Minor style/modernization improvements (readability, const-correctness).

Overall: more robust and physically meaningful dilepton monitoring using optimal track information.

PR validation:

scram b runtests_TestDQMOnlineClient-ngt_dqm_sourceclient
scram b runtests_TestDQMOnlineClient-scouting_dqm_sourceclient
runTheMatrix.py -l 18434.0 -t 4 -j 8

all run fine.
Using the following script, running on scouting events obtained running of the ZtoEE RAW-RECO skim of 2025 data:

#!/bin/bash -ex

LOCALPATH='/eos/cms/store/group/tsg-phase2/user/jprendi/NERD25/MoreStats/EGammas/HLT/'
echo "Input source: |${LOCALPATH}|"
LOCALFILES=$(ls -1 ${LOCALPATH} | grep Scouting)
ALL_FILES=""
for f in ${LOCALFILES[@]}; do
    ALL_FILES+="file:${LOCALPATH}/${f},"
done

# Remove the last character
ALL_FILES="${ALL_FILES%?}"
echo "Discovered files: $ALL_FILES"

cmsDriver.py step2 -s DQM:hltScoutingCollectionMonitor+hltScoutingDileptonMonitor+hltScoutingPi0Monitor \
             --conditions 160X_dataRun3_HLT_v1 \
             --datatier DQMIO \
             -n -1 \
             --eventcontent DQMIO \
             --geometry DB:Extended \
             --era Run3_2025 \
             --filein file:$ALL_FILES \
             --fileout file:step2.root \
             --nThreads 24 \
             --python_filename dqm.py \
             --no_exec

cat <<@EOF >> dqm.py
# import best track producer
from PhysicsTools.Scouting.Run3ScoutingElectronBestTrackProducer_cfi import Run3ScoutingElectronBestTrackProducer
process.run3ScoutingElectronBestTrack =  Run3ScoutingElectronBestTrackProducer.clone()
# import beamspot
from RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi import onlineBeamSpotProducer as _onlineBeamSpotProducer
process.hltOnlineBeamSpot = _onlineBeamSpotProducer.clone()
process.scoutingCollectionMonitor.onlineMetaDataDigis = "hltOnlineMetaDataDigis"
process.scoutingCollectionMonitor.onlyScouting = True
process.dqmoffline_step = cms.EndPath(process.hltOnlineBeamSpot+process.hltScoutingCollectionMonitor+process.run3ScoutingElectronBestTrack+process.hltScoutingDileptonMonitor+process.hltScoutingPi0Monitor)
@EOF

cmsRun dqm.py >& dqm.log

cmsDriver.py step3 -s HARVESTING:@hltScouting \
         --conditions 160X_dataRun3_HLT_v1 \
         --data \
         --geometry DB:Extended \
         --scenario pp \
         --filetype DQM \
         --era Run3_2025 \
         -n 10000 \
         --filein file:step2.root \
         --fileout file:step3.root \
         --no_exec

cmsRun step3_HARVESTING.py >& harvesting.log

we observe a substantial increase of the Z→ee event yield.

image

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:

Not a backport, it will be backported to CMSSW_16_0_X for 2026 data-taking operations.

@cmsbuild

cmsbuild commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

cms-bot internal usage

@cmsbuild

Copy link
Copy Markdown
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-50474/48613

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild

Copy link
Copy Markdown
Contributor

@cmsbuild

Copy link
Copy Markdown
Contributor

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

It involves the following packages:

  • DQMOffline/HLTScouting (dqm)
  • HLTriggerOffline/Scouting (dqm)

@cmsbuild, @ctarricone, @gabrielmscampos, @nothingface0, @rseidita can you please review it and eventually sign? Thanks.
@missirol, @mtosi, @rociovilar 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

@mmusich

mmusich commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

@cmsbuild, please test

@cmsbuild

Copy link
Copy Markdown
Contributor

-1

Failed Tests: UnitTests
Size: This PR adds an extra 24KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-551595/52099/summary.html
COMMIT: 53a2494
CMSSW: CMSSW_16_1_X_2026-03-18-2300/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/50474/52099/install.sh to create a dev area with all the needed externals and cmssw changes.

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:

You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-551595/52099/git-recent-commits.json
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-551595/52099/git-merge-result

Failed Unit Tests

I found 1 errors in the following unit tests:

---> test Zmumuall had ERRORS

Comparison Summary

Summary:

  • You potentially removed 200 lines from the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 20742 differences found in the comparisons
  • DQMHistoTests: Total files compared: 53
  • DQMHistoTests: Total histograms compared: 4185208
  • DQMHistoTests: Total failures: 3238
  • DQMHistoTests: Total nulls: 23
  • DQMHistoTests: Total successes: 4181927
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 31.630000000000003 KiB( 52 files compared)
  • DQMHistoSizes: changed ( 18434.0,... ): 8.677 KiB HLT/ScoutingOffline
  • DQMHistoSizes: changed ( 2024.0000001,... ): -0.381 KiB SiStrip/MechanicalView
  • DQMHistoSizes: changed ( 2024.0000001 ): 0.012 KiB JetMET/SUSYDQM
  • DQMHistoSizes: changed ( 2024.0010001 ): -0.020 KiB JetMET/SUSYDQM
  • DQMHistoSizes: changed ( 2024.0020001 ): -0.008 KiB JetMET/SUSYDQM
  • DQMHistoSizes: changed ( 2024.0040001 ): -0.062 KiB JetMET/SUSYDQM
  • DQMHistoSizes: changed ( 2024.0050001 ): 0.035 KiB JetMET/SUSYDQM
  • DQMHistoSizes: changed ( 2024.0060001 ): 0.008 KiB JetMET/SUSYDQM
  • DQMHistoSizes: changed ( 2024.0070001 ): 0.004 KiB JetMET/SUSYDQM
  • Checked 227 log files, 198 edm output root files, 53 DQM output files
  • TriggerResults: found differences in 3 / 51 workflows

@mmusich

mmusich commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

@cmsbuild, please test

  • let's try in the new IB

@cmsbuild

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 24KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-551595/52102/summary.html
COMMIT: 53a2494
CMSSW: CMSSW_16_1_X_2026-03-19-1100/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/50474/52102/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 1 lines to the logs
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 53
  • DQMHistoTests: Total histograms compared: 4185284
  • DQMHistoTests: Total failures: 67
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 4185197
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 8.368 KiB( 52 files compared)
  • DQMHistoSizes: changed ( 18434.0,... ): 2.092 KiB HLT/ScoutingOffline
  • Checked 227 log files, 198 edm output root files, 53 DQM output files
  • TriggerResults: no differences found

Comment thread HLTriggerOffline/Scouting/plugins/ScoutingDileptonMonitor.cc
@cmsbuild

Copy link
Copy Markdown
Contributor

@cmsbuild

Copy link
Copy Markdown
Contributor

Pull request #50474 was updated. @cmsbuild, @ctarricone, @gabrielmscampos, @nothingface0, @rseidita can you please check and sign again.

@mmusich

mmusich commented Mar 20, 2026

Copy link
Copy Markdown
Contributor Author

test parameters:

  • addpkg = DQM/Integration

@mmusich

mmusich commented Mar 20, 2026

Copy link
Copy Markdown
Contributor Author

@cmsbuild, please test

@cmsbuild

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 24KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-551595/52109/summary.html
COMMIT: bf0b30c
CMSSW: CMSSW_16_1_X_2026-03-19-2300/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/50474/52109/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 1 lines to the logs
  • Reco comparison results: 13 differences found in the comparisons
  • DQMHistoTests: Total files compared: 53
  • DQMHistoTests: Total histograms compared: 4185284
  • DQMHistoTests: Total failures: 55
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 4185209
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 8.368 KiB( 52 files compared)
  • DQMHistoSizes: changed ( 18434.0,... ): 2.092 KiB HLT/ScoutingOffline
  • Checked 227 log files, 198 edm output root files, 53 DQM output files
  • TriggerResults: no differences found

@gabrielmscampos

Copy link
Copy Markdown
Member

+dqm

@cmsbuild

Copy link
Copy Markdown
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @mandrenguyen, @sextonkennedy, @ftenchini (and backports should be raised in the release meeting by the corresponding L2)

@ftenchini

Copy link
Copy Markdown
Contributor

+1

@cmsbuild
cmsbuild merged commit cf5b3a0 into cms-sw:master Mar 23, 2026
11 checks passed
@mmusich
mmusich deleted the ScoutingDileptonMonitor_bestTrack branch March 23, 2026 16:09
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.

4 participants