Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusFrankATcernch authored Apr 9, 2020
2 parents 97e5849 + ecd0589 commit 838e7bd
Show file tree
Hide file tree
Showing 28 changed files with 248 additions and 104 deletions.
11 changes: 2 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ option(DD4HEP_USE_HEPMC3 "Build hepmc3 extensions" OFF)
option(DD4HEP_LOAD_ASSIMP "Download and build ASSIMP from github" OFF)
option(BUILD_TESTING "Enable and build tests" ON)
option(BUILD_SHARED_LIBS "If OFF build STATIC Libraries" ON)
option(CMAKE_MACOSX_RPATH "Build with rpath on macos" ON)
option(DD4HEP_SET_RPATH "Link libraries with built-in RPATH (run-time search path)" ON)

SET(DD4HEP_BUILD_PACKAGES "DDRec DDDetectors DDCond DDAlign DDCAD DDDigi DDG4 DDEve UtilityApps"
CACHE STRING "List of DD4hep packages to build")
SEPARATE_ARGUMENTS(DD4HEP_BUILD_PACKAGES)
Expand Down Expand Up @@ -206,14 +207,6 @@ endif()


ENDIF(DD4HEP_USE_EXISTING_DD4HEP)
#######################
# Treatment for Apple #
#######################

if( APPLE )
set( USE_DYLD 1)
set(CMAKE_MACOSX_RPATH 1)
endif()

#########################
# Configure and install #
Expand Down
11 changes: 11 additions & 0 deletions DDG4/include/DDG4/Geant4GeneratorWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
// Author : M.Frank
//
//==========================================================================

/** \addtogroup Geant4GeneratorAction
*
@{
\package Geant4GeneratorWrapper
* \brief Wrap native G4 particle ganerators like the generic particle source etc.
*
*
@}
*/

#ifndef DD4HEP_DDG4_GEANT4GENERATORWRAPPER_H
#define DD4HEP_DDG4_GEANT4GENERATORWRAPPER_H

Expand Down
10 changes: 10 additions & 0 deletions DDG4/include/DDG4/Geant4InputAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
//
//==========================================================================

/** \addtogroup Geant4GeneratorAction
*
@{
\package Geant4InputAction
* \brief Basic geant4 event reader class. This interface/base-class must be implemented by concrete readers.
*
*
@}
*/

#ifndef DD4HEP_DDG4_GEANT4INPUTACTION_H
#define DD4HEP_DDG4_GEANT4INPUTACTION_H

Expand Down
9 changes: 9 additions & 0 deletions DDG4/include/DDG4/Geant4InteractionMerger.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
// Author : M.Frank
//
//==========================================================================

/** \addtogroup Geant4GeneratorAction
*
@{
\package Geant4InteractionMerger
* \brief Geant4Action to merge several independent interaction to one
@}
*/

#ifndef DD4HEP_DDG4_GEANT4INTERACTIONMERGER_H
#define DD4HEP_DDG4_GEANT4INTERACTIONMERGER_H

Expand Down
11 changes: 10 additions & 1 deletion DDG4/include/DDG4/Geant4InteractionVertexBoost.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
// Author : M.Frank
//
//==========================================================================
/** \addtogroup Geant4GeneratorAction
*
@{
\package Geant4InteractionVertexBoost
* \brief Action class to boost the primary vertex (and all outgoing particles) of a single interaction
*
*
@}
*/

