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 #38 from alicerobson/hcal
Browse files Browse the repository at this point in the history
Thanks Alice!
  • Loading branch information
cbernet authored Oct 30, 2017
2 parents fee61f5 + a457093 commit 0584658
Show file tree
Hide file tree
Showing 9 changed files with 5,563 additions and 6,421 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS} $ENV{PODIO} $ENV{FCCEDM})
#--- Declare ROOT dependency ---------------------------------------------------
if(APPLE)
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.10)
#set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12)
find_package(ROOT REQUIRED COMPONENTS RIO Tree)
include_directories(${ROOT_INCLUDE_DIRS})
add_definitions(${ROOT_CXX_FLAGS})
Expand Down
6 changes: 1 addition & 5 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ ${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)

add_executable(example_loop example_loop.cpp PythiaConnector.cpp)
target_compile_definitions(example_loop PRIVATE WITHSORT=1)
target_link_libraries(example_loop papas ${ROOT_LIBRARIES} datamodel datamodelDict podio utilities)

add_executable(example_pair example_dag_pair.cpp)
target_link_libraries(example_pair papas ${ROOT_LIBRARIES} )

add_executable(example_pdebug example_pdebug_python_comparer.cpp PythiaConnector.cpp )
target_compile_definitions(example_pdebug PRIVATE WITHSORT=1)
target_link_libraries(example_pdebug papas ${ROOT_LIBRARIES} datamodel datamodelDict podio utilities)

add_executable(example_plot example_plot.cpp PythiaConnector.cpp )
Expand All @@ -44,8 +41,7 @@ FILE(GLOB files "${CMAKE_SOURCE_DIR}/examples/data/*")
INSTALL(FILES ${files} DESTINATION data/)

# --- adding tests for examples ------------------------------
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} )
add_test(NAME example_loop COMMAND $ENV{FCCPAPASCPP}/bin/example_loop $ENV{FCCPAPASCPP}/data/ee_ZH_Zmumu_Hbb.root WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} )
set_property(TEST example_loop PROPERTY DEPENDS fcc-generate)
add_test(NAME test_debug_cms COMMAND /bin/bash $ENV{FCCPAPASCPP}/data/pdebug_CMS.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} )
set_tests_properties(test_debug_cms PROPERTIES PASS_REGULAR_EXPRESSION "compare.out matches")
Expand Down
11,927 changes: 5,548 additions & 6,379 deletions examples/data/required_cms_physics.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/example_loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main(int argc, char* argv[]) {
// open the Pythia file fname
try {
PythiaConnector pythiaConnector(fname);
#if WITHSORT
#if PAPASWITHSORT
std::cout << "doing sorting";
#else
std::cout << "no sort";
Expand Down
6 changes: 4 additions & 2 deletions papas/datatypes/DefinitionsCollections.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#ifndef DefinitionsCollections_h
#define DefinitionsCollections_h

#include "papas/utility/PapasPreProcessor.h"
#include "papas/datatypes/IdCoder.h"


#include <list>
#include <unordered_map>
#if WITHSORT
#if WITHSORT or PAPASWITHSORT
#include <set>
#else
#include <unordered_set>
Expand All @@ -20,7 +22,7 @@ class Particle;

typedef std::list<Particle> ListParticles; ///< list of Particles
typedef std::unordered_map<uint64_t, Edge> Edges; ///< collection of Edge objects
#if WITHSORT
#if PAPASWITHSORT
typedef std::set<Identifier, std::greater<Identifier>> Ids; ///< set containing Identifiers
#else
typedef std::unordered_set<Identifier> Ids; ///< set containing Identifiers
Expand Down
2 changes: 1 addition & 1 deletion papas/detectors/cms/src/CMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ CMS CreateDefaultCMS() {
eresECAL,
erespECAL);

std::vector<std::vector<double>> eresHCAL = {{0.8062, 2.753, 0.1501}, {6.803e-06, 6.676, 0.1716}};
std::vector<std::vector<double>> eresHCAL = {{1.1, 0., 0.09}, {1.1, 0., 0.09}};
std::vector<std::vector<double>> erespHCAL = {{1.036, 4.452, -2.458}, {1.071, 9.471, -2.823}};
std::vector<double> acceptanceParameters = {1., // energy
1., -1.9381, -1.75330, 3., 1.1, 10., 1.05634,
Expand Down
7 changes: 7 additions & 0 deletions papas/utility/PapasPreProcessor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef PapasPreprocessor_h
#define PapasPreprocessor_h

#define PAPASWITHSORT 1


#endif // PapasPreprocessor_h
31 changes: 0 additions & 31 deletions papaslib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,38 +78,7 @@ include_directories(
${CMAKE_SOURCE_DIR}
)

# remove ### to get back root dicts
###REFLEX_GENERATE_DICTIONARY(papas ${headers} SELECTION selection.xml)

#message(STATUS, "bin" ${PROJECT_BINARY_DIR})

###add_library(papasDict SHARED ${sources} ${headers} papas.cxx)
###add_dependencies(papasDict papas-dictgen )
###target_link_libraries( papasDict papas ${ROOT_LIBRARIES} )
add_library(papas SHARED ${sources} )
target_link_libraries( papas ${ROOT_LIBRARIES} )
target_compile_definitions(papas PRIVATE WITHSORT=1)
install(TARGETS papas DESTINATION lib)
###install(TARGETS papasDict DESTINATION lib)

# Install the dictionary
###install(FILES ${CMAKE_CURRENT_BINARY_DIR}/papasDict.rootmap DESTINATION lib)
###install(FILES ${CMAKE_CURRENT_BINARY_DIR}/papas_rdict.pcm DESTINATION lib)

#install(DIRECTORY sources DESTINATION include)

### Install the dictionary
#if (${ROOT_VERSION} GREATER 6)
#install(FILES
#"${PROJECT_BINARY_DIR}/papas_rdict.pcm"
#DESTINATION lib COMPONENT dev)
#endif()









1 change: 0 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ${CMAKE_CURRENT_SOURCE_DIR}
message(${MAINDIR} ${INCLUDE_DIRECTORIES})

add_executable(utests unittest.cpp )
target_compile_definitions(utests PRIVATE WITHSORT=1)
target_link_libraries(utests papas ${ROOT_LIBRARIES} datamodel datamodelDict podio utilities)


Expand Down

0 comments on commit 0584658

Please sign in to comment.