-
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
Use modern C++ constructs in EventSetup #24270
Conversation
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.
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-24270/5987 |
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. cms-bot commands are listed here |
please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
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&); |
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.
@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
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.
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.
please test @Dr15Jones do we expect changes because of this PR in the DQM output? |
The tests are being triggered in jenkins. |
Comparison job queued. |
@fabiocos asked
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. |
One such difference, is 1 Tau more or less tau: 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. |
So I was looking in detail at the results from
and are filled within this
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. |
Comparison is ready Comparison Summary:
|
+1 @Dr15Jones thank you for the check |
This is a refactoring to improve the overall code quality of part of the EventSetup.