-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APRIL and SDHCALContent integration #29
base: master
Are you sure you want to change the base?
Changes from all commits
a907286
47cb514
ebd193d
08d484e
0a2868f
c070114
d6fc74c
df38b05
751ee26
ea7a897
55dd1a8
cdcf8f3
4557661
76d15af
fc937a7
bdc6e79
d1531bc
4e33c8c
d49c7a0
d8f1d2c
d793e70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build/ | ||
lib/ |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -41,15 +41,38 @@ FIND_PACKAGE( DD4hep REQUIRED ) | |||
FIND_PACKAGE( ROOT REQUIRED ) | ||||
FIND_PACKAGE( MarlinTrk REQUIRED ) | ||||
|
||||
OPTION( USE_SDHCALCONTENT "Use SDHCALContent" OFF ) | ||||
OPTION( USE_APRILCONTENT "Use APRILContent" OFF ) | ||||
|
||||
FOREACH( pkg PandoraSDK Marlin MarlinUtil LCContent DD4hep ROOT MarlinTrk ) | ||||
FOREACH( pkg PandoraSDK Marlin MarlinUtil LCContent DD4hep ROOT MarlinTrk ) | ||||
IF( ${pkg}_FOUND ) | ||||
INCLUDE_DIRECTORIES( SYSTEM ${${pkg}_INCLUDE_DIRS} ) | ||||
LINK_LIBRARIES( ${${pkg}_LIBRARIES} ) | ||||
ADD_DEFINITIONS ( ${${pkg}_DEFINITIONS} ) | ||||
ENDIF() | ||||
ENDFOREACH() | ||||
|
||||
IF( USE_SDHCALCONTENT ) | ||||
FIND_PACKAGE( SDHCALContent REQUIRED ) | ||||
INCLUDE_DIRECTORIES( SYSTEM ${SDHCALContent_INCLUDE_DIRS} ) | ||||
LINK_LIBRARIES( ${SDHCALContent_LIBRARIES} ) | ||||
ADD_DEFINITIONS ( ${SDHCALContent_DEFINITIONS} ) | ||||
ADD_DEFINITIONS( "-DSDHCALCONTENT" ) | ||||
ENDIF() | ||||
|
||||
IF( USE_APRILCONTENT ) | ||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) | ||||
FIND_PACKAGE( APRILContent REQUIRED ) | ||||
FIND_PACKAGE( mlpack REQUIRED ) | ||||
INCLUDE_DIRECTORIES( SYSTEM ${APRILContent_INCLUDE_DIRS} ) | ||||
LINK_LIBRARIES( ${APRILContent_LIBRARIES} ) | ||||
ADD_DEFINITIONS ( ${APRILContent_DEFINITIONS} ) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
ADD_DEFINITIONS( "-DAPRILCONTENT" ) | ||||
INCLUDE_DIRECTORIES( SYSTEM ${mlpack_INCLUDE_DIRS} ) | ||||
LINK_LIBRARIES( ${mlpack_LIBRARIES} ) | ||||
ADD_DEFINITIONS ( ${mlpack_DEFINITIONS} ) | ||||
ENDIF() | ||||
|
||||
IF( PANDORA_MONITORING ) | ||||
FIND_PACKAGE( PandoraMonitoring 03.00.00 REQUIRED ) | ||||
IF( PandoraMonitoring_FOUND ) | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mlpack should come with a cmake config file, so this findmlpack should not be needed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tanguypasquier did you check, whether you can simply remove this file and things keep working? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I indeed tried to simply remove the file but it generates some errors during the compilation. I get : `By not providing "Findmlpack.cmake" in CMAKE_MODULE_PATH this project has Could not find a package configuration file provided by "mlpack" with any mlpackConfig.cmake Add the installation prefix of "mlpack" to CMAKE_PREFIX_PATH or set I checked in the mlpack files for the ones mentioned in the CMake error but couldn't find any of them. I had already encountered this error during the APRIL installation and I then came across this issue (mlpack/mlpack#444) which seemed to indicate that the best option was to have the Findmlpack.cmake file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where are you getting your |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
IF(NOT DEFINED mlpack_DIR) | ||
MESSAGE(STATUS "Warning: it is mandorary to define mlpack_DIR.") | ||
ENDIF() | ||
|
||
IF (NOT DEFINED mlpack_INCLUDE_DIRS) | ||
SET(mlpack_INCLUDE_DIRS ${mlpack_DIR}/include) | ||
ENDIF() | ||
|
||
# Check mlpack core header file | ||
FIND_PATH(mlpack_CORE_HPP_DIR NAMES core.hpp HINTS ${mlpack_INCLUDE_DIRS}/mlpack) | ||
|
||
# Check mlpack library | ||
#FIND_LIBRARY(mlpack_LIBRARIES NAMES mlpack HINTS ${mlpack_DIR}/*) | ||
tmadlener marked this conversation as resolved.
Show resolved
Hide resolved
|
||
include(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(mlpack DEFAULT_MSG mlpack_CORE_HPP_DIR) |
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -20,10 +20,18 @@ | |||||||||||
#include <DD4hep/Detector.h> | ||||||||||||
#include <DD4hep/DetElement.h> | ||||||||||||
|
||||||||||||
#include <Pandora/PandoraObjectFactories.h> | ||||||||||||
|
||||||||||||
#include <memory> | ||||||||||||
|
||||||||||||
|
||||||||||||
typedef std::vector<EVENT::CalorimeterHit *> CalorimeterHitVector; | ||||||||||||
|
||||||||||||
#ifdef APRILCONTENT | ||||||||||||
namespace april_content { class CaloHitFactory; } | ||||||||||||
#endif | ||||||||||||
|
||||||||||||
|
||||||||||||
/** | ||||||||||||
* @brief DDCaloHitCreator class | ||||||||||||
*/ | ||||||||||||
|
@@ -111,6 +119,8 @@ class DDCaloHitCreator | |||||||||||
float m_hCalBarrelOuterPhi0; ///< HCal barrel outer phi0 coordinate | ||||||||||||
unsigned int m_hCalBarrelOuterSymmetry; ///< HCal barrel outer symmetry order | ||||||||||||
|
||||||||||||
bool m_useAPRIL = false; ///< Choose if we want to use APRIL instead of Pandora for the reconstruction | ||||||||||||
|
||||||||||||
public: | ||||||||||||
FloatVector m_eCalBarrelNormalVector; | ||||||||||||
FloatVector m_hCalBarrelNormalVector; | ||||||||||||
|
@@ -241,6 +251,12 @@ class DDCaloHitCreator | |||||||||||
*/ | ||||||||||||
float GetMaximumRadius(const EVENT::CalorimeterHit *const pCaloHit, const unsigned int symmetryOrder, const float phi0) const; | ||||||||||||
|
||||||||||||
/** | ||||||||||||
* @brief Initialize the factory for calo hit creation | ||||||||||||
* | ||||||||||||
*/ | ||||||||||||
void ChooseFactory(); | ||||||||||||
|
||||||||||||
const Settings m_settings; ///< The calo hit creator settings | ||||||||||||
|
||||||||||||
const pandora::Pandora & m_pandora; ///< Reference to the pandora object to create calo hits | ||||||||||||
|
@@ -252,6 +268,12 @@ class DDCaloHitCreator | |||||||||||
|
||||||||||||
dd4hep::VolumeManager m_volumeManager; ///< DD4hep volume manager | ||||||||||||
|
||||||||||||
//Added by T.Pasquier | ||||||||||||
std::unique_ptr<pandora::ObjectFactory<object_creation::CaloHit::Parameters, object_creation::CaloHit::Object>> m_caloHitFactory{nullptr}; //General factory to initialize | ||||||||||||
|
||||||||||||
/* DDCaloHitCreator& operator=(const DDCaloHitCreator&) = delete; // Disallow copying | ||||||||||||
DDCaloHitCreator(const DDCaloHitCreator&) = delete; */ | ||||||||||||
Comment on lines
+274
to
+275
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Since you know have a |
||||||||||||
|
||||||||||||
}; | ||||||||||||
|
||||||||||||
//------------------------------------------------------------------------------------------------------------------------------------------ | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDHCALContent
doesn't seem to export any definitions(?): https://github.com/tanguypasquier/SDHCALContent/blob/main/cmake/SDHCALContentConfig.cmake.in