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

Refactore PropagateToMuon and add propagation to L3 muon filters at HLT #37180

Merged
merged 2 commits into from Mar 22, 2022

Conversation

JanFSchulte
Copy link
Contributor

@JanFSchulte JanFSchulte commented Mar 8, 2022

Follow-up to #37086, adding the propagation of the L3 muon trajectory to the second muon station for the L3-L1 matching in a handful of HLT filters.

Out of the suggestions made by @makortel in that PR to improve the code, I opted to refactor the PropagateToMuon class into two classes.

We re-checked the HLT timing and as before we do not observe a significant change when we add the propgation (compare blue and black):
image

In terms of rates, no significant change is observed for higher-pt muon triggers, such as IsoMu24. Changes are observed for low-pT muon triggers, especially the Bs->mumu trigger HLT_DoubleMu4_3_Bs_v14, which goes from ~15 to ~22 Hz. We observe that the HLT efficiency for Bs->mumu candidates passing the analysis selection improves from ~75% to ~90%, so a good deal of the rate increase is coming from genuine Bs that BPH needs for analysis.

Full rate results are here: https://jschulte.web.cern.ch/jschulte/rates/

fyi @missirol @khaosmos93

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 8, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37180/28748

  • This PR adds an extra 76KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 8, 2022

A new Pull Request was created by @JanFSchulte (Jan-Frederik Schulte) for master.

It involves the following packages:

  • DQMOffline/L1Trigger (dqm, l1)
  • HLTrigger/Configuration (hlt)
  • HLTrigger/Muon (hlt)
  • L1Trigger/L1TNtuples (l1)
  • MuonAnalysis/MuonAssociators (analysis)

@Martin-Grunewald, @rekovic, @epalencia, @emanueleusai, @ahmad3213, @cmsbuild, @missirol, @jfernan2, @pmandrik, @santocch, @cecilecaillol, @pbo0, @rvenditti can you please review it and eventually sign? Thanks.
@HuguesBrun, @CeliaFernandez, @calderona, @silviodonato, @abbiendi, @jhgoh, @Martin-Grunewald, @bellan, @sscruz, @Fedespring, @thomreis, @dinyar, @battibass, @missirol, @rociovilar, @trocino, @cericeci, @kreczko this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

process.load("TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAny_cfi")
process.load("TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi")
process.load("TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi")
return process
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is loading all these needed? Are these for various possible options but only one is used in the end?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HLT menu already contains:

