Skip to content

Commit

Permalink
pull latest main branch & fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
SanghyunKo committed Jan 8, 2025
2 parents f318589 + d7fec08 commit 0951225
Show file tree
Hide file tree
Showing 201 changed files with 21,021 additions and 2,861 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cvmfs-contrib/github-action-cvmfs@v3.1
- uses: actions/checkout@v4
- uses: cvmfs-contrib/github-action-cvmfs@v4
- uses: aidasoft/run-lcg-view@v4
with:
release-platform: LCG_101/x86_64-centos7-clang12-opt
container: el9
view-path: /cvmfs/sw-nightlies.hsf.org/key4hep
run: |
export PYTHONPATH=$(python -m site --user-site):$PYTHONPATH
export PATH=/root/.local/bin:$PATH
pip install --upgrade --user pip
pip install pre-commit --user
# Use virtualenv from the LCG release
pip uninstall --yes virtualenv
python -m venv /root/pre-commit-venv
source /root/pre-commit-venv/bin/activate
pip install pre-commit
export PYTHONPATH=$VIRTUAL_ENV/lib/python3.$(python3 -c 'import sys; print(f"{sys.version_info[1]}")')/site-packages:$PYTHONPATH
# Newer versions of git are more cautious around the github runner
# environment and without this git rev-parse --show-cdup in pre-commit
# fails
git config --global --add safe.directory $(pwd)
pre-commit run --show-diff-on-failure \
--color=always \
--all-files
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ repos:
rev: v4.5.0
hooks:
- id: check-xml
- repo: local
hooks:
- id: ruff-format
name: ruff-format
entry: ruff format --force-exclude
types: [python]
language: system
10 changes: 10 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
target-version = "py311"

line-length = 99

[format]
# Make things format the same way as black
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
16 changes: 10 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ project(${PackageName})

# project version
SET( ${PackageName}_VERSION_MAJOR 0 )
SET( ${PackageName}_VERSION_MINOR 20 )
SET( ${PackageName}_VERSION_MINOR 21 )
SET( ${PackageName}_VERSION_PATCH 0 )

SET( ${PackageName}_VERSION "${${PackageName}_VERSION_MAJOR}.${${PackageName}_VERSION_MINOR}" )
Expand All @@ -18,6 +18,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake )
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)

include(cmake/Key4hepConfig.cmake)

