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

[14.0.X] store the hltobjects for Mass50 triggers #44746

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

pinchunchou
Copy link
Contributor

PR description:

We've encountered an issue with the Mass50 HLT triggers for double electrons (Ele15Ele10GsfMass50, DoubleEle10GsfMass50, and DoubleEle15GsfMass50) in both ppref and HI HLT menus. These HLT triggers are not storing any information in the hltobject trees, even though the events are being triggered. After investigating, we have identified that the problem lies with HLTEgammaCombMassFilter.

I have made some modifications to HLTEgammaCombMassFilter, and now the information is being stored in hltobject.

See slides: https://twiki.cern.ch/twiki/pub/CMS/HLT_HIon_Run3/pinchun20230928.pdf (P.8)

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 15, 2024

A new Pull Request was created by @pinchunchou for CMSSW_14_0_X.

It involves the following packages:

  • HLTrigger/Egamma (hlt)

@Martin-Grunewald, @mmusich, @cmsbuild can you please review it and eventually sign? Thanks.
@silviodonato, @Martin-Grunewald, @missirol this is something you requested to watch as well.
@rappoccio, @sextonkennedy, @antoniovilela you are the release manager for this.

cms-bot commands are listed here

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 15, 2024

cms-bot internal usage

@Martin-Grunewald
Copy link
Contributor

Martin-Grunewald commented Apr 16, 2024

You need to provide a PR to master branch (currently 14_1_X) first, and then link this PR to be its backport to 14_0.

