-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fixes for L3 and L1 trigger object matching in Muon HLT #37086
Conversation
…matching in HLTMuonL1TFilter
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37086/28571
|
A new Pull Request was created by @JanFSchulte (Jan-Frederik Schulte) for master. It involves the following packages:
@cmsbuild, @missirol, @Martin-Grunewald can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
@@ -45,6 +46,8 @@ class HLTMuonDimuonL3Filter : public HLTFilter { | |||
const reco::RecoChargedCandidateRef&, | |||
const reco::BeamSpot&, | |||
const edm::ESHandle<MagneticField>&) const; | |||
|
|||
mutable PropagateToMuon prop_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the mutable
attribute here might clash with the need to use this object inside a global
module (which HLTFilter
is). Maybe one step in the right direction is to use std::atomic
. I can't judge with certainty, so I would kindly ask advise from @cms-sw/core-l2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a quick look PropagateToMuon::init()
appears to set various member variables, and intended to be called on each event, so the use of mutable
here indeed looks unsafe. The std::atomic
won't help for many reasons, and any synchronization mechanism (like std::mutex
) would be bad because the critical section is essentially the duration of the entire filter()
method.
Here are some alternatives (in no particular order)
- place
PropagateToMuon
object into anedm::StreamCache
(or make the entire moduleedm::stream
, but that might well be an overkill) - refactor
PropagateToMuon
into two classes such that- one class contains the current constructor and the
init()
function (asconst
), but instead of writing to member variables, it would create an object of an another class (below) - another class that contains the member variables currently being written to in
init()
, and all theextrapolate() const
methods
- one class contains the current constructor and the
- move
PropagateToMuon
into EventSetup, in which case theESProducer
would take the role of the current constructor, and theESProcucer::produce()
+ the constructor ofPropagateToMuon
would take the role of the currentinit()
method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @makortel . @JanFSchulte , I think this point will need to be addressed before moving forward with this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback @makortel @missirol . Given that the impact on the HLT performance is minimal and we included this update mostly because it is technically the more correct way to perform the matching, I am not sure the effort is worth the gain. We might end up going with the just the fix to the L1 filter that is unaffected by this question and is an actual performance improvement.
if (deltaR2(muon->eta(), muon->phi(), prevMuons[it2]->eta(), prevMuons[it2]->phi()) < 0.1) | ||
matchPrevL1 = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (deltaR2(muon->eta(), muon->phi(), prevMuons[it2]->eta(), prevMuons[it2]->phi()) < 0.1) | |
matchPrevL1 = true; | |
} | |
if (reco::deltaR2(muon->eta(), muon->phi(), prevMuons[it2]->eta(), prevMuons[it2]->phi()) < maxDeltaR2_){ | |
matchPrevL1 = true; | |
break; | |
} | |
} |
Looks like the 0.1 qualifies as "magic number" here, so it would need to be replaced by a configuration parameter (held by a class member as in the suggested snippet). Also, is 0.1 the threshold for Delta-R or Delta-R^2 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made the 0.1 configurable in the factorized PR. In the way it's currently used, it is basically arbitrary since the parameters of the L1 candidates that need to be matched are identical.
-1 Failed Tests: RelVals RelVals-INPUT AddOn RelVals
RelVals-INPUT
AddOn Tests
|
We have decided to factorize this PR and proceed with the more urgent, and much easier fix for the L1 candidate matching in #37110. Closing this PR for now and will follow up once we have solved the concerns for the muon propagation. |
This PR improves the matching of L3 and L1 candidates in filters in the Muon HLT in two ways:
For L3/L1 matching, the L3 muon is now propagated to the second muon station, since L1 parameters are defined there. This improves matching efficiency for very low pT muons. This change has negligible impact on overall HLT performance. Total HLT rate is virtually unchange (0.04% increase). Timing is virtually unchange as well, despite the added propagation (black is without, red is with the propagation)
In HLTMuonL1TFilter a match between L1 muons before and after different filters is performed. Currently the code expects the muons that are compared to be in the same collection. However, there are use cases in the current menu where the matching is performed with a copy of the L1 muon collection and thus always fails. This causes an inefficiency for low pT muons that are reconstructed only by L1-seeded reconstruction steps. Impact is mostly negligible, showing tiny efficiency improvements for high-pT muon from the Z:
Effect gets more visible for lower pT muons, for example in the turnon of the double-muon trigger:
However, the effect is significant for very low pT leptons. For the muon Bs -> mumu trigger (HLT_DoubleMu4_3_Bs_v14) we find a ~20% improvement of HLT efficiency on a sample of signal events provided by BPH.