include(GNUInstallDirs)
set(CMAKE_INSTALL_LIBDIR lib)
set(CMAKE_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
Expand All @@ -43,10 +45,6 @@ option(INSTALL_BEAMPIPE_STL_FILES "Download CAD files for building the detailed


find_package(DD4hep REQUIRED COMPONENTS DDRec DDG4 DDParsers)
# dd4hep_set_compiler_flags() expects DD4hep_SET_RPATH to be set to ON
# otherwise it will not set the rpath when installing
set(DD4HEP_SET_RPATH ON)
dd4hep_set_compiler_flags()

find_package ( ROOT REQUIRED COMPONENTS Geom GenVector)
message ( STATUS "ROOT_VERSION: ${ROOT_VERSION}" )
Expand All @@ -70,6 +68,7 @@ file(GLOB sources
./detector/tracker/*.cpp
./detector/calorimeter/*.cpp
./detector/calorimeter/dual-readout/src/*.cpp
./detector/calorimeter/dual-readout-tubes/src/*.cpp
./detector/fcal/*.cpp
./detector/muonSystem/*.cpp
./detector/other/*.cpp
Expand Down Expand Up @@ -118,6 +117,8 @@ file(GLOB G4sources
./plugins/Geant4Output2EDM4hep_DRC.cpp
./plugins/DRCaloFastSimModel.cpp
./plugins/DRCaloFastSimModel.h
./plugins/DRTubesSDAction.hh
./plugins/DRTubesSDAction.cpp
)

if(DD4HEP_USE_PYROOT)
Expand All @@ -136,8 +137,11 @@ target_include_directories(${PackageName}G4 PRIVATE ${PROJECT_SOURCE_DIR}/detect
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_include_directories(${PackageName} PRIVATE ${PROJECT_SOURCE_DIR}/detector/calorimeter/dual-readout-tubes/include )
target_include_directories(${PackageName}G4 PRIVATE ${PROJECT_SOURCE_DIR}/detector/calorimeter/dual-readout-tubes/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 EDM4HEP::edm4hep EDM4HEP::edm4hepDict podio::podio podio::podioDict podio::podioRootIO ${Geant4_LIBRARIES})
target_link_libraries(${PackageName}G4 DD4hep::DDCore DD4hep::DDRec DD4hep::DDParsers DD4hep::DDG4 ROOT::Core podio::podioRootIO EDM4HEP::edm4hep ${Geant4_LIBRARIES})

if(K4GEO_USE_LCIO)
target_link_libraries(${PackageName} LCIO::lcio)
Expand Down
21 changes: 13 additions & 8 deletions CaloTB/CaloTB_EPT_AHCAL/TBModel2015_steering.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,38 @@
SIM.compactFile = "../../DD4HEP/compact/TBModel2015.xml"
SIM.runType = "batch"
SIM.macroFile = "vis.mac"
#SIM.inputFiles = "mcparticles.slcio"
# SIM.inputFiles = "mcparticles.slcio"
SIM.outputFile = "DD4hep_mu-_8GeV_QGSP_BERT_10k.slcio"

SIM.numberOfEvents = 10000
SIM.skipNEvents = 0
SIM.physicsList = "QGSP_BERT"
SIM.dumpSteeringFile = "TBModel2015_dump.xml"
SIM.enableDetailedShowerMode=True
SIM.enableDetailedShowerMode = True

SIM.random.seed = "0123456789"
SIM.field.eps_min = 1*mm
SIM.part.minimalKineticEnergy = 1*MeV
SIM.field.eps_min = 1 * mm
SIM.part.minimalKineticEnergy = 1 * MeV

SIM.action.calo = "Geant4ScintillatorCalorimeterAction"

## set the particle.tbl file to add extra particles to DDsim (B-Baryons)
## use the power of python to get the file from DD4hep wherever it is
import os
if os.path.exists( os.path.join( os.environ.get("DD4hepINSTALL"), "examples/DDG4/examples/particle.tbl") ):
SIM.physics.pdgfile = os.path.join( os.environ.get("DD4hepINSTALL"), "examples/DDG4/examples/particle.tbl")

if os.path.exists(
os.path.join(os.environ.get("DD4hepINSTALL"), "examples/DDG4/examples/particle.tbl")
):
SIM.physics.pdgfile = os.path.join(
os.environ.get("DD4hepINSTALL"), "examples/DDG4/examples/particle.tbl"
)


SIM.enableGun = True
SIM.gun.particle = "mu-"
SIM.gun.energy = 8*GeV
SIM.gun.energy = 8 * GeV
SIM.gun.position = "0, 0, -1000"
SIM.gun.direction = "0,0,1"

#SIM.gun.isotrop
# SIM.gun.isotrop
SIM.gun.multiplicity = 1
14 changes: 7 additions & 7 deletions CaloTB/run_sim/ddsim_steering_00.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
SIM.compactFile = "../compact/MainTestBeamSetup.xml"
SIM.dumpSteeringFile = "dumpSteering00.xml"

SIM.field.eps_min = 1*mm
SIM.field.eps_min = 1 * mm

SIM.part.minimalKineticEnergy = 1*MeV
SIM.part.minimalKineticEnergy = 1 * MeV

SIM.physicsList = "QGSP_BERT"
SIM.enableDetailedShowerMode=True

SIM.enableDetailedShowerMode = True

SIM.enableGun = True

SIM.gun.energy = 10*GeV
SIM.gun.energy = 10 * GeV
SIM.gun.particle = "pi+"
#SIM.gun.multiplicity
# SIM.gun.multiplicity
SIM.gun.position = "0,0,-1000"
#SIM.gun.isotrop
# SIM.gun.isotrop
SIM.gun.direction = "0,0,1"
9 changes: 5 additions & 4 deletions FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/ALLEGRO_o1_v03.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@
<!-- <include ref="../../../MDI/compact/MDI_o1_v01/BeamInstrumentation_o1_v01.xml"/> -->

<include ref="LumiCal.xml"/>
<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="VertexComplete_IDEA_o1_v03.xml"/> <!-- symbolic link to ../../../IDEA/compact/IDEA_o1_v03/VertexComplete_IDEA_o1_v03.xml -->
<include ref="DriftChamber_o1_v02.xml"/> <!-- symbolic link to ../../../IDEA/compact/IDEA_o1_v03/DriftChamber_o1_v02.xml -->
<include ref="SiliconWrapper_o1_v03.xml"/> <!-- symbolic link to ../../../IDEA/compact/IDEA_o1_v03/SiliconWrapper_o1_v03.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="HCalBarrel_TileCal.xml"/>
<include ref="HCalBarrel_TileCal_v03.xml"/>
<include ref="ECalEndcaps_Turbine.xml"/>
<include ref="HCalEndcaps_ThreeParts_TileCal.xml"/>
<include ref="HCalEndcaps_ThreeParts_TileCal_v03.xml"/>
<include ref="MuonTagger.xml"/>

<fields>
Expand Down
105 changes: 65 additions & 40 deletions FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/DectDimensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,38 @@
<constant name="world_side" value="6100*mm"/>
<constant name="CrossingAngle" value="0.030*rad"/>

<constant name="GlobalTrackerReadoutID" type="string" value="system:5,layer:3,stave:6,module:5,sensor:2"/>
<constant name="GlobalTrackerReadoutID_OB" type="string" value="system:5,layer:1,stave:6,module:4,sensor:2"/>
<constant name="GlobalTrackerReadoutID_Disk" type="string" value="system:5,side:-2,layer:3,petal:3,stave:6,module:10,sensor:2"/>
<constant name="GlobalTrackerReadoutID_SiWrapperB" type="string" value="system:5,layer:1,stave:9,module:6,sensor:1"/>
<constant name="GlobalTrackerReadoutID_SiWrapperD" type="string" value="system:5,side:1,layer:1,module:6,sensor:1"/>
<constant name="GlobalTrackerReadoutID" type="string" value="system:5,side:-2,layer:3,module:16,sensor:6"/>

<constant name="SolenoidField" value="2*tesla"/>

<constant name="DetID_NOTUSED" value=" 0"/>
<constant name="DetID_VXD_IB" value=" 1"/>
<constant name="DetID_VXD_Disks" value=" 2"/>
<constant name="DetID_VXD_OB" value=" 20"/>
<constant name="DetID_DCH" value=" 3"/>
<constant name="DetID_ECAL_Barrel" value=" 4"/>
<constant name="DetID_ECAL_Endcap" value=" 5"/>
<!-- Detector IDs -->
<constant name="DetID_NOTUSED" value=" 0"/>

<constant name="DetID_VXD_Barrel" value=" 1"/>
<constant name="DetID_VXD_Disks" value=" 2"/>

<constant name="DetID_DCH" value=" 3"/>

<constant name="DetID_SiWr_Barrel" value=" 23"/>
<constant name="DetID_SiWr_Disks" value=" 24"/>

<constant name="DetID_ECAL_Barrel" value=" 4"/>
<constant name="DetID_ECAL_Endcap" value=" 5"/>

<constant name="DetID_HCAL_Barrel" value=" 8"/>
<constant name="DetID_HCAL_Endcap" value=" 9"/>
<constant name="DetID_HCAL_Barrel" value=" 8"/>
<constant name="DetID_HCAL_Endcap" value=" 9"/>

<constant name="DetID_Muon_Barrel" value=" 12"/>
<constant name="DetID_Muon_Endcap_1" value=" 13"/>
<constant name="DetID_Muon_Endcap_2" value=" 14"/>

<constant name="DetID_LumiCal" value=" 15"/>
<constant name="DetID_LumiCalInstrumentation" value=" 16"/>
<constant name="DetID_LumiCalCooling" value=" 17"/>
<constant name="DetID_LumiCalBackShield" value=" 18"/>
<constant name="DetID_HOMAbsorber" value=" 19"/>
<constant name="DetID_LumiCalNoseShield" value=" 22"/>
<constant name="DetID_Muon_Barrel" value=" 12"/>
<constant name="DetID_Muon_Endcap_1" value=" 13"/>
<constant name="DetID_Muon_Endcap_2" value=" 14"/>

<constant name="DetID_LumiCal" value=" 15"/>
<constant name="DetID_LumiCalInstrumentation" value=" 16"/>
<constant name="DetID_LumiCalCooling" value=" 17"/>
<constant name="DetID_LumiCalBackShield" value=" 18"/>
<constant name="DetID_HOMAbsorber" value=" 19"/>
<constant name="DetID_LumiCalNoseShield" value=" 22"/>

<!-- BPW: Beam Pipe Width -->
<constant name="BPWWall" value="0.35*mm" />
<constant name="BPWCool" value="1.0*mm" />
Expand Down Expand Up @@ -79,14 +81,29 @@

<constant name="env_safety" value="0.1*mm"/>

<!-- VTX parameters -->
<constant name="VertexClearanceTheta" value="0.110"/> <!-- Clearance of vertex detector in mrad-->
<constant name="VTXIB_r_clearance" value="1*mm"/> <!-- Clearance of vertex detector in radius, used for definiton of vertex DD4hep_SubdetectorAssembly -->
<constant name="VTXIB_r_min" value="13.7*mm"/> <!-- Start of inner vertex detector layers. To keep distance of 1.3 mm from outer beam pipe end (10+0.35+1+0.35 mm = 11.7 mm). This changes to 13.7 mm due to cooling issues (see https://indico.cern.ch/event/1176398/contributions/5207171/attachments/2581129/4451907/Krakow%202023_v23_final.pdf) -->
<constant name="VTXIB_r_max" value="31*mm"/> <!-- End of inner vertex detector layers (the ones with smaller pixels) -->
<constant name="VTXOB_r_min" value="320*mm"/> <!-- Start of outer vertex layers (the ones with larger pixels) -->
<constant name="VTXOB_r_max" value="340*mm"/> <!-- End of outer vertex layer (the one with larger pixels) -->
<constant name="Outer_Vertex_half_length" value="1050*mm"/>
<!-- Vertex detector. Changing the values here it not enough to resize the detector, contact expert (Armin Ilg) -->
<constant name="VertexClearanceTheta" value="0.1035*rad"/> <!-- Clearance of vertex detector in mrad from IP. !!!Too high currently, should be 110 mrad -> Need to adapt vertex disks!!! -->
<constant name="VTXIB_r_min_clearance" value="1.0*mm"/> <!-- Clearance of vertex detector in radius, used for definiton of vertex DD4hep_SubdetectorAssembly -->
<constant name="VTXIB_r_min_layer" value="13.7*mm"/> <!-- Start of inner vertex detector layers. To keep distance of 1.3 mm from outer beam pipe end (10+0.35+1+0.35 mm = 11.7 mm). This changes to 13.7 mm due to cooling issues (see https://indico.cern.ch/event/1176398/contributions/5207171/attachments/2581129/4451907/Krakow%202023_v23_final.pdf) -->
<constant name="VTXIB_r_max_layer" value="34.0*mm"/> <!-- Position of the outermost vertex inner barrel layer -->
<constant name="VTXIB_r_max" value="50.0*mm"/> <!-- End of inner vertex = outer radius of inner vertex tube -->
<constant name="VTXIB_half_length" value="556.2/2.*mm"/> <!-- 278.1*mm, half length of inner vertex tube -->

<constant name="VTXOB_r_min_layer" value="140*mm"/> <!-- R of the innermost layer of the outer vertex -->
<constant name="VTXOB_r_min_clearance" value="15.0*mm"/> <!-- Clearance of vertex detector in radius, used for definiton of vertex DD4hep_SubdetectorAssembly -->
<constant name="VTXOB_r_max_layer" value="315*mm"/> <!-- R of the outermost layer of the outer vertex -->
<constant name="VTXOB_rmax_clearance" value="15.0*mm"/> <!-- Clearance of vertex detector in radius, used for definiton of vertex DD4hep_SubdetectorAssembly -->

<constant name="VTXD_z_min" value="279.06*mm"/> <!-- Start of VTX disks in z -->
<constant name="VTXD_z_min_total" value="VTXD_z_min-1.5*cm"/> <!-- Outermost edge of VTX disks in z -->
<constant name="VTXD_z_max" value="918.641*mm"/> <!-- Outermost VTX disk in z -->
<constant name="VTXD_z_max_total" value="VTXD_z_max+4.5*cm"/> <!-- Outermost edge of VTX disk in z -->
<constant name="VTXD_r_min" value="34.5*mm"/> <!-- Start of VTX disks in r -->
<constant name="VTXD_r_max" value="315.0*mm"/> <!-- Start of VTX disks in r -->

<constant name="VTX_r_min" value="VTXIB_r_min_layer-VTXIB_r_min_clearance"/>
<constant name="VTX_r_max" value="VTXOB_r_max_layer+VTXOB_rmax_clearance"/>
<constant name="VTX_z_max" value="VTXD_z_max+4.5*cm"/>
<!-- End of VTX parameters -->

<!-- Drift Chamber parameters -->
Expand All @@ -96,6 +113,16 @@
<constant name="DCH_half_length_total" value=" 2250 * mm " />
<!-- End of Drift Chamber parameters -->

<!-- Silicon wrapper. Changing the values of the disk parameters is not enough, please contact the expert (Armin Ilg) -->
<constant name="SiWrB_inner_radius" value="2040*mm"/>
<constant name="SiWrB_outer_radius" value="2080*mm"/>
<constant name="SiWrB_half_length" value="2400*mm"/>
<constant name="SiWrD_inner_radius" value="350.0*mm"/>
<constant name="SiWrD_outer_radius" value="2040.0*mm"/>
<constant name="SiWrD_zmin" value="2300.0*mm"/>
<constant name="SiWrD_zmax" value="2340.0*mm"/>
<!-- End of Silicon Wrapper parameters -->

<!-- LAr ECAL Calo Barrel -->
<constant name="BarECal_id" value="DetID_ECAL_Barrel"/>
<constant name="BarECal_rmin" value="2100*mm"/>
Expand Down Expand Up @@ -213,18 +240,16 @@
</limits>
<regions>
<region name="BeampipeRegion"/>
<region name="VTXIBRegion"/>
<region name="VTXOBRegion"/>
<region name="VTXBRegion"/>
<region name="VTXDRegion"/>
<region name="SiWrapperBRegion"/>
<region name="SiWrapperDRegion"/>
<region name="SiWrBRegion"/>
<region name="SiWrDRegion"/>
</regions>


<display>
<vis name="VXDVis" alpha="0.1" r="0.1" g=".5" b=".5" showDaughters="true" visible="false"/>
<vis name="VXDLayerVis" alpha="1.0" r="0.1" g=".5" b=".5" showDaughters="true" visible="true"/>
<vis name="VXDSupportVis" alpha="1.0" r="0.0" g="1.0" b="0.0" showDaughters="true" visible="true"/>
<vis name="VXDVis" alpha="0.2" r="0.1" g=".5" b=".5" showDaughters="true" visible="true"/>
<vis name="SiWrVis" alpha="0.2" r="1.0" g="1.0" b="0.0" showDaughters="false" visible="true"/>
<vis name="ITVis" alpha="1.0" r="0.54" g="0.43" b="0.04" showDaughters="true" visible="true"/>
<vis name="OTVis" alpha="1.0" r="0.8" g="0.8" b="0.4" showDaughters="true" visible="false"/>
<vis name="ECALVis" alpha="1.0" r="0.2" g="0.6" b="0" showDaughters="true" visible="true"/>
Expand Down
8 changes: 7 additions & 1 deletion FCCee/ALLEGRO/compact/ALLEGRO_o1_v03/ECalEndcaps_Turbine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
<constant name="ECalEndcapNumPlanes" value="928"/>
<constant name="ECalEndcapNumCalibLayers" value="10"/>
<constant name="nWheels" value="3" />
<!-- following three lines just to satisfy new segmentation interface -->
<constant name="BladeAngle1" value="41*deg" />
<constant name="BladeAngle2" value="41*deg" />
<constant name="BladeAngle3" value="41*deg" />

<constant name="BladeAngle" value="41*deg" />
<constant name="NobleLiquidGap" value="3.9*mm" />
<constant name="AbsorberBladeThickness" value="2.9*mm" />
Expand All @@ -51,6 +56,7 @@
<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"/>
<constant name="nUnitCellsLeastCommonMultiple" value="78336"/>
</define>

<display>
Expand Down Expand Up @@ -108,7 +114,7 @@
<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">
<turbineBlade name="turbineBlade" angle="BladeAngle" decreaseAnglePerWheel="false" sameNUnitCells="false" nUnitCells="144 272 512" nUnitCellsLeastCommonMultiple="nUnitCellsLeastCommonMultiple">
<absorberBlade name="absorberBlade" thickness="AbsorberBladeThickness" scaleThickness="true" thicknessScaleFactor="1.0" sensitive="false">
<material name="Lead" />
</absorberBlade>
Expand Down
Loading

0 comments on commit 0951225

Please sign in to comment.