@@ -45,6 +47,35 @@ bool HLTEgammaCombMassFilter::hltFilter(edm::Event& iEvent,
trigger::TriggerFilterObjectWithRefs& filterproduct) const {
//right, issue 1, we dont know if this is a TriggerElectron, TriggerPhoton, TriggerCluster (should never be a TriggerCluster btw as that implies the 4-vectors are not stored in AOD)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this comment still apply after the changes proposed here?

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 think this problem should already be solved after we applied the proposed change, but one can verify if this is really solved or not.

Copy link
Contributor

Choose a reason for hiding this comment

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

If it does, then please remove 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.

Sure, I have removed the comment. Thanks for the reminder!

@mmusich
Copy link
Contributor

mmusich commented Apr 17, 2024

@pinchunchou can you please address the comments?

@pinchunchou
Copy link
Contributor Author

You need to provide a PR to master branch (currently 14_1_X) first, and then link this PR to be its backport to 14_0.

Thanks for the reminder. I will do this

@cmsbuild
Copy link
Contributor

Pull request #44746 was updated. @cmsbuild, @mmusich, @Martin-Grunewald can you please check and sign again.

@cmsbuild
Copy link
Contributor

Pull request #44746 was updated. @mmusich, @cmsbuild, @Martin-Grunewald can you please check and sign again.

@pinchunchou
Copy link
Contributor Author

You need to provide a PR to master branch (currently 14_1_X) first, and then link this PR to be its backport to 14_0.

Thanks for the reminder. I will do this

PR to master branch: #44778

@mmusich
Copy link
Contributor

mmusich commented Apr 18, 2024

backport of #44778

@mmusich
Copy link
Contributor

mmusich commented Apr 18, 2024

type egamma, bug-fix

@mmusich
Copy link
Contributor

mmusich commented Apr 18, 2024

@cmsbuild, please test

@@ -35,6 +36,7 @@ void HLTEgammaCombMassFilter::fillDescriptions(edm::ConfigurationDescriptions& d
makeHLTFilterDescription(desc);
desc.add<edm::InputTag>("firstLegLastFilter", edm::InputTag("firstFilter"));
desc.add<edm::InputTag>("secondLegLastFilter", edm::InputTag("secondFilter"));
desc.add<edm::InputTag>("l1EGCand", edm::InputTag("hltL1IsoRecoEcalCandidate"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the default value of the tag is not realistic, and the PR has no changes to the python configs, I would naively expect some test to fail because of a misconfigured InputTag. Or not ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

scram b runtests passed without failures - if there are python configs where this parameter should be added, they are not used in testing. Are the configs where the module is called such as HLTrigger/Configuration/test/OnLine_HLT_FULL.py are expected to need changes?

Copy link
Contributor

Choose a reason for hiding this comment

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

fillDescriptions inserts values/parameters if they are missing in the py config, so no changes needed there.
However, if the default of a new parameter is not realistic, then it is either not used or misused. Please check!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @Martin-Grunewald , since it passes tests its unclear to me what is meant by the current value is unrealistic, could you clarify?
BTW if I remove that line (L39), when doing HLT emulation we would have error as below:

----- Begin Fatal Exception 17-Jun-2024 07:35:03 CEST-----------------------
An exception of category 'Configuration' occurred while
[0] Constructing the EventProcessor
[1] Constructing module: class=HLTEgammaCombMassFilter label='hltDoubleEle10Mass50PPRefFilter'
Exception Message:
MissingParameter: Parameter 'l1EGCand' not found.
----- End Fatal Exception -------------------------------------------------

And if I also remove L27 and L49-51, nothing will be stored in the hltobject. So I think we should keep it as it is?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the issue @missirol is referring to is the observation that hltL1IsoRecoEcalCandidate is not part of any recent menu, so there shouldn't be an object with that label in the Event. So it is weird!
Check whether/how l1EGCand is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes you are correct. In the modules for HIon HLT menu we should use hltEgammaCandidatesPPOnAA. I looked into the example you provided but not quite sure how to do the customisation for them, could you advice?

Copy link
Contributor

@missirol missirol Jun 18, 2024

Choose a reason for hiding this comment

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

It could be something as follows (did not test it).

diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py
index 4f116461823..0b027666ccc 100644
--- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py
+++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py
@@ -261,6 +261,13 @@ def checkHLTfor43774(process):
 
     return process
     
+def customizeHLTfor44746(process):
+    for modLabel in ['hltDoubleEle10Mass50PPOnAAFilter', 'hltDoubleEle15Mass50PPOnAAFilter']:
+        if hasattr(process, modLabel):
+            mod = getattr(process, modLabel)
+            mod.l1EGCand = cms.InputTag('hltEgammaCandidatesPPOnAA')
+    return process
+
 # CMSSW version specific customizations
 def customizeHLTforCMSSW(process, menuType="GRun"):
 
@@ -270,5 +277,6 @@ def customizeHLTforCMSSW(process, menuType="GRun"):
     # process = customiseFor12718(process)
 
     process = checkHLTfor43774(process)
+    process = customizeHLTfor44746(process)
 
     return process

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I have applied the changes here as well as at PR #44778 in the latest squashed commits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry there seems to be some merge conflicts. I am trying to deal with them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The conflicts are solved.

PrevFilterOutput->getObjects(trigger::TriggerElectron, eleCandsPrev);

if (!phoCandsPrev.empty()) {
for (auto& phoCand : phoCandsPrev) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would auto const& work, instead ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure I will fix it, thanks for pointing this out

Copy link
Contributor Author

@pinchunchou pinchunchou Jun 17, 2024

Choose a reason for hiding this comment

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

This is fixed accordingly in the latest commits.

Comment on lines 67 to 114
}
} else if (!clusCandsPrev.empty()) {
for (auto& clusCand : clusCandsPrev) {
filterproduct.addObject(trigger::TriggerCluster, clusCand);
}
} else if (!eleCandsPrev.empty()) {
for (auto& eleCand : eleCandsPrev) {
filterproduct.addObject(trigger::TriggerElectron, eleCand);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Normally (but I guess there is no universal rule on this), the trigger objects are added for those candidates which pass some kinematic/trigger selection inside the HLTFilter, e.g. the candidates forming pairs passing the mass cut. Here, it seems that simply every candidate is saved regardless. Is this really intended ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure I will try to fix it, thanks for pointing this out

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem has been fixed in the latest commits.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b35ec9/38942/summary.html
COMMIT: 1dab41d
CMSSW: CMSSW_14_0_X_2024-04-18-1100/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/44746/38942/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

@Martin-Grunewald
Copy link
Contributor

code-checks

@cmsbuild
Copy link
Contributor

cmsbuild commented May 2, 2024

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-44746/40148

  • This PR adds an extra 20KB to repository

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

@missirol
Copy link
Contributor

missirol commented May 5, 2024

@pinchunchou

No reply to review comments in over 2 weeks. What is the plan for this PR ?

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 3, 2024

Pull request #44746 was updated. @Martin-Grunewald, @cmsbuild, @mmusich can you please check and sign again.

@pinchunchou
Copy link
Contributor Author

Hmm, looks like merging of #45302 just now leads to a merge conflict in this PR.

@pinchunchou please fix this PR.

fixed

@Martin-Grunewald
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 3, 2024

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b35ec9/40192/summary.html
COMMIT: 73b2adb
CMSSW: CMSSW_14_0_X_2024-07-02-2300/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/44746/40192/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

@Martin-Grunewald
Copy link
Contributor

+1

@Martin-Grunewald
Copy link
Contributor

urgent

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 3, 2024

This pull request is fully signed and it will be integrated in one of the next CMSSW_14_0_X IBs (tests are also fine) and once validation in the development release cycle CMSSW_14_1_X is complete. This pull request will now be reviewed by the release team before it's merged. @antoniovilela, @sextonkennedy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@Martin-Grunewald
Copy link
Contributor

@rappoccio @antoniovilela Merge conflicts resolved by author, this PR is now ready to go into 14_0, please merge.

@antoniovilela
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 7289f53 into cms-sw:CMSSW_14_0_X Jul 3, 2024
10 checks passed
@antoniovilela
Copy link
Contributor

@rappoccio @antoniovilela Merge conflicts resolved by author, this PR is now ready to go into 14_0, please merge.

@Martin-Grunewald @cms-sw/hlt-l2
Martin, always use @cms-sw/orp-l2 to mention us (which I can more easily filter).
In general, not only this PR, (also) add the hlt-integration label, especially close to a new menu. This will allow me to keep track of what is needed for the HLT menu, as has already been discussed in the past.

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.

7 participants