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

Muon selector function taking enum type #21185

Merged
merged 1 commit into from Nov 9, 2017
Merged

Muon selector function taking enum type #21185

merged 1 commit into from Nov 9, 2017

Conversation

peruzzim
Copy link
Contributor

@peruzzim peruzzim commented Nov 6, 2017

Needed to call reco::Muon::passed from string parser using names defined in the reco::Muon::Selector enum.

@gpetruc @arizzi @emanueledimarco @drkovalskyi

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2017

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2017

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/PR-21185/1838

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2017

A new Pull Request was created by @peruzzim for master.

It involves the following packages:

DataFormats/MuonReco

@perrotta, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@battibass, @abbiendi, @rovere, @calderona, @HuguesBrun, @jhgoh, @trocino, @amagitte, @bachtis this is something you requested to watch as well.
@davidlange6, @slava77 you are the release manager for this.

cms-bot commands are listed here

@perrotta
Copy link
Contributor

perrotta commented Nov 6, 2017

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/24204/console Started: 2017/11/06 16:27

@slava77
Copy link
Contributor

slava77 commented Nov 6, 2017 via email

@peruzzim
Copy link
Contributor Author

peruzzim commented Nov 6, 2017

@slava77 I have not succeeded in casting from the parser, and was not able to find any documentation for how to do so. The twiki shows an example that uses the string.
I also tried to navigate through the code, but I was not able to really identify which functions are called to see if there is a workaround.
In any case, having the chance of accessing by string would be cleaner because we are already doing it for several other methods (e.g. pat::Muon::dB).

@gpetruc
Copy link
Contributor

gpetruc commented Nov 6, 2017 via email

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2017

-1

Tested at: d2f3a41

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:
fcaeeab
You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-21185/24204/git-log-recent-commits
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-21185/24204/git-merge-result

You can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-21185/24204/summary.html

I found follow errors while testing this PR

Failed tests: UnitTests

  • Unit Tests:

I found errors in the following unit tests:

---> test runtestTqafTopEventProducers had ERRORS
---> test runtestTqafTopEventSelection had ERRORS
---> test runtestTqafExamples had ERRORS

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:
fcaeeab
You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-21185/24204/git-log-recent-commits
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-21185/24204/git-merge-result

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2017

Comparison job queued.

@gpetruc
Copy link
Contributor

gpetruc commented Nov 6, 2017 via email

@slava77
Copy link
Contributor

slava77 commented Nov 6, 2017 via email

@drkovalskyi
Copy link
Contributor

OK, although this somewhat defeats the purpose of the method with int
argument,
which is there to allow an "OR" of many bits in one go.

We may want to have different names for the two methods to avoid confusion. Probably easier to change the name of the new method.

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 6, 2017

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

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 26
  • DQMHistoTests: Total histograms compared: 2900266
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2900094
  • DQMHistoTests: Total skipped: 171
  • DQMHistoTests: Total Missing objects: 0
  • Checked 107 log files, 10 edm output root files, 26 DQM output files

@peruzzim
Copy link
Contributor Author

peruzzim commented Nov 6, 2017

@drkovalskyi I don't see why this should be confusing and require different names for the method.

Actually I would find it confusing to have two methods, one taking the enum and one taking an integral type (each can be converted into the other either implicitly or by static_cast) that do the same thing with a different name.

The possibility of testing the OR of several bits is still supported exactly as it was before, and the addition looks totally transparent to me apart from the chance of calling a single bit in a clean way from the string parser (i.e. without knowing the values defined in the enum - we clearly don't want to hardcode that somewhere else).

@drkovalskyi
Copy link
Contributor

Just a suggestion. I don't feel strongly either way.

@peruzzim
Copy link
Contributor Author

peruzzim commented Nov 7, 2017

If I understand correctly, #21186 needs to be merged for the unit tests to complete successfully.
If some action from my side is needed before that, please let me know.

@slava77
Copy link
Contributor

slava77 commented Nov 8, 2017

+1

for #21185 d2f3a41

  • simple extension to reco::Muon interface to add bool passed( Selector selection ) const
  • jenkins tests pass

@cmsbuild
Copy link
Contributor

cmsbuild commented Nov 8, 2017

This pull request is fully signed and it will be integrated in one of the next master IBs (but tests are reportedly failing). This pull request will now be reviewed by the release team before it's merged. @davidlange6, @slava77, @smuzaffar (and backports should be raised in the release meeting by the corresponding L2)

@drkovalskyi
Copy link
Contributor

This will need a backport for 94X.

@davidlange6
Copy link
Contributor

i would prefer the cast go in the calling code instead- was that considered?
@peruzzim @slava77

@peruzzim
Copy link
Contributor Author

peruzzim commented Nov 8, 2017

@davidlange6 yes, it was considered. This update allows calling the method passing the selection by name from the string parser (we need to have the method taking the enum type defined, because we cannot cast there, please see the discussion above). Otherwise, yes, we would have done the cast in the calling code.

@slava77
Copy link
Contributor

slava77 commented Nov 8, 2017

i would prefer the cast go in the calling code instead- was that considered?

I do not understand the comment.
Please elaborate.

@davidlange6
Copy link
Contributor

hi @slava77 - i mean that one can do either

bool passed( unsigned int selection ) const { return (selectors_ & selection)==selection; }
bool passed( Selector selection ) const { return passed(static_cast(selection)); }

or change any user of "passed" that with a Selector to be
bool retVal = myMuon.passed( static_castselection);

i guess I miss the understanding of if this is a bug affecting current sw or something that is needed in the future?

@slava77
Copy link
Contributor

slava77 commented Nov 9, 2017 via email

@davidlange6
Copy link
Contributor

davidlange6 commented Nov 9, 2017 via email

@slava77
Copy link
Contributor

slava77 commented Nov 9, 2017 via email

@davidlange6
Copy link
Contributor

+1

@davidlange6
Copy link
Contributor

merge

@cmsbuild cmsbuild merged commit 2075664 into cms-sw:master Nov 9, 2017
@peruzzim peruzzim deleted the muon_passed_enum branch November 30, 2017 14:02
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

7 participants