-
Notifications
You must be signed in to change notification settings - Fork 115
Description
While trying to answer a question in a DD4hepTutorial repo we have, about how to apply the limits for the max step_length in dd4hep, I came across the problem of applying the limits set in <limits> to neutral particles.
In the calorimeter example below (see repoducer), the custom sensitive action prints a warning if the step length is above the limit.
Using particles="*" does not apply the limit to gammas, which is fine I guess if the default behaviour is applying this to charged particles only. But based on this Geant4 forum entry, in Geant4 there is an extra flag to set the limits for neutral particles as well. And after a bit of digging in the dd4hep code, I could not find an equivalent in dd4hep, but maybe I missed something.
Also, the limit is also not applied when explicitly using <limit name="step_length_max" particles="gamma" value="0.5" unit="mm" />.
So my question is how to apply the limits to neutral particles as well?
Right now, there is no specific physics reason why I want to know, this is purely of interest and to answer the original user's question.
Performance-wise it probably makes sense to have particles="*" not apply to neutral particles, but given there is a way to do this in Geant4, users might want to do this in dd4hep as well.
Reproducer
To reproduce:
source /cvmfs/sw.hsf.org/key4hep/setup.sh
git clone https://github.com/s6anloes/DD4hepTutorialsTest.git
cd DD4hepTutorialsTest
mkdir build install
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install -Wno-dev
make install -j 8
cd ..
k4_local_repo
ddsim --steeringFile simplecalo2/sc2SteeringFile.py -N 1