-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
avoid duplicates in HLTPMMassFilter
plugin
#40918
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-40918/34403
|
A new Pull Request was created by @missirol (Marino Missiroli) 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 |
if (mass >= lowerMassCut_ && mass <= upperMassCut_) { | ||
if (isGoodPair(pEleCh1[jj], pEleCh1[ii])) { | ||
n++; | ||
refele = electrons[ii]; | ||
filterproduct.addObject(TriggerElectron, refele); | ||
refele = electrons[jj]; | ||
filterproduct.addObject(TriggerElectron, refele); | ||
for (auto const idx : {jj, ii}) { | ||
if (save_cand[idx]) | ||
filterproduct.addObject(TriggerElectron, electrons[idx]); | ||
save_cand[idx] = false; | ||
} |
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.
In the isElectron1_ && isElectron2_
case, there is no change in how candidate pairs are counted (as the nested loop was already considering only unique pairs). The only change is that the same TriggerElectron
is not added more than once to the output product.
std::vector<bool> save_cand(scs.size(), true); | ||
for (unsigned int jj = 0; jj < scs.size(); jj++) { | ||
TLorentzVector p1Ele = pEleCh1.at(jj); | ||
for (unsigned int ii = 0; ii < scs.size(); ii++) { | ||
TLorentzVector p2Ele = pEleCh2.at(ii); | ||
|
||
if (fabs(p1Ele.E() - p2Ele.E()) < 0.00001) | ||
continue; | ||
|
||
TLorentzVector pTot = p1Ele + p2Ele; | ||
double mass = pTot.M(); | ||
|
||
if (mass >= lowerMassCut_ && mass <= upperMassCut_) { | ||
for (unsigned int ii = jj + 1; ii < scs.size(); ii++) { | ||
if (isGoodPair(pEleCh1[jj], pEleCh2[ii]) or isGoodPair(pEleCh2[jj], pEleCh1[ii])) { | ||
n++; | ||
refsc = scs[ii]; | ||
filterproduct.addObject(TriggerCluster, refsc); | ||
refsc = scs[jj]; | ||
filterproduct.addObject(TriggerCluster, refsc); | ||
for (auto const idx : {jj, ii}) { | ||
if (save_cand[idx]) | ||
filterproduct.addObject(TriggerCluster, scs[idx]); | ||
save_cand[idx] = false; | ||
} |
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.
In the non-isElectron1_ && isElectron2_
case, there is a change in how candidate pairs are counted, as (1) the case jj == ii
is explicitly skipped (supposedly it was effectively skipped pre-PR too, because of the requirement on delta-Energy), and (2) a given pair of TriggerCluster
s is only counted at most once: a given pair is considered 'good' if it passes the selection under the "plus minus" or "minus plus" hypothesis, while pre-PR the pair was counted twice when both hypotheses were passing the selection (because both indices of the nested loop ranged from 0 to size-1). Here too, a given TriggerCluster
is added at most once to the output product, unlike in the pre-PR implementation.
enable gpu Nothing to do with GPUs, but to test this change with the HLT GPU reconstruction on. (potentially different inputs to the filter in question.) |
please test |
type bugfix |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-7258b4/30977/summary.html Comparison SummarySummary:
GPU Comparison SummarySummary:
|
The differences in DQM outputs for wf 11634.7 ( |
assign egamma-pog Since this HLT filter is mostly related to E/gamma, I would kindly ask the POG to review this PR. It is not really urgent, but if this PR proceeds quickly, its backport might be included in |
New categories assigned: egamma-pog @a-kapoor,@swagata87 you have been requested to review this Pull request/Issue and eventually sign? Thanks |
|
||
if (mass >= lowerMassCut_ && mass <= upperMassCut_) { | ||
for (unsigned int ii = jj + 1; ii < scs.size(); ii++) { | ||
if (isGoodPair(pEleCh1[jj], pEleCh2[ii]) or isGoodPair(pEleCh2[jj], pEleCh1[ii])) { |
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 (isGoodPair(pEleCh1[jj], pEleCh2[ii]) ) {
will suffice, and the or
with isGoodPair(pEleCh2[jj], pEleCh1[ii])
can be dropped; because the way isGoodPair
function is written, it does not differentiate between electron and positron
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.
or maybe keep it to be safe, running on 1K Zee events I do not see any change in results with and w/o the or
, but I'm not sure if low-pT would be affected by a wrong charge hypothesis. The way it is now seems safer approach.
+1
|
Thanks for the checks and comments, @swagata87 . |
+hlt |
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. @perrotta, @dpiparo, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
This PR modifies the plugin
HLTPMMassFilter
in order to (1) consider a given pair of candidates only once when counting how many pairs pass the selection requirements, and (2) avoid duplicates in the candidates added to theTriggerFilterObjectWithRefs
output product of this plugin.Discussed in CMSHLT-2635.
PR description:
None.
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:
CMSSW_13_0_X