Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speed up shared-hits cleaning in TrackerSeedCleaner #47023

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

missirol
Copy link
Contributor

@missirol missirol commented Dec 22, 2024

PR description:

CMSHLT-3366 discusses one event with long processing time at HLT (~9 minutes online). It looks like most of this time is spent in the method RedundantSeedCleaner::clean (which is called from RedundantSeedCleaner::define, which in turn is called from TrackerSeedCleaner::clean).

This PR includes small technical changes to make the method in question faster (RedundantSeedCleaner is removed, and the relevant function is integrated in TrackerSeedCleaner itself). In the simplified example in [1] based on CMSHLT-3366, the instance in question of TSGFromL2Muon takes ~700 seconds pre-PR, and ~300 seconds post-PR.

Merely technical. No changes to physics outputs expected.

PR validation:

Using [2] to print properties of the seeds post-cleaning using the test in [1], one gets exactly the same printout before and after this PR.

[1]

#!/bin/bash

hltLabel=hlt
[ $# -lt 1 ] || hltLabel="${1}"

hltGetConfiguration /dev/CMSSW_14_2_0/GRun/V11 \
  --input root://eoscms.cern.ch//eos/cms/store/group/tsg/FOG/debug/241014_run386917/hlt-slow-event/run386917_ls0306_index000115.root \
  --data \
  --globaltag 141X_dataRun3_HLT_v2 \
  --output minimal \
  --no-prescale \
  --max-events 1 \
  --timing \
  --path HLT_Mu20NoFiltersNoVtxDisplaced_Photon20_CaloCustomId_v* \
  > "${hltLabel}".py

cat <<@EOF >> "${hltLabel}".py
del process.MessageLogger
process.load("FWCore.MessageLogger.MessageLogger_cfi")

process.source.skipEvents = cms.untracked.uint32( 91 )

process.options.numberOfThreads = 1
process.options.numberOfStreams = 0
@EOF

cmsRun "${hltLabel}".py &> "${hltLabel}".log
mv output.root "${hltLabel}".root

[2]

diff --git a/RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc b/RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc
index 029e8b47ad7..4b09c7bffd8 100644
--- a/RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc
+++ b/RecoMuon/TrackerSeedGenerator/src/TrackerSeedCleaner.cc
@@ -54,6 +54,10 @@ void TrackerSeedCleaner::clean(const reco::TrackRef& muR,
   if (cleanBySharedHits)
     removeRedundantSeeds(seeds);
 
+  for (auto const& seed : seeds) {
+     edm::LogPrint("TSC") << "TSC " << seed.nHits() << " " << seed.startingState().detId() << " " << seed.startingState().pt() << " " << seed.direction();
+  }
+
   theTTRHBuilder = theProxyService->eventSetup().getHandle(theTTRHBuilderToken);
 
   LogDebug("TrackerSeedCleaner") << seeds.size() << " trajectory seeds to the events before cleaning" << endl;

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:

N/A

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 22, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • RecoMuon/TrackerSeedGenerator (reconstruction)

@cmsbuild, @jfernan2, @mandrenguyen can you please review it and eventually sign? Thanks.
@CeliaFernandez, @Fedespring, @HuguesBrun, @abbiendi, @andrea21z, @bellan, @cericeci, @jhgoh, @rociovilar, @trocino this is something you requested to watch as well.
@antoniovilela, @mandrenguyen, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@jfernan2
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Size: This PR adds an extra 24KB to repository
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-2ad1a5/43599/summary.html
COMMIT: faa3212
CMSSW: CMSSW_15_0_X_2024-12-23-1100/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/47023/43599/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 10 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3818730
  • DQMHistoTests: Total failures: 471
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3818239
  • DQMHistoTests: Total skipped: 20
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 214 log files, 184 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@jfernan2
Copy link
Contributor

+1

@cmsbuild
Copy link
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, @antoniovilela, @sextonkennedy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@mandrenguyen
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit cb8c1e8 into cms-sw:master Dec 24, 2024
11 checks passed
@missirol missirol deleted the devel_CMSHLT3366 branch December 31, 2024 17:22
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