Skip to content

Commit

Permalink
Merge branch 'main' of github.com:eic/epic into eic_sr_background_study
Browse files Browse the repository at this point in the history
Update my local branch
  • Loading branch information
Andrii Natochii committed Sep 11, 2024
2 parents 0cf1cb3 + 5a7dd05 commit ed325d4
Show file tree
Hide file tree
Showing 59 changed files with 1,586 additions and 782 deletions.
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
- "reports/**/*"
- "requirements.txt"
- "scripts/**/*"
- "templates/setup.sh.in"
- "templates/thisepic.sh.in"
- "views/**/*"

"topic: magnets":
Expand Down
70 changes: 41 additions & 29 deletions .github/workflows/linux-eic-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ jobs:
path: install/
if-no-files-found: error
- run: |
source install/setup.sh
source install/bin/thisepic.sh
sed -i 's%\(<fiber\|<lens\)%<comment>\1%g; s%\(/fiber>\|/lens>\)%\1</comment>%g' \
${DETECTOR_PATH}/compact/ecal/barrel_interlayers.xml \
${DETECTOR_PATH}/compact/ecal/bic_default.xml \
${DETECTOR_PATH}/compact/ecal/forward_scfi.xml \
${DETECTOR_PATH}/compact/far_forward/ZDC_Ecal_WSciFi.xml \
${DETECTOR_PATH}/compact/pid/mrich.xml
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
- xmllint-after-build
- list-detector-configs
steps:
- uses: eic/trigger-gitlab-ci@v2
- uses: eic/trigger-gitlab-ci@v3
id: trigger
with:
url: https://eicweb.phy.anl.gov
Expand All @@ -140,7 +140,7 @@ jobs:
DETECTOR_REPOSITORYURL=${{ github.server_url }}/${{ github.repository }}
DETECTOR_REPOSITORYREF=${{ github.ref }}
DETECTOR_CONFIG=${{ needs.list-detector-configs.outputs.configs_csv }}
DETECTOR_VERSION=${{ github.event.pull_request.head.ref || github.ref_name }}
DETECTOR_VERSION=${{ github.sha }}
GITHUB_REPOSITORY=${{ github.repository }}
GITHUB_SHA=${{ github.event.pull_request.head.sha || github.sha }}
GITHUB_PR=${{ github.event.pull_request.number }}
Expand All @@ -161,7 +161,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
IFS=, read -a configs <<< "${{ needs.list-detector-configs.outputs.configs_csv }}"
for config in ${configs[@]} ; do
Expand All @@ -187,7 +187,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
root -b -q "scripts/test_ACTS.cxx+(\"${DETECTOR_PATH}/${{matrix.detector_config}}.xml\")" | tee check_tracking_geometry.out
bin/acts_geo_check check_tracking_geometry.out
Expand All @@ -207,7 +207,7 @@ jobs:
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
pushd scripts/material_map
export DETECTOR_CONFIG=epic_craterlake_material_map
Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
IFS=, read -a configs <<< "${{ needs.list-detector-configs.outputs.configs_csv }}"
for config in ${configs[@]} ; do
Expand Down Expand Up @@ -269,7 +269,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
IFS=, read -a configs <<< "${{ needs.list-detector-configs.outputs.configs_csv }}"
for config in ${configs[@]} ; do
Expand Down Expand Up @@ -301,7 +301,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
# For some reason npdet_to_step really wants a space in IFS
IFS=$' \n\t'
Expand Down Expand Up @@ -337,7 +337,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
mkdir -p doc
npdet_info dump ${DETECTOR_PATH}/${{matrix.detector_config}}.xml | tee doc/${{matrix.detector_config}}_constants.out
Expand All @@ -364,7 +364,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
mkdir -p doc
npdet_info dump ${DETECTOR_PATH}/${{matrix.detector_config}}.xml | grep -v '^\s' | grep '=' | cut -d= -f1-2 | tee doc/${{matrix.detector_config}}_constants.toml
Expand Down Expand Up @@ -432,7 +432,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "bridge" # this job must succeed even when new artifacts
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
mkdir -p doc
checkOverlaps --option ${{ matrix.option }} -c ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml | tee doc/overlap_check_tgeo.out
Expand All @@ -453,7 +453,7 @@ jobs:
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
mkdir -p doc
checkGeometry -f true -c ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml | tee geometry_check_full.out
Expand Down Expand Up @@ -485,7 +485,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "bridge" # this job must succeed even when new artifacts
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
mkdir -p doc
python scripts/checkOverlaps.py -c ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml | tee doc/overlap_check_geant4.out
Expand All @@ -510,34 +510,46 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "bridge" # this job must succeed even when new artifacts
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
mkdir -p doc
python scripts/checkOverlaps.py -c ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml | tee doc/overlap_check_geant4.out
noverlaps="$(grep -c GeomVol1002 doc/overlap_check_geant4.out || true)"
if [[ "${noverlaps}" -gt "0" ]] ; then echo "${noverlaps} overlaps found!" && false ; fi
trigger-detector-benchmarks:
trigger-benchmarks:
runs-on: ubuntu-latest
needs: [check-overlap-tgeo, check-overlap-geant4-fast]
strategy:
matrix:
detector_config: [epic_craterlake]
benchmark_repo: [detector_benchmarks, physics_benchmarks, reconstruction_benchmarks]
include:
- benchmark_repo: detector_benchmarks
project_id: 399
secret_var: EICWEB_DETECTOR_BENCHMARK_TRIGGER
- benchmark_repo: physics_benchmarks
project_id: 400
secret_var: EICWEB_PHYSICS_BENCHMARK_TRIGGER
- benchmark_repo: reconstruction_benchmarks
project_id: 408
secret_var: EICWEB_RECONSTRUCTION_BENCHMARK_TRIGGER
steps:
- uses: eic/trigger-gitlab-ci@v2
- uses: eic/trigger-gitlab-ci@v3
id: trigger
with:
url: https://eicweb.phy.anl.gov
project_id: 399
token: ${{ secrets.EICWEB_DETECTOR_BENCHMARK_TRIGGER }}
project_id: ${{ matrix.project_id }}
token: ${{ secrets[matrix.secret_var] }}
ref_name: master
variables: |
DETECTOR=epic
DETECTOR_REPOSITORYURL=${{ github.server_url }}/${{ github.repository }}
DETECTOR_VERSION=${{ github.event.pull_request.head.ref || github.ref_name }}
DETECTOR_VERSION=${{ github.sha }}
DETECTOR_CONFIG=${{ matrix.detector_config }}
GITHUB_REPOSITORY=${{ github.repository }}
GITHUB_SHA=${{ github.event.pull_request.head.sha || github.sha }}
PIPELINE_NAME=${{ github.event.pull_request.title || github.ref_name }}
- run: |
gh api \
--method POST \
Expand All @@ -546,7 +558,7 @@ jobs:
-f state="pending" \
-f target_url="${{ steps.trigger.outputs.web_url }}" \
-f description="Triggered... $(TZ=America/New_York date)" \
-f context="eicweb/detector_benchmarks (${{ matrix.detector_config }})"
-f context="eicweb/${{ matrix.benchmark_repo }} (${{ matrix.detector_config }})"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -568,7 +580,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
bin/generate_prim_file -c $DETECTOR_PATH/${{ matrix.detector_config }}.xml -o prim -D -t ${{ matrix.detector_config }}
- uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -671,7 +683,7 @@ jobs:
uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
npsim --compactFile ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml -G --random.seed 1 --gun.particle "${{ matrix.particle }}-" --gun.momentumMin "1*GeV" --gun.momentumMax "20*GeV" --gun.distribution "uniform" -N 100 --outputFile sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -v WARNING
- uses: actions/upload-artifact@v4
Expand All @@ -681,7 +693,7 @@ jobs:
if-no-files-found: error
- name: Download previous artifact
id: download_previous_artifact
uses: dawidd6/action-download-artifact@v3
uses: dawidd6/action-download-artifact@v6
with:
branch: ${{ github.event.pull_request.base.ref || github.ref_name }}
path: ref/
Expand All @@ -692,7 +704,7 @@ jobs:
uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
export PYTHONPATH=$HOME/.local/lib/python3.10/site-packages:$PYTHONPATH
mkdir capybara-reports
Expand Down Expand Up @@ -730,7 +742,7 @@ jobs:
uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
url=root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/DIS/NC/${{matrix.beam}}/minQ2=${{matrix.minq2}}/pythia8NCDIS_${{matrix.beam}}_minQ2=${{matrix.minq2}}_beamEffects_xAngle=-0.025_hiDiv_1.hepmc3.tree.root
npsim --compactFile ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml -N 100 --inputFiles ${url} --random.seed 1 --outputFile sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root -v WARNING
Expand All @@ -741,7 +753,7 @@ jobs:
if-no-files-found: error
- name: Download previous artifact
id: download_previous_artifact
uses: dawidd6/action-download-artifact@v3
uses: dawidd6/action-download-artifact@v6
with:
branch: ${{ github.event.pull_request.base.ref || github.ref_name }}
path: ref/
Expand All @@ -752,7 +764,7 @@ jobs:
uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
pip install 'pygithub>=2' 'bokeh>=3'
export PYTHONPATH=$HOME/.local/lib/python3.10/site-packages:$PYTHONPATH
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Create backport pull requests
uses: korthout/backport-action@v2
uses: korthout/backport-action@v3
with:
github_token: ${{ secrets.BACKPORT_ACTION_TOKEN }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.4
rev: v18.1.8
hooks:
- id: clang-format
- repo: https://github.com/Lucas-C/pre-commit-hooks
Expand Down
28 changes: 17 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ PROJECT(epic
DESCRIPTION "DD4hep Geometry Description of the EPIC Experiment"
)

# Set version based on git
include(cmake/git_version.cmake)
set_git_version(CMAKE_PROJECT_VERSION)

# C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 17 CACHE STRING "Set the C++ standard to be used")
Expand Down Expand Up @@ -100,22 +104,24 @@ install(DIRECTORY calibrations/
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/calibrations
)

#-----------------------------------------------------------------------------------
# Configure and install compact/version.xml
#
configure_file(templates/version.xml.in ${CMAKE_CURRENT_BINARY_DIR}/version.xml @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/compact
)

#-----------------------------------------------------------------------------------
# Configure and install detector setup script
#
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
configure_file(templates/thisepic.sh.in ${CMAKE_CURRENT_BINARY_DIR}/thisepic.sh @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/thisepic.sh
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
configure_file(templates/setup.sh.in ${CMAKE_CURRENT_BINARY_DIR}/setup.sh @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.sh
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/thisepic.sh
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.sh
DESTINATION ${CMAKE_INSTALL_BINDIR}
RENAME this${PROJECT_NAME}.sh
RENAME setup.sh
)

# install programs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cmake --install build
```
To load the geometry, you can use the scripts in the `install` directory:
```bash
source install/setup.sh
source install/bin/thisepic.sh
```

### Adding/changing detector geometry
Expand Down
Loading

0 comments on commit ed325d4

Please sign in to comment.