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

Add PF developments for L1T phase-2 #38047

Closed
wants to merge 1 commit into from

Conversation

perrotta
Copy link
Contributor

PR description:

This is the same as #38045 from @cecilecaillol (originally in #37536) with all commits squashed into 1, with the idea of getting rid of the huge amount of files with invalid states as listed in #38045 (comment)

Original description: "This is another PR to port all L1T Phase-2 developments to cms-sw. This PR targets the particle flow code. It includes several PRs made locally, the details of which can be found in the twiki https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideL1TPhase2Instructions and in the cms-l1t-offline branch.
The code is equivalent to the old PR #37452 but has been reorganized to have a structure more CMS-friendly."

Of course, I'll let Cecile decide which version to eventually merge in CMSSW, or whether to import this single commit into a new PR of her, in case some further development is needed.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38047/30128

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @perrotta (Andrea Perrotta) for master.

It involves the following packages:

  • DataFormats/L1TCorrelator (upgrade, l1)
  • DataFormats/L1TParticleFlow (upgrade, l1)
  • DataFormats/L1Trigger (l1)
  • L1Trigger/Phase2L1ParticleFlow (upgrade, l1)

@rekovic, @epalencia, @cmsbuild, @AdrianoDee, @srimanob, @cecilecaillol can you please review it and eventually sign? Thanks.
@kreczko, @rovere, @eyigitba, @Martin-Grunewald, @missirol, @dinyar, @thomreis, @trtomei, @beaucero 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

@perrotta
Copy link
Contributor Author

With only one commit, there are no files with invalid status in git

@cecilecaillol
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

-1

Failed Tests: UnitTests
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-119c9a/24917/summary.html
COMMIT: 2584acc
CMSSW: CMSSW_12_5_X_2022-05-23-1100/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/38047/24917/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 SiStripDAQ_O2O_test had ERRORS

Comparison Summary

Summary:

  • No significant changes to the logs found
  • ROOTFileChecks: Some differences in event products or their sizes found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3650985
  • DQMHistoTests: Total failures: 281
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3650682
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 49 files compared)
  • Checked 208 log files, 45 edm output root files, 50 DQM output files
  • TriggerResults: found differences in 1 / 49 workflows

@cecilecaillol
Copy link
Contributor

I am fine with merging this PR and closing the other ones. I dont know why the unit tests fail, though.

@cecilecaillol
Copy link
Contributor

+l1

@AdrianoDee
Copy link
Contributor

AdrianoDee commented May 24, 2022

+upgrade

@cmsbuild
Copy link
Contributor

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

Copy link
Contributor Author

@perrotta perrotta left a comment

Choose a reason for hiding this comment

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

It is extremely hard to debug such large amount of code, and for sure several bugs and issues will be found only when tested on some large poduction. I would suggest however to have at least a look at the Static Analyzer report of the automatic bot tests, as it quite often points to some actual flaw, that can be identified thanks to it, and for which a fix can be provided since now. Most of the comments above derives from the inspection of the SA output for this PR

