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

Factor of 2 bugfix for HF PF rechits w/ short-fiber only #38464

Merged
merged 1 commit into from Jun 26, 2022

Conversation

mandrenguyen
Copy link
Contributor

PR description:

Bug-fix for a dropped factor of two in the PF HF rechit reconstruction. The energy is scaled by a factor of two in the code anticipating that the long and short fibers will be added. However, when there is only a deposit in the short fiber, this factor of two needs to be scaled back out.
Heavy-ions use low energy HF rechits for discriminating hadronic interactions from electromagetic and noise. This bug was found to reduce discrimination compared to using HF towers (which are not available at mini-AOD).

This was summarized at a recent PF meeting:
https://indico.cern.ch/event/1102173/contributions/4925583/attachments/2464753/4226434/HF_lk_17June_2022.pdf

We would certainty like to fix this for 12_5, where we use the HF essentially only for event selection.
It will be discussed at PPD tomorrow (June 23rd), whether this should also be backported for the upcoming high-lumi pp data.

PR validation:

if this PR is a backport please specify the original PR and why you need to backport that PR:

Bug-fix for a dropped factor of two in the PF HF rechit reconstruction. The energy is scaled by a factor of two in the code anticipating that the long and short fibers will be added. However, when there is only a deposit in the short fiber, this factor of two needs to be scaled back out.
Heavy-ions use low energy HF rechits for discriminating hadronic interactions from electromagetic and noise. This bug was found to reduce discrimination compared to using HF towers (which are not available at mini-AOD).

This was summarized at a recent PF meeting:
https://indico.cern.ch/event/1102173/contributions/4925583/attachments/2464753/4226434/HF_lk_17June_2022.pdf

We would certainty like to fix this for 12_5, where we use the HF essentially only for event selection.
It will be discussed at PPD tomorrow (June 23rd), whether this should also be backported for the upcoming high-lumi pp data.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38464/30676

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @mandrenguyen (Matthew Nguyen) for master.

It involves the following packages:

  • RecoParticleFlow/PFClusterProducer (reconstruction)

@jpata, @cmsbuild, @clacaputo can you please review it and eventually sign? Thanks.
@mmarionncern, @felicepantaleo, @rovere, @lgray, @lecriste, @hatakeyamak, @ebrondol, @seemasharmafnal 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

@jpata
Copy link
Contributor

jpata commented Jun 22, 2022

@cmsbuild please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c5fe37/25694/summary.html
COMMIT: 6c069e2
CMSSW: CMSSW_12_5_X_2022-06-22-1100/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/38464/25694/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 11203 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3659099
  • DQMHistoTests: Total failures: 6129
  • DQMHistoTests: Total nulls: 5
  • DQMHistoTests: Total successes: 3652943
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: -0.031 KiB( 49 files compared)
  • DQMHistoSizes: changed ( 138.4 ): -0.008 KiB JetMET/SUSYDQM
  • DQMHistoSizes: changed ( 138.5 ): -0.004 KiB JetMET/SUSYDQM
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • DQMHistoSizes: changed ( 4.53 ): -0.023 KiB JetMET/SUSYDQM
  • Checked 208 log files, 45 edm output root files, 50 DQM output files
  • TriggerResults: found differences in 3 / 49 workflows

@kdlong
Copy link
Contributor

kdlong commented Jun 23, 2022

Thanks @mandrenguyen. Can you also make a back port to 12_4, as discussed in the PPD meeting?

@perrotta
Copy link
Contributor

urgent
(the backport is intended to enter next week' 12_4_1)

@kdlong
Copy link
Contributor

kdlong commented Jun 24, 2022

Sorry to contribute entropy here, but maybe it's worth a quick comment in the code saying why you are dividing the factor of two? If someone really cares they can find it here, but it would be consistent with the rest of the code to have an in-line comment (just the first 1-2 sentences you have here in the PR).

If this slows down the integration of the PR don't worry about it.

@clacaputo
Copy link
Contributor

+reconstruction

  • fix for HF PF rechits energy
  • reco differences in PFCandidates are in line with the expectation; minimal differences in other downstream quantities

@cmsbuild
Copy link
Contributor

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

@perrotta
Copy link
Contributor

I think that rewriting L143-L168 of the code as follows would give identical results and fix the bug, but it could be more intuitive and avoid the (correct) suggestion of adding some inline documentation by @kdlong here above

        double energy = sHORT;

        if (found_hit != tmpOut.end() && found_hit->detId() == longID.rawId()) {
          double lONG = found_hit->energy();
          //Ask for fraction

          //If in this case lONG-sHORT<0 add the energy to the sHORT
          if ((lONG - sHORT) < thresh_HF_)
            energy += lONG;
          else
            energy += sHORT;

          if (abs(detid.ieta()) <= 32)
            energy *= HFCalib_;

          newHit.setEnergy(energy);
          if (!(sHORT > shortFibre_Cut && (lONG / sHORT < longFibre_Fraction)))
            if (energy > thresh_HF_)
              out->push_back(newHit);

        } else {
          //only short hit!

          if (abs(detid.ieta()) <= 32)
            energy *= HFCalib_;

          newHit.setEnergy(energy);
          if (energy > thresh_HF_)
            out->push_back(newHit);
        }

What do you think @mandrenguyen @clacaputo etc?

was too quick, this is the fix suggested by Lev

code format

reorganize code in more logical way
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38464/30733

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

Pull request #38464 was updated. @jpata, @cmsbuild, @clacaputo can you please check and sign again.

@perrotta
Copy link
Contributor

please test
(thank you @mandrenguyen )

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-c5fe37/25797/summary.html
COMMIT: 9d533e3
CMSSW: CMSSW_12_5_X_2022-06-25-1100/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/38464/25797/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 11205 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3659995
  • DQMHistoTests: Total failures: 6131
  • DQMHistoTests: Total nulls: 4
  • DQMHistoTests: Total successes: 3653838
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: -0.035 KiB( 49 files compared)
  • DQMHistoSizes: changed ( 138.4 ): -0.008 KiB JetMET/SUSYDQM
  • DQMHistoSizes: changed ( 138.5 ): -0.004 KiB JetMET/SUSYDQM
  • DQMHistoSizes: changed ( 4.53 ): -0.023 KiB JetMET/SUSYDQM
  • Checked 208 log files, 45 edm output root files, 50 DQM output files
  • TriggerResults: found differences in 3 / 49 workflows

@perrotta
Copy link
Contributor

@cms-sw/reconstruction-l2 the logic of the algo didn't change since your last signature, and the reco/dqm outputs are identical. I merge this master PR in order to speed up the integration of the backport PR in 12_4_X.
If you see any issue that we didn't notice, please let us know and we'll revert or fix it.
I'll let you sign the backport PR before merging it.

@perrotta
Copy link
Contributor

merge

@jfernan2
Copy link
Contributor

jfernan2 commented Sep 18, 2023

+1
(for the records)

@cmsbuild
Copy link
Contributor

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 be automatically merged.

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