diff --git a/DDCore/include/DD4hep/Memory.h b/DDCore/include/DD4hep/Memory.h new file mode 100644 index 0000000000000000000000000000000000000000..511802878238ef774e15b9f9750fde798201ef1e --- /dev/null +++ b/DDCore/include/DD4hep/Memory.h @@ -0,0 +1,55 @@ +// $Id: Readout.h 951 2013-12-16 23:37:56Z Christian.Grefe@cern.ch $ +//==================================================================== +// AIDA Detector description implementation for LCD +//-------------------------------------------------------------------- +// +// Author : M.Frank +// +//==================================================================== +#ifndef DD4HEP_MEMORY_H +#define DD4HEP_MEMORY_H + +// Framework include files +#include "RVersion.h" + +// C/C++ include files +#include <memory> + +/// Namespace for the AIDA detector description toolkit +namespace DD4hep { + + /// Out version of the std auto_ptr implementation base either on auto_ptr or unique_ptr. + /** + * Only need to overload constructor. Everything else + * like operator->, operator*, get, release etc. comes from base. + * + * \author M.Frank + * \version 1.0 + * \ingroup DD4HEP_GEOMETRY + */ + template <typename T> class dd4hep_ptr +#if __cplusplus >= 201103L && ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) + : public std::unique_ptr<T> { + public: + typedef std::unique_ptr<T> base_t; +#else + : public std::auto_ptr<T> { + public: + typedef std::auto_ptr<T> base_t; + void swap(base_t& c) { *this = c; c.release(); } +#endif + /// Default Constructor. + dd4hep_ptr() : base_t() {} + /// Constructor from pointer + dd4hep_ptr(T* p) : base_t(p) {} + /// Constructor from copy + dd4hep_ptr(base_t& c) : base_t(c) {} + /// Assignment operator + dd4hep_ptr& operator=(base_t& c) { + this->swap(c); + return *this; + } + }; +} + +#endif // DD4HEP_MEMORY_H diff --git a/DDEve/CMakeLists.txt b/DDEve/CMakeLists.txt index 3f80634f2d389c024169349a8ee8ec321e9d6b82..73b2ea3cad1e4611a026b959fedf8d84c24ac78d 100644 --- a/DDEve/CMakeLists.txt +++ b/DDEve/CMakeLists.txt @@ -45,7 +45,6 @@ list(APPEND sources G__DDEve.cxx) add_library(DD4hepEve SHARED ${sources}) target_link_libraries(DD4hepEve DD4hepCore DD4hepG4 ${ROOT_EVE_LIBRARIES} -lFTGL ${LCIO_LIBRARIES} ) -SET( CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Wno-long-long") SET_TARGET_PROPERTIES( DD4hepEve PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION}) diff --git a/DDRec/include/DDRec/API/Exceptions.h b/DDRec/include/DDRec/API/Exceptions.h index 24a76f78a4e31b310f8ac6aea4b2ed74ce009c73..8710524abec4c0095da7dad943bdbe270fe2d9a7 100644 --- a/DDRec/include/DDRec/API/Exceptions.h +++ b/DDRec/include/DDRec/API/Exceptions.h @@ -17,7 +17,7 @@ #include <stdexcept> #include <string> -#include <strstream> +#include <sstream> namespace DD4hep { namespace DDRec { diff --git a/DDRec/src/Surface.cpp b/DDRec/src/Surface.cpp index 5d53c4ae390c2b11516b795cc556dd3974d4bbd0..28aef5f07e8d679d3377630965ad4bc78b40f8f8 100644 --- a/DDRec/src/Surface.cpp +++ b/DDRec/src/Surface.cpp @@ -1,12 +1,12 @@ #include "DDRec/Surface.h" #include "DD4hep/objects/DetectorInterna.h" +#include "DD4hep/Memory.h" #include "DDRec/MaterialManager.h" #include <cmath> #include <memory> #include <exception> -#include <memory> #include "TGeoMatrix.h" #include "TGeoShape.h" @@ -553,7 +553,7 @@ namespace DD4hep { // need to get the inverse transformation ( see Detector.cpp ) // std::auto_ptr<TGeoHMatrix> wtI( new TGeoHMatrix( wm.Inverse() ) ) ; // has been fixed now, no need to get the inverse anymore: - std::auto_ptr<TGeoHMatrix> wtI( new TGeoHMatrix( wm ) ) ; + dd4hep_ptr<TGeoHMatrix> wtI( new TGeoHMatrix( wm ) ) ; //---- if the volSurface is not in the DetElement's volume, we need to mutliply the path to the volume to the // DetElements world transform @@ -571,7 +571,7 @@ namespace DD4hep { // std::cout << " +++ new world transform matrix : " << std::endl ; #if 0 //fixme: which convention to use here - the correct should be wtI, however it is the inverse of what is stored in DetElement ??? - std::auto_ptr<TGeoHMatrix> wt( new TGeoHMatrix( wtI->Inverse() ) ) ; + dd4hep_ptr<TGeoHMatrix> wt( new TGeoHMatrix( wtI->Inverse() ) ) ; wt->Print() ; // cache the world transform for the surface _wtM = wt.release() ; diff --git a/DDSurfaces/CMakeLists.txt b/DDSurfaces/CMakeLists.txt index d63db334acdb426ac08225ec5e2aae528c95a931..686837af4a8ca55825fef9d63bd16f0a19060531 100644 --- a/DDSurfaces/CMakeLists.txt +++ b/DDSurfaces/CMakeLists.txt @@ -31,7 +31,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) #add_library(${PackageName} SHARED ${sources} ) -#SET(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Wno-long-long") #SET_TARGET_PROPERTIES( ${PackageName} PROPERTIES VERSION ${DDSurfaces_VERSION} SOVERSION ${DDSurfaces_SOVERSION}) #--- install target------------------------------------- diff --git a/UtilityApps/CMakeLists.txt b/UtilityApps/CMakeLists.txt index a7e2b87e579ee17ecb97ac0f876daebac19da6ef..a6c4bfc824d5a0afe334944c921157fa2b3d6f09 100644 --- a/UtilityApps/CMakeLists.txt +++ b/UtilityApps/CMakeLists.txt @@ -7,8 +7,6 @@ include_directories( ${CMAKE_SOURCE_DIR}/DDCore/include ${CMAKE_SOURCE_DIR}/DDRec/include ${CMAKE_SOURCE_DIR}/DDTest/include ) - - #----------------------------------------------------------------------------------- add_executable(geoDisplay src/display.cpp) target_link_libraries(geoDisplay DD4hepCore ) diff --git a/cmake/DD4hep.cmake b/cmake/DD4hep.cmake index 6efecca228a3176e438b8c008579dd885b99d326..a88d1205317d56e0d642216b415c41616c93b6e5 100644 --- a/cmake/DD4hep.cmake +++ b/cmake/DD4hep.cmake @@ -1,3 +1,10 @@ + +#--------------------------------------------------------------------------------------------------- +##SET( CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -pedantic -Wno-long-long") +SET( CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Wno-long-long") + +add_definitions(-DBOOST_SPIRIT_USE_PHOENIX_V3) + #--------------------------------------------------------------------------------------------------- # add_dd4hep_plugin ( libraryName ) # diff --git a/cmake/FindROOT.cmake b/cmake/FindROOT.cmake index 0c8b468aad9ee01c423fecac5c056d8e44548e6d..a57e8eb6e781e3a2c4191c64ee5dfd41a9d93e0b 100644 --- a/cmake/FindROOT.cmake +++ b/cmake/FindROOT.cmake @@ -101,7 +101,7 @@ function(root_generate_dictionary dictionary) #---call rootcint------------------------------------------ add_custom_command(OUTPUT ${dictionary}.cxx ${dictionary}.h COMMAND echo ${ROOTCINT_EXECUTABLE} -cint -f ${dictionary}.cxx - -c ${ARG_OPTIONS} ${includedirs} ${headerfiles} ${linkdefs} + -c -p ${ARG_OPTIONS} ${includedirs} ${headerfiles} ${linkdefs} COMMAND ${ROOTCINT_EXECUTABLE} -f ${dictionary}.cxx -c -p ${ARG_OPTIONS} ${includedirs} ${headerfiles} ${linkdefs} DEPENDS ${headerfiles} ${linkdefs})