Skip to content

Commit

Permalink
Merge branch 'main' into refactor-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell authored Jul 11, 2024
2 parents 48a7511 + 2e1bba2 commit cff96de
Show file tree
Hide file tree
Showing 104 changed files with 13,148 additions and 230 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/downstream-build.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# Do not edit this file, it will be overwritten!
# The template file can be found in
# https://github.com/key4hep/key4hep-actions/blob/main/workflows/downstream-build.yaml
name: downstream-build

on:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
downstream-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: actions/checkout@v4
- uses: key4hep/key4hep-actions/downstream-build@main
11 changes: 10 additions & 1 deletion .github/workflows/key4hep-build.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Do not edit this file, it will be overwritten!
# The template file can be found in
# https://github.com/key4hep/key4hep-actions/blob/main/workflows/key4hep-build.yaml
name: Key4hep build

on:
Expand All @@ -6,13 +9,19 @@ on:
- main
pull_request:
workflow_dispatch:
schedule:
- cron: '16 5 * * *'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
matrix:
build_type: ["release", "nightly"]
image: ["alma9", "ubuntu22", "centos7"]
image: ["alma9", "ubuntu22"]
fail-fast: false
runs-on: ubuntu-latest
steps:
Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/key4hep.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/linux.yml

This file was deleted.

64 changes: 56 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ project(${PackageName})

# project version
SET( ${PackageName}_VERSION_MAJOR 0 )
SET( ${PackageName}_VERSION_MINOR 19 )
SET( ${PackageName}_VERSION_MINOR 20 )
SET( ${PackageName}_VERSION_PATCH 0 )

SET( ${PackageName}_VERSION "${${PackageName}_VERSION_MAJOR}.${${PackageName}_VERSION_MINOR}" )
Expand Down Expand Up @@ -50,23 +50,63 @@ dd4hep_set_compiler_flags()
find_package ( ROOT REQUIRED COMPONENTS Geom GenVector)
message ( STATUS "ROOT_VERSION: ${ROOT_VERSION}" )

find_package( Geant4 REQUIRED )
find_package( LCIO REQUIRED)

add_subdirectory(detectorSegmentations)
add_subdirectory(detectorCommon)
find_package( Geant4 REQUIRED )
OPTION(K4GEO_USE_LCIO "Enable or disable the use of LCIO, which is needed for some detector constructors and plugins" ON)
if(K4GEO_USE_LCIO)
find_package(LCIO REQUIRED)
# Shim for older LCIO versions
if(NOT TARGET LCIO::lcio)
add_library(LCIO::lcio INTERFACE IMPORTED GLOBAL)
set_target_properties(LCIO::lcio
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LCIO_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${LCIO_LIBRARIES}"
)
endif()
endif()

