Skip to content

[16.0.X] add best track index to determine which electron charge to use in ScoutingDileptonMonitor#50494

Merged
cmsbuild merged 1 commit into
cms-sw:CMSSW_16_0_Xfrom
mmusich:ScoutingDileptonMonitor_bestTrack_16_0_X
Mar 24, 2026
Merged

[16.0.X] add best track index to determine which electron charge to use in ScoutingDileptonMonitor#50494
cmsbuild merged 1 commit into
cms-sw:CMSSW_16_0_Xfrom
mmusich:ScoutingDileptonMonitor_bestTrack_16_0_X

Conversation

@mmusich

@mmusich mmusich commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

backport of #50474

PR description:

This is PR is based off #50457.

  • 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:

backport of #50474 to the 2026 data-taking release.

@cmsbuild

cmsbuild commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

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

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

@cmsbuild

cmsbuild commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

cms-bot internal usage

@gabrielmscampos

Copy link
Copy Markdown
Member

please test

@gabrielmscampos

Copy link
Copy Markdown
Member

please abort

@gabrielmscampos

Copy link
Copy Markdown
Member

test parameters:

  • addpkg = DQM/Integration

@gabrielmscampos

Copy link
Copy Markdown
Member

please test

@mmusich

mmusich commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

@cmsbuild please abort

@mmusich

mmusich commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

This needs to be tested with #50457

@mmusich

mmusich commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

test parameters:

@mmusich

mmusich commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

@cmsbuild, please test

@cmsbuild

Copy link
Copy Markdown
Contributor

+1

Size: This PR adds an extra 20KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-1a925f/52152/summary.html
COMMIT: ce84da0
CMSSW: CMSSW_16_0_X_2026-03-23-1100/el8_amd64_gcc13
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/50494/52152/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 7 lines to the logs
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 10 differences found in the comparisons
  • DQMHistoTests: Total files compared: 53
  • DQMHistoTests: Total histograms compared: 4166533
  • DQMHistoTests: Total failures: 361
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 4166152
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 34.708 KiB( 52 files compared)
  • DQMHistoSizes: changed ( 18434.0,... ): 8.677 KiB HLT/ScoutingOffline
  • Checked 227 log files, 198 edm output root files, 53 DQM output files
  • TriggerResults: found differences in 1 / 51 workflows

@gabrielmscampos

Copy link
Copy Markdown
Member

+dqm

  • Tests passed on DQM P5 playback environment, running on top of CMSSW_16_0_4+50457.

@cmsbuild

Copy link
Copy Markdown
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_16_0_X IBs (tests are also fine) and once validation in the development release cycle CMSSW_16_1_X is complete. This pull request will now be reviewed by the release team before it's merged. @sextonkennedy, @mandrenguyen, @ftenchini (and backports should be raised in the release meeting by the corresponding L2)
Notice This PR was tested with additional Pull Request(s), please also merge them if necessary: #50457

@ftenchini

Copy link
Copy Markdown
Contributor

+1

@cmsbuild
cmsbuild merged commit c3f0906 into cms-sw:CMSSW_16_0_X Mar 24, 2026
9 checks passed
@mmusich
mmusich deleted the ScoutingDileptonMonitor_bestTrack_16_0_X branch March 24, 2026 16:28
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