diff --git a/Root/TruthWeightTool.cxx b/Root/TruthWeightTool.cxx index e17ca1fb89b323f99bc167c329478970336069cb..fc29efbc0a9d583431cc9b7a4cff355afe6f078d 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 312dbdddbe5e2f4e0b5c353e8879e6e735dbe1fe..4dead0b74a3420a83409bea472e4cac815fc0919 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;