Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • tsulaia/GeoModel
  • sroe/GeoModel
  • todorova/GeoModel
  • evc/GeoModel
  • pagessin/GeoModel
  • nstyles/GeoModel
  • ncalace/GeoModel
  • mnovak/GeoModel
  • whopkins/GeoModel
  • ssnyder/GeoModel
  • japost/GeoModel
  • asalzbur/GeoModel
  • akraszna/GeoModel
  • amadio/GeoModel
  • dcasperfaser/GeoModel
  • faser/offline/GeoModel
  • bmorgan/GeoModel
  • rbianchi/GeoModel
  • dcasper/GeoModel
  • GeoModelDev/GeoModel
20 results
Select Git revision
Show changes
Commits on Source (982)
Showing with 3653 additions and 478 deletions
......@@ -3,5 +3,7 @@
*.swp
*.swo
# VSCode-related files and folders
build
.vscode
install
This diff is collapsed.
[submodule "ATLASExtensions"]
path = ATLASExtensions
url = ../../atlas/geomodelatlas/ATLASExtensions.git
Subproject commit 91e64f107d822e601e8dbe5190031845236124eb
......@@ -13,3 +13,5 @@ brew "boost"
brew "nlohmann-json"
brew "xerces-c"
brew "eigen"
brew "hdf5"
brew "hepmc3"
## Docker file to compile the very basic
## packages needed for GeoModel in order to avoid
## their duplication in the creation step of the
## Light and Full version
FROM ubuntu:20.04
USER root
WORKDIR /root
ARG XercesC_VERSION=3.2.3
ENV DEBIAN_FRONTEND noninteractive
### Install tzdata package
### During ordinary installation, the package
### wants to be configured. The additional commands
### circumvene the configuration on docker
RUN apt-get update && apt-get install -y tzdata && ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && dpkg-reconfigure --frontend noninteractive tzdata
### Install C++, cmake and python
RUN apt-get update && apt-get install -y cmake g++ python git sudo nano wget
### Boost installation
RUN apt-get update && apt-get install -y libboost-all-dev
### Now we come to QT5 as a prerequiste of GeoModel
RUN apt-get update && apt-get install -y qt5-default qt5-qmake qtbase5-dev-tools qt5-doc
### Next install sqlite for the GeoModel outputs
RUN apt-get update && apt-get install -y sqlite3 libsqlite3-dev
### Install eigen to avoid the own installation
RUN apt-get update && apt-get install -y libeigen3-dev
### Another layer of building xer
RUN wget https://cern.ch/lcgpackages/tarFiles/sources/xerces-c-${XercesC_VERSION}.tar.gz && \
tar -xzf xerces-c-${XercesC_VERSION}.tar.gz && \
mkdir build && \
cd build && \
cmake ../xerces-c-${XercesC_VERSION} && \
make -j2 && \
make install && \
cd .. && \
rm -rf xerces-c-${XercesC_VERSION} build
### Last but very important, the installation of the OpenGL module
RUN apt-get update && apt-get install -y mesa-utils build-essential libgl1-mesa-dev
# Set up the ATLAS user, and give it super user rights.
RUN addgroup wheel && \
echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \
adduser atlas && chmod 755 /home/atlas && \
usermod -aG wheel atlas && \
usermod -aG root atlas && \
mkdir /workdir && chown "atlas:atlas" /workdir && \
chmod 755 /workdir
USER atlas
WORKDIR /workdir
# Setup the most basic image
ARG BASEIMAGE=gitlab-registry.cern.ch/geomodeldev/geomodel:master-base
ARG BASEIMAGE=gitlab-registry.cern.ch/geomodeldev/ubuntu-geant4-image:main-base
FROM ${BASEIMAGE}
### First install Geant4 as we want to have the full functionallity
RUN git clone https://gitlab.cern.ch/geant4/geant4.git --branch 'v10.6.0' && \
mkdir build_geant4 && \
cd build_geant4 && \
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/geant4 -DCMAKE_BUILD_TYPE=Release -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_GDML=ON -DGEANT4_BUILD_MULTITHREADED=ON ../geant4/ &&\
make -j3 > /dev/null && \
sudo make install > /dev/null && \
cd .. && \
rm -rf build_geant4 geant4 && \
echo "#!/bin/bash" > ~/setup_docker.sh && \
echo "cd /usr/local/geant4/bin" >> ~/setup_docker.sh && \
echo "source geant4.sh" >> ~/setup_docker.sh && \
echo "cd -" >> ~/setup_docker.sh && \
sudo mv ~/setup_docker.sh /usr/local/geant4/setup_docker.sh && \
echo "source /usr/local/geant4/setup_docker.sh" >> ~/.bashrc
### Compile then geo model
COPY . /workdir/GeoModel_src/
### Compile GeoModel
COPY . /workdir/GeoModel_src/
RUN mkdir -p /workdir/build_geomodel/ && \
cd /workdir/build_geomodel/ && \
. ~/.bashrc && \
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/GeoModel -DGEOMODEL_BUILD_FULLSIMLIGHT=1 -DGEOMODEL_BUILD_VISUALIZATION=1 -DGEOMODEL_USE_BUILTIN_JSON=1 -DGEOMODEL_BUILD_TOOLS=1 -DGEOMODEL_USE_BUILTIN_XERCESC=0 -DGEOMODEL_USE_BUILTIN_COIN3D=1 ../GeoModel_src/ && \
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/GeoModel \
-DGEOMODEL_BUILD_FULLSIMLIGHT=1 \
-DGEOMODEL_BUILD_VISUALIZATION=1 \
-DGEOMODEL_USE_BUILTIN_JSON=1 \
-DGEOMODEL_BUILD_TOOLS=1 \
-DGEOMODEL_USE_BUILTIN_XERCESC=0 \
-DGEOMODEL_USE_BUILTIN_COIN3D=1 \
-DGEOMODEL_BUILD_ATLASEXTENSIONS=1 \
../GeoModel_src/ && \
make -j2 && \
sudo make install && \
cd .. && \
......
# Setup the most basic image
ARG BASEIMAGE=gitlab-registry.cern.ch/geomodeldev/geomodel:master-base
FROM ${BASEIMAGE}
COPY . /workdir/GeoModel_src/
RUN mkdir -p /workdir/build_geomodel/ && \
cd /workdir/build_geomodel/ && \
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/GeoModel -DGEOMODEL_BUILD_VISUALIZATION=1 -DGEOMODEL_USE_BUILTIN_JSON=1 -DGEOMODEL_BUILD_TOOLS=1 -DGEOMODEL_USE_BUILTIN_XERCESC=1 -DGEOMODEL_USE_BUILTIN_COIN3D=1 ../GeoModel_src/ && \
make -j2 && \
sudo make install && \
cd .. && \
sudo rm -rf build_geomodel GeoModel_src && \
echo "#!/bin/bash" > ~/setup_docker.sh && \
echo "export PATH=\"/usr/local/GeoModel/bin:\${PATH}\"" >> ~/setup_docker.sh && \
echo "export LD_LIBRARY_PATH=\"/usr/local/GeoModel/lib:\${LD_LIBRARY_PATH}\"" >> ~/setup_docker.sh && \
sudo mv ~/setup_docker.sh /usr/local/GeoModel/setup_docker.sh && \
echo "source /usr/local/GeoModel/setup_docker.sh" >> ~/.bashrc
#!/bin/bash
echo "Compile GeoModelCore with flags: "
echo " **** CMAKE_CONFIG_FLAGS: ${CMAKE_CONFIG_FLAGS}"
echo " **** CMAKE_EXTRA_FLAGS: ${CMAKE_EXTRA_FLAGS}"
if [ -z "${SOURCE_DIR}" ]; then
SOURCE_DIR="${PWD}"
fi
echo "SOURCE_DIR=\"${SOURCE_DIR}\""
echo "BUILD_DIR=\"${CI_PROJECT_DIR}/../build\""
echo "INSTALL_DIR=\"${CI_PROJECT_DIR}/install\""
BUILD_DIR="${CI_PROJECT_DIR}/../build"
INSTALL_DIR="${CI_PROJECT_DIR}/install"
mkdir -p ${BUILD_DIR}
mkdir -p ${INSTALL_DIR}
ls -lh ${INSTALL_DIR}
echo "mkdir -p ${BUILD_DIR}"
echo "mkdir -p ${INSTALL_DIR}"
cd ${BUILD_DIR}
echo "cd ${BUILD_DIR}"
export LD_LIBRARY_PATH="${INSTALL_DIR}/lib:${LD_LIBRARY_PATH}"
export ROOT_INCLUDE_PATH="${INSTALL_DIR}/include:${ROOT_INCLUDE_PATH}"
export PATH="${INSTALL_DIR}/bin:${PATH}"
echo "export LD_LIBRARY_PATH=\"${INSTALL_DIR}/lib:${LD_LIBRARY_PATH}\""
echo "export ROOT_INCLUDE_PATH=\"${INSTALL_DIR}/include:${ROOT_INCLUDE_PATH}\""
echo "export PATH=\"${INSTALL_DIR}/bin:${PATH}\""
echo "cmake ${CMAKE_CONFIG_FLAGS} \
-DCMAKE_CXX_FLAGS=\"${CMAKE_EXTRA_FLAGS}\" \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
${SOURCE_DIR}"
cmake ${CMAKE_CONFIG_FLAGS} \
-DCMAKE_CXX_FLAGS="${CMAKE_EXTRA_FLAGS}" \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
${SOURCE_DIR}
result=$?
if [ ${result} -ne 0 ];then
echo "Cmake failed"
exit 1
fi
make -j4
result=$?
if [ ${result} -ne 0 ];then
echo "Compilation failed"
exit 1
fi
make install
result=$?
if [ ${result} -ne 0 ];then
echo "Installation failed"
exit 1
fi
ls -lh ${INSTALL_DIR}
# GitLab API examples for GeoModel
**NOTE:** Here below, `95156` is the ID of the GeoModel project on the CERN GitLab installation. You can find the ID of your project by looking at the main page of your GitLab repository, you'll find the ID under the name of the repository.
**NOTE:** Being the GeoModel respoitory public, we don't need authorization. If your project is not public, you need to pass a variable in the header. Please [see this post](https://stackoverflow.com/a/59949488/320369) for an example.
But please notice, to get CI **jobs** through the API, you need at least a Personal Access Token, even if the repository is fully public.
[TOC]
## Tags
### Get the list of tags
```
curl "https://gitlab.cern.ch/api/v4/projects/95156/repository/tags/"
```
### Get the name of the latest tag
```
curl -Ss --request GET "https://gitlab.cern.ch/api/v4/projects/95156/repository/tags" | jq -r '.[0] | .name'
```
### Get the commit hash of the latest tag
```
curl -Ss --request GET "https://gitlab.cern.ch/api/v4/projects/95156/repository/tags" | jq -r '.[0] | .commit.id'
```
## Pipelines
Given the GeoModel project ID: 95156, get all the latest pipelines:
......@@ -16,22 +43,22 @@ The answer is:
...
```
Get only the pipelines for branch `master`:
Get only the pipelines for branch `main`:
```
curl "https://gitlab.cern.ch/api/v4/projects/95156/pipelines?ref=master"
curl "https://gitlab.cern.ch/api/v4/projects/95156/pipelines?ref=main"
```
Get only the pipelines for branch `master` and with status `success`:
Get only the pipelines for branch `main` and with status `success`:
```
curl "https://gitlab.cern.ch/api/v4/projects/95156/pipelines?ref=master&status=success"
curl "https://gitlab.cern.ch/api/v4/projects/95156/pipelines?ref=main&status=success"
```
Get the latest successful pipeline, just the latest one:
```
curl -v -H "Content-Type: application/json" "https://gitlab.cern.ch/api/v4/projects/95156/pipelines?ref=master&status=success&per_page=1&page=1"
curl -v -H "Content-Type: application/json" "https://gitlab.cern.ch/api/v4/projects/95156/pipelines?ref=main&status=success&per_page=1&page=1"
```
To get the JSON content from the curl response, you can use `jq`, the JSON processor. On macOS, you can install `jq` with Homebrew: `brew install jq`.
......@@ -39,10 +66,168 @@ To get the JSON content from the curl response, you can use `jq`, the JSON proce
For example, get the `web_url` link for the latest successful pipeline:
```
curl -v -H "Content-Type: application/json" "https://gitlab.cern.ch/api/v4/projects/95156/pipelines?ref=master&status=success&per_page=1&page=1" | jq -r '.[0] | .web_url'
curl -v -H "Content-Type: application/json" "https://gitlab.cern.ch/api/v4/projects/95156/pipelines?ref=main&status=success&per_page=1&page=1" | jq -r '.[0] | .web_url'
```
Then, to get the DAG page from the latest pipeline, just use the link from above and add “dag”:
https://gitlab.cern.ch/GeoModelDev/GeoModel/-/pipelines/2163714/dag
## Get a CI job or list of jobs
### Get a single job and its metadata
We can ask for the latest CI job with:
```sh
curl -Ss --header "PRIVATE-TOKEN:<token>" "https://gitlab.cern.ch/api/v4/projects/95156/jobs/?page=1&per_page=1"
```
this gives:
```
[{"id":32216368,"status":"success","stage":"step-E","name":"ubu-single-gmfsl","ref":"main","tag":false,"coverage":null,"allow_failure":false,"created_at":"2023-09-04T18:38:51.723+02:00","started_at":"2023-09-04T19:10:52.976+02:00","finished_at":"2023-09-04T19:14:59.394+02:00","erased_at":null,"duration":246.417715,"queued_duration":0.475744,"user":{"id":281,"username":"rbianchi","name":"Riccardo Maria Bianchi","state":"active","avatar_url":"https://gitlab.cern.ch/uploads/-/system/user/avatar/281/avatar.png","web_url":"https://gitlab.cern.ch/rbianchi","created_at":"2015-04-30T11:00:28.847+02:00","bio":"Particle Physicist (PhD) at CERN working on the ATLAS experiment (since 2005). Faculty Research Associate at the University of Pittsburgh. Co-author of \"Applied Computational Physics\" (Oxford University Press, 2018).","location":"CERN, Geneva, Switzerland","public_email":"riccardo.maria.bianchi@cern.ch","skype":"","linkedin":"riccardo-maria-bianchi-8580432a","twitter":"drric_physics","discord":"","website_url":"www.riccardomariabianchi.com","organization":"ATLAS Experiment, University of Pittsburgh","job_title":"","pronouns":"","bot":false,"work_information":"ATLAS Experiment, University of Pittsburgh","followers":0,"following":0,"local_time":"8:17 PM"},"commit":{"id":"fdafc154d8aa4a8f9f6eefe99d906f623ad99f8a","short_id":"fdafc154","created_at":"2023-09-04T18:38:49.000+02:00","parent_ids":["ffe3884fb7e1a1903fcc17400430137cb12b311e"],"title":"CI: add expiry policy of 1 day to all artifacts","message":"CI: add expiry policy of 1 day to all artifacts\r\n\r\nThis will help the fix of #88","author_name":"Riccardo Maria Bianchi","author_email":"riccardo.maria.bianchi@cern.ch","authored_date":"2023-09-04T18:38:49.000+02:00","committer_name":"Riccardo Maria Bianchi","committer_email":"riccardo.maria.bianchi@cern.ch","committed_date":"2023-09-04T18:38:49.000+02:00","trailers":{},"web_url":"https://gitlab.cern.ch/GeoModelDev/GeoModel/-/commit/fdafc154d8aa4a8f9f6eefe99d906f623ad99f8a"},"pipeline":{"id":6150944,"iid":1561,"project_id":95156,"sha":"fdafc154d8aa4a8f9f6eefe99d906f623ad99f8a","ref":"main","status":"success","source":"push","created_at":"2023-09-04T18:38:51.434+02:00","updated_at":"2023-09-04T19:57:43.438+02:00","web_url":"https://gitlab.cern.ch/GeoModelDev/GeoModel/-/pipelines/6150944"},"web_url":"https://gitlab.cern.ch/GeoModelDev/GeoModel/-/jobs/32216368","project":{"ci_job_token_scope_enabled":false},"artifacts_file":{"filename":"artifacts.zip","size":1381606499},"artifacts":[{"file_type":"archive","size":1381606499,"filename":"artifacts.zip","file_format":"zip"},{"file_type":"metadata","size":995592,"filename":"metadata.gz","file_format":"gzip"},{"file_type":"trace","size":145865,"filename":"job.log","file_format":null}],"runner":{"id":33042,"description":"default-runner-69f5dcf6c6-hsn54","ip_address":"188.185.15.101","active":true,"paused":false,"is_shared":true,"runner_type":"instance_type","name":"gitlab-runner","online":true,"status":"online"},"artifacts_expire_at":"2023-09-05T19:14:48.655+02:00","tag_list":["docker"]}]
```
But we can prettify the output with `jq` itself (note teh dot at the end!):
```sh
curl -Ss --header "PRIVATE-TOKEN:<token>" "https://gitlab.cern.ch/api/v4/projects/95156/jobs/?page=1&per_page=1" | jq .
```
which gives this nice output:
```json
[
{
"id": 32216368,
"status": "success",
"stage": "step-E",
"name": "ubu-single-gmfsl",
"ref": "main",
"tag": false,
"coverage": null,
"allow_failure": false,
"created_at": "2023-09-04T18:38:51.723+02:00",
"started_at": "2023-09-04T19:10:52.976+02:00",
"finished_at": "2023-09-04T19:14:59.394+02:00",
"erased_at": null,
"duration": 246.417715,
"queued_duration": 0.475744,
"user": {
"id": 281,
"username": "rbianchi",
"name": "Riccardo Maria Bianchi",
"state": "active",
"avatar_url": "https://gitlab.cern.ch/uploads/-/system/user/avatar/281/avatar.png",
"web_url": "https://gitlab.cern.ch/rbianchi",
"created_at": "2015-04-30T11:00:28.847+02:00",
"bio": "Particle Physicist (PhD) at CERN working on the ATLAS experiment (since 2005). Faculty Research Associate at the University of Pittsburgh. Co-author of \"Applied Computational Physics\" (Oxford University Press, 2018).",
"location": "CERN, Geneva, Switzerland",
"public_email": "riccardo.maria.bianchi@cern.ch",
"skype": "",
"linkedin": "riccardo-maria-bianchi-8580432a",
"twitter": "drric_physics",
"discord": "",
"website_url": "www.riccardomariabianchi.com",
"organization": "ATLAS Experiment, University of Pittsburgh",
"job_title": "",
"pronouns": "",
"bot": false,
"work_information": "ATLAS Experiment, University of Pittsburgh",
"followers": 0,
"following": 0,
"local_time": "8:18 PM"
},
"commit": {
"id": "fdafc154d8aa4a8f9f6eefe99d906f623ad99f8a",
"short_id": "fdafc154",
"created_at": "2023-09-04T18:38:49.000+02:00",
"parent_ids": [
"ffe3884fb7e1a1903fcc17400430137cb12b311e"
],
"title": "CI: add expiry policy of 1 day to all artifacts",
"message": "CI: add expiry policy of 1 day to all artifacts\r\n\r\nThis will help the fix of #88",
"author_name": "Riccardo Maria Bianchi",
"author_email": "riccardo.maria.bianchi@cern.ch",
"authored_date": "2023-09-04T18:38:49.000+02:00",
"committer_name": "Riccardo Maria Bianchi",
"committer_email": "riccardo.maria.bianchi@cern.ch",
"committed_date": "2023-09-04T18:38:49.000+02:00",
"trailers": {},
"web_url": "https://gitlab.cern.ch/GeoModelDev/GeoModel/-/commit/fdafc154d8aa4a8f9f6eefe99d906f623ad99f8a"
},
"pipeline": {
"id": 6150944,
"iid": 1561,
"project_id": 95156,
"sha": "fdafc154d8aa4a8f9f6eefe99d906f623ad99f8a",
"ref": "main",
"status": "success",
"source": "push",
"created_at": "2023-09-04T18:38:51.434+02:00",
"updated_at": "2023-09-04T19:57:43.438+02:00",
"web_url": "https://gitlab.cern.ch/GeoModelDev/GeoModel/-/pipelines/6150944"
},
"web_url": "https://gitlab.cern.ch/GeoModelDev/GeoModel/-/jobs/32216368",
"project": {
"ci_job_token_scope_enabled": false
},
"artifacts_file": {
"filename": "artifacts.zip",
"size": 1381606499
},
"artifacts": [
{
"file_type": "archive",
"size": 1381606499,
"filename": "artifacts.zip",
"file_format": "zip"
},
{
"file_type": "metadata",
"size": 995592,
"filename": "metadata.gz",
"file_format": "gzip"
},
{
"file_type": "trace",
"size": 145865,
"filename": "job.log",
"file_format": null
}
],
"runner": {
"id": 33042,
"description": "default-runner-69f5dcf6c6-hsn54",
"ip_address": "188.185.15.101",
"active": true,
"paused": false,
"is_shared": true,
"runner_type": "instance_type",
"name": "gitlab-runner",
"online": true,
"status": "online"
},
"artifacts_expire_at": "2023-09-05T19:14:48.655+02:00",
"tag_list": [
"docker"
]
}
]
```
From the output above it is easy to spot useful metadata to exploit in API calls and scripts!
### Get job's metadata
With `jq` you can extract multiple job's metadata, here's an example of a call that extracts the name of the job and the boolean that says if the job is for a tag or not:
```sh
curl -Ss --header "PRIVATE-TOKEN:<token>" "https://gitlab.cern.ch/api/v4/projects/95156/jobs/?page=1&per_page=1" | jq -r '.[] | .name + "--" + (.tag|tostring)'
ubu-single-gmfsl--false
```
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
# === Preamble ===
cmake_minimum_required(VERSION 3.12...3.19.1)
# Make the 'cmake' module directory visible to CMake.
list( APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
# Define color codes for CMake messages
include( cmake_colors_defs )
cmake_minimum_required(VERSION 3.16...4.0)
# === Project's settings ===
include( GeoModel-version )
include( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/GeoModel-version.cmake )
project( "GeoModel" VERSION ${GeoModel_VERSION} LANGUAGES CXX )
set(CMAKE_CXX_STANDARD 20)
# Make the 'cmake' module directory visible to CMake.
list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
# === Project wide setup ===
# Define color codes for CMake messages
include( cmake_colors_defs )
# Use the GNU install directory names.
include( GNUInstallDirs )
# Set a default build type
include( BuildType )
# Print Build Info on screen
include( PrintBuildInfo )
# Set default build and C++ options
include( configure_cpp_options )
# === Externally provided content ===
# By default prefer not to use frameworks on macOS.
# But use it at a "LAST" resource, if no other options worked.
# For details on the behaviour of this cache variable, see:
# - https://cmake.org/cmake/help/v3.0/command/find_file.html
if( APPLE )
set( CMAKE_FIND_FRAMEWORK "LAST" CACHE STRING
"Framework finding behaviour on macOS" )
set( CMAKE_FIND_FRAMEWORK "LAST" CACHE STRING "Framework finding behaviour on macOS" )
endif()
# === Externally provided content ===
# Set up how the project handle some of its dependenices. Either by picking them
# up from the environment, or building them itself.
include( SetupEigen3 )
......@@ -55,10 +51,32 @@ option(GEOMODEL_BUILD_VISUALIZATION "Enable the build of GeoModelVisualization"
option(GEOMODEL_BUILD_GEOMODELG4 "Enable the build of GeoModelG4" OFF)
option(GEOMODEL_BUILD_FULLSIMLIGHT "Enable the build of FullSimLight" OFF)
option(GEOMODEL_BUILD_FULLSIMLIGHT_PROFILING "Enable FullSimLight profiling targets" OFF)
option(GEOMODEL_BUILD_FSL "Enable the build of FSL and FullSimLight" OFF)
option(GEOMODEL_BUILD_ATLASEXTENSIONS "Build the Custom ATLAS Extensions" OFF)
option(GEOMODEL_BUILD_TESTING "Build the unit tests of GeoModel" OFF )
option(GEOMODEL_USE_QT5 "Use QT5 for Visualization and FSL" OFF)
include(CTest) # needs to be included at the top level
if( BUILD_TESTING AND GEOMODEL_BUILD_TESTING )
# Add the GoogleTest framework, for tests
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})
endif()
if(GEOMODEL_BUILD_FSL AND GEOMODEL_BUILD_FULLSIMLIGHT)
message(STATUS "==> NOTE: You enabled both BUILD_FSL and BUILD_FULLSIMLIGHT. Since BUILD_FSL triggers the build of the FullSimLight package as well, I set BUILD_FULLSIMLIGHT to FALSE to avoid errors of 'double inclusion'")
set(GEOMODEL_BUILD_FULLSIMLIGHT FALSE)
endif()
if (GEOMODEL_USE_QT5)
set (QT_VERSION 5)
else()
set (QT_VERSION 6)
endif()
if(GEOMODEL_BUILD_FULLSIMLIGHT_PROFILING)
set(GEOMODEL_BUILD_FULLSIMLIGHT ON CACHE BOOL "Enable the build of FullSimLight" FORCE)
include(CTest) # needs to be included at the top level
endif()
# a list to keep track of the packages we build
......@@ -69,11 +87,10 @@ list( APPEND BUILT_PACKAGES "GeoModelCore")
add_subdirectory(GeoModelIO)
list( APPEND BUILT_PACKAGES "GeoModelIO")
if(GEOMODEL_BUILD_ALL)
set(GEOMODEL_BUILD_TOOLS TRUE)
set(GEOMODEL_BUILD_VISUALIZATION TRUE)
set(GEOMODEL_BUILD_FULLSIMLIGHT TRUE)
set(GEOMODEL_BUILD_TOOLS TRUE)
set(GEOMODEL_BUILD_VISUALIZATION TRUE)
set(GEOMODEL_BUILD_FSL TRUE)
endif()
if(GEOMODEL_BUILD_TOOLS)
......@@ -97,33 +114,46 @@ if(GEOMODEL_BUILD_FULLSIMLIGHT)
list( APPEND BUILT_PACKAGES "FullSimLight")
endif()
if(GEOMODEL_BUILD_FSL)
set(GEOMODEL_BUILD_GEOMODELG4 TRUE) # FullSimLight needs GeoModelG4
add_subdirectory(FullSimLight)# FSL needs FullSimLight
add_subdirectory(FSL)
list( APPEND BUILT_PACKAGES "FullSimLight")
list( APPEND BUILT_PACKAGES "FSL")
endif()
if(GEOMODEL_BUILD_ATLASEXTENSIONS)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/ATLASExtensions)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/ATLASExtensions/CMakeLists.txt)
add_subdirectory(ATLASExtensions)
list( APPEND BUILT_PACKAGES "ATLASExtensions")
else()
message(FATAL_ERROR "You enabled the build of the ATLASExtensions submodule, by setting the 'GEOMODEL_BUILD_ATLASEXTENSIONS=1' option. However, no 'CMakeLists.txt' file was found in the ATLASExtensions folder! You probably forgot to recursively clone the submodule. Run this from the source top folder: 'git submodule update --init'. Then, re-run CMake." )
endif()
else()
message(FATAL_ERROR "You enabled the build of the ATLASExtensions submodule, by setting the 'GEOMODEL_BUILD_ATLASEXTENSIONS=1' option. However, no 'ATLASExtensions' folder is found in the repository! Please, check the integrity of your copy of the GeoModel repository." )
endif()
endif()
if(GEOMODEL_BUILD_GEOMODELG4 OR GEOMODEL_BUILD_EXAMPLES_W_GEANT4)
add_subdirectory(GeoModelG4)
if(GEOMODEL_BUILD_EXAMPLES AND GEOMODEL_BUILD_EXAMPLES_W_GEANT4)
message(STATUS "==> NOTE: You enabled both GEOMODEL_BUILD_EXAMPLES and GEOMODEL_BUILD_EXAMPLES_W_GEANT4. Since GEOMODEL_BUILD_EXAMPLES triggers the build of the GEOMODEL_BUILD_EXAMPLES_W_GEANT4 as well, I set GEOMODEL_BUILD_EXAMPLES_W_GEANT4 to FALSE to avoid errors of 'double inclusion'")
set(GEOMODEL_BUILD_EXAMPLES_W_GEANT4 FALSE)
elseif (GEOMODEL_BUILD_EXAMPLES_W_GEANT4)
add_subdirectory(GeoModelExamples)
list( APPEND BUILT_PACKAGES "GeoModelExamples")
endif()
list( APPEND BUILT_PACKAGES "GeoModelG4")
endif()
# A function to get a string with comma-separated package names from a list of packages
# NOTE: We could make use of list(JOIN ...) on CMake >= 3.12,
# but on Ubuntu 18 the apt package installs 3.10 instead
function(getCSVStringFromList inputList outputString)
#message("input: ${inputList}") # for debug
set(tempList "")
foreach( item ${inputList})
list(APPEND tempList ${item})
endforeach()
string (REPLACE ";" ", " outStr "${tempList}")
#message("string: ${outStr}") # for debug
set( ${outputString} ${outStr} PARENT_SCOPE)
endfunction()
# Print Build Info on screen
include( PrintBuildInfo )
# Let the users know which and how many packages they are building
list(LENGTH BUILT_PACKAGES BUILT_PACKAGES_LENGTH)
#
# list(JOIN BUILT_PACKAGES ", " BUILT_PACKAGES_STR) # list(JOIN) needs /CMake 3.12, which is missing on Ubuntu 18 by default
getCSVStringFromList( "${BUILT_PACKAGES}" BUILT_PACKAGES_STR )
#
string(REPLACE ";" ", " BUILT_PACKAGES_STR "${BUILT_PACKAGES}")
message(STATUS "${BoldWhite}-----${ColourReset}")
message( STATUS "${BoldGreen}Building the following ${BUILT_PACKAGES_LENGTH} packages: ${BUILT_PACKAGES_STR}${ColourReset}")
message(STATUS "${BoldGreen}Building the following ${BUILT_PACKAGES_LENGTH} packages: ${BUILT_PACKAGES_STR}${ColourReset}")
message(STATUS "${BoldWhite}-----${ColourReset}")
.DS_Store
# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
cmake_minimum_required(VERSION 3.16...4.0)
project(fsl VERSION 0.1 LANGUAGES CXX)
file( GLOB MANPAGES man/man1/* )
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
# I am top-level project.
# Make the root module directory visible to CMake.
list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake )
# get global GeoModel version
include( GeoModel-version )
# set the project, with the version taken from the GeoModel parent project
project( "fsl" VERSION ${GeoModel_VERSION} LANGUAGES CXX )
if (GEOMODEL_USE_QT5)
set (QT_VERSION 5)
else()
set (QT_VERSION 6)
endif()
# Define color codes for CMake messages
include( cmake_colors_defs )
# Warn the users about what they are doing
message(STATUS "${BoldGreen}Building ${PROJECT_NAME} individually, as a top-level project.${ColourReset}")
# Set default build and C++ options
include( configure_cpp_options )
set( CMAKE_FIND_FRAMEWORK "LAST" CACHE STRING
"Framework finding behaviour on macOS" )
# Set up how the project handle some of its dependenices. Either by picking them
# up from the environment, or building them itself.
include( SetupJSON )
find_package (FullSimLight REQUIRED)
add_definitions (-DFSLPLUGINROOT="${FullSimLight_DIR}/../../../${CMAKE_INSTALL_DATAROOTDIR}" )
message ( STATUS "FSL plugin files sought here: ${FullSimLight_DIR}/../../../${CMAKE_INSTALL_DATAROOTDIR}" )
if(FullSimLight_HAS_HEPMC3)
add_compile_definitions( USE_HEPMC3 )
message (STATUS "HEPMC3 Enabled in FullSimLight")
else()
message (STATUS "HEPMC3 Disabled in FullSimLight")
endif()
if(FullSimLight_HAS_Pythia)
add_compile_definitions( USE_Pythia )
message (STATUS "Pythia Enabled in FullSimLight")
else()
message (STATUS "Pythia Disabled in FullSimLight")
endif()
else()
# I am called from other project with add_subdirectory().
message( STATUS "Building ${PROJECT_NAME} as part of the root GeoModel project.")
# Set the project
project( "fsl" VERSION ${GeoModel_VERSION} LANGUAGES CXX )
add_definitions (-DFSLPLUGINROOT="${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}" )
if(GEOMODEL_USE_HEPMC3)
add_compile_definitions( USE_HEPMC3 )
endif()
if(GEOMODEL_USE_PYTHIA)
add_compile_definitions( USE_Pythia )
endif()
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Find the dependencies of the project.
find_package( Qt${QT_VERSION} COMPONENTS Core Gui Widgets Sql PrintSupport OpenGL REQUIRED )
# Qt${QT_VERSION} settings.
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# Use the GNU install directory names.
include( GNUInstallDirs )
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cpp)
file(GLOB headers ${PROJECT_SOURCE_DIR}/src/*.h)
file(GLOB uis ${PROJECT_SOURCE_DIR}/src/*.ui)
set(PROJECT_SOURCES ${sources} ${headers} ${uis} )
add_executable(fsl ${PROJECT_SOURCES} )
target_link_libraries(fsl PRIVATE Qt${QT_VERSION}::Widgets nlohmann_json::nlohmann_json)
# Install the executable.
install( TARGETS fsl
EXPORT ${PROJECT_NAME}-export
LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT Runtime )
install( FILES ${MANPAGES}
DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man1
COMPONENT Runtime )
.\" Manpage for fsl.
.\" Contact geomodel-core-team@cern.ch to correct errors or typos.
.TH man 1 "01 Nov 2024" "6.5" "fsl man page"
.SH NAME
fsl \- user interface for fullSimLight Geant4 simulation.
.SH SYNOPSIS
fsl [-c JsonConfigFile]
.SH DESCRIPTION
fsl is a graphical user front-end to fullSimLight. fsl/fullSimLight
runs Geant4 simulation using input files containing 1) event data,
2) geometry data, and 3) configuration data.
Using the fsl application, one can configure and launch the simulation
interactively through a series of menus. The menus allow to select
the event type and input source, the geometry input, the magnetic
field, and any plugins. A number of example plugins appear in the
menus. For more information on writing custom plugins, see the web
page
.IR geomodel.web.cern.ch \.
Default configuration files for fsl are typically installed in
/usr/share/fsl on linux systems.
Users can either run fullSimLight simulation from within fsl or simply
configure the simulation, in which case the configuration may be saved
to a json file. The json file may read back into fsl
for further editing (see the -c option below) or passed to fullSimLight
on the command line.
From the fsl main window, users may run the gmex geometry explorer,
and/or the gmclash clash detection utility, in addition to fullSimLight.
.SH OPTIONS
.TP
.BI \-c \ JsonConfigFile
Open a fullSimLight configuration file for further interactive configuration.
.\" ====================================================================
.SH "SEE ALSO"
.\" ====================================================================
.
gmcat(1), gmclash(1), gmstatistics(1), gmex(1), fullSimLight(1)
.IR "geant4.web.cern.ch"
is the web page for the Geant4 toolkit, the development of which is led
by CERN.
.IR "pythia.org"
is the web page for the pythia event generator
.IR "geomodel.web.cern.ch"
is the location of the main documentation for the GeoModel Tools Suite.
.
.SH AUTHORS
.MT Marilena.Bandieramonte@\:cern\:.ch
Marilena Bandieramonte
.ME ,
.MT Raees.Ahmad.Khan@\:cern\:.ch
Raees Khan
.ME
and
.MT boudreau@\:pitt\:.edu
Joe Boudreau
.ME .
#ifndef _BETTERTEXTBROWSER_H_
#define _BETTERTEXTBROWSER_H_
#include <QTextBrowser>
#include <QMenu>
#include <QAction>
#include <iostream>
#include <QContextMenuEvent>
#include <QIcon>
#include <QStyle>
#include "fsl_mainwindow.h"
class BetterTextBrowser:public QTextBrowser {
Q_OBJECT
public:
// Constructor:
BetterTextBrowser(QWidget * parent):QTextBrowser(parent){}
// Destructor:
~BetterTextBrowser() {}
// Set main window:
void setMainWindow(FSLMainWindow *mainWindow) {
m_mainWindow=mainWindow;
}
// Override from base class. Add an action for "save text to file"
void contextMenuEvent(QContextMenuEvent *event) {
QMenu *menu = createStandardContextMenu();
QAction *action=menu->addAction(tr("Save to file"));
action->setIcon((style()->standardIcon(QStyle::StandardPixmap(QStyle::SP_DialogSaveButton), nullptr, this)));
action->setEnabled(!document()->isEmpty());
action->setShortcut(QKeySequence(QKeySequence(Qt::CTRL + Qt::Key_S)));
connect(action, &QAction::triggered, m_mainWindow, &FSLMainWindow::save_display_output);
menu->exec(event->globalPos());
delete menu;
}
private:
FSLMainWindow *m_mainWindow {nullptr};
};
#endif
#include "configregions.h"
#include "ui_configregions.h"
#include <iostream>
#include <QDoubleValidator>
#include <sstream>
ConfigRegions::ConfigRegions(QWidget *parent) :
QDialog(parent),
ui(new Ui::ConfigRegions)
{
ui->setupUi(this);
this->setWindowTitle("Regions Configuration");
std::setlocale(LC_NUMERIC, "C");
connect(ui->pB_add_region, &QPushButton::released, this, &ConfigRegions::add_region_config);
electron_cut_validator = new QDoubleValidator(-100000.0,100000.0,8);
proton_cut_validator = new QDoubleValidator(-100000.0,100000.0,8);
positron_cut_validator = new QDoubleValidator(-100000.0,100000.0,8);
gamma_cut_validator = new QDoubleValidator(-100000.0,100000.0,8);
loc= QLocale::C;
loc.setNumberOptions(QLocale::RejectGroupSeparator);
electron_cut_validator->setLocale(loc);
proton_cut_validator->setLocale(loc);
positron_cut_validator->setLocale(loc);
gamma_cut_validator->setLocale(loc);
ui->lE_electron->setValidator(electron_cut_validator);
ui->lE_proton->setValidator(proton_cut_validator);
ui->lE_positron->setValidator(positron_cut_validator);
ui->lE_gamma->setValidator(gamma_cut_validator);
}
ConfigRegions::~ConfigRegions()
{
delete ui;
delete electron_cut_validator;
delete proton_cut_validator;
delete positron_cut_validator;
delete gamma_cut_validator;
}
void ConfigRegions::add_region_config()
{
region_name = (ui->lE_reg_name->text()).toStdString();
frootLV_names = (ui->lE_froot->text()).toStdString();
electron_cut = (ui->lE_electron->text()).toDouble();
proton_cut = (ui->lE_proton->text()).toDouble();
positron_cut = (ui->lE_positron->text()).toDouble();
gamma_cut = (ui->lE_gamma->text()).toDouble();
emit send_config(region_name,frootLV_names,electron_cut,proton_cut,positron_cut,gamma_cut);
ui->lE_reg_name->clear();
ui->lE_froot->clear();
ui->lE_electron->clear();
ui->lE_proton->clear();
ui->lE_positron->clear();
ui->lE_gamma->clear();
}
#ifndef CONFIGREGIONS_H
#define CONFIGREGIONS_H
#include <QDialog>
#include <QDoubleValidator>
#include <QLocale>
#include <clocale>
namespace Ui {
class ConfigRegions;
}
class ConfigRegions : public QDialog
{
Q_OBJECT
public:
explicit ConfigRegions(QWidget *parent = nullptr);
~ConfigRegions();
std::string region_name;
std::string frootLV_names;
double electron_cut;
double proton_cut;
double positron_cut;
double gamma_cut;
void add_region_config();
QLocale loc;
signals:
void send_config(std::string region_name, std::string frootLV_names
,double electron_cut , double proton_cut
,double positron_cut , double gamma_cut);
private:
Ui::ConfigRegions *ui;
QDoubleValidator *electron_cut_validator;
QDoubleValidator *proton_cut_validator;
QDoubleValidator *positron_cut_validator;
QDoubleValidator *gamma_cut_validator;
};
#endif // CONFIGREGIONS_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ConfigRegions</class>
<widget class="QDialog" name="ConfigRegions">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>581</width>
<height>250</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>Region Name</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lE_reg_name"/>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>RootLV Names</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLineEdit" name="lE_froot"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>Electron Cut (GeV)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lE_electron"/>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>Proton Cut (GeV)</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QLineEdit" name="lE_proton"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>Positron Cut (GeV)</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lE_positron"/>
</item>
<item row="2" column="3">
<widget class="QLabel" name="label_6">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>Gamma Cut (GeV)</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QLineEdit" name="lE_gamma"/>
</item>
<item row="3" column="0" colspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>205</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="pB_add_region">
<property name="text">
<string>Add Region</string>
</property>
</widget>
</item>
<item row="3" column="3" colspan="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>219</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
This diff is collapsed.
#ifndef FSLMAINWINDOW_H
#define FSLMAINWINDOW_H
#include <QMainWindow>
#include <nlohmann/json.hpp>
#include <QStringListModel>
#include <QProcess>
#include <QLocale>
#include <QStandardItemModel>
#include <QDoubleValidator>
#include "configregions.h"
#include <clocale>
QT_BEGIN_NAMESPACE
namespace Ui { class FSLMainWindow; }
QT_END_NAMESPACE
struct Region {
std::string Region_name;
std::vector<std::string> fRootLVnames;
double electron_cut;
double proton_cut;
double positron_cut;
double gamma_cut;
};
inline void to_json(nlohmann::json& j, const Region& r) {
j = nlohmann::json{{"RegionName", r.Region_name},
{"RootLVNames", r.fRootLVnames},
{"GammaCut", r.gamma_cut},
{"ElectronCut", r.electron_cut},
{"PositronCut", r.positron_cut},
{"ProtonCut", r.proton_cut}};
}
inline void from_json(const nlohmann::json& j, Region& r) {
r.Region_name=j.at("RegionName").get<std::string>();
r.fRootLVnames=j.at("RootLVNames").get<std::vector<std::string>>();
r.gamma_cut=j.at("GammaCut").get<double>();
r.electron_cut=j.at("ElectronCut").get<double>();
r.positron_cut=j.at("PositronCut").get<double>();
r.proton_cut=j.at("ProtonCut").get<double>();
}
class FSLMainWindow : public QMainWindow
{
Q_OBJECT
public:
//Parameters associated with the main tab
QLocale lo;
nlohmann::json j;
QProcess fullSimLight_process;
QProcess gmex_process;
std::string geom_file_address = "";
std::string geom_file_directory="";
std::string physics_list_name = "";
int number_of_threads = 0;
int number_of_events = 0;
std::string config_file_name = "";
std::string save_directory = "";
std::string save_display_directory = "";
//Parameters associated with the Generator tab
std::string generator = "";
std::string particle = "";
std::string particle_energy = "";
std::string particle_direction = "";
double p_x;
double p_y;
double p_z;
std::string x_dir;
std::string y_dir;
std::string z_dir;
int number_of_primaries_per_event;
std::string pythia_input_file = "";
std::string pythia_type_of_event = "";
std::string hepmc3_input_file = "";
std::string hepmc3_type_of_file = "";
std::string generator_plugin = "";
//Parameters associated with the Sensitive Detectors tab
std::vector<std::string> sensitive_detector_extensions;
//int sens_det_number;
// std::string hits_file = "";
// std::string histo_file = "";
//Parameters associated with the Magnetic field tab
std::string magnetic_field_type = "";
std::string magnetic_field = "";
std::string magnetic_field_plugin_file = "";
//std::string magnetic_field_map = "";
//Parameters associated with the User Actions tab
// std::vector<std::string> run_actions;
// std::vector<std::string> event_actions;
// std::vector<std::string> stepping_actions;
// std::vector<std::string> stacking_actions;
// std::vector<std::string> tracking_actions;
std::vector<std::string> user_action_extensions;
//Parameters associated with the g4ui commands tab
std::vector<std::string> g4ui_commands;
// int g4ui_number;
//Parameters associated with the shape commands tab
// int shape_number;
// std::vector<std::string> shape_extensions;
//Parameters associated with the Region tab
std::vector<Region> regions;
std::string load_file_name;
//Function headers
FSLMainWindow(QWidget *parent = nullptr);
~FSLMainWindow();
//Functions used in Configuration
void save_configuration();
void save_configuration_as();
void save_display_output();
void create_configuration();
void view_configuration();
void run_configuration();
void run_gmex();
void run_gmclash();
void load_configuration();
void load_configuration_CL(std::string config_file_path); //Load configuration from Command Line
std::vector<std::string> display_configuration(const std::string &s);
void clear_main_status();
void configure_generator();
void configure_energy_direction();
void add_sens_det();
void del_sens_det();
void configure_sens_det_actions();
// void add_g4ui();
// void del_g4ui();
void configure_g4ui_command();
void pop_up_regions();
void del_region();
std::vector<std::string> parse_froot_string(std::string input_froot_string);
void configure_regions();
void add_user_action();
void del_user_action();
void configure_actions();
// void del_shape_ext();
// void add_shape_ext();
// void configure_shape_ext();
void assign_geom_file();
void assign_phys_list_plugin();
void assign_gen_plug_file();
void assign_hepmc3_file();
void assign_pythia_file();
void assign_magnetic_field_plugin_file();
//void assign_magnetic_field_map();
//void assign_shape_ext_file();
// void assign_run_actions_file();
// void assign_event_actions_file();
// void assign_stepping_actions_file();
// void assign_stacking_actions_file();
// void assign_tracking_actions_file();
// void run_actions_file();
// void event_actions_file();
// void stepping_actions_file();
// void stacking_actions_file();
// void tracking_actions_file();
void configure_magnetic_field();
std::string get_file_name();
std::string get_directory();
//Custom signals
signals:
void send_error_message(std::string info);
private slots:
// void catch_error_message(std::string info);
// void get_sens_det_index(QModelIndex region_index);
// void get_g4ui_index(QModelIndex g4ui_index);
// void get_shape_index(QModelIndex g4ui_index);
void add_region(std::string region_name, std::string frootLV_names
,double electron_cut , double proton_cut
,double positron_cut , double gamma_cut);
void check_if_pythia_file();
void fsmlreadyReadStandardOutput();
void fsmlreadyReadStandardError();
void fsml_process_started();
void fsml_process_finished();
void gmexreadyReadStandardOutput();
void gmexreadyReadStandardError();
// void gmex_process_started();
// void gmex_process_finished();
private:
Ui::FSLMainWindow *ui;
// QStringListModel *sens_det_model;
// QStringListModel *g4ui_model;
// QStringListModel *shape_model;
ConfigRegions *region;
QStandardItemModel *region_model;
QStandardItemModel *user_action_model;
QStandardItemModel *sens_det_model;
QStringList region_horizontalHeader;
QStringList user_action_horizontalHeader;
QStringList sens_det_horizontalHeader;
QDoubleValidator *p_x_validator;
QDoubleValidator *p_y_validator;
QDoubleValidator *p_z_validator;
QDoubleValidator *mag_field_validator;
};
#endif // FSLMAINWINDOW_H