Skip to content

Commit

Permalink
Merge pull request #7 from key4hep/main
Browse files Browse the repository at this point in the history
update from master
  • Loading branch information
aciarma authored Aug 26, 2024
2 parents 245c056 + 173619f commit 3a73b48
Show file tree
Hide file tree
Showing 136 changed files with 5,897 additions and 271 deletions.
57 changes: 56 additions & 1 deletion 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 @@ -68,6 +69,7 @@ endif()
file(GLOB sources
./detector/tracker/*.cpp
./detector/calorimeter/*.cpp
./detector/calorimeter/dual-readout/src/*.cpp
./detector/fcal/*.cpp
./detector/muonSystem/*.cpp
./detector/other/*.cpp
Expand Down Expand Up @@ -107,9 +109,15 @@ if(NOT DCH_INFO_H_EXIST)
message(WARNING "Subdetector ${FILES_DEPENDINGON_DCH_INFO_H} will not be built because header file DDRec/DCH_info.h was not found")
endif()

find_package(EDM4HEP)
file(GLOB G4sources
./plugins/TPCSDAction.cpp
./plugins/CaloPreShowerSDAction.cpp
./plugins/FiberDRCaloSDAction.h
./plugins/FiberDRCaloSDAction.cpp
./plugins/Geant4Output2EDM4hep_DRC.cpp
./plugins/DRCaloFastSimModel.cpp
./plugins/DRCaloFastSimModel.h
)

if(DD4HEP_USE_PYROOT)
Expand All @@ -125,8 +133,11 @@ add_library(lcgeo ALIAS k4geo)
target_include_directories(${PackageName} PRIVATE ${PROJECT_SOURCE_DIR}/detector/include )
target_include_directories(${PackageName}G4 PRIVATE ${PROJECT_SOURCE_DIR}/detector/include )

target_include_directories(${PackageName} PRIVATE ${PROJECT_SOURCE_DIR}/detector/calorimeter/dual-readout/include )
target_include_directories(${PackageName}G4 PRIVATE ${PROJECT_SOURCE_DIR}/detector/calorimeter/dual-readout/include )

target_link_libraries(${PackageName} DD4hep::DDCore DD4hep::DDRec DD4hep::DDParsers ROOT::Core detectorSegmentations)
target_link_libraries(${PackageName}G4 DD4hep::DDCore DD4hep::DDRec DD4hep::DDParsers DD4hep::DDG4 ROOT::Core ${Geant4_LIBRARIES})
target_link_libraries(${PackageName}G4 DD4hep::DDCore DD4hep::DDRec DD4hep::DDParsers DD4hep::DDG4 ROOT::Core EDM4HEP::edm4hep EDM4HEP::edm4hepDict podio::podio podio::podioDict podio::podioRootIO ${Geant4_LIBRARIES})

if(K4GEO_USE_LCIO)
target_link_libraries(${PackageName} LCIO::lcio)
Expand Down Expand Up @@ -184,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_o1_v01/stl_files/Pipe_240430")

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

foreach(STL_FILE ${STL_FILES})
set(FULL_URL "${FCC_URL}/MDI/${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()
6 changes: 4 additions & 2 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 All @@ -42,9 +44,9 @@
<include ref="Vertex_IDEA_o1_v01.xml"/> <!-- symbolic link to ../../../IDEA/compact/IDEA_o1_v03/Vertex_IDEA_o1_v01.xml"/>-->
<include ref="DriftChamber_o1_v02.xml"/> <!-- symbolic link to ../../../IDEA/compact/IDEA_o1_v03/DriftChamber_o1_v02.xml -->
<include ref="ECalBarrel_thetamodulemerged.xml"/> <!-- if you remove the ECalBarrel, you also have to remove or update the "GlobalSolenoid" field (it depends on ECAL dimensions) -->
<include ref="ECalEndcaps_coneCryo.xml"/>
<include ref="HCalEndcaps_ThreeParts_TileCal.xml"/>
<include ref="HCalBarrel_TileCal.xml"/>
<include ref="ECalEndcaps_Turbine.xml"/>
<include ref="HCalEndcaps_ThreeParts_TileCal.xml"/>
<include ref="MuonTagger.xml"/>

<fields>
Expand Down
1 change: 1 addition & 0 deletions FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/DectDimensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<constant name="BarECal_dz" value="3100*mm"/>

<!-- LAr ECAL Endcaps -->
<constant name="ECalEndcap_id" value="DetID_ECAL_Endcap"/>
<constant name="ECalEndcap_inner_radius" value="350*mm"/>
<constant name="ECalEndcap_outer_radius" value="2900*mm"/>
<constant name="ECalEndcap_min_z" value="3200*mm"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@
<!-- readout for the simulation, with the baseline merging: 2x along the module direction in each layer; 4x along theta in each layer except layer 1 -->
<!-- the lists mergedCells_Theta and mergedModules define the number of cells to group together in the theta and module direction as a function of the layer -->
<readout name="ECalBarrelModuleThetaMerged">
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="1536" mergedCells_Theta="4 1 4 4 4 4 4 4 4 4 4" mergedModules="2 2 2 2 2 2 2 2 2 2 2" grid_size_theta="0.009817477/4" offset_theta="0.5902785"/>
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="ECalBarrelNumPlanes" mergedCells_Theta="4 1 4 4 4 4 4 4 4 4 4" mergedModules="2 2 2 2 2 2 2 2 2 2 2" grid_size_theta="0.009817477/4" offset_theta="0.5902785"/>
<id>system:4,cryo:1,type:3,subtype:3,layer:8,module:11,theta:10</id>
</readout>

<!-- example of adding a second readout for the reconstruction, to compare the two -->
<readout name="ECalBarrelModuleThetaMerged2">
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="1536" mergedCells_Theta="2 4 2 1 2 1 2 2 1 1 1" mergedModules="2 1 1 2 2 1 1 1 2 2 1" grid_size_theta="0.009817477/4" offset_theta="0.5902785"/>
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="ECalBarrelNumPlanes" mergedCells_Theta="2 4 2 1 2 1 2 2 1 1 1" mergedModules="2 1 1 2 2 1 1 1 2 2 1" grid_size_theta="0.009817477/4" offset_theta="0.5902785"/>
<id>system:4,cryo:1,type:3,subtype:3,layer:8,module:11,theta:10</id>
</readout>
</readouts>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@
<!-- readout for the simulation, with the baseline merging: 2x along the module direction in each layer; 4x along theta in each layer except layer 1 -->
<!-- the lists mergedCells_Theta and mergedModules define the number of cells to group together in the theta and module direction as a function of the layer -->
<readout name="ECalBarrelModuleThetaMerged">
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="1536" mergedCells_Theta="4 1 4 4 4 4 4 4 4 4 4" mergedModules="2 2 2 2 2 2 2 2 2 2 2" grid_size_theta="0.009817477/4" offset_theta="0.5902785"/>
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="ECalBarrelNumPlanes" mergedCells_Theta="4 1 4 4 4 4 4 4 4 4 4" mergedModules="2 2 2 2 2 2 2 2 2 2 2" grid_size_theta="0.009817477/4" offset_theta="0.5902785"/>
<id>system:4,cryo:1,type:3,subtype:3,layer:8,module:11,theta:10</id>
</readout>

<!-- example of adding a second readout for the reconstruction, to compare the two -->
<readout name="ECalBarrelModuleThetaMerged2">
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="1536" mergedCells_Theta="2 4 2 1 2 1 2 2 1 1 1" mergedModules="2 1 1 2 2 1 1 1 2 2 1" grid_size_theta="0.009817477/4" offset_theta="0.5902785"/>
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="ECalBarrelNumPlanes" mergedCells_Theta="2 4 2 1 2 1 2 2 1 1 1" mergedModules="2 1 1 2 2 1 1 1 2 2 1" grid_size_theta="0.009817477/4" offset_theta="0.5902785"/>
<id>system:4,cryo:1,type:3,subtype:3,layer:8,module:11,theta:10</id>
</readout>
</readouts>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@
<!-- readout for the simulation, with the baseline merging: 2x along the module direction in each layer; 4x along theta in each layer except layer 1 -->
<!-- the lists mergedCells_Theta and mergedModules define the number of cells to group together in the theta and module direction as a function of the layer -->
<readout name="ECalBarrelModuleThetaMerged">
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="1536" mergedCells_Theta="4 1 4 4 4 4 4 4 4 4 4" mergedModules="2 2 2 2 2 2 2 2 2 2 2" grid_size_theta="0.009817477/4" offset_theta="0.5902785"/>
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="ECalBarrelNumPlanes" mergedCells_Theta="4 1 4 4 4 4 4 4 4 4 4" mergedModules="2 2 2 2 2 2 2 2 2 2 2" grid_size_theta="0.009817477/4" offset_theta="0.5902785"/>
<id>system:4,cryo:1,type:3,subtype:3,layer:8,module:11,theta:10</id>
</readout>

<!-- example of adding a second readout for the reconstruction, to compare the two -->
<readout name="ECalBarrelModuleThetaMerged2">
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="1536" mergedCells_Theta="2 4 2 1 2 1 2 2 1 1 1" mergedModules="2 1 1 2 2 1 1 1 2 2 1" grid_size_theta="0.009817477/4" offset_theta="0.5902785"/>
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="ECalBarrelNumPlanes" mergedCells_Theta="2 4 2 1 2 1 2 2 1 1 1" mergedModules="2 1 1 2 2 1 1 1 2 2 1" grid_size_theta="0.009817477/4" offset_theta="0.5902785"/>
<id>system:4,cryo:1,type:3,subtype:3,layer:8,module:11,theta:10</id>
</readout>
</readouts>
Expand Down Expand Up @@ -154,4 +154,4 @@
</calorimeter>
</detector>
</detectors>
</lccdd>
</lccdd>
133 changes: 133 additions & 0 deletions FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/ECalEndcaps_Turbine.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8"?>
<lccdd xmlns:compact="http://www.lcsim.org/schemas/compact/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/compact/1.0/compact.xsd">

<info name="FCCee_ECalEndcaps_Turbine"
title="Calorimeter endcaps"
author="E.Varnes, J.Rutherfoord, R.Walker"
url="no"
status="development"
version="1.0">
<comment>
Liquid argon EM calorimeter endcap design.
Electromagnetic part (EMEC) includes lead+steel absorber.
Turbine geometry.
</comment>
</info>

<define>
<!-- cryostat -->
<constant name="CryoEMECThicknessFront" value="50*mm"/>
<constant name="CryoEMECThicknessBack" value="100*mm"/>
<constant name="CryoEMECThicknessInner" value="50*mm"/>
<constant name="CryoEMECThicknessOuter" value="100*mm"/>
<constant name="CryoEndcap_front_rmin" value="ECalEndcap_inner_radius"/>
<constant name="CryoEndcap_back_rmin" value="ECalEndcap_inner_radius"/>
<constant name="CryoEndcap_rmax" value="ECalEndcap_outer_radius"/>
<constant name="CryoEndcap_z1" value="ECalEndcap_min_z"/>
<constant name="CryoEndcap_z2" value="ECalEndcap_max_z"/>
<constant name="CryoEndcap_dz" value="(ECalEndcap_max_z - ECalEndcap_min_z)*0.5"/>
<constant name="CryoEndcap_zOffset" value="ECalEndcap_min_z + 0.5*(ECalEndcap_max_z - ECalEndcap_min_z)"/>
<!-- space between the cryostat and calorimeter -->
<constant name="BathThicknessFront" value="10*mm"/>
<constant name="BathThicknessBack" value="40*mm"/>
<constant name="BathThicknessOuter" value="50*mm"/>
<!-- electromegnetic calorimeter: EMEC -->
<constant name="EMEC_z1" value="CryoEndcap_z1 + CryoEMECThicknessFront + BathThicknessFront"/>offset
<constant name="EMEC_z2" value="ECalEndcap_max_z - CryoEMECThicknessBack - BathThicknessBack"/>
<constant name="EMEC_rmin1" value="CryoEndcap_front_rmin + CryoEMECThicknessInner + BathThicknessFront"/>
<constant name="EMEC_rmin2" value="EMEC_rmin1"/>
<constant name="EMEC_rmax" value="ECalEndcap_outer_radius - CryoEMECThicknessOuter - BathThicknessOuter"/>
<!-- LAr thickness: double gap size -->
<constant name="ECalEndcapNumPlanes" value="928"/>
<constant name="ECalEndcapNumCalibLayers" value="10"/>
<constant name="nWheels" value="3" />
<constant name="BladeAngle" value="41*deg" />
<constant name="NobleLiquidGap" value="3.9*mm" />
<constant name="AbsorberBladeThickness" value="2.9*mm" />
<constant name="ElectrodeBladeThickness" value="1.3*mm" />
<!-- total amount of steel in one passive plate: it is divided for the outside layer on top and bottom -->
<constant name="EMEC_steel_thickness" value="0.1*mm"/>
<!-- total amount of glue in one passive plate: it is divided for the outside layer on top and bottom -->
<constant name="EMEC_glue_thickness" value="0.1*mm"/>
</define>

<display>
<vis name="emec_cryo_vis" r="0.6" g="0.6" b="0.5" alpha="1" showDaughters="true" visible="true" drawingStyle="solid" />
<vis name="emec_bath_vis" r="0.6" g="0.4" b="0.5" alpha="1" showDaughters="true" visible="true" drawingStyle="solid" />
<vis name="emec_envelope_vis_vis" r="0.6" g="0.3" b="0" alpha="1" showDaughters="true" visible="true" drawingStyle="solid" />
<vis name="emec_layer_vis" r="0.6" g="0.3" b="0.2" alpha="1" showDaughters="true" visible="true" drawingStyle="solid" />
<vis name="emec_lar_vis" r="0.5" g="0.3" b="0.2" alpha="1" showDaughters="true" visible="true" drawingStyle="solid" />
<vis name="emec_pb_vis" r="0.5" g="0.5" b="0.2" alpha="1" showDaughters="true" visible="true" drawingStyle="solid" />
<vis name="emec_readout_vis" r="0.5" g="0.1" b="0.2" alpha="1" showDaughters="true" visible="true" drawingStyle="solid" />
<vis name="electrode_vis" r="0.5" g="0.0" b="0.0" alpha="1" showDaughters="true" visible="true" drawingStyle="solid" />
</display>


<readouts>
<readout name="ECalEndcapTurbine">
<!-- temporarily use the same segmentation as the barrel ECal, since that works in reco, even though it's not ideal (or maybe not even tenable) for the endcap
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" nModules="928" mergedCells_Theta="1 1 1 1 1 1 1 1 1 1" mergedModules="1 1 1 1 1 1 1 1 1 1" grid_size_theta="0.009817477/4" offset_theta="0.08"/>
<id>system:4,cryo:1,type:3,subtype:3,side:3,wheel:3,layer:8,module:11,theta:10</id>
</readout>
-->
<segmentation type="FCCSWEndcapTurbine_k4geo" offset_rho="42 78.3215 146.82" offset_z="303.5" offset_phi="0.0" offset_theta="0.11242" grid_size_rho="2.016 2.014 2.004" grid_size_z="1.80" />
<id>system:4,cryo:1,type:3,subtype:3,side:-2,wheel:3,layer:8,module:17,rho:8,z:8</id>

<!-- <id>system:4,cryo:1,type:3,subtype:3,side:-2,wheel:3,layer:9,module:14,rho:-10,z:-14</id> -->
</readout> -->
<!--
<readout name="ECalEndcapPhiTheta">
<segmentation type="FCCSWGridModuleThetaMerged_k4geo" mergedCells_Theta="1 1 1 1 " mergedModules="1 1 1 1" grid_size_theta="0.005" offset_theta="-3.14"/>
<id>system:4,cryo:1,type:3,subtype:3,side:1,wheel:3,layer:5,module:14,theta:10</id>
</readout>
<readout name="ECalEndcapPhiEtaReco">
<segmentation type="FCCSWGridPhiEta_k4geo" phi_bins="704" offset_phi="-pi+(pi/704.)" grid_size_eta="0.05" offset_eta="-2.91"/>
<id>system:4,cryo:1,type:3,subtype:3,layer:8,eta:10,phi:10</id>
</readout>
-->
</readouts>

<detectors>
<!-- electromagnetic calorimeter -->
<detector id="ECalEndcap_id" name="EMEC_turbine" type="ECalEndcap_Turbine_o1_v01" readout="ECalEndcapTurbine" vis="emec_envelope_vis" sensitive="true">
<type_flags type=" DetType_CALORIMETER + DetType_ELECTROMAGNETIC + DetType_ENDCAP"/>
<sensitive type="SimpleCalorimeterSD"/>
<!-- <dimensions rmin1="EMEC_rmin1" rmin2="EMEC_rmin2" rmax="EMEC_rmax" dz="(EMEC_z2-EMEC_z1)/2." z_offset="EMEC_z1+(EMEC_z2-EMEC_z1)/2."/> -->
<dimensions rmin1="CryoEndcap_front_rmin" rmin2="CryoEndcap_front_rmin" rmax1="CryoEndcap_rmax" rmax2="CryoEndcap_rmax" dz="(CryoEndcap_z2-CryoEndcap_z1)/2." z_offset="EMEC_z1+(EMEC_z2-EMEC_z1)/2."/>
<calorimeter name="EM_endcap">
<dimensions rmin="EMEC_rmin1" rmax="EMEC_rmax" dz="(EMEC_z2-EMEC_z1)/2." z_offset="EMEC_z1+(EMEC_z2-EMEC_z1)/2."/>
<cryostat name="ECAL_EndCapCryo">
<material name="Aluminum" />
<dimensions rmin1="CryoEndcap_front_rmin" rmin2="CryoEndcap_front_rmin+CryoEMECThicknessInner" rmax1="CryoEndcap_rmax-CryoEMECThicknessOuter" rmax2="CryoEndcap_rmax" dz="(CryoEndcap_z2-CryoEndcap_z1-CryoEMECThicknessFront-CryoEMECThicknessBack)/2."/>
<front sensitive="false"/> <!-- inner wall of the cryostat -->
<side sensitive="false"/> <!-- both sides of the cryostat -->
<back sensitive="false"/> <!-- outer wall of the cryostat -->
</cryostat>
<supportTube name="supportTube" nWheels="nWheels" thickness="1.0*cm" sensitive="false">
<material name="CarbonFiber" />
</supportTube>
<turbineBlade name="turbineBlade" angle="BladeAngle" decreaseAnglePerWheel="false" sameNUnitCells="false" nUnitCells="144 272 512" nUnitCellsLeastCommonMultiple="78336">
<absorberBlade name="absorberBlade" thickness="AbsorberBladeThickness" scaleThickness="true" thicknessScaleFactor="1.0" sensitive="false">
<material name="Lead" />
</absorberBlade>
<glue thickness="EMEC_glue_thickness" sensitive="false">
<material name="lArCaloGlue"/>
</glue>
<cladding thickness="EMEC_steel_thickness" sensitive="false">
<material name="lArCaloSteel"/>
</cladding>
<electrodeBlade name="electrodeBlade" thickness="ElectrodeBladeThickness" sensitive="false" vis="electrode_vis">
<material name="PCB" />
</electrodeBlade>
<nobleLiquidGap name="nobleLiquidGap" gap="NobleLiquidGap" sensitive="true">
<material name="LAr" />
</nobleLiquidGap>
</turbineBlade>
</calorimeter>
</detector>

</detectors>

</lccdd>
Loading

0 comments on commit 3a73b48

Please sign in to comment.