-
Notifications
You must be signed in to change notification settings - Fork 4.6k
HcalPFCuts database table and relevant infrastructure #41128
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
Conversation
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41128/34775
|
|
A new Pull Request was created by @igv4321 (Igor Volobouev) for master. It involves the following packages:
@cmsbuild, @tvami, @saumyaphor4252, @francescobrivio can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
| @@ -0,0 +1,37 @@ | |||
| #ifndef HcalPFCutsHandler_h | |||
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.
| #ifndef HcalPFCutsHandler_h | |
| #ifndef CondTools_Hcal_HcalPFCutsHandler_h |
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.
Done
| #include "FWCore/Framework/interface/MakerMacros.h" | ||
| #include "CondCore/PopCon/interface/PopConSourceHandler.h" | ||
|
|
||
| #include "FWCore/Framework/interface/Event.h" | ||
| #include "DataFormats/Common/interface/Handle.h" | ||
| #include "FWCore/Framework/interface/EventSetup.h" | ||
| // user include files | ||
| #include "CondFormats/HcalObjects/interface/HcalPFCuts.h" | ||
| #include "CondFormats/DataRecord/interface/HcalPFCutsRcd.h" | ||
| #include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h" |
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.
please alpha order these
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.
Done
| @@ -54,6 +54,7 @@ namespace edmtest { | |||
| esConsumes<HcalPedestalWidths, HcalPedestalWidthsRcd>(edm::ESInputTag("", "effective")); | |||
| tok_Gains = esConsumes<HcalGains, HcalGainsRcd>(); | |||
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.
it would be better to have these all in the initializer part, but maybe for a follow-up 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.
Indeed, but for now staying consistent with existing code that works should be ok
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.
Yes this can be done in a follow-up PR
| #include "CondTools/Hcal/interface/HcalPFCutsHandler.h" | ||
| #include "FWCore/Framework/interface/MakerMacros.h" | ||
|
|
||
| //typedef popcon::PopConAnalyzer<HcalPFCutsHandler> HcalPFCutsPopConAnalyzer; |
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.
remove commented out code
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.
Done
| void analyze(const edm::Event& ev, const edm::EventSetup& esetup) override { | ||
| //Using ES to get the data: | ||
|
|
||
| myDBObject = new HcalPFCuts(esetup.getData(m_tok)); |
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.
instead of a new, could this be done as a unique_ptr?
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.
There are 38 other *PopConAnalyzer.cc files in that directory, all using this type of initialization. This PR does not look to me like a good opportunity to replace popcon memory management model with something better.
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.
Right but you are adding a new file here, I didnt ask to fix the rest of them (well now that you are bringing that up, maybe you should do that in a dedicated next PR...), I asked to have a new addition to be better. If you are not using the unique_ptr you need to make sure that myDBObject is deleted (otherwise this will do a memory leak). Can you point me to where that happens in the code?
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 am not sure if it gets deleted... The pointer is passes to the PopCon system in the "endJob" method, and then PopCon does whatever is necessary to write the corresponding object or collection to the database. So even if there is a memory leak in a sense that the program does not itself delete every object it creates on the heap, all these objects have to be kept alive until the end of the job anyway, and the OS will do the right thing when the program exits.
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.
Another plugin from HCAL HcalZDCLowGainFractionsPopConAnalyzer makes an explicit delete, see
https://github.com/cms-sw/cmssw/blob/master/CondTools/Hcal/plugins/HcalZDCLowGainFractionsPopConAnalyzer.cc#L21
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.
HcalZDCLowGainFractions is a kind of dead end (not sure it was ever used) so may not serve as an example (?)
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.
Most of the code in CondTools/Hcal/plugins is quite old, and was written when unique_ptr wasn't even part of the C++ standard. My preference would be to keep the code consistent with the old design, and if we get to fixing things, do it all at once.
|
|
||
| void HcalPFCutsHandler::getNewObjects() { | ||
| // edm::LogInfo ("HcalPFCutsHandler") | ||
| std::cout << "------- " << m_name << " - > getNewObjects\n" |
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.
please use the LogInfo (or LogPrint etc) instead of teh cout, you also dont need std::endl when you use the MsgLogger functions
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.
Again, this is just a boilerplate, with 41 pre-existing *Handler.cc in CondTools/Hcal/src out of which 35 print to cout. Not sure why this one should be different.
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.
couts are strictly forbidden for new developments, so please change those, the rest of the package can be updated later
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.
OK, prints to cout are removed in HcalPFCutsHandler.cc
Can you please include these as a unit test in this PR? |
|
@igv4321 since this PR is introducing a new CondObject I believe it's best if it's discussed at an AlCaDB meeting, maybe you or @abdoulline would be available to present next Monday (27th March)? |
|
Another question: in the PR description there is no mention of the need for Backports, will this be needed for online data taking this year? |
(1) I can present the things at the next AlCaDB meeting (2) as to the backporting - we'd like to have it backported for 2023 data taking, if circumstances would allow, |
|
Thank you Salavat!
The agenda is ready https://indico.cern.ch/event/1269033/#65-hcal-pfcuts-db-conditions, let us know in case you prefer a differnt title (and please note that the agenda is still under construction)
Indeed you are right, the 13_0_X cycle (for 2023 data-taking) is kinda closed to major updates like this one: it has to be discussed with PPD L1s and release managers (FYI @perrotta @rappoccio) |
|
Unit test added, as requested |
|
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41128/34795
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41128/34796
|
|
Pull request #41128 was updated. @cmsbuild, @tvami, @saumyaphor4252, @francescobrivio can you please check and sign again. |
|
@cmsbuild , please test |
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41128/34962
|
|
Pull request #41128 was updated. @tvami, @saumyaphor4252, @francescobrivio can you please check and sign again. |
|
This pull request is fully signed and it will be integrated in one of the next master IBs after it passes the integration tests. 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 |
|
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-faea2f/31699/summary.html Comparison SummarySummary:
|

PR description:
Added HcalPFCuts table for specifying seed and suppression thresholds for
PF Hcal objects. This table was discussed at
https://indico.cern.ch/event/1220970/contributions/5284605/attachments/2598482/4486203/HCAL_PFlowCutsSeeds_Feb24_2023.pdf
No changes expected in the output, as this table is not yet used by consumers.
PR validation:
Several private scripts were run to validate ascii and sql databse I/O of the new table.