Navigation Menu

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

L1 emulator for LLP displaced jet trigger (L1 6:1 LUT, L2 jet algo), L1TNtuples addition of jet hwQual #36919

Merged
merged 6 commits into from Feb 17, 2022

Conversation

gk199
Copy link
Contributor

@gk199 gk199 commented Feb 9, 2022

PR description:

This PR implements the L1 emulator of the LLP displaced jet trigger algorithm. Calo L1 takes the 6 fine grain bits from the HCAL uHTR (PRs #34600 and #35599) and uses a 6:1 LUT to set a single bit of tower hwQual based on the logical OR of the timing and depth information. The Calo L2 jet algorithm flags a jet as delayed if there are >= 2 flagged towers within the 9x9 jet region. This is saved in the LSB of jet.hwQual, 1 if jet is flagged as containing an LLP, 0 otherwise. L1 and L2 firmware updates have been completed.

The uGT emulator follows, and is implemented in recent PR #36868. L1 Menu Tools is in the process of being updated to include the displaced jet bit, in PR #74.

The L1 seed JIRA ticket, including slides detailing the testing of the L1 emulator and links to relevant presentations, is here. Slides 2-10 focus on the L1 emulator implementation and validation tests.

The emulator implementation has been presented at L1 Trigger CMS Week and to the HCAL Trigger group.

Additionally, the L1TNtuples are updated to store the jet hwQual information (in L1AnalysisL1Upgrade.cc and L1AnalysisL1UpgradeDataFormat.h). Tested by myself and @elfontan.

A single comment in HcalFinegrainBit.cc is updated to reflect the correct assignment of the 6 fine grain bits from the uHTR.

PR validation:

Passed runTheMatrix.py tests. Tested in CMSSW_12_3_X_2022-02-08-1100.

…dition of jet hwQual, fix comment in HcalFinegrainBit.cc
@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 9, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36919/28230

  • This PR adds an extra 40KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 9, 2022

A new Pull Request was created by @gk199 (Gillian Kopp) for master.

It involves the following packages:

  • EventFilter/L1TRawToDigi (l1)
  • L1Trigger/L1TCaloLayer1 (l1)
  • L1Trigger/L1TCalorimeter (l1)
  • L1Trigger/L1TNtuples (l1)
  • SimCalorimetry/HcalTrigPrimAlgos (l1)

@epalencia, @cmsbuild, @cecilecaillol, @rekovic can you please review it and eventually sign? Thanks.
@kreczko, @missirol, @rovere, @Martin-Grunewald, @bsunanda, @thomreis, @dinyar, @abdoulline this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@cecilecaillol
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

-1

Failed Tests: Build ClangBuild
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-cc9948/22324/summary.html
COMMIT: b392d89
CMSSW: CMSSW_12_3_X_2022-02-09-2300/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/36919/22324/install.sh to create a dev area with all the needed externals and cmssw changes.

Build

I found compilation warning when building: See details on the summary page.

Clang Build

I found compilation warning while trying to compile with clang. Command used:

USER_CUDA_FLAGS='--expt-relaxed-constexpr' USER_CXXFLAGS='-Wno-register -fsyntax-only' scram build -k -j 32 COMPILER='llvm compile'

See details on the summary page.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36919/28248

  • This PR adds an extra 40KB to repository

@cmsbuild
Copy link
Contributor

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

@cecilecaillol
Copy link
Contributor

please test

@gk199
Copy link
Contributor Author

gk199 commented Feb 16, 2022

L1T DQM histogram comparison comments:

  • Changes are seen in the jet QUAL bit plot (CenJetsQual), and are expected. The Stage2Layer2JetAlgorithmFirmwareImp1.cc sets the least significant bit of jet hwQual (to 1) if the jet is found to be delayed based on the HCAL feature bits. This bit is set infrequently, as seen in the central jet quality histogram.
  • In the DQM histograms, I also see the HCAL Feature Bit occupancy histograms at Layer 1. This is also expected since the feature bit is now being set based a 6:1 LUT from the 6 fine grain bits from the HCAL uHTR (update to Layer-1 logic, as previously the feature bit just relied on the first uHTR fine grain bit).

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-cc9948/22463/summary.html
COMMIT: e757f7b
CMSSW: CMSSW_12_3_X_2022-02-16-1100/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/36919/22463/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

@slava77 comparisons for the following workflows were not done due to missing matrix map:

  • /data/cmsbld/jenkins/workspace/compare-root-files-short-matrix/data/PR-cc9948/138.4_PromptCollisions+RunMinimumBias2021+ALCARECOPROMPTR3+HARVESTDPROMPTR3
  • /data/cmsbld/jenkins/workspace/compare-root-files-short-matrix/data/PR-cc9948/138.5_ExpressCollisions+RunMinimumBias2021+TIER0EXPRUN3+ALCARECOEXPR3+HARVESTDEXPR3
  • /data/cmsbld/jenkins/workspace/compare-root-files-short-matrix/data/PR-cc9948/139.001_RunMinimumBias2021+RunMinimumBias2021+HLTDR3_2021+RECODR3_MinBiasOffline+HARVESTD2021MB

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3965143
  • DQMHistoTests: Total failures: 8
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3965113
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 204 log files, 45 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@perrotta
Copy link
Contributor

+1

@dan131riley
Copy link

We're getting ASAN heap-buffer-overflow errors, likely related to this PR, see #37012

@@ -107,9 +107,14 @@ namespace l1t {

HcalTrigTowerDetId id(cEta, cPhi);
const auto tp = hcalTPGs->find(id);

int fg_bits = 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

uint32_t fg_bits = 0


int fg_bits = 0;
for (int index = 0; index < 6; index++)
fg_bits += tp->SOI_fineGrain(index) << index;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fg_bits |= tp->SOI_fineGrain(index) << index;

Choose a reason for hiding this comment

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

This loop needs to be inside this conditional:

            if (tp != hcalTPGs->end()) {

@gk199
Copy link
Contributor Author

gk199 commented Feb 22, 2022

We're getting ASAN heap-buffer-overflow errors, likely related to this PR, see #37012

I added some suggestions above in CaloLayer1Packer.cc, please let me know if there are any other thoughts to resolve this (or input from someone from L1, @cecilecaillol?). Is there a way to test the ASAN build locally, with a command to run to reproduce the error?

@makortel
Copy link
Contributor

makortel commented Mar 1, 2022

Is there a way to test the ASAN build locally, with a command to run to reproduce the error?

Yes, you can check the latest ASAN build from the IB dashboard and run a failing workflow there, e.g.

cmsrel CMSSW_12_3_ASAN_X_2022-02-28-1100
cd CMSSW_12_3_ASAN_X_2022-02-28-1100/src
cmsenv
runTheMatrix.py -l 23234.0

@cecilecaillol
Copy link
Contributor

@gk199 Could you check if your suggested fixes above remove the errors?

@gk199
Copy link
Contributor Author

gk199 commented Mar 14, 2022

@gk199 Could you check if your suggested fixes above remove the errors?

I tested my suggested fix, and still have the heap-buffer-overflow issue. I also tested a number of other modifications, such as doing the 6:1 logic in CaloLayer1Packer.cc prior to passing through setFB instead of doing the 6:1 logic in UCTCTP7RawData.h.

Any other suggestions or guidance will be much appreciated as I work to resolve this.

@dan131riley
Copy link

This loop:

int fg_bits = 0;
for (int index = 0; index < 6; index++)
fg_bits += tp->SOI_fineGrain(index) << index;

needs to be inside this conditional:
if (tp != hcalTPGs->end()) {
ctp7Data.setET(cType, negativeEta, iEta, iPhi, tp->SOI_compressedEt());
ctp7Data.setFB(cType, negativeEta, iEta, iPhi, fg_bits);
}

As is, when id isn't found it's indexing off the end of the vector.

@gk199
Copy link
Contributor Author

gk199 commented Mar 14, 2022

Many thanks @dan131riley for the fix and the explanation! I confirm this resolves the step2 heap-buffer-overflow from CaloLayer1Packer::makeHCalTPGs when running runTheMatrix.py -l 39834.0 in CMSSW_12_4_ASAN_X_2022-03-14-1100.

However, I see an error in step3, which seems unrelated to any code in this PR, as it is part of HGVHistoProducerAlgo.

READ of size 4 at 0x60d008945b0c thread T0
    #0 0x7fd8a67a0b47 in HGVHistoProducerAlgo::tracksters_to_SimTracksters(HGVHistoProducerAlgoHistograms const&, int, std::vector<ticl::Trackster, std::allocator<ticl::Trackster> > const&, std::vector<reco::CaloCluster, std::allocator<reco::CaloCluster> > const&, std::vector<ticl::Trackster, std::allocator<ticl::Trackster> > const&, HGVHistoProducerAlgo::validationType, std::vector<ticl::Trackster, std::allocator<ticl::Trackster> > const&, std::map<unsigned int, std::vector<unsigned int, std::allocator<unsigned int> >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::vector<unsigned int, std::allocator<unsigned int> > > > > const&, std::vector<SimCluster, std::allocator<SimCluster> > const&, edm::ProductID const&, std::vector<CaloParticle, std::allocator<CaloParticle> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::unordered_map<DetId, HGCRecHit const*, std::hash<DetId>, std::equal_to<DetId>, std::allocator<std::pair<DetId const, HGCRecHit const*> > > const&, unsigned int) const (/cvmfs/cms-ib.cern.ch/week0/slc7_amd64_gcc11/cms/cmssw/CMSSW_12_4_ASAN_X_2022-03-14-1100/biglib/slc7_amd64_gcc11/pluginSimulation.so+0x17eeb47)
    #1 0x7fd8a67a713b in HGVHistoProducerAlgo::fill_trackster_histos(HGVHistoProducerAlgoHistograms const&, int, std::vector<ticl::Trackster, std::allocator<ticl::Trackster> > const&, std::vector<reco::CaloCluster, std::allocator<reco::CaloCluster> > const&, std::vector<ticl::Trackster, std::allocator<ticl::Trackster> > const&, std::vector<ticl::Trackster, std::allocator<ticl::Trackster> > const&, std::map<unsigned int, std::vector<unsigned int, std::allocator<unsigned int> >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, std::vector<unsigned int, std::allocator<unsigned int> > > > > const&, std::vector<SimCluster, std::allocator<SimCluster> > const&, edm::ProductID const&, std::vector<CaloParticle, std::allocator<CaloParticle> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&, std::unordered_map<DetId, HGCRecHit const*, std::hash<DetId>, std::equal_to<DetId>, std::allocator<std::pair<DetId const, HGCRecHit const*> > > const&, unsigned int) const (/cvmfs/cms-ib.cern.ch/week0/slc7_amd64_gcc11/cms/cmssw/CMSSW_12_4_ASAN_X_2022-03-14-1100/biglib/slc7_amd64_gcc11/pluginSimulation.so+0x17f513b)

As this is an unrelated file to this L1 emulator PR, may I now open a new PR to fix the heap-buffer-overflow with the changes in CaloLayer1Packer::makeHCalTPGs?

@dan131riley
Copy link

@gk199 please make a new PR with the step2 fix. The fix is clearly correct and needed, the step3 error can be dealt with separately.

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

8 participants