ptsums.push_back(std::pair<float, float>(vtx.pt(), vtx.z0()));
if (ptsum == 0 || vtx.pt() > ptsum) {
ptsum = vtx.pt();
z0 = vtx.z0();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This z0 is not needed here (as pointed out by the Static Analyzer)

continue;
float pVal = h_dz->GetBinContent(b);
if (pMax < pVal || lBin[vtx] == -1) {
pVal = pMax;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shouldn't this be

Suggested change
pVal = pMax;
pMax = pVal;

(as suggested by the Static Analyzer)?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes. that said, this entire file is to be deleted in a new PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. that said, this entire file is to be deleted in a new PR.

Why not now, then?

Copy link
Contributor

Choose a reason for hiding this comment

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

In principle, now is fine for me as well, but it's up to @drankincms and @cecilecaillol to work this out, not me

int LowerSize = PowerOf2LessThan(InSize); //-- LowerSize >= Size / 2
int UpperSize = InSize - LowerSize; //-- UpperSize < LowerSiz

if (LowerSize < UpperSize)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shouldn't you gracefully return here, maybe also adding in the check that UpperSize is above 0?
(As suggested by the Static Analyzer)

Copy link
Contributor

Choose a reason for hiding this comment

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

no, I think here we should ungracefully stop because this is not something that is ever expected to happen in any valid circumstance. we could add an assert.


template <typename T>
void bitonicSort(const T in[], int Start, int InSize, T out[], int OutSize, bool dir) {
if (InSize <= 1) // copy in-> out and exit
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could a check that OutSize>0 help here?
(As suggested by the Static Analyzer)

Copy link
Contributor

Choose a reason for hiding this comment

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

it doesn't make sense to ever call this function with outSize <= 0 (why bother sorting N elements just to throw away all of them), so in principle we could add an assert.

}
switch (algo) {
case VertexAlgo::External: {
int lBin[nVtx_];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think all elements in this vector should be initialized to "-1" if the logic at L126 can work
(As suggested by the Static Analyzer)

Copy link
Contributor

Choose a reason for hiding this comment

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

No idea, this piece of code was added by @violatingcp so he may know better, but anway we should remove this entire file in a new PR because it's obsolete

debug = cms.bool(False)
)

L1SeedConePFJetEmulatorProducer = L1SeedConePFJetProducer.clone(HW = cms.bool(True))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
L1SeedConePFJetEmulatorProducer = L1SeedConePFJetProducer.clone(HW = cms.bool(True))
L1SeedConePFJetEmulatorProducer = L1SeedConePFJetProducer.clone(HW = True)

@@ -99,6 +38,8 @@
vtxAlgo = "external",
vtxFormat = cms.string("TkPrimaryVertex"),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given the complexity of these configs (and the lack of fillDescriptions methods in most of the code in this PR) it would be safer to remove all types from the cloned parameters) I understand that this could also go in a further cleanup PR, once this is merged

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, in particular this l1ParticleFlow_cff file is to be deleted.

@@ -145,7 +89,7 @@
pfAlgo = "PFAlgo2HGC",
# inputs
tracks = cms.InputTag('pfTracksFromL1TracksHGCal'),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same here

@@ -228,6 +175,8 @@
vtxAlgo = "external",
vtxFormat = cms.string("TkPrimaryVertex"),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same here

from L1Trigger.Phase2L1ParticleFlow.DeregionizerProducer_cfi import DeregionizerProducer as l1ctLayer2Deregionizer
scPFL1PF = L1SeedConePFJetProducer.clone(L1PFObjects = 'l1ctLayer1:PF')
scPFL1Puppi = L1SeedConePFJetProducer.clone()
scPFL1PuppiEmulator = L1SeedConePFJetEmulatorProducer.clone(L1PFObject = cms.InputTag('l1ctLayer2Deregionizer', 'Puppi'))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
scPFL1PuppiEmulator = L1SeedConePFJetEmulatorProducer.clone(L1PFObject = cms.InputTag('l1ctLayer2Deregionizer', 'Puppi'))
scPFL1PuppiEmulator = L1SeedConePFJetEmulatorProducer.clone(L1PFObject = 'l1ctLayer2Deregionizer:Puppi')

@perrotta
Copy link
Contributor Author

@cecilecaillol @gpetruc please have a look at the comments above

@smuzaffar I cannot find the git instruction to let @cecilecaillol pushing commits to this PR: does it exist any such possibility?

@perrotta
Copy link
Contributor Author

@cecilecaillol about the differences reported in the L1T Phase2 DQM, are they all understood? (They are the same here and in the previous version of this PR).

For example (from wf 39434):

Is it correct that these plots are now emppty?
image

or much less populated when including all categories?
image

"Non puppi" plots show just some fluctuation in the differences, which is probably what should be expected: but please give a glance also to them.

@smuzaffar
Copy link
Contributor

smuzaffar commented May 25, 2022

@cecilecaillol @gpetruc please have a look at the comments above

@smuzaffar I cannot find the git instruction to let @cecilecaillol pushing commits to this PR: does it exist any such possibility?

@perrotta , @cecilecaillol can not push to your branch. I think only users with push rights to cms-sw/cmssw can do it ( see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork ).

I think @cecilecaillol can open a PR with changes for perrotta/cmssw branch l1t-squashedpf and then you can squash and merge those changes to your branch

@perrotta
Copy link
Contributor Author

@perrotta , @cecilecaillol can not push to your branch. I think only users with push rights to cms-sw/cmssw can do it ( see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork ).

I think @cecilecaillol can open a PR with changes for perrotta/cmssw branch l1t-squashedpf and then you can squash and merge those changes to your branch

Thank you @smuzaffar

@cecilecaillol as you can see from the messages above. still some work is needed for this PR, at least some cleaning, as also suggested by @gpetruc
I think you can either follow the suggestion of Shahzad, or squash all commits into one in your own #38045 (ending up in a PR identical to this one) and apply the fixes over there.

@qliphy
Copy link
Contributor

qliphy commented May 30, 2022

ping @cecilecaillol on above comments

@cecilecaillol
Copy link
Contributor

@cecilecaillol about the differences reported in the L1T Phase2 DQM, are they all understood? (They are the same here and in the previous version of this PR).

For example (from wf 39434):

Is it correct that these plots are now emppty? image

or much less populated when including all categories? image

"Non puppi" plots show just some fluctuation in the differences, which is probably what should be expected: but please give a glance also to them.

@gpetruc Can you check if the DQM plots are as expected?

@gpetruc
Copy link
Contributor

gpetruc commented May 31, 2022

@cecilecaillol about the differences reported in the L1T Phase2 DQM, are they all understood? (They are the same here and in the previous version of this PR).
For example (from wf 39434):
Is it correct that these plots are now emppty? image
or much less populated when including all categories? image
"Non puppi" plots show just some fluctuation in the differences, which is probably what should be expected: but please give a glance also to them.

@gpetruc Can you check if the DQM plots are as expected?

I don't know anything about them, they were added by @drankincms

@dsrankin
Copy link
Contributor

@cecilecaillol about the differences reported in the L1T Phase2 DQM, are they all understood? (They are the same here and in the previous version of this PR).
For example (from wf 39434):
Is it correct that these plots are now emppty? image
or much less populated when including all categories? image
"Non puppi" plots show just some fluctuation in the differences, which is probably what should be expected: but please give a glance also to them.

@gpetruc Can you check if the DQM plots are as expected?

I don't know anything about them, they were added by @drankincms

It looks like the switch from l1pfCandidates to l1ctLayer1 hasn't been propagated here if I am reading things correctly. This change is in the l1t-offline branch, @cecilecaillol could you add that change to this PR to fix perhaps?

@cecilecaillol
Copy link
Contributor

@cecilecaillol about the differences reported in the L1T Phase2 DQM, are they all understood? (They are the same here and in the previous version of this PR).
For example (from wf 39434):
Is it correct that these plots are now emppty? image
or much less populated when including all categories? image
"Non puppi" plots show just some fluctuation in the differences, which is probably what should be expected: but please give a glance also to them.

@gpetruc Can you check if the DQM plots are as expected?

I don't know anything about them, they were added by @drankincms

It looks like the switch from l1pfCandidates to l1ctLayer1 hasn't been propagated here if I am reading things correctly. This change is in the l1t-offline branch, @cecilecaillol could you add that change to this PR to fix perhaps?

@drankincms Thanks! Can you point me to the code or corresponding PR in cms-l1t-offline?

@dsrankin
Copy link
Contributor

Sure! This is the PR: cms-l1t-offline@1b2ffd5

@perrotta
Copy link
Contributor Author

perrotta commented Jun 1, 2022

Closing in favour of #38178

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.

8 participants