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

Adding HCAL FB LUT to caloParams for uploading to DB #41221

Merged
merged 1 commit into from
Apr 10, 2023

Conversation

vshang
Copy link

@vshang vshang commented Mar 29, 2023

PR description:

This PR is to add a parameter to the latest caloParams file (caloParams_2022_v0_6_cfi.py) containing the HCal FB LUT for the LLP trigger as well as modifications to CaloL1 software to handle converting the HCal FB LUT from the caloParams file to the CaloL1 Algo settings key to upload to the DB.

PR validation:

Changes were tested locally on CMSSW_13_1_0_pre2 release by using the modified caloParams file to produce a CaloL1 Algo settings key containing the correct HCal FB LUT. This Algo settings key has been tested and validated during several P5 tests together with the new CaloLayer1 firmware and SWATCH software to upload the HCal FB LUT from DB to firmware.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • L1Trigger/L1TCaloLayer1 (l1)
  • L1Trigger/L1TCalorimeter (l1)
  • L1TriggerConfig/L1TConfigProducers (l1)

@epalencia, @cmsbuild, @cecilecaillol, @aloeliger can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @missirol this is something you requested to watch as well.
@perrotta, @dpiparo, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41221/34944

  • This PR adds an extra 44KB to repository

  • Found files with invalid states:

    • L1Trigger/L1TCalorimeter/python/caloParams_2022_v0_6_cfi.py:
    • L1Trigger/L1TCalorimeter/python/caloParamsHI_2022_v0_6_cfi.py:

@cmsbuild
Copy link
Contributor

Pull request #41221 was updated. @epalencia, @cmsbuild, @cecilecaillol, @aloeliger can you please check and sign again.

@aloeliger
Copy link
Contributor

@vshang Am I misremembering? When we did this last the ALCA experts told us that long long in their formats was essentially not possible. I'm not seeing any interface to the ALCA formats here, and the added parameters are long long. Is this the complete PR?

@aloeliger
Copy link
Contributor

@vshang, Ahh, okay never mind, too tired and not paying enough attention, I see where the change is made and what you've done. Do we need to tag in the ALCA/DB experts to take a look though?

@vshang
Copy link
Author

vshang commented Mar 29, 2023

@vshang, Ahh, okay never mind, too tired and not paying enough attention, I see where the change is made and what you've done. Do we need to tag in the ALCA/DB experts to take a look though?

Sure, wouldn't hurt to have them check again to confirm nothing breaks from their side.

@aloeliger
Copy link
Contributor

@tvami Could I tag you in really quickly to make sure that this solution is okay from the ALCA/DB side in preference over what was proposed in #41046?

@tvami
Copy link
Contributor

tvami commented Mar 29, 2023

