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
  • 79-npsim-gun-shoudl-have-gun-etamin-and-gun-etamax
  • 82-set-charge-by-pdg-id-in-hepmc-reader
  • 90-support-fastsim-and-gflash
  • ci_image_update
  • master
  • multi-threaded-npsim
  • occ_7.5
  • pr/dd4hep_01_24
  • pr/podio_1
  • v0.2.0
  • v0.3.0
  • v0.3.1
  • v0.3.2
  • v0.4.0
  • v0.5.0
  • v0.6.0
  • v0.7.0
  • v0.8.0
  • v0.9.0
  • v1.0.0
  • v1.1.0
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.2.3
  • v1.2.4
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.4.0
  • v1.4.1
31 results

Target

Select target project
  • EIC/NPDet
  • Polakovic/NPDet
  • whit/NPDet
  • jxie/NPDet
  • jihee.kim/NPDet
  • ManojJadhav/NPDet
  • jmartinezmarin/NPDet
  • whit1/EIC/NPDet
  • cpeng/NPDet
9 results
Select Git revision
  • Digit
  • HCAL_detector
  • ZDC
  • beamline
  • crystal
  • emcal_gap
  • master
  • new_ci_runner
  • sieic_vis
  • tooling
  • whit-master-patch-58257
11 results
Show changes
Commits on Source (487)
Showing
with 5913 additions and 144 deletions
---
BasedOnStyle: Chromium
BreakConstructorInitializersBeforeComma: true
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Cpp11BracedListStyle: true
ColumnLimit: 120
Standard: Cpp11
#SpaceBeforeParens: ControlStatements
SpaceAfterControlStatementKeyword: true
BinPackArguments: true
BinPackParameters: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
PointerBindsToType: true
NamespaceIndentation: All
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpacesBeforeTrailingComments: 1
...
FROM eicweb.phy.anl.gov:4567/containers/eic_container/jug_dev:testing
LABEL maintainer="Whitney Armstrong <warmstrong@anl.gov>" \
name="npdet" \
group="EIC/NPDet" \
march="native" \
basedist="ubuntu" \
base="eic_container" \
version="0.2"
RUN cd /tmp \
&& git clone https://eicweb.phy.anl.gov/EIC/NPDet.git \
&& mkdir -p NPDet/build && cd NPDet/build \
&& cmake ../. -DCMAKE_CXX_STANDARD=17 \
&& make -j30 && make -j4 install \
&& cd /tmp && rm -rf /tmp/NPDet
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
# exports variables in config.env as environment variables
export $(shell sed 's/=.*//' $(cnf))
SHELL = bash
# grep the version from the mix file
VERSION=$(shell bash version.sh)
TAG_VERSION=$(VERSION)
# help will output the help for each task
# thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
.PHONY: help
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help
# ==========================================================================
#
build: ## build the image
docker build -t $(APP_NAME) .
build-nc: ## Build the container without caching (from scratch)
docker build --no-cache -t $(APP_NAME) .
build-alt: ## build the container for various machine architectures (broadwell, haswell, knl)
@echo 'building for architecture: $(ALT_NAME)'
docker build -t $(APP_NAME)_$(ALT_NAME) -f Dockerfile.$(ALT_NAME) .
build-alt-nc: ## build the container for various machine architectures (broadwell, haswell, knl)
@echo 'build-alt-nc: building for architecture: $(ALT_NAME)'
docker build --no-cache -t $(APP_NAME)_$(ALT_NAME) -f Dockerfile.$(ALT_NAME) .
# ==========================================================================
#
run: ## Run container on port configured in `config.env`
docker run -i -t --rm --env-file=./config.env -p=$(PORT):$(PORT) --name="$(APP_NAME)" $(REPO)/$(APP_NAME):$(TAG_VERSION)
up: build run ## Run container on port configured in `config.env` (Alias to run)
stop: ## Stop and remove a running container
docker stop $(APP_NAME); docker rm $(APP_NAME)
# ==========================================================================
#
tag: tag-latest tag-version #tag-version ## Generate container tags for the `{version}` and `latest` tags
tag-latest: ## Generate container `{version}` tag
@echo 'create tag latest'
#docker tag $(APP_NAME) $(REPO)/$(APP_NAME):latest
tag-version: ## Generate container `latest` tag
@echo 'creating tag $(APP_NAME):$(VERSION)'
docker tag $(APP_NAME):latest $(APP_NAME):$(VERSION)
tag-alt: tag-alt-latest # tag-alt-version ## Generate container tags for the `{version}` ans `latest` tags
tag-alt-latest: ## Generate container `{version}` tag
@echo 'create tag latest'
#docker tag $(APP_NAME)_$(ALT_NAME) $(REPO)/$(APP_NAME)_$(ALT_NAME):latest
tag-alt-version: ## Generate container `{version}` tag
@echo 'create tag latest'
docker tag $(APP_NAME)_$(ALT_NAME) $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):$(VERSION)
# ==========================================================================
#
login: ## Auto login to AWS-ECR unsing aws-cli
@docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
echo "Login COMPLETE"
release-latest: build login publish-latest ## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR
release: build-nc publish cleanup## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR
release-cached: build publish ## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR
cleanup:
@echo "cleaning up"
docker rmi $(APP_NAME):latest
publish: login publish-latest publish-version #publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR
@echo "Publishing done"
publish-latest: ## Publish the `latest` taged container to ECR
@echo 'publish latest to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)'
docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest
docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest
docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest
publish-version: ## Publish the `{version}` taged container to ECR
@echo 'publish latest to $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION)'
docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION)
docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION)
docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION)
push: login ## push after login @echo 'push latest to $(REG_NAME)/$(REPO)/$(APP_NAME):latest'
docker tag $(APP_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest
docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest
# ==========================================================================
#
release-alt: build-alt publish-alt ## Make a release by building and publishing the `{version}` ans `latest` tagged containers to ECR
publish-alt: login publish-alt-latest #publish-alt-version ## Publish the `{version}` ans `latest` tagged containers to ECR
push-alt: login tag-alt-latest ## push after login
#docker push $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):latest
docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest
publish-alt-latest: #tag-alt-latest ## Publish the `latest` taged container to ECR
#docker push $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):latest
docker tag $(APP_NAME)_$(ALT_NAME):latest $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest
docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest
docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest
publish-alt-version: tag-alt-version ## Publish the `latest` taged container to ECR
#docker push $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):$(VERSION)
docker push $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):$(VERSION)
# ==========================================================================
#
login-dockerhub: ## login to hub.docker.com
@echo 'docker hub login :'
docker login
push-dockerhub: build #publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR
@echo '$(DH_ORG)/$(APP_NAME):$(TAG_VERSION)'
docker push $(DH_ORG)/$(APP_NAME):latest
#docker push $(DH_ORG)/$(APP_NAME):$(VERSION)
publish-dockerhub: build tag #publish-version ## Publish the `{version}` ans `latest` tagged containers to ECR
@echo '$(DH_ORG)/$(APP_NAME):$(TAG_VERSION)'
docker push $(DH_ORG)/$(APP_NAME):latest
#docker push $(DH_ORG)/$(APP_NAME):$(VERSION)
# ==========================================================================
#
clean-tags:
docker rmi $(REPO)/$(APP_NAME):latest || true
docker rmi $(GL_GROUP)/$(APP_NAME):latest || true
docker rmi $(GL_REG_GROUP)/$(APP_NAME):latest || true
docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME):latest || true
docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest || true
docker rmi $(REPO)/$(APP_NAME)_$(ALT_NAME):latest || true
docker rmi $(GL_GROUP)/$(APP_NAME)_$(ALT_NAME):latest || true
docker rmi $(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest || true
docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME)_$(ALT_NAME):latest || true
docker rmi $(REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest || true
clean:
docker rmi $(REPO_NAME)/$(APP_NAME) || true
docker rmi $(REPO_NAME)/$(APP_NAME):$(TAG_VERSION) || true
docker rmi $(REPO_NAME)/$(APP_NAME):$(VERSION) || true
docker rmi $(REPO)/$(APP_NAME) || true
docker rmi $(REPO)/$(APP_NAME):$(TAG_VERSION) || true
docker rmi $(REPO)/$(APP_NAME):$(VERSION) || true
docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME):latest || true
docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME):$(TAG_VERSION) || true
docker rmi $(REG_NAME)/$(REPO)/$(APP_NAME) || true
docker rmi $(DH_ORG)/$(APP_NAME) || true
docker rmi $(DH_ORG)/$(APP_NAME):$(TAG_VERSION) || true
docker rmi $(DH_ORG)/$(APP_NAME):$(VERSION) || true
docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):latest || true
docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME):$(VERSION) || true
docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME) || true
docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):latest || true
docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):$(VERSION) || true
docker rmi $(GL_REG_NAME)/$(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME) || true
docker rmi $(GL_REG_GROUP)/$(APP_NAME) || true
docker rmi $(GL_REG_GROUP)/$(APP_NAME):$(VERSION) || true
docker rmi $(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME) || true
docker rmi $(GL_REG_GROUP)/$(APP_NAME)_$(ALT_NAME):$(VERSION) || true
docker rmi $(GL_REG_NAME)/$(REG_USER)/$(APP_NAME) || true
docker rmi $(GL_REG_NAME)/$(REG_USER)/$(APP_NAME):$(VERSION) || true
#docker rmi $(APP_NAME) || true
version: ## Output the current version
@echo $(VERSION)
# ==========================================================================
#
info: ## Output the current version
@echo 'VERSION = $(VERSION) '
@echo 'REG_USER = $(REG_USER) '
@echo 'REG_NAME = $(REG_NAME) '
@echo 'ALT_NAME = $(ALT_NAME) '
@echo 'APP_NAME = $(APP_NAME) '
@echo 'REPO_NAME = $(REPO_NAME) '
@echo 'DH_ORG = $(DH_ORG) '
@echo 'GL_GROUP = $(GL_GROUP) '
@echo 'GL_REG_GROUP = $(GL_REG_GROUP)'
@echo 'GL_REG_NAME = $(GL_REG_NAME) '
@echo 'REPO = $(REPO) '
@echo 'TAG_VERSION = $(TAG_VERSION) '
ls: ## list all docker images
docker images
# Port to run the container
REG_HOST ?= eicweb.phy.anl.gov
REG_NAME ?= eicweb.phy.anl.gov:4567
REG_PORT ?= 4567
REG_URL ?= https://$(REG_HOST)
APP_NAME = npdet
REPO_NAME = npdet
DH_ORG = hallac
GL_GROUP = eic
GL_REG_GROUP = eic/npdet
GL_REG_NAME = $(REG_NAME)
# INSTALL
# - copy the files deploy.env, config.env, version.sh and Makefile to your repo
# - replace the vars in deploy.env
# - define the version script
# Build the container
make build
# Build and publish the container
make release
# Publish a container to AWS-ECR.
# This includes the login to the repo
make publish
# Run the container
make run
# Build an run the container
make up
# Stop the running container
make stop
# Build the container with differnt config and deploy file
make cnf=another_config.env dpl=another_deploy.env build
\ No newline at end of file
#!/bin/bash
cat ../../VERSION
*.pcm
# Compiled Object files
*.slo
*.lo
*.o
# Compiled Dynamic libraries
*.so
*.d
*.root
*.slcio
*.stp
*.dylib
# Compiled Static libraries
*.lai
*.la
*.a
# build trees
build/*
doc/doxygen_output
DEBUG*/*
BUILD*/*
RELEASE*/*
TEST*/*
# vim
# cmake
CMakeCache.txt
CMakeFiles
Makefile
cmake_install.cmake
install_manifest.txt
# vim
~*
*.swp
*.swo
# python
__pycache__/
*.py[cod]
*$py.class
.ipynb_checkpoints
##
*.d
*.pcm
*.root
*.hepmc
image: eicweb.phy.anl.gov:4567/containers/image_recipes/dd4hep_base:latest
image: eicweb.phy.anl.gov:4567/containers/eic_container/jug_dev:testing
stages:
- build
- containerize
- test
- deploy
before_script:
- pwd
- ls -lrth /usr/local/bin
.eicweb:
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
.documentation:
rules:
- if: '$CI_SERVER_HOST != "eicweb.phy.anl.gov" && $CI_COMMIT_BRANCH == "master"'
compile:
extends: .eicweb
stage: build
script:
- bash bin/do_build
artifacts:
when: always
paths:
- install/
- build/test_result_*.xml
reports:
junit: build/test_result_*.xml
test_npsim:
extends: .eicweb
needs: ["compile"]
stage: test
script:
- mkdir -p test_files/
- LD_LIBRARY_PATH=install/lib:$LD_LIBRARY_PATH install/bin/npsim --compactFile examples/gem_tracker_disc.xml --enableGun --numberOfEvents 10 --outputFile test_files/test_npsim.root
- rootls -t test_files/test_npsim.root
artifacts:
expire_in: 1 days
paths:
- test_files/
gen_doxygen_src:
stage: build
extends: .documentation
script:
- mkdir build && cd build && cmake ../. -DCMAKE_INSTALL_PREFIX=../install
artifacts:
paths:
- build/src/dd4pod/src
- build/src/dd4pod/dd4pod
rtd_sphinx_build:
stage: build
image: eicweb.phy.anl.gov:4567/containers/image_recipes/dd4hep_base:latest
extends: .documentation
#image: eicweb.phy.anl.gov:4567/containers/eic_container/rtd_builder
image: eicweb.phy.anl.gov:4567/containers/image_recipes/ubuntu_dind:latest
script:
- apt-get update && apt-get install -y python3-sphinx python3-pip
- pip3 install sphinx && pip3 install sphinx_rtd_theme
- cd docs && pip3 install -r requirements.txt && make html
artifacts:
paths:
- docs/_build/html
pages:
stage: deploy
extends: .documentation
image: eicweb.phy.anl.gov:4567/containers/eic_container/alpine
needs: ['gen_doxygen_src','rtd_sphinx_build']
script:
- ./bin/do_build
# - . /usr/local/bin/thisroot.sh
# - . /usr/local/bin/thisdd4hep.sh
# - . /usr/local/bin/geant4.sh
# - mkdir install
# - mkdir build
# - cd build
# - cmake .. -DCMAKE_INSTALL_PREFIX=../install
# - make -j4
trigger:
stage: containerize
script: curl -X POST -F token=8806e69cdc802d752413e8a31554a2 -F ref=master https://eicweb.phy.anl.gov/api/v4/projects/290/trigger/pipeline
- apk update && apk add doxygen graphviz ttf-ubuntu-font-family
- mkdir -p public && cp -r docs/_build/html/* public/.
- cd doc && doxygen Doxyfile && mv doxygen_output/html ../public/ref_doc && cd ..
artifacts:
paths:
- public
staging:
stage: deploy
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov" && $CI_COMMIT_BRANCH == "master"'
trigger: EIC/juggler
terminal:
image: eicweb.phy.anl.gov:4567/containers/eic_container/jug_dev:testing
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml
# Optionally build your docs in additional formats such as PDF
formats:
- pdf
# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: docs/requirements.txt
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(NPDet VERSION 0.1.0 LANGUAGES CXX)
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
# Add library source directory name that appear in ./src
set(NPDet_LIB_NAMES
GenericDetectors
)
# CMP0074: find_package() uses <PackageName>_ROOT variables
cmake_policy(SET CMP0074 NEW)
# Add executable source directory name that appear in ./src
set(NPDet_EXE_NAMES
)
project(NPDet
VERSION 1.2.0
LANGUAGES CXX)
# Add concept detector names
set(NPDet_CONCEPT_NAMES
eRHIC
JLEIC
SiEIC
SoLID
)
# C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 17 CACHE STRING "Set the C++ standard to be used")
if(NOT CMAKE_CXX_STANDARD MATCHES "17|20|23")
message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}")
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Build type
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build type configuration" FORCE)
message(STATUS "Setting default build type: ${CMAKE_BUILD_TYPE}")
endif()
# Error on all warnings
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
#FIXME not ready for this...
#add_compile_options(-Wall -Wextra -Werror -pedantic)
endif()
# Export compile commands as json for run-clang-tidy
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(BUILD_DATA_MODEL "build the dd4pod datamodel" ON)
set(USE_GEOCAD ON CACHE BOOL "build the geocad library. Requires opencascade")
# ---------------------------------------------------------------------------
# set default install prefix and build type
# set default install prefix, build type, C++ standard
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE)
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "..." FORCE)
......@@ -29,42 +46,72 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "..." FORCE)
endif()
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17 CACHE STRING "...." FORCE)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
include(GNUInstallDirs)
# ---------------------------------------------------------------------------
# load additional OS dependent settings
include(cmake/os.cmake)
include(cmake/root.cmake)
set(PODIO "$ENV{PODIO}/lib/podio/cmake")
set(CMAKE_MODULE_PATH CMAKE_MODULE_PATH PODIO)
#----------------------------------------------------------------------------
# Find Libraries
find_package( DD4hep REQUIRED COMPONENTS DDCore DDG4 )
#----------------------------------------------------------------------------
# PODIO
find_package(podio 0.14.1 REQUIRED )
include_directories(${podio_INCLUDE_DIR})
# DD4hep
find_package( DD4hep 1.18 REQUIRED COMPONENTS DDCore DDG4 )
include(${DD4hep_DIR}/cmake/DD4hep.cmake)
include(${DD4hep_DIR}/cmake/DD4hepBuild.cmake)
dd4hep_configure_output()
dd4hep_set_compiler_flags()
# Opencascade
if(USE_GEOCAD)
find_package(OpenCASCADE)
endif()
#-----------------------------------------
# add the library sub directories
foreach(aSharedLib ${NPDet_LIB_NAMES})
add_subdirectory("src/${aSharedLib}")
endforeach(aSharedLib)
# libfmt
find_package(fmt REQUIRED)
# add the executable sub directories
foreach(anExeName ${NPDet_EXE_NAMES})
add_subdirectory("src/${anExeName}")
endforeach(anExeName)
#-----------------------------------------
# catch2 unit testing
enable_testing()
Include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.1)
FetchContent_MakeAvailable(Catch2)
#target_link_libraries(tests Catch2::Catch2)
# add the concept detector sub directories
foreach(aConceptName ${NPDet_CONCEPT_NAMES})
add_subdirectory("src/ConceptDetectors/${aConceptName}")
endforeach(aConceptName)
#-----------------------------------------
# add the library sub directories
add_subdirectory(src/detectors)
add_subdirectory(src/plugins)
add_subdirectory(src/dd4pod)
add_subdirectory(src/geocad)
add_subdirectory(src/config)
add_subdirectory(src/tools)
#----------------------------------------------------------------------------
# install examples
set(NPDet_EXAMPLES
)
install(FILES ${NPDet_EXAMPLES}
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/examples"
)
#----------------------------------------------------------------------------
# Add the config tool/script directory
add_subdirectory(src/config)
add_subdirectory(src/tools)
#set(NPDet_EXAMPLES
# )
#install(FILES ${NPDet_EXAMPLES}
# DESTINATION "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/examples"
# )
#----------------------------------------------------------------------------
# Install and export targets
......@@ -78,10 +125,10 @@ include(CMakePackageConfigHelpers)
set(TARGETS_INSTALL_PATH lib/NPDet/NPDetTargets.cmake)
CONFIGURE_PACKAGE_CONFIG_FILE(
cmake/NPDetConfig.cmake.in
cmake/NPDetConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/NPDetConfig.cmake
INSTALL_DESTINATION lib/NPDet
PATH_VARS TARGETS_INSTALL_PATH
PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR TARGETS_INSTALL_PATH
)
write_basic_package_version_file("NPDetConfigVersion.cmake"
......@@ -94,3 +141,7 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/NPDetConfigVersion.cmake
DESTINATION lib/NPDet
)
install(PROGRAMS
scripts/sanitize_hepmc3.py DESTINATION bin RENAME sanitize_hepmc3
)
NPDet - Nuclear Physics Detector Library
NPdet - Nuclear Physics Detector Library
========================================
* [Overview](#overview)
* [Installation](#installation)
+ [Dependencies](#dependencies)
+ [Building](#building)
+ [Getting Started](#getting-started)
- [Using the detector library](#using-the-detector-library)
- [Adding a detector to the library](#adding-a-detector-to-the-library)
* [Libraries](#libraries)
+ [Generic Detectors](#generic-detectors)
+ [Concept-Detectors](#concept-detectors)
- [SiEIC](#sieic)
- [JLEIC](#jleic)
- [SoLID](#solid)
- [clas12](#clas12)
- [eRHIC](#erhic)
* [Related Projects and Useful Links](#related-projects-and-useful-links)
A collection of detectors for simulating and building Nuclear Physics experiments.
Overview
--------
......@@ -28,21 +13,32 @@ simulation and reconstruction easier by providing a set of flexible
concept-detector can be created.
Documentation
-------------
- [User Manual found here](https://eic.phy.anl.gov/npdet/)
- [Reference API documentation](https://eic.phy.anl.gov/npdet/ref_doc)
Writing documentation:
- [restructured text syntax .rst](https://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html)
### Tutorials
Installation
------------
### Dependencies
### Singularity Container
The following are needed before building `NPDet`
The easiest way to use this library is the with the [eic_container](https://eicweb.phy.anl.gov/containers/eic_container/).
### Building
The following are needed before building `NPDet`
* [DD4hep](https://github.com/AIDAsoft/DD4hep)
* [ROOT](https://root.cern.ch)
* [GEANT4](http://geant4.cern.ch)
### Building
```
git clone https://eicweb.phy.anl.gov/EIC/NPDet.git
mkdir npdet_build && cd npdet_build
......@@ -51,54 +47,10 @@ make -j4
make install
```
### Getting Started
#### Using the detector library
Checkout the [`examples`](examples/README.md) directory for a quick start
on how to use the input.
#### Adding a detector to the library
Todo
Libraries
---------
### Generic Detectors
[more details about Generic Detectors](src/GenericDetectors/README.md)
### Concept-Detectors
#### SiEIC
[more details about SiEIC](src/ConceptDetectors/SiEIC/README.md)
#### JLEIC
[more details about JLEIC](src/ConceptDetectors/JLEIC/README.md)
#### SoLID
[more details about JLEIC](src/ConceptDetectors/SoLID/README.md)
#### clas12
[more details about JLEIC](src/ConceptDetectors/clas12/README.md)
#### eRHIC
[more details about eRHIC](src/ConceptDetectors/eRHIC/README.md)
Related Projects and Useful Links
---------------------------------
- [nprec](https://eicweb.phy.anl.gov/EIC/nprec)
- [lcgeo](https://github.com/iLCSoft/lcgeo)
- [FCCSW](https://github.com/HEP-FCC/FCCSW), [fcc](http://fccsw.web.cern.ch/fccsw/)
- [FCCSW](https://github.com/HEP-FCC/FCCSW),
- [PODIO](https://github.com/HEP-FCC/podio)
- [HepMC3](https://gitlab.cern.ch/hepmc/HepMC3.git)
1.2.0
#!/bin/bash
ps
source /usr/local/bin/thisroot.sh
source /usr/local/bin/thisdd4hep.sh
source /usr/local/bin/geant4.sh
mkdir build
cd build
cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local
make -j10
cmake -Bbuild -S. -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=install
cmake --build build -j30
cmake --build build --target test
cmake --install build
@PACKAGE_INIT@
include("@PACKAGE_TARGETS_INSTALL_PATH@")
include("${CMAKE_CURRENT_LIST_DIR}/NPDetTargets.cmake")
set_and_check(NPDet_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set_and_check(NPDet_LIBRARY_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
#set_and_check(NPDet_PYTHON_DIR "@PACKAGE_NPDet_PYTHON_INSTALLDIR@")
include(CMakeFindDependencyMacro)
find_dependency(ROOT @ROOT_VERSION@)
check_required_components(NPDet)
# - Try to find OpenCASCADE libraries
### Does not test what version has been found,though
### that could be done by parsing Standard_Version.hxx
# Once done, this will define
# OCC_FOUND - true if OCC has been found
# OCC_INCLUDE_DIR - the OCC include dir
# OCC_LIBRARIES (not cached) - full path of OCC libraries
set(_occdirs ${CASROOT} ${CASS_DIR} $ENV{CASROOT} /opt/occ)
find_path(OCC_INCLUDE_DIR
NAMES Standard_Real.hxx
HINTS ${_occdirs} /usr/include/opencascade /usr/include/oce
PATH_SUFFIXES inc
DOC "Specify the directory containing Standard_Real.hxx")
foreach(_libname ${OCC_FIND_COMPONENTS})
list(APPEND OCC_REQUIRED_LIBRARIES OCC_${_libname}_LIBRARY)
find_library(OCC_${_libname}_LIBRARY $
NAMES ${_libname}
HINTS ${_occdirs}
PATH_SUFFIXES lib)
if(OCC_${_libname}_LIBRARY)
list(APPEND OCC_LIBRARIES ${OCC_${_libname}_LIBRARY})
endif()
endforeach()
# handle the QUIETLY and REQUIRED arguments and set OCC_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OCC DEFAULT_MSG OCC_INCLUDE_DIR ${OCC_REQUIRED_LIBRARIES})
mark_as_advanced(OCC_INCLUDE_DIR ${OCC_REQUIRED_LIBRARIES})
This diff is collapsed.
This diff is collapsed.
/*
You probably do not need to edit this at all.
Add some SmartMenus required styles not covered in Bootstrap 3's default CSS.
These are theme independent and should work with any Bootstrap 3 theme mod.
*/
/* sub menus arrows on desktop */
.navbar-nav:not(.sm-collapsible) ul .caret {
position: absolute;
right: 0;
margin-top: 6px;
margin-right: 15px;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
border-left: 4px dashed;
}
.navbar-nav:not(.sm-collapsible) ul a.has-submenu {
padding-right: 30px;
}
/* make sub menu arrows look like +/- buttons in collapsible mode */
.navbar-nav.sm-collapsible .caret, .navbar-nav.sm-collapsible ul .caret {
position: absolute;
right: 0;
margin: -3px 15px 0 0;
padding: 0;
width: 32px;
height: 26px;
line-height: 24px;
text-align: center;
border-width: 1px;
border-style: solid;
}
.navbar-nav.sm-collapsible .caret:before {
content: '+';
font-family: monospace;
font-weight: bold;
}
.navbar-nav.sm-collapsible .open > a > .caret:before {
content: '-';
}
.navbar-nav.sm-collapsible a.has-submenu {
padding-right: 50px;
}
/* revert to Bootstrap's default carets in collapsible mode when the "data-sm-skip-collapsible-behavior" attribute is set to the ul.navbar-nav */
.navbar-nav.sm-collapsible[data-sm-skip-collapsible-behavior] .caret, .navbar-nav.sm-collapsible[data-sm-skip-collapsible-behavior] ul .caret {
position: static;
margin: 0 0 0 2px;
padding: 0;
width: 0;
height: 0;
border-top: 4px dashed;
border-right: 4px solid transparent;
border-bottom: 0;
border-left: 4px solid transparent;
}
.navbar-nav.sm-collapsible[data-sm-skip-collapsible-behavior] .caret:before {
content: '' !important;
}
.navbar-nav.sm-collapsible[data-sm-skip-collapsible-behavior] a.has-submenu {
padding-right: 15px;
}
/* scrolling arrows for tall menus */
.navbar-nav span.scroll-up, .navbar-nav span.scroll-down {
position: absolute;
display: none;
visibility: hidden;
height: 20px;
overflow: hidden;
text-align: center;
}
.navbar-nav span.scroll-up-arrow, .navbar-nav span.scroll-down-arrow {
position: absolute;
top: -2px;
left: 50%;
margin-left: -8px;
width: 0;
height: 0;
overflow: hidden;
border-top: 7px dashed transparent;
border-right: 7px dashed transparent;
border-bottom: 7px solid;
border-left: 7px dashed transparent;
}
.navbar-nav span.scroll-down-arrow {
top: 6px;
border-top: 7px solid;
border-right: 7px dashed transparent;
border-bottom: 7px dashed transparent;
border-left: 7px dashed transparent;
}
/* add more indentation for 2+ level sub in collapsible mode - Bootstrap normally supports just 1 level sub menus */
.navbar-nav.sm-collapsible ul .dropdown-menu > li > a,
.navbar-nav.sm-collapsible ul .dropdown-menu .dropdown-header {
padding-left: 35px;
}
.navbar-nav.sm-collapsible ul ul .dropdown-menu > li > a,
.navbar-nav.sm-collapsible ul ul .dropdown-menu .dropdown-header {
padding-left: 45px;
}
.navbar-nav.sm-collapsible ul ul ul .dropdown-menu > li > a,
.navbar-nav.sm-collapsible ul ul ul .dropdown-menu .dropdown-header {
padding-left: 55px;
}
.navbar-nav.sm-collapsible ul ul ul ul .dropdown-menu > li > a,
.navbar-nav.sm-collapsible ul ul ul ul .dropdown-menu .dropdown-header {
padding-left: 65px;
}
/* fix SmartMenus sub menus auto width (subMenusMinWidth and subMenusMaxWidth options) */
.navbar-nav .dropdown-menu > li > a {
white-space: normal;
}
.navbar-nav ul.sm-nowrap > li > a {
white-space: nowrap;
}
.navbar-nav.sm-collapsible ul.sm-nowrap > li > a {
white-space: normal;
}
/* fix .navbar-right subs alignment */
.navbar-right ul.dropdown-menu {
left: 0;
right: auto;
}
\ No newline at end of file
/*!
* SmartMenus jQuery Plugin Bootstrap Addon - v0.3.1 - November 1, 2016
* http://www.smartmenus.org/
*
* Copyright Vasil Dinkov, Vadikom Web Ltd.
* http://vadikom.com
*
* Licensed MIT
*/
(function(factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery', 'jquery.smartmenus'], factory);
} else if (typeof module === 'object' && typeof module.exports === 'object') {
// CommonJS
module.exports = factory(require('jquery'));
} else {
// Global jQuery
factory(jQuery);
}
} (function($) {
$.extend($.SmartMenus.Bootstrap = {}, {
keydownFix: false,
init: function() {
// init all navbars that don't have the "data-sm-skip" attribute set
var $navbars = $('ul.navbar-nav:not([data-sm-skip])');
$navbars.each(function() {
var $this = $(this),
obj = $this.data('smartmenus');
// if this navbar is not initialized
if (!obj) {
$this.smartmenus({
// these are some good default options that should work for all
// you can, of course, tweak these as you like
subMenusSubOffsetX: 2,
subMenusSubOffsetY: -6,
subIndicators: false,
collapsibleShowFunction: null,
collapsibleHideFunction: null,
rightToLeftSubMenus: $this.hasClass('navbar-right'),
bottomToTopSubMenus: $this.closest('.navbar').hasClass('navbar-fixed-bottom')
})
.bind({
// set/unset proper Bootstrap classes for some menu elements
'show.smapi': function(e, menu) {
var $menu = $(menu),
$scrollArrows = $menu.dataSM('scroll-arrows');
if ($scrollArrows) {
// they inherit border-color from body, so we can use its background-color too
$scrollArrows.css('background-color', $(document.body).css('background-color'));
}
$menu.parent().addClass('open');
},
'hide.smapi': function(e, menu) {
$(menu).parent().removeClass('open');
}
});
function onInit() {
// set Bootstrap's "active" class to SmartMenus "current" items (should someone decide to enable markCurrentItem: true)
$this.find('a.current').parent().addClass('active');
// remove any Bootstrap required attributes that might cause conflicting issues with the SmartMenus script
$this.find('a.has-submenu').each(function() {
var $this = $(this);
if ($this.is('[data-toggle="dropdown"]')) {
$this.dataSM('bs-data-toggle-dropdown', true).removeAttr('data-toggle');
}
if ($this.is('[role="button"]')) {
$this.dataSM('bs-role-button', true).removeAttr('role');
}
});
}
onInit();
function onBeforeDestroy() {
$this.find('a.current').parent().removeClass('active');
$this.find('a.has-submenu').each(function() {
var $this = $(this);
if ($this.dataSM('bs-data-toggle-dropdown')) {
$this.attr('data-toggle', 'dropdown').removeDataSM('bs-data-toggle-dropdown');
}
if ($this.dataSM('bs-role-button')) {
$this.attr('role', 'button').removeDataSM('bs-role-button');
}
});
}
obj = $this.data('smartmenus');
// custom "isCollapsible" method for Bootstrap
obj.isCollapsible = function() {
return !/^(left|right)$/.test(this.$firstLink.parent().css('float'));
};
// custom "refresh" method for Bootstrap
obj.refresh = function() {
$.SmartMenus.prototype.refresh.call(this);
onInit();
// update collapsible detection
detectCollapsible(true);
};
// custom "destroy" method for Bootstrap
obj.destroy = function(refresh) {
onBeforeDestroy();
$.SmartMenus.prototype.destroy.call(this, refresh);
};
// keep Bootstrap's default behavior for parent items when the "data-sm-skip-collapsible-behavior" attribute is set to the ul.navbar-nav
// i.e. use the whole item area just as a sub menu toggle and don't customize the carets
if ($this.is('[data-sm-skip-collapsible-behavior]')) {
$this.bind({
// click the parent item to toggle the sub menus (and reset deeper levels and other branches on click)
'click.smapi': function(e, item) {
if (obj.isCollapsible()) {
var $item = $(item),
$sub = $item.parent().dataSM('sub');
if ($sub && $sub.dataSM('shown-before') && $sub.is(':visible')) {
obj.itemActivate($item);
obj.menuHide($sub);
return false;
}
}
}
});
}
// onresize detect when the navbar becomes collapsible and add it the "sm-collapsible" class
var winW;
function detectCollapsible(force) {
var newW = obj.getViewportWidth();
if (newW != winW || force) {
var $carets = $this.find('.caret');
if (obj.isCollapsible()) {
$this.addClass('sm-collapsible');
// set "navbar-toggle" class to carets (so they look like a button) if the "data-sm-skip-collapsible-behavior" attribute is not set to the ul.navbar-nav
if (!$this.is('[data-sm-skip-collapsible-behavior]')) {
$carets.addClass('navbar-toggle sub-arrow');
}
} else {
$this.removeClass('sm-collapsible');
if (!$this.is('[data-sm-skip-collapsible-behavior]')) {
$carets.removeClass('navbar-toggle sub-arrow');
}
}
winW = newW;
}
}
detectCollapsible();
$(window).bind('resize.smartmenus' + obj.rootId, detectCollapsible);
}
});
// keydown fix for Bootstrap 3.3.5+ conflict
if ($navbars.length && !$.SmartMenus.Bootstrap.keydownFix) {
// unhook BS keydown handler for all dropdowns
$(document).off('keydown.bs.dropdown.data-api', '.dropdown-menu');
// restore BS keydown handler for dropdowns that are not inside SmartMenus navbars
if ($.fn.dropdown && $.fn.dropdown.Constructor) {
$(document).on('keydown.bs.dropdown.data-api', '.dropdown-menu:not([id^="sm-"])', $.fn.dropdown.Constructor.prototype.keydown);
}
$.SmartMenus.Bootstrap.keydownFix = true;
}
}
});
// init ondomready
$($.SmartMenus.Bootstrap.init);
return $;
}));
\ No newline at end of file