file(GLOB sources
./detector/tracker/*.cpp
./detector/calorimeter/*.cpp
./detector/fcal/*.cpp
./detector/muonSystem/*.cpp
./detector/other/*.cpp
./detector/CaloTB/*.cpp
./FCalTB/setup/*.cpp
./plugins/LinearSortingPolicy.cpp
./detector/PID/ARC_geo_o1_v01.cpp
)

if(NOT K4GEO_USE_LCIO)
set(lcio_sources # in ./detector/tracker
TrackerEndcap_o2_v05_geo.cpp
SiTrackerEndcap_o2_v02ext_geo.cpp
TrackerBarrel_o1_v03_geo.cpp
TrackerBarrel_o1_v04_geo.cpp
TrackerBarrel_o1_v05_geo.cpp
TrackerEndcap_o1_v05_geo.cpp
TrackerEndcap_o2_v06_geo.cpp
VertexBarrel_detailed_o1_v01_geo.cpp
VertexEndcap_o1_v05_geo.cpp
ZPlanarTracker_geo.cpp
)
foreach(lcio_source ${lcio_sources})
list(FILTER sources EXCLUDE REGEX "${lcio_source}")
endforeach()
message(STATUS "Use of LCIO is DISABLED, some detectors that depend on LCIO will not be built: ${lcio_sources}")
endif()

include(CheckIncludeFileCXX)
set(CMAKE_REQUIRED_LIBRARIES DD4hep::DDRec)
CHECK_INCLUDE_FILE_CXX(DDRec/DCH_info.h DCH_INFO_H_EXIST)
set(CMAKE_REQUIRED_LIBRARIES)
set(FILES_DEPENDINGON_DCH_INFO_H "DriftChamber_o1_v02.cpp" )

if(NOT DCH_INFO_H_EXIST)
list(FILTER sources EXCLUDE REGEX "${FILES_DEPENDINGON_DCH_INFO_H}")
message(WARNING "Subdetector ${FILES_DEPENDINGON_DCH_INFO_H} will not be built because header file DDRec/DCH_info.h was not found")
endif()

file(GLOB G4sources
./plugins/TPCSDAction.cpp
./plugins/CaloPreShowerSDAction.cpp
Expand All @@ -85,12 +125,20 @@ add_library(lcgeo ALIAS k4geo)
target_include_directories(${PackageName} PRIVATE ${PROJECT_SOURCE_DIR}/detector/include )
target_include_directories(${PackageName}G4 PRIVATE ${PROJECT_SOURCE_DIR}/detector/include )

target_link_libraries(${PackageName} DD4hep::DDCore DD4hep::DDRec DD4hep::DDParsers ROOT::Core LCIO::lcio detectorSegmentations)
target_link_libraries(${PackageName}G4 DD4hep::DDCore DD4hep::DDRec DD4hep::DDParsers DD4hep::DDG4 ROOT::Core ${Geant4_LIBRARIES} LCIO::lcio)
target_link_libraries(${PackageName} DD4hep::DDCore DD4hep::DDRec DD4hep::DDParsers ROOT::Core detectorSegmentations)
target_link_libraries(${PackageName}G4 DD4hep::DDCore DD4hep::DDRec DD4hep::DDParsers DD4hep::DDG4 ROOT::Core ${Geant4_LIBRARIES})

if(K4GEO_USE_LCIO)
target_link_libraries(${PackageName} LCIO::lcio)
target_link_libraries(${PackageName}G4 LCIO::lcio)
endif()

#Create this_package.sh file, and install
dd4hep_instantiate_package(${PackageName})

add_subdirectory(detectorSegmentations)
add_subdirectory(detectorCommon)

# Destination directories are hardcoded because GNUdirectories are not included
install(TARGETS ${PackageName} ${PackageName}G4
EXPORT ${PROJECT_NAME}Targets
Expand Down
6 changes: 3 additions & 3 deletions FCCee/ALLEGRO/compact/ALLEGRO_o1_v02/DectEmptyMaster.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<include ref="${DD4hepINSTALL}/DDDetectors/compact/detector_types.xml" />

<includes>
<gdmlFile ref="../../DetCommon/compact/elements.xml"/>
<gdmlFile ref="../../DetCommon/compact/materials.xml"/>
<gdmlFile ref="./elements.xml"/>
<gdmlFile ref="./materials.xml"/>
</includes>

<info name="FCCDectMaster"
Expand All @@ -25,6 +25,6 @@
<constant name="world_z" value="world_size"/>
</define>

<include ref="./FCCee_DectDimensions.xml" />
<include ref="./DectDimensions.xml" />

</lccdd>
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@
<readout thickness="readout_thickness" sensitive="false">
<material name="PCB"/>
</readout>
<layers> <!-- pcb electrode segmentation in the radial direction -->
<layers>
<!-- pcb electrode segmentation, rescaled to the total radial thickness of the active ECAL volume -->
<!-- This is NOT the radial thickness of each layer!!! -->
<layer thickness="1.5*cm" repeat="1"/>
<layer thickness="3.5*cm" repeat="11"/>
</layers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@
<side sensitive="false"/> <!-- both sides of the cryostat -->
<back sensitive="false"/> <!-- outer wall of the cryostat -->
</cryostat>
<bath name="ECAL_bath">
<material name="LAr"/>
<dimensions rmin="Bath_rmin" rmax="Bath_rmax" dz="EMBarrel_dz"/>
</bath>
<calorimeter name="EM_barrel">
<!-- offset defines the numbering of the modules: module==0 for phi=0 direction -->
<dimensions rmin="EMBarrel_rmin" rmax="EMBarrel_rmax" dz="EMBarrel_dz" offset="-InclinationAngle"/>
Expand Down Expand Up @@ -129,7 +133,9 @@
<readout thickness="readout_thickness" sensitive="true">
<material name="PCB"/>
</readout>
<layers> <!-- pcb electrode segmentation in the radial direction -->
<layers>
<!-- pcb electrode segmentation, rescaled to the total radial thickness of the active ECAL volume -->
<!-- This is NOT the radial thickness of each layer!!! -->
<layer thickness="1.5*cm" repeat="1"/>
<layer thickness="3.5*cm" repeat="11"/>
</layers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<constant name="CryoBarrelFrontCold" value="3.8*mm"/> <!-- Al solid equivalent of 0.043 X0 sandwich CFRP -->
<constant name="CryoBarrelFront" value="CryoBarrelFrontWarm+CryoBarrelFrontCold"/>

<constant name="CryoBarrelBackCold" value="30*mm"/> <!-- Al solid corresponding to 0.34 X0 -->
<constant name="CryoBarrelBackCold" value="1100*mm"/> <!-- Al solid corresponding to 12.5 X0 -->
<constant name="CryoBarrelBackWarm" value="2.7*mm"/> <!-- Al solid equivalent of 0.03 X0 sandwich CFRP -->
<constant name="SolenoidBarrel" value="70*mm"/> <!-- Al solenoid with thickness of 0.8 X0 -->
<constant name="CryoBarrelBack" value="CryoBarrelBackWarm+SolenoidBarrel+CryoBarrelBackCold"/>
Expand Down Expand Up @@ -78,7 +78,7 @@
<readouts>
<!-- readout for the simulation, with the baseline merging: 2x along the module direction in each layer; 4x along theta in each layer except layer 1 -->
<!-- the lists mergedCells_Theta and mergedModules define the number of cells to group together in the theta and module direction as a function of the layer -->
<readout name="ECalBarrelModuleThetaMerged2">
<readout name="ECalBarrelModuleThetaMerged">
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="1536" mergedCells_Theta="4 1 4 4 4 4 4 4 4 4 4 4" mergedModules="2 2 2 2 2 2 2 2 2 2 2 2" grid_size_theta="0.009817477/4" offset_theta="0.5902785"/>
<id>system:4,cryo:1,type:3,subtype:3,layer:8,module:11,theta:10</id>
</readout>
Expand All @@ -102,6 +102,10 @@
<side sensitive="true"/> <!-- both sides of the cryostat -->
<back sensitive="true"/> <!-- outer wall of the cryostat -->
</cryostat>
<bath name="ECAL_bath">
<material name="LAr"/>
<dimensions rmin="Bath_rmin" rmax="Bath_rmax" dz="EMBarrel_dz"/>
</bath>
<calorimeter name="EM_barrel">
<!-- offset defines the numbering of the modules: module==0 for phi=0 direction -->
<dimensions rmin="EMBarrel_rmin" rmax="EMBarrel_rmax" dz="EMBarrel_dz" offset="-InclinationAngle"/>
Expand Down Expand Up @@ -129,7 +133,9 @@
<readout thickness="readout_thickness" sensitive="false">
<material name="PCB"/>
</readout>
<layers> <!-- pcb electrode segmentation in the radial direction -->
<layers>
<!-- pcb electrode segmentation, rescaled to the total radial thickness of the active ECAL volume -->
<!-- This is NOT the radial thickness of each layer!!! -->
<layer thickness="1.5*cm" repeat="1"/>
<layer thickness="3.5*cm" repeat="11"/>
</layers>
Expand Down
Loading

0 comments on commit cff96de

Please sign in to comment.