This should be ok, the long long was not ok as an addition in the already existing CondFormat. Since you are not modifying that, this wont be a problem anymore. Reading in two sets of float and converting them to long long on the consumer side should be all good. (That is my understanding of what happens in this PR, please correct me if that's not it)

@vshang
Copy link
Author

vshang commented Mar 30, 2023

This should be ok, the long long was not ok as an addition in the already existing CondFormat. Since you are not modifying that, this wont be a problem anymore. Reading in two sets of float and converting them to long long on the consumer side should be all good. (That is my understanding of what happens in this PR, please correct me if that's not it)

Yes, I got around the issue by just saving the upper and lower halves of the 64 HCAL FB LUT as separate entries in the caloParams file, then combining the two later on when writing the LUT to a config file. The output config file has not changed, just how it is stored in the caloParams file, which means no additional changes need to be made to the DB or SWATCH.

@aloeliger
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

-1

Failed Tests: UnitTests RelVals RelVals-INPUT AddOn
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-3f0c10/31685/summary.html
COMMIT: 99a7c2f
CMSSW: CMSSW_13_1_X_2023-03-29-2300/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/41221/31685/install.sh to create a dev area with all the needed externals and cmssw changes.

Unit Tests

I found errors in the following unit tests:

---> test L1O2O_L1TSubs had ERRORS

RelVals

----- Begin Fatal Exception 30-Mar-2023 09:57:20 CEST-----------------------
An exception of category 'Configuration' occurred while
   [0] Constructing the EventProcessor
   [1] Constructing module: class=L1TCaloLayer1 label='simCaloStage2Layer1Digis'
Exception Message:
MissingParameter: Parameter 'useHCALFBLUT' not found.
----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 30-Mar-2023 09:57:20 CEST-----------------------
An exception of category 'Configuration' occurred while
   [0] Constructing the EventProcessor
   [1] Constructing module: class=L1TCaloLayer1 label='simCaloStage2Layer1Digis'
Exception Message:
MissingParameter: Parameter 'useHCALFBLUT' not found.
----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 30-Mar-2023 09:57:22 CEST-----------------------
An exception of category 'Configuration' occurred while
   [0] Constructing the EventProcessor
   [1] Constructing module: class=L1TCaloLayer1 label='simCaloStage2Layer1Digis'
Exception Message:
MissingParameter: Parameter 'useHCALFBLUT' not found.
----- End Fatal Exception -------------------------------------------------
Expand to see more relval errors ...

RelVals-INPUT

  • 134.813134.813_RunCosmics2015C/step2_RunCosmics2015C.log
  • 136.721136.721_RunHLTPhy2016B/step2_RunHLTPhy2016B.log
  • 136.722136.722_RunDoubleEG2016B/step2_RunDoubleEG2016B.log
Expand to see more relval errors ...

AddOn Tests

----- Begin Fatal Exception 30-Mar-2023 09:58:49 CEST-----------------------
An exception of category 'Configuration' occurred while
   [0] Constructing the EventProcessor
   [1] Constructing module: class=L1TCaloLayer1 label='simCaloStage2Layer1Digis'
Exception Message:
MissingParameter: Parameter 'useHCALFBLUT' not found.
----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 30-Mar-2023 09:58:16 CEST-----------------------
An exception of category 'Configuration' occurred while
   [0] Constructing the EventProcessor
   [1] Constructing module: class=L1TCaloLayer1 label='simCaloStage2Layer1Digis'
Exception Message:
MissingParameter: Parameter 'useHCALFBLUT' not found.
----- End Fatal Exception -------------------------------------------------
----- Begin Fatal Exception 30-Mar-2023 09:58:28 CEST-----------------------
An exception of category 'FileOpenError' occurred while
   [0] Constructing the EventProcessor
   [1] Constructing input source of type PoolSource
   [2] Calling RootInputFileSequence::initTheFile()
   [3] Calling StorageFactory::open()
   [4] Calling File::sysopen()
Exception Message:
Failed to open the file 'RelVal_Raw_Fake2_MC.root'
   Additional Info:
      [a] Input file file:RelVal_Raw_Fake2_MC.root could not be opened.
      [b] open() failed with system error 'No such file or directory' (error code 2)
----- End Fatal Exception -------------------------------------------------
Expand to see more addon errors ...

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 7, 2023

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-3f0c10/31886/summary.html
COMMIT: 465dac7
CMSSW: CMSSW_13_1_X_2023-04-07-1100/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/41221/31886/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 23 lines from the logs
  • Reco comparison results: 16 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3459609
  • DQMHistoTests: Total failures: 12
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3459575
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 207 log files, 159 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

@aloeliger
Copy link
Contributor

Looks like the logs and trigger results are fine.

@aloeliger
Copy link
Contributor

I fixed the issue with the matrix test outputs by setting useHCALFBLUT = false by default and only checking for the HCAL FB LUT parameters if useHCALFBLUT = true. This should solve any backwards compatibility issues that was causing the log outputs and trigger results to fail.

Where is this activated then? I'm glad that everything passes now, but am I correct in reading this as you essentially just getting rid of the changes (if not the code) that you just worked so hard to introduce?

@vshang
Copy link
Author

vshang commented Apr 7, 2023

I fixed the issue with the matrix test outputs by setting useHCALFBLUT = false by default and only checking for the HCAL FB LUT parameters if useHCALFBLUT = true. This should solve any backwards compatibility issues that was causing the log outputs and trigger results to fail.

Where is this activated then? I'm glad that everything passes now, but am I correct in reading this as you essentially just getting rid of the changes (if not the code) that you just worked so hard to introduce?

No, everything still works as expected for generating the CaloL1 algo settings key for uploading to DB from the updated caloParams_2023_v0_0_cfi file, which I've tested locally. There is a private repository maintained at [1] which is used to generate this key and requires useHCALFBLUT = true (see [2]). Nothing else in the rest of CMSSW should be affected; the rest of the commits were to ensure this was the case.

[1] https://github.com/uwcms/L1TCaloLayer1LUTWriter
[2] https://github.com/uwcms/L1TCaloLayer1LUTWriter/blob/master/python/l1tCaloLayer1LUTWriter_cfi.py#L11

@aloeliger
Copy link
Contributor

Then for my edification, does this need to be enabled in CMSSW anywhere? Is it going to cause emulation mismatches or something with it disabled? (But presumably present in hardware?)

@vshang
Copy link
Author

vshang commented Apr 7, 2023

Then for my edification, does this need to be enabled in CMSSW anywhere? Is it going to cause emulation mismatches or something with it disabled? (But presumably present in hardware?)

The HCAL FB LUT parameter is already included in the current CaloL1 algo settings key used for production and has already been present in the CaloL1 CTP7's since the LLP trigger was first introduced. Nothing should be expected to change with CMSSW or emulation comparison to hardware. Previously the HCAL FB LUT was loaded manually through SWATCH commands directly to the firmware. This PR is just to ensure that this can be done by changing the values in the caloParams file and uploading the changes to DB instead.

To answer your question more directly, I don't expect the HCAL FB LUT parameter to be enabled in CMSSW elsewhere, and this PR should not change anything with regard to emulation comparisons to hardware.

@aloeliger
Copy link
Contributor

aloeliger commented Apr 8, 2023

Okay. It's for custom plugin usage, I guess I get it. Do we understand what things would have to change to prevent the compatibility issues we saw?

@vshang
Copy link
Author

vshang commented Apr 8, 2023

Do you mean changes in addition to this PR? None that I am aware of.

@aloeliger
Copy link
Contributor

Do you mean changes in addition to this PR? None that I am aware of.

I meant to prevent the failing tests and trigger mismatches.

@vshang
Copy link
Author

vshang commented Apr 8, 2023

Do you mean changes in addition to this PR? None that I am aware of.

I meant to prevent the failing tests and trigger mismatches.

Ah yes, those should not be an issue anymore. I squashed the changes together so it might be hard to pick out, but this is handled essentially by disabling the check for the new parameters unless explicitly enabled (useHCALBLUT = true).

@aloeliger
Copy link
Contributor

Do you mean changes in addition to this PR? None that I am aware of.

I meant to prevent the failing tests and trigger mismatches.

Ah yes, those should not be an issue anymore. I squashed the changes together so it might be hard to pick out, but this is handled essentially by disabling the check for the new parameters unless explicitly enabled (useHCALBLUT = true).

Right, but my point is, should we have a list of the things that are not compatible with the new HCAL LUT and fix those?

@vshang
Copy link
Author

vshang commented Apr 8, 2023

Do you mean changes in addition to this PR? None that I am aware of.

I meant to prevent the failing tests and trigger mismatches.

Ah yes, those should not be an issue anymore. I squashed the changes together so it might be hard to pick out, but this is handled essentially by disabling the check for the new parameters unless explicitly enabled (useHCALBLUT = true).

Right, but my point is, should we have a list of the things that are not compatible with the new HCAL LUT and fix those?

I don't think so, though I can confirm with my supervisors. Given that the LLP trigger logic is not expected to change unless there is a major update from the HCAL side, I think keeping everything else the same without changes is probably the best way forward for now.

@aloeliger
Copy link
Contributor

+l1

  • Tests pass, no trigger differences after disabling of LUT in standard CMSSW running
  • Primary differences in external modules used by CaloL1 team.

@tvami
Copy link
Contributor

tvami commented Apr 9, 2023

+db

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 9, 2023

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. @perrotta, @dpiparo, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@rappoccio
Copy link
Contributor

+1

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.

10 participants