Skip to content
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

new cmake option to download the beampipe STL files from the web eos #359

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

option(BUILD_TESTING "Enable and build tests" ON)
option(INSTALL_COMPACT_FILES "Copy compact files to install area" OFF)
option(INSTALL_BEAMPIPE_STL_FILES "Download CAD files for building the detailed beampipe" OFF)

#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Expand Down Expand Up @@ -194,3 +195,47 @@ write_basic_package_version_file(
install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_CMAKEDIR}/k4geoConfig.cmake
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_CMAKEDIR}/k4geoConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_CMAKEDIR} )

if(INSTALL_BEAMPIPE_STL_FILES)

set(STL_FILES
"AlBeMet162_30042024.stl"
"Copper_pipe_28092023.stl"
"Gold_19042024.stl"
"Paraffine_19042024.stl"
"Tungsten_mask_02102023.stl"
"Water_30042024.stl"
)
# Set main FCC url
set(FCC_URL "https://fccsw.web.cern.ch/fccsw/filesForSimDigiReco")
set(STL_PATH "MDI/MDI_o1_v01/stl_files/Pipe_240430")

# Set the output directory where the file will be placed
set(OUTPUT_DIR "${CMAKE_BINARY_DIR}/${STL_PATH}")
file(MAKE_DIRECTORY ${OUTPUT_DIR})

foreach(STL_FILE ${STL_FILES})
set(FULL_URL "${FCC_URL}/${STL_PATH}/${STL_FILE}")
message(DEBUG "Downloading file ${FULL_URL}")
set(OUTPUT_FILE "${OUTPUT_DIR}/${STL_FILE}")

if(EXISTS "${OUTPUT_FILE}")
message(STATUS "File ${STL_FILE} already exists. Skipping download.")
else()
# Download the file
file(DOWNLOAD ${FULL_URL} ${OUTPUT_FILE}
SHOW_PROGRESS
STATUS download_status)

list(GET download_status 0 status_code)
if(NOT status_code EQUAL 0)
list(GET download_status 1 error_message)
message(FATAL_ERROR "Failed to download file: ${error_message}")
endif()
endif()
endforeach()

file(MAKE_DIRECTORY share/k4geo/FCCee)
INSTALL(DIRECTORY ${OUTPUT_DIR} DESTINATION share/k4geo/FCCee/MDI/compact/MDI_o1_v01/stl_files )

endif()
2 changes: 2 additions & 0 deletions FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/ALLEGRO_o1_v03.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
<include ref="../../../MDI/compact/MDI_o1_v00/Beampipe_o4_v05.xml" />
<include ref="../../../MDI/compact/MDI_o1_v00/BeamInstrumentation_o1_v01.xml" />

<!-- In order to use the CAD beampipe, build k4geo with the following CMake option:
cmake -D INSTALL_BEAMPIPE_STL_FILES=ON which will download the files needed -->
<!-- engineered CAD model of the beam pipe -->
<!-- <include ref="../../../MDI/compact/MDI_o1_v01/Beampipe_CADimport_o1_v02.xml" /> -->
<!-- <include ref="../../../MDI/compact/MDI_o1_v01/BeamInstrumentation_o1_v01.xml"/> -->
Expand Down
3 changes: 3 additions & 0 deletions FCCee/IDEA/compact/IDEA_o1_v03/IDEA_o1_v03.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
<!-- shape based model of the beam pipe -->
<include ref="../../../MDI/compact/MDI_o1_v00/Beampipe_o4_v05.xml" />
<include ref="../../../MDI/compact/MDI_o1_v00/BeamInstrumentation_o1_v01.xml" />

<!-- engineered CAD model of the beam pipe -->
<!-- In order to use the CAD beampipe, build k4geo with the following CMake option:
cmake -D INSTALL_BEAMPIPE_STL_FILES=ON which will download the files needed -->
<!-- <include ref="../../../MDI/compact/MDI_o1_v01/Beampipe_CADimport_o1_v02.xml" /> -->
<!-- <include ref="../../../MDI/compact/MDI_o1_v01/BeamInstrumentation_o1_v01.xml"/> -->
<include ref="LumiCal_o1_v01.xml"/>
Expand Down
7 changes: 4 additions & 3 deletions FCCee/MDI/compact/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ aciarma - 08/07/24
-- BeamInstrumentation_o1_v01.xml : compensating and screening solenoids
-- HOMAbsorber.xml : old model of the HOM absorbers. Not needed anymore with new low impedance beam pipe.

- MDI_o1_v01 (STL FILES NOT IN THIS REPO!!! WILL BE ADDED LATER)
- MDI_o1_v01
-- Beampipe_CADimport_o1_v02.xml : import CAD models for engineered beam pipe (by F. Fransesini/INFN-LNF)
These .stl files are hosted [here](https://fccsw.web.cern.ch/fccsw/filesForSimDigiReco/MDI/MDI_o1_v01/)
These .stl files are hosted [here](https://fccsw.web.cern.ch/fccsw/filesForSimDigiReco/MDI/MDI_o1_v01/).
The CMake option `INSTALL_BEAMPIPE_STL_FILES=ON` downloads these STL.
-- stl_files/Pipe_240430
├── AlBeMet162_30042024.stl : central and elliptoconical chambers, with cooling manifolds
├── Copper_pipe_28092023.stl : low impedance beam pipe separation region
├── Gold_19042024.stl : 5um coating inside the central chamber
├── Paraffine_19042024.stl : cooling for central chamber
├── Tungsten_mask_02102023.stl : SR masks 2.1m upstream
└── Water_30042024.stl : cooling for elliptoconical chambers
-- BeamInstrumentation_o1_v01.xml : compensating and screening solenoids
-- BeamInstrumentation_o1_v01.xml : compensating and screening solenoids
Loading