From 2068230c56da343456d6aa89a1901fa98e69ffbb Mon Sep 17 00:00:00 2001 From: Alvaro Tolosa Delgado Date: Fri, 26 Jul 2024 15:43:43 +0200 Subject: [PATCH 1/3] add ddsim steering file for CLD o3 (with ARC) --- CLDConfig/cld_arc_steer.py | 65 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 CLDConfig/cld_arc_steer.py diff --git a/CLDConfig/cld_arc_steer.py b/CLDConfig/cld_arc_steer.py new file mode 100644 index 0000000..52efa54 --- /dev/null +++ b/CLDConfig/cld_arc_steer.py @@ -0,0 +1,65 @@ +# +# Copyright (c) 2014-2024 Key4hep-Project. +# +# This file is part of Key4hep. +# See https://key4hep.github.io/key4hep-doc/ for further info. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# File: cld_arc_steer.py +# Description: this file extends the ddsim steering file used for CLD +# with the specifications to run the ARC subdetector + +# First, load cld steering file + +from cld_steer import * +# change the compact file to the CLD option 3 (which contains ARC) +SIM.compactFile = os.environ["K4GEO"]+"/FCCee/CLD/compact/CLD_o3_v01/CLD_o3_v01.xml" + +# Second, define specifications for ARC: + +# Register optical physics and Cerenkov process to the default physics +def setupCerenkov(kernel): + from DDG4 import PhysicsList + + seq = kernel.physicsList() + cerenkov = PhysicsList(kernel, "Geant4CerenkovPhysics/CerenkovPhys") + cerenkov.MaxNumPhotonsPerStep = 10 + cerenkov.MaxBetaChangePerStep = 10.0 + cerenkov.TrackSecondariesFirst = False + cerenkov.VerboseLevel = 0 + cerenkov.enableUI() + seq.adopt(cerenkov) + ph = PhysicsList(kernel, "Geant4OpticalPhotonPhysics/OpticalGammaPhys") + ph.addParticleConstructor("G4OpticalPhoton") + ph.VerboseLevel = 0 + ph.BoundaryInvokeSD = True + ph.enableUI() + seq.adopt(ph) + return None +SIM.physics.setupUserPhysics(setupCerenkov) + +# Associate the Geant4OpticalTrackerAction to these detectors +# this action register total energy of the opt photon as a single hit +# and kills the optical photon, so no time is wasted tracking them +SIM.action.mapActions["ARCBARREL"] = "Geant4OpticalTrackerAction" +SIM.action.mapActions["ARCENDCAP"] = "Geant4OpticalTrackerAction" + +# Define filter, so detector is only sensitive to optical photons +SIM.filter.filters["opticalphotons"] = dict( + name="ParticleSelectFilter/OpticalPhotonSelector", + parameter={"particle": "opticalphoton"}, + ) +SIM.filter.mapDetFilter["ARCBARREL"] = "opticalphotons" +SIM.filter.mapDetFilter["ARCENDCAP"] = "opticalphotons" + From 80dd39b71e46c43ed4466c471f1fe57f3575344a Mon Sep 17 00:00:00 2001 From: Alvaro Tolosa Delgado Date: Fri, 26 Jul 2024 16:24:01 +0200 Subject: [PATCH 2/3] add test for ddsim steering file for CLD o3 (with ARC) --- test/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 84a5a2c..fce9fcc 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -26,6 +26,11 @@ add_test(NAME ddsim_lcio COMMAND ddsim -S cld_steer.py -N 3 --inputFile ../test/yyxyev_000.stdhep --outputFile test.slcio --compactFile ${DETECTOR} ) +add_test(NAME ddsim_cld_arc + WORKING_DIRECTORY ${CLDConfig_DIR} + COMMAND ddsim -S cld_arc_steer.py -N 10 -G --gun.direction "1 0 0" +) + # FIXME: need to call k4run from CLDConfig dir where the pandora config lives add_test(NAME lcio_input WORKING_DIRECTORY ${CLDConfig_DIR} From cd577fcc85005f6cf9155d64d58160cfd64cbc49 Mon Sep 17 00:00:00 2001 From: Alvaro Tolosa Delgado Date: Fri, 26 Jul 2024 16:29:49 +0200 Subject: [PATCH 3/3] fix error in pre-commit check --- CLDConfig/cld_arc_steer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CLDConfig/cld_arc_steer.py b/CLDConfig/cld_arc_steer.py index 52efa54..32147ff 100644 --- a/CLDConfig/cld_arc_steer.py +++ b/CLDConfig/cld_arc_steer.py @@ -15,10 +15,12 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# # File: cld_arc_steer.py # Description: this file extends the ddsim steering file used for CLD # with the specifications to run the ARC subdetector +# # First, load cld steering file @@ -62,4 +64,3 @@ def setupCerenkov(kernel): ) SIM.filter.mapDetFilter["ARCBARREL"] = "opticalphotons" SIM.filter.mapDetFilter["ARCENDCAP"] = "opticalphotons" -