Skip to content

Commit ae2e7e5

Browse files
wdconincveprbl
andauthored
feat: export simulation geometry to CAD models (STEP) (#667)
### Briefly, what does this PR introduce? This PR exports the geometry to STEP files for CAD import and dimensioning. There are no real settings to tweak, but to increase the level at which volumes are exported, hints can be added to the yaml file. Detectors can also be removed (currently only the ACTS subassemblies are removed since they don't do anything). There are 'issues' that need to be addressed, but they have to be addressed in npsim: - units are off (npdet_to_step use the cm value from TGeo and writes them as inch values in STEP) eic/npsim#20, - some shapes cannot be exported; not sure yet which ones and it makes more sense to bypass them in npsim eic/npsim#21. ### What kind of change does this PR introduce? - [ ] Bug fix (issue #__) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [ ] Tests for the changes have been added - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? No. ### Does this PR change default behavior? No. --------- Co-authored-by: Dmitry Kalinkin <[email protected]>
1 parent dc00fc3 commit ae2e7e5

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

.github/workflows/linux-eic-shell.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,42 @@ jobs:
249249
path: "*.root"
250250
if-no-files-found: error
251251

252+
convert-to-step:
253+
runs-on: ubuntu-latest
254+
needs:
255+
- build
256+
strategy:
257+
matrix:
258+
detector_config: [epic_craterlake_no_bhcal, epic_craterlake_tracking_only, epic_dirc_only, epic_drich_only, epic_imaging_only, epic_ip6, epic_lfhcal_with_insert]
259+
steps:
260+
- uses: actions/checkout@v4
261+
- uses: actions/download-artifact@v4
262+
with:
263+
name: build-gcc-fast-eic-shell
264+
path: install/
265+
- uses: cvmfs-contrib/github-action-cvmfs@v4
266+
- uses: eic/run-cvmfs-osg-eic-shell@main
267+
with:
268+
platform-release: "jug_xl:nightly"
269+
network_types: "none"
270+
setup: install/setup.sh
271+
run: |
272+
# For some reason npdet_to_step really wants a space in IFS
273+
IFS=$' \n\t'
274+
# First get all detectors (except world)
275+
declare -A detectors
276+
while read d ; do detectors[$d]='-l 3' ; done <<< $(npdet_to_step list $DETECTOR_PATH/${{matrix.detector_config}}.xml | sed '/world/d;s/.*(vol: \(.*\)).*/\1/g')
277+
# Then tweak the levels (default is 1)
278+
detectors[LFHCAL]='-l 2'
279+
detectors[OuterBarrelMPGDSubAssembly]='-l 4'
280+
# Export to one STEP file
281+
npdet_to_step $(for d in ${!detectors[@]} ; do echo part ${detectors[$d]} $d ; done) -o ${{matrix.detector_config}} $DETECTOR_PATH/${{matrix.detector_config}}.xml 2>&1 | sed '/TGeoMatrix::dtor/d'
282+
- uses: actions/upload-artifact@v4
283+
with:
284+
name: ${{matrix.detector_config}}.stp
285+
path: ${{matrix.detector_config}}.stp
286+
if-no-files-found: error
287+
252288
dump-constants:
253289
runs-on: ubuntu-latest
254290
needs: build
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
ebeam: 5
2+
pbeam: 41
3+
features:
4+
beampipe:
5+
tracking:
6+
definitions_craterlake:
7+
vertex_barrel:
8+
silicon_barrel:
9+
mpgd_barrel:
10+
support_service_craterlake:
11+
mpgd_outerbarrel:
12+
mpgd_forward_endcap:
13+
mpgd_backward_endcap:
14+
silicon_disks:
15+
tof_barrel:
16+
tof_endcap:
17+
pid:
18+
dirc:
19+
pfrich:
20+
drich:
21+
ecal:
22+
forward_homogeneous:
23+
forward_insert_homogeneous:
24+
barrel_interlayers:
25+
backward_PbWO4:
26+
solenoid:
27+
hcal:
28+
lfhcal_with_space_for_insert:
29+
forward_insert:
30+
backward:
31+
backward_endcap_flux:
32+
far_forward:
33+
far_forward:
34+
far_backward:
35+
far_backward:

0 commit comments

Comments
 (0)