Skip to content

Commit

Permalink
Merge pull request cms-sw#45740 from mmusich/mm_dev_morePrintOut_Beam…
Browse files Browse the repository at this point in the history
…SpotOnlineProducer_14_0_X

[14.0.X] `BeamSpotOnlineProducer`: add more printouts in case of invalid errors
  • Loading branch information
cmsbuild authored Aug 20, 2024
2 parents 556b001 + 5803265 commit af2d35b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions RecoVertex/BeamSpotProducer/plugins/BeamSpotOnlineProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ________________________________________________________________**/
#include "CondFormats/DataRecord/interface/BeamSpotTransientObjectsRcd.h"
#include "DataFormats/BeamSpot/interface/BeamSpot.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/GeometryCommonDetAlgo/interface/GlobalError.h"
#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerEvmReadoutRecord.h"
#include "DataFormats/Scalers/interface/BeamSpotOnline.h"
#include "FWCore/Framework/interface/ESHandle.h"
Expand Down Expand Up @@ -119,8 +120,8 @@ void BeamSpotOnlineProducer::produce(Event& iEvent, const EventSetup& iSetup) {
reco::BeamSpot::Point apoint(f * spotDB.x(), f * spotDB.y(), f * spotDB.z());

reco::BeamSpot::CovarianceMatrix matrix;
for (int i = 0; i < 7; ++i) {
for (int j = 0; j < 7; ++j) {
for (int i = 0; i < reco::BeamSpot::dimension; ++i) {
for (int j = 0; j < reco::BeamSpot::dimension; ++j) {
matrix(i, j) = spotDB.covariance(i, j);
}
}
Expand Down Expand Up @@ -209,8 +210,8 @@ void BeamSpotOnlineProducer::produce(Event& iEvent, const EventSetup& iSetup) {
reco::BeamSpot::Point apoint(spotDB->x(), spotDB->y(), spotDB->z());

reco::BeamSpot::CovarianceMatrix matrix;
for (int i = 0; i < 7; ++i) {
for (int j = 0; j < 7; ++j) {
for (int i = 0; i < reco::BeamSpot::dimension; ++i) {
for (int j = 0; j < reco::BeamSpot::dimension; ++j) {
matrix(i, j) = spotDB->covariance(i, j);
}
}
Expand All @@ -222,6 +223,11 @@ void BeamSpotOnlineProducer::produce(Event& iEvent, const EventSetup& iSetup) {
aSpot.setEmittanceY(spotDB->emittanceY());
aSpot.setbetaStar(spotDB->betaStar());
aSpot.setType(reco::BeamSpot::Tracker);

GlobalError bse(aSpot.rotatedCovariance3D());
if ((bse.cxx() <= 0.) || (bse.cyy() <= 0.) || (bse.czz() <= 0.)) {
edm::LogError("UnusableBeamSpot") << "Beamspot from fallback to DB with invalid errors: " << aSpot.covariance();
}
}

*result = aSpot;
Expand Down

0 comments on commit af2d35b

Please sign in to comment.