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

Target

Select target project
  • CbmSoft/cbmroot_legacy_svn
  • r.karabowicz/Old_CbmRoot
2 results
Show changes
Commits on Source (1385)
Showing with 283 additions and 13150 deletions
stages:
- build
- documentation
CbmRoot_Continuous:
stage: build
tags:
- CbmRoot
only:
- master
only:
variables:
- $CI_PROJECT_PATH == "CbmSoft/CbmRoot"
cache:
paths:
- build/
- external/DataTree/
- external/DataTreeQA/
- external/KFParticle/
- external/NicaFemto/
- external/Vc/
- external/cppzmq/
- external/flib_dpb/flib_dpb/
- external/flib_dpb_20/
- external/ipc/ipc/
- external/ipc_legacy/ipc/
- external/jsroot/
- external/spadic/spadic/
- input
- geometry
- parameters
script:
- set -xv
- mkdir -p build
- cd build
- find . -name "*.root" -delete
- find . -name "*_ok" -delete
- find . -name "all_*.par" -delete
- cd ..
- echo "export LINUX_FLAVOUR=Debian8.11" >> Dart.cfg
- echo "export FAIRSOFT_VERSION=jun19p1" >> Dart.cfg
- echo "export FAIRROOT_VERSION=v18.2.0" >> Dart.cfg
- echo "export SIMPATH=/cvmfs/fairroot.gsi.de/fairsoft/\${FAIRSOFT_VERSION}" >> Dart.cfg
- echo "export FAIRROOTPATH=/cvmfs/fairroot.gsi.de/fairroot/\${FAIRROOT_VERSION}_fairsoft-\${FAIRSOFT_VERSION}" >> Dart.cfg
- echo "export BUILDDIR=$PWD/build" >> Dart.cfg
- echo "export SOURCEDIR=$PWD" >> Dart.cfg
- echo "export NCPU=5" >> Dart.cfg
- echo "export PATH=\$SIMPATH/bin:$PATH" >> Dart.cfg
- ls
- pwd
- cat Dart.cfg
- $PWD/Dart.sh Continuous Dart.cfg
- cd build
- find . -name "*.root" -delete
- find . -name "*_ok" -delete
- find . -name "all_*.par" -delete
- cd ..
FormatCheck:
stage: build
tags:
- CbmRoot
only:
- merge_requests
only:
variables:
- $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH == "CbmSoft/CbmRoot"
script:
- set -xv
- echo "export FAIRSOFT_VERSION=jun19p1" >> Dart.cfg
- echo "export FAIRROOT_VERSION=v18.2.0" >> Dart.cfg
- echo "export SIMPATH=/cvmfs/fairroot.gsi.de/fairsoft/\${FAIRSOFT_VERSION}" >> env.sh
- echo "export BUILDDIR=$PWD/build" >> env.sh
- echo "export SOURCEDIR=$PWD" >> env.sh
- echo "export PATH=\$SIMPATH/bin:$PATH" >> env.sh
- ls
- pwd
- cat env.sh
- . ./env.sh && ctest -S cmake/scripts/checkformat.cmake -VV
CbmRoot_Merge:
stage: build
tags:
- CbmRoot
only:
- merge_requests
only:
variables:
- $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH == "CbmSoft/CbmRoot"
script:
- set -xv
- echo "export LINUX_FLAVOUR=Debian8.11" >> Dart.cfg
- echo "export FAIRSOFT_VERSION=jun19p1" >> Dart.cfg
- echo "export FAIRROOT_VERSION=v18.2.0" >> Dart.cfg
- echo "export SIMPATH=/cvmfs/fairroot.gsi.de/fairsoft/\${FAIRSOFT_VERSION}" >> Dart.cfg
- echo "export FAIRROOTPATH=/cvmfs/fairroot.gsi.de/fairroot/\${FAIRROOT_VERSION}_fairsoft-\${FAIRSOFT_VERSION}" >> Dart.cfg
- echo "export BUILDDIR=$PWD/build" >> Dart.cfg
- echo "export SOURCEDIR=$PWD" >> Dart.cfg
- echo "export NCPU=5" >> Dart.cfg
- echo "export PATH=\$SIMPATH/bin:$PATH" >> Dart.cfg
- ls
- pwd
- cat Dart.cfg
- $PWD/Dart.sh Nightly Dart.cfg
pages:
stage: documentation
image: alpine
tags:
- docker
script:
- apk update && apk add doxygen
- doxygen doxygen/cbmDoxyfile.conf
- mv html-doc/html public/
artifacts:
paths:
- public
only:
- doxygen
# The name of our project is "CBMROOT". CMakeLists files in this project can
# refer to the root source directory of the project as ${CBMROOT_SOURCE_DIR} or
# as ${CMAKE_SOURCE_DIR} and to the root binary directory of the project as
# as ${CMAKE_SOURCE_DIR} and to the root binary directory of the project as
# ${CBMROOT_BINARY_DIR} or ${CMAKE_BINARY_DIR}.
# This difference is important for the base classes which are in CBMROOT
# This difference is important for the base classes which are in CBMROOT
# and PANDAROOT.
# Check if cmake has the required version
# For the CTest fixtures at least CMake 3.7.2 is needed.
CMAKE_MINIMUM_REQUIRED(VERSION 3.7.2 FATAL_ERROR)
# Since NicaFempto requires 3.11.0 we should be consistent while we
# build it in the CbmRoot context
CMAKE_MINIMUM_REQUIRED(VERSION 3.11.0 FATAL_ERROR)
# Set name of our project to "CBMROOT". Has to be done
# after check of cmake version
# after check of cmake version
project(CBMROOT)
FIND_PATH(FAIRBASE NAMES FairRun.h PATHS
${CMAKE_SOURCE_DIR}/base/steer
${CBMBASE_DIR}/steer
NO_DEFAULT_PATH
)
......@@ -30,12 +33,14 @@ Else (FAIRBASE)
EndIf (FAIRBASE)
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/
# is checked
set(CMAKE_MODULE_PATH "${FAIRROOTPATH}/share/fairbase/cmake/modules_old" ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH "${FAIRROOTPATH}/share/fairbase/cmake/modules" ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH "$ENV{SIMPATH}/share/cmake/ZeroMQ" ${CMAKE_PREFIX_PATH})
# Check if the compiler support specific C++11 features
# Up to now this is only a check since the code does not use
# any of the features of the new standard
......@@ -51,7 +56,13 @@ if(FAIRROOTPATH)
SET(MY_ROOT_INCLUDE_PATH ${FAIRROOT_INCLUDE_DIR})
If(CMAKE_INSTALL_PREFIX)
Message("***** HERE *****")
SET(MY_ROOT_INCLUDE_PATH ${MY_ROOT_INCLUDE_PATH} "${CMAKE_INSTALL_PREFIX}/include")
SET(MY_ROOT_INCLUDE_PATH
${MY_ROOT_INCLUDE_PATH}
"${CMAKE_INSTALL_PREFIX}/include"
"${CMAKE_INSTALL_PREFIX}/include/mvd"
"${CMAKE_INSTALL_PREFIX}/include/littrack"
"${CMAKE_INSTALL_PREFIX}/include/KF"
)
EndIf(CMAKE_INSTALL_PREFIX)
endif(FAIRROOTPATH)
......@@ -68,20 +79,20 @@ Include(ExternalProject)
# CbmRoot uses from 22.07.15 C++11, so we need an compiler which supports C++11
# Check if the used compiler support C++11. If not stop with an error message
# Check also if FairSoft and FairRoot have been compiled with C++11 support
# Check also if FairSoft and FairRoot have been compiled with C++11 support
If(NOT _HAS_CXX11_FLAG)
Message(FATAL_ERROR "The used C++ compiler (${CMAKE_CXX_COMPILER}) does not support C++11. CbmRoot can only be compiled with compilers supporting C++11. Please install such an compiler.")
EndIf()
Execute_process(COMMAND $ENV{SIMPATH}/bin/fairsoft-config --cxxflags OUTPUT_VARIABLE _res_fairsoft_config OUTPUT_STRIP_TRAILING_WHITESPACE)
String(FIND ${_res_fairsoft_config} "-std=c++11" POS_C++11)
If(${POS_C++11} EQUAL -1)
If(${POS_C++11} EQUAL -1)
Message(FATAL_ERROR "FairSoft wasn't compiled with c++11 support. Please recompile FairSoft with a compiler which supports c++11.")
EndIf()
Execute_process(COMMAND $ENV{SIMPATH}/bin/fairsoft-config --root-version OUTPUT_VARIABLE _res_root_version OUTPUT_STRIP_TRAILING_WHITESPACE)
String(FIND ${_res_root_version} "Usage" POS_USAGE)
If(${POS_USAGE} EQUAL 1)
If(${POS_USAGE} EQUAL 1)
Message(FATAL_ERROR "FairSoft version to old. At least nov15 compiled with ROOT6 is needed.")
EndIf()
If(NOT ${_res_root_version} EQUAL 6)
......@@ -90,18 +101,18 @@ EndIf()
# Extract the FairRoot version from fairroot-config
# The version info is of the form Major.Minor.Patch e.g. 15.11.1 and
# is stored in the variable FairRoot_VERSION and FairSoft_VERSION
# is stored in the variable FairRoot_VERSION and FairSoft_VERSION
FairRootVersion()
FairSoftVersion()
# Since 20.02.2019 CbmRoot need at least FairRoot v18.0.5 and FairSoft may18
# Check if FairRoot and FairSoft have at least this versions
# Check if FairRoot and FairSoft have at least this versions
If(FairRoot_VERSION VERSION_LESS 18.0.5)
Message(FATAL_ERROR "\n CbmRoot needs at least FairRoot version v18.0.5. \n You use FairRoot ${FairRoot_VERSION}. Please upgrade your FairRoot version.")
Message(FATAL_ERROR "\n CbmRoot needs at least FairRoot version v18.0.5. \n You use FairRoot ${FairRoot_VERSION}. Please upgrade your FairRoot version.")
EndIf()
# FairSoft version 18.5.0 means may18
If(FairSoft_VERSION VERSION_LESS 18.5.0)
Message(FATAL_ERROR "\n CbmRoot needs at least FairSoft version may18. \n You use FairSoft ${_fairsoft_version}. Please upgrade your FairSoft version.")
Message(FATAL_ERROR "\n CbmRoot needs at least FairSoft version may18. \n You use FairSoft ${_fairsoft_version}. Please upgrade your FairSoft version.")
EndIf()
Execute_process(COMMAND $ENV{FAIRROOTPATH}/bin/fairroot-config --fairsoft_path OUTPUT_VARIABLE _simpath OUTPUT_STRIP_TRAILING_WHITESPACE)
......@@ -118,7 +129,52 @@ EndIf()
#Check the compiler and set the compile and link flags
If(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
Set(_default_build_type FullWarnings)
Set(_cflags "-g -O2")
Set(_cxxflags "-g -O2 -Wshadow -Wall -Wextra -Wunused-variable")
String(TOUPPER ${_default_build_type} upper_build_type )
Set(_build_type_cxx CMAKE_CXX_FLAGS_${upper_build_type})
Set(_build_type_c CMAKE_C_FLAGS_${upper_build_type})
Set(_exe_linker_flags CMAKE_EXE_LINKER_FLAGS_${upper_build_type})
Set(_module_linker_flags CMAKE_MODULE_LINKER_FLAGS_${upper_build_type})
Set(_shared_linker_flags CMAKE_SHARED_LINKER_FLAGS_${upper_build_type})
Set(_static_linker_flags CMAKE_STATIC_LINKER_FLAGS_${upper_build_type})
Message("No build type defined on command line. Set the build type ${_default_build_type}")
Message("CXX_FLAGS: ${_cxxflags}")
Message("C_FLAGS: ${_cflags}")
Set(CMAKE_BUILD_TYPE ${_default_build_type} CACHE STRING "Choose the type of build." FORCE)
If(CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin)
If(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Set(${_build_type_cxx} ${_cxxflags} CACHE STRING "Flags used by the CXX compiler during FullWarnings builds.")
Set(${_build_type_c} ${_cflags} CACHE STRING "Flags used by the C compiler during FullWarnings builds.")
Set(${_exe_linker_flags} "" CACHE STRING "Flags used by the linker during FullWarnings builds.")
Set(${_module_linker_flags} "" CACHE STRING "Flags used by the linker during the creation of modules during FullWarnings builds.")
Set(${_shared_linker_flags} "" CACHE STRING "Flags used by the linker during the creation of shared libraries during FullWarnings builds.")
Set(${_static_linker_flags} "" CACHE STRING "Flags used by the linker during the creation of static libraries during FullWarnings builds.")
mark_as_advanced(
${_build_type_cxx}
${_build_type_c}
${_exe_linker_flags}
${_module_linker_flags}
${_shared_linker_flags}
${_static_linker_flags}
)
EndIf()
EndIf()
EndIf()
If(CMAKE_BUILD_TYPE MATCHES CONTINUOUS)
Set(CMAKE_CXX_FLAGS_CONTINUOUS "-g -O2 -Wshadow -Wall -Wextra -Wunused-variable")
Set(CMAKE_C_FLAGS_CONTINUOUS "-g -O2")
Message("The build type is CONTINUOUS")
Message("CXX_FLAGS: ${CMAKE_CXX_FLAGS_CONTINUOUS}")
Message("C_FLAGS: ${CMAKE_C_FLAGS_CONTINUOUS}")
EndIf()
Check_Compiler()
set(CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES} "CONTINUOUS" "FullWarnings")
#Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wshadow -Weffc++ -Wno-unused-variable -Wno-unused-parameter -Wno-sign-compare -Wno-ignored-qualifiers -Wno-overloaded-virtual")
#Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -Wno-padded -Wno-global-constructors")
#Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-documentation -Wno-padded -Wno-global-constructors -Wno-exit-time-destructors -Wno-extra-semi -Wno-weak-vtables -Wno-unused-member-function")
......@@ -151,7 +207,7 @@ CHECK_OUT_OF_SOURCE_BUILD()
# message
IF(NOT UNIX)
MESSAGE(FATAL_ERROR "You're not on an UNIX system. The project was up to now only tested on UNIX systems, so we break here. If you want to go on please edit the CMakeLists.txt in the source directory.")
ENDIF(NOT UNIX)
ENDIF(NOT UNIX)
#Check if necessary environment variables are set
#If not stop execution
......@@ -186,23 +242,17 @@ else(CBMROOT_MINIMAL)
find_package(GEANT4VMC)
find_package(TBB)
find_package(SSE)
find_package(IWYU)
# find_package(IWYU)
find_package(ZeroMQ)
Set(Boost_NO_SYSTEM_PATHS TRUE)
Set(Boost_NO_BOOST_CMAKE TRUE)
# set(Boost_DEBUG TRUE)
If(${ROOT_LIBRARY_DIR} MATCHES /lib/root)
set(BOOST_ROOT ${SIMPATH})
set(GSL_DIR ${SIMPATH})
Else(${ROOT_LIBRARY_DIR} MATCHES /lib/root)
set(BOOST_ROOT ${SIMPATH}/basics/boost)
set(GSL_DIR ${SIMPATH}/basics/gsl)
EndIf(${ROOT_LIBRARY_DIR} MATCHES /lib/root)
set(BOOST_ROOT ${SIMPATH})
set(GSL_DIR ${SIMPATH})
Message("-- Looking for Boost ...")
# If an older version of boost is found both of the variables below are
# cached and in a second cmake run, a good boost version is found even
# if the version is to old.
# cached and in a second cmake run, a good boost version is found even
# if the version is to old.
# To overcome this problem both variables are cleared before checking
# for boost.
Unset(Boost_INCLUDE_DIR CACHE)
......@@ -225,9 +275,14 @@ endif(CBMROOT_MINIMAL)
# Defines all basic include directories from fairbase
SetBasicVariables()
# Add the Geant3 include directory such that ROOT can find TGeant3.h
# Has to be done after calling SetBasicVariables, otherwise the value
# is overwritten
SET(ROOT_INCLUDE_PATH ${ROOT_INCLUDE_PATH} "${GEANT3_INCLUDE_DIR}")
Set(BASE_INCLUDE_DIRECTORIES
${BASE_INCLUDE_DIRECTORIES}
${SYSTEM_INCLUDE_DIRECTORIES}
${BASE_INCLUDE_DIRECTORIES}
${SYSTEM_INCLUDE_DIRECTORIES}
)
# Set the library version in the main CMakeLists.txt
......@@ -248,7 +303,7 @@ Else()
)
EndIf()
SET(CBMLIBDIR ${CMAKE_BINARY_DIR}/lib)
SET(CBMLIBDIR ${CMAKE_BINARY_DIR}/lib)
SET(LD_LIBRARY_PATH ${CBMLIBDIR} ${Boost_LIBRARY_DIRS} ${LD_LIBRARY_PATH})
# Recurse into the given subdirectories. This does not actually
......@@ -260,96 +315,48 @@ If(CMAKE_SYSTEM_NAME MATCHES Darwin)
Check_Include_File("_types/_uint8_t.h" _UINT8_T_EXIST)
EndIf()
Option(BUILD_UNITTESTS "Build all unit tests and add them as new tests" ON)
If(BUILD_UNITTESTS)
Message("Build the unit tests.")
Set(GTEST_ROOT ${SIMPATH})
Find_Package(GTest)
EndIf(BUILD_UNITTESTS)
### Subdirectories to be compiled #####
### Extrenals included as svn externals
### Externals included as svn externals
add_subdirectory (external)
### Base directories
add_subdirectory (base)
add_subdirectory (data)
add_subdirectory (core)
add_subdirectory (sim)
add_subdirectory (field)
add_subdirectory (generators)
add_subdirectory (run)
### Module directories
add_subdirectory (passive)
add_subdirectory (mvd)
add_subdirectory (sts)
add_subdirectory (rich)
add_subdirectory (much)
add_subdirectory (trd)
add_subdirectory (tof)
add_subdirectory (ecal)
add_subdirectory (psd)
### Reco directories
add_subdirectory (global)
add_subdirectory (L1)
add_subdirectory (KF)
add_subdirectory (littrack)
add_subdirectory (tracking)
add_subdirectory (eventbuilder)
### Analysis directories
add_subdirectory (reco)
add_subdirectory (analysis)
add_subdirectory (dilept)
add_subdirectory (hadron)
add_subdirectory (macro)
#####add_subdirectory (trdcatrack)
#add_subdirectory (vis)
### Detector directories
add_subdirectory (mvd)
### Others
add_subdirectory (macro)
add_subdirectory(fles)
If(FAIRMQ_FOUND)
add_subdirectory(MQ)
EndIf()
add_subdirectory(tutorials)
add_subdirectory (beamtime)
Option(BUILD_UNITTESTS "Build all unit tests and add them as new tests" ON)
If(BUILD_UNITTESTS)
Message("Build the unit tests.")
Set(GTEST_ROOT ${SIMPATH})
Find_Package(GTest)
If(GTEST_FOUND)
Message("Add tests library and tests.")
Add_Subdirectory(test)
EndIf(GTEST_FOUND)
EndIf(BUILD_UNITTESTS)
add_custom_target(cleanlib
COMMAND ${CMAKE_COMMAND} -E remove libCbm*
COMMAND ${CMAKE_COMMAND} -E remove G__Cbm*
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
Execute_Process(COMMAND ${ROOT_CONFIG_EXECUTABLE} --has-opengl
OUTPUT_VARIABLE EveIsBuild
OUTPUT_STRIP_TRAILING_WHITESPACE
)
If(${EveIsBuild} STREQUAL yes)
Message(STATUS "Build the eventdisplay.")
add_subdirectory (eventdisplay)
Else(${EveIsBuild} STREQUAL yes)
Message(STATUS "The eventdisplay is not build, there is no OpenGL support.")
EndIf(${EveIsBuild} STREQUAL yes)
##set(BUILD_BEAMTIME FALSE CACHE BOOL "Build everything needed (DABC, RocLib ...) to read testbeam data.")
#If(BUILD_BEAMTIME)
## add_subdirectory (roclight)
# add_subdirectory (roc)
# add_subdirectory (beamtime)
#else(BUILD_BEAMTIME)
# tof beamtime software is needed for the new tof tracking and fles
# It requires EITHER roc OR roclight to be compiled
add_subdirectory (roclight)
add_subdirectory (beamtime/tof)
add_subdirectory (beamtime)
#EndIf(BUILD_BEAMTIME)
add_custom_target(cleantest
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/scripts/cleantest.cmake
)
Option(BUILD_DOXYGEN "Build Doxygen" OFF)
if(BUILD_DOXYGEN)
......@@ -359,7 +366,7 @@ endif(BUILD_DOXYGEN)
if(RULE_CHECKER_FOUND)
ADD_CUSTOM_TARGET(RULES
ADD_CUSTOM_TARGET(RULES
COMMAND ${RULE_CHECKER_SCRIPT1} ${CMAKE_BINARY_DIR} viol > violations.html
DEPENDS $ENV{ALL_RULES})
......@@ -377,7 +384,13 @@ if(NOT CBMROOT_MINIMAL)
WRITE_CONFIG_FILE(config.sh)
WRITE_CONFIG_FILE(config.csh)
SET(ROOT_INCLUDE_PATH ${ROOT_INCLUDE_PATH} "${CMAKE_INSTALL_PREFIX}/include")
SET(ROOT_INCLUDE_PATH
${ROOT_INCLUDE_PATH}
"${CMAKE_INSTALL_PREFIX}/include"
"${CMAKE_INSTALL_PREFIX}/include/mvd"
"${CMAKE_INSTALL_PREFIX}/include/littrack"
"${CMAKE_INSTALL_PREFIX}/include/KF"
)
SET(VMCWORKDIR ${CMAKE_INSTALL_PREFIX}/share/cbmroot)
WRITE_CONFIG_FILE(config.sh_install)
WRITE_CONFIG_FILE(config.csh_install)
......@@ -403,6 +416,6 @@ Install(FILES ${CMAKE_BINARY_DIR}/config.csh_install
)
Install(DIRECTORY gconfig geometry input parameters
Install(DIRECTORY geometry input parameters
DESTINATION share/cbmroot
PATTERN ".svn" EXCLUDE)
PATTERN ".git" EXCLUDE)
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
......@@ -38,158 +38,26 @@ Set(CTEST_CUSTOM_ERROR_EXCEPTION
set(CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION}
# -- doxygen warnings
# "of command \@param is not found in the argument list of"
# "for \\link command"
# "for \\ref command"
# "\\class statement"
# "\\file statement"
# "are not documented:"
# "Skipping documentation"
# "has a brief description"
# -- CLHEP and Pluto warnings
# "/include/CLHEP/"
"CLHEP"
"PParticle.h"
"PDataBase.h"
"PMesh.h"
"PStaticData.h"
"PUtils.h"
"PDistribution.h"
"/pluto/"
# -- htrack warnings
# should be switched on, but there are so many
# "htrack"
"bitfield::operator"
"bytefield::operator"
"bitfield operator"
"bytefield operator"
"DataRootObjectLIB/src/histogramData.cxx"
# -- warnings from ubuntu systems which are a little to much
# -- probably defined warn-unused-result. ignoring the result
# -- of fgets is common practice. A work around would be to
# -- store the return value in a dummy variable
"ignoring return value of 'char* fgets(char*, int, FILE*)'"
"ignoring return value of 'char* fscanf(char*, int, FILE*)'"
# -- boost warnings
"/include/boost/exception/exception.hpp:"
"/include/boost/smart_ptr/detail/sp_convertible.hpp:"
"/include/boost/smart_ptr/shared_ptr.hpp:"
"/include/boost"
"/boost/include"
# -- Root warnings when installed in installation dir
"/include/root/"
# -- Root warnings which should not show up in the test setup
"/include/G__ci.h:"
"/include/TAttImage.h:"
"/include/TBuffer.h"
"/include/TChainElement.h"
"/include/TCollectionProxyInfo.h"
"/include/TCut.h:"
"/include/TEveBoxSet.h:"
"/include/TEveTrackPropagator.h:"
"/include/TEveTrackPropagator.h:"
"/include/TEveVector.h:"
"/include/TFcnAdapter.h:"
"/include/TFitterMinuit.h:"
"/include/TGeoMatrix.h:"
"/include/TGeoPainter.h:"
"/include/TGDMLParse.h"
"/include/TList.h:"
"/include/TMap.h:"
"/include/TMatrixT.h:"
"/include/TMatrixTSym.h:"
"/include/TMemberInspector.h:"
"/include/TObjArray.h:"
"/include/TRefArray.h:"
"/include/TString.h"
"/include/Minuit2/BasicFunctionGradient.h:"
"/include/Minuit2/MnUserParameterState.h:"
"/include/Minuit2/StackAllocator.h:"
"/include/TMVA/ClassInfo.h:"
"/include/TMVA/Config.h:"
"/include/TMVA/Configurable.h:"
"/include/TMVA/DataInputHandler.h:"
"/include/TMVA/DataSet.h:"
"/include/TMVA/DataSetInfo.h:"
"/include/TMVA/DataSetManager.h:"
"/include/TMVA/Event.h:"
"/include/TMVA/Factory.h:"
"/include/TMVA/KDEKernel.h:"
"/include/TMVA/Option.h:"
"/include/TMVA/PDF.h:"
"/include/TMVA/Reader.h:"
"/include/TMVA/Types.h:"
# -- Geant3 warnings
"TGeant3.h"
"TGeant3TGeo.h"
# -- Errors which are filtered for the time being
# -- MbsAPI is only a copy from elsewhere so don't know what to do
# -- FairTSBufferFunctional.h has to be fixed by Tobias
"MbsAPI"
"FairTSBufferFunctional.h"
"FairRegistry.h"
"FairDbTableRow.h"
"FairDbResult.h"
"FairDbValidityRec.h"
"Fair"
"base/source"
"std::binary_function"
# -- VC warnings
"common/undomacros.h"
"common/macros.h"
"common/types.h"
"common/storage.h"
"common/aliasingentryhelper.h"
"common/logarithm.h"
"common/vectortuple.h"
"common/interleavedmemory.h"
"avx/vectorhelper.h"
"avx/mask.h"
"avx/limits.h"
"avx/vector.h"
"avx/writemaskedvector.h"
"avx/writemaskedvector.tcc"
"avx/writemaskedvector.tcc"
"sse/mask.h"
"sse/vector.h"
"sse/limits.h"
"sse/types.h"
"sse/helperimpl.h"
"sse/vector.tcc"
"sse/vectorhelper.h"
"sse/vectorhelper.tcc"
"sse/casts.h"
"sse/shuffle.h"
"sse/intrinsics.h"
"Vc/Allocator"
"Vc/global.h"
# -- warnings from fles subdirector
"external/ipc"
"external/ipc_legacy"
"fles/ctrl"
"external/flib_dpb"
"external/flib_dpb_20"
"external/spadic"
"fles/tsclient"
"fles/softdpb"
"fles/reader.*old-style cast"
"L1/vectors/P4_F32vec4.h"
"Dict.cxx"
# -- warnings from our external packages
"external/flib_dpb"
# "external/flib_dpb_20"
"external/ipc"
# -- remove intended fall through warnings
"CbmMcbm2018UnpackerAlgoTof.cxx.*warning: this statement may fall through"
"CbmMcbm2018UnpackerAlgoTof.cxx.*note: here"
"CbmDeviceUnpackTofMcbm2018.cxx.*warning: this statement may fall through"
"CbmDeviceUnpackTofMcbm2018.cxx.*note: here"
"PairAnalysisHistos.cxx.*warning: this statement may fall through"
"PairAnalysisHistos.cxx.*note: here"
# -- warnings from structures for HADAQ memory casting
"struct hadaq::HadTu"
"struct hadaq::HadTuId"
"TrbBridgeTrbNetHeaders.hpp"
"TrbBridgeTrbNetHeaders.cpp"
# -- warnings from structures for MBS/LMD memory casting
"struct mbs::Header"
......@@ -198,7 +66,7 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
"warning: text-based stub file"
# -- don't show pragma message warnings
"#pragma message: Compiling CBM Configuration"
"Compiling CBM Configuration"
)
# -----------------------------------------------------------
......
......@@ -28,7 +28,12 @@ Else()
Set(CTEST_USE_LAUNCHERS 1)
EndIf()
String(TOUPPER $ENV{ctest_model} _Model)
If(NOT $ENV{ctest_model} MATCHES Weekly)
String(TOUPPER $ENV{ctest_model} _Model)
Else()
Set(_Model PROFILE)
EndIf()
If(EXTRA_FLAGS)
Set(CTEST_CONFIGURE_COMMAND " \"${CMAKE_EXECUTABLE_NAME}\" \"-G${CTEST_CMAKE_GENERATOR}\" \"-DCMAKE_BUILD_TYPE=${_Model}\" \"-DCTEST_USE_LAUNCHERS=${CTEST_USE_LAUNCHERS}\" \"${EXTRA_FLAGS}\" \"${CTEST_SOURCE_DIRECTORY}\" ")
Else()
......@@ -50,22 +55,24 @@ If($ENV{ctest_model} MATCHES Nightly OR $ENV{ctest_model} MATCHES Weekly OR $ENV
# get the information about conflicting or localy modified files
# from svn, extract the relavant information about the file name
# and put the result in the output variable
Execute_Process(COMMAND svn stat -u
COMMAND grep ^[CM]
COMMAND cut -c21-
OUTPUT_VARIABLE FILELIST
)
# create out of the output a cmake list. This step is done to convert the
# stream into seperated filenames.
# The trick is to exchange an "\n" by an ";" which is the separartor in
# a list created by cmake
String(REGEX REPLACE "\n" ";" _result "${FILELIST}")
ForEach(_file ${_result})
String(STRIP "${_file}" _file1)
Set(CTEST_NOTES_FILES ${CTEST_NOTES_FILES} "${CTEST_SOURCE_DIRECTORY}/${_file1}")
EndForEach(_file ${_result})
If(EXISTS ${CTEST_SOURCE_DIRECTORY}/.svn)
Execute_Process(COMMAND svn stat -u
COMMAND grep ^[CM]
COMMAND cut -c21-
OUTPUT_VARIABLE FILELIST
)
# create out of the output a cmake list. This step is done to convert the
# stream into seperated filenames.
# The trick is to exchange an "\n" by an ";" which is the separartor in
# a list created by cmake
String(REGEX REPLACE "\n" ";" _result "${FILELIST}")
ForEach(_file ${_result})
String(STRIP "${_file}" _file1)
Set(CTEST_NOTES_FILES ${CTEST_NOTES_FILES} "${CTEST_SOURCE_DIRECTORY}/${_file1}")
EndForEach(_file ${_result})
EndIf()
CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
......
SET(MODEL Experimental)
IF(${CTEST_SCRIPT_ARG} MATCHES Nightly)
SET(MODEL Nightly)
ENDIF(${CTEST_SCRIPT_ARG} MATCHES Nightly)
SET (CTEST_COMMAND
"ctest -D ${MODEL}Start -D ${MODEL}Update -D ${MODEL}Configure -D ${MODEL}Submit"
)
SET (CTEST_SOURCE_DIRECTORY $ENV{SOURCEDIR})
SET (CTEST_BINARY_DIRECTORY $ENV{BUILDDIR})
SET (CTEST_UPDATE_COMMAND "/usr/bin/svn")
SET (CTEST_UPDATE_CHECKOUT " ${CTEST_UPDATE_COMMAND} update ")
# what cmake command to use for configuring this dashboard
SET (CTEST_CMAKE_COMMAND
"cmake"
)
####################################################################
# The values in this section are optional you can either
# have them or leave them commented out
####################################################################
# should ctest wipe the binary tree before running
#SET (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
# this is the initial cache to use for the binary tree, be careful to escape
# any quotes inside of this string if you use it
SET (CTEST_INITIAL_CACHE "
BUILDNAME:STRING=$ENV{LABEL}
SITE:STRING=$ENV{SITE}
")
# set any extra environment variables here
#SET (CTEST_ENVIRONMENT
#)
#CTEST_START (${MODEL})
#CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}")
#CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}")
#CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}")
#CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}")
#CTEST_SUBMIT ()
\ No newline at end of file
......@@ -78,7 +78,11 @@ else
GCC_VERSION=$($CXX -dumpversion)
fi
export LABEL1=${LINUX_FLAVOUR}-$SYSTEM-$COMPILER$GCC_VERSION-fairsoft_$FAIRSOFT_VERSION-fairroot_$FAIRROOT_VERSION
if [ "${ctest_model}" == "Weekly" ]; then
export LABEL1=${LINUX_FLAVOUR}-$SYSTEM-$COMPILER$GCC_VERSION-${ctest_model}-fairsoft_$FAIRSOFT_VERSION-fairroot_$FAIRROOT_VERSION
else
export LABEL1=${LINUX_FLAVOUR}-$SYSTEM-$COMPILER$GCC_VERSION-fairsoft_$FAIRSOFT_VERSION-fairroot_$FAIRROOT_VERSION
fi
export LABEL=$(echo $LABEL1 | sed -e 's#/#_#g')
# get the number of processors
......
# Create a library called "libKF" which includes the source files given in
# the array .
# The extension is already found. Any number of sources could be listed here.
Set(INCLUDE_DIRECTORIES
${CBMROOT_SOURCE_DIR}/base
${CBMROOT_SOURCE_DIR}/data
${CBMROOT_SOURCE_DIR}/data/sts
${CBMROOT_SOURCE_DIR}/data/mvd
${CBMROOT_SOURCE_DIR}/data/much
${CBMROOT_SOURCE_DIR}/data/trd
${CBMROOT_SOURCE_DIR}/data/rich
${CBMROOT_SOURCE_DIR}/data/tof
${CBMROOT_SOURCE_DIR}/tof/TofData
${CBMROOT_SOURCE_DIR}/data/ecal
${CBMROOT_SOURCE_DIR}/data/global
${CBMROOT_SOURCE_DIR}/KF
${CBMROOT_SOURCE_DIR}/KF/Interface
${CBMROOT_SOURCE_DIR}/KF/KFModelParameters
${CBMROOT_SOURCE_DIR}/KF/KFModelParameters/common
${CBMROOT_SOURCE_DIR}/KF/KFModelParameters/HRGModel
${CBMROOT_SOURCE_DIR}/KF/KFModelParameters/MultiscatteringModel
${CBMROOT_SOURCE_DIR}/KF/KFModelParameters/ImpactParameterModel
${CBMROOT_SOURCE_DIR}/KF/KFModelParameters/InverseSlope
${CBMROOT_SOURCE_DIR}/KF/KFModelParameters/BoltzmannDistribution
${CBMROOT_SOURCE_DIR}/KF/KFModelParameters/BlastWaveModel
${CBMROOT_SOURCE_DIR}/KF/KFQA
${KFParticle_INCLUDE_DIR}
${CBMROOT_SOURCE_DIR}/sts
${CBMROOT_SOURCE_DIR}/sts/setup
${CBMROOT_SOURCE_DIR}/L1
${CBMROOT_SOURCE_DIR}/L1/L1Algo
${CBMROOT_SOURCE_DIR}/L1/ParticleFinder
${CBMROOT_SOURCE_DIR}/field
${CBMROOT_SOURCE_DIR}/passive
${CBMROOT_SOURCE_DIR}/mvd
${CBMROOT_SOURCE_DIR}/rich
${CBMROOT_SOURCE_DIR}/much/geo
${CBMROOT_SOURCE_DIR}/trd/base
${CBMROOT_SOURCE_DIR}/tof/TofParam
${CBMROOT_SOURCE_DIR}/ecal
)
Include_Directories( ${INCLUDE_DIRECTORIES})
Set(SYSTEM_INCLUDE_DIRECTORIES
${VC_INCLUDE_DIRS}
${BASE_INCLUDE_DIRECTORIES}
)
Include_Directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})
set(LINK_DIRECTORIES
${Vc_LIB_DIR}
${KFParticle_LIB_DIR}
${ROOT_LIBRARY_DIR}
${FAIRROOT_LIBRARY_DIR}
${Boost_LIBRARY_DIRS}
)
link_directories( ${LINK_DIRECTORIES})
set(SRCS
CbmKF.cxx
CbmKFFieldMath.cxx
CbmKFHit.cxx
CbmKFMaterial.cxx
CbmKFMath.cxx
CbmKFPixelMeasurement.cxx
CbmKFPrimaryVertexFinder.cxx
CbmKFSecondaryVertexFinder.cxx
CbmKFTrackInterface.cxx
CbmKFUMeasurement.cxx
CbmKFVertexInterface.cxx
Interface/CbmEcalTrackExtrapolationKF.cxx
Interface/CbmKFStsHit.cxx
Interface/CbmKFTrack.cxx
Interface/CbmKFTrdHit.cxx
Interface/CbmKFTofHit.cxx
Interface/CbmPVFinderKF.cxx
Interface/CbmStsFitPerformanceTask.cxx
Interface/CbmStsKFTrackFitter.cxx
Interface/CbmStsKFSecondaryVertexFinder.cxx
Interface/CbmTrdTrackFitterKF.cxx
Interface/CbmTofTrackFitterKF.cxx
Interface/CbmGlobalTrackFitterKF.cxx
# CbmKFParticle.cxx
# CbmKFParticle_simd.cxx
# CbmKFParticleInterface.cxx
KFModelParameters/CbmThermalModelNoFlow.cxx
KFModelParameters/common/Acceptance.cxx
KFModelParameters/HRGModel/CbmHRGModel.cxx
KFModelParameters/HRGModel/HagedornSpectrum.cxx
KFModelParameters/HRGModel/ThermalModel.cxx
# KFModelParameters/HRGModel/ThermalModelBase.cxx
KFModelParameters/HRGModel/ThermalModelEVMF.cxx
KFModelParameters/HRGModel/ThermalModelFit.cxx
KFModelParameters/HRGModel/ThermalParticle.cxx
KFModelParameters/HRGModel/ThermalParticleSystem.cxx
KFModelParameters/HRGModel/xMath.cxx
KFModelParameters/MultiscatteringModel/CbmMultiscatteringModel.cxx
KFModelParameters/MultiscatteringModel/MultiscatteringModel.cxx
KFModelParameters/InverseSlope/CbmInverseSlope.cxx
KFModelParameters/InverseSlope/InverseSlope.cxx
KFModelParameters/InverseSlope/RapidityFit.cxx
KFModelParameters/BoltzmannDistribution/CbmBoltzmannDistribution.cxx
KFModelParameters/BoltzmannDistribution/BoltzmannDistribution.cxx
KFModelParameters/BlastWaveModel/CbmBlastWave.cxx
KFModelParameters/BlastWaveModel/BlastWave.cxx
KFModelParameters/BlastWaveModel/BlastWaveLongitudinal.cxx
KFModelParameters/BlastWaveModel/RapidityFitBlastWave.cxx
KFModelParameters/ImpactParameterModel/CbmImpactParameterModel.cxx
KFModelParameters/ImpactParameterModel/ImpactParameterModel.cxx
KFModelParameters/CbmModelsQA.cxx
KFQA/CbmKFTrErrMCPoints.cxx
KFQA/CbmKFTrackFitQA.cxx
KFQA/CbmKFTrackQA.cxx
KFQA/KFParticleMatch.cxx
CbmKFParticleFinder.cxx
CbmKFParticleFinderPID.cxx
CbmKFParticleFinderQA.cxx
CbmKFParticleInterface.cxx
)
set(HEADERS
CbmKF.h
CbmKFFieldMath.h
CbmKFHit.h
CbmKFMaterial.h
CbmKFMath.h
CbmKFPixelMeasurement.h
CbmKFPrimaryVertexFinder.h
CbmKFSecondaryVertexFinder.h
CbmKFTrackInterface.h
CbmKFUMeasurement.h
CbmKFVertexInterface.h
Interface/CbmEcalTrackExtrapolationKF.h
Interface/CbmKFStsHit.h
Interface/CbmKFTrack.h
Interface/CbmKFTrdHit.h
Interface/CbmKFTofHit.h
Interface/CbmPVFinderKF.h
Interface/CbmStsFitPerformanceTask.h
Interface/CbmStsKFTrackFitter.h
Interface/CbmStsKFSecondaryVertexFinder.h
Interface/CbmTrdTrackFitterKF.h
Interface/CbmTofTrackFitterKF.h
Interface/CbmGlobalTrackFitterKF.h
# CbmKFParticle.h
KFModelParameters/CbmModelBase.h
KFModelParameters/CbmThermalModelNoFlow.h
KFModelParameters/common/Acceptance.h
KFModelParameters/HRGModel/CbmHRGModel.h
KFModelParameters/HRGModel/HagedornSpectrum.h
KFModelParameters/HRGModel/ThermalModel.h
KFModelParameters/HRGModel/ThermalModelBase.h
KFModelParameters/HRGModel/ThermalModelEVMF.h
KFModelParameters/HRGModel/ThermalModelFit.h
KFModelParameters/HRGModel/ThermalParticle.h
KFModelParameters/HRGModel/ThermalParticleSystem.h
KFModelParameters/HRGModel/xMath.h
KFModelParameters/MultiscatteringModel/CbmMultiscatteringModel.h
KFModelParameters/MultiscatteringModel/MultiscatteringModel.h
KFModelParameters/InverseSlope/CbmInverseSlope.h
KFModelParameters/InverseSlope/InverseSlope.h
KFModelParameters/InverseSlope/RapidityFit.h
KFModelParameters/BoltzmannDistribution/CbmBoltzmannDistribution.h
KFModelParameters/BoltzmannDistribution/BoltzmannDistribution.h
KFModelParameters/BlastWaveModel/CbmBlastWave.h
KFModelParameters/BlastWaveModel/BlastWave.h
KFModelParameters/BlastWaveModel/BlastWaveLongitudinal.h
KFModelParameters/BlastWaveModel/RapidityFitBlastWave.h
KFModelParameters/ImpactParameterModel/CbmImpactParameterModel.h
KFModelParameters/ImpactParameterModel/ImpactParameterModel.h
KFModelParameters/CbmModelsQA.h
KFQA/CbmKFTrErrMCPoints.h
KFQA/CbmKFTrackFitQA.h
KFQA/CbmKFTrackQA.h
KFQA/CbmKFPartEfficiencies.h
KFQA/KFParticleMatch.h
CbmKFParticleFinder.h
CbmKFParticleFinderPID.h
CbmKFParticleFinderQA.h
CbmKFParticleInterface.h
)
If (APPLE)
ADD_DEFINITIONS(-Wall -Wabi -Wsign-promo -Wctor-dtor-privacy -Wreorder -Wno-deprecated -Wno-parentheses -DDO_TPCCATRACKER_EFF_PERFORMANCE -DNonhomogeneousField -DCBM -DUSE_TIMERS) # -Weffc++ -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast : wait for other parts of cbmroot\root.
#---Check for compiler flags
CHECK_CXX_COMPILER_FLAG("-Wno-pmf-conversions" HAS_PMF)
If(HAS_PMF)
ADD_DEFINITIONS(-Wno-pmf-conversions)
EndIf()
CHECK_CXX_COMPILER_FLAG("-Wstrict-null-sentinel" HAS_SENTINEL)
If(HAS_SENTINEL)
ADD_DEFINITIONS(-Wstrict-null-sentinel)
EndIf()
CHECK_CXX_COMPILER_FLAG("-Wno-non-template-friend" HAS_TEMPLATE_FRIEND)
If(HAS_TEMPLATE_FRIEND)
ADD_DEFINITIONS(-Wno-non-template-friend)
EndIf()
CHECK_CXX_COMPILER_FLAG("-Wno-pragmas" HAS_PRAGMA)
If(HAS_PRAGMA)
ADD_DEFINITIONS(-Wno-pragmas)
EndIf()
Else()
ADD_DEFINITIONS(-Wall -Wabi -fabi-version=0 -Wsign-promo -Wno-pmf-conversions -Wctor-dtor-privacy -Wreorder -Wno-deprecated -Wstrict-null-sentinel -Wno-non-template-friend -Wno-pragmas -Wno-parentheses -DDO_TPCCATRACKER_EFF_PERFORMANCE -DNonhomogeneousField -DCBM -DUSE_TIMERS) # -Weffc++ -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast : wait for other parts of cbmroot\root.
EndIf()
IF (SSE_FOUND)
Message(STATUS "KF will be compiled with SSE support")
ADD_DEFINITIONS(-DHAVE_SSE)
SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS
"-msse -O3")
ELSE (SSE_FOUND)
MESSAGE(STATUS "KF will be compiled without SSE support")
SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS
"-O3")
ENDIF (SSE_FOUND)
set(LINKDEF KFLinkDef.h)
Set(LIBRARY_NAME KF)
Set(DEPENDENCIES
CbmSts CbmEcal CbmBase CbmData Base Vc.a Minuit2 KFParticle
)
Set(DEFINITIONS -DDO_TPCCATRACKER_EFF_PERFORMANCE -DNonhomogeneousField -DCBM -DUSE_TIMERS)
GENERATE_LIBRARY()
Add_Dependencies(KF KFPARTICLE)
This diff is collapsed.
#include "CbmStsKFTrackFitter.h"
#include "CbmKFMath.h"
#include "CbmKFTrack.h"
#include "CbmKFVertex.h"
#include "CbmKFStsHit.h"
#include "FairRootManager.h"
#include "CbmStsTrack.h"
#include "CbmVertex.h"
#include "CbmMvdHit.h"
#include "TClonesArray.h"
#include "TMath.h"
#include <iostream>
#include "math.h"
using std::cout;
using std::endl;
ClassImp(CbmStsKFTrackFitter);
CbmStsKFTrackFitter::CbmStsKFTrackFitter():
fHits(),
fMvdHitsArray(0),
fStsHitsArray(0),
fIsInitialised(0)
{}
void CbmStsKFTrackFitter::Init(){
// Initialisation
FairRootManager *rootMgr = FairRootManager::Instance();
if(NULL == rootMgr) {
cout << "-E- CbmStsKFTrackFitter::Init(): "
<< "ROOT manager is not instantiated!" << endl;
return;
}
fStsHitsArray = reinterpret_cast<TClonesArray*>(rootMgr->GetObject("StsHit"));
if ( !fStsHitsArray ) {
cout << "-W- CbmStsKFTrackFitter::Init: "
<< "no STS hits array" << endl;
//return;
}
fMvdHitsArray = reinterpret_cast<TClonesArray*>(rootMgr->GetObject("MvdHit"));
if( !fMvdHitsArray ) {
cout << "-W- CbmStsKFTrackFitter::Init: "
<< "no MVD hits array" << endl;
//return;
}
fIsInitialised = 1;
};
void CbmStsKFTrackFitter::SetKFHits(CbmKFTrack &T, CbmStsTrack* track){
T.fHits.clear();
if( !fIsInitialised ) Init();
Int_t NStsHits = ( fStsHitsArray ) ?track->GetNofHits() :0;
Int_t NMvdHits= ( fMvdHitsArray) ?track->GetNofMvdHits() :0;
fHits.resize( NMvdHits + NStsHits );
if ( NMvdHits > 0 ){
for (Int_t i=0; i<NMvdHits;i++){
Int_t j = track->GetMvdHitIndex(i);
fHits[i].Create( reinterpret_cast<CbmMvdHit*>(fMvdHitsArray->At(j)) );
T.fHits.push_back(&(fHits[i]));
}
}
if( NStsHits>0 && fStsHitsArray ){
for (Int_t i=0; i<NStsHits;i++){
Int_t j = track->GetHitIndex(i);
fHits[NMvdHits+i].Create( reinterpret_cast<CbmStsHit*>(fStsHitsArray->At(j)) );
T.fHits.push_back(&(fHits[NMvdHits+i]));
}
}
}
Int_t CbmStsKFTrackFitter::DoFit( CbmStsTrack* track, Int_t pidHypo )
{
track->SetPidHypo(pidHypo);
CbmKFTrack T;
T.SetPID(pidHypo);
SetKFHits( T, track);
for( Int_t i=0; i<6; i++ ) T.GetTrack()[i] = 0.; // no guess taken
T.Fit( 1 ); // fit downstream
CheckTrack( T );
T.Fit( 0 ); // fit upstream
CheckTrack( T );
Int_t err = T.Fit( 1 ); // fit downstream
Bool_t ok = (!err) && CheckTrack( T );
if( ok ){
FairTrackParam par;
//T.GetTrackParam( *track->GetParamLast() ); // store fitted track & cov.matrix
T.GetTrackParam( par );
track->SetParamLast(&par);
err = T.Fit( 0 ); // fit upstream
ok = ok && (!err) && CheckTrack( T );
if( ok ) T.GetStsTrack( *track, 1 ); // store fitted track & cov.matrix & chi2 & NDF
}
if( !ok ){
Double_t *t = T.GetTrack();
Double_t *c = T.GetCovMatrix();
for( int i=0; i<6 ; i++) t[i] = 0;
for( int i=0; i<15; i++) c[i] = 0;
c[0] = c[2] = c[5] = c[9] = c[14] = 100.;
T.GetRefChi2() = 100.;
T.GetRefNDF() = 0;
T.GetStsTrack( *track, 0 );
T.GetStsTrack( *track, 1 );
track->SetFlag(1);
} else{
track->SetFlag(0);
}
return !ok;
}
void CbmStsKFTrackFitter::Extrapolate( FairTrackParam* track, Double_t z, FairTrackParam* e_track )
{
if( !track ) return;
CbmKFTrack T;
T.SetTrackParam( *track );
T.Extrapolate( z );
if( e_track ) T.GetTrackParam( *e_track );
}
void CbmStsKFTrackFitter::Extrapolate( CbmStsTrack* track, Double_t z, FairTrackParam* e_track )
{
if( !track ) return;
CbmKFTrack T;
T.SetPID( track->GetPidHypo() );
const FairTrackParam *fpar = track->GetParamFirst(), *lpar = track->GetParamLast();
if( z<=fpar->GetZ() ){ // extrapolate first parameters
T.SetTrackParam( *fpar );
T.Extrapolate( z );
}else if( z<fpar->GetZ()+0.1 ){ // extrapolate first parameters
T.SetTrackParam( *fpar );
T.Propagate( z );
}else if( lpar->GetZ()<=z ){ // extrapolate last parameters
T.SetTrackParam( *lpar );
T.Extrapolate( z );
}else if( lpar->GetZ()-0.1<z ){ // extrapolate last parameters
T.SetTrackParam( *lpar );
T.Propagate( z );
}else { // refit with smoother
SetKFHits( T, track);
T.SetTrackParam( *fpar );
T.Smooth( z );
}
if( e_track ) T.GetTrackParam( *e_track );
}
Double_t CbmStsKFTrackFitter::GetChiToVertex( CbmStsTrack* track, CbmVertex *vtx )
{
if( !vtx ){
FairRootManager *fManger = FairRootManager::Instance();
// Get pointer to PrimaryVertex object from IOManager if it exists
// The old name for the object is "PrimaryVertex" the new one
// "PrimaryVertex." Check first for the new name
// TODO: don't use reinterpret_cast
vtx = reinterpret_cast<CbmVertex*>(fManger->GetObject("PrimaryVertex."));
if (nullptr == vtx) {
vtx = reinterpret_cast<CbmVertex*>(fManger->GetObject("PrimaryVertex"));
}
if( !vtx ){
cout<< "-W- CbmStsKFTrackFitter::GetChiToVertex: No Primary Vertex found!"<<endl;
return 100.;
}
}
CbmKFTrack T;
T.SetStsTrack( *track, 1 );
T.Extrapolate( vtx->GetZ() );
TMatrixFSym tmp(3);
vtx->CovMatrix( tmp );
Double_t Cv[3] = { tmp(0,0), tmp(0,1), tmp(1,1) };
return CbmKFMath::getDeviation( T.GetTrack()[0], T.GetTrack()[1], T.GetCovMatrix(),
vtx->GetX(), vtx->GetY(), Cv );
}
Double_t CbmStsKFTrackFitter::FitToVertex( CbmStsTrack* track, CbmVertex *vtx, FairTrackParam *v_track )
{
Double_t ret = 100.;
if( !track || !vtx || !v_track ) return ret;
CbmKFTrack T( *track );
CbmKFVertex V( *vtx );
T.Fit2Vertex( V );
T.GetTrackParam( *v_track );
if( T.GetRefNDF()>0 && T.GetRefChi2()>=0 ){
ret = T.GetRefChi2()/T.GetRefNDF();
if( finite(ret) ) ret = sqrt(ret);
}
return ret;
}
Bool_t CbmStsKFTrackFitter::CheckTrack( CbmKFTrack &T )
{
Bool_t ok = 1;
Double_t *t = T.GetTrack();
Double_t *c = T.GetCovMatrix();
for( int i=0; i<6; i++) ok = ok && finite(t[i]) && TMath::Abs(t[i])<1.e5;
for( int i=0; i<15; i++) ok = ok && finite(c[i]);
ok = ok && finite( T.GetMass() ) && finite( T.GetRefChi2() );
if( ok ){
ok = ok && ( c[ 0] > 0 );
ok = ok && ( c[ 2] > 0 );
ok = ok && ( c[ 5] > 0 );
ok = ok && ( c[ 9] > 0 );
ok = ok && ( c[14] > 0 );
}
if( ok ){ // correct the cov matrix
Double_t c00 = TMath::Sqrt(c[ 0]);
Double_t c11 = TMath::Sqrt(c[ 2]);
Double_t c22 = TMath::Sqrt(c[ 5]);
Double_t c33 = TMath::Sqrt(c[ 9]);
Double_t c44 = TMath::Sqrt(c[14]);
Double_t a = c11*c00;
if( c[ 1] > a ) c[ 1] = a;
if( c[ 1] < -a ) c[ 1] = -a;
a = c22*c00;
if( c[ 3] > a ) c[ 3] = a;
if( c[ 3] < -a ) c[ 3] = -a;
a = c22*c11;
if( c[ 4] > a ) c[ 4] = a;
if( c[ 4] < -a ) c[ 4] = -a;
a = c33*c00;
if( c[ 6] > a ) c[ 6] = a;
if( c[ 6] < -a ) c[ 6] = -a;
a = c33*c11;
if( c[ 7] > a ) c[ 7] = a;
if( c[ 7] < -a ) c[ 7] = -a;
a = c33*c22;
if( c[ 8] > a ) c[ 8] = a;
if( c[ 8] < -a ) c[ 8] = -a;
a = c44*c00;
if( c[10] > a ) c[10] = a;
if( c[10] < -a ) c[10] = -a;
a = c44*c11;
if( c[11] > a ) c[11] = a;
if( c[11] < -a ) c[11] = -a;
a = c44*c22;
if( c[12] > a ) c[12] = a;
if( c[12] < -a ) c[12] = -a;
a = c44*c33;
if( c[13] > a ) c[13] = a;
if( c[13] < -a ) c[13] = -a;
}
if( !ok ){
for( int i=0; i<6 ; i++) t[i] = 0;
for( int i=0; i<15; i++) c[i] = 0;
c[0] = c[2] = c[5] = c[9] = c[14] = 100.;
T.GetRefChi2() = 100.;
T.GetRefNDF() = 0;
}
return ok;
}
# Create a library called "libL1" which includes the source files given in
# the array .
# The extension is already found. Any number of sources could be listed here.
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wshadow -Weffc++ -Wno-unused-variable -Wno-unused-parameter -Wno-sign-compare -Wno-ignored-qualifiers -Wno-overloaded-virtual")
# Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -Wno-padded -Wno-global-constructors")
# Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast")
Set(INCLUDE_DIRECTORIES
${CBMROOT_SOURCE_DIR}/base
${CBMROOT_SOURCE_DIR}/data
${CBMROOT_SOURCE_DIR}/data/sts
${CBMROOT_SOURCE_DIR}/data/much
${CBMROOT_SOURCE_DIR}/data/mvd
${CBMROOT_SOURCE_DIR}/data/trd
${CBMROOT_SOURCE_DIR}/data/tof
${CBMROOT_SOURCE_DIR}/data/rich
${CBMROOT_SOURCE_DIR}/data/global
${CBMROOT_SOURCE_DIR}/rich/fitter
${CBMROOT_SOURCE_DIR}/L1
${CBMROOT_SOURCE_DIR}/L1/L1Algo
${CBMROOT_SOURCE_DIR}/L1/OffLineInterface
${CBMROOT_SOURCE_DIR}/L1/ParticleFinder
${CBMROOT_SOURCE_DIR}/KF
${CBMROOT_SOURCE_DIR}/KF/KFQA
${KFParticle_INCLUDE_DIR}
${CBMROOT_SOURCE_DIR}/KF/Interface
${CBMROOT_SOURCE_DIR}/run
${CBMROOT_SOURCE_DIR}/data
${CBMROOT_SOURCE_DIR}/sts
${CBMROOT_SOURCE_DIR}/mvd
${CBMROOT_SOURCE_DIR}/trd/base
${CBMROOT_SOURCE_DIR}/much/geo
${CBMROOT_SOURCE_DIR}/tof/TofParam
${CBMROOT_SOURCE_DIR}/tof/TofData
)
Include_Directories( ${INCLUDE_DIRECTORIES})
Set(SYSTEM_INCLUDE_DIRECTORIES
${VC_INCLUDE_DIRS}
${BASE_INCLUDE_DIRECTORIES}
)
Include_Directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})
set(LINK_DIRECTORIES
${Vc_LIB_DIR}
${KFParticle_LIB_DIR}
${ROOT_LIBRARY_DIR}
${FAIRROOT_LIBRARY_DIR}
${Boost_LIBRARY_DIRS}
)
link_directories( ${LINK_DIRECTORIES})
set(SRCS
#L1Algo/L1CATrackFinder.cxx
#CbmL1Performance.cxx
#CbmL1ReadEvent.cxx
CbmL1CATrdTrackFinderSA.cxx
CbmL1TrdTracklet.cxx
CbmL1TrdTracklet4.cxx
CbmL1.cxx
#CbmL1TrdTrackFinderSts.cxx
CbmL1TrackMerger.cxx
CbmL1TofMerger.cxx
L1AlgoInputData.cxx
OffLineInterface/CbmL1RichENNRingFinder.cxx
OffLineInterface/CbmL1RichENNRingFinderParallel.cxx
OffLineInterface/CbmL1StsTrackFinder.cxx
#OffLineInterface/CbmL1MuchFinder.cxx
#OffLineInterface/CbmL1MuchHit.cxx
#OffLineInterface/CbmL1MuchTrack.cxx
#OffLineInterface/CbmL1MuchFinderQa.cxx
OffLineInterface/CbmL1RichRingQa.cxx
#OffLineInterface/CbmL1SttHit.cxx
#OffLineInterface/CbmL1SttTrackFinder.cxx
#OffLineInterface/CbmL1SttTrack.cxx
L1Algo/L1Algo.cxx
L1Algo/L1CATrackFinder.cxx
L1Algo/L1TrackExtender.cxx
L1Algo/L1TrackFitter.cxx
L1Algo/L1CAMergeClones.cxx
L1Algo/L1HitsSortHelper.cxx
L1Algo/L1Grid.cxx
CbmL1Performance.cxx
CbmL1ReadEvent.cxx
L1Algo/L1TrackParFit.cxx
L1Algo/L1Event.cxx
L1Algo/L1EventMatch.cxx
L1Algo/L1MCEvent.cxx
CbmL1MCTrack.cxx
ParticleFinder/CbmL1PFFitter.cxx
ParticleFinder/CbmL1PFMCParticle.cxx
)
set(HEADERS
CbmL1CATrdTrackFinderSA.h
CbmL1.h
CbmL1MCTrack.h
CbmL1MCPoint.h
CbmL1StsHit.h
CbmL1TofMerger.h
CbmL1Track.h
CbmL1TrackMerger.h
CbmL1TrackPar.h
CbmL1TrdHit.h
#CbmL1TrdTrackFinderSts.h
CbmL1TrdTracklet4.h
CbmL1TrdTracklet.h
CbmL1Vtx.h
#OffLineInterface/CbmL1MuchFinder.h
#OffLineInterface/CbmL1MuchFinderQa.h
#OffLineInterface/CbmL1MuchHit.h
#OffLineInterface/CbmL1MuchTrack.h
OffLineInterface/CbmL1RichENNRingFinder.h
OffLineInterface/CbmL1RichRingQa.h
OffLineInterface/CbmL1StsTrackFinder.h
#OffLineInterface/CbmL1SttHit.h
#OffLineInterface/CbmL1SttTrackFinder.h
#OffLineInterface/CbmL1SttTrack.h
# L1Algo/L1Algo.h
)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
If(APPLE)
ADD_DEFINITIONS(-Wall -Wabi -Wsign-promo -Wctor-dtor-privacy -Wreorder -Wno-deprecated -Wno-parentheses -DDO_TPCCATRACKER_EFF_PERFORMANCE -DNonhomogeneousField -DCBM -DUSE_TIMERS) # -Weffc++ -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast : wait for other parts of cbmroot\root.
#---Check for compiler flags
CHECK_CXX_COMPILER_FLAG("-Wno-pmf-conversions" HAS_PMF)
If(HAS_PMF)
ADD_DEFINITIONS(-Wno-pmf-conversions)
EndIf()
CHECK_CXX_COMPILER_FLAG("-Wstrict-null-sentinel" HAS_SENTINEL)
If(HAS_SENTINEL)
ADD_DEFINITIONS(-Wstrict-null-sentinel)
EndIf()
CHECK_CXX_COMPILER_FLAG("-Wno-non-template-friend" HAS_TEMPLATE_FRIEND)
If(HAS_TEMPLATE_FRIEND)
ADD_DEFINITIONS(-Wno-non-template-friend)
EndIf()
if (OPENMP_FOUND)
Execute_Process(COMMAND clang++ -print-prog-name=clang++
OUTPUT_VARIABLE _Exe)
Get_Filename_Component(link_directory ${_Exe} DIRECTORY)
Set(link_directory "${link_directory}/../lib")
Set(LINK_DIRECTORIES
${LINK_DIRECTORIES}
${link_directory}
)
link_directories( ${LINK_DIRECTORIES})
endif()
Else()
ADD_DEFINITIONS(-Wall -Wabi -fabi-version=0 -Wsign-promo -Wno-pmf-conversions -Wctor-dtor-privacy -Wreorder -Wno-deprecated -Wstrict-null-sentinel -Wno-non-template-friend -Wno-parentheses -DDO_TPCCATRACKER_EFF_PERFORMANCE -DNonhomogeneousField -DCBM -DUSE_TIMERS) # -Weffc++ -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast : wait for other parts of cbmroot\root.
EndIf()
IF (SSE_FOUND)
ADD_DEFINITIONS(-DHAVE_SSE)
SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS
"-msse -O3")
Message(STATUS "L1 will be compiled with SSE support")
ELSE (SSE_FOUND)
Message(STATUS "L1 will be compiled without SSE support")
SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS
"-O3")
ENDIF (SSE_FOUND)
set(LINKDEF L1LinkDef.h)
Set(LIBRARY_NAME L1)
Set(DEPENDENCIES
#Rich
KF CbmTrd CbmSts CbmBase CbmData Base boost_regex
)
GENERATE_LIBRARY()
This diff is collapsed.
/*
*====================================================================
*
* CBM Level 1 Reconstruction
*
* Authors: I.Kisel, S.Gorbunov
*
* e-mail : ikisel@kip.uni-heidelberg.de
*
*====================================================================
*
* CbmL1 header file
*
*====================================================================
*/
#ifndef _CbmL1_h_
#define _CbmL1_h_
//#define GLOBAL
/// temporary TEST !!!!
///#define HAVE_SSE
#include "CbmL1Track.h"
#include "CbmL1Vtx.h"
//#include "L1Algo/L1Algo.h"
#include "CbmL1MCTrack.h"
#include "CbmL1MCPoint.h"
#include "CbmL1StsHit.h"
#include "FairTask.h"
#include "FairRootManager.h"
#include "FairDetector.h"
#include "CbmEvent.h"
#include "CbmMCTrack.h"
#include "CbmStsPoint.h"
#include "CbmStsDigi.h"
#include "CbmStsCluster.h"
#include "CbmStsHit.h"
#include "CbmMvdPoint.h"
#include "CbmMvdHit.h"
//#include "CbmMCEventHeader.h"
//#include "L1AlgoInputData.h"
#include "CbmTimeSlice.h"
#include "CbmMCDataArray.h"
#include "CbmMCEventList.h"
#include "TClonesArray.h"
#include "TRefArray.h"
#include "TParticle.h"
#include "TRandom.h"
#include "TGeoManager.h"
#include "TGeoMatrix.h"
#include "TGeoTube.h"
#include "TGeoCone.h"
#include "TGeoPcon.h"
#include "TGeoBBox.h"
#include "TH1.h"
#include "TH2.h"
#include "TProfile.h"
#include "TProfile2D.h"
#include <iostream>
#include <fstream>
#include <set>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include "L1EventEfficiencies.h"
using std::vector;
class L1AlgoInputData;
class L1Algo;
class L1Event;
class CbmL1ParticlesFinder;
class L1FieldSlice;
class CbmL1Track;
class CbmL1MCTrack;
class KFTopoPerformance;
//class CbmEvBasedArray;
class CbmL1HitStore{
public:
int ExtIndex;
int iStation;
double x, y, time, dx, dy, dt, dxy;
int Det;
};
//class CbmL1FileEvent{
//public:
// int File;
// int Event;
//}
class CbmTrdParSetDigi;
class CbmTrdParModDigi;
class CbmTofDigiPar;
class CbmL1 : public FairTask
{
private:
CbmL1(const CbmL1&);
CbmL1 operator=(const CbmL1&);
public:
L1Algo *algo; // for access to L1 Algorithm from L1::Instance
TString fDigiFile; // Digitization file
vector<CbmL1Track> vRTracks; // reconstructed tracks
typedef std::set<std::pair<int, int> > DFSET;
DFSET vFileEvent;
// set<pair<int, int> > vFileEvent;
static CbmL1 *Instance(){ return fInstance; }
void SetParContainers();
virtual InitStatus ReInit();
virtual InitStatus Init();
void Exec(Option_t * option);
CbmL1();
/** Constructor
* @param _fPerformance - type of Efficiency output: 0 - w\o efficiencies, doesn't use MC data; 1 - L1 standard efficiency definition; 2 - QA efficiency definition
* @param fSTAPDataMode_ - way to work with files for the standalone package: 0 - off , 1 - write, 2 - read data and work only with it, 3 - write and read (debug)
* @param findParticleMode_ : 0 - don't run FindParticles; 1 - run, all MC particle is reco-able; 2 - run, MC particle is reco-able if created from reco-able tracks; 3 - run, MC particle is reco-able if created from reconstructed tracks
*/
CbmL1(const char *name, Int_t iVerbose = 1, Int_t _fPerformance = 0, int fSTAPDataMode_ = 0, TString fSTAPDataDir_ = "./", int findParticleMode_ = 0);
~CbmL1( /*if (targetFieldSlice) delete;*/ );
void SetStsMaterialBudgetFileName( TString fileName ){ fStsMatBudgetFileName = fileName; }
void SetMvdMaterialBudgetFileName( TString fileName ){ fMvdMatBudgetFileName = fileName; }
void SetMuchMaterialBudgetFileName( TString fileName ){ fMuchMatBudgetFileName = fileName; }
void SetTrdMaterialBudgetFileName( TString fileName ){ fTrdMatBudgetFileName = fileName; }
void SetTofMaterialBudgetFileName( TString fileName ){ fTofMatBudgetFileName = fileName; }
void SetExtrapolateToTheEndOfSTS( bool b ){ fExtrapolateToTheEndOfSTS = b; }
void SetDataMode( int TimesliceMode) { fTimesliceMode = TimesliceMode; }
void SetMuchPar( TString fileName ){ fDigiFile = fileName; }
void Finish();
// void SetTrackingLevel( Int_t iLevel ){ fTrackingLevel = iLevel; }
// void MomentumCutOff( Double_t cut ){ fMomentumCutOff = cut; }
// void SetGhostSuppression( Bool_t b ){ fGhostSuppression= b; }
// void SetDetectorEfficiency( Double_t eff ){ fDetectorEfficiency = eff; }
vector<CbmL1HitStore> vHitStore; // diff hit information
void Reconstruct(CbmEvent* event = NULL);
friend class L1AlgoDraw;
friend class L1AlgoPulls;
template<int NHits> friend class L1AlgoEfficiencyPerformance;
friend class CbmL1MCTrack;
friend class CbmL1PFFitter;
// bool ReadMCDataFromFile(const char work_dir[100], const int maxNEvent, const int iVerbose);
// vector<CbmL1MCPoint> vMCPoints;
// static bool compareZ(const int &a, const int &b );
inline double Get_Z_vMCPoint(int a) const { return vMCPoints[a].z; }
private:
vector<CbmL1MCPoint> vMCPoints;
int nMvdPoints;
vector<int> vMCPoints_in_Time_Slice;
void IdealTrackFinder(); // just copy all reconstructable MCTracks into RecoTracks.
/// Read information about hits, mcPoints and mcTracks into L1 classes
void ReadEvent(L1AlgoInputData *, CbmEvent* event = NULL);
bool ReadMCPoint( CbmL1MCPoint *MC, int iPoint, int MVD ); // help procedure
bool ReadMCPoint(CbmL1MCPoint *MC, int iPoint, int file, int event, int MVD );
// static bool compareZ(const int &a, const int &b );
// bool compareZ(const int &a, const int &b );
void Fill_vMCTracks();
/// Input Performance
void HitMatch(); // Procedure for match hits and MCPoints.
void FieldApproxCheck(); // Build histos with difference between Field map and approximated field
void FieldIntegralCheck(); // Build 2D histo: dependence of the field integral on phi and theta
void InputPerformance(); // Build histos about input data, like hit pulls, etc.
void TimeHist();
/// Reconstruction Performance
void TrackMatch(); // Procedure for match Reconstructed and MC Tracks. Should be called before Performances
void EfficienciesPerformance(); // calculate efficiencies
void TrackFitPerformance(); // pulls & residuals. Can be called only after Performance()
void HistoPerformance(); // fill some histograms and calculate efficiencies
/// STandAlone Package service-functions
void WriteSTAPGeoData(const vector<float> &geo); // create geo_algo.dat
void WriteSTAPAlgoData(); // create data_algo.dat
void WriteSTAPPerfData(); // create data_perfo.dat
//void ReadSTAPGeoData(vector<float> geo, int &size);
void ReadSTAPGeoData(vector<float> &geo, int &size);
void ReadSTAPAlgoData();
void ReadSTAPPerfData();
/// SIMD KF Banchmark service-functions
void WriteSIMDKFData();
void WriteHistosCurFile( TObject *obj );
static std::istream& eatwhite(std::istream& is); // skip spaces
static void writedir2current( TObject *obj ); // help procedure
int NStation, NMvdStations, NStsStations, NMuchStations, NTrdStations, NTOFStation;// number of detector stations (all\sts\mvd)
Int_t fPerformance; // 0 - w\o perf. 1 - L1-Efficiency definition. 2 - QA-Eff.definition
int fSTAPDataMode; // way to work with file for standalone package. 0 (off) , 1 (write), 2 (read data and work only with it), 3 (debug - write and read)
TString fSTAPDataDir;
Int_t fTrackingLevel; // really doesn't used
Double_t fMomentumCutOff; // really doesn't used
Bool_t fGhostSuppression; // really doesn't used
Bool_t fUseMVD, fUseMUCH, fUseTRD, fUseTOF; //
// Double_t fDetectorEfficiency; // really doesn't used
CbmL1Vtx PrimVtx;
// L1FieldSlice *targetFieldSlice _fvecalignment;
/// Input data
CbmTimeSlice* fTimeSlice;
CbmMCEventList* fEventList; //! MC event list (all)
//vector<CbmStsDigi> *listStsDigi;
vector<CbmStsDigi> listStsDigi;
CbmMCDataArray* fStsPoints;
CbmMCDataArray* fMCTracks;
CbmMCDataArray* fMvdPoints;
//TClonesArray *listMCTracks ;
TClonesArray *listStsPts; // Sts MC points
//TClonesArray *listStsDigi;
TClonesArray *listStsDigiMatch;
TClonesArray *listStsClusters;
TClonesArray *listStsHits;
TClonesArray *listStsHitMatch;
TClonesArray *listStsClusterMatch;
// Pointers to data arrays
// CbmEvBasedArray* fMCTracks;
// STS
// CbmEvBasedArray* fStsPts; // CbmStsPoint array
// MVD
// CbmEvBasedArray* fMvdPts; //CbmMvdPoint array
TClonesArray *listMvdPts; // Mvd MC points
TClonesArray *listMvdHits;
TClonesArray *listMvdDigiMatches;
TClonesArray *listMvdHitMatches;
//MuCh
int nMuchPoints;
CbmMCDataArray* fMuchPoints;
TClonesArray * listMuchHitMatches; // Output CbmMatch array
TClonesArray* fDigiMatchesMuch;
TClonesArray* fClustersMuch;
TClonesArray* fMuchPixelHits; // CbmMuchPixelHit array
TClonesArray* fMuchStrawHits; // CbmMuchStrawHit array
TClonesArray* fDigisMuch;
//TRD
CbmTrdParSetDigi *fTrdDigiPar; //!
CbmTrdParModDigi *fTrdModuleInfo; //!
// CbmTrdDigiPar * fTrdDigiPar;
CbmMCDataArray* fTrdPoints;
TClonesArray *listTrdHits;
TClonesArray *fTrdHitMatches;
//ToF
CbmMCDataArray* fTofPoints;
TClonesArray* fTofHitDigiMatches; // CbmMatches array
TClonesArray* fTofHits; // CbmMatches array
CbmTofDigiPar * fDigiPar;
struct TH1FParameters
{
TString name, title;
int nbins;
float xMin, xMax;
};
TFile* fPerfFile;
TDirectory* fHistoDir;
static const int fNTimeHistos = 22;
TH1F* fTimeHisto[fNTimeHistos];
static const int fNGhostHistos = 9;
TH1F* fGhostHisto[fNGhostHistos];
//CbmMCEventHeader* fEvent;
/// Used data = Repacked input data
vector<CbmL1StsHit> vStsHits; // hits with hit-mcpoint match information
// vector<CbmL1MCPoint> vMCPoints;
vector<CbmL1MCTrack> vMCTracks;
vector<int> vHitMCRef; // indices of MCPoints in vMCPoints, indexed by index of hit in algo->vStsHits array. According to StsMatch. Used for IdealResponce
// vector<int> vHitMCRef1;
// CbmMatch stsHitMatch;
//std::map<Double_t, Int_t> FEI2vMCPoints;
typedef std::map<Double_t, Int_t> DFEI2I;
DFEI2I dFEI2vMCPoints;
DFEI2I dFEI2vMCTracks;
inline Double_t dFEI(int file, int event, int idx) { return (1000 * idx) + file + (0.0001 * event); }
// DFEI2I::iterator map_it;
L1AlgoInputData* fData;
TDirectory *histodir;
static CbmL1 *fInstance;
private:
int fFindParticlesMode;
TString fStsMatBudgetFileName;
TString fMvdMatBudgetFileName;
TString fMuchMatBudgetFileName;
TString fTrdMatBudgetFileName;
TString fTofMatBudgetFileName;
bool fExtrapolateToTheEndOfSTS;
int fTimesliceMode;
KFTopoPerformance* fTopoPerformance;
L1EventEfficiencies fEventEfficiency; // average efficiencies
ClassDef(CbmL1,1);
};
#endif //_CbmL1_h_
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef _L1HitPoint_h_
#define _L1HitPoint_h_
/// contain strips positions and coordinates of hit
#if 1
struct L1HitPoint{
L1HitPoint(): x(0.f), y(0.f), dx(0.f), dy(0.f), dxy(0.f), u(0.f), v(0.f), du(0.f), dv(0.f), z(0.f), time(0.f), timeEr(2.9f) {};
L1HitPoint(fscal x_, fscal y_, fscal dx_, fscal dy_, fscal dxy_, fscal du_, fscal dv_, fscal z_, fscal v_, fscal u_, float time_, float timeEv1_=0, float timeEr_=2.9f):
x(x_), y(y_), dx(dx_), dy(dy_), dxy(dxy_), u(u_), v(v_), du(du_), dv(dv_), z(z_), time(time_), timeEr(timeEr_) {};
// L1HitPoint(fscal x_, fscal y_, fscal z_, fscal v_, fscal u_, fscal time_, unsigned short int n_ = 0):
// x(x_), y(y_), z(z_), u(u_), v(v_), time(time_){};
fscal Xs() const { return X()/Z(); }
fscal Ys() const { return Y()/Z(); } // value to sort hits by
fscal X() const { return x; }
fscal Y() const { return y; }
fscal dX() const { return dx; }
fscal dY() const { return dy; }
fscal dXY() const { return dxy; }
fscal dU() const { return du; }
fscal dV() const { return dv; }
fscal Z() const { return z; }
fscal U() const { return u; }
fscal V() const { return v; }
// unsigned short int N() const { return n; }
// int GetSortIndex() const { return SortIndex; }
void SetX(fscal X1) { x = X1; }
void SetY(fscal Y1) { y = Y1; }
void SetZ(fscal Z1) { z = Z1; }
void SetU(fscal U1) { u = U1; }
void SetV(fscal V1) { v = V1; }
void Set(fscal &x1, const float &y1, const float &dx1, const float &dy1, const float &xy1, const float &z1, const fscal &u1, const fscal &v1, const fscal &du1, const fscal &dv1, const float &time1, float timeEr1) {
x = x1;
y = y1;
dx = dx1;
dy = dy1;
du = du1;
dxy = xy1;
dv = dv1;
z = z1;
u = u1;
v = v1;
time = time1;
timeEr =timeEr1;
}
private:
float x, y, dx, dy, dxy, u, v, du, dv;
float z; // TODO: may be we should use iz
// x\u, v - front and back strips; x, y, z - coordinates of hits
public:
float time, timeEr;
// int track;
};
#else
static const float R = 60;
static const float shortPackingConstant = 2 * R / 65535.f;
static const float MZ = 110;
static const float shortPackingConstantZ = MZ / 65535.f;
/// contain strips positions and coordinates of hit
struct L1HitPoint{
L1HitPoint(){};
L1HitPoint(fscal x_, fscal y_, fscal z_, fscal v_, fscal u_, unsigned short int n_ = 0): x(f2s(x_)), y(f2s(y_)), z(f2sZ(z_)), u(f2s(u_)), v(f2s(v_)), n(n_){};
fscal Xs() const { return X()/Z(); }
fscal Ys() const { return Y()/Z(); } // value to sort hits by
fscal X() const { return s2f(x); }
fscal Y() const { return s2f(y); }
fscal Z() const { return s2fZ(z); }
fscal U() const { return s2f(u); }
fscal V() const { return s2f(v); }
unsigned short int N() const { return n; }
private:
//unsigned short int
unsigned short int f2s(float f) const {
return (f + R)/shortPackingConstant;
}
float s2f(unsigned short int f) const {
return (float(f)+0.5)*shortPackingConstant - R;
}
unsigned short int f2sZ(float f) const {
return (f)/shortPackingConstantZ;
}
float s2fZ(unsigned short int f) const {
return (float(f)+0.5)*shortPackingConstantZ;
}
unsigned short int x, y;
unsigned short int z; // TODO: may be we should use iz
unsigned short int u, v; // x\u, v - front and back strips; x, y, z - coordinates of hits
unsigned short int n; // number of event
};
#endif
#endif
This diff is collapsed.