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

Use modern C++ constructs in EventSetup #24270

Merged
merged 9 commits into from
Aug 13, 2018

Conversation

Dr15Jones
Copy link
Contributor

This is a refactoring to improve the overall code quality of part of the EventSetup.

The name change matches the change to using std::move.
Use of an std::optional avoids additional calls to new/delete.
-switched to using from typedef
-switched to constexpr from enum
-use 'if constexpr' to handle recursive calls rather than use function overloading.
We know the length at compile time.
Variadic template arguments are more flexible than set number of arguments with dummy defaults.
The ability to use variadic templates with the edm::es::products
function means it can now handle arbitrary numbers of arguments.
The '<<' mechanism required lots of additional classes to function
and is not as efficient as the new version of edm::es::products.
@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @Dr15Jones (Chris Jones) for master.

It involves the following packages:

FWCore/Framework

@cmsbuild, @smuzaffar, @Dr15Jones can you please review it and eventually sign? Thanks.
@makortel, @Martin-Grunewald, @wddgit this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@Dr15Jones
Copy link
Contributor Author

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 12, 2018

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/29784/console Started: 2018/08/12 19:36

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-24270/29784/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 28
  • DQMHistoTests: Total histograms compared: 2811739
  • DQMHistoTests: Total failures: 30
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2811528
  • DQMHistoTests: Total skipped: 181
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 27 files compared)
  • Checked 122 log files, 14 edm output root files, 28 DQM output files

@cmsbuild
Copy link
Contributor

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. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2)

@@ -47,12 +48,12 @@ namespace edm {
=CallbackSimpleDecorator<TRecord> >
class Callback : public CallbackBase {
public:
typedef TReturn (T ::* method_type)(const TRecord&);
using method_type = TReturn (T ::*)(const TRecord&);
Copy link
Contributor

Choose a reason for hiding this comment

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

@Dr15Jones for my own education, is there a functional difference between these two syntaxes, or is it just aesthetics? Browsing around https://en.cppreference.com/w/cpp/language/type_alias I would say the latter, but I would like to know your motivation

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 using directive can do everything the typedef can do and then even more. The modern C++ community seems to favor deprecating the use of typedef in favor of the more flexible using. That is why I've been converting code from using one to the other.

@fabiocos
Copy link
Contributor

please test

@Dr15Jones do we expect changes because of this PR in the DQM output?

@cmsbuild
Copy link
Contributor

cmsbuild commented Aug 13, 2018

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/29792/console Started: 2018/08/13 10:25

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@Dr15Jones
Copy link
Contributor Author

@fabiocos asked

do we expect changes because of this PR in the DQM output?

This should not have changed DQM. However, my change to similar code last week also caused a series of DQM plots to be slightly different. We ultimately decided that was because those plots are not always reproducible. I'm assuming the same thing happened here.

@Dr15Jones
Copy link
Contributor Author

One such difference, is 1 Tau more or less tau:

https://cmssdt.cern.ch/SDT/jenkins-artifacts/baseLineComparisons/CMSSW_10_3_X_2018-08-12-1100+24270/27959/10224.0_TTbar_13+TTbar_13TeV_TuneCUETP8M1_2017PU_GenSimFull+DigiFullPU_2017PU+RecoFullPU_2017PU+HARVESTFullPU_2017PU/L1T_L1TStage2CaloLayer2_NonIsolated-Tau.html

If this code change actually was the cause of a problem then I would have expected drastic problems (crashes, completely missing objects, etc) not something this subtle.

@Dr15Jones
Copy link
Contributor Author

So I was looking in detail at the results from L1TStage2CaloLayer2. The histograms that are showing differences are booked in this directory:

ibooker.setCurrentFolder(monitorDir_+"/NonIsolated-Tau");

and are filled within this if block:

stage2CaloLayer2TauBxOcc_->Fill(itBX, itTau->hwPt());

The comparison tests say only TausPhi, TausEtEtaPhi and TausOcc differ by 1 entry, while TausEta and TausQual histograms are filled that the same time but do not show any difference in entries. I interpret this to mean that we do have the exact same number of Taus in the two jobs. Now the three histograms showing differences all use Phi in their binning. In we had a Phi that was shifted to be out of range of the histogram binning, that would explain the histograms not depending on Phi in the two job show the same entries while the ones use Phi differ by one.

I believe @slava77 has said that some of the L1 plots are known to have differences based on changes in underflow/overflow, so this is probably one of those cases.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-24270/29792/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 28
  • DQMHistoTests: Total histograms compared: 2811739
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2811556
  • DQMHistoTests: Total skipped: 181
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 27 files compared)
  • Checked 122 log files, 14 edm output root files, 28 DQM output files

@fabiocos
Copy link
Contributor

+1

@Dr15Jones thank you for the check

@cmsbuild cmsbuild merged commit 00d1548 into cms-sw:master Aug 13, 2018
@Dr15Jones Dr15Jones deleted the modernizeEventSetup branch August 31, 2018 16:00
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

3 participants