#ifndef DD4HEP_DDG4_GEANT4INTERACTIONVERTEXBOOST_H
#define DD4HEP_DDG4_GEANT4INTERACTIONVERTEXBOOST_H
Expand All @@ -25,7 +34,7 @@ namespace dd4hep {

/// Action class to boost the primary vertex (and all outgoing particles) of a single interaction
/**
* The vertex smearing is steered by the Lorentz transformation angle.
* The vertex boost is steered by the Lorentz transformation angle.
* The interaction to be modified is identified by the interaction's unique mask.
*
* \author M.Frank
Expand Down
11 changes: 11 additions & 0 deletions DDG4/include/DDG4/Geant4InteractionVertexSmear.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
// Author : M.Frank
//
//==========================================================================

/** \addtogroup Geant4GeneratorAction
*
@{
\package Geant4InteractionVertexSmear
* \brief Action class to smear the primary vertex (and all outgoing particles) of a single interaction
*
*
@}
*/

#ifndef DD4HEP_DDG4_GEANT4INTERACTIONVERTEXSMEAR_H
#define DD4HEP_DDG4_GEANT4INTERACTIONVERTEXSMEAR_H

Expand Down
9 changes: 9 additions & 0 deletions DDG4/include/DDG4/Geant4ParticleGun.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
// Author : M.Frank
//
//==========================================================================
/** \addtogroup Geant4GeneratorAction
*
@{
\package Geant4ParticleGun
* \brief Implementation of a particle gun using Geant4Particles.
*
*
@}
*/

#ifndef DD4HEP_DDG4_GEANT4PARTICLEGUN_H
#define DD4HEP_DDG4_GEANT4PARTICLEGUN_H
Expand Down
10 changes: 10 additions & 0 deletions DDG4/include/DDG4/Geant4ParticleHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
//
//==========================================================================

/** \addtogroup Geant4Action
*
@{
\package Geant4ParticleHandler
* \brief Geant4Action to collect the MC particle information.
*
*
@}
*/

#ifndef DD4HEP_DDG4_GEANT4PARTICLEHANDLER_H
#define DD4HEP_DDG4_GEANT4PARTICLEHANDLER_H

Expand Down
11 changes: 11 additions & 0 deletions DDG4/include/DDG4/Geant4PrimaryHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
// Author : M.Frank
//
//==========================================================================

/** \addtogroup Geant4GeneratorAction
*
@{
\package Geant4PrimaryHandler
* \brief Geant4Action to convert the particle information to Geant4
*
*
@}
*/

#ifndef DD4HEP_DDG4_GEANT4PRIMARYHANDLER_H
#define DD4HEP_DDG4_GEANT4PRIMARYHANDLER_H

Expand Down
12 changes: 12 additions & 0 deletions DDG4/include/DDG4/Geant4UserParticleHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
// Author : M.Frank
//
//==========================================================================

/** \addtogroup Geant4Action
*
@{
\package Geant4UserParticleHandler
* \brief Geant4ParticleHandler user extension action called by the particle handler.
*
*
@}
*/


#ifndef DD4HEP_DDG4_GEANT4USERPARTICLEHANDLER_H
#define DD4HEP_DDG4_GEANT4USERPARTICLEHANDLER_H

Expand Down
1 change: 0 additions & 1 deletion DDG4/lcio/LCIOFileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
\package LCIOFileReader
* \brief Plugin to read lcio files
*
And here we can put a longer description, parameters, examples...
*
@}
*/
Expand Down
11 changes: 11 additions & 0 deletions DDG4/lcio/LCIOStdHepReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
// Author : M.Frank
//
//==========================================================================

/** \addtogroup Geant4EventReader
*
@{
\package LCIOStdHepReader
* \brief Base class to read StdHep files
*
*
@}
*/

#ifndef DD4HEP_DDG4_LCIOSTDHEPREADER_H
#define DD4HEP_DDG4_LCIOSTDHEPREADER_H

Expand Down
11 changes: 11 additions & 0 deletions DDG4/plugins/Geant4EventReaderGuineaPig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
//
//==========================================================================

/** \addtogroup Geant4EventReader
*
@{
\package Geant4EventReaderGuineaPig
* \brief Reader for ascii files with e+e- pairs created from GuineaPig.
*
*
@}
*/


// Framework include files
#include "DDG4/Geant4InputAction.h"

Expand Down
11 changes: 11 additions & 0 deletions DDG4/plugins/Geant4EventReaderHepEvt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
//
//==========================================================================

/** \addtogroup Geant4EventReader
*
@{
\package Geant4EventReaderHepEvt
* \brief Plugin to read HepEvt ASCII files
*
*
@}
*/


// Framework include files
#include "DDG4/Geant4InputAction.h"

Expand Down
13 changes: 12 additions & 1 deletion DDG4/plugins/Geant4EventReaderHepMC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
//
//==========================================================================

/** \addtogroup Geant4EventReader
*
@{
\package Geant4EventReaderHepMC
* \brief Plugin to read HepMC2 ASCII files
*
*
@}
*/


// Framework include files
#include "DDG4/IoStreams.h"
#include "DDG4/Geant4InputAction.h"
Expand All @@ -29,7 +40,7 @@ namespace dd4hep {
class EventStream;
}

/// Class to populate Geant4 primaries from StdHep files.
/// Class to populate Geant4 primaries from HepMC(2) files.
/**
* Class to populate Geant4 primary particles and vertices from a
* file in HepMC format (ASCII)
Expand Down
1 change: 0 additions & 1 deletion DDG4/plugins/Geant4SDActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ namespace dd4hep {
/**
* \author M.Frank
* \version 1.0
* \ingroup DD4HEP_SIMULATION
* \addtogroup Geant4SDActionPlugin
*
* @{
Expand Down
4 changes: 2 additions & 2 deletions DDG4/plugins/Geant4SensDetFilters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ ParticleRejectFilter::~ParticleRejectFilter() {

/// Filter action. Return true if hits should be processed
bool ParticleRejectFilter::operator()(const G4Step* step) const {
return isSameType(step->GetTrack());
return !isSameType(step->GetTrack());
}

/// Constructor.
Expand All @@ -221,7 +221,7 @@ ParticleSelectFilter::~ParticleSelectFilter() {

/// Filter action. Return true if hits should be processed
bool ParticleSelectFilter::operator()(const G4Step* step) const {
return !isSameType(step->GetTrack());
return isSameType(step->GetTrack());
}

/// Constructor.
Expand Down
11 changes: 11 additions & 0 deletions DDG4/plugins/Geant4TCUserParticleHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
// Author : M.Frank
//
//==========================================================================

/** \addtogroup Geant4Action
*
@{
\package Geant4TCUserParticleHandler
* \brief Rejects to keep particles, which are created outside a tracking cylinder.
*
*
@}
*/

#ifndef DD4HEP_DDG4_GEANT4TCUSERPARTICLEHANDLER_H
#define DD4HEP_DDG4_GEANT4TCUSERPARTICLEHANDLER_H

Expand Down
2 changes: 1 addition & 1 deletion DDG4/src/Geant4ParticleHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void Geant4ParticleHandler::end(const G4Track* track) {
m_userHandler->end(track, m_currTrack);
}

// These are candate tracks with a probability to be stored due to their properties:
// These are candidate tracks with a probability to be stored due to their properties:
// - primary particle
// - hits created
// - secondaries
Expand Down
40 changes: 11 additions & 29 deletions cmake/DD4hep.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@ endif()

function( add_dd4hep_plugin libraryName )
ADD_LIBRARY ( ${libraryName} ${ARGN} )

if(APPLE)
dd4hep_generate_rootmap_apple( ${libraryName} )
else()
dd4hep_generate_rootmap( ${libraryName} )
endif()

dd4hep_generate_rootmap( ${libraryName} )
install( TARGETS ${libraryName} LIBRARY DESTINATION lib )
endfunction()

Expand Down Expand Up @@ -75,28 +69,23 @@ endfunction()
# Create the .components file needed by the plug-in system.
#---------------------------------------------------------------------------------------------------
function(dd4hep_generate_rootmap library)

if(APPLE)
dd4hep_generate_rootmap_apple( ${library} )
set(ENV_VAR DYLD_LIBRARY_PATH)
set(${ENV_VAR}_VALUE $<TARGET_FILE_DIR:${library}>:$<TARGET_FILE_DIR:DD4hep::DD4hepGaudiPluginMgr>)
else()
dd4hep_generate_rootmap_notapple( ${library} )
endif()
endfunction()
#---------------------------------------------------------------------------------------------------
function(dd4hep_generate_rootmap_notapple library)
if ( NOT DD4hep_DIR )
SET ( DD4hep_DIR ${CMAKE_SOURCE_DIR} )
set(ENV_VAR LD_LIBRARY_PATH)
set(${ENV_VAR}_VALUE $<TARGET_FILE_DIR:${library}>:$<TARGET_FILE_DIR:DD4hep::DD4hepGaudiPluginMgr>:$ENV{${ENV_VAR}})
endif()

set(rootmapfile ${CMAKE_SHARED_MODULE_PREFIX}${library}.components)

add_custom_command(OUTPUT ${rootmapfile}
DEPENDS ${library}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -Dlibname=$<TARGET_FILE_NAME:${library}> -Drootmapfile=${rootmapfile}
-DDD4HEP_LISTCOMPONENTS_CMD=$<TARGET_FILE:DD4hep::listcomponents>
-DLIBRARY_LOCATION=$<TARGET_FILE_DIR:${library}>
-DDD4HEP_LIBRARY_LOCATION=$<TARGET_FILE_DIR:DD4hep::DDCore>
-DDD4hep_DIR=${DD4hep_DIR}
-P ${DD4hep_DIR}/cmake/MakeGaudiMap.cmake)
COMMAND ${ENV_VAR}=${${ENV_VAR}_VALUE} $<TARGET_FILE:DD4hep::listcomponents> -o ${rootmapfile} $<TARGET_FILE_NAME:${library}>
WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH}
)

add_custom_target(Components_${library} ALL DEPENDS ${rootmapfile})
SET( install_destination "lib" )
if( CMAKE_INSTALL_LIBDIR )
Expand All @@ -106,10 +95,3 @@ function(dd4hep_generate_rootmap_notapple library)
DESTINATION ${install_destination}
)
endfunction()
#
#
#---------------------------------------------------------------------------------------------------
function(dd4hep_generate_rootmap_apple library)
# for now do the same for apple that is done for the rest
dd4hep_generate_rootmap_notapple( ${library} )
endfunction()
Loading

0 comments on commit 838e7bd

Please sign in to comment.