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

Merge branch 'cppcheck.xAODTau-20230929' into 'main'

xAODTau: Fix cppcheck warnings.

See merge request atlas/athena!66166
parents b973065b f8c84adf
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
*/
// $Id: DiTauJet_v1.cxx 631921 2015-09-23 23:30:59Z dkirchme $
......@@ -12,6 +12,7 @@
#include "xAODTau/versions/DiTauJet_v1.h"
// #include "xAODDiTau/versions/TauJetCalibMapper_v1.h"
#include "DiTauJetAccessors_v1.h"
#include <stdexcept>
namespace xAOD {
......@@ -370,13 +371,22 @@ namespace xAOD {
// Set int detail via enum
//-------------------------------------------------------------------------
void DiTauJet_v1::setDetail( DiTauJetParameters::Detail detail, int value ) {
( *( xAODDiTau::detailsAccessorV1<int>( detail ) ) )( *this ) = value;
const SG::AuxElement::Accessor< int >* acc = xAODDiTau::detailsAccessorV1<int>( detail );
if (!acc) {
throw std::runtime_error ("DiTauJet_v1::setDetail: bad detail code");
}
(*acc)(*this) = value;
}
//-------------------------------------------------------------------------
// Set float detail via enum
//-------------------------------------------------------------------------
void DiTauJet_v1::setDetail( DiTauJetParameters::Detail detail, float value ) {
const SG::AuxElement::Accessor< float >* acc = xAODDiTau::detailsAccessorV1<float>( detail );
if (!acc) {
throw std::runtime_error ("DiTauJet_v1::setDetail: bad detail code");
}
(*acc)(*this) = value;
( *( xAODDiTau::detailsAccessorV1<float>( detail ) ) )( *this ) = value;
}
......
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