Skip to content
Snippets Groups Projects
Commit 02a8bac7 authored by Adam Edward Barton's avatar Adam Edward Barton :speech_balloon:
Browse files

Merge branch 'ATLASRECTS-6095' into 'master'

Remove FPEs raised from bad muon extensions

See merge request !41926
parents 5d020685 5e261c42
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!41926Remove FPEs raised from bad muon extensions
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -29,7 +29,14 @@ namespace Amg {
inline double error(const Amg::MatrixX& mat, int index) {
return sqrt(mat(index, index));
}
/// Returns true if all diagonal elements of the covariance matrix
/// are greater or equal zero
template <int N> bool valid_cov(const AmgSymMatrix(N)& mat){
for (int i = 0; i < N ; ++i){
if (mat(i,i) < 0.) return false;
}
return true;
}
template<int N>
inline double error(const AmgSymMatrix(N)& mat, int index ) {
assert(index<N);
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "MuonSystemExtensionTool.h"
......@@ -225,7 +225,7 @@ MuonSystemExtensionTool::muonSystemExtension(const xAOD::TrackParticle& indetTr
// create shared pointer and add to garbage collection
std::shared_ptr<const Trk::TrackParameters> sharedPtr(exPars);
// reject intersections with very big uncertainties (parallel to surface)
if (Amg::error(*exPars->covariance(), Trk::locX) > 10000.
if (!Amg::valid_cov(*exPars->covariance()) || Amg::error(*exPars->covariance(), Trk::locX) > 10000.
|| Amg::error(*exPars->covariance(), Trk::locY) > 10000.)
continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment