-
Notifications
You must be signed in to change notification settings - Fork 45
Implement Celeritas-DD4hep integration plugin #1756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
rahmans1
wants to merge
100
commits into
celeritas-project:develop
Choose a base branch
from
rahmans1:feature-dd4hep-integration-plugin
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
100 commits
Select commit
Hold shift + click to select a range
9d8d49c
Add dd4hep to list of optional cmake dependencies
rahmans1 926bf32
Add initial ddceler plugin building mechanism to cmake
rahmans1 78c4a61
Add initial ddceler plugin layout
rahmans1 32a4c12
Update CMakeLists.txt to bring in latest changes from develop
rahmans1 d88d5d0
Remove ddceler plugin test files. Will be uploaded later with proper …
rahmans1 2eb55b2
Add ddceler directory to list of subdirectories to build if DD4hep op…
5e0c2b4
Fix typo. Replace dd4hep with ddceler.
2e18c6f
Add plugin to lib post install
518ed0b
Modify plugin name to match class name
242c8e7
Fix formatting for ddceler plugin code
db4682a
Add DDG4 Run Action plugin for celeritas offload with proper formatting
2d9531e
Add DDG4 Run Action plugin for celeritas offload to cmake file
92ef544
Minimal DDG4 steering file to demonstrate celeritas integration
45675e3
Add a placeholder non-zero uniform magnetic field
d8cb34b
Merge branch 'celeritas-project:develop' into feature-dd4hep-integrat…
rahmans1 3426206
Merge branch 'celeritas-project:develop' into feature-dd4hep-integrat…
rahmans1 ffdebc9
First commit of simple detector for testing celeritas-dd4hep integrat…
rahmans1 eab608a
Fix style and set sensor type
e1b7f2e
Parse sensor type properly
247c802
Remove explicit definition of world volume and make the beampipe a pa…
544e71f
Add a placeholder sensor type for beampipe to passive
d382ba3
Fix style and move comment block into info section
3ff27fc
Fix style and commit first iteration of benchmark plotting script to …
c393a26
Add steering file to the example with proper formatting
e3b43be
Use a uniform 3 Tesla field everywhere
372ffbc
Merge branch 'develop' into feature-dd4hep-integration-plugin
rahmans1 cd7c7f5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] be6380d
Track zero energy deposition particles
06c2650
Align celeritas magnetic field with the DD4hep field direction
d3870b6
Updates to the plotting script. Looking at only primaries from MCPart…
791c0f3
Move the steering file to the example directory
8fa69e1
Merge branch 'develop' into feature-dd4hep-integration-plugin
rahmans1 3d8fa86
Fix comments and don't include unnecessary header file
rahmans1 5bcf1c4
Merge branch 'celeritas-project:develop' into feature-dd4hep-integrat…
rahmans1 945037b
Generalize info message for celeritas tracking and replace physics li…
rahmans1 a99b483
Update steering file
rahmans1 e7565fb
Add messenger commands to pass celeritas configuration variables thro…
rahmans1 10dda0c
Merge branch 'celeritas-project:develop' into feature-dd4hep-integrat…
rahmans1 71c5bf6
First commit of workflow to test dd4hep integration under eic-shell e…
rahmans1 29543ed
Temporarily trigger on every push to the branch
rahmans1 2e6d880
Remove download action
rahmans1 2893153
Build celeritas with dd4hep
rahmans1 962233c
Run with a general example from DD4hep upstream repo
rahmans1 938fd43
Set correct relative path for steering file in action
rahmans1 7a43205
Merge branch 'celeritas-project:develop' into feature-dd4hep-integrat…
rahmans1 acadfb8
Merge branch 'celeritas-project:develop' into feature-dd4hep-integrat…
rahmans1 a17b72c
Merge branch 'celeritas-project:develop' into feature-dd4hep-integrat…
rahmans1 193b27b
Merge branch 'celeritas-project:develop' into feature-dd4hep-integrat…
rahmans1 dabb8d3
Specify a single parameter to define the field map for DD4hep and cel…
f7d60ee
Use lowercase for dd4hep class name
b6a68df
Revert "Use lowercase for dd4hep class name"
f853755
Revert "Specify a single parameter to define the field map for DD4hep…
8e4dc01
Using the upstream DD4hep example but replacing the field with a cons…
b781260
Remove custom example
f53a239
Use the constant field example instead of solenoidal field
rahmans1 908143d
1. DDcelerTMI.hh:34 - Changed m_uniformFieldStrength from float to st…
2209929
Minor updates to variable names that align with the example output st…
718d5ee
1. DDcelerTMI.cc:10 - Added #include <DD4hep/Detector.h> to access t…
0f5e37c
Strategy 1 (Fast path): DDcelerTMI.cc:54-82
2578b1e
Build the magnetic field with only constant field types in local example
bff4df5
Only allow constant field components
b23e4c5
Don't use debug mode in action workflow
df18cec
Also run with no celeritas offload and produce a benchmark comparison…
1e996a7
Add more options within steering file to simplify usage
f17d96c
Add a dd4hep property to pass celeritas ignored processes from steeri…
d00b13a
Attempt at parametrizing the field driver options through the xml des…
8d222b0
Instead of resetting Geant4FieldManager, we query the DD4hep descript…
f9721a7
Use CELER_VALIDATE instead of using throw directly everywhere
9120784
Use CELER_LOG(info) instead of using this->info directly everywhere
0167a04
Merge branch 'develop' into feature-dd4hep-integration-plugin
rahmans1 f8720bd
Merge branch 'develop' into feature-dd4hep-integration-plugin
rahmans1 aca4052
Apply fixes from pre-commit hooks: see detailed commit message →
pre-commit-ci[bot] e654cf2
Configure DD4hep plugins to link against build libraries and copy com…
667aaca
Add VecGeom-specific linker flags for DD4hep plugins
80a94a7
Additional condition for vecgeom based runs
953a072
Revert "Use CELER_LOG(info) instead of using this->info directly ever…
b416eb7
Use the ci nightly of eic-shell container
rahmans1 1b437a6
Doesn't need to run on every push to the branch
rahmans1 020c94b
Use the container from github package registry instead of accessing f…
rahmans1 92b18b7
Revert "Doesn't need to run on every push to the branch"
93967bb
Source profile for eic-shell container environment
rahmans1 fdfbbf9
Use bash shell explicitly
rahmans1 7c487c5
Run Celeritas and Geant4 simulations in parallel
rahmans1 4f24883
Check removing source command in workflow
rahmans1 41240e7
Enhance dd4hep integration workflow with error handling
rahmans1 cf3684d
Merge branch 'celeritas-project:develop' into feature-dd4hep-integrat…
rahmans1 064e040
Merge branch 'celeritas-project:develop' into feature-dd4hep-integrat…
rahmans1 e89d113
Reorganize plugin cmakefile to setup proper dependency chain
ccda8f1
Add copyright header to steeringFile.py
6ef1501
Add copyright header to SiD_ConstantField.xml
b0ea549
Make steeringFile.py PEP8 compliant
654795e
Rename parameter 'nam' to 'name' and remove from codespell ignore list
a5cb800
Merge branch 'feature-dd4hep-integration-plugin' of https://github.co…
aeadd13
Initialize DDcelerTMI member variables and add validation
d865047
Merge branch 'celeritas-project:develop' into feature-dd4hep-integrat…
rahmans1 2f61586
Refactor dd4hep integration workflow steps
rahmans1 c621268
Add error handling to dd4hep integration workflow
rahmans1 9eaff43
Rename upload step and update artifact paths
rahmans1 d491cb1
Export gdml and upload artifact
rahmans1 965fc39
Update check-dd4hep-integration workflow for GDML output
rahmans1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| name: Check dd4hep integration | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| workflow_call: | ||
| push: | ||
| branches: | ||
| - feature-dd4hep-integration-plugin | ||
|
|
||
| concurrency: | ||
| group: build-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}-${{github.workflow}} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| check-dd4hep-integration: | ||
| container: ghcr.io/eic/eic_ci:nightly | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: Build and test dd4hep integration | ||
| shell: bash | ||
| run: | | ||
| set +e | ||
| set -o pipefail | ||
| source /etc/profile | ||
| eic-info | ||
| cmake -DCELERITAS_USE_DD4hep=ON -DCMAKE_INSTALL_PREFIX=install -S . -B build | ||
| cmake --build build -j 8 | ||
| cmake --install build | ||
| export LD_LIBRARY_PATH=$PWD/install/lib:${LD_LIBRARY_PATH} | ||
|
|
||
| # Run both simulations in parallel with separate log files | ||
| echo "Starting Celeritas simulation..." | ||
| ddsim --compactFile=$PWD/example/ddceler/SiD_ConstantField.xml --steering $PWD/example/ddceler/steeringFile.py --outputFile output_celeritas.root --geometry.dumpGDML SiD_ConstantField.gdml > celeritas.log 2>&1 & | ||
| CELER_PID=$! | ||
|
|
||
| echo "Starting Geant4 simulation..." | ||
| CELER_DISABLE=1 ddsim --compactFile=$PWD/example/ddceler/SiD_ConstantField.xml --steering $PWD/example/ddceler/steeringFile.py --outputFile output_geant4.root > geant4.log 2>&1 & | ||
| GEANT4_PID=$! | ||
|
|
||
| # Wait for both to complete | ||
| wait $CELER_PID || CELER_EXIT=$? | ||
| wait $GEANT4_PID || GEANT4_EXIT=$? | ||
|
|
||
| # Display logs | ||
| echo "=== Celeritas Log ===" | ||
| cat celeritas.log | ||
| echo "=== Geant4 Log ===" | ||
| cat geant4.log | ||
|
|
||
| # Check exit codes | ||
| if [ "${CELER_EXIT:-0}" -ne 0 ] || [ "${GEANT4_EXIT:-0}" -ne 0 ]; then | ||
| echo "Error: One or more simulations failed" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Compare benchmarks and generate plots | ||
| if [ -f output_geant4.root ] && [ -f output_celeritas.root ]; then | ||
| root -l -b -q "${PWD}/example/ddceler/compare_benchmarks.cc(\"output_geant4.root\", \"output_celeritas.root\")" | ||
| else | ||
| echo "Error: Output files not found" | ||
| exit 1 | ||
| fi | ||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: simulation-artifacts | ||
| path: | | ||
| *.log | ||
| *.png | ||
| *.gdml | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| <!-- Derived from https://github.com/AIDASoft/DD4hep/blob/master/DDDetectors/compact/SiD.xml --> | ||
| <!-- Copyright Celeritas contributors: see top-level COPYRIGHT file for details --> | ||
| <!-- SPDX-License-Identifier: (Apache-2.0 OR MIT) --> | ||
| <lccdd> | ||
| <comment> | ||
| Using a constant field in the DD4hep example SiD detector description | ||
| </comment> | ||
|
|
||
| <includes> | ||
| <gdmlFile ref="${DD4hepINSTALL}/DDDetectors/compact/elements.xml"/> | ||
| <gdmlFile ref="${DD4hepINSTALL}/DDDetectors/compact/materials.xml"/> | ||
| </includes> | ||
|
|
||
| <define> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiDConstants.xml"/> | ||
| </define> | ||
|
|
||
|
|
||
| <limits> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD_Limits.xml"/> | ||
| </limits> | ||
|
|
||
| <regions> | ||
| <region name="SiTrackerBarrelRegion" eunit="MeV" lunit="mm" cut="0.001" threshold="0.001"> | ||
| <limitsetref name="SiTrackerBarrelRegionLimitSet"/> | ||
| </region> | ||
| </regions> | ||
|
|
||
|
|
||
| <comment>Common Generic visualization attributes</comment> | ||
| <display> | ||
| <vis name="InvisibleNoDaughters" showDaughters="false" visible="false"/> | ||
| <vis name="InvisibleWithDaughters" showDaughters="true" visible="false"/> | ||
| <vis name="GreenVis" alpha="1" r="0.0" g="1.0" b="0.0" showDaughters="true" visible="true"/> | ||
| <vis name="RedVis" alpha="1" r="1.0" g="0.0" b="0.0" showDaughters="true" visible="true"/> | ||
| <vis name="BlueVis" alpha="1" r="0.0" g="0.0" b="1.0" showDaughters="true" visible="true"/> | ||
| </display> | ||
|
|
||
| <comment>Additional design specific material definitions</comment> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD/SiD_Materials.xml"/> | ||
|
|
||
| <comment>Tracking detectors</comment> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD/SiD_Vertex.xml"/> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD/SiD_Tracker.xml"/> | ||
|
|
||
| <comment>Calorimeters</comment> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD/SiD_Ecal.xml"/> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD/SiD_Hcal.xml"/> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD/SiD_HcalPlug.xml"/> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD/SiD_Muon.xml"/> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD/SiD_Lumical.xml"/> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD/SiD_Beamcal.xml"/> | ||
|
|
||
| <comment>Beampipe</comment> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD/SiD_Beampipe.xml"/> | ||
|
|
||
| <comment>Dead material, supports and magnet</comment> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD/SiD_Shields.xml"/> | ||
| <include ref="${DD4hepINSTALL}/DDDetectors/compact/SiD/SiD_Solenoid.xml"/> | ||
|
|
||
| <comment>Magnetic field</comment> | ||
| <fields> | ||
| <field name="MagnetFields1_Constant" type="ConstantField" field="magnetic"> | ||
| <strength x="0" y="0" z="4.0*tesla"/> | ||
| </field> | ||
| <field name="MagnetFields2_Constant" type="ConstantField" field="magnetic"> | ||
| <strength x="0" y="0" z="3.0*tesla"/> | ||
| </field> | ||
| </fields> | ||
|
|
||
| </lccdd> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? We don't use it in epic, but we use it in npsim...