From 5c4d5d8bbf4b38a449d562ccd5da2750aecaf4d5 Mon Sep 17 00:00:00 2001 From: Charles Leggett <charles.g.leggett@gmail.com> Date: Tue, 20 Dec 2016 21:01:54 +0100 Subject: [PATCH] Property modernization w/ Gaudi v28 (McAsciiEventSelector-00-03-00) * updates for Property modernization. see gaudi/Gaudi!182 * requires Gaudi v28 * made Property types explicit, eg IntegerProperty -> Gaudi::Property<int> * Property with verifiers are now Gaudi::CheckedProperty<TYPE> * tag McAsciiEventSelector-00-03-00 M src/McAsciiCnvSvc.h M src/McAsciiEventSelector.h 2016-12-16 Charles Leggett * endreq -> endmsg * tag McAsciiEventSelector-00-02-08 M src/McAsciiFileHelper.cxx M src/McAsciiCnvSvc.cxx Former-commit-id: 19c12230392e9fcc7c3246aea465130c63b84ddf --- .../McAsciiEventSelector/src/McAsciiCnvSvc.cxx | 18 +++++++++--------- .../McAsciiEventSelector/src/McAsciiCnvSvc.h | 2 +- .../src/McAsciiEventSelector.h | 12 ++++++------ .../src/McAsciiFileHelper.cxx | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Generators/McAsciiEventSelector/src/McAsciiCnvSvc.cxx b/Generators/McAsciiEventSelector/src/McAsciiCnvSvc.cxx index b186f5f40eb..b0be0c15ba6 100644 --- a/Generators/McAsciiEventSelector/src/McAsciiCnvSvc.cxx +++ b/Generators/McAsciiEventSelector/src/McAsciiCnvSvc.cxx @@ -54,12 +54,12 @@ StatusCode McAsciiCnvSvc::initialize() m_msg.setLevel( m_outputLevel.value() ); m_msg << MSG::INFO << "Enter McAsciiCnvSvc initialization..." - << endreq; + << endmsg; if ( !ConversionSvc::initialize().isSuccess() ) { m_msg << MSG::ERROR << "Unable to initialize base class ::ConversionSvc !!" - << endreq; + << endmsg; return StatusCode::FAILURE; } setProperties().ignore(); @@ -115,7 +115,7 @@ void McAsciiCnvSvc::setInputFile( const std::string& asciiFileName ) if ( asciiFileName.empty() ) { m_msg << MSG::ERROR << "Empty input ASCII file name !!" - << endreq; + << endmsg; throw std::runtime_error( "Empty input ASCII file name !!" ); } @@ -131,7 +131,7 @@ void McAsciiCnvSvc::setInputFile( const std::string& asciiFileName ) m_msg << MSG::ERROR << "Could not configure the converter tool to read from file [" << propValue << "] !!" - << endreq; + << endmsg; throw std::runtime_error( "Failed to configure ASCII cnv tool !!" ); } @@ -149,7 +149,7 @@ void McAsciiCnvSvc::setupCnvTool() if ( service( "ToolSvc", toolSvc ).isFailure() || 0 == toolSvc ) { m_msg << MSG::FATAL << "Tool Service not found !!" - << endreq; + << endmsg; throw std::runtime_error( "Could not find ToolSvc !!" ); } @@ -161,18 +161,18 @@ void McAsciiCnvSvc::setupCnvTool() m_msg << MSG::ERROR << "Creation of algTool [" << cnvName << "]" << " FAILED !" - << endreq; + << endmsg; throw std::runtime_error( "Could not retrieve [" +cnvName+"] !" ); } else { m_msg << MSG::DEBUG << "AlgTool [" << cnvName << "] successfully created" - << endreq; + << endmsg; m_cnvTool = dynamic_cast<IIOHepMcTool*>(algTool); if ( 0 == m_cnvTool ) { m_msg << MSG::ERROR << "Could not dynamic-cast to IIOHepMcTool* !!" - << endreq; + << endmsg; throw std::runtime_error( "Could not dyn-cast to IIOHepMcTool* !!" ); } } @@ -193,7 +193,7 @@ void McAsciiCnvSvc::setupCnvTool() << "Could not configure the converter tool to record the " << "McEventCollection in [" << propValue << "] !!" - << endreq; + << endmsg; throw std::runtime_error( "Failed to configure ASCII cnv tool !!" ); } } diff --git a/Generators/McAsciiEventSelector/src/McAsciiCnvSvc.h b/Generators/McAsciiEventSelector/src/McAsciiCnvSvc.h index 4d826ef3168..875106e2e4b 100644 --- a/Generators/McAsciiEventSelector/src/McAsciiCnvSvc.h +++ b/Generators/McAsciiEventSelector/src/McAsciiCnvSvc.h @@ -84,7 +84,7 @@ class McAsciiCnvSvc : public ConversionSvc IIOHepMcTool* m_cnvTool; /// Output location of the @c McEventCollection - StringProperty m_mcEventsOutputName; + Gaudi::Property<std::string> m_mcEventsOutputName; }; /////////////////////////////////////////////////////////////////// diff --git a/Generators/McAsciiEventSelector/src/McAsciiEventSelector.h b/Generators/McAsciiEventSelector/src/McAsciiEventSelector.h index 0d81398abd7..897ed1464dd 100644 --- a/Generators/McAsciiEventSelector/src/McAsciiEventSelector.h +++ b/Generators/McAsciiEventSelector/src/McAsciiEventSelector.h @@ -84,7 +84,7 @@ class McAsciiEventSelector : virtual public IEvtSelector, McAsciiCnvSvc* m_asciiCnvSvc; /// List of input files - StringArrayProperty m_asciiFileNames; + Gaudi::Property<std::vector<std::string>> m_asciiFileNames; typedef std::size_t EvtSize_t; typedef std::pair<std::string, EvtSize_t> AsciiFile_t; @@ -100,11 +100,11 @@ class McAsciiEventSelector : virtual public IEvtSelector, mutable std::size_t m_curEvtNbr; // mimic @c McEventSelector properties - IntegerProperty m_runNbr; - IntegerProperty m_firstEventNbr; - IntegerProperty m_eventsPerRun; - IntegerProperty m_initTimeStamp; - IntegerProperty m_timeStampInterval; + Gaudi::CheckedProperty<int> m_runNbr; + Gaudi::CheckedProperty<int> m_firstEventNbr; + Gaudi::CheckedProperty<int> m_eventsPerRun; + Gaudi::CheckedProperty<int> m_initTimeStamp; + Gaudi::Property<int> m_timeStampInterval; }; /////////////////////////////////////////////////////////////////// diff --git a/Generators/McAsciiEventSelector/src/McAsciiFileHelper.cxx b/Generators/McAsciiEventSelector/src/McAsciiFileHelper.cxx index 5186f7558dd..689772f3c27 100644 --- a/Generators/McAsciiEventSelector/src/McAsciiFileHelper.cxx +++ b/Generators/McAsciiEventSelector/src/McAsciiFileHelper.cxx @@ -30,7 +30,7 @@ std::size_t evtMax( const std::string& name, MsgStream& msg ) !asciiFile.good() ) { msg << MSG::ERROR << "Could not open file [" << name << "] !!" - << endreq; + << endmsg; throw std::runtime_error( "McAsciiFileHelper::evtMax: " "Problem opening ascii file !!" ); } -- GitLab