Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

Commit

Permalink
Merge pull request #34 from alicerobson/lxplus
Browse files Browse the repository at this point in the history
Thanks for the additional info, Alice
  • Loading branch information
cbernet authored Jun 20, 2017
2 parents e6324c7 + 0e030fa commit 59ddc9a
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 31 deletions.
3 changes: 1 addition & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ${MAINDIR}/spdlog
${CMAKE_CURRENT_SOURCE_DIR}
)


add_executable(example_simple example_simple.cpp PythiaConnector.cpp )
target_compile_definitions(example_simple PRIVATE WITHSORT=1)
target_link_libraries(example_simple papas ${ROOT_LIBRARIES} datamodel datamodelDict podio utilities)
Expand Down Expand Up @@ -46,4 +45,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)
#set_property(TEST example_loop PROPERTY DEPENDS fcc-generate)
5 changes: 3 additions & 2 deletions examples/PythiaConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion examples/example_simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion papas/datatypes/src/Cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
8 changes: 4 additions & 4 deletions papas/display/src/GDetectorElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ GDetectorElement::GDetectorElement(std::shared_ptr<const DetectorElement> 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({0., 0., radius, radius});
m_boxes.push_back({-dz, -radius, dz, radius});
}

// Choose color according to which element it is
Expand All @@ -59,8 +59,8 @@ GDetectorElement::GDetectorElement(std::shared_ptr<const DetectorElement> 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({0., 0., radius, radius});
m_boxes.push_back({-dz, -radius, dz, radius});

// Choose color according to which element it is
int color = 0;
Expand Down
10 changes: 5 additions & 5 deletions papas/graphtools/src/EventRuler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
17 changes: 2 additions & 15 deletions papaslib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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}
)
Expand Down
2 changes: 1 addition & 1 deletion tests/unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 59ddc9a

Please sign in to comment.