process.SteppingHelixPropagatorAny = cms.ESProducer( "SteppingHelixPropagatorESProducer",
process.hltESPFastSteppingHelixPropagatorAny = cms.ESProducer( "SteppingHelixPropagatorESProducer",
process.hltESPFastSteppingHelixPropagatorOpposite = cms.ESProducer( "SteppingHelixPropagatorESProducer",
process.hltESPSteppingHelixPropagatorAlong = cms.ESProducer( "SteppingHelixPropagatorESProducer",
process.hltESPSteppingHelixPropagatorOpposite = cms.ESProducer( "SteppingHelixPropagatorESProducer",

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps some cleanup and rationalisation is needed!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did make the label if the propagators configurable so the ones already in the menu can be used.
There is indeed some logic that chooses the propagator that is used in the code:

const Propagator *propagatorBarrel = &*propagator_;
const Propagator *propagatorEndcaps = &*propagator_;
if (whichState_ != AtVertex) {
if (start.position().perp() > barrelCylinder_->radius())
propagatorBarrel = &*propagatorOpposite_;
if (fabs(start.position().z()) > endcapDiskPos_[useMB2_ ? 2 : 1]->position().z())
propagatorEndcaps = &*propagatorOpposite_;
}
if (cosmicPropagation_) {
if (start.momentum().dot(GlobalVector(start.position().x(), start.position().y(), start.position().z())) < 0) {
// must flip the propagations
propagatorBarrel = (propagatorBarrel == &*propagator_ ? &*propagatorOpposite_ : &*propagator_);
propagatorEndcaps = (propagatorEndcaps == &*propagator_ ? &*propagatorOpposite_ : &*propagator_);
}
}

From what I can see, only the Along and Opposite are actually being used, so the Any could in principle be left out.

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 9, 2022

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37180/28763

  • This PR adds an extra 36KB to repository

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

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 9, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37180/28764

  • This PR adds an extra 144KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 9, 2022

Pull request #37180 was updated. @Martin-Grunewald, @rekovic, @epalencia, @emanueleusai, @ahmad3213, @cmsbuild, @missirol, @jfernan2, @pmandrik, @santocch, @cecilecaillol, @pbo0, @rvenditti can you please check and sign again.

@JanFSchulte
Copy link
Contributor Author

I should note that without this customization, the tests will fail because HLT crashes: https://github.com/cms-sw/cmssw/pull/37180/files#diff-8fc23ee531566af47b6eff1b354bb3db1c4e8f3925413edc3632e417d168b75fR158

Copy link
Contributor

@missirol missirol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a first look from my side.

Support for other muon stations will be added on request.

\class PropagateToMuonCore PropagateToMuonCore.h
"HLTriggerOffline/Muon/interface/PropagateToMuonCore.h" \brief Propagate an
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"HLTriggerOffline/Muon/interface/PropagateToMuonCore.h" \brief Propagate an
\brief Propagate an

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

public:
explicit PropagateToMuon(const edm::ParameterSet &iConfig, edm::ConsumesCollector);
~PropagateToMuon();
//This is a nearly identical copy to MuonAnalysis/MuonAssociators/interface/PropagateToMuonCore.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this comment. Isn't this file the same that contains the comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a nearly identical copy of the PropagateToMuon class, for reasons I don't know, in HLTrigger/Offline, and I somewhat randomly used that one as the starting point for the refactoring, hence the leftover comment. I removed it.

object (usually a track) to the second muon station. Support for other muon
stations will be added on request.

\author Giovanni Petrucciani
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would either remove the name(s) altogether, or add your name too to signal that the class has been reworked.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Comment on lines 1 to 2
#ifndef HLTriggerOffline_Muon_interface_trackStateEnums_h
#define HLTriggerOffline_Muon_interface_trackStateEnums_h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Comment on lines 200 to 201
Chi2MeasurementEstimator estimator(1e10,
3.); // require compatibility at 3 sigma
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Chi2MeasurementEstimator estimator(1e10,
3.); // require compatibility at 3 sigma
// require compatibility at 3 sigma
Chi2MeasurementEstimator estimator(1e10, 3.);

Avoid wierd break by code-format by moving comment above line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

filter.propagatorAny = cms.ESInputTag("", "SteppingHelixPropagatorAny")
filter.propagatorOpposite = cms.ESInputTag("", "hltESPSteppingHelixPropagatorOpposite")

return process
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

customizeFor37180 also needs to be called inside customizeHLTforCMSSW (the latter contains examples).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -21,6 +23,7 @@ class HLTMuonTrkL1TFilter : public HLTFilter {
trigger::TriggerFilterObjectWithRefs& filterproduct) const override;

private:
mutable PropagateToMuonInterface propInt_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mutable PropagateToMuonInterface propInt_;
const PropagateToMuonInterface propInt_;

I didn't see the need to use mutable anymore (here and in other similar places). No?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, that was an oversight, fixed.

Comment on lines 117 to 123
desc.add<bool>("useSimpleGeometry", true);
desc.add<bool>("useStation2", true);
desc.add<string>("useTrack", "tracker");
desc.add<string>("useState", "atVertex");
desc.add<edm::ESInputTag>("propagatorAlong", edm::ESInputTag("", "hltESPSteppingHelixPropagatorAlong"));
desc.add<edm::ESInputTag>("propagatorAny", edm::ESInputTag("", "SteppingHelixPropagatorAny"));
desc.add<edm::ESInputTag>("propagatorOpposite", edm::ESInputTag("", "hltESPSteppingHelixPropagatorOpposite"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To factorise better, this is probably a good candidate for PropagateToMuonInterface::fillPSetDescription, so the lines here would become a single call to that static function (there are various examples of fillPSetDescription in CMSSW).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, done.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37180/28787

  • This PR adds an extra 36KB to repository

@JanFSchulte
Copy link
Contributor Author

I won't get around to resolving the duplication immediately, so I'll create an issue for the moment.

@perrotta
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37180/28921

  • This PR adds an extra 68KB to repository

@cmsbuild
Copy link
Contributor

Pull request #37180 was updated. @rekovic, @epalencia, @emanueleusai, @ahmad3213, @Martin-Grunewald, @missirol, @jfernan2, @pmandrik, @santocch, @cecilecaillol, @pbo0, @rvenditti can you please check and sign again.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-9dc230/23256/summary.html
COMMIT: 972fe57
CMSSW: CMSSW_12_4_X_2022-03-21-1100/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/37180/23256/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

@slava77 comparisons for the following workflows were not done due to missing matrix map:

  • /data/cmsbld/jenkins/workspace/compare-root-files-short-matrix/data/PR-9dc230/39434.911_TTbar_14TeV+2026D88_DD4hep+TTbar_14TeV_TuneCP5_GenSimHLBeamSpot14+DigiTrigger+RecoGlobal+HARVESTGlobal

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 2 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3695650
  • DQMHistoTests: Total failures: 51214
  • DQMHistoTests: Total nulls: 64
  • DQMHistoTests: Total successes: 3644350
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.004 KiB( 48 files compared)
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 204 log files, 45 edm output root files, 49 DQM output files
  • TriggerResults: found differences in 1 / 48 workflows

@perrotta
Copy link
Contributor

+1

  • This PR was already fully signed, and the last update only cleaned it up from a few unused header include: it can be merged now without waiting for it being signed once again by all categories involved

@perrotta
Copy link
Contributor

merge

@cmsbuild cmsbuild merged commit 6c53647 into cms-sw:master Mar 22, 2022
@missirol
Copy link
Contributor

+hlt

@JanFSchulte , please open the backport PR to 12_3_X.

@jfernan2
Copy link
Contributor

+1
For the records

@santocch
Copy link

+1

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.

None yet