Skip to content

Commit

Permalink
new cmake option to download the beampipe STL files from the web eos
Browse files Browse the repository at this point in the history
  • Loading branch information
atolosadelgado committed Aug 6, 2024
1 parent 559f411 commit 6e446bf
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
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})

set(FILES_DOWNLOADED)

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}")

# 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()
list(APPEND FILES_DOWNLOADED "${FULL_URL}")

endforeach()

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

endif()
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

0 comments on commit 6e446bf

Please sign in to comment.