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

Refactoring of Phase1 OMTF emulator & Phase2 OMTF emulator #1196

Conversation

mbluj
Copy link

@mbluj mbluj commented Jan 10, 2024

PR description:

This PR consists of two parts:

  1. Refactoring of Phase1 OMTF emulator that is rebase of development in PR #43687 to the official CMSSW,
  2. and Phase2 OMTF emulator code on top of it (added as a new CMSSW package).

Neither changes introduced for Phase1 nor Phase2 are switched on in standard workflows. For it dedicated PRs will be prepared.

PR validation:

Tested with matrix tests (limited set)

FYI, @kbunkow, @akalinow

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

Attempts to compile this PR succeeded!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -j 8

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

I found no issues with the code checks!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 code-checks && scram b -k -j 8 code-checks

I found no issues with the headers!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 check-headers

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

I found 2 files that did not meet formatting requirements:

  • L1Trigger/L1TMuonOverlapPhase1/src/Omtf/OMTFConfiguration.cc
  • L1Trigger/L1TTrackMatch/plugins/L1TrackJetClustering.h

Please run scram b code-format to auto-apply code formatting

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 code-format-all

@mbluj
Copy link
Author

mbluj commented Jan 11, 2024

I can apply code formatting fixes, but please note that:
a) one of affected files has nothing to do with the OMTF emulator,
b) formatting issue in the OMTF-related file is due to difference in formatting rules between 13_3 and 14_0 (master) release series, i.e. the file passed formatting test as in 14_0.
So, should I proceed with the formatting fixes or it is fine to keep the code as it is?

@mbluj mbluj force-pushed the phase2-l1t-integration-13_3_0_pre3_mbluj_OMTF_ph2 branch from 8bc105a to 283fc1d Compare January 11, 2024 11:16
@mbluj
Copy link
Author

mbluj commented Jan 11, 2024

I can apply code formatting fixes, but please note that: a) one of affected files has nothing to do with the OMTF emulator, b) formatting issue in the OMTF-related file is due to difference in formatting rules between 13_3 and 14_0 (master) release series, i.e. the file passed formatting test as in 14_0. So, should I proceed with the formatting fixes or it is fine to keep the code as it is?

So, I applied the formatting fix and squashed with previous commit with a similar fix. After the squashing you can note that the fix touches only no-OMTF-related code as changes of OMTF code simply inverted previous change introduced for master/14_0...

Copy link

@aloeliger aloeliger left a comment

Choose a reason for hiding this comment

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

I didn't go over the phase 1 stuff in too much detail, since I'm not sure how much of that is already present in CMSSW, or is otherwise not really negotiable here. If this is all new stuff and none of it is in CMSSW, I know there is a PR open to CMSSW, I will go read and review there.

This PR is still quite large otherwise, so this is not the most thorough review.

In general, please go and remove commented out code that isn't serving to demonstrate or clarify something in the code around it, or standing in for code to be implemented later.

<<" meanDistPhiValue "<<omtfCand->getGoldenPatern()->meanDistPhiValue(iLogicLayer, omtfCand->getRefLayer())//<<(phiDist != hit.phiDist? "!!!!!!!<<<<<" : "")
<<endl;*/

