CALICESiWTB
A Geant4 simulation of the CALICE SiW calorimeter beam tests.
Table of Contents
Project description
The project targets a standalone Geant4 simulation of the CALICE SiW calorimeter beam tests to perform Geant4 regression testing, physics lists comparison and validation against test-beam data.
- ⏰ Start date: 17 February 2022
- 📌 Status: under development
- ❕ DO NOTE: A first implementation was provided by Katalin Nikolics around 2018, the code is available in GitLab ( restricted link ). This repo is an adaptation of it aiming to produce results with the same level of accuracy while reducing the code to a Geant4 advanced example.
- :page_facing_up: Citation: if you want to use the code read the LICENSE and cite
Authors and contacts
- 👨🔬 Lorenzo Pezzotti (CERN EP-SFT) - lorenzo.pezzotti@cern.ch
- 👨🔬 Supervisor: Alberto Ribon (CERN EP-SFT)
- 👩🔬 Katalin Nikolics (CERN EP-SFT)
Documentation and results
Selected articles
- :page_facing_up: Pezzotti, L.; Kiryunin, A.; Konstantinov, D.; Ribon, A.; Strizenec, P.; on behalf of the Geant4 Collaboration. Including Calorimeter Test Beams in Geant-val—The Physics Validation Testing Suite of Geant4. Instruments 2022, 6, 41.
Selected presentations
- 🗣️ CERN EP-SFT Group Meeting, End of Fellowship Report
- 🗣️ 11th BTTB Workshop 19/4/2023, Geant4 Validation on Test-Beam Calorimetry Data
- 🗣️ Geant4 Collaboration Meeting 28/9/2022, Physics validation of Geant4 via calorimeter test-beams
- 🗣️ CALOR2022 17/5/2022, Including calorimeter test-beams into geant-val
- 🗣️ CERN EP-SFT Group Meeting 2/5/2022, Highlights from recent Geant4 validation on test-beam data
- 🗣️ CERN EP-SFT Simulation Group Meeting 26/4/2022, Physics lists’ comparison and regression testing on CALICE SiW data
- 🗣️ CALICE Collaboration Meeting, Valencia 21/4/2022, CALICE prototypes beam tests integration into Geant-val
- 🗣️ CERN EP-SFT Simulation Group Meeting 22/3/2022, Validation on the CALICE SiW calorimeter beam test (first test, first results)
Geant Val integration
Geant Val is the Geant4 testing and validation suite. It is a project hosted on gitlab.cern.ch used to facilitate the maintenance and validation of Geant4 applications, referred to as tests.
The following are instructions to use CALICESiWTB within Geant Val, from batch submission to website deployment.
- On lxplus git clone ATLHECTB and the Geant Val/geant-config-generator
git clone git@github.com:lopezzot/CALICESiWTB.git git clone ssh://git@gitlab.cern.ch:7999/GeantValidation/geant-config-generator.git
- Copy the CALICESiWTB geant val scripts into tests/geant4/; cd geant-config-generator
Note that file inside
cp -r CALICESiWTB/geantval_scripts/CALICESiWTB/ geant-config-generator/tests/geant4/ cd geant-config-generator
tests/geant/CALICESiWTB/files/
will be used by Geant Val for execution and data analysis. - We will execute CALICESiWTB via Geant Val using Geant4.10.7.p03, therefore we must make sure file
10.7.p03.sh
exists intoconfigs/geant/
. In file10.7.p03.sh
we also export the path to the CALICESiWTB 10.7.p03 executable file (for instruction on how to compile CALICESiWTB see How to: Build, compile and execute on lxplus).
Hence10.7.p03.sh
looks like this:#!/bin/bash VERSION="10.7.p03" PLATFORM="x86_64-centos7-gcc8-optdeb" # Geant4 libraries source /cvmfs/geant4.cern.ch/geant4/$VERSION/${PLATFORM}/bin/geant4.sh [ -e /cvmfs/geant4.cern.ch/geant4/$VERSION/setup_g4datasets.sh ] && source/cvmfs/geant4.cern.ch/geant4/$VERSION/setup_g4datasets.sh # Test path export PATH="/cvmfs/geant4.cern.ch/opt-geant-val/$VERSION/$PLATFORM/bin:/cvmfs/geant4.cern.ch/opt/$VERSION/$PLATFORM/bin:$PATH:/afs/cern.ch/work/l/lopezzot/Fellow/CALICE/geantval/build/" # Compiler source /cvmfs/sft.cern.ch/lcg/contrib/gcc/8/x86_64-centos7/setup.sh # Externals #export LD_LIBRARY_PATH="/cvmfs/sft.cern.ch/lcg/releases/LCG_88/ROOT/6.08.06/x86_64-centos7-gcc62-opt/lib:/cvmfs/sft.cern.ch/lcg/releases/LCG_88/qt5/5.6.0/x86_64-centos7-gcc62-opt/lib/:/cvmfs/sft.cern.ch/lcg/releases/LCG_88/hdf5/1.8.18/x86_64-centos7-gcc62-opt/lib/:$LD_LIBRARY_PATH"
- Create macros and metadata for Geant Val execution
this command creates the Geant Val files for batch submission using HTCondor under the
python mc-config-generator.py submit -t CALICESiWTB -d OUTPUT -v 10.7.p03 -q "testmatch" -r
OUTPUT
folder, using CALICESiWTB, Geant4.10.7.p03 and thetestmatch
job flavour. - To monitor the jobs use
When the job execution ends, the root output files are stored in the corresponding job folder.
python mc-config-generator.py status -t CALICESiWTB -d OUTPUT
- Execute the analysis on the root files in the
OUTPUT
folder to create Geant Val JSON output filesthe analysis is coded inpython mc-config-generator.py parse -t CALICESiWTB -d OUTPUT
tests/geant4/CALICESiWTB/parser.py
and in the root macros stored in each job folder. TheOUTPUTJSON
folder is created with the corresponding JSON files. - The last part is to deploy the results on Geant Val. The CALICESiWTB layout on the Geant Val website is defined in the
CALICESiWTB.xml
file ongitlab.com/thegriglat/geant-val-layouts
(additional info are in thetags.json
file).
Deploy JSON files on the Geant Val databasefind . -name '*.json' | while read i; do curl -H "Content-Type: application/json" -H "token: askauthor" --data @$i https://geant-val.cern.ch/upload; echo; done
List of results on Geant Val
The following are results deployed on Geant Val so far. A copy of the used config files is stored in geantval_scripts/configs/
.
Geant-Val-Results-Table
CALICESiWTB | Reproduce data | Reproduce analysis | Comments |
---|---|---|---|
v1.2 Dataset #1 tag 1.2_1 (Geant4.11.2.p01 FTFP_BERT(+tune1,2,3), FTFP_INCLXX, QGSP_BERT) Added on 10/4/2024 |
python mc-config-generator.py submit -t CALICESiWTB -d OUTPUT -v version -q "testmatch" -r | python mc-config-generator.py parse -t CALICESiWTB -d OUTPUT | Produced with new el9 machines on lxplus. |
v1.1 Dataset #1 tag 1.1_1 (Geant4.11.0.p04 FTFP_BERT, FTFP_INCLXX, QGSP_BERT) (Geant4.11.1.p01 FTFP_BERT(+tune_1,2,3), FTFP_INCLXX, QGSP_BERT) Added on 3/5/2023 |
python mc-config-generator.py submit -t CALICESiWTB -d OUTPUT -v version -q "testmatch" -r | python mc-config-generator.py parse -t CALICESiWTB -d OUTPUT | Nothing. |
v1.0 Dataset #2 tag 1.0_2 (Geant4.10.06.p03, Geant4.10.5.p01, Geant4.10.4.p01, CALICESiWTB v1.0, FTFP_BERT, FTFP_INCLXX, QGSP_BERT) Added on 16/4/2022 |
python mc-config-generator.py submit -t CALICESiWTB -d OUTPUT -v version -q "testmatch" -r | python mc-config-generator.py parse -t CALICESiWTB -d OUTPUT | Results for three Geant4 versions, three physics list. Results for 10.5.p01 and 10.4.p01 obtained in single thread mode. |
v1.0 Dataset #1 tag 1.0_1 (Geant4.10.07.p03, CALICESiWTB v1.0, FTFP_BERT, FTFP_INCLXX, QGSP_BERT) Added on 14/4/2022 |
python mc-config-generator.py submit -t CALICESiWTB -d OUTPUT -v 10.7.p03 -q "testmatch" -r | python mc-config-generator.py parse -t CALICESiWTB -d OUTPUT | Results for one Geant4 versions, three physics list. Results for experiment included as well, use last parser part for it. |
Available datasets and analyses
We provide datasets and ROOT analyses, as well as instructions for their reproducibility. Ask authors for access to datasets.
Results-Table
CALICESiWTB | Reproduce data | Reproduce analysis | Comments |
---|---|---|---|
v0p4 Dataset #1 tag 0p4_1 |
Geant4.10.07.p03 CALICESiWTB v0p4 ./CALICESiWTB run_pi-_x_GeV.mac FTFP_BERT #nThreads x = 2, 4, 6, 8, 10 using FTFP_BERT physics list |
root -l MyLongitudinalPlots.C |
Analysis reproducable with analysis/v0.4/MyLongitudinalPlots.C macro assuming Data0p4_1/ is alongside root macro. New results on pion energy and hit longitudinal distributions. Prepared for the CALICE Collaboration Meeting April 2022. |
v0p3 Dataset #1 tag 0p3_1 |
Geant4.10.07.p03 CALICESiWTB v0p3 ./CALICESiWTB run_pi-_x_GeV.mac x = 2, 4, 6, 8, 10 FTFP_BERT implicit physics list |
root -l MyLongitudinalPlots.C |
Analysis reproducable with analysis/v0.3/MyLongitudinalPlots.C macro assuming Data0p3_1/ is alongside root macro. First results on pion energy longitudinal distributions, shown at presentation on 22/03/2022. |
How to
Build, compile and execute on Mac/Linux
- git clone the repo
git clone https://github.com/lopezzot/CALICESiWTB.git
- source Geant4 env
source /relative_path_to/geant4.10.07_p01-install/bin/geant4.sh
- cmake build directory and make (using geant4.10.07_p01)
mkdir CALICESiWTB-build; cd CALICESiWTB-build/ cmake -DGeant4_DIR=/absolute_path_to/geant4.10.07_p01-install/lib/Geant4-10.7.1/ relative_path_to/CALICESiWTB/ make
- execute (example with
run_pi-_2GeV.mac
macro card, FTFP_BERT physics list and 2 threads)./CALICESiWTB run_pi-_2GeV.mac FTFP_BERT 2
- Parser options: argv[1] a Geant4 macro card, argv[2] the physics list (optional, default FTFP_BERT), argv[3] number of threads
- It is possible to select alternative FTF tunings with PL_tuneID (example FTFP_BERT_tune1) [only for Geant4-11.1.0 or higher]
Build, compile and execute on lxplus
- git clone the repo
git clone https://github.com/lopezzot/CALICESiWTB.git
- cmake build directory and make (using geant4.10.07_p03, check for gcc and cmake dependencies for other versions)
Hint: cp and source the scripts/CALICESiWTB_lxplus_10.7.p03.sh file in the build directory.
mkdir CALICESiWTB-build; cd CALICESiWTB-build/ source /cvmfs/sft.cern.ch/lcg/contrib/gcc/8.3.0/x86_64-centos7/setup.sh source /cvmfs/geant4.cern.ch/geant4/10.7.p03/x86_64-centos7-gcc8-optdeb-MT/CMake-setup.sh export CXX=`which g++` export CC=`which gcc` cmake3 -DGeant4_DIR= /cvmfs/geant4.cern.ch/geant4/10.7.p03/x86_64-centos7-gcc8-optdeb-MT/lib64/Geant4-10.7.3 ../CALICESiWTB/ make
- execute (example 2 GeV pi- macro card, FTFP_BERT physics list and 2 threads)
./CALICESiWTB run_pi-_2GeV.mac FTFP_BERT 2
Submit a job with HTCondor on lxplus
- git clone the repo
git clone https://github.com/lopezzot/CALICESiWTB.git
- prepare execution files (example with Geant4.10.07_p03, 2 GeV pi- macro, 2 threads, FTFP_BERT physics list)
mkdir CALICESiWTB-build; cd CALICESiWTB-build mkdir error log output cp ../CALICESiWTB/scripts/CALICESiWTB_lxplus_10.7.p03.sh . source CALICESiWTB_lxplus_10.7.p03.sh
- prepare for HTCondor submission (example with Geant4.10.07_p03, 2 GeV pi- macro, 2 threads, FTFP_BERT physics list)
cp ../CALICESiWTB/scripts/CALICESiWTB_HTCondor_10.7.p03.sh . export MYHOME=`pwd` echo cd $MYHOME >> CALICESiWTB_HTCondor_10.7.p03.sh echo $MYHOME/CALICESiWTB run_pi-_2GeV.mac FTFP_BERT 2 >> CALICESiWTB_HTCondor_10.7.p03.sh cp ../CALICESiWTB/scripts/CALICESiWTB_HTCondor.sub . sed -i '1 i executable = CALICESiWTB_HTCondor_10.7.p03.sh' CALICESiWTB_HTCondor.sub
- submit a job
condor_submit CALICESiWTB_HTCondor.sub
My quick Geant4 installation
Here is my standard Geant4 installation (example with Geant4.10.7.p01) starting from the unpacked geant4.10.07.tar.gz file under the example path "path/to".
- create build directory alongside source files
cd /path/to mkdir geant4.10.07-build cd geant4.10.07-build
- link libraries with CMAKE (example with my favourite libraries)
cmake -DCMAKE_INSTALL_PREFIX=/Users/lorenzo/myG4/geant4.10.07_p01-install \ -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_QT=ON -DGEANT4_BUILD_MULTITHREADED=ON \ -DGEANT4_USE_GDML=ON ../geant4.10.07.p01
- make it
make -jN make install