From 418023b525cb88373f3de851f11a5ae8913a07b3 Mon Sep 17 00:00:00 2001 From: Dag Gillberg <dag.gillberg@cern.ch> Date: Sat, 25 Feb 2017 20:28:07 +0000 Subject: [PATCH] Chaning debug message to debut stream. Proper tool handle name for athena. --- Root/TruthWeightTool.cxx | 3 ++- test/ath_test_truthWeightTool.cxx | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Root/TruthWeightTool.cxx b/Root/TruthWeightTool.cxx index e17ca1fb89b3..fc29efbc0a9d 100644 --- a/Root/TruthWeightTool.cxx +++ b/Root/TruthWeightTool.cxx @@ -13,7 +13,7 @@ namespace xAOD { } StatusCode TruthWeightTool::initialize() { - ATH_MSG_WARNING( "Initialising... " ); + ATH_MSG_DEBUG( "Initialising... " ); return StatusCode::SUCCESS; } @@ -44,6 +44,7 @@ namespace xAOD { ATH_MSG_DEBUG( "Retrieving truth meta data from a new file" ); m_metaDataContainer = nullptr; ATH_CHECK( inputMetaStore()->retrieve( m_metaDataContainer, m_metaName ) ); + if (m_metaDataContainer==nullptr) std::runtime_error("Cannot access metadata: "+m_metaName); return StatusCode::SUCCESS; } diff --git a/test/ath_test_truthWeightTool.cxx b/test/ath_test_truthWeightTool.cxx index 312dbdddbe5e..4dead0b74a34 100644 --- a/test/ath_test_truthWeightTool.cxx +++ b/test/ath_test_truthWeightTool.cxx @@ -48,7 +48,10 @@ int main( int argc, char* argv[] ) { // Create the truth weight tool: xAOD::TruthWeightTool weightTool( "TruthWeightTool" ); weightTool.setProperty( "OutputLevel", MSG::INFO ).ignore(); - ToolHandle< xAOD::ITruthWeightTool > handle( "TruthWeightTool" ); + + // The preferred way to create and configure tools is with a ToolHandle: + // constructor argument is: Type/Name + ToolHandle< xAOD::ITruthWeightTool > handle( "xAOD::TruthWeightTool/TruthWeightTool" ); if ( handle.retrieve().isFailure() ) { ::Error( APP_NAME, "Could not retrieve TruthWeightTool"); return 1; -- GitLab