diff --git a/CMakeLists.txt b/CMakeLists.txt index 70ec0e519..769573b8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -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() diff --git a/FCCee/MDI/compact/README.md b/FCCee/MDI/compact/README.md index 0b177c6d5..13222dae2 100644 --- a/FCCee/MDI/compact/README.md +++ b/FCCee/MDI/compact/README.md @@ -5,9 +5,10 @@ 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 @@ -15,4 +16,4 @@ These .stl files are hosted [here](https://fccsw.web.cern.ch/fccsw/filesForSimDi ├── 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 \ No newline at end of file +-- BeamInstrumentation_o1_v01.xml : compensating and screening solenoids