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

[13.0.X] Produce a fake BeamSpot object in BeamSpotOnlineProducer when using transient record logic and OnlineBeamSpotESProducer returned a fake #41674

Conversation

mmusich
Copy link
Contributor

@mmusich mmusich commented May 15, 2023

backport of #41597 (partial)

PR description:

While working on #41193, I have noticed that despite OnlineBeamSpotESProducer has a refined logic in order to put into the event setup a fake BeamSpot when certain conditions are not met:

if (best) {
return std::shared_ptr<const BeamSpotObjects>(best, edm::do_nothing_deleter());
} else {
return std::shared_ptr<const BeamSpotObjects>(&fakeBS_, edm::do_nothing_deleter());
edm::LogInfo("OnlineBeamSpotESProducer")
<< "None of the Online BeamSpots in the ES is suitable, \n returning a fake one. ";
}

the current BeamSpotOnlineProducer logic, if useTransientRecord_ is true and the OnlineBeamSpotESProducer returned a fake beamspot, just falls back to DB (reading the content of BeamSpotObjectsRcd, populated by the PCL in realtime workflows) - which I have understood from the Beam Spot experts is not the right / expected behaviour.

if (useTransientRecord_) {
auto const& spotDB = iSetup.getData(beamTransientToken_);
if (spotDB.beamType() != 2) {
if (shoutMODE && beamTransientRcdESWatcher_.check(iSetup)) {
edm::LogWarning("BeamSpotFromDB")
<< "Online Beam Spot producer falls back to DB value because the ESProducer returned a fake beamspot ";
}
fallBackToDB = true;

In this PR (in commit 5a3afff) I change the current behaviour, such that instead now it will indeed produce a fake BS for consumption online (as it was originally devised).

In the master branch, I have found convenient to create a new plugin BeamSpotOnlineFromOfflineConverter that taking a BeamSpotObject in input creates an sqlite file in output containing a payload of the type BeamSpotOnlineObjects. This has been added in commit 0b2e105, while commits 6f1912e and 5c011c8 add a utility accessor to the BeamSpotOnlineObjects condtion format to be able to readily copy from a BeamSpotObjects payload (friend class) all the common parameters. Finally commit 991186b adds this converter to the battery of unit tests of the CondTools/BeamSpot package.

N.B.
I have NOT backported commits d5eedb8 and 63e821e in this PR as they are not needed. Indeed in 13.0.X the phase-2 HLT menu uses the offline BeamSpot directly, without using the fallback mechanism, see:

import FWCore.ParameterSet.Config as cms
offlineBeamSpot = cms.EDProducer("BeamSpotProducer")

(the move was done in #41047 which was not backported)

PR validation:

cmssw complies. Passes back unit tests.

If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:

This is a backport of #41597, to be backported down to 13.0.X for 2023 data-taking purposes.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @mmusich (Marco Musich) for CMSSW_13_0_X.

It involves the following packages:

  • CondFormats/BeamSpotObjects (db, alca)
  • CondTools/BeamSpot (db, alca)
  • RecoVertex/BeamSpotProducer (reconstruction, alca)

@clacaputo, @cmsbuild, @saumyaphor4252, @francescobrivio, @mandrenguyen, @tvami can you please review it and eventually sign? Thanks.
@VourMa, @GiacomoSguazzoni, @JanFSchulte, @tocheng, @VinInn, @missirol, @rovere, @mmusich, @mtosi, @dgulhan, @seemasharmafnal, @francescobrivio 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

@mmusich
Copy link
Contributor Author

mmusich commented May 15, 2023

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e49873/32634/summary.html
COMMIT: 991186b
CMSSW: CMSSW_13_0_X_2023-05-15-1100/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/41674/32634/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 20 lines to the logs
  • Reco comparison results: 2 differences found in the comparisons
  • DQMHistoTests: Total files compared: 49
  • DQMHistoTests: Total histograms compared: 3555563
  • DQMHistoTests: Total failures: 4
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3555537
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 48 files compared)
  • Checked 213 log files, 164 edm output root files, 49 DQM output files
  • TriggerResults: no differences found

@tvami
Copy link
Contributor

tvami commented May 16, 2023

+1

@clacaputo
Copy link
Contributor

+reconstruction

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_13_0_X IBs (tests are also fine) and once validation in the development release cycle CMSSW_13_2_X is complete. 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)

@perrotta
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 6e9ea6c into cms-sw:CMSSW_13_0_X May 16, 2023
@mmusich mmusich deleted the 13_0_X_useFakeBSasFallBackInOnlineProducer2 branch May 16, 2023 12:37
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.

5 participants