Skip to content

Commit

Permalink
Merge pull request #1 from tanguypasquier/master
Browse files Browse the repository at this point in the history
Inclusion of SDHCALContent and APRILContent
  • Loading branch information
tanguypasquier authored Mar 4, 2024
2 parents 8130146 + cce3c23 commit 7b934b3
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
lib/
31 changes: 30 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,44 @@ 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 )
IF( SDHCALContent_FOUND )
INCLUDE_DIRECTORIES( SYSTEM ${SDHCALContent_INCLUDE_DIRS} )
LINK_LIBRARIES( ${SDHCALContent_LIBRARIES} )
ADD_DEFINITIONS ( ${SDHCALContent_DEFINITIONS} )
ADD_DEFINITIONS( "-DSDHCALCONTENT" )
ENDIF()
ENDIF()

IF( USE_APRILCONTENT )
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
FIND_PACKAGE( APRILContent REQUIRED )
FIND_PACKAGE( mlpack REQUIRED )
IF( APRILContent_FOUND )
INCLUDE_DIRECTORIES( SYSTEM ${APRILContent_INCLUDE_DIRS} )
LINK_LIBRARIES( ${APRILContent_LIBRARIES} )
ADD_DEFINITIONS ( ${APRILContent_DEFINITIONS} )
ADD_DEFINITIONS( "-DAPRILCONTENT" )
ENDIF()
IF( mlpack_FOUND )
INCLUDE_DIRECTORIES( SYSTEM ${mlpack_INCLUDE_DIRS} )
LINK_LIBRARIES( ${mlpack_LIBRARIES} )
ADD_DEFINITIONS ( ${mlpack_DEFINITIONS} )
ENDIF()
ENDIF()

IF( PANDORA_MONITORING )
FIND_PACKAGE( PandoraMonitoring 03.00.00 REQUIRED )
IF( PandoraMonitoring_FOUND )
Expand Down
18 changes: 18 additions & 0 deletions cmake/Findmlpack.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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}/*)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(mlpack DEFAULT_MSG mlpack_CORE_HPP_DIR)

IF(NOT mlpack_FOUND)
MESSAGE(FATAL_ERROR "The mlpack package not found.")
ENDIF()
14 changes: 12 additions & 2 deletions src/DDPandoraPFANewProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@
#include "marlin/Global.h"
#include "marlin/Exceptions.h"


#include "Api/PandoraApi.h"

#include "LCContent.h"
#include "LCPlugins/LCSoftwareCompensation.h"

#ifdef SDHCALCONTENT
#include "SDHCALContent.h"
#endif

#ifdef APRILCONTENT
#include "APRILContent.h"
#endif

#include "DDExternalClusteringAlgorithm.h"
#include "DDPandoraPFANewProcessor.h"

Expand All @@ -29,7 +36,6 @@

#include "DDBFieldPlugin.h"


#include <cstdlib>

DDPandoraPFANewProcessor aDDPandoraPFANewProcessor;
Expand Down Expand Up @@ -296,6 +302,10 @@ pandora::StatusCode DDPandoraPFANewProcessor::RegisterUserComponents() const
PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, LCContent::RegisterAlgorithms(*m_pPandora));
PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, LCContent::RegisterBasicPlugins(*m_pPandora));

#ifdef SDHCALCONTENT
PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, SDHCALContent::RegisterEnergyCorrections(*m_pPandora));
#endif

if(m_settings.m_useDD4hepField)
{
dd4hep::Detector& mainDetector = dd4hep::Detector::getInstance();
Expand Down

1 comment on commit 7b934b3

@tanguypasquier
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the compilation options to choose to include SDHCALContent or APRILContent in DDMarlinPandora.

To compile with SDHCALContent :

mkdir build

cd build

cmake -C ${ILCSOFT}/ILCSoft.cmake -DPANDORA_MONITORING=ON -DUSE_SDHCALCONTENT=ON -DSDHCALContent_DIR=path/to/SDHCALContent ..

To compile with APRILContent :

mkdir build

cd build

cmake -C ${ILCSOFT}/ILCSoft.cmake -DPANDORA_MONITORING=ON -DUSE_APRILCONTENT=ON -DAPRILContent_DIR=path/toAPRILContent -Dmlpack_DIR=path/to/MLPACK/INSTALL ..

Please sign in to comment.