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 (614)
Showing
with 971 additions and 533 deletions
......@@ -8,6 +8,9 @@ CbmRoot_Continuous:
- CbmRoot
only:
- master
only:
variables:
- $CI_PROJECT_PATH == "CbmSoft/CbmRoot"
cache:
paths:
- build/
......@@ -23,6 +26,9 @@ CbmRoot_Continuous:
- external/ipc_legacy/ipc/
- external/jsroot/
- external/spadic/spadic/
- input
- geometry
- parameters
script:
- set -xv
- mkdir -p build
......@@ -31,12 +37,6 @@ CbmRoot_Continuous:
- find . -name "*_ok" -delete
- find . -name "all_*.par" -delete
- cd ..
- cd input
- if [ ! -e field_v12a.root ]; then ln -s /srv/CBM/fieldmaps/field_v12a.root; fi
- if [ ! -e field_v12b.root ]; then ln -s /srv/CBM/fieldmaps/field_v12b.root; fi
- if [ ! -e field_v16a.root ]; then ln -s /srv/CBM/fieldmaps/field_v16a.root; fi
- if [ ! -e field_v18a.root ]; then ln -s /srv/CBM/fieldmaps/field_v18a.root; fi
- 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
......@@ -56,24 +56,39 @@ CbmRoot_Continuous:
- 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
# - mkdir -p build
# - cd build
# - touch bla.txt
# - cd ..
- cd input
- if [ ! -e field_v12a.root ]; then ln -s /srv/CBM/fieldmaps/field_v12a.root; fi
- if [ ! -e field_v12b.root ]; then ln -s /srv/CBM/fieldmaps/field_v12b.root; fi
- if [ ! -e field_v16a.root ]; then ln -s /srv/CBM/fieldmaps/field_v16a.root; fi
- if [ ! -e field_v18a.root ]; then ln -s /srv/CBM/fieldmaps/field_v18a.root; fi
- 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
......
# 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
......@@ -13,11 +13,11 @@
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
)
......@@ -33,7 +33,7 @@ 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})
......@@ -56,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)
......@@ -73,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)
......@@ -95,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)
......@@ -126,11 +132,15 @@ EndIf()
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")
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}")
......@@ -139,8 +149,20 @@ If(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
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})
Set(${_build_type_c} ${_cflags})
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()
......@@ -152,6 +174,7 @@ If(CMAKE_BUILD_TYPE MATCHES 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")
......@@ -184,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
......@@ -228,8 +251,8 @@ else(CBMROOT_MINIMAL)
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)
......@@ -258,8 +281,8 @@ SetBasicVariables()
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
......@@ -280,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
......@@ -292,95 +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 (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)
......@@ -390,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})
......@@ -408,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)
......@@ -434,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.
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
......@@ -5,7 +5,7 @@ EndIf()
add_subdirectory(base)
add_subdirectory(source)
add_subdirectory(sink)
add_subdirectory(unpacker)
#add_subdirectory(unpacker)
add_subdirectory(monitor)
add_subdirectory(histoServer)
......
......@@ -13,9 +13,9 @@ set(INCLUDE_DIRECTORIES
${CBMROOT_SOURCE_DIR}/fles/star2019/eventbuilder
${CBMROOT_SOURCE_DIR}/fles/star2019/parameter
${CBMROOT_SOURCE_DIR}/beamtime/base
${CBMROOT_SOURCE_DIR}/data
${CBMROOT_SOURCE_DIR}/data/tof
${CBMROOT_SOURCE_DIR}/base
${CBMDATA_DIR}
${CBMDATA_DIR}/tof
${CBMBASE_DIR}
)
Set(SYSTEM_INCLUDE_DIRECTORIES
......
......@@ -134,12 +134,14 @@ bool CbmMqHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/)
fNMessages += 1;
delete tempObject;
if( nullptr != tempObject )
delete tempObject;
/// TODO: control flags communication with histo server
/// Idea: 1 req channel (per device or not mixup?), polling every N TS and/or M s
if( bMqHistoServerResetHistos )
{
std::lock_guard<std::mutex> lk(mtx);
// LOG(info) << "Reset Monitor histos ";
ResetHistograms();
bMqHistoServerResetHistos = kFALSE;
......@@ -147,6 +149,7 @@ bool CbmMqHistoServer::ReceiveData(FairMQMessagePtr& msg, int /*index*/)
if( bMqHistoServerSaveHistos )
{
std::lock_guard<std::mutex> lk(mtx);
// LOG(info) << "Save All histos & canvases";
SaveHistograms();
bMqHistoServerSaveHistos = kFALSE;
......@@ -270,9 +273,9 @@ template< class HistoT > bool CbmMqHistoServer::ReadHistogram( HistoT * pHist )
continue;
/// Check if name matches one in config for others
if( fvpsHistosFolder[ uHist ].first == pHist->GetName() )
if( fvpsHistosFolder[ uHist ].first == histogram_new->GetName() )
{
fvHistos[ uHist ] = std::pair< TNamed *, std::string >( pHist, fvpsHistosFolder[ uHist ].second );
fvHistos[ uHist ] = std::pair< TNamed *, std::string >( histogram_new, fvpsHistosFolder[ uHist ].second );
fServer->Register( Form( "/%s", fvHistos[ uHist ].second.data() ), fvHistos[ uHist ].first );
fvbHistoRegistered[ uHist ] = true;
......@@ -292,7 +295,7 @@ template< class HistoT > bool CbmMqHistoServer::ReadHistogram( HistoT * pHist )
} // for( uint32_t uIdx = 0; uIdx < fvbHistoRegistered.size(); ++uIdx )
break;
} // if( fvpsHistosFolder[ uHist ].first == pHist->GetName() )
} // if( fvpsHistosFolder[ uHist ].first == histogram_new->GetName() )
} // for( uint32_t uCanv = 0; uCanv < fvpsCanvasConfig.size(); ++uCanv )
} // if( !fbAllCanvasReady )
} // if (-1 == index1)
......@@ -306,6 +309,7 @@ template< class HistoT > bool CbmMqHistoServer::ReadHistogram( HistoT * pHist )
<< pHist->GetName();
return false;
} // if( nullptr == histogram_existing )
histogram_existing->Add( pHist );
} // else of if (-1 == index1)
return true;
......
......@@ -7,10 +7,9 @@ set(INCLUDE_DIRECTORIES
${CBMROOT_SOURCE_DIR}/fles/cern2016/param
${CBMROOT_SOURCE_DIR}/fles/cern2016/unpacker
${CBMROOT_SOURCE_DIR}/beamtime/base
${CBMROOT_SOURCE_DIR}/data
${CBMROOT_SOURCE_DIR}/data/tof
${CBMROOT_SOURCE_DIR}/base
${CBMROOT_SOURCE_DIR}/tof/TofData
${CBMDATA_DIR}
${CBMDATA_DIR}/tof
${CBMBASE_DIR}
${CBMROOT_SOURCE_DIR}/tof/TofParam
${CBMROOT_SOURCE_DIR}/tof/TofTools
)
......
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startMQSamplerMonitor.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQSamplerMonitor.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startMQSamplerT0Monitor2020.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQSamplerT0Monitor2020.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/startMQSamplerTofMonitor2020.sh.in ${CMAKE_BINARY_DIR}/bin/MQ/topologies/startMQSamplerTofMonitor2020.sh)
set(INCLUDE_DIRECTORIES
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/MQ/base
${CBMROOT_SOURCE_DIR}/fles/cern2016/param
${CBMROOT_SOURCE_DIR}/fles/cern2016/unpacker
${CBMROOT_SOURCE_DIR}/fles/mcbm2018/monitor
${CBMROOT_SOURCE_DIR}/fles/mcbm2018/parameter
${CBMROOT_SOURCE_DIR}/fles/mcbm2018/dataformat
${CBMROOT_SOURCE_DIR}/fles/mcbm2018/commonMQ
${CBMROOT_SOURCE_DIR}/fles/flestools
${CBMROOT_SOURCE_DIR}/beamtime/base
${CBMROOT_SOURCE_DIR}/beamtime/unpacker
${CBMROOT_SOURCE_DIR}/data
${CBMROOT_SOURCE_DIR}/data/tof
${CBMROOT_SOURCE_DIR}/base
${CBMDATA_DIR}
${CBMDATA_DIR}/tof
${CBMDATA_DIR}/raw
${CBMBASE_DIR}
)
Set(SYSTEM_INCLUDE_DIRECTORIES
......@@ -72,7 +71,27 @@ set(DEPENDENCIES
${FAIR_LIBS}
${BOOST_LIBS}
fles_ipc
CbmFlibCern2016
CbmFlibMcbm2018
CbmFlibFlesTools
CbmBase
CbmData
Core
RIO
Net
Hist
RHTTP
)
#GENERATE_LIBRARY()
GENERATE_EXECUTABLE()
set(EXE_NAME TofMonitorMcbm2018)
set(SRCS CbmDeviceMonitorTof.cxx runMonitorTof.cxx)
set(DEPENDENCIES
${DEPENDENCIES}
${FAIR_LIBS}
${BOOST_LIBS}
fles_ipc
CbmFlibMcbm2018
CbmFlibFlesTools
CbmBase
......
......@@ -76,13 +76,16 @@ try
fuOffSpillCountLimit = fConfig->GetValue< uint32_t >( "SpillThr" );
fuPublishFreqTs = fConfig->GetValue< uint32_t >( "PubFreqTs" );
fdMinPublishTime = fConfig->GetValue< double_t >( "PubTimeMin" );
fdMinPublishTime = fConfig->GetValue< double_t >( "PubTimeMax" );
fdMaxPublishTime = fConfig->GetValue< double_t >( "PubTimeMax" );
fsChannelNameDataInput = fConfig->GetValue< std::string >( "TsNameIn" );
fsChannelNameHistosInput = fConfig->GetValue< std::string >( "ChNameIn" );
fsChannelNameHistosConfig = fConfig->GetValue< std::string >( "ChNameHistCfg" );
fsChannelNameCanvasConfig = fConfig->GetValue< std::string >( "ChNameCanvCfg" );
fsAllowedChannels[ 0 ] = fsChannelNameDataInput;
LOG(info) << "Histograms publication frequency in TS: " << fuPublishFreqTs;
LOG(info) << "Histograms publication min. interval in s: " << fdMinPublishTime;
LOG(info) << "Histograms publication max. interval in s: " << fdMaxPublishTime;
// Get the information about created channels from the device
// Check if the defined channels from the topology (by name)
......@@ -177,7 +180,7 @@ Bool_t CbmDeviceMonitorT0::InitContainers()
fMonitorAlgo->SetHistoryHistoSize( fuHistoryHistoSize );
fMonitorAlgo->SetPulserTotLimits( fuMinTotPulser, fuMaxTotPulser );
fMonitorAlgo->SetSpillThreshold( fuOffSpillCountLimit );
fMonitorAlgo->AddMsComponentToList(0, 0x90);
// fMonitorAlgo->AddMsComponentToList(0, 0x90);
Bool_t initOK = fMonitorAlgo->InitContainers();
......@@ -281,11 +284,11 @@ bool CbmDeviceMonitorT0::HandleData(FairMQMessagePtr& msg, int /*index*/)
std::chrono::system_clock::time_point currentTime = std::chrono::system_clock::now();
std::chrono::duration<double_t> elapsedSeconds = currentTime - fLastPublishTime;
if( ( fdMaxPublishTime < elapsedSeconds.count() ) ||
( 0 == fulNumMessages % 100 && fdMinPublishTime < elapsedSeconds.count() ) )
( 0 == fulNumMessages % fuPublishFreqTs && fdMinPublishTime < elapsedSeconds.count() ) )
{
SendHistograms();
fLastPublishTime = std::chrono::system_clock::now();
} // if( ( fdMaxPublishTime < elapsedSeconds.count() ) || ( 0 == fulNumMessages % 100 && fdMinPublishTime < elapsedSeconds.count() ) )
} // if( ( fdMaxPublishTime < elapsedSeconds.count() ) || ( 0 == fulNumMessages % fuPublishFreqTs && fdMinPublishTime < elapsedSeconds.count() ) )
return true;
}
......@@ -338,11 +341,24 @@ Bool_t CbmDeviceMonitorT0::DoUnpack(const fles::Timeslice& ts, size_t /*componen
{
fulTsCounter++;
if( /* fbMonitorMode && */ bMcbm2018MonitorTaskT0ResetHistos ) {
LOG(info) << "Reset T0 Monitor histos ";
fMonitorAlgo->ResetHistograms();
bMcbm2018MonitorTaskT0ResetHistos = kFALSE;
} // if( fbMonitorMode && bMcbm2018MonitorTaskT0ResetHistos )
if( kFALSE == fbComponentsAddedToList )
{
for( uint32_t uCompIdx = 0; uCompIdx < ts.num_components(); ++uCompIdx )
{
if( kusSysId == ts.descriptor( uCompIdx, 0 ).sys_id )
{
fMonitorAlgo->AddMsComponentToList( uCompIdx, kusSysId );
} // if( kusSysId == ts.descriptor( uCompIdx, 0 ).sys_id )
} // for( uint32_t uComp = 0; uComp < ts.num_components(); ++uComp )
fbComponentsAddedToList = kTRUE;
} // if( kFALSE == fbComponentsAddedToList )
if( /* fbMonitorMode && */ bMcbm2018MonitorTaskT0ResetHistos )
{
LOG(info) << "Reset T0 Monitor histos ";
fMonitorAlgo->ResetHistograms();
bMcbm2018MonitorTaskT0ResetHistos = kFALSE;
} // if( fbMonitorMode && bMcbm2018MonitorTaskT0ResetHistos )
if( kFALSE == fMonitorAlgo->ProcessTs( ts ) )
{
......
......@@ -34,8 +34,12 @@ class CbmDeviceMonitorT0: public FairMQDevice
bool HandleData(FairMQMessagePtr&, int);
private:
/// Constants
static const uint16_t kusSysId = 0x90;
/// Control flags
Bool_t fbIgnoreOverlapMs; //! Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice
Bool_t fbComponentsAddedToList = kFALSE;
/// User settings parameters
std::string fsChannelNameDataInput;
......
/**
* CbmDeviceMonitorTof.cxx
*
* @since 2020-04-15
* @author P.-A Loizeau
*/
#include "CbmDeviceMonitorTof.h"
#include "CbmMQDefs.h"
#include "CbmMcbm2018MonitorAlgoTof.h"
#include "CbmFlesCanvasTools.h"
#include "StorableTimeslice.hpp"
#include "FairMQLogger.h"
#include "FairMQProgOptions.h" // device->fConfig
#include "FairParGenericSet.h"
#include "RootSerializer.h"
#include "BoostSerializer.h"
#include "TNamed.h"
#include "TList.h"
#include "TCanvas.h"
#include "TFile.h"
#include "TH1.h"
#include <string>
#include <iomanip>
#include <array>
#include <boost/serialization/utility.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <stdexcept>
struct InitTaskError : std::runtime_error { using std::runtime_error::runtime_error; };
using namespace std;
Bool_t bMcbm2018MonitorTaskTofResetHistos = kFALSE;
CbmDeviceMonitorTof::CbmDeviceMonitorTof()
: fMonitorAlgo{ new CbmMcbm2018MonitorAlgoTof() }
{
}
void CbmDeviceMonitorTof::InitTask()
try
{
/// Read options from executable
LOG(info) << "Init options for CbmMqStarHistoServer.";
fbIgnoreOverlapMs = fConfig->GetValue< bool >( "IgnOverMs" );
fbDebugMonitorMode = fConfig->GetValue< bool >( "DebugMoni" );
fbIgnoreCriticalErrors = fConfig->GetValue< bool >( "IgnCritErr" );
fuHistoryHistoSize = fConfig->GetValue< uint32_t >( "HistEvoSz" );
fuMinTotPulser = fConfig->GetValue< uint32_t >( "PulsTotMin" );
fuMaxTotPulser = fConfig->GetValue< uint32_t >( "PulsTotMax" );
fiGdpbIndex = fConfig->GetValue< int32_t >( "GdpbIdx" );
fuPublishFreqTs = fConfig->GetValue< uint32_t >( "PubFreqTs" );
fdMinPublishTime = fConfig->GetValue< double_t >( "PubTimeMin" );
fdMaxPublishTime = fConfig->GetValue< double_t >( "PubTimeMax" );
fsChannelNameDataInput = fConfig->GetValue< std::string >( "TsNameIn" );
fsChannelNameHistosInput = fConfig->GetValue< std::string >( "ChNameIn" );
fsChannelNameHistosConfig = fConfig->GetValue< std::string >( "ChNameHistCfg" );
fsChannelNameCanvasConfig = fConfig->GetValue< std::string >( "ChNameCanvCfg" );
fsAllowedChannels[ 0 ] = fsChannelNameDataInput;
LOG(info) << "Histograms publication frequency in TS: " << fuPublishFreqTs;
LOG(info) << "Histograms publication min. interval in s: " << fdMinPublishTime;
LOG(info) << "Histograms publication max. interval in s: " << fdMaxPublishTime;
// Get the information about created channels from the device
// Check if the defined channels from the topology (by name)
// are in the list of channels which are possible/allowed
// for the device
// The idea is to check at initilization if the devices are
// properly connected. For the time beeing this is done with a
// nameing convention. It is not avoided that someone sends other
// data on this channel.
//logger::SetLogLevel("INFO");
int noChannel = fChannels.size();
LOG(info) << "Number of defined channels: " << noChannel;
for( auto const &entry : fChannels )
{
LOG(info) << "Channel name: " << entry.first;
if( std::string::npos != entry.first.find( fsChannelNameDataInput ) )
{
if( !IsChannelNameAllowed( entry.first ) )
throw InitTaskError( "Channel name does not match." );
OnData( entry.first, &CbmDeviceMonitorTof::HandleData );
} // if( std::string::npos != entry.first.find( fsChannelNameDataInput ) )
} // for( auto const &entry : fChannels )
InitContainers();
} catch (InitTaskError& e) {
LOG(error) << e.what();
// Wrapper defined in CbmMQDefs.h to support different FairMQ versions
cbm::mq::ChangeState( this, cbm::mq::Transition::ErrorFound );
}
bool CbmDeviceMonitorTof::IsChannelNameAllowed(std::string channelName)
{
for( auto const &entry : fsAllowedChannels ) {
std::size_t pos1 = channelName.find(entry);
if( pos1 != std::string::npos ) {
const vector< std::string >::const_iterator pos =
std::find( fsAllowedChannels.begin(), fsAllowedChannels.end(), entry );
const vector< std::string >::size_type idx = pos - fsAllowedChannels.begin();
LOG(info) << "Found " << entry << " in " << channelName;
LOG(info) << "Channel name " << channelName
<< " found in list of allowed channel names at position " << idx;
return true;
} // if (pos1!=std::string::npos)
} // for(auto const &entry : fsAllowedChannels)
LOG(info) << "Channel name " << channelName
<< " not found in list of allowed channel names.";
LOG(error) << "Stop device.";
return false;
}
Bool_t CbmDeviceMonitorTof::InitContainers()
{
LOG(info) << "Init parameter containers for CbmDeviceMonitorTof.";
fParCList = fMonitorAlgo->GetParList();
for( int iparC = 0; iparC < fParCList->GetEntries(); iparC++ ) {
FairParGenericSet* tempObj = (FairParGenericSet*)( fParCList->At( iparC ) );
fParCList->Remove( tempObj );
std::string paramName{ tempObj->GetName() };
// NewSimpleMessage creates a copy of the data and takes care of its destruction (after the transfer takes place).
// Should only be used for small data because of the cost of an additional copy
// Her must come the proper Runid
std::string message = paramName + ",111";
LOG(info) << "Requesting parameter container " << paramName << ", sending message: " << message;
FairMQMessagePtr req( NewSimpleMessage(message) );
FairMQMessagePtr rep( NewMessage() );
FairParGenericSet* newObj = nullptr;
if ( Send(req, "parameters") > 0 ) {
if ( Receive( rep, "parameters" ) >= 0) {
if ( rep->GetSize() != 0 ) {
CbmMQTMessage tmsg( rep->GetData(), rep->GetSize() );
newObj = static_cast< FairParGenericSet* >( tmsg.ReadObject( tmsg.GetClass() ) );
LOG( info ) << "Received unpack parameter from the server:";
newObj->print();
} else {
LOG( error ) << "Received empty reply. Parameter not available";
} // if (rep->GetSize() != 0)
} // if (Receive(rep, "parameters") >= 0)
} // if (Send(req, "parameters") > 0)
fParCList->AddAt( newObj, iparC );
delete tempObj;
} // for ( int iparC = 0; iparC < fParCList->GetEntries(); iparC++ )
/// Need to add accessors for all options
fMonitorAlgo->SetIgnoreOverlapMs( fbIgnoreOverlapMs );
fMonitorAlgo->SetDebugMonitorMode( fbDebugMonitorMode );
fMonitorAlgo->SetIgnoreCriticalErrors( fbIgnoreCriticalErrors );
fMonitorAlgo->SetHistoryHistoSize( fuHistoryHistoSize );
fMonitorAlgo->SetPulserTotLimits( fuMinTotPulser, fuMaxTotPulser );
fMonitorAlgo->SetGdpbIndex( fiGdpbIndex );
Bool_t initOK = fMonitorAlgo->InitContainers();
// Bool_t initOK = fMonitorAlgo->ReInitContainers();
/// Histos creation and obtain pointer on them
/// Trigger histo creation on all associated algos
initOK &= fMonitorAlgo->CreateHistograms();
/// Obtain vector of pointers on each histo from the algo (+ optionally desired folder)
std::vector< std::pair< TNamed *, std::string > > vHistos = fMonitorAlgo->GetHistoVector();
/// Obtain vector of pointers on each canvas from the algo (+ optionally desired folder)
std::vector< std::pair< TCanvas *, std::string > > vCanvases = fMonitorAlgo->GetCanvasVector();
/// Add pointers to each histo in the histo array
/// Create histo config vector
/// ===> Use an std::vector< std::pair< std::string, std::string > > with < Histo name, Folder >
/// and send it through a separate channel using the BoostSerializer
for( UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto )
{
// LOG(info) << "Registering " << vHistos[ uHisto ].first->GetName()
// << " in " << vHistos[ uHisto ].second.data()
// ;
fArrayHisto.Add( vHistos[ uHisto ].first );
std::pair< std::string, std::string > psHistoConfig( vHistos[ uHisto ].first->GetName(),
vHistos[ uHisto ].second );
fvpsHistosFolder.push_back( psHistoConfig );
/// Serialize the vector of histo config into a single MQ message
FairMQMessagePtr messageHist( NewMessage() );
Serialize< BoostSerializer < std::pair< std::string, std::string > > >( *messageHist, psHistoConfig );
/// Send message to the common histogram config messages queue
if( Send( messageHist, fsChannelNameHistosConfig ) < 0 )
{
LOG(error) << "Problem sending histo config";
return false;
} // if( Send( messageHist, fsChannelNameHistosConfig ) < 0 )
LOG(info) << "Config of hist " << psHistoConfig.first.data()
<< " in folder " << psHistoConfig.second.data() ;
} // for( UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto )
/// Create canvas config vector
/// ===> Use an std::vector< std::pair< std::string, std::string > > with < Canvas name, config >
/// and send it through a separate channel using the BoostSerializer
for( UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv )
{
// LOG(info) << "Registering " << vCanvases[ uCanv ].first->GetName()
// << " in " << vCanvases[ uCanv ].second.data();
std::string sCanvName = (vCanvases[ uCanv ].first)->GetName();
std::string sCanvConf = GenerateCanvasConfigString( vCanvases[ uCanv ].first );
std::pair< std::string, std::string > psCanvConfig( sCanvName, sCanvConf );
fvpsCanvasConfig.push_back( psCanvConfig );
/// Serialize the vector of canvas config into a single MQ message
FairMQMessagePtr messageCan( NewMessage() );
Serialize< BoostSerializer < std::pair< std::string, std::string > > >( *messageCan, psCanvConfig );
/// Send message to the common canvas config messages queue
if( Send( messageCan, fsChannelNameCanvasConfig ) < 0 )
{
LOG(error) << "Problem sending canvas config";
return false;
} // if( Send( messageCan, fsChannelNameCanvasConfig ) < 0 )
LOG(info) << "Config string of Canvas " << psCanvConfig.first.data()
<< " is " << psCanvConfig.second.data() ;
} // for( UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv )
return initOK;
}
// handler is called whenever a message arrives on "data", with a reference to the message and a sub-channel index (here 0)
bool CbmDeviceMonitorTof::HandleData(FairMQMessagePtr& msg, int /*index*/)
{
fulNumMessages++;
LOG(debug) << "Received message number "<< fulNumMessages
<< " with size " << msg->GetSize();
if( 0 == fulNumMessages % 10000 )
LOG(info) << "Received " << fulNumMessages << " messages";
std::string msgStr( static_cast<char*>( msg->GetData() ), msg->GetSize() );
std::istringstream iss( msgStr );
boost::archive::binary_iarchive inputArchive( iss );
/// Create an empty TS and fill it with the incoming message
fles::StorableTimeslice component{ 0 };
inputArchive >> component;
/// Process the Timeslice
DoUnpack(component, 0);
/// Send histograms each 100 time slices. Should be each ~1s
/// Use also runtime checker to trigger sending after M s if
/// processing too slow or delay sending if processing too fast
std::chrono::system_clock::time_point currentTime = std::chrono::system_clock::now();
std::chrono::duration<double_t> elapsedSeconds = currentTime - fLastPublishTime;
if( ( fdMaxPublishTime < elapsedSeconds.count() ) ||
( 0 == fulNumMessages % fuPublishFreqTs && fdMinPublishTime < elapsedSeconds.count() ) )
{
SendHistograms();
fLastPublishTime = std::chrono::system_clock::now();
} // if( ( fdMaxPublishTime < elapsedSeconds.count() ) || ( 0 == fulNumMessages % fuPublishFreqTs && fdMinPublishTime < elapsedSeconds.count() ) )
return true;
}
bool CbmDeviceMonitorTof::SendHistograms()
{
/// Serialize the array of histos into a single MQ message
FairMQMessagePtr message( NewMessage() );
Serialize<RootSerializer>( *message, &fArrayHisto );
// test code to check if deserialization works
/*
TObject* tempObject = nullptr;
Deserialize<RootDeserializer>(*message, tempObject);
if (TString(tempObject->ClassName()).EqualTo("TObjArray")) {
TObjArray* arrayHisto = static_cast<TObjArray*>(tempObject);
LOG(info) << "Array contains " << arrayHisto->GetEntriesFast()
<< " entries";
for (Int_t i = 0; i < arrayHisto->GetEntriesFast(); i++) {
TObject* obj = arrayHisto->At(i);
LOG(info) << obj->GetName();
TH1* histogram = static_cast<TH1*>(obj);
LOG(info) << histogram->GetNbinsX();
}
}
*/
/// Send message to the common histogram messages queue
if( Send( message, fsChannelNameHistosInput ) < 0 )
{
LOG(error) << "Problem sending data";
return false;
} // if( Send( message, fsChannelNameHistosInput ) < 0 )
/// Reset the histograms after sending them (but do not reset the time)
fMonitorAlgo->ResetHistograms( kFALSE );
return true;
}
CbmDeviceMonitorTof::~CbmDeviceMonitorTof()
{
}
Bool_t CbmDeviceMonitorTof::DoUnpack(const fles::Timeslice& ts, size_t /*component*/)
{
fulTsCounter++;
if( kFALSE == fbComponentsAddedToList )
{
for( uint32_t uCompIdx = 0; uCompIdx < ts.num_components(); ++uCompIdx )
{
if( kusSysIdTof == ts.descriptor( uCompIdx, 0 ).sys_id )
{
fMonitorAlgo->AddMsComponentToList( uCompIdx, kusSysIdTof );
} // if( kusSysIdTof == ts.descriptor( uCompIdx, 0 ).sys_id )
else if( kusSysIdT0 == ts.descriptor( uCompIdx, 0 ).sys_id )
{
fMonitorAlgo->AddMsComponentToList( uCompIdx, kusSysIdT0 );
} // if( kusSysIdT0 == ts.descriptor( uCompIdx, 0 ).sys_id )
} // for( uint32_t uComp = 0; uComp < ts.num_components(); ++uComp )
fbComponentsAddedToList = kTRUE;
} // if( kFALSE == fbComponentsAddedToList )
if( /* fbMonitorMode && */ bMcbm2018MonitorTaskTofResetHistos )
{
LOG(info) << "Reset TOF Monitor histos ";
fMonitorAlgo->ResetHistograms();
bMcbm2018MonitorTaskTofResetHistos = kFALSE;
} // if( fbMonitorMode && bMcbm2018MonitorTaskTofResetHistos )
if( kFALSE == fMonitorAlgo->ProcessTs( ts ) )
{
LOG(error) << "Failed processing TS " << ts.index()
<< " in unpacker algorithm class";
return kTRUE;
} // if( kFALSE == fMonitorAlgo->ProcessTs( ts ) )
/// Clear the digis vector in case it was filled
fMonitorAlgo->ClearVector();
if( 0 == fulTsCounter % 10000 )
LOG(info) << "Processed " << fulTsCounter << " time slices";
return kTRUE;
}
void CbmDeviceMonitorTof::Finish()
{
}
/**
* CbmDeviceMonitorTof.h
*
* @since 2020-04-15
* @author P.-A Loizeau
*/
#ifndef CBMDEVICEMONITORTOF_H_
#define CBMDEVICEMONITORTOF_H_
#include "FairMQDevice.h"
#include "Timeslice.hpp"
#include "TMessage.h"
#include "Rtypes.h"
#include "TObjArray.h"
#include <vector>
#include <map>
#include <chrono>
class TList;
class CbmMcbm2018MonitorAlgoTof;
class CbmDeviceMonitorTof: public FairMQDevice
{
public:
CbmDeviceMonitorTof();
virtual ~CbmDeviceMonitorTof();
protected:
virtual void InitTask();
bool HandleData(FairMQMessagePtr&, int);
private:
/// Constants
static const uint16_t kusSysIdTof = 0x60;
static const uint16_t kusSysIdT0 = 0x90;
/// Control flags
Bool_t fbIgnoreOverlapMs = kFALSE; //! Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice
Bool_t fbDebugMonitorMode = kFALSE; //! Switch ON the filling of a additional set of histograms
Bool_t fbIgnoreCriticalErrors = kTRUE; //! If ON not printout at all for critical errors
Bool_t fbComponentsAddedToList = kFALSE;
/// User settings parameters
std::string fsChannelNameDataInput = "tofcomponent";
std::string fsChannelNameHistosInput = "histogram-in";
std::string fsChannelNameHistosConfig = "histo-conf";
std::string fsChannelNameCanvasConfig = "canvas-conf";
uint32_t fuHistoryHistoSize = 3600;
uint32_t fuMinTotPulser = 185;
uint32_t fuMaxTotPulser = 195;
int32_t fiGdpbIndex = -1;
uint32_t fuPublishFreqTs = 100;
double_t fdMinPublishTime = 0.5;
double_t fdMaxPublishTime = 5.0;
/// List of MQ channels names
std::vector< std::string > fsAllowedChannels = { fsChannelNameDataInput };
/// Parameters management
TList* fParCList = nullptr;
/// Statistics & first TS rejection
uint64_t fulNumMessages = 0;
uint64_t fulTsCounter = 0;
std::chrono::system_clock::time_point fLastPublishTime = std::chrono::system_clock::now();
/// Processing algo
CbmMcbm2018MonitorAlgoTof * fMonitorAlgo;
/// Array of histograms to send to the histogram server
TObjArray fArrayHisto = {};
/// Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server
std::vector< std::pair< std::string, std::string > > fvpsHistosFolder = {};
/// Vector of string pairs with ( CanvasName, CanvasConfig ) to send to the histogram server
/// Format of Can config is "NbPadX(U);NbPadY(U);ConfigPad1(s);....;ConfigPadXY(s)"
/// Format of Pad config is "GrixX(b),GridY(b),LogX(b),LogY(b),LogZ(b),HistoName(s),DrawOptions(s)"
std::vector< std::pair< std::string, std::string > > fvpsCanvasConfig = {};
bool IsChannelNameAllowed(std::string channelName);
Bool_t InitContainers();
Bool_t DoUnpack(const fles::Timeslice& ts, size_t component);
void Finish();
bool SendHistograms();
};
// special class to expose protected TMessage constructor
class CbmMQTMessage : public TMessage
{
public:
CbmMQTMessage(void* buf, Int_t len)
: TMessage(buf, len)
{
ResetBit(kIsOwner);
}
};
#endif /* CBMDEVICEMONITORTOF_H_ */
#include "runFairMQDevice.h"
#include "CbmDeviceMonitorTof.h"
#include <string>
#include <iomanip>
namespace bpo = boost::program_options;
using namespace std;
void addCustomOptions(bpo::options_description& options)
{
options.add_options() ("IgnOverMs", bpo::value< bool >()->default_value( true ),
"Ignore overlap MS if true");
options.add_options() ("DebugMoni", bpo::value< bool >()->default_value( false ),
"Debug Monitor Mode");
options.add_options() ("IgnCritErr", bpo::value< bool >()->default_value( true ),
"Ignore Critical Errors");
options.add_options() ("HistEvoSz", bpo::value< uint32_t >()->default_value( 1800 ),
"Size of evolution histos in seconds");
options.add_options() ("PulsTotMin", bpo::value< uint32_t >()->default_value( 185 ),
"Minimal TOT for pulser cut");
options.add_options() ("PulsTotMax", bpo::value< uint32_t >()->default_value( 195 ),
"Maximal TOT for pulser cut");
options.add_options() ("GdpbIdx", bpo::value< int32_t >()->default_value( -1 ),
"Single gDPB selection by index, -1 (default) to disable");
options.add_options() ("PubFreqTs", bpo::value< uint32_t >()->default_value( 100 ),
"Histo publishing frequency in TS");
options.add_options() ("PubTimeMin", bpo::value< double_t >()->default_value( 1.0 ),
"Minimal time between two publishing");
options.add_options() ("PubTimeMax", bpo::value< double_t >()->default_value( 10.0 ),
"Maximal time between two publishing");
options.add_options() ( "TsNameIn", bpo::value< std::string >()->default_value( "tofcomponent" ),
"MQ channel name for TS data");
options.add_options() ( "ChNameIn", bpo::value< std::string >()->default_value( "histogram-in" ),
"MQ channel name for histos");
options.add_options() ( "ChNameHistCfg", bpo::value< std::string >()->default_value( "histo-conf" ),
"MQ channel name for histos config");
options.add_options() ( "ChNameCanvCfg", bpo::value< std::string >()->default_value( "canvas-conf" ),
"MQ channel name for canvases config");
}
FairMQDevicePtr getDevice(const FairMQProgOptions& /*config*/)
{
return new CbmDeviceMonitorTof();
}
......@@ -44,7 +44,7 @@ else
_nbmoni=1
fi
_paramfile=/scratch/cbmroot_macro/macro/beamtime/mcbm2018/mT0Par.par
_paramfile=/scratch/cbmroot_macro/macro/beamtime/mcbm2019/mT0Par.par
SAMPLER="MultiTsaSampler"
SAMPLER+=" --id sampler1"
......@@ -60,6 +60,7 @@ elif [ "$_filename" != "" ]; then
fi
fi
SAMPLER+=" --high-water-mark 1000"
SAMPLER+=" --send-ts-per-sysid 1"
SAMPLER+=" --channel-config name=t0component,type=push,method=bind,address=tcp://127.0.0.1:11555"
SAMPLER+=" --transport shmem"
#SAMPLER+=" --transport zeromq"
......
#!/bin/bash
$SIMPATH/bin/fairmq-shmmonitor --cleanup
if [ $# -ge 1 ]; then
_nbmoni=$1
((_pubfreqts = $_nbmoni*100 ))
_pubminsec=1.0
_pubmaxsec=10.0
if [ $# -ge 4 ]; then
_filename=""
_dirname=""
_hostname=$4
if [ $# -ge 5 ]; then
_pubfreqts=$5
if [ $# -ge 6 ]; then
_pubminsec=$6
if [ $# -ge 7 ]; then
_pubmaxsec=$7
fi
fi
fi
elif [ $# -ge 2 ]; then
_filename=$2
_hostname=""
if [ $# -eq 3 ]; then
_dirname=$3
else
_dirname=""
fi
else
echo 'Starting connection to local stream'
echo ' for other usages, please supply at least a filename.'
echo 'Possible usages are:'
echo 'startMQSamplerT0Monitor2020.sh'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes>'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes> <full filename pattern list>'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes> <filename pattern> <folder_path>'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list>'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS>'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS> <Min Hist pub. in s>'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS> <Min Hist pub. in s> <Max Hist pub. in s>'
_filename=""
_dirname=""
_hostname="localhost"
fi
else
echo 'Starting connection to local stream with 1 monitor process'
echo ' for other usages, please supply at least a filename.'
echo 'Possible usages are:'
echo 'startMQSamplerT0Monitor2020.sh'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes>'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes> <full filename pattern list>'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes> <filename pattern> <folder_path>'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list>'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS>'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS> <Min Hist pub. in s>'
echo 'startMQSamplerT0Monitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS> <Min Hist pub. in s> <Max Hist pub. in s>'
_filename=""
_dirname=""
_hostname="localhost"
_nbmoni=1
_pubfreqts=100
_pubminsec=1.0
_pubmaxsec=10.0
fi
_paramfile=/scratch/cbmroot_macro/macro/beamtime/mcbm2020/mT0Par.par
SAMPLER="MultiTsaSampler"
SAMPLER+=" --id sampler1"
SAMPLER+=" --max-timeslices 0"
SAMPLER+=" --severity info"
#SAMPLER+=" --flib-port 10"
if [ "$_hostname" != "" ]; then
SAMPLER+=" --flib-host $_hostname"
elif [ "$_filename" != "" ]; then
SAMPLER+=" --filename $_filename"
if [ "$_dirname" != "" ]; then
SAMPLER+=" --dirname $_dirname"
fi
fi
SAMPLER+=" --high-water-mark 1000"
SAMPLER+=" --send-ts-per-sysid 1"
SAMPLER+=" --channel-config name=t0component,type=push,method=bind,address=tcp://127.0.0.1:11555"
#SAMPLER+=" --transport shmem"
SAMPLER+=" --transport zeromq"
#SAMPLER+=" --transport nanomsg"
xterm -l -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER &
_iMoni=0
while (( _iMoni < _nbmoni )); do
(( _yOffset=100*_iMoni ))
(( _iMoni += 1 ))
MONITOR="T0MonitorMcbm2018"
MONITOR+=" --id mon$_iMoni"
MONITOR+=" --severity info"
MONITOR+=" --PubFreqTs $_pubfreqts"
MONITOR+=" --PubTimeMin $_pubminsec"
MONITOR+=" --PubTimeMax $_pubmaxsec"
MONITOR+=" --channel-config name=t0component,type=pull,method=connect,address=tcp://127.0.0.1:11555"
#MONITOR+=" --transport shmem"
MONITOR+=" --transport zeromq"
#MONITOR+=" --transport nanomsg"
MONITOR+=" --channel-config name=parameters,type=req,method=connect,transport=zeromq,address=tcp://127.0.0.1:11005,rateLogging=0"
MONITOR+=" --channel-config name=histogram-in,type=pub,method=connect,transport=zeromq,address=tcp://127.0.0.1:11666"
MONITOR+=" --channel-config name=histo-conf,type=pub,method=connect,transport=zeromq,address=tcp://127.0.0.1:11667"
MONITOR+=" --channel-config name=canvas-conf,type=pub,method=connect,transport=zeromq,address=tcp://127.0.0.1:11668"
xterm -l -geometry 80x23+500+$_yOffset -hold -e @CMAKE_BINARY_DIR@/bin/MQ/monitor/$MONITOR &
done
PARAMETERSERVER="parmq-server"
PARAMETERSERVER+=" --id parmq-server"
PARAMETERSERVER+=" --severity info"
PARAMETERSERVER+=" --channel-name parameters"
PARAMETERSERVER+=" --channel-config name=parameters,type=rep,method=bind,transport=zeromq,address=tcp://127.0.0.1:11005,rateLogging=0"
PARAMETERSERVER+=" --first-input-name $_paramfile"
PARAMETERSERVER+=" --first-input-type ASCII"
PARAMETERSERVER+=" --libs-to-load=libCbmFlibMcbm2018" # doesn't work due to runtime problem
xterm -geometry 80x23+1000+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/parmq/$PARAMETERSERVER &
HISTSERVER="MqHistoServer"
HISTSERVER+=" --id server1"
HISTSERVER+=" --channel-config name=histogram-in,type=sub,method=bind,transport=zeromq,address=tcp://127.0.0.1:11666"
HISTSERVER+=" --channel-config name=histo-conf,type=sub,method=bind,transport=zeromq,address=tcp://127.0.0.1:11667"
HISTSERVER+=" --channel-config name=canvas-conf,type=sub,method=bind,transport=zeromq,address=tcp://127.0.0.1:11668"
xterm -geometry 80x23+1500+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/histogramServer/$HISTSERVER &
#!/bin/bash
$SIMPATH/bin/fairmq-shmmonitor --cleanup
if [ $# -ge 1 ]; then
_nbmoni=$1
((_pubfreqts = $_nbmoni*100 ))
_pubminsec=1.0
_pubmaxsec=10.0
if [ $# -ge 4 ]; then
_filename=""
_dirname=""
_hostname=$4
if [ $# -ge 5 ]; then
_pubfreqts=$5
if [ $# -ge 6 ]; then
_pubminsec=$6
if [ $# -ge 7 ]; then
_pubmaxsec=$7
fi
fi
fi
elif [ $# -ge 2 ]; then
_filename=$2
_hostname=""
if [ $# -eq 3 ]; then
_dirname=$3
else
_dirname=""
fi
else
echo 'Starting connection to local stream'
echo ' for other usages, please supply at least a filename.'
echo 'Possible usages are:'
echo 'startMQSamplerTofMonitor2020.sh'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes>'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> <full filename pattern list>'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> <filename pattern> <folder_path>'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list>'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS>'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS> <Min Hist pub. in s>'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS> <Min Hist pub. in s> <Max Hist pub. in s>'
_filename=""
_dirname=""
_hostname="localhost"
fi
else
echo 'Starting connection to local stream with 1 monitor process'
echo ' for other usages, please supply at least a filename.'
echo 'Possible usages are:'
echo 'startMQSamplerTofMonitor2020.sh'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes>'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> <full filename pattern list>'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> <filename pattern> <folder_path>'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list>'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS>'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS> <Min Hist pub. in s>'
echo 'startMQSamplerTofMonitor2020.sh <Nb Monitor processes> "" "" <hostname(s) list> <Hist publish freq. in TS> <Min Hist pub. in s> <Max Hist pub. in s>'
_filename=""
_dirname=""
_hostname="localhost"
_nbmoni=1
_pubfreqts=100
_pubminsec=1.0
_pubmaxsec=10.0
fi
_paramfile=/scratch/cbmroot_macro/macro/beamtime/mcbm2020/mTofPar.par
SAMPLER="MultiTsaSampler"
SAMPLER+=" --id sampler1"
SAMPLER+=" --max-timeslices 0"
SAMPLER+=" --severity info"
#SAMPLER+=" --flib-port 10"
if [ "$_hostname" != "" ]; then
SAMPLER+=" --flib-host $_hostname"
elif [ "$_filename" != "" ]; then
SAMPLER+=" --filename $_filename"
if [ "$_dirname" != "" ]; then
SAMPLER+=" --dirname $_dirname"
fi
fi
SAMPLER+=" --high-water-mark 1000"
#SAMPLER+=" --no-split-ts 1"
SAMPLER+=" --send-ts-per-channel 1"
SAMPLER+=" --sysid-chan 0x60:tofcomponent"
SAMPLER+=" --sysid-chan 0x90:tofcomponent"
SAMPLER+=" --channel-config name=tofcomponent,type=push,method=bind,address=tcp://127.0.0.1:11555"
#SAMPLER+=" --transport shmem"
SAMPLER+=" --transport zeromq"
#SAMPLER+=" --transport nanomsg"
xterm -l -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER &
_iMoni=0
((_oubfreqts = $_nbmoni*100 ))
while (( _iMoni < _nbmoni )); do
(( _yOffset=100*_iMoni ))
(( _iMoni += 1 ))
MONITOR="TofMonitorMcbm2018"
MONITOR+=" --id mon$_iMoni"
MONITOR+=" --severity info"
# MONITOR+=" --DebugMoni 1"
MONITOR+=" --PubFreqTs $_pubfreqts"
MONITOR+=" --PubTimeMin $_pubminsec"
MONITOR+=" --PubTimeMax $_pubmaxsec"
MONITOR+=" --channel-config name=tofcomponent,type=pull,method=connect,address=tcp://127.0.0.1:11555"
#MONITOR+=" --transport shmem"
MONITOR+=" --transport zeromq"
#MONITOR+=" --transport nanomsg"
MONITOR+=" --channel-config name=parameters,type=req,method=connect,transport=zeromq,address=tcp://127.0.0.1:11005,rateLogging=0"
MONITOR+=" --channel-config name=histogram-in,type=pub,method=connect,transport=zeromq,address=tcp://127.0.0.1:11666"
MONITOR+=" --channel-config name=histo-conf,type=pub,method=connect,transport=zeromq,address=tcp://127.0.0.1:11667"
MONITOR+=" --channel-config name=canvas-conf,type=pub,method=connect,transport=zeromq,address=tcp://127.0.0.1:11668"
xterm -l -geometry 80x23+500+$_yOffset -hold -e @CMAKE_BINARY_DIR@/bin/MQ/monitor/$MONITOR &
done
PARAMETERSERVER="parmq-server"
PARAMETERSERVER+=" --id parmq-server"
PARAMETERSERVER+=" --severity info"
PARAMETERSERVER+=" --channel-name parameters"
PARAMETERSERVER+=" --channel-config name=parameters,type=rep,method=bind,transport=zeromq,address=tcp://127.0.0.1:11005,rateLogging=0"
PARAMETERSERVER+=" --first-input-name $_paramfile"
PARAMETERSERVER+=" --first-input-type ASCII"
PARAMETERSERVER+=" --libs-to-load=libCbmFlibMcbm2018" # doesn't work due to runtime problem
xterm -geometry 80x23+1000+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/parmq/$PARAMETERSERVER &
HISTSERVER="MqHistoServer"
HISTSERVER+=" --id server1"
HISTSERVER+=" --channel-config name=histogram-in,type=sub,method=bind,transport=zeromq,address=tcp://127.0.0.1:11666"
HISTSERVER+=" --channel-config name=histo-conf,type=sub,method=bind,transport=zeromq,address=tcp://127.0.0.1:11667"
HISTSERVER+=" --channel-config name=canvas-conf,type=sub,method=bind,transport=zeromq,address=tcp://127.0.0.1:11668"
xterm -geometry 80x23+1500+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/histogramServer/$HISTSERVER &
......@@ -65,8 +65,10 @@ Set(DEPENDENCIES
Net
Geom
CbmField
CbmTof
CbmSts
CbmTofBase
CbmStsBase
CbmStsSim
CbmSimBase
CbmFlibMcbm2018
)
GENERATE_EXECUTABLE()