From 96dd3dead02d4a1b9003747a5804c865c0e9756b Mon Sep 17 00:00:00 2001 From: Alice Date: Mon, 19 Jun 2017 16:53:50 +0200 Subject: [PATCH 1/3] changes for Xcode 8 warning + remove rpath from papaslib CMake --- examples/CMakeLists.txt | 4 +++- examples/PythiaConnector.cpp | 5 +++-- examples/example_simple.cpp | 2 +- papas/datatypes/src/Cluster.cpp | 2 +- papas/display/src/GDetectorElement.cpp | 8 ++++---- papas/graphtools/src/EventRuler.cpp | 10 +++++----- papaslib/CMakeLists.txt | 17 ++--------------- tests/unittest.cpp | 2 +- 8 files changed, 20 insertions(+), 30 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index fb9db5b..d1ec56f 100755 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -5,6 +5,7 @@ ${MAINDIR} ${MAINDIR}/spdlog ${CMAKE_CURRENT_SOURCE_DIR} ) +message(STATUS "Found podio: ${ROOT_LIBRARIES}") add_executable(example_simple example_simple.cpp PythiaConnector.cpp ) @@ -25,6 +26,7 @@ target_link_libraries(example_pdebug papas ${ROOT_LIBRARIES} datamodel datamodel add_executable(example_plot example_plot.cpp PythiaConnector.cpp ) target_link_libraries(example_plot papas ${ROOT_LIBRARIES} datamodel datamodelDict podio utilities) + #todo fix this #add_executable(example_gun example_gun.cpp ) #target_link_libraries(example_gun papas ${ROOT_LIBRARIES} datamodel datamodelDict utilities) @@ -46,4 +48,4 @@ install(TARGETS example_plot DESTINATION bin) add_test(NAME fcc-generate COMMAND $ENV{FCCPHYSICS}/bin/fcc-pythia8-generate $ENV{FCCPHYSICS}/share/ee_ZH_Zmumu_Hbb.txt WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) add_test(NAME example_loop COMMAND $ENV{FCCPAPASCPP}/bin/example_loop ee_ZH_Zmumu_Hbb.root WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) -#set_property(TEST example_loop PROPERTY DEPENDS fcc-generate) \ No newline at end of file +#set_property(TEST example_loop PROPERTY DEPENDS fcc-generate) diff --git a/examples/PythiaConnector.cpp b/examples/PythiaConnector.cpp index 3e92247..0987675 100644 --- a/examples/PythiaConnector.cpp +++ b/examples/PythiaConnector.cpp @@ -11,7 +11,7 @@ #include "papas/reconstruction/PapasManager.h" #include "papas/reconstruction/PapasManager.h" -#include "datamodel/CaloClusterCollection.h" +//#include "datamodel/CaloClusterCollection.h" #include "datamodel/EventInfoCollection.h" #include "datamodel/ParticleCollection.h" #include "utilities/ParticleUtils.h" @@ -166,6 +166,7 @@ void PythiaConnector::writeParticlesROOT(const char* fname, const papas::Particl writer.finish(); } +/* void PythiaConnector::writeClustersROOT(const char* fname, const papas::Clusters& clusters) { podio::ROOTWriter writer(fname, &m_store); @@ -217,7 +218,7 @@ void PythiaConnector::AddClustersToEDM(const papas::Clusters& papasClusters, fcc p3.z = c.second.position().Z(); } } - +*/ /*void PythiaConnector::readClustersROOT(unsigned int eventNo, papas::PapasManager& papasManager) { const fcc::ParticleCollection* ptcs(nullptr); diff --git a/examples/example_simple.cpp b/examples/example_simple.cpp index 06a7fb4..1bea200 100644 --- a/examples/example_simple.cpp +++ b/examples/example_simple.cpp @@ -62,7 +62,7 @@ int main(int argc, char* argv[]) { } // testing (move elsewhere) - pythiaConnector.writeClustersROOT("simpleeg.root", papasManager.event().clusters("em")); + //pythiaConnector.writeClustersROOT("simpleeg.root", papasManager.event().clusters("em")); // produce papas display TApplication tApp("theApp", &argc, argv); diff --git a/papas/datatypes/src/Cluster.cpp b/papas/datatypes/src/Cluster.cpp index f16cd23..e4c6d14 100644 --- a/papas/datatypes/src/Cluster.cpp +++ b/papas/datatypes/src/Cluster.cpp @@ -10,7 +10,7 @@ double Cluster::s_maxEnergy = 0; Cluster::Cluster(double energy, const TVector3& position, double size_m, uint32_t index, IdCoder::ItemType type, char subtype) - : m_id(IdCoder::makeId(index, type, subtype, fmax(0, energy))), m_position(position), m_subClusters({}) { + : m_id(IdCoder::makeId(index, type, subtype, fmax(0, energy))), m_position(position) { setSize(size_m); setEnergy(energy); } diff --git a/papas/display/src/GDetectorElement.cpp b/papas/display/src/GDetectorElement.cpp index a867e56..a878381 100644 --- a/papas/display/src/GDetectorElement.cpp +++ b/papas/display/src/GDetectorElement.cpp @@ -33,8 +33,8 @@ GDetectorElement::GDetectorElement(std::shared_ptr detEle double radius = elem.radius(); double dz = elem.z(); - m_circles.push_back(std::move(TEllipse(0., 0., radius, radius))); - m_boxes.push_back(std::move(TBox(-dz, -radius, dz, radius))); + m_circles.push_back(TEllipse(0., 0., radius, radius)); + m_boxes.push_back(TBox(-dz, -radius, dz, radius)); } // Choose color according to which element it is @@ -59,8 +59,8 @@ GDetectorElement::GDetectorElement(std::shared_ptr detEle GDetectorElement::GDetectorElement(double radius, double dz) { - m_circles.push_back(std::move(TEllipse(0., 0., radius, radius))); - m_boxes.push_back(std::move(TBox(-dz, -radius, dz, radius))); + m_circles.push_back(TEllipse(0., 0., radius, radius)); + m_boxes.push_back(TBox(-dz, -radius, dz, radius)); // Choose color according to which element it is int color = 0; diff --git a/papas/graphtools/src/EventRuler.cpp b/papas/graphtools/src/EventRuler.cpp index e45da40..9d65c89 100644 --- a/papas/graphtools/src/EventRuler.cpp +++ b/papas/graphtools/src/EventRuler.cpp @@ -11,18 +11,18 @@ Distance EventRuler::distance(Identifier id1, Identifier id2) const { // figure out the object types and then call ClusterCluster or ClusterTrack distance measures if (IdCoder::isCluster(id1) && IdCoder::isCluster(id2)) if (IdCoder::type(id1) == IdCoder::type(id2)) - return std::move(clusterClusterDistance(id1, id2)); + return clusterClusterDistance(id1, id2); else // hcal ecal not linked return Distance(); else if (IdCoder::isTrack(id2) && IdCoder::isCluster(id1)) - return std::move(clusterTrackDistance(id1, id2)); + return clusterTrackDistance(id1, id2); else if (IdCoder::isTrack(id1) && IdCoder::isCluster(id2)) - return std::move(clusterTrackDistance(id2, id1)); + return clusterTrackDistance(id2, id1); else if (IdCoder::isTrack(id1) && IdCoder::isTrack(id2)) - return std::move(Distance()); + return Distance(); std::cout << IdCoder::type(id1) << ":" << IdCoder::type(id2) << std::endl; throw "Distance between ids could not be computed"; - return std::move(Distance()); + return Distance(); } Distance EventRuler::clusterClusterDistance(Identifier id1, Identifier id2) const { diff --git a/papaslib/CMakeLists.txt b/papaslib/CMakeLists.txt index d9b3ffa..b8b2863 100644 --- a/papaslib/CMakeLists.txt +++ b/papaslib/CMakeLists.txt @@ -1,24 +1,11 @@ cmake_minimum_required(VERSION 2.8) # use, i.e. don't skip the full RPATH for the build tree -SET(CMAKE_SKIP_BUILD_RPATH FALSE) +SET(CMAKE_SKIP_BUILD_RPATH TRUE) -# when building, don't use the install RPATH already -# (but later on when installing) +# when building, don't use the install RPATH SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) -SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") - -# add the automatically determined parts of the RPATH -# which point to directories outside the build tree to the install RPATH -SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - -# the RPATH to be used when installing, but only if it's not a system directory -LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) -IF("${isSystemDir}" STREQUAL "-1") - SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") -ENDIF("${isSystemDir}" STREQUAL "-1") - include_directories( ${CMAKE_SOURCE_DIR} ) diff --git a/tests/unittest.cpp b/tests/unittest.cpp index 98afdcb..217edbd 100644 --- a/tests/unittest.cpp +++ b/tests/unittest.cpp @@ -445,7 +445,7 @@ TEST_CASE("BlockSplitter") { // create history nodes Nodes historyNodes; for (auto id : ids) - historyNodes.emplace(id, std::move(PFNode(id))); + historyNodes.emplace(id, PFNode(id)); Nodes emptyNodes; Blocks blocks; From c5e1a8cc1ea192f74264f37fa7edae9255d18cf7 Mon Sep 17 00:00:00 2001 From: Alice Date: Tue, 20 Jun 2017 10:49:15 +0200 Subject: [PATCH 2/3] tidying --- examples/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d1ec56f..f5d65e7 100755 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -5,8 +5,6 @@ ${MAINDIR} ${MAINDIR}/spdlog ${CMAKE_CURRENT_SOURCE_DIR} ) -message(STATUS "Found podio: ${ROOT_LIBRARIES}") - add_executable(example_simple example_simple.cpp PythiaConnector.cpp ) target_compile_definitions(example_simple PRIVATE WITHSORT=1) @@ -26,7 +24,6 @@ target_link_libraries(example_pdebug papas ${ROOT_LIBRARIES} datamodel datamodel add_executable(example_plot example_plot.cpp PythiaConnector.cpp ) target_link_libraries(example_plot papas ${ROOT_LIBRARIES} datamodel datamodelDict podio utilities) - #todo fix this #add_executable(example_gun example_gun.cpp ) #target_link_libraries(example_gun papas ${ROOT_LIBRARIES} datamodel datamodelDict utilities) From 0e030face2105a04567430d3a16429b699611a91 Mon Sep 17 00:00:00 2001 From: Alice Date: Tue, 20 Jun 2017 14:59:20 +0200 Subject: [PATCH 3/3] pass parameters of TEllipse,TBox directly --- papas/display/src/GDetectorElement.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/papas/display/src/GDetectorElement.cpp b/papas/display/src/GDetectorElement.cpp index a878381..6742b4c 100644 --- a/papas/display/src/GDetectorElement.cpp +++ b/papas/display/src/GDetectorElement.cpp @@ -33,8 +33,8 @@ GDetectorElement::GDetectorElement(std::shared_ptr detEle double radius = elem.radius(); double dz = elem.z(); - m_circles.push_back(TEllipse(0., 0., radius, radius)); - m_boxes.push_back(TBox(-dz, -radius, dz, radius)); + m_circles.push_back({0., 0., radius, radius}); + m_boxes.push_back({-dz, -radius, dz, radius}); } // Choose color according to which element it is @@ -59,8 +59,8 @@ GDetectorElement::GDetectorElement(std::shared_ptr detEle GDetectorElement::GDetectorElement(double radius, double dz) { - m_circles.push_back(TEllipse(0., 0., radius, radius)); - m_boxes.push_back(TBox(-dz, -radius, dz, radius)); + m_circles.push_back({0., 0., radius, radius}); + m_boxes.push_back({-dz, -radius, dz, radius}); // Choose color according to which element it is int color = 0;