if (hit.phiDist > 504 || hit.phiDist < -512) {

Choose a reason for hiding this comment

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

Could these numbers be a bit better explained with some constants?

Copy link
Author

Choose a reason for hiding this comment

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

@kbunkow, can you take a look, please?

Choose a reason for hiding this comment

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

This looks similar to previous python files where it has user specific information in it. Do these need to be in CMSSW? Will it be future proof?

Copy link
Author

Choose a reason for hiding this comment

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

@kbunkow, can you take check expert config files for phase2, please?

Choose a reason for hiding this comment

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

Same question here, and I assume for the other python files in this set.

Comment on lines +71 to +72
DtPhase2DigiToStubsConverterOmtf(const OMTFConfiguration* config,
const OmtfAngleConverter* angleConverter,

Choose a reason for hiding this comment

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

This doesn't seem possible due to the amount of underlying code that needs to use these (so don't worry about this), but I don't suppose either of these could be references, and not have to worry about having nullptrs around?

@aloeliger aloeliger added Phase-1 Pertains to phase-1 development Phase-2 Pertains to phase-2 development Emulator Development Emulator development PR Physics Affecting A PR expected to affect Physics content of the trigger labels Jan 19, 2024
@epalencia
Copy link

@mbluj , could you please address Andrew's comments?

@mbluj
Copy link
Author

mbluj commented Feb 2, 2024

@mbluj , could you please address Andrew's comments?

Yes, sorry for this delay. I was absent and then overflooded by other commitments. I plan to back to it next week.

@aloeliger aloeliger changed the base branch from phase2-l1t-integration-13_3_0_pre3 to phase2-l1t-integration-14_0_0_pre3 February 5, 2024 15:43
@aloeliger aloeliger added the Needs Rebase PR should be rebased to newer branch label Feb 13, 2024
@aloeliger aloeliger changed the base branch from phase2-l1t-integration-14_0_0_pre3 to phase2-l1t-integration-13_3_0_pre3 February 13, 2024 12:54
@aloeliger
Copy link

Hi @mbluj, I'm going around starting to figure out how to update all PRs to our new IB

For this PR I would recommend:

  1. First, make a backup of this branch and it's commits pushed to github under a different name
  2. checkout CMSSW_14_0_0_pre3 via cmsrel CMSSW_14_0_0_pre3 && cd CMSSW_14_0_0_pre3/src/ && cmsenv && git cms-init
  3. Get a copy of this branch locally via git cms-checkout-topic -u mbluj:phase2-l1t-integration-13_3_0_pre3_mbluj_OMTF_ph2
  4. Perform an interactive rebase via git rebase from-CMSSW_14_0_0_pre3 --interactive
  5. In the interactive rebase, please drop all commits that were not originally part of this pull request. In my tests, there seemed to be some earlier commits from track trigger commits that get caught up in this somehow?
  6. You can either then push the resulting branch to the current PR branch, or make a new one and make a PR from that branch to cms-l1t-offline:phase2-l1t-integration-14_0_0_pre3

Alternatively, because you have relatively few commits, you could just cherry-pick commits by doing something like:

  1. First, make a backup of this branch and it's commits pushed to github under a different name
  2. checkout CMSSW_14_0_0_pre3 via cmsrel CMSSW_14_0_0_pre3 && cd CMSSW_14_0_0_pre3/src/ && cmsenv && git cms-init
  3. Fetch your changes git fetch my-cmssw
  4. Cherry pick the 4 necessary commits via git cherry-pick, the 4 commands needed (in order) I think are: git cherry-pick 20dacb5c0e47d54008bacd8e08d9cd52b40622bd git cherry-pick 3323c2e6914f707a6837977c5cc7172a1baeda9b and git cherry-pick 283fc1d619f86e57efa53e3437f379dc09be6f13
  5. You can either then push the resulting branch to the current PR branch, or make a new one and make a PR from that branch to cms-l1t-offline:phase2-l1t-integration-14_0_0_pre3

@mbluj
Copy link
Author

mbluj commented Feb 13, 2024

OK, I will rebase it to newer release, I think I know how do it.
Do I understand correctly that you want it be based on plain CMSSW_14_0_0_pre3? Will not it be better to rebase to cms-l1t-offline:phase2-l1t-integration-14_0_0_pre3? But, both are fine with me.

@zhenbinwu
Copy link

OK, I will rebase it to newer release, I think I know how do it. Do I understand correctly that you want it be based on plain CMSSW_14_0_0_pre3? Will not it be better to rebase to cms-l1t-offline:phase2-l1t-integration-14_0_0_pre3? But, both are fine with me.

In order to get both phase-2 EMTF and OMTF to the GMT, I would prefer a rebase to cms-l1t-offline:phase2-l1t-integration-14_0_0_pre3, since EMTF is merged. Thanks

@mbluj mbluj force-pushed the phase2-l1t-integration-13_3_0_pre3_mbluj_OMTF_ph2 branch from 283fc1d to 9e1e558 Compare February 16, 2024 12:55
@mbluj mbluj changed the base branch from phase2-l1t-integration-13_3_0_pre3 to phase2-l1t-integration-14_0_0_pre3 February 16, 2024 13:00
@mbluj
Copy link
Author

mbluj commented Feb 16, 2024

@aloeliger I rebased my development branch to phase2-l1t-integration-14_0_0_pre3 and changed target base to it.

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

Attempts to compile this PR succeeded!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -j 8

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

I found no issues with the code checks!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 code-checks && scram b -k -j 8 code-checks

I found no issues with the headers!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 check-headers

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

I found 1 files that did not meet formatting requirements:

  • L1Trigger/L1TMuon/src/MicroGMTConfiguration.cc

Please run scram b code-format to auto-apply code formatting

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 code-format-all

@mbluj
Copy link
Author

mbluj commented Feb 16, 2024

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

I found 1 files that did not meet formatting requirements:

  • L1Trigger/L1TMuon/src/MicroGMTConfiguration.cc

Please run scram b code-format to auto-apply code formatting

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 code-format-all

This file is not modified by this PR. And I do not see issue with its formatting.

@mbluj
Copy link
Author

mbluj commented Feb 21, 2024

PR updated with cherry-picked cleanup of OMTF phase1 code and with cleanup of OMTF phase2 code. There are, however, still a few items to address.

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

Attempts to compile this PR succeeded!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -j 8

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

I found no issues with the code checks!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 code-checks && scram b -k -j 8 code-checks

I found no issues with the headers!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 check-headers

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

I found 1 files that did not meet formatting requirements:

  • L1Trigger/L1TMuon/src/MicroGMTConfiguration.cc

Please run scram b code-format to auto-apply code formatting

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 code-format-all

@aloeliger
Copy link

@mbluj Are there any remaining review comments to be addressed here? I think we would like to merge this draft, and have a PR made for any phase 2 elements that have not already had a PR to central CMSSW. @epalencia any objection to your side towards beginning to merge this into the prototype?

@mbluj
Copy link
Author

mbluj commented Feb 26, 2024

@mbluj Are there any remaining review comments to be addressed here? I think we would like to merge this draft, and have a PR made for any phase 2 elements that have not already had a PR to central CMSSW. @epalencia any objection to your side towards beginning to merge this into the prototype?

I will commit today a few additional fixes from Karol. So, please hold on until it is done, please.

@mbluj mbluj force-pushed the phase2-l1t-integration-13_3_0_pre3_mbluj_OMTF_ph2 branch from 84a5e52 to 758c7a5 Compare February 26, 2024 12:48
@mbluj
Copy link
Author

mbluj commented Feb 26, 2024

Added cleanups from Karol:

  • removal of a few expert configurations (cfg files),
  • replacement of const ptrs by const refs in DtPhase2DigiToStubsConverter.

As the changes are small and not specific were squashed with the previous commit with cleanups.

Last missing piece is fixing propagation in CandidateSimMuonMatcher.cc which should not depend on point where a propagated muon is produced. It is basically ready and can be added this afternoon (here and to phase1 PR)

@mbluj
Copy link
Author

mbluj commented Feb 26, 2024

@aloeliger @epalencia, commit with updated propagation in CandidateSimMuonMatcher.cc is added and now we consider updates of this PR compete.

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

Attempts to compile this PR succeeded!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -j 8

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

I found no issues with the code checks!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 code-checks && scram b -k -j 8 code-checks

I found no issues with the headers!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 check-headers

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

I found 2 files that did not meet formatting requirements:

  • L1Trigger/L1TMuon/src/MicroGMTConfiguration.cc
  • L1Trigger/L1TMuonOverlapPhase2/interface/InputMakerPhase2.h

Please run scram b code-format to auto-apply code formatting

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 code-format-all

@epalencia
Copy link

@mbluj , can you check the format issue in L1Trigger/L1TMuonOverlapPhase2/interface/InputMakerPhase2.h?

@mbluj
Copy link
Author

mbluj commented Feb 27, 2024

@mbluj , can you check the format issue in L1Trigger/L1TMuonOverlapPhase2/interface/InputMakerPhase2.h?

OK. There is indeed small formatting issue. I am going to fix it and squash with earlier commit to not add new trivial items to history.

@mbluj mbluj force-pushed the phase2-l1t-integration-13_3_0_pre3_mbluj_OMTF_ph2 branch from 52ce8d5 to 531046d Compare February 27, 2024 11:08
@mbluj
Copy link
Author

mbluj commented Feb 27, 2024

@epalencia Corrected branch pushed.

@aloeliger
Copy link

@epalencia Any objection to merging this now? The phase 1 PR has been signed in CMSSW already.

@epalencia
Copy link

No. Please go ahead.

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

Attempts to compile this PR succeeded!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -j 8

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

I found no issues with the code checks!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 code-checks && scram b -k -j 8 code-checks

I found no issues with the headers!

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 check-headers

@triggerDoctor
Copy link

Hello, I'm triggerDoctor. @aloeliger is testing this script for L1T offline software validation.

I found 1 files that did not meet formatting requirements:

  • L1Trigger/L1TMuon/src/MicroGMTConfiguration.cc

Please run scram b code-format to auto-apply code formatting

Info Value
return code 0
command eval scramv1 runtime -sh && scram b -k -j 8 code-format-all

@aloeliger
Copy link

@mbluj To provide the menu team with validation material, we are going to go ahead and merge this branch into the integration branch. If there are any elements of this (Phase 2 or otherwise) that haven't been put in a PR to central CMSSW, please make a PR for that now. @epalencia FYI.

@aloeliger aloeliger merged commit 77fa72a into cms-l1t-offline:phase2-l1t-integration-14_0_0_pre3 Feb 28, 2024
@mbluj
Copy link
Author

mbluj commented Feb 28, 2024

@mbluj To provide the menu team with validation material, we are going to go ahead and merge this branch into the integration branch. If there are any elements of this (Phase 2 or otherwise) that haven't been put in a PR to central CMSSW, please make a PR for that now. @epalencia FYI.

Thanks, great! FYI, @kbunkow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Emulator Development Emulator development PR Phase-1 Pertains to phase-1 development Phase-2 Pertains to phase-2 development Physics Affecting A PR expected to affect Physics content of the trigger
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants