diff --git a/DDCond/src/plugins/ConditionsRepositoryParser.cpp b/DDCond/src/plugins/ConditionsRepositoryParser.cpp index 1b3f7751b9ef0922aba51f3c0c876526b7de3096..69eb3a8fb7bb384c7601fd1eb939cb0c9a9f94b7 100644 --- a/DDCond/src/plugins/ConditionsRepositoryParser.cpp +++ b/DDCond/src/plugins/ConditionsRepositoryParser.cpp @@ -252,7 +252,7 @@ namespace DD4hep { ConversionArg* arg = _param<ConversionArg>(); if ( element.hasAttr(_U(ref)) ) { XML::DocumentHolder doc(XML::DocumentHandler().load(element, element.attr_value(_U(ref)))); - (*this)(doc.root()); + Converter<arbitrary>(lcdd,param,optional)(doc.root()); } for( xml_coll_t c(element,_UC(property)); c; ++c) { xml_dim_t d = c; diff --git a/DDG4/include/DDG4/Geant4InputAction.h b/DDG4/include/DDG4/Geant4InputAction.h index 4333e996d4e67e83a75ab7989ec5cb7b34f251ad..3a63bdfd9046d1899b6bfb67a67110b2642ea9a8 100644 --- a/DDG4/include/DDG4/Geant4InputAction.h +++ b/DDG4/include/DDG4/Geant4InputAction.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -70,11 +69,11 @@ namespace DD4hep { /// Default destructor virtual ~Geant4EventReader(); /// File name - const std::string& name() const { return m_name; } + const std::string& name() const { return m_name; } /// Flag if direct event access (by event sequence number) is supported (Default: false) - bool hasDirectAccess() const { return m_directAccess; } + bool hasDirectAccess() const { return m_directAccess; } /// return current Event Number - int currentEventNumber() const { return m_currEvent; } + int currentEventNumber() const { return m_currEvent; } /// Move to the indicated event number. /** For pure sequential access, the default implementation * will skip events one by one. diff --git a/DDG4/include/DDG4/IoStreams.h b/DDG4/include/DDG4/IoStreams.h index 67fc4800bc0e98d8509ef38a29082bfec54e05e4..89333e80dc43ae8ab71a5e6724246a8d6dbfc181 100644 --- a/DDG4/include/DDG4/IoStreams.h +++ b/DDG4/include/DDG4/IoStreams.h @@ -81,13 +81,13 @@ namespace DD4hep { struct category : boost::iostreams::seekable_device_tag, boost::iostreams::closable_tag { }; /// Default constructor - dd4hep_file() : m_handle(0) { } + dd4hep_file() = default; /// Constructors taking file desciptors dd4hep_file(handle_type fd, dd4hep_file_flags); /// Constructors taking file desciptors dd4hep_file(const char* fname, BOOST_IOS::openmode mode); /// Default destructor - ~dd4hep_file(); + ~dd4hep_file() = default; /// open overloads taking file descriptors void open(handle_type fd, dd4hep_file_flags flags); /// open overload taking C-style string @@ -107,9 +107,9 @@ namespace DD4hep { private: /// Native stream handle - handle_type m_handle; + handle_type m_handle = 0; /// Stream flag(s) - dd4hep_file_flags m_flag; + dd4hep_file_flags m_flag = 0; }; diff --git a/DDG4/plugins/Geant4DetectorGeometryConstruction.cpp b/DDG4/plugins/Geant4DetectorGeometryConstruction.cpp index 2bb8687640f1377fe39b02c7ecd886113197df1a..5d7c0d3949c11cf496c231fb564ef01c20ed2f85 100644 --- a/DDG4/plugins/Geant4DetectorGeometryConstruction.cpp +++ b/DDG4/plugins/Geant4DetectorGeometryConstruction.cpp @@ -10,7 +10,6 @@ // \date 2015-11-09 // //========================================================================== -// $Id$ // Framework include files #include "DDG4/Geant4DetectorConstruction.h" diff --git a/DDG4/plugins/Geant4EventReaderHepMC.cpp b/DDG4/plugins/Geant4EventReaderHepMC.cpp index 0ef39a63aa1866e35fc07fa5c84657d56b5dc6dc..c06566eeb47a115c2a17e1b5d0730fb5bf2c6a94 100644 --- a/DDG4/plugins/Geant4EventReaderHepMC.cpp +++ b/DDG4/plugins/Geant4EventReaderHepMC.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -50,15 +49,14 @@ namespace DD4hep { /// Read an event and fill a vector of MCParticles. virtual EventReaderStatus readParticles(int event_number, Vertex& primary_vertex, - std::vector<Particle*>& particles); - virtual EventReaderStatus moveToEvent(int event_number); - virtual EventReaderStatus skipEvent() { return EVENT_READER_OK; } + std::vector<Particle*>& particles) override; + virtual EventReaderStatus moveToEvent(int event_number) override; + virtual EventReaderStatus skipEvent() override { return EVENT_READER_OK; } }; } /* End namespace Simulation */ } /* End namespace DD4hep */ -// $Id: Geant4Converter.cpp 603 2013-06-13 21:15:14Z markus.frank $ //==================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------- @@ -170,9 +168,8 @@ Geant4EventReaderHepMC::Geant4EventReaderHepMC(const string& nam) // Now open the input file: m_input.open(nam.c_str(),BOOST_IOS::in|BOOST_IOS::binary); if ( not m_input.is_open() ) { - string err = "+++ Geant4EventReaderHepMC: Failed to open input stream:"+nam+ - " Error:"+string(strerror(errno)); - throw runtime_error(err); + except("Geant4EventReaderHepMC","+++ Failed to open input stream: %s Error:%s.", + nam.c_str(), ::strerror(errno)); } m_events = new HepMC::EventStream(m_input); } @@ -187,7 +184,7 @@ Geant4EventReaderHepMC::~Geant4EventReaderHepMC() { /// skipEvents if required Geant4EventReader::EventReaderStatus Geant4EventReaderHepMC::moveToEvent(int event_number) { - if( m_currEvent == 0 && event_number != 0 ) { + if( m_currEvent < event_number && event_number != 0 ) { printout(INFO,"EventReaderHepMC::moveToEvent","Skipping the first %d events", event_number); printout(INFO,"EventReaderHepMC::moveToEvent","Event number before skipping: %d", m_currEvent); while ( m_currEvent < event_number ) { diff --git a/DDG4/src/Geant4DetectorConstruction.cpp b/DDG4/src/Geant4DetectorConstruction.cpp index 8715ca3c1358d51f4c5a24c424458a131e103fed..a58e755dea3993fa881b062ad17e004aa5efd3bc 100644 --- a/DDG4/src/Geant4DetectorConstruction.cpp +++ b/DDG4/src/Geant4DetectorConstruction.cpp @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDG4/src/Geant4InputAction.cpp b/DDG4/src/Geant4InputAction.cpp index fda76766093717cb94da3c1025595b4997895c4c..f396abb1225596f8e6544f35a3a6e72c5a10f484 100644 --- a/DDG4/src/Geant4InputAction.cpp +++ b/DDG4/src/Geant4InputAction.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDG4/src/Geant4VolumeManager.cpp b/DDG4/src/Geant4VolumeManager.cpp index a9c2c1e095648634ce5ab5325c8caf39a052ac4d..86775173d6d4ae88e05f823ce9aff29aa96c949d 100644 --- a/DDG4/src/Geant4VolumeManager.cpp +++ b/DDG4/src/Geant4VolumeManager.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDG4/src/IoStreams.cpp b/DDG4/src/IoStreams.cpp index 940a388f91ba90fd48ee826af6eeb3afeeed0b56..55a8ccec08b6ceac6f2e55bce827691ac181e340 100644 --- a/DDG4/src/IoStreams.cpp +++ b/DDG4/src/IoStreams.cpp @@ -61,10 +61,6 @@ namespace DD4hep { template<> std::streamsize dd4hep_file<int>::read(char_type* s, std::streamsize n) { return ::read(m_handle,s,n); } - /// Specialization for standard file descriptor files according to the posix standard: Default destructor - template<> dd4hep_file<int>::~dd4hep_file() - { if (m_handle) ::close(m_handle); m_handle = 0;} - /// Specialization for standard file descriptor files according to the posix standard template<> std::streamsize dd4hep_file<int>::write(const char_type* s, std::streamsize n) { return ::write(m_handle,s,n); } @@ -107,10 +103,6 @@ namespace DD4hep { template<> dd4hep_file<TFile*>::dd4hep_file(const char* fname, BOOST_IOS::openmode mode) : m_handle(0), m_flag(close_handle) { open(fname,mode); } - /// Specialization for the usage of TFile structures: Default destructor - template<> dd4hep_file<TFile*>::~dd4hep_file() - { if ( m_handle ) m_handle->Close(); m_handle = 0; } - /// Specialization for the usage of TFile structures template<> std::streamsize dd4hep_file<TFile*>::read(char_type* s, std::streamsize n) { if ( m_handle ) {