-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved GFlash and Geant4 fast simulation handling #933
Improved GFlash and Geant4 fast simulation handling #933
Conversation
@andresailer In the Geant4Sensitives: Is it a good idea to have G4Step as a "const" object? |
Rebase failed
@MarkusFrankATcernch If it compiles without a const_cast, I don't see a reason not to leave it const. The SensitiveDetectors shouldn't modify the G4Step. |
…e same sensitive actions as fast simulation
…e same sensitive actions as fast simulation
…e same sensitive actions as fast simulation
f0732f8
to
b3a9e57
Compare
@EnginEren |
Hi @MarkusFrankATcernch, thanks. I'll let you know when I have updates |
Hi Markus, I cloned and build master version of mkdir build
cd build
cmake ..
...
CMake Error at examples/ClientTests/CMakeLists.txt:216 (if):
if given arguments:
"VERSION_GREATER" "10.2.99"
Unknown arguments specified
I'm currently lacking the knowledge how to run/test GFlash and FastSim Cheers, |
Hi Engin,
would fail. |
That's weird.. -bash-4.2$ geant4-config --version
10.7.2 it comes from LCG101 |
Hmm. I have also built against LCG 101. I get the same output, but it seems to build:
I followed the build commands on the dd4hep page:
|
hmm.. I can also build the dd4hep. There is no problem. Based on the user guide: $ git clone https://github.com/AIDASoft/DD4hep.git
$ cd DD4hep
$ source /cvmfs/sft.cern.ch/lcg/views/LCG_101/x86_64-centos7-gcc11-opt/setup.sh
$ mkdir build
$ cd build
$ cmake -DDD4HEP_USE_GEANT4=ON -DBoost_NO_BOOST_CMAKE=ON -DDD4HEP_USE_LCIO=ON -DBUILD_TESTING=ON -DGeant4_DIR=G4INSTALL/lib64/Geant4-10.7.2 -DROOT_DIR=$ROOTSYS -DDD4HEP_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release ..
$ make
$ make install
$ cd ..
$ source bin/thisdd4hep.sh but I cannot build the |
I continue then aftwards simply like this:
This works fine for me. |
As required by dd4hep v1-21 (changed in AIDASoft/DD4hep#933)
Some sensitive detectors, e.g. Geant4OpticalCalorimeterAction, kill the incident optical photon and absorb the energy completely. See e.g. This is failing in our EIC code for the exact same reason (but in a PMT detector SD action that absorbs the optical photon). |
BEGINRELEASENOTES
The fast simulation handling in Geant4 includes the GFlash interface
as implemented in
<geant40-source>/source/parameterisations/gflash
and a fast simulation interface as provided by
<geant40-source>/source/processes/parameterisation
This MR allows to handle both mechanisms using the same callbacks
in the Geant4SensitiveActions using the callback specialization:
in addition to the regular callback for full simulation:
The
Geant4FastSimSpot
is inspired by theG4GFlashSpot
, but avoids the specialization towards GFlashgiven that the
G4FastHit
and theG4GFlashEnergySpot
are equivalent.Together with the helper class
Geant4FastSimHandler
simple sensitive detector callbackscan be implemented like:
Callbacks with this signature are called both for GFlash and the G4 fast simulation.
To simplify the user defined construction of fast simulation shower models
the helper class
Geant4FastSimShowerModel
is implemented as aGeant4Action
and hence allows to have options to be set by the user (including python).
As an illustration two fast simulation shower models were implemented in
<dd4hep>/DDG4/plugins/Geant4P1ShowerModel.cpp
which were directly deducedfrom the Geant4 example
<geant4-source>/examples/extended/parameterisations/Par01
.Please see the source files for details.
To execute GFlash or fast simulation to simple python examples are provided
using simple silicon blocks as sensitive volumes:
<dd4hep-dir>/examples/ClientTests/scripts/SiliconBlockGFlash.py
<dd4hep-dir>/examples/ClientTests/scripts/SiliconBlockFastSim.py
To enable either the following actions are required:
This step is identical for GFlash and fast simulation physics.
2. Enable the shower mode:
Here the options must be set according to the parameters required by the shower models.
The G4 fast simulation interface is only functional for Geant4 version >= 10.07.
For lower versions of Geant4 missing classes are stubbed to allow the compilation.
ENDRELEASENOTES