Skip to content

Commit

Permalink
Merge branch 'key4hep:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mahmoudali2 authored Oct 3, 2024
2 parents 7bdd29f + 120ea0d commit d1e094d
Show file tree
Hide file tree
Showing 26 changed files with 565 additions and 265 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/test.yml

This file was deleted.

1 change: 0 additions & 1 deletion ARCdigi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ file(GLOB headers
gaudi_add_module(${PackageName}
SOURCES ${sources}
LINK
Gaudi::GaudiAlgLib
Gaudi::GaudiKernel
EDM4HEP::edm4hep
k4FWCore::k4FWCore
Expand Down
10 changes: 5 additions & 5 deletions ARCdigi/include/ARCdigitizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// GAUDI
#include "Gaudi/Property.h"
#include "GaudiAlg/GaudiAlgorithm.h"
#include "Gaudi/Algorithm.h"
#include "GaudiKernel/IRndmGenSvc.h"
#include "GaudiKernel/RndmGenerators.h"

Expand Down Expand Up @@ -33,7 +33,7 @@ namespace edm4hep {
*
*/

class ARCdigitizer : public GaudiAlgorithm {
class ARCdigitizer : public Gaudi::Algorithm {
public:
explicit ARCdigitizer(const std::string&, ISvcLocator*);
virtual ~ARCdigitizer();
Expand All @@ -44,17 +44,17 @@ class ARCdigitizer : public GaudiAlgorithm {
/** Execute.
* @return status code
*/
virtual StatusCode execute() final;
virtual StatusCode execute(const EventContext&) const final;
/** Finalize.
* @return status code
*/
virtual StatusCode finalize() final;

private:
// Input sim tracker hit collection name
DataHandle<edm4hep::SimTrackerHitCollection> m_input_sim_hits{"inputSimHits", Gaudi::DataHandle::Reader, this};
mutable DataHandle<edm4hep::SimTrackerHitCollection> m_input_sim_hits{"inputSimHits", Gaudi::DataHandle::Reader, this};
// Output digitized tracker hit collection name
DataHandle<edm4hep::TrackerHit3DCollection> m_output_digi_hits{"outputDigiHits", Gaudi::DataHandle::Writer, this};
mutable DataHandle<edm4hep::TrackerHit3DCollection> m_output_digi_hits{"outputDigiHits", Gaudi::DataHandle::Writer, this};
// Flat value for SiPM efficiency
FloatProperty m_flat_SiPM_effi{this, "flatSiPMEfficiency", -1.0, "Flat value for SiPM quantum efficiency (<0 := disabled)"};
// Apply the SiPM efficiency to digitized hits instead of simulated hits
Expand Down
4 changes: 2 additions & 2 deletions ARCdigi/src/ARCdigitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

DECLARE_COMPONENT(ARCdigitizer)

ARCdigitizer::ARCdigitizer(const std::string& aName, ISvcLocator* aSvcLoc) : GaudiAlgorithm(aName, aSvcLoc) {
ARCdigitizer::ARCdigitizer(const std::string& aName, ISvcLocator* aSvcLoc) : Gaudi::Algorithm(aName, aSvcLoc) {
declareProperty("inputSimHits", m_input_sim_hits, "Input sim tracker hit collection name");
declareProperty("outputDigiHits", m_output_digi_hits, "Output digitized tracker hit collection name");
}
Expand Down Expand Up @@ -43,7 +43,7 @@ StatusCode ARCdigitizer::initialize() {
return StatusCode::SUCCESS;
}

StatusCode ARCdigitizer::execute() {
StatusCode ARCdigitizer::execute(const EventContext&) const {
// Get the input collection with Geant4 hits
const edm4hep::SimTrackerHitCollection* input_sim_hits = m_input_sim_hits.get();
verbose() << "Input Sim Hit collection size: " << input_sim_hits->size() << endmsg;
Expand Down
5 changes: 0 additions & 5 deletions ARCdigi/test/runARCdigitizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,8 @@
arc_digitizer.AuditExecute = True
podiooutput.AuditExecute = True

from Configurables import EventCounter
event_counter = EventCounter('event_counter')
event_counter.Frequency = 1

ApplicationMgr(
TopAlg = [
event_counter,
podioinput,
arc_digitizer,
podiooutput
Expand Down
30 changes: 2 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(${PackageName})

# please keep this layout for version setting, used by the automatic tagging script
set(${PackageName}_VERSION_MAJOR 0)
set(${PackageName}_VERSION_MINOR 2)
set(${PackageName}_VERSION_MINOR 3)
set(${PackageName}_VERSION_PATCH 0)

set(${PackageName}_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
Expand All @@ -23,35 +23,9 @@ find_package(k4FWCore)
find_package(Gaudi)
#---------------------------------------------------------------

include(cmake/Key4hepConfig.cmake)
include(GNUInstallDirs)

# Set up C++ Standard
# ``-DCMAKE_CXX_STANDARD=<standard>`` when invoking CMake
set(CMAKE_CXX_STANDARD 17 CACHE STRING "")

if(NOT CMAKE_CXX_STANDARD MATCHES "14|17|20")
message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}")
endif()

# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)

# when building, don't use the install RPATH already
# (but later on when installing)
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(CTest)
function(set_test_env _testname)
set_property(TEST ${test_name} APPEND PROPERTY ENVIRONMENT "ROOT_INCLUDE_PATH=$<$<TARGET_EXISTS:podio::podio>:$<TARGET_FILE_DIR:podio::podio>/../include>:$<$<TARGET_EXISTS:EDM4HEP::edm4hep>:$<TARGET_FILE_DIR:EDM4HEP::edm4hep>/../include>:$ENV{ROOT_INCLUDE_PATH}")
Expand Down
2 changes: 1 addition & 1 deletion DCHdigi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ file(GLOB headers
gaudi_add_module(${PackageName}
SOURCES ${sources}
LINK
Gaudi::GaudiAlgLib
Gaudi::GaudiKernel
EDM4HEP::edm4hep
extensionDict
k4FWCore::k4FWCore
k4FWCore::k4Interface
DD4hep::DDRec
)

Expand Down
10 changes: 5 additions & 5 deletions DCHdigi/include/DCHsimpleDigitizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// GAUDI
#include "Gaudi/Property.h"
#include "GaudiAlg/GaudiAlgorithm.h"
#include "Gaudi/Algorithm.h"
#include "GaudiKernel/IRndmGenSvc.h"
#include "GaudiKernel/RndmGenerators.h"

Expand Down Expand Up @@ -36,7 +36,7 @@ namespace edm4hep {
*
*/

class DCHsimpleDigitizer : public GaudiAlgorithm {
class DCHsimpleDigitizer : public Gaudi::Algorithm {
public:
explicit DCHsimpleDigitizer(const std::string&, ISvcLocator*);
virtual ~DCHsimpleDigitizer();
Expand All @@ -47,17 +47,17 @@ class DCHsimpleDigitizer : public GaudiAlgorithm {
/** Execute.
* @return status code
*/
virtual StatusCode execute() final;
virtual StatusCode execute(const EventContext&) const final;
/** Finalize.
* @return status code
*/
virtual StatusCode finalize() final;

private:
// Input sim tracker hit collection name
DataHandle<edm4hep::SimTrackerHitCollection> m_input_sim_hits{"inputSimHits", Gaudi::DataHandle::Reader, this};
mutable DataHandle<edm4hep::SimTrackerHitCollection> m_input_sim_hits{"inputSimHits", Gaudi::DataHandle::Reader, this};
// Output digitized tracker hit collection name
DataHandle<edm4hep::TrackerHit3DCollection> m_output_digi_hits{"outputDigiHits", Gaudi::DataHandle::Writer, this};
mutable DataHandle<edm4hep::TrackerHit3DCollection> m_output_digi_hits{"outputDigiHits", Gaudi::DataHandle::Writer, this};

// Detector readout name
Gaudi::Property<std::string> m_readoutName{this, "readoutName", "CDCHHits", "Name of the detector readout"};
Expand Down
22 changes: 11 additions & 11 deletions DCHdigi/include/DCHsimpleDigitizerExtendedEdm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// GAUDI
#include "Gaudi/Property.h"
#include "GaudiAlg/GaudiAlgorithm.h"
#include "Gaudi/Algorithm.h"
#include "GaudiKernel/IRndmGenSvc.h"
#include "GaudiKernel/RndmGenerators.h"

Expand Down Expand Up @@ -33,7 +33,7 @@
*
*/

class DCHsimpleDigitizerExtendedEdm : public GaudiAlgorithm {
class DCHsimpleDigitizerExtendedEdm : public Gaudi::Algorithm {
public:
explicit DCHsimpleDigitizerExtendedEdm(const std::string&, ISvcLocator*);
virtual ~DCHsimpleDigitizerExtendedEdm();
Expand All @@ -44,21 +44,21 @@ class DCHsimpleDigitizerExtendedEdm : public GaudiAlgorithm {
/** Execute.
* @return status code
*/
virtual StatusCode execute() final;
virtual StatusCode execute(const EventContext&) const final;
/** Finalize.
* @return status code
*/
virtual StatusCode finalize() final;

private:
// Input sim tracker hit collection name
DataHandle<edm4hep::SimTrackerHitCollection> m_input_sim_hits{"inputSimHits", Gaudi::DataHandle::Reader, this};
mutable DataHandle<edm4hep::SimTrackerHitCollection> m_input_sim_hits{"inputSimHits", Gaudi::DataHandle::Reader, this};
// Output digitized tracker hit collection name
DataHandle<extension::DriftChamberDigiCollection> m_output_digi_hits{"outputDigiHits", Gaudi::DataHandle::Writer, this};
mutable DataHandle<extension::DriftChamberDigiCollection> m_output_digi_hits{"outputDigiHits", Gaudi::DataHandle::Writer, this};
// Output association between digitized and simulated hit collections
DataHandle<extension::MCRecoDriftChamberDigiAssociationCollection> m_output_sim_digi_association{"outputSimDigiAssociation", Gaudi::DataHandle::Writer, this};
mutable DataHandle<extension::MCRecoDriftChamberDigiAssociationCollection> m_output_sim_digi_association{"outputSimDigiAssociation", Gaudi::DataHandle::Writer, this};
// Output digitized tracker hit in local coordinates collection name. Only filled in debug mode
DataHandle<extension::DriftChamberDigiLocalCollection> m_output_digi_local_hits{"outputDigiLocalHits", Gaudi::DataHandle::Writer, this};
mutable DataHandle<extension::DriftChamberDigiLocalCollection> m_output_digi_local_hits{"outputDigiLocalHits", Gaudi::DataHandle::Writer, this};

// Detector readout name
Gaudi::Property<std::string> m_readoutName{this, "readoutName", "CDCHHits", "Name of the detector readout"};
Expand All @@ -77,10 +77,10 @@ class DCHsimpleDigitizerExtendedEdm : public GaudiAlgorithm {
// Flag to produce debugging distributions
Gaudi::Property<bool> m_debugMode{this, "debugMode", false, "Flag to produce debugging distributions"};
// Declaration of debugging distributions
DataHandle<podio::UserDataCollection<double>> m_leftHitSimHitDeltaDistToWire{"leftHitSimHitDeltaDistToWire", Gaudi::DataHandle::Writer, this}; // mm
DataHandle<podio::UserDataCollection<double>> m_leftHitSimHitDeltaLocalZ{"leftHitSimHitDeltaLocalZ", Gaudi::DataHandle::Writer, this}; // mm
DataHandle<podio::UserDataCollection<double>> m_rightHitSimHitDeltaDistToWire{"rightHitSimHitDeltaDistToWire", Gaudi::DataHandle::Writer, this}; // mm
DataHandle<podio::UserDataCollection<double>> m_rightHitSimHitDeltaLocalZ{"rightHitSimHitDeltaLocalZ", Gaudi::DataHandle::Writer, this}; // mm
mutable DataHandle<podio::UserDataCollection<double>> m_leftHitSimHitDeltaDistToWire{"leftHitSimHitDeltaDistToWire", Gaudi::DataHandle::Writer, this}; // mm
mutable DataHandle<podio::UserDataCollection<double>> m_leftHitSimHitDeltaLocalZ{"leftHitSimHitDeltaLocalZ", Gaudi::DataHandle::Writer, this}; // mm
mutable DataHandle<podio::UserDataCollection<double>> m_rightHitSimHitDeltaDistToWire{"rightHitSimHitDeltaDistToWire", Gaudi::DataHandle::Writer, this}; // mm
mutable DataHandle<podio::UserDataCollection<double>> m_rightHitSimHitDeltaLocalZ{"rightHitSimHitDeltaLocalZ", Gaudi::DataHandle::Writer, this}; // mm

// Random Number Service
IRndmGenSvc* m_randSvc;
Expand Down
4 changes: 2 additions & 2 deletions DCHdigi/src/DCHsimpleDigitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
DECLARE_COMPONENT(DCHsimpleDigitizer)

DCHsimpleDigitizer::DCHsimpleDigitizer(const std::string& aName, ISvcLocator* aSvcLoc)
: GaudiAlgorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", "DCHsimpleDigitizer") {
: Gaudi::Algorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", "DCHsimpleDigitizer") {
declareProperty("inputSimHits", m_input_sim_hits, "Input sim tracker hit collection name");
declareProperty("outputDigiHits", m_output_digi_hits, "Output digitized tracker hit collection name");
}
Expand Down Expand Up @@ -45,7 +45,7 @@ StatusCode DCHsimpleDigitizer::initialize() {
return StatusCode::SUCCESS;
}

StatusCode DCHsimpleDigitizer::execute() {
StatusCode DCHsimpleDigitizer::execute(const EventContext&) const {
// Get the input collection with Geant4 hits
const edm4hep::SimTrackerHitCollection* input_sim_hits = m_input_sim_hits.get();
debug() << "Input Sim Hit collection size: " << input_sim_hits->size() << endmsg;
Expand Down
4 changes: 2 additions & 2 deletions DCHdigi/src/DCHsimpleDigitizerExtendedEdm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
DECLARE_COMPONENT(DCHsimpleDigitizerExtendedEdm)

DCHsimpleDigitizerExtendedEdm::DCHsimpleDigitizerExtendedEdm(const std::string& aName, ISvcLocator* aSvcLoc)
: GaudiAlgorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", "DCHsimpleDigitizerExtendedEdm") {
: Gaudi::Algorithm(aName, aSvcLoc), m_geoSvc("GeoSvc", "DCHsimpleDigitizerExtendedEdm") {
declareProperty("inputSimHits", m_input_sim_hits, "Input sim tracker hit collection name");
declareProperty("outputDigiHits", m_output_digi_hits, "Output digitized tracker hit collection name");
declareProperty("outputSimDigiAssociation", m_output_sim_digi_association, "Output name for the association between digitized and simulated hit collections");
Expand Down Expand Up @@ -46,7 +46,7 @@ StatusCode DCHsimpleDigitizerExtendedEdm::initialize() {
return StatusCode::SUCCESS;
}

StatusCode DCHsimpleDigitizerExtendedEdm::execute() {
StatusCode DCHsimpleDigitizerExtendedEdm::execute(const EventContext&) const {
// Get the input collection with Geant4 hits
const edm4hep::SimTrackerHitCollection* input_sim_hits = m_input_sim_hits.get();
debug() << "Input Sim Hit collection size: " << input_sim_hits->size() << endmsg;
Expand Down
5 changes: 0 additions & 5 deletions DCHdigi/test/runDCHsimpleDigitizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,9 @@
geantsim.AuditExecute = True
out.AuditExecute = True

from Configurables import EventCounter
event_counter = EventCounter('event_counter')
event_counter.Frequency = 1

from Configurables import ApplicationMgr
ApplicationMgr(
TopAlg = [
event_counter,
genAlg,
hepmc_converter,
geantsim,
Expand Down
5 changes: 0 additions & 5 deletions DCHdigi/test/runDCHsimpleDigitizerExtendedEdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,9 @@
geantsim.AuditExecute = True
out.AuditExecute = True

from Configurables import EventCounter
event_counter = EventCounter('event_counter')
event_counter.Frequency = 1

from Configurables import ApplicationMgr
ApplicationMgr(
TopAlg = [
event_counter,
genAlg,
hepmc_converter,
geantsim,
Expand Down
9 changes: 8 additions & 1 deletion Tracking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ set(PackageName Tracking)
project(${PackageName})

#find_package(GenFit)
FIND_PACKAGE(MarlinUtil)

#if (GenFit_FOUND)

file(GLOB sources
${PROJECT_SOURCE_DIR}/src/*.cpp
${PROJECT_SOURCE_DIR}/components/*.cpp
)

file(GLOB headers
Expand All @@ -17,7 +19,6 @@ file(GLOB headers
gaudi_add_module(${PackageName}
SOURCES ${sources}
LINK
Gaudi::GaudiAlgLib
Gaudi::GaudiKernel
EDM4HEP::edm4hep
k4FWCore::k4FWCore
Expand All @@ -27,6 +28,7 @@ gaudi_add_module(${PackageName}
target_include_directories(${PackageName} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
${MarlinUtil_INCLUDE_DIRS}
)

set_target_properties(${PackageName} PROPERTIES PUBLIC_HEADER "${headers}")
Expand All @@ -45,4 +47,9 @@ install(TARGETS ${PackageName}
)

install(FILES ${scripts} DESTINATION test)

SET(test_name "test_TracksFromGenParticles")
ADD_TEST(NAME ${test_name} COMMAND k4run test/runTracksFromGenParticles.py)
set_test_env(${test_name})

#endif()
Loading

0 comments on commit d1e094d

Please sign in to comment.