mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 13:57:13 +02:00
Compare commits
381 Commits
2020.11.09
...
2021.5.10.
Author | SHA1 | Date | |
---|---|---|---|
085ea3aee7 | |||
c054ad3af3 | |||
28c7d533e9 | |||
fa6a685508 | |||
d5c10aa3e7 | |||
be5fee8126 | |||
d9cd780386 | |||
55b4a92453 | |||
0299d315d5 | |||
779a2a0199 | |||
01c785271f | |||
05ddc5caaf | |||
fa25340e5c | |||
e65e7ac42f | |||
7d605c2c87 | |||
043d582616 | |||
7c4f9ee044 | |||
a2007b78e7 | |||
7004f43a9a | |||
2b3b5af303 | |||
7a67d7e88a | |||
60e3fb8aab | |||
2f2fe4dd47 | |||
7955426682 | |||
63259ec5c8 | |||
e8fe203940 | |||
10b315c2bd | |||
f35de3bc2b | |||
4caf4cced2 | |||
1eb70f63ad | |||
997e5dd96c | |||
7aeb394514 | |||
f9f50f1d84 | |||
a62e068a9a | |||
85bc37f04d | |||
a3f5315015 | |||
d63a182996 | |||
f147c7bfcb | |||
4218fe5f2f | |||
511f5a7ca5 | |||
a5ab5c1fa0 | |||
8b7023d9a3 | |||
c8c7bca6e0 | |||
8ddc407e62 | |||
7a2827f693 | |||
f4be0b8efa | |||
a6e23b0509 | |||
64de9f3ad0 | |||
390a842b97 | |||
040cc9c14f | |||
0a1c4992e2 | |||
59b56c764f | |||
ff7afd0de7 | |||
835e62425f | |||
c8cdbfc488 | |||
2f75143245 | |||
6f7c31b747 | |||
75c2d987c4 | |||
726f5eba29 | |||
4404ee717a | |||
54530ab103 | |||
6126780660 | |||
9b7f9b1be1 | |||
26c829d766 | |||
3fde5c5b55 | |||
3e5f546ebe | |||
9833a7d330 | |||
8f9155e578 | |||
9df1eac3c1 | |||
5ededf9be4 | |||
3e8774798a | |||
9048e7f6c4 | |||
1ce56764fa | |||
8c091eece2 | |||
d69e238e67 | |||
95fe1720c0 | |||
69f558c072 | |||
e382df21b9 | |||
8e773c97dd | |||
c043e74c07 | |||
d4518b2ca3 | |||
fd3108a61b | |||
e8fedfa55f | |||
0eb204bfd3 | |||
d9b2a90651 | |||
8ca1d9c50c | |||
baff0518bb | |||
2e669c585b | |||
ca0bc3e0f3 | |||
08ea179519 | |||
557cab9c50 | |||
8e6dfe9b0f | |||
6901368fd6 | |||
3f1dbb7d67 | |||
a12dd153ef | |||
f6126abe31 | |||
8bf9f974a3 | |||
e63fa1d7c2 | |||
1e8dacf9b8 | |||
58fb5321f0 | |||
9e8c8f4bbc | |||
faf885d2e0 | |||
c120c70678 | |||
d5dcc8e138 | |||
90a9cea670 | |||
2eea1882d2 | |||
c6eefac0eb | |||
46e0c0abed | |||
a5f0f6eb34 | |||
62c86f56b1 | |||
77080a524a | |||
3dce1e46f9 | |||
08ecc1e52d | |||
8c1974b34e | |||
d89d349247 | |||
910961cf41 | |||
595b7aa5e8 | |||
f72ad4326f | |||
2306e44ae3 | |||
10fa57ebb9 | |||
0ca9115cb8 | |||
06dbf82e93 | |||
8565ac6cf2 | |||
a26f22a052 | |||
30f9d53520 | |||
7b81532f54 | |||
dcf0b58a6d | |||
e39ea64560 | |||
77dacdf40d | |||
5397a9a78b | |||
3fbafb3c1d | |||
e3721e89e0 | |||
ec75728941 | |||
9b6a10d7ce | |||
57904446f0 | |||
3d48501d30 | |||
d364e5e2ec | |||
aacd7c4bec | |||
abfc0dc266 | |||
85a6d82d9f | |||
56be47669f | |||
b96b1849cd | |||
902919f2df | |||
1efdc90719 | |||
e852158b83 | |||
f48eff49e9 | |||
f7ecabdb51 | |||
cbf61ed05e | |||
8be579ea53 | |||
7fcac35549 | |||
6563965787 | |||
73d582744e | |||
fa8fdced5f | |||
5142603103 | |||
2fa3ebd8e6 | |||
a534271aff | |||
d2eed6177c | |||
ddf43dbd24 | |||
bfe8cb7020 | |||
40f6eb8ede | |||
5c71dd7246 | |||
146d605d19 | |||
918f3f3fde | |||
a36a294515 | |||
f19bc8880a | |||
0cb7d62ad5 | |||
5ee95cf811 | |||
980d76a15a | |||
4385df18b7 | |||
121450b8cc | |||
e7ecb38b29 | |||
59e12bbed8 | |||
bd76a66770 | |||
f592b98beb | |||
a6d696a0f8 | |||
4c4e2ccb6b | |||
b6b9a5d598 | |||
eb221e083d | |||
8d9382c25b | |||
5017818fb4 | |||
2020407438 | |||
876207c8cd | |||
ec21624aeb | |||
1de5b85ce2 | |||
b4e4033736 | |||
820bc01505 | |||
4e54d1c318 | |||
dec4183e0f | |||
feed09f2f4 | |||
c6aa8d6072 | |||
4ec38a071c | |||
0c4b721e13 | |||
fae884e658 | |||
f20f084991 | |||
20ce79872f | |||
328375924f | |||
a1d91e590e | |||
679db120b0 | |||
7a6797b23e | |||
93f8e8ecb3 | |||
d112956f79 | |||
9649982932 | |||
eca2836703 | |||
d14c9600bb | |||
42971c94b7 | |||
b0fd4f4c44 | |||
06473cfcb2 | |||
6f2aad3836 | |||
38aad40fef | |||
51c5520472 | |||
75838f77b3 | |||
54bedeaa0a | |||
b33b2edbd0 | |||
f7cb2b5dcd | |||
9ea3cbc8f1 | |||
53bb677f8c | |||
663999a539 | |||
98b45b32fd | |||
74c08cd742 | |||
696073b505 | |||
e4645a8273 | |||
c0cd25460d | |||
e7e30693f0 | |||
dd96aac3cd | |||
5697393a70 | |||
052dd8058f | |||
4d99ce8c52 | |||
633c646239 | |||
2a88bc6a1e | |||
d8af2e594a | |||
8da7c3e805 | |||
ddfbea76be | |||
c5f2275703 | |||
8c491f18fd | |||
e07e2f2da0 | |||
d981e1b8e5 | |||
58e6338f9c | |||
27f3af5365 | |||
350b4f0368 | |||
445f3c66fd | |||
1189b991e5 | |||
3e2b471ee1 | |||
8c76d5d52c | |||
e7eee67fed | |||
fade48dcfa | |||
8e58e7f8bf | |||
c8f56ee23c | |||
32d951e28a | |||
5c63c8fc8f | |||
7b70274d4f | |||
1cd905c08b | |||
13e809acd4 | |||
46533b0411 | |||
4f4de15d3a | |||
4f99aeabd2 | |||
f36a12e454 | |||
5e246c0754 | |||
518c6783cc | |||
0706564694 | |||
2108bbda66 | |||
82feed1ab8 | |||
4be0b5d436 | |||
f7eb256eb6 | |||
250fc26308 | |||
06a50520c1 | |||
fc766055d4 | |||
828b1479c7 | |||
22ed52605c | |||
a1a95ebb20 | |||
d7ce5fedfd | |||
3a2682ffe7 | |||
bf74a4135e | |||
252ecf2769 | |||
de01ab75e9 | |||
5698da5f95 | |||
7300d73675 | |||
d4b467a641 | |||
7b71076180 | |||
9197d2b209 | |||
e094e41d89 | |||
512e1a3136 | |||
6d04c14bd6 | |||
64183d8d6a | |||
287efde54a | |||
faa25b9e9f | |||
1b92b01a46 | |||
4849063b6c | |||
5cd020ae81 | |||
160fabe02c | |||
90dd8e70e5 | |||
08e121c71f | |||
cb3b337a99 | |||
5d9a952316 | |||
8cc05c5848 | |||
d69d69e892 | |||
07a120fc4a | |||
11e8796847 | |||
f79b009978 | |||
3259bfb008 | |||
934bc5b9db | |||
6d11faed87 | |||
35fc52dae7 | |||
e599bfe56f | |||
764becc271 | |||
7462d1002d | |||
834794ad98 | |||
56c504abbb | |||
4d6346e678 | |||
dc7e448759 | |||
e658cbacda | |||
1e6c6dea71 | |||
0e5d4d1d8e | |||
a2986784d3 | |||
975cbb576e | |||
e48a92d9cd | |||
befdcf7f36 | |||
02f5c472a8 | |||
75ed2cd2e4 | |||
3be045f9b6 | |||
8fae982802 | |||
128ec88b5f | |||
d5fc158330 | |||
864e6e4c81 | |||
343d96ff16 | |||
4142328437 | |||
6c797988c7 | |||
215c262981 | |||
081b809078 | |||
9263567cd8 | |||
58e90a85be | |||
025c836e25 | |||
5d5abae3f4 | |||
e2ad46386e | |||
308d44e452 | |||
69da61b1fb | |||
460168ce04 | |||
4e429c0d77 | |||
bf4fab549d | |||
f7705eb1da | |||
a2217e2066 | |||
aaa02706fc | |||
6a80bc5b54 | |||
b9275646ad | |||
9e2f2697c7 | |||
b6b0df62b6 | |||
0ba537e479 | |||
75ddf535dc | |||
b1de501bef | |||
0f3a63f101 | |||
3b4b2d707f | |||
f405aa1733 | |||
df0fdb7ecb | |||
91b7a87557 | |||
9468b9ca1e | |||
d7982e178e | |||
9cf5714a5b | |||
0c9ac8911a | |||
4730c8c0a9 | |||
43efb8acfd | |||
6ecca8fcb0 | |||
17cb63a57f | |||
4f83fcb001 | |||
ab94af6d29 | |||
7c725cc69b | |||
f0198d2d2e | |||
5ddccbdee4 | |||
8fb39b8c7e | |||
bd5293f4b1 | |||
b91180f5b2 | |||
7c3b5065a5 | |||
9aef802bea | |||
f7d85231f2 | |||
5b3a911e8d | |||
65f5e1c1ab | |||
839896c7e6 | |||
4a7e246604 | |||
7f293115c4 | |||
f59f40a659 | |||
64fd82f92c | |||
cd232fd732 | |||
172fa66b1f |
@ -31,7 +31,7 @@ script:
|
||||
|
||||
deploy:
|
||||
provider: script
|
||||
script: find $HOME/miniconda/envs/testenv/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -t $CONDA_TOKEN upload --force {} \;
|
||||
script: find $HOME/miniconda/envs/testenv/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -v --show-traceback -t $CONDA_TOKEN upload --force {} \;
|
||||
on:
|
||||
branch: developer
|
||||
tags: true
|
||||
|
@ -1,6 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
project(slsDetectorPackage)
|
||||
set(PROJECT_VERSION 5.0.0)
|
||||
set(PROJECT_VERSION 5.1.0)
|
||||
include(CheckIPOSupported)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
||||
|
||||
@ -49,7 +49,7 @@ option(SLS_DEVEL_HEADERS "install headers for devel" OFF)
|
||||
option(SLS_USE_MOENCH "compile zmq and post processing for Moench" OFF)
|
||||
|
||||
# set(ClangFormat_BIN_NAME clang-format)
|
||||
set(ClangFormat_EXCLUDE_PATTERNS "build/"
|
||||
set(ClangFormat_EXCLUDE_PATTERNS "build/"
|
||||
"libs/"
|
||||
"slsDetectorCalibration/"
|
||||
"ctbGui/"
|
||||
@ -64,18 +64,6 @@ check_ipo_supported(RESULT SLS_LTO_AVAILABLE)
|
||||
message(STATUS "SLS_LTO_AVAILABLE:" ${SLS_LTO_AVAILABLE})
|
||||
|
||||
|
||||
# # Use ld.gold if it is available and isn't disabled explicitly
|
||||
# option(SLS_USE_LD_GOLD "Use GNU gold linker" ON)
|
||||
# if (SLS_USE_LD_GOLD)
|
||||
# execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||
# if ("${LD_VERSION}" MATCHES "GNU gold")
|
||||
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
# set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
# set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
# else ()
|
||||
# message(WARNING "GNU gold linker isn't available, using the default system linker.")
|
||||
# endif ()
|
||||
# endif ()
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
@ -169,8 +157,37 @@ set(CMAKE_INSTALL_RPATH $ORIGIN)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
||||
|
||||
set(ZeroMQ_HINT "" CACHE STRING "Hint where ZeroMQ could be found")
|
||||
#Adapted from: https://github.com/zeromq/cppzmq/
|
||||
if (NOT TARGET libzmq)
|
||||
if(ZeroMQ_HINT)
|
||||
message(STATUS "Looking for ZeroMQ in: ${ZeroMQ_HINT}")
|
||||
find_package(ZeroMQ 4
|
||||
NO_DEFAULT_PATH
|
||||
HINTS ${ZeroMQ_DIR}
|
||||
)
|
||||
else()
|
||||
find_package(ZeroMQ 4 QUIET)
|
||||
endif()
|
||||
|
||||
|
||||
find_package(ZeroMQ 4 REQUIRED)
|
||||
|
||||
# libzmq autotools install: fallback to pkg-config
|
||||
if(NOT ZeroMQ_FOUND)
|
||||
message(STATUS "CMake libzmq package not found, trying again with pkg-config (normal install of zeromq)")
|
||||
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/libzmq-pkg-config)
|
||||
find_package(ZeroMQ 4 REQUIRED)
|
||||
endif()
|
||||
|
||||
# TODO "REQUIRED" above should already cause a fatal failure if not found, but this doesn't seem to work
|
||||
if(NOT ZeroMQ_FOUND)
|
||||
message(FATAL_ERROR "ZeroMQ was not found, neither as a CMake package nor via pkg-config")
|
||||
endif()
|
||||
|
||||
if (ZeroMQ_FOUND AND NOT TARGET libzmq)
|
||||
message(FATAL_ERROR "ZeroMQ version not supported!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (SLS_USE_TESTS)
|
||||
enable_testing()
|
||||
@ -187,20 +204,12 @@ if (SLS_USE_TEXTCLIENT)
|
||||
add_subdirectory(slsDetectorSoftware)
|
||||
endif (SLS_USE_TEXTCLIENT)
|
||||
|
||||
|
||||
if (SLS_USE_RECEIVER)
|
||||
if (SLS_USE_HDF5)
|
||||
find_package(HDF5 1.10 COMPONENTS CXX REQUIRED)
|
||||
endif (SLS_USE_HDF5)
|
||||
add_subdirectory(slsReceiverSoftware)
|
||||
endif (SLS_USE_RECEIVER)
|
||||
|
||||
if (SLS_USE_GUI)
|
||||
find_package(Qt4 REQUIRED)
|
||||
find_package(Qwt 6.1 REQUIRED)
|
||||
if (QT4_FOUND AND QWT_FOUND)
|
||||
add_subdirectory(slsDetectorGui)
|
||||
endif()
|
||||
add_subdirectory(slsDetectorGui)
|
||||
endif (SLS_USE_GUI)
|
||||
|
||||
if (SLS_USE_SIMULATOR)
|
||||
@ -212,7 +221,7 @@ if (SLS_USE_INTEGRATION_TESTS)
|
||||
endif (SLS_USE_INTEGRATION_TESTS)
|
||||
|
||||
if (SLS_USE_PYTHON)
|
||||
set(PYBIND11_CPP_STANDARD -std=c++11)
|
||||
find_package (Python 3.6 COMPONENTS Interpreter Development)
|
||||
add_subdirectory(libs/pybind11)
|
||||
add_subdirectory(python)
|
||||
endif(SLS_USE_PYTHON)
|
||||
|
67
README.md
67
README.md
@ -4,7 +4,7 @@ Please do not update to any xxxx.xx.xx.dev0 tags. They are not releases, but tag
|
||||
Use only releases with tags such as x.x.x or x.x.x-rcx.
|
||||
|
||||
### Documentation
|
||||
Detailed documentation can be found on the [official site.](https://www.psi.ch/detectors/users-support)
|
||||
Detailed documentation on the latest release of 5.0.0 can be found in the [software wiki](https://slsdetectorgroup.github.io/devdoc/index.html) and on the [official site](https://www.psi.ch/en/detectors/software).
|
||||
|
||||
### Binaries
|
||||
Binaries for the slsDetectorPackage are available through conda.
|
||||
@ -12,6 +12,7 @@ Binaries for the slsDetectorPackage are available through conda.
|
||||
#Add conda channels
|
||||
conda config --add channels conda-forge
|
||||
conda config --add channels slsdetectorgroup
|
||||
conda config --set channel_priority strict
|
||||
|
||||
conda install slsdetlib #only shared lib and command line
|
||||
conda install slsdet #python bindings (includes slsdetlib)
|
||||
@ -29,10 +30,8 @@ git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git
|
||||
|
||||
```
|
||||
#### Dependencies
|
||||
* Lib: c++11 compiler (gcc=>4.8), ZeroMQ 4
|
||||
* Gui: Qt 4.8 and Qwt 6.0
|
||||
* Calibration wizards and ctbGUI: ROOT
|
||||
* Optional: HDF5
|
||||
|
||||
Refer [this page](https://slsdetectorgroup.github.io/devdoc/dependencies.html) for dependencies.
|
||||
|
||||
|
||||
#### Compilation
|
||||
@ -42,27 +41,38 @@ cmk.sh or directly with cmake for more control.
|
||||
|
||||
**1. Compile using script cmk.sh**<br>
|
||||
|
||||
After compiling, the libraries and executables will be found in `slsDetectorPackage/build/bin` directory<br>
|
||||
These are mainly aimed at those not familiar with using ccmake and cmake.
|
||||
```
|
||||
The binaries are generated in slsDetectorPackage/build/bin directory.
|
||||
|
||||
Usage: [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [-h] [-d <HDF5 directory>] [-j] <Number of threads>
|
||||
-[no option]: only make
|
||||
-c: Clean
|
||||
-b: Builds/Rebuilds CMake files normal mode
|
||||
-p: Builds/Rebuilds Python API
|
||||
-h: Builds/Rebuilds Cmake files with HDF5 package
|
||||
-d: HDF5 Custom Directory
|
||||
-t: Build/Rebuilds only text client
|
||||
-r: Build/Rebuilds only receiver
|
||||
-g: Build/Rebuilds only gui
|
||||
-s: Simulator
|
||||
-u: Chip Test Gui
|
||||
-j: Number of threads to compile through
|
||||
-e: Debug mode
|
||||
-i: Builds tests
|
||||
|
||||
eg. Rebuild when you switch to a new build and compile in parallel:
|
||||
./cmk.sh -bj5
|
||||
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [n] [-h] [z] [-d <HDF5 directory>] [-l Install directory] [-k <CMake command>] [-j <Number of threads>]
|
||||
-[no option]: only make
|
||||
-c: Clean
|
||||
-b: Builds/Rebuilds CMake files normal mode
|
||||
-p: Builds/Rebuilds Python API
|
||||
-h: Builds/Rebuilds Cmake files with HDF5 package
|
||||
-d: HDF5 Custom Directory
|
||||
-k: CMake command
|
||||
-l: Install directory
|
||||
-t: Build/Rebuilds only text client
|
||||
-r: Build/Rebuilds only receiver
|
||||
-g: Build/Rebuilds only gui
|
||||
-s: Simulator
|
||||
-u: Chip Test Gui
|
||||
-j: Number of threads to compile through
|
||||
-e: Debug mode
|
||||
-i: Builds tests
|
||||
-m: Manuals
|
||||
-n: Manuals without compiling doxygen (only rst)
|
||||
-z: Moench zmq processor
|
||||
|
||||
# get all options
|
||||
./cmk.sh -?
|
||||
|
||||
# new build and compile in parallel:
|
||||
./cmk.sh -bj5
|
||||
```
|
||||
|
||||
**2. Compile without script**<br>
|
||||
Use cmake to create out-of-source builds, by creating a build folder parallel to source directory. This would create a debug build with address sanitizers.
|
||||
```
|
||||
@ -71,3 +81,12 @@ Use cmake to create out-of-source builds, by creating a build folder parallel to
|
||||
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON
|
||||
$ make -j12 #or whatever number of threads wanted
|
||||
```
|
||||
|
||||
To install binaries using CMake
|
||||
```
|
||||
git clone --recursive https://github.com/slsdetectorgroup/slsDetectorPackage.git
|
||||
mkdir build && cd build
|
||||
cmake ../slsDetectorPackage -DCMAKE_INSTALL_PREFIX=/your/install/path
|
||||
make -j12 #or whatever number of cores you are using to build
|
||||
make install
|
||||
```
|
||||
|
95
RELEASE.txt
95
RELEASE.txt
@ -1,67 +1,39 @@
|
||||
SLS Detector Package 5.0.0-rc2 released on 09.10.2020 (Release Candidate 2)
|
||||
===========================================================================
|
||||
SLS Detector Package 5.X.X released on XX.XX.2021 (Minor Release)
|
||||
===================================================================
|
||||
|
||||
This document describes the differences between X and Y releases.
|
||||
|
||||
|
||||
|
||||
CONTENTS
|
||||
--------
|
||||
1. Firmware Requirements
|
||||
2. Download, Documentation & Support
|
||||
1. New Features
|
||||
2. Resolved Issues
|
||||
3. Known Issues
|
||||
4. Firmware Requirements
|
||||
5. Download, Documentation & Support
|
||||
|
||||
|
||||
1. Firmware Requirements
|
||||
|
||||
|
||||
1. New Features
|
||||
===============
|
||||
|
||||
Setting Mythen3 gain from command line
|
||||
|
||||
4. Firmware Requirements
|
||||
========================
|
||||
|
||||
Eiger
|
||||
=====
|
||||
Compatible version : 08.09.2020 (v27)
|
||||
|
||||
Jungfrau
|
||||
========
|
||||
Compatible version : 24.07.2020 (v1.1, PCB v1.0)
|
||||
: 21.07.2020 (v2.1, PCB v2.0)
|
||||
|
||||
Gotthard
|
||||
========
|
||||
Compatible version : 08.02.2018 (50um and 25um Master)
|
||||
: 09.02.2018 (25 um Slave)
|
||||
|
||||
Mythen3
|
||||
=======
|
||||
Compatible version : 25.09.2020 (development)
|
||||
|
||||
Gotthard2
|
||||
=========
|
||||
Compatible version : 25.09.2020 (development)
|
||||
|
||||
Moench
|
||||
======
|
||||
Compatible version : 10.05.2020 (v1.0)
|
||||
|
||||
Ctb
|
||||
===
|
||||
Compatible version : 10.05.2019 (v1.0)
|
||||
|
||||
|
||||
Detector Upgrade
|
||||
================
|
||||
|
||||
The following can be upgraded remotely:
|
||||
Eiger via bit files
|
||||
Jungfrau via command <.pof>
|
||||
Mythen3 via command <.rbf>
|
||||
Gotthard2 via command <.rbf>
|
||||
Moench via command <.pof>
|
||||
Ctb via command <.pof>
|
||||
|
||||
The following cannot be upgraded remotely:
|
||||
Gotthard
|
||||
|
||||
Instructions available at
|
||||
https://slsdetectorgroup.github.io/devdoc/firmware.html
|
||||
and
|
||||
https://slsdetectorgroup.github.io/devdoc/serverupgrade.html
|
||||
|
||||
|
||||
2. Download, Documentation & Support
|
||||
|
||||
|
||||
5. Known Issues
|
||||
===============
|
||||
|
||||
No updates from 5.0.0
|
||||
|
||||
|
||||
|
||||
6. Download, Documentation & Support
|
||||
====================================
|
||||
|
||||
Download
|
||||
@ -88,6 +60,9 @@ SLS Detector Package 5.0.0-rc2 released on 09.10.2020 (Release Candidate 2)
|
||||
Consuming slsDetectorPackage:
|
||||
https://slsdetectorgroup.github.io/devdoc/consuming.html
|
||||
|
||||
API Examples:
|
||||
https://github.com/slsdetectorgroup/api-examples
|
||||
|
||||
Command Line Documentation:
|
||||
https://slsdetectorgroup.github.io/devdoc/commandline.html
|
||||
|
||||
@ -106,6 +81,10 @@ SLS Detector Package 5.0.0-rc2 released on 09.10.2020 (Release Candidate 2)
|
||||
Python API Example:
|
||||
https://slsdetectorgroup.github.io/devdoc/pyexamples.html
|
||||
|
||||
Receivers (including custom receiver):
|
||||
https://slsdetectorgroup.github.io/devdoc/receivers.html
|
||||
https://slsdetectorgroup.github.io/devdoc/slsreceiver.html
|
||||
|
||||
TroubleShooting:
|
||||
https://slsdetectorgroup.github.io/devdoc/troubleshooting.html
|
||||
|
||||
@ -121,4 +100,4 @@ SLS Detector Package 5.0.0-rc2 released on 09.10.2020 (Release Candidate 2)
|
||||
|
||||
dhanya.thattil@psi.ch
|
||||
erik.frojdh@psi.ch
|
||||
anna.bergamaschi@psi.ch
|
||||
|
||||
|
@ -1,112 +0,0 @@
|
||||
|
||||
# This file is originally from https://github.com/zeromq/azmq and distributed
|
||||
# under Boost Software Lincese 1.0
|
||||
# Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person or organization
|
||||
# obtaining a copy of the software and accompanying documentation covered by
|
||||
# this license (the "Software") to use, reproduce, display, distribute,
|
||||
# execute, and transmit the Software, and to prepare derivative works of the
|
||||
# Software, and to permit third-parties to whom the Software is furnished to
|
||||
# do so, all subject to the following:
|
||||
|
||||
# The copyright notices in the Software and this entire statement, including
|
||||
# the above license grant, this restriction and the following disclaimer,
|
||||
# must be included in all copies of the Software, in whole or in part, and
|
||||
# all derivative works of the Software, unless such copies or derivative
|
||||
# works are solely in the form of machine-executable object code generated by
|
||||
# a source language processor.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
# SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
# FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
# --------------------------------------------------------------------------------
|
||||
|
||||
# Find ZeroMQ Headers/Libs
|
||||
|
||||
# Variables
|
||||
# ZMQ_ROOT - set this to a location where ZeroMQ may be found
|
||||
#
|
||||
# ZeroMQ_FOUND - True of ZeroMQ found
|
||||
# ZeroMQ_INCLUDE_DIRS - Location of ZeroMQ includes
|
||||
# ZeroMQ_LIBRARIES - ZeroMQ libraries
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if (NOT ZMQ_ROOT)
|
||||
set(ZMQ_ROOT "$ENV{ZMQ_ROOT}")
|
||||
endif()
|
||||
|
||||
if (NOT ZMQ_ROOT)
|
||||
find_path(_ZeroMQ_ROOT NAMES include/zmq.h)
|
||||
else()
|
||||
set(_ZeroMQ_ROOT "${ZMQ_ROOT}")
|
||||
endif()
|
||||
|
||||
find_path(ZeroMQ_INCLUDE_DIRS NAMES zmq.h HINTS ${_ZeroMQ_ROOT}/include)
|
||||
|
||||
if (ZeroMQ_INCLUDE_DIRS)
|
||||
set(_ZeroMQ_H ${ZeroMQ_INCLUDE_DIRS}/zmq.h)
|
||||
|
||||
function(_zmqver_EXTRACT _ZeroMQ_VER_COMPONENT _ZeroMQ_VER_OUTPUT)
|
||||
set(CMAKE_MATCH_1 "0")
|
||||
set(_ZeroMQ_expr "^[ \\t]*#define[ \\t]+${_ZeroMQ_VER_COMPONENT}[ \\t]+([0-9]+)$")
|
||||
file(STRINGS "${_ZeroMQ_H}" _ZeroMQ_ver REGEX "${_ZeroMQ_expr}")
|
||||
string(REGEX MATCH "${_ZeroMQ_expr}" ZeroMQ_ver "${_ZeroMQ_ver}")
|
||||
set(${_ZeroMQ_VER_OUTPUT} "${CMAKE_MATCH_1}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
_zmqver_EXTRACT("ZMQ_VERSION_MAJOR" ZeroMQ_VERSION_MAJOR)
|
||||
_zmqver_EXTRACT("ZMQ_VERSION_MINOR" ZeroMQ_VERSION_MINOR)
|
||||
_zmqver_EXTRACT("ZMQ_VERSION_PATCH" ZeroMQ_VERSION_PATCH)
|
||||
|
||||
message(STATUS "ZeroMQ version: ${ZeroMQ_VERSION_MAJOR}.${ZeroMQ_VERSION_MINOR}.${ZeroMQ_VERSION_PATCH}")
|
||||
|
||||
# We should provide version to find_package_handle_standard_args in the same format as it was requested,
|
||||
# otherwise it can't check whether version matches exactly.
|
||||
if (ZeroMQ_FIND_VERSION_COUNT GREATER 2)
|
||||
set(ZeroMQ_VERSION "${ZeroMQ_VERSION_MAJOR}.${ZeroMQ_VERSION_MINOR}.${ZeroMQ_VERSION_PATCH}")
|
||||
else()
|
||||
# User has requested ZeroMQ version without patch part => user is not interested in specific patch =>
|
||||
# any patch should be an exact match.
|
||||
set(ZeroMQ_VERSION "${ZeroMQ_VERSION_MAJOR}.${ZeroMQ_VERSION_MINOR}")
|
||||
endif()
|
||||
|
||||
if (NOT ${CMAKE_CXX_PLATFORM_ID} STREQUAL "Windows")
|
||||
find_library(ZeroMQ_LIBRARIES NAMES zmq HINTS ${_ZeroMQ_ROOT}/lib)
|
||||
else()
|
||||
find_library(
|
||||
ZeroMQ_LIBRARY_RELEASE
|
||||
NAMES
|
||||
libzmq
|
||||
"libzmq-${CMAKE_VS_PLATFORM_TOOLSET}-mt-${ZeroMQ_VERSION_MAJOR}_${ZeroMQ_VERSION_MINOR}_${ZeroMQ_VERSION_PATCH}"
|
||||
HINTS
|
||||
${_ZeroMQ_ROOT}/lib
|
||||
)
|
||||
|
||||
find_library(
|
||||
ZeroMQ_LIBRARY_DEBUG
|
||||
NAMES
|
||||
libzmq_d
|
||||
"libzmq-${CMAKE_VS_PLATFORM_TOOLSET}-mt-gd-${ZeroMQ_VERSION_MAJOR}_${ZeroMQ_VERSION_MINOR}_${ZeroMQ_VERSION_PATCH}"
|
||||
HINTS
|
||||
${_ZeroMQ_ROOT}/lib)
|
||||
|
||||
# On Windows we have to use corresponding version (i.e. Release or Debug) of ZeroMQ because of `errno` CRT global variable
|
||||
# See more at http://www.drdobbs.com/avoiding-the-visual-c-runtime-library/184416623
|
||||
set(ZeroMQ_LIBRARIES optimized "${ZeroMQ_LIBRARY_RELEASE}" debug "${ZeroMQ_LIBRARY_DEBUG}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(ZeroMQ FOUND_VAR ZeroMQ_FOUND
|
||||
REQUIRED_VARS ZeroMQ_INCLUDE_DIRS ZeroMQ_LIBRARIES
|
||||
VERSION_VAR ZeroMQ_VERSION)
|
||||
|
||||
if (ZeroMQ_FOUND)
|
||||
mark_as_advanced(ZeroMQ_INCLUDE_DIRS ZeroMQ_LIBRARIES ZeroMQ_VERSION
|
||||
ZeroMQ_VERSION_MAJOR ZeroMQ_VERSION_MINOR ZeroMQ_VERSION_PATCH)
|
||||
endif()
|
@ -25,6 +25,12 @@ install(FILES
|
||||
DESTINATION ${CMAKE_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install(FILES
|
||||
"${CMAKE_SOURCE_DIR}/libzmq-pkg-config/FindZeroMQ.cmake"
|
||||
COMPONENT devel
|
||||
DESTINATION ${CMAKE_INSTALL_DIR}/libzmq-pkg-config
|
||||
)
|
||||
|
||||
if (PROJECT_LIBRARIES OR PROJECT_STATIC_LIBRARIES)
|
||||
install(
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
|
@ -12,8 +12,21 @@ include(CMakeFindDependencyMacro)
|
||||
|
||||
set(SLS_USE_HDF5 "@SLS_USE_HDF5@")
|
||||
|
||||
# Add optional dependencies here
|
||||
|
||||
find_package(ZeroMQ 4 QUIET)
|
||||
# libzmq autotools install: fallback to pkg-config
|
||||
if(NOT ZeroMQ_FOUND)
|
||||
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/libzmq-pkg-config)
|
||||
find_package(ZeroMQ 4 REQUIRED)
|
||||
endif()
|
||||
|
||||
if(NOT ZeroMQ_FOUND)
|
||||
message(FATAL_ERROR "ZeroMQ was NOT found!")
|
||||
endif()
|
||||
|
||||
find_dependency(Threads)
|
||||
|
||||
# Add optional dependencies here
|
||||
if (SLS_USE_HDF5)
|
||||
find_dependency(HDF5)
|
||||
endif ()
|
||||
|
33
cmk.sh
33
cmk.sh
@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
CMAKE="cmake3"
|
||||
BUILDDIR="build"
|
||||
INSTALLDIR=""
|
||||
HDF5DIR="/opt/hdf5v1.10.0"
|
||||
HDF5=0
|
||||
COMPILERTHREADS=0
|
||||
@ -22,13 +24,15 @@ CMAKE_PRE=""
|
||||
CMAKE_POST=""
|
||||
|
||||
usage() { echo -e "
|
||||
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [n] [-h] [z] [-d <HDF5 directory>] [-j] <Number of threads>
|
||||
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [n] [-h] [z] [-d <HDF5 directory>] [-l Install directory] [-k <CMake command>] [-j <Number of threads>]
|
||||
-[no option]: only make
|
||||
-c: Clean
|
||||
-b: Builds/Rebuilds CMake files normal mode
|
||||
-p: Builds/Rebuilds Python API
|
||||
-h: Builds/Rebuilds Cmake files with HDF5 package
|
||||
-d: HDF5 Custom Directory
|
||||
-k: CMake command
|
||||
-l: Install directory
|
||||
-t: Build/Rebuilds only text client
|
||||
-r: Build/Rebuilds only receiver
|
||||
-g: Build/Rebuilds only gui
|
||||
@ -75,7 +79,7 @@ For rebuilding only certain sections
|
||||
|
||||
" ; exit 1; }
|
||||
|
||||
while getopts ":bpchd:j:trgeisumnz" opt ; do
|
||||
while getopts ":bpchd:k:l:j:trgeisumnz" opt ; do
|
||||
case $opt in
|
||||
b)
|
||||
echo "Building of CMake files Required"
|
||||
@ -99,6 +103,14 @@ while getopts ":bpchd:j:trgeisumnz" opt ; do
|
||||
echo "New HDF5 directory: $OPTARG"
|
||||
HDF5DIR=$OPTARG
|
||||
;;
|
||||
l)
|
||||
echo "CMake install directory: $OPTARG"
|
||||
INSTALLDIR="$OPTARG"
|
||||
;;
|
||||
k)
|
||||
echo "CMake command: $OPTARG"
|
||||
CMAKE="$OPTARG"
|
||||
;;
|
||||
j)
|
||||
echo "Number of compiler threads: $OPTARG"
|
||||
COMPILERTHREADS=$OPTARG
|
||||
@ -252,7 +264,15 @@ else
|
||||
fi
|
||||
|
||||
|
||||
#install
|
||||
if [ -n "$INSTALLDIR" ]; then
|
||||
CMAKE_POST+=" -DCMAKE_INSTALL_PREFIX=$INSTALLDIR"
|
||||
CMAKE_POST+=" -DCMAKE_FIND_ROOT_PATH=$INSTALLDIR"
|
||||
fi
|
||||
|
||||
|
||||
#enter build dir
|
||||
#pushd $BUILDDIR;
|
||||
cd $BUILDDIR;
|
||||
echo "in "$PWD
|
||||
|
||||
@ -261,7 +281,7 @@ echo "in "$PWD
|
||||
#cmake
|
||||
if [ $REBUILD -eq 1 ]; then
|
||||
rm -f CMakeCache.txt
|
||||
BUILDCOMMAND="$CMAKE_PRE cmake3 $CMAKE_POST .."
|
||||
BUILDCOMMAND="$CMAKE_PRE $CMAKE $CMAKE_POST .."
|
||||
echo $BUILDCOMMAND
|
||||
eval $BUILDCOMMAND
|
||||
fi
|
||||
@ -305,6 +325,13 @@ else
|
||||
fi
|
||||
|
||||
|
||||
#install
|
||||
if [ -n "$INSTALLDIR" ]; then
|
||||
make install
|
||||
# popd
|
||||
# $CMAKE --build $BUILDDIR --target install
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -13,8 +13,9 @@ cmake .. \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DSLS_USE_HDF5=OFF\
|
||||
|
||||
|
||||
cmake --build . -- -j10
|
||||
NCORES=$(getconf _NPROCESSORS_ONLN)
|
||||
echo "Building using: ${NCORES} cores"
|
||||
cmake --build . -- -j${NCORES}
|
||||
cmake --build . --target install
|
||||
|
||||
CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
|
||||
CTEST_OUTPUT_ON_FAILURE=1 ctest -j 2
|
||||
|
@ -1,3 +1,3 @@
|
||||
#Copy the GUI
|
||||
mkdir $PREFIX/bin
|
||||
cp build/bin/slsDetectorGui $PREFIX/bin/.
|
||||
mkdir -p $PREFIX/bin
|
||||
cp build/install/bin/slsDetectorGui $PREFIX/bin/.
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
mkdir $PREFIX/lib
|
||||
mkdir $PREFIX/bin
|
||||
mkdir -p $PREFIX/lib
|
||||
mkdir -p $PREFIX/bin
|
||||
mkdir -p $PREFIX/include/sls
|
||||
# mkdir $PREFIX/include/slsDetectorPackage
|
||||
|
||||
|
@ -59,6 +59,16 @@ outputs:
|
||||
script: copy_lib.sh
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
- zeromq
|
||||
|
||||
host:
|
||||
- zeromq
|
||||
|
||||
run:
|
||||
- libstdcxx-ng
|
||||
- libgcc-ng
|
||||
@ -78,6 +88,8 @@ outputs:
|
||||
|
||||
host:
|
||||
- python
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
|
||||
|
||||
run:
|
||||
- libstdcxx-ng
|
||||
@ -94,6 +106,13 @@ outputs:
|
||||
- name: slsdetgui
|
||||
script: copy_gui.sh
|
||||
requirements:
|
||||
|
||||
build:
|
||||
- {{ compiler('c') }}
|
||||
- {{compiler('cxx')}}
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
- qwt 6.*
|
||||
|
||||
run:
|
||||
- {{ pin_subpackage('slsdetlib', exact=True) }}
|
||||
- qwt 6.*
|
||||
|
@ -36,7 +36,7 @@ Depreciated commands
|
||||
------------------------
|
||||
|
||||
.. note ::
|
||||
All dac commands are preceded with the **dac** command. Use command **daclist** to get correct list of dac command arguments for current detector.
|
||||
All the dac commands are preceded with the **dac** command. Use command **daclist** to get correct list of dac command arguments for current detector.
|
||||
|
||||
.. csv-table:: Depreciated commands
|
||||
:file: ../depreciated.csv
|
||||
|
@ -9,7 +9,7 @@ CMake approaches.
|
||||
One can test with :ref:`detector simulators<Virtual Detector Servers>` before testing the API with a real detector or when a real detector is not at hand.
|
||||
|
||||
CMake: slsDetectorPackage as submodule in your project
|
||||
---------------------------------------
|
||||
---------------------------------------------------------------
|
||||
|
||||
If you are using CMake to build your integration and want to build everything
|
||||
in one go, we support adding slsDetectorPackage as a subfolder in your cmake project.
|
||||
|
@ -12,32 +12,7 @@ Download
|
||||
|
||||
- detector server corresponding to package in slsDetectorPackage/serverBin
|
||||
|
||||
- bit files
|
||||
.. list-table::
|
||||
:widths: 25 10 30 25 10
|
||||
:header-rows: 1
|
||||
|
||||
* - Software
|
||||
- Hardware
|
||||
- Firmware Date
|
||||
- Firmware Link
|
||||
- Comments
|
||||
* - v5.0.0-rcx
|
||||
-
|
||||
- 08.09.2020
|
||||
- `v27 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/eiger/v27/>`__
|
||||
-
|
||||
* - v4.0.0 - v4.2.0
|
||||
-
|
||||
- 30.07.2019
|
||||
- `v24 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/eiger/v24/>`__
|
||||
-
|
||||
* - v3.1.0 - v3.1.5
|
||||
-
|
||||
- 17.08.2017
|
||||
- `v20 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/eiger/v20/>`__
|
||||
-
|
||||
|
||||
- `bit files <https://github.com/slsdetectorgroup/slsDetectorFirmware>`__
|
||||
|
||||
Upgrade
|
||||
^^^^^^^^
|
||||
@ -116,37 +91,7 @@ Download
|
||||
^^^^^^^^^^^^^
|
||||
- detector server corresponding to package in slsDetectorPackage/serverBin
|
||||
|
||||
- pof files
|
||||
.. list-table::
|
||||
:widths: 25 10 30 25 10
|
||||
:header-rows: 1
|
||||
|
||||
* - Software
|
||||
- Hardware
|
||||
- Firmware Date
|
||||
- Firmware Link
|
||||
- Comments
|
||||
* - v5.0.0-rcx
|
||||
- 2.0
|
||||
- 21.07.2020
|
||||
- `v2.1 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/jungfrau/v2_1/jungfrau_v2_1.pof>`__
|
||||
-
|
||||
* - v5.0.0-rcx
|
||||
- 1.0
|
||||
- 24.07.2020
|
||||
- `v1.1 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/jungfrau/v1_1/jungfrau_v1_1.pof>`__
|
||||
-
|
||||
* - v4.0.1 - v4.2.0
|
||||
- 1.0
|
||||
- 06.12.2018
|
||||
- `v0.7 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/jungfrau/v0_7/jungfrau_v0_7.pof>`__
|
||||
-
|
||||
* - v3.1.0 - v3.1.5
|
||||
- 1.0
|
||||
- 13.11.2017
|
||||
- `v0.6 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/jungfrau/v0_6/jungfrau_v0_6.pof>`__
|
||||
-
|
||||
|
||||
- `pof files <https://github.com/slsdetectorgroup/slsDetectorFirmware>`__
|
||||
|
||||
|
||||
Upgrade (from v4.x.x)
|
||||
@ -156,7 +101,7 @@ Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you
|
||||
|
||||
#. Tftp must be installed on pc.
|
||||
|
||||
#. Update client package to the latest (5.0.0-rc1).
|
||||
#. Update client package to the latest (5.x.x).
|
||||
|
||||
#. Disable server respawning or kill old server
|
||||
.. code-block:: bash
|
||||
@ -204,7 +149,7 @@ Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you
|
||||
jungfrauDetectorServervxxx --stop-server 1953
|
||||
|
||||
|
||||
Upgrade (from v5.0.0-rcx)
|
||||
Upgrade (from v5.0.0)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
|
||||
@ -230,31 +175,8 @@ Download
|
||||
^^^^^^^^^^^^^
|
||||
- detector server corresponding to package in slsDetectorPackage/serverBin
|
||||
|
||||
- pof files
|
||||
.. list-table::
|
||||
:widths: 15 15 15 15 5
|
||||
:header-rows: 1
|
||||
- `pof files <https://github.com/slsdetectorgroup/slsDetectorFirmware>`__
|
||||
|
||||
* - Software
|
||||
- Hardware
|
||||
- Firmware Date
|
||||
- Firmware Link
|
||||
- Comments
|
||||
* - All versions
|
||||
- 50um
|
||||
- 08.02.2018
|
||||
- `50um <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/gotthard_I/50um/gotthard_I_50um.pof>`__
|
||||
-
|
||||
* - All versions
|
||||
- 25um (master)
|
||||
- 08.02.2018
|
||||
- `25um (master) <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/gotthard_I/25um/master/gotthard_I_25um_master.pof>`__
|
||||
-
|
||||
* - All versions
|
||||
- 25um (slave)
|
||||
- 09.02.2018
|
||||
- `25um (slave) <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/gotthard_I/25um/slave/gotthard_I_25um_slave.pof>`__
|
||||
-
|
||||
|
||||
.. _firmware upgrade using blaster for blackfin:
|
||||
|
||||
@ -294,24 +216,10 @@ Download
|
||||
|
||||
- detector server corresponding to package in slsDetectorPackage/serverBin
|
||||
|
||||
- rbf files
|
||||
.. list-table::
|
||||
:widths: 25 10 30 25 10
|
||||
:header-rows: 1
|
||||
|
||||
* - Software
|
||||
- Hardware
|
||||
- Firmware Date
|
||||
- Firmware Link
|
||||
- Comments
|
||||
* - v5.0.0-rcx
|
||||
-
|
||||
- 25.09.2020
|
||||
-
|
||||
- development
|
||||
- rbf files (in developement)
|
||||
|
||||
|
||||
Upgrade (from v5.0.0-rcx)
|
||||
Upgrade (from v5.0.0)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
#. Program from console
|
||||
@ -337,23 +245,10 @@ Download
|
||||
^^^^^^^^^^^^^
|
||||
- detector server corresponding to package in slsDetectorPackage/serverBin
|
||||
|
||||
- rbf files
|
||||
.. list-table::
|
||||
:widths: 25 10 30 25 10
|
||||
:header-rows: 1
|
||||
- rbf files (in development)
|
||||
|
||||
* - Software
|
||||
- Hardware
|
||||
- Firmware Date
|
||||
- Firmware Link
|
||||
- Comments
|
||||
* - v5.0.0-rcx
|
||||
-
|
||||
- 25.09.2020
|
||||
-
|
||||
- development
|
||||
|
||||
Upgrade (from v5.0.0-rcx)
|
||||
Upgrade (from v5.0.0)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
#. Program from console
|
||||
@ -375,28 +270,10 @@ Download
|
||||
^^^^^^^^^^^^^
|
||||
- detector server corresponding to package in slsDetectorPackage/serverBin
|
||||
|
||||
- pof files
|
||||
.. list-table::
|
||||
:widths: 25 10 30 25 10
|
||||
:header-rows: 1
|
||||
- `pof files <https://github.com/slsdetectorgroup/slsDetectorFirmware>`__
|
||||
|
||||
* - Software
|
||||
- Hardware
|
||||
- Firmware Date
|
||||
- Firmware Link
|
||||
- Comments
|
||||
* - v5.0.0-rcx
|
||||
- EPCQ128
|
||||
- 05.10.2020
|
||||
- `v1.0 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/moench/EPCQ128/v1_0/moench_v1_0_201005.pof>`__
|
||||
-
|
||||
* - v5.0.0-rcx
|
||||
- EPCS128
|
||||
- 05.10.2020
|
||||
- `v1.0 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/moench/EPCS128/v1_0/moench_v1_0_201005.pof>`__
|
||||
-
|
||||
|
||||
Upgrade (from v5.0.0-rcx)
|
||||
Upgrade (from v5.0.0)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
|
||||
@ -419,28 +296,10 @@ Download
|
||||
^^^^^^^^^^^^^
|
||||
- detector server corresponding to package in slsDetectorPackage/serverBin
|
||||
|
||||
- pof files
|
||||
.. list-table::
|
||||
:widths: 25 10 30 25 10
|
||||
:header-rows: 1
|
||||
- `pof files <https://github.com/slsdetectorgroup/slsDetectorFirmware>`__
|
||||
|
||||
* - Software
|
||||
- Hardware
|
||||
- Firmware Date
|
||||
- Firmware Link
|
||||
- Comments
|
||||
* - v5.0.0-rcx
|
||||
- EPCQ128
|
||||
- 05.10.2020
|
||||
- `v1.0 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/ctb/EPCQ128/v1_0/ctb_v1_0_201005.pof>`__
|
||||
-
|
||||
* - v5.0.0-rcx
|
||||
- EPCS128
|
||||
- 05.10.2020
|
||||
- `v1.0 <https://github.com/slsdetectorgroup/slsDetectorFirmware/blob/master/binaries/ctb/EPCS128/v1_0/ctb_v1_0_201005.pof>`__
|
||||
-
|
||||
|
||||
Upgrade (from v5.0.0-rcx)
|
||||
Upgrade (from v5.0.0)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you run into issues while programming firmware.
|
||||
@ -462,11 +321,12 @@ Check :ref:`firmware troubleshooting <blackfin firmware troubleshooting>` if you
|
||||
Firmware Troubleshooting with blackfin
|
||||
----------------------------------------
|
||||
|
||||
#. v4.x.x client after programming will most likely reboot the blackfin processor, regardless of error.
|
||||
1. v4.x.x client after programming will most likely reboot the blackfin processor, regardless of error.
|
||||
|
||||
#. v5.x.x-rcx client after programming will not reboot the blackfin processor, if error occurred.
|
||||
2. v5.x.x-rcx client after programming will not reboot the blackfin processor, if error occurred.
|
||||
|
||||
3. If a reboot occured with an incomplete firmware in flash, the blackfin will most likely not find the mtd3 drive. To see if this drive exists:
|
||||
|
||||
#. If a reboot occured with an incomplete firmware in flash, the blackfin will most likely not find the mtd3 drive. To see if this drive exists:
|
||||
.. code-block:: bash
|
||||
|
||||
# connect to the board
|
||||
@ -482,7 +342,7 @@ Firmware Troubleshooting with blackfin
|
||||
|
||||
4. If one can see the mtd3 drive, one can already try to flash again using the **programfpga** command (without rebooting blackfin or detector).
|
||||
|
||||
#. If one can't list it, read the next section to try to get the blackfin to list it.
|
||||
5. If one can't list it, read the next section to try to get the blackfin to list it.
|
||||
|
||||
How to get back mtd3 drive remotely
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -53,9 +53,9 @@ int main() {
|
||||
}
|
||||
|
||||
std::ofstream fs2("depreciated.csv");
|
||||
fs2 << "Old, New\n";
|
||||
fs2 << "Old, New\n";
|
||||
auto cmds = proxy.GetDepreciatedCommands();
|
||||
for (auto it : cmds){
|
||||
for (auto it : cmds) {
|
||||
fs2 << it.first << ", " << it.second << '\n';
|
||||
}
|
||||
}
|
||||
|
@ -49,25 +49,39 @@ The easiest way to configure options is to use the ccmake utility.
|
||||
|
||||
Build using cmk.sh script
|
||||
-------------------------
|
||||
These are mainly aimed at those not familiar with using ccmake and cmake.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
The binaries are generated in slsDetectorPackage/build/bin directory.
|
||||
|
||||
# new build and make with 9 parallel threads
|
||||
./cmk.sh -cbj9
|
||||
|
||||
# build with python
|
||||
./cmk.sh -bpj9
|
||||
|
||||
# build with GUI
|
||||
./cmk.sh -bgj9
|
||||
|
||||
# build with hdf5
|
||||
./cmk.sh -hj9 -d [path of hdf5 dir]
|
||||
|
||||
Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [s] [u] [i] [m] [n] [-h] [z] [-d <HDF5 directory>] [-l Install directory] [-k <CMake command>] [-j <Number of threads>]
|
||||
-[no option]: only make
|
||||
-c: Clean
|
||||
-b: Builds/Rebuilds CMake files normal mode
|
||||
-p: Builds/Rebuilds Python API
|
||||
-h: Builds/Rebuilds Cmake files with HDF5 package
|
||||
-d: HDF5 Custom Directory
|
||||
-k: CMake command
|
||||
-l: Install directory
|
||||
-t: Build/Rebuilds only text client
|
||||
-r: Build/Rebuilds only receiver
|
||||
-g: Build/Rebuilds only gui
|
||||
-s: Simulator
|
||||
-u: Chip Test Gui
|
||||
-j: Number of threads to compile through
|
||||
-e: Debug mode
|
||||
-i: Builds tests
|
||||
-m: Manuals
|
||||
-n: Manuals without compiling doxygen (only rst)
|
||||
-z: Moench zmq processor
|
||||
|
||||
# get all options
|
||||
./cmk.sh -?
|
||||
|
||||
# new build and compile in parallel:
|
||||
./cmk.sh -bj5
|
||||
|
||||
|
||||
Install binaries using conda
|
||||
--------------------------------
|
||||
|
@ -1,6 +1,6 @@
|
||||
Receiver
|
||||
==============================================
|
||||
|
||||
.. doxygenclass:: Receiver
|
||||
.. doxygenclass:: sls::Receiver
|
||||
:members:
|
||||
.. :undoc-members:
|
@ -48,3 +48,24 @@ Custom Receiver
|
||||
| Cannot use "auto" for **udp_dstip**.
|
||||
|
||||
| Also ensure that there are no **rx_** commands in the config file. These commands are for configuring the slsReceiver.
|
||||
|
||||
Example of a custom receiver config file
|
||||
|
||||
* The main difference is the lack of **rx_** commands or file commands (eg. fwrite, fpath) and the udp_dstmac is required in config file.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# detector hostname
|
||||
hostname bchip052
|
||||
|
||||
# udp destination port (receiver)
|
||||
udp_dstport 50004
|
||||
|
||||
# udp destination ip (receiver)
|
||||
udp_dstip 10.0.1.100
|
||||
|
||||
# udp source ip (same subnet as udp_dstip)
|
||||
udp_srcip 10.0.1.184
|
||||
|
||||
# udp destination mac
|
||||
udp_dstmac 22:47:d5:48:ad:ef
|
||||
|
@ -1,6 +1,10 @@
|
||||
Troubleshooting
|
||||
=================
|
||||
|
||||
If something is missing, don't hesitate to
|
||||
open an issue at our `github repo issues
|
||||
<https://github.com/slsdetectorgroup/slsDetectorPackage/issues>`_.
|
||||
|
||||
Common
|
||||
------
|
||||
|
||||
|
@ -60,6 +60,7 @@ Client
|
||||
sls_detector_put virtual 2 1912
|
||||
|
||||
Use the same in the config file.
|
||||
Detector API has a method 'isVirtualDetectorServer' to check if on-board detector server is virtual.
|
||||
|
||||
|
||||
Sample Config file
|
||||
|
39
examples/jungfrau_custom_receiver.config
Executable file
39
examples/jungfrau_custom_receiver.config
Executable file
@ -0,0 +1,39 @@
|
||||
# detector hostname
|
||||
hostname bchip052
|
||||
|
||||
# do not use any rx_ or "file" (eg. fwrite, fpath) commands, which go to slsReceiver/slsMultiReceiver
|
||||
|
||||
# udp destination port (receiver)
|
||||
udp_dstport 50004
|
||||
|
||||
# udp destination ip (receiver)
|
||||
udp_dstip 10.0.1.100
|
||||
|
||||
# udp source ip (same subnet as udp_dstip)
|
||||
udp_srcip 10.0.1.184
|
||||
|
||||
# udp destination mac
|
||||
udp_dstmac 22:47:d5:48:ad:ef
|
||||
|
||||
|
||||
# PCBv2.0 (using 2 interfaces, top)
|
||||
udp_dstport2 50005
|
||||
udp_dstip2 10.0.2.100
|
||||
udp_srcip2 10.0.2.184
|
||||
udp_dstmac2 22:47:d5:48:ad:ff
|
||||
|
||||
|
||||
# enable two interfaces
|
||||
numinterfaces 2
|
||||
# select inner interface(effective only when numinterfaces is 1)
|
||||
#selinterface 1
|
||||
|
||||
# power on chip
|
||||
powerchip 1
|
||||
|
||||
# high voltage
|
||||
highvoltage 200
|
||||
|
||||
# timing to trigger
|
||||
timing trigger
|
||||
|
@ -1,9 +1,9 @@
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
#include "sls/ClientSocket.h"
|
||||
#include "DetectorImpl.h"
|
||||
#include "Module.h"
|
||||
#include "sls/ClientSocket.h"
|
||||
#include "sls/logger.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
|
||||
@ -446,8 +446,8 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
|
||||
CHECK(m.readRegister(0x7b) == 0x1003E);
|
||||
}
|
||||
|
||||
TEST_CASE("Eiger or Jungfrau startingfnum",
|
||||
"[.eigerintegration][.jungfrauintegration][startingfnum]") {
|
||||
TEST_CASE("Eiger or Jungfrau nextframenumber",
|
||||
"[.eigerintegration][.jungfrauintegration][nextframenumber]") {
|
||||
SingleDetectorConfig c;
|
||||
|
||||
// pick up multi detector from shm id 0
|
||||
@ -465,8 +465,8 @@ TEST_CASE("Eiger or Jungfrau startingfnum",
|
||||
// starting fnum
|
||||
uint64_t val = 8;
|
||||
|
||||
m.setStartingFrameNumber(val);
|
||||
CHECK(m.getStartingFrameNumber() == val);
|
||||
m.setNextFrameNumber(val);
|
||||
CHECK(m.getNextFrameNumber() == val);
|
||||
CHECK(m.acquire() == slsDetectorDefs::OK);
|
||||
CHECK(m.getReceiverCurrentFrameIndex() == val);
|
||||
|
||||
@ -474,18 +474,18 @@ TEST_CASE("Eiger or Jungfrau startingfnum",
|
||||
CHECK(m.acquire() == slsDetectorDefs::OK);
|
||||
CHECK(m.getReceiverCurrentFrameIndex() == val);
|
||||
|
||||
CHECK_THROWS_AS(m.setStartingFrameNumber(0), sls::RuntimeError);
|
||||
CHECK_THROWS_AS(m.setNextFrameNumber(0), sls::RuntimeError);
|
||||
|
||||
if (m.getDetectorTypeAsString() == "Eiger") {
|
||||
val = 281474976710655;
|
||||
} else if (m.getDetectorTypeAsString() == "Jungfrau") {
|
||||
val = 18446744073709551615;
|
||||
}
|
||||
m.setStartingFrameNumber(val);
|
||||
CHECK(m.getStartingFrameNumber() == val);
|
||||
m.setNextFrameNumber(val);
|
||||
CHECK(m.getNextFrameNumber() == val);
|
||||
CHECK(m.acquire() == slsDetectorDefs::OK);
|
||||
CHECK(m.getReceiverCurrentFrameIndex() == val);
|
||||
CHECK(m.getStartingFrameNumber() == (val + 1));
|
||||
CHECK(m.getNextFrameNumber() == (val + 1));
|
||||
}
|
||||
|
||||
TEST_CASE("Eiger readnlines", "[.eigerintegration][readnlines]") {
|
||||
|
Submodule libs/pybind11 updated: 4f72ef846f...8de7772cc7
27
libzmq-pkg-config/FindZeroMQ.cmake
Executable file
27
libzmq-pkg-config/FindZeroMQ.cmake
Executable file
@ -0,0 +1,27 @@
|
||||
#From: https://github.com/zeromq/cppzmq/
|
||||
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_LIBZMQ QUIET libzmq)
|
||||
|
||||
set(ZeroMQ_VERSION ${PC_LIBZMQ_VERSION})
|
||||
find_library(ZeroMQ_LIBRARY NAMES libzmq.so libzmq.dylib libzmq.dll
|
||||
PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS})
|
||||
find_library(ZeroMQ_STATIC_LIBRARY NAMES libzmq-static.a libzmq.a libzmq.dll.a
|
||||
PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS})
|
||||
|
||||
if(ZeroMQ_LIBRARY OR ZeroMQ_STATIC_LIBRARY)
|
||||
set(ZeroMQ_FOUND ON)
|
||||
endif()
|
||||
|
||||
if (TARGET libzmq)
|
||||
# avoid errors defining targets twice
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_library(libzmq SHARED IMPORTED)
|
||||
set_property(TARGET libzmq PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS})
|
||||
set_property(TARGET libzmq PROPERTY IMPORTED_LOCATION ${ZeroMQ_LIBRARY})
|
||||
|
||||
add_library(libzmq-static STATIC IMPORTED ${PC_LIBZMQ_INCLUDE_DIRS})
|
||||
set_property(TARGET libzmq-static PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS})
|
||||
set_property(TARGET libzmq-static PROPERTY IMPORTED_LOCATION ${ZeroMQ_STATIC_LIBRARY})
|
@ -1,19 +1,16 @@
|
||||
|
||||
# find_package (Python COMPONENTS Interpreter Development)
|
||||
|
||||
pybind11_add_module(_slsdet
|
||||
src/main.cpp
|
||||
src/enums.cpp
|
||||
src/detector.cpp
|
||||
src/network.cpp
|
||||
src/pattern.cpp
|
||||
src/scan.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(_slsdet PUBLIC
|
||||
slsDetectorShared
|
||||
slsReceiverShared
|
||||
slsSupportShared
|
||||
${ZeroMQ_LIBRARIES}
|
||||
)
|
||||
slsDetectorStatic
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -33,6 +30,7 @@ set( PYTHON_FILES
|
||||
enums.py
|
||||
errors.py
|
||||
gotthard.py
|
||||
pattern.py
|
||||
gotthard2.py
|
||||
moench.py
|
||||
proxy.py
|
||||
|
14
python/examples/manipulate_pattern.py
Normal file
14
python/examples/manipulate_pattern.py
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
from slsdet import Detector, patternParameters
|
||||
|
||||
d = Detector()
|
||||
pat = patternParameters()
|
||||
|
||||
#Access to members of the structure using numpy arrays
|
||||
pat.patlimits = 0x0, 0xa
|
||||
|
||||
d.setPattern(pat)
|
||||
|
||||
#Load pattern from file
|
||||
pat.load("/some/dir/some.pat")
|
@ -6,7 +6,7 @@ d = Detector()
|
||||
d.fformat = fileFormat.BINARY
|
||||
|
||||
# Altough not recommended for convenience all enums
|
||||
# and some other things can be impored using *
|
||||
# and some other things can be imported using *
|
||||
|
||||
from slsdet import *
|
||||
d.speed = speedLevel.FULL_SPEED
|
||||
@ -15,6 +15,6 @@ d.speed = speedLevel.FULL_SPEED
|
||||
|
||||
import slsdet.enums
|
||||
for enum in dir(slsdet.enums):
|
||||
# filter out special memebers
|
||||
# filter out special members
|
||||
if not enum.startswith('_'):
|
||||
print(enum)
|
||||
|
19
python/examples/using_scan.py
Normal file
19
python/examples/using_scan.py
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
from slsdet import Mythen3, scanParameters, dacIndex
|
||||
|
||||
#Configure scan
|
||||
sp = scanParameters()
|
||||
sp.enable = 1
|
||||
sp.dacInd = dacIndex.VTH1
|
||||
sp.startOffset = 0
|
||||
sp.stopOffset = 1000
|
||||
sp.stepSize = 100
|
||||
sp.dacSettleTime_ns = int(1e9)
|
||||
|
||||
|
||||
# Send scan to detector
|
||||
d = Mythen3()
|
||||
d.setScan(sp)
|
||||
|
||||
|
||||
|
@ -10,6 +10,8 @@ from slsdet.lookup import view, find
|
||||
import slsdet
|
||||
|
||||
|
||||
|
||||
|
||||
d = Detector()
|
||||
e = Eiger()
|
||||
c = Ctb()
|
||||
|
80
python/scripts/compile_servers.py
Normal file
80
python/scripts/compile_servers.py
Normal file
@ -0,0 +1,80 @@
|
||||
import subprocess
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
import shutil as sh
|
||||
from argparse import ArgumentParser
|
||||
|
||||
class color:
|
||||
HEADER = "\033[95m"
|
||||
BLUE = "\033[94m"
|
||||
CYAN = "\033[96m"
|
||||
GREEN = "\033[92m"
|
||||
YELLOW = "\033[93m"
|
||||
RED = "\033[91m"
|
||||
ENDC = "\033[0m"
|
||||
BOLD = "\033[1m"
|
||||
UNDERLINE = "\033[4m"
|
||||
MAGENTA = "\033[35m"
|
||||
|
||||
@staticmethod
|
||||
def red(s):
|
||||
return f"{color.RED}{s}{color.ENDC}"
|
||||
|
||||
@staticmethod
|
||||
def green(s):
|
||||
return f"{color.GREEN}{s}{color.ENDC}"
|
||||
|
||||
def add_to_path():
|
||||
paths = [
|
||||
"/opt/uClinux/bfin-uclinux/bin",
|
||||
"/opt/nios2-gcc/bin",
|
||||
"/opt/eldk-5.1/powerpc-4xx-softfloat/sysroots/i686-eldk-linux/usr/bin/ppc405-linux",
|
||||
]
|
||||
os.environ["PATH"] += os.pathsep + os.pathsep.join(paths)
|
||||
|
||||
|
||||
def rc_to_string(rc):
|
||||
if rc == 0:
|
||||
return color.green("OK")
|
||||
else:
|
||||
return color.red("FAIL")
|
||||
|
||||
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument('-t', '--tag', help = 'Tag added to server file name', default='developer')
|
||||
parser.add_argument('-g', '--git', help='Add new servers to the git repo', action="store_true")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
servers = [
|
||||
# "eigerDetectorServer",
|
||||
# "jungfrauDetectorServer",
|
||||
"mythen3DetectorServer",
|
||||
# "gotthard2DetectorServer",
|
||||
# "gotthardDetectorServer",
|
||||
# "ctbDetectorServer",
|
||||
# "moenchDetectorServer",
|
||||
]
|
||||
|
||||
|
||||
server_root = Path("../../slsDetectorServers/").resolve()
|
||||
|
||||
add_to_path()
|
||||
for server in servers:
|
||||
bin_name = f"{server}_{args.tag}"
|
||||
path = server_root / server
|
||||
print(f"{bin_name} - ", end="")
|
||||
os.chdir(path)
|
||||
try:
|
||||
sh.rmtree(path/'bin')
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
p = subprocess.run(["make"], stdout=subprocess.DEVNULL)
|
||||
print(rc_to_string(p.returncode))
|
||||
if p.returncode == 0:
|
||||
sh.move(f"bin/{server}", f"bin/{bin_name}")
|
||||
if args.git:
|
||||
print("Adding to git")
|
||||
subprocess.run(['git', 'add', 'bin', '-f'])
|
@ -11,6 +11,8 @@ import subprocess
|
||||
|
||||
from parse import remove_comments
|
||||
|
||||
allow_bitwise_op = ["M3_GainCaps"]
|
||||
|
||||
def single_line_enum(line):
|
||||
sub = line[line.find('{')+1:line.find('}')]
|
||||
return sub.strip().split(',')
|
||||
@ -49,13 +51,17 @@ def extract_enums(lines):
|
||||
def generate_enum_string(enums):
|
||||
data = []
|
||||
for key, value in enums.items():
|
||||
data.append(f'py::enum_<slsDetectorDefs::{key}>(Defs, "{key}")\n')
|
||||
if key in allow_bitwise_op:
|
||||
tag=", py::arithmetic()"
|
||||
else:
|
||||
tag=""
|
||||
data.append(f'py::enum_<slsDetectorDefs::{key}>(Defs, "{key}"{tag})\n')
|
||||
for v in value:
|
||||
data.append(f'\t.value("{v}", slsDetectorDefs::{key}::{v})\n')
|
||||
data.append('.export_values();\n\n')
|
||||
return ''.join(data)
|
||||
|
||||
with open('../../slsSupportLib/include/sls_detector_defs.h') as f:
|
||||
with open('../../slsSupportLib/include/sls/sls_detector_defs.h') as f:
|
||||
data = f.read()
|
||||
|
||||
data = remove_comments(data)
|
||||
|
103
python/setup.py
103
python/setup.py
@ -2,11 +2,12 @@
|
||||
Setup file for slsdet
|
||||
Build upon the pybind11 example found here: https://github.com/pybind/python_example
|
||||
"""
|
||||
from setuptools import setup, Extension, find_packages
|
||||
from setuptools.command.build_ext import build_ext
|
||||
import sys
|
||||
import setuptools
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append('../libs/pybind11')
|
||||
from setuptools import setup, find_packages
|
||||
from pybind11.setup_helpers import Pybind11Extension, build_ext
|
||||
|
||||
__version__ = os.environ.get('GIT_DESCRIBE_TAG', 'developer')
|
||||
|
||||
@ -19,109 +20,29 @@ def get_conda_path():
|
||||
return os.environ['CONDA_PREFIX']
|
||||
|
||||
|
||||
# class get_pybind_include(object):
|
||||
# """Helper class to determine the pybind11 include path
|
||||
# The purpose of this class is to postpone importing pybind11
|
||||
# until it is actually installed, so that the ``get_include()``
|
||||
# method can be invoked. """
|
||||
|
||||
# def __init__(self, user=False):
|
||||
# self.user = user
|
||||
|
||||
# def __str__(self):
|
||||
# import pybind11
|
||||
# return pybind11.get_include(self.user)
|
||||
|
||||
|
||||
#TODO migrate to CMake build?
|
||||
ext_modules = [
|
||||
Extension(
|
||||
Pybind11Extension(
|
||||
'_slsdet',
|
||||
['src/main.cpp',
|
||||
'src/enums.cpp',
|
||||
'src/detector.cpp',
|
||||
'src/network.cpp'],
|
||||
'src/network.cpp',
|
||||
'src/pattern.cpp',
|
||||
'src/scan.cpp',],
|
||||
include_dirs=[
|
||||
# Path to pybind11 headers
|
||||
# get_pybind_include(),
|
||||
# get_pybind_include(user=True),
|
||||
os.path.join('../libs/pybind11/include'),
|
||||
os.path.join(get_conda_path(), 'include'),
|
||||
|
||||
],
|
||||
libraries=['SlsDetector', 'SlsReceiver', 'zmq'],
|
||||
libraries=['SlsDetector', 'SlsSupport', 'SlsReceiver', 'zmq'],
|
||||
library_dirs=[
|
||||
os.path.join(get_conda_path(), 'lib'),
|
||||
os.path.join(get_conda_path(), 'bin'),
|
||||
],
|
||||
|
||||
language='c++'
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
# As of Python 3.6, CCompiler has a `has_flag` method.
|
||||
# cf http://bugs.python.org/issue26689
|
||||
def has_flag(compiler, flagname):
|
||||
"""Return a boolean indicating whether a flag name is supported on
|
||||
the specified compiler.
|
||||
"""
|
||||
import tempfile
|
||||
with tempfile.NamedTemporaryFile('w', suffix='.cpp') as f:
|
||||
f.write('int main (int argc, char **argv) { return 0; }')
|
||||
try:
|
||||
compiler.compile([f.name], extra_postargs=[flagname])
|
||||
except setuptools.distutils.errors.CompileError:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def cpp_flag(compiler):
|
||||
"""Return the -std=c++[11/14] compiler flag.
|
||||
The c++14 is prefered over c++11 (when it is available).
|
||||
"""
|
||||
if has_flag(compiler, '-std=c++14'):
|
||||
return '-std=c++14'
|
||||
elif has_flag(compiler, '-std=c++11'):
|
||||
return '-std=c++11'
|
||||
else:
|
||||
raise RuntimeError('Unsupported compiler -- at least C++11 support '
|
||||
'is needed!')
|
||||
|
||||
|
||||
class BuildExt(build_ext):
|
||||
"""A custom build extension for adding compiler-specific options."""
|
||||
c_opts = {
|
||||
'msvc': ['/EHsc'],
|
||||
'unix': [],
|
||||
}
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7']
|
||||
|
||||
def build_extensions(self):
|
||||
ct = self.compiler.compiler_type
|
||||
opts = self.c_opts.get(ct, [])
|
||||
if ct == 'unix':
|
||||
opts.append('-DVERSION_INFO="%s"' % self.distribution.get_version())
|
||||
opts.append(cpp_flag(self.compiler))
|
||||
if has_flag(self.compiler, '-fvisibility=hidden'):
|
||||
opts.append('-fvisibility=hidden')
|
||||
elif ct == 'msvc':
|
||||
opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version())
|
||||
for ext in self.extensions:
|
||||
ext.extra_compile_args = opts
|
||||
|
||||
print('**************************************************')
|
||||
print(ct)
|
||||
print(opts)
|
||||
print('**************************************************')
|
||||
build_ext.build_extensions(self)
|
||||
|
||||
|
||||
|
||||
def get_shared_lib():
|
||||
return [f for f in os.listdir('.') if '_slsdet' in f]
|
||||
|
||||
setup(
|
||||
name='slsdet',
|
||||
version=__version__,
|
||||
@ -132,6 +53,6 @@ setup(
|
||||
long_description='',
|
||||
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
|
||||
ext_modules=ext_modules,
|
||||
cmdclass={'build_ext': BuildExt},
|
||||
cmdclass={"build_ext": build_ext},
|
||||
zip_safe=False,
|
||||
)
|
||||
|
@ -8,6 +8,8 @@ from .mythen3 import Mythen3
|
||||
from .gotthard2 import Gotthard2
|
||||
from .gotthard import Gotthard
|
||||
from .moench import Moench
|
||||
from .pattern import Pattern, patternParameters
|
||||
|
||||
|
||||
import _slsdet
|
||||
xy = _slsdet.xy
|
||||
@ -18,3 +20,4 @@ from .enums import *
|
||||
|
||||
IpAddr = _slsdet.IpAddr
|
||||
MacAddr = _slsdet.MacAddr
|
||||
scanParameters = _slsdet.scanParameters
|
@ -349,7 +349,7 @@ class Detector(CppDetectorApi):
|
||||
|
||||
@property
|
||||
@element
|
||||
def nframes(self):
|
||||
def framecounter(self):
|
||||
"""
|
||||
[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Number of frames from start run control.
|
||||
Note
|
||||
@ -540,13 +540,13 @@ class Detector(CppDetectorApi):
|
||||
|
||||
@property
|
||||
@element
|
||||
def startingfnum(self):
|
||||
"""[Eiger][Jungfrau] Starting frame number for next acquisition. Stopping acquisition might result in different frame numbers for different modules. """
|
||||
return self.getStartingFrameNumber()
|
||||
def nextframenumber(self):
|
||||
"""[Eiger][Jungfrau] Next frame number. Stopping acquisition might result in different frame numbers for different modules. """
|
||||
return self.getNextFrameNumber()
|
||||
|
||||
@startingfnum.setter
|
||||
def startingfnum(self, value):
|
||||
ut.set_using_dict(self.setStartingFrameNumber, value)
|
||||
@nextframenumber.setter
|
||||
def nextframenumber(self, value):
|
||||
ut.set_using_dict(self.setNextFrameNumber, value)
|
||||
|
||||
@property
|
||||
@element
|
||||
@ -1009,6 +1009,32 @@ class Detector(CppDetectorApi):
|
||||
ip = ut.make_ip(ip) #Convert from int or string to IpAddr
|
||||
ut.set_using_dict(self.setClientZmqIp, ip)
|
||||
|
||||
|
||||
@property
|
||||
def zmqhwm(self):
|
||||
"""
|
||||
Client's zmq receive high water mark. Default is the zmq library's default (1000), can also be set here using -1.
|
||||
This is a high number and can be set to 2 for gui purposes.
|
||||
One must also set the receiver's send high water mark to similar value. Final effect is sum of them.
|
||||
Setting it via command line is useful only before zmq enabled (before opening gui).
|
||||
"""
|
||||
return self.getClientZmqHwm()
|
||||
|
||||
@zmqhwm.setter
|
||||
def zmqhwm(self, n_frames):
|
||||
self.setClientZmqHwm(n_frames)
|
||||
|
||||
@property
|
||||
def rx_zmqhwm(self):
|
||||
"""
|
||||
Receiver's zmq send high water mark. Default is the zmq library's default (1000). This is a high number and can be set to 2 for gui purposes. One must also set the client's receive high water mark to similar value. Final effect is sum of them. Also restarts receiver zmq streaming if enabled. Can set to -1 to set default value.
|
||||
"""
|
||||
return self.getRxZmqHwm()
|
||||
|
||||
@rx_zmqhwm.setter
|
||||
def rx_zmqhwm(self, n_frames):
|
||||
self.setRxZmqHwm(n_frames)
|
||||
|
||||
@property
|
||||
@element
|
||||
def udp_dstip(self):
|
||||
@ -1499,7 +1525,7 @@ class Detector(CppDetectorApi):
|
||||
|
||||
@property
|
||||
@element
|
||||
def timestamp(self):
|
||||
def frametime(self):
|
||||
"""[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Timestamp at a frame start.
|
||||
Note
|
||||
----
|
||||
@ -1670,6 +1696,8 @@ class Detector(CppDetectorApi):
|
||||
To change settings as well or set threshold without trimbits, use setThresholdEnergy.
|
||||
:setter: It loads trim files from settingspath.
|
||||
"""
|
||||
if self.type == detectorType.MYTHEN3:
|
||||
return self.getAllThresholdEnergy()
|
||||
return self.getThresholdEnergy()
|
||||
|
||||
@threshold.setter
|
||||
@ -1965,7 +1993,7 @@ class Detector(CppDetectorApi):
|
||||
|
||||
@property
|
||||
@element
|
||||
def now(self):
|
||||
def runtime(self):
|
||||
"""[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Time from detector start up.
|
||||
Note
|
||||
-----
|
||||
@ -3079,6 +3107,14 @@ class Detector(CppDetectorApi):
|
||||
"""
|
||||
return ClkFreqProxy(self)
|
||||
|
||||
|
||||
def readout(self):
|
||||
"""
|
||||
Mythen3] Starts detector readout. Status changes to TRANSMITTING and automatically returns to idle at the end of readout.
|
||||
"""
|
||||
self.startDetectorReadout()
|
||||
|
||||
|
||||
"""
|
||||
---------------------------<<<Debug>>>---------------------------
|
||||
"""
|
||||
|
@ -14,4 +14,5 @@ clockIndex = _slsdet.slsDetectorDefs.clockIndex
|
||||
readoutMode = _slsdet.slsDetectorDefs.readoutMode
|
||||
masterFlags = _slsdet.slsDetectorDefs.masterFlags
|
||||
burstMode = _slsdet.slsDetectorDefs.burstMode
|
||||
timingSourceType = _slsdet.slsDetectorDefs.timingSourceType
|
||||
timingSourceType = _slsdet.slsDetectorDefs.timingSourceType
|
||||
M3_GainCaps = _slsdet.slsDetectorDefs.M3_GainCaps
|
53
python/slsdet/pattern.py
Normal file
53
python/slsdet/pattern.py
Normal file
@ -0,0 +1,53 @@
|
||||
import _slsdet
|
||||
|
||||
from _slsdet import Pattern
|
||||
|
||||
|
||||
class patternParameters(_slsdet.patternParameters):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.view = self.numpy_view()
|
||||
self.names = self.view.dtype.names
|
||||
|
||||
def __getattr__(self, name):
|
||||
if name in self.names:
|
||||
return self.view[name][0]
|
||||
else:
|
||||
raise KeyError(f"Key: {name} not found")
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
if name in ["view", "names"]:
|
||||
self.__dict__[name] = value
|
||||
elif name in self.names:
|
||||
self.view[name] = value
|
||||
else:
|
||||
raise KeyError(f"Key: {name} not found")
|
||||
|
||||
# Provide custom dir for tab completion
|
||||
def __dir__(self):
|
||||
return self.names
|
||||
|
||||
|
||||
class Pattern(_slsdet.Pattern):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.view = self.data().numpy_view()
|
||||
self.names = self.view.dtype.names
|
||||
|
||||
def __getattr__(self, name):
|
||||
if name in self.names:
|
||||
return self.view[name][0]
|
||||
else:
|
||||
raise KeyError(f"Key: {name} not found")
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
if name in ["view", "names"]:
|
||||
self.__dict__[name] = value
|
||||
elif name in self.names:
|
||||
self.view[name] = value
|
||||
else:
|
||||
raise KeyError(f"Key: {name} not found")
|
||||
|
||||
# Provide custom dir for tab completion
|
||||
def __dir__(self):
|
||||
return self.names
|
@ -102,6 +102,34 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(defs::detectorSettings, sls::Positions)) &
|
||||
Detector::setSettings,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getThresholdEnergy",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getThresholdEnergy,
|
||||
py::arg() = Positions{})
|
||||
.def("getAllThresholdEnergy",
|
||||
(Result<std::array<int, 3>>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getAllThresholdEnergy,
|
||||
py::arg() = Positions{})
|
||||
.def("setThresholdEnergy",
|
||||
(void (Detector::*)(int, defs::detectorSettings, bool,
|
||||
sls::Positions)) &
|
||||
Detector::setThresholdEnergy,
|
||||
py::arg(), py::arg() = defs::STANDARD, py::arg() = true,
|
||||
py::arg() = Positions{})
|
||||
.def("setThresholdEnergy",
|
||||
(void (Detector::*)(std::array<int, 3>, defs::detectorSettings,
|
||||
bool, sls::Positions)) &
|
||||
Detector::setThresholdEnergy,
|
||||
py::arg(), py::arg() = defs::STANDARD, py::arg() = true,
|
||||
py::arg() = Positions{})
|
||||
.def("getSettingsPath",
|
||||
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getSettingsPath,
|
||||
py::arg() = Positions{})
|
||||
.def("setSettingsPath",
|
||||
(void (Detector::*)(const std::string &, sls::Positions)) &
|
||||
Detector::setSettingsPath,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("loadTrimbits",
|
||||
(void (Detector::*)(const std::string &, sls::Positions)) &
|
||||
Detector::loadTrimbits,
|
||||
@ -114,12 +142,24 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(int, sls::Positions)) &
|
||||
Detector::setAllTrimbits,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getTrimEnergies",
|
||||
(Result<std::vector<int>>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getTrimEnergies,
|
||||
py::arg() = Positions{})
|
||||
.def("setTrimEnergies",
|
||||
(void (Detector::*)(std::vector<int>, sls::Positions)) &
|
||||
Detector::setTrimEnergies,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getGapPixelsinCallback",
|
||||
(bool (Detector::*)() const) & Detector::getGapPixelsinCallback)
|
||||
.def("setGapPixelsinCallback",
|
||||
(void (Detector::*)(const bool)) &
|
||||
Detector::setGapPixelsinCallback,
|
||||
py::arg())
|
||||
.def("isVirtualDetectorServer",
|
||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||
Detector::isVirtualDetectorServer,
|
||||
py::arg() = Positions{})
|
||||
.def("registerAcquisitionFinishedCallback",
|
||||
(void (Detector::*)(void (*)(double, int, void *), void *)) &
|
||||
Detector::registerAcquisitionFinishedCallback,
|
||||
@ -314,6 +354,9 @@ void init_det(py::module &m) {
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getDacList", (std::vector<defs::dacIndex>(Detector::*)() const) &
|
||||
Detector::getDacList)
|
||||
.def("setDefaultDacs",
|
||||
(void (Detector::*)(sls::Positions)) & Detector::setDefaultDacs,
|
||||
py::arg() = Positions{})
|
||||
.def("getDAC",
|
||||
(Result<int>(Detector::*)(defs::dacIndex, bool, sls::Positions)
|
||||
const) &
|
||||
@ -356,6 +399,8 @@ void init_det(py::module &m) {
|
||||
.def("startReceiver", (void (Detector::*)()) & Detector::startReceiver)
|
||||
.def("stopReceiver", (void (Detector::*)()) & Detector::stopReceiver)
|
||||
.def("startDetector", (void (Detector::*)()) & Detector::startDetector)
|
||||
.def("startDetectorReadout",
|
||||
(void (Detector::*)()) & Detector::startDetectorReadout)
|
||||
.def("stopDetector", (void (Detector::*)()) & Detector::stopDetector)
|
||||
.def("getDetectorStatus",
|
||||
(Result<defs::runStatus>(Detector::*)(sls::Positions) const) &
|
||||
@ -374,13 +419,13 @@ void init_det(py::module &m) {
|
||||
(Result<std::vector<uint64_t>>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getNumMissingPackets,
|
||||
py::arg() = Positions{})
|
||||
.def("getStartingFrameNumber",
|
||||
.def("getNextFrameNumber",
|
||||
(Result<uint64_t>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getStartingFrameNumber,
|
||||
Detector::getNextFrameNumber,
|
||||
py::arg() = Positions{})
|
||||
.def("setStartingFrameNumber",
|
||||
.def("setNextFrameNumber",
|
||||
(void (Detector::*)(uint64_t, sls::Positions)) &
|
||||
Detector::setStartingFrameNumber,
|
||||
Detector::setNextFrameNumber,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("sendSoftwareTrigger",
|
||||
(void (Detector::*)(sls::Positions)) &
|
||||
@ -599,15 +644,15 @@ void init_det(py::module &m) {
|
||||
Detector::setPartialFramesPadding,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getRxUDPSocketBufferSize",
|
||||
(Result<int64_t>(Detector::*)(sls::Positions) const) &
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getRxUDPSocketBufferSize,
|
||||
py::arg() = Positions{})
|
||||
.def("setRxUDPSocketBufferSize",
|
||||
(void (Detector::*)(int64_t, sls::Positions)) &
|
||||
(void (Detector::*)(int, sls::Positions)) &
|
||||
Detector::setRxUDPSocketBufferSize,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getRxRealUDPSocketBufferSize",
|
||||
(Result<int64_t>(Detector::*)(sls::Positions) const) &
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getRxRealUDPSocketBufferSize,
|
||||
py::arg() = Positions{})
|
||||
.def("getRxLock",
|
||||
@ -747,6 +792,17 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const sls::IpAddr, sls::Positions)) &
|
||||
Detector::setClientZmqIp,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getClientZmqHwm",
|
||||
(int (Detector::*)() const) & Detector::getClientZmqHwm)
|
||||
.def("setClientZmqHwm",
|
||||
(void (Detector::*)(const int)) & Detector::setClientZmqHwm,
|
||||
py::arg())
|
||||
.def("getRxZmqHwm",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getRxZmqHwm,
|
||||
py::arg() = Positions{})
|
||||
.def("setRxZmqHwm",
|
||||
(void (Detector::*)(const int)) & Detector::setRxZmqHwm, py::arg())
|
||||
.def("getSubExptime",
|
||||
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getSubExptime,
|
||||
@ -763,24 +819,6 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(sls::ns, sls::Positions)) &
|
||||
Detector::setSubDeadTime,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getThresholdEnergy",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getThresholdEnergy,
|
||||
py::arg() = Positions{})
|
||||
.def("setThresholdEnergy",
|
||||
(void (Detector::*)(int, defs::detectorSettings, bool,
|
||||
sls::Positions)) &
|
||||
Detector::setThresholdEnergy,
|
||||
py::arg(), py::arg() = defs::STANDARD, py::arg() = true,
|
||||
py::arg() = Positions{})
|
||||
.def("getSettingsPath",
|
||||
(Result<std::string>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getSettingsPath,
|
||||
py::arg() = Positions{})
|
||||
.def("setSettingsPath",
|
||||
(void (Detector::*)(const std::string &, sls::Positions)) &
|
||||
Detector::setSettingsPath,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getOverFlowMode",
|
||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getOverFlowMode,
|
||||
@ -796,14 +834,6 @@ void init_det(py::module &m) {
|
||||
.def("setBottom",
|
||||
(void (Detector::*)(bool, sls::Positions)) & Detector::setBottom,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getTrimEnergies",
|
||||
(Result<std::vector<int>>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getTrimEnergies,
|
||||
py::arg() = Positions{})
|
||||
.def("setTrimEnergies",
|
||||
(void (Detector::*)(std::vector<int>, sls::Positions)) &
|
||||
Detector::setTrimEnergies,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getRateCorrection",
|
||||
(Result<sls::ns>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getRateCorrection,
|
||||
@ -1102,6 +1132,20 @@ void init_det(py::module &m) {
|
||||
(Result<std::array<ns, 3>>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getGateDelayForAllGates,
|
||||
py::arg() = Positions{})
|
||||
.def("getMaster",
|
||||
(Result<bool>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getMaster,
|
||||
py::arg() = Positions{})
|
||||
.def("getChipStatusRegister",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getChipStatusRegister,
|
||||
py::arg() = Positions{})
|
||||
.def("setGainCaps",
|
||||
(void (Detector::*)(int, sls::Positions)) & Detector::setGainCaps,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("getGainCaps",
|
||||
(Result<int>(Detector::*)(sls::Positions)) & Detector::getGainCaps,
|
||||
py::arg() = Positions{})
|
||||
.def("getNumberOfAnalogSamples",
|
||||
(Result<int>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getNumberOfAnalogSamples,
|
||||
@ -1251,9 +1295,17 @@ void init_det(py::module &m) {
|
||||
(void (Detector::*)(const std::string &, sls::Positions)) &
|
||||
Detector::setPattern,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("setPattern",
|
||||
(void (Detector::*)(const sls::Pattern &, sls::Positions)) &
|
||||
Detector::setPattern,
|
||||
py::arg(), py::arg() = Positions{})
|
||||
.def("savePattern",
|
||||
(void (Detector::*)(const std::string &)) & Detector::savePattern,
|
||||
py::arg())
|
||||
.def("loadDefaultPattern",
|
||||
(void (Detector::*)(sls::Positions)) &
|
||||
Detector::loadDefaultPattern,
|
||||
py::arg() = Positions{})
|
||||
.def("getPatternIOControl",
|
||||
(Result<uint64_t>(Detector::*)(sls::Positions) const) &
|
||||
Detector::getPatternIOControl,
|
||||
|
@ -2,10 +2,12 @@
|
||||
* warning */
|
||||
|
||||
#include <pybind11/chrono.h>
|
||||
#include <pybind11/numpy.h>
|
||||
#include <pybind11/operators.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
|
||||
#include "sls/Pattern.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
namespace py = pybind11;
|
||||
void init_enums(py::module &m) {
|
||||
@ -275,4 +277,14 @@ void init_enums(py::module &m) {
|
||||
.value("TIMING_EXTERNAL",
|
||||
slsDetectorDefs::timingSourceType::TIMING_EXTERNAL)
|
||||
.export_values();
|
||||
|
||||
py::enum_<slsDetectorDefs::M3_GainCaps>(Defs, "M3_GainCaps",
|
||||
py::arithmetic())
|
||||
.value("M3_C10pre", slsDetectorDefs::M3_GainCaps::M3_C10pre)
|
||||
.value("M3_C15sh", slsDetectorDefs::M3_GainCaps::M3_C15sh)
|
||||
.value("M3_C30sh", slsDetectorDefs::M3_GainCaps::M3_C30sh)
|
||||
.value("M3_C50sh", slsDetectorDefs::M3_GainCaps::M3_C50sh)
|
||||
.value("M3_C225ACsh", slsDetectorDefs::M3_GainCaps::M3_C225ACsh)
|
||||
.value("M3_C15pre", slsDetectorDefs::M3_GainCaps::M3_C15pre)
|
||||
.export_values();
|
||||
}
|
||||
|
@ -1,18 +1,19 @@
|
||||
#include <pybind11/chrono.h>
|
||||
#include <pybind11/numpy.h>
|
||||
#include <pybind11/operators.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
|
||||
#include "sls/sls_detector_defs.h"
|
||||
#include "sls/Pattern.h"
|
||||
namespace py = pybind11;
|
||||
void init_enums(py::module &m) {
|
||||
py::class_<slsDetectorDefs> Defs(m, "slsDetectorDefs");
|
||||
py::class_<slsDetectorDefs::xy> xy(m, "xy");
|
||||
xy.def(py::init());
|
||||
xy.def(py::init<int,int>());
|
||||
xy.def(py::init<int, int>());
|
||||
xy.def_readwrite("x", &slsDetectorDefs::xy::x);
|
||||
xy.def_readwrite("y", &slsDetectorDefs::xy::y);
|
||||
|
||||
[[ENUMS]]
|
||||
|
||||
[[ENUMS]]
|
||||
}
|
||||
|
@ -19,6 +19,8 @@ void init_enums(py::module &);
|
||||
void init_experimental(py::module &);
|
||||
void init_det(py::module &);
|
||||
void init_network(py::module &);
|
||||
void init_pattern(py::module &);
|
||||
void init_scan(py::module &);
|
||||
PYBIND11_MODULE(_slsdet, m) {
|
||||
m.doc() = R"pbdoc(
|
||||
C/C++ API
|
||||
@ -33,6 +35,8 @@ PYBIND11_MODULE(_slsdet, m) {
|
||||
init_enums(m);
|
||||
init_det(m);
|
||||
init_network(m);
|
||||
init_pattern(m);
|
||||
init_scan(m);
|
||||
// init_experimental(m);
|
||||
|
||||
|
||||
|
29
python/src/pattern.cpp
Normal file
29
python/src/pattern.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
#include <pybind11/chrono.h>
|
||||
#include <pybind11/numpy.h>
|
||||
#include <pybind11/operators.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
|
||||
#include "sls/Pattern.h"
|
||||
#include "sls/sls_detector_defs.h"
|
||||
namespace py = pybind11;
|
||||
void init_pattern(py::module &m) {
|
||||
|
||||
using pat = sls::patternParameters;
|
||||
py::class_<pat> patternParameters(m, "patternParameters");
|
||||
|
||||
PYBIND11_NUMPY_DTYPE(pat, word, ioctrl, limits, loop, nloop, wait,
|
||||
waittime);
|
||||
|
||||
patternParameters.def(py::init());
|
||||
patternParameters.def("numpy_view", [](py::object &obj) {
|
||||
pat &o = obj.cast<pat &>();
|
||||
return py::array_t<pat>(1, &o, obj);
|
||||
});
|
||||
|
||||
py::class_<sls::Pattern> Pattern(m, "Pattern");
|
||||
Pattern.def(py::init());
|
||||
Pattern.def("load", &sls::Pattern::load);
|
||||
Pattern.def("data", (pat * (sls::Pattern::*)()) & sls::Pattern::data,
|
||||
py::return_value_policy::reference);
|
||||
}
|
39
python/src/scan.cpp
Normal file
39
python/src/scan.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
#include <pybind11/chrono.h>
|
||||
#include <pybind11/numpy.h>
|
||||
#include <pybind11/operators.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
#include <sstream>
|
||||
#include "sls/sls_detector_defs.h"
|
||||
namespace py = pybind11;
|
||||
void init_scan(py::module &m) {
|
||||
|
||||
using sp = slsDetectorDefs::scanParameters;
|
||||
py::class_<sp> scanParameters(m, "scanParameters");
|
||||
|
||||
scanParameters.def(py::init());
|
||||
|
||||
scanParameters.def(py::init<slsDetectorDefs::dacIndex, int, int, int>());
|
||||
scanParameters.def(py::init<slsDetectorDefs::dacIndex, int, int, int, std::chrono::nanoseconds>());
|
||||
scanParameters.def_readwrite("enable", &sp::enable);
|
||||
scanParameters.def_readwrite("dacInd", &sp::dacInd);
|
||||
scanParameters.def_readwrite("startOffset", &sp::startOffset);
|
||||
scanParameters.def_readwrite("stopOffset", &sp::stopOffset);
|
||||
scanParameters.def_readwrite("stepSize", &sp::stepSize);
|
||||
scanParameters.def_readwrite("dacSettleTime_ns", &sp::dacSettleTime_ns);
|
||||
scanParameters.def("__repr__", [](const sp &a){
|
||||
std::ostringstream oss;
|
||||
auto indent = " ";
|
||||
oss << "<scanParameters>\n";
|
||||
oss << indent << "enable: " << a.enable << '\n';
|
||||
oss << indent << "dacInd: " << a.dacInd << '\n';
|
||||
oss << indent << "startOffset: " << a.startOffset << '\n';
|
||||
oss << indent << "stopOffset: " << a.stopOffset << '\n';
|
||||
oss << indent << "stepSize: " << a.stepSize << '\n';
|
||||
oss << indent << "dacSettleTime_ns: " << a.dacSettleTime_ns;
|
||||
return oss.str();
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
@ -1 +0,0 @@
|
||||
800 10
|
@ -1 +0,0 @@
|
||||
829 9.3
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
800 10
|
@ -1 +0,0 @@
|
||||
804 15.0
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
800 10
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
817 11.6
|
File diff suppressed because it is too large
Load Diff
BIN
settingsdir/mythen3/fast/11200eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/fast/11200eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/fast/11200eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/fast/11200eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/fast/4500eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/fast/4500eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/fast/4500eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/fast/4500eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/fast/5400eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/fast/5400eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/fast/5400eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/fast/5400eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/fast/6400eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/fast/6400eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/fast/6400eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/fast/6400eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/fast/8000eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/fast/8000eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/fast/8000eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/fast/8000eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/fast/9900eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/fast/9900eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/fast/9900eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/fast/9900eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/highgain/11200eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/highgain/11200eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/highgain/11200eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/highgain/11200eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/highgain/4500eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/highgain/4500eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/highgain/4500eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/highgain/4500eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/highgain/5400eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/highgain/5400eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/highgain/5400eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/highgain/5400eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/highgain/6400eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/highgain/6400eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/highgain/6400eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/highgain/6400eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/highgain/8000eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/highgain/8000eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/highgain/8000eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/highgain/8000eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/highgain/9900eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/highgain/9900eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/highgain/9900eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/highgain/9900eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/standard/11200eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/standard/11200eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/standard/11200eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/standard/11200eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/standard/4500eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/standard/4500eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/standard/4500eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/standard/4500eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/standard/5400eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/standard/5400eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/standard/5400eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/standard/5400eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/standard/6400eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/standard/6400eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/standard/6400eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/standard/6400eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/standard/8000eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/standard/8000eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/standard/8000eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/standard/8000eV/trim.snxxxx
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/standard/9900eV/trim.sn0000
Normal file
BIN
settingsdir/mythen3/standard/9900eV/trim.sn0000
Normal file
Binary file not shown.
BIN
settingsdir/mythen3/standard/9900eV/trim.snxxxx
Normal file
BIN
settingsdir/mythen3/standard/9900eV/trim.snxxxx
Normal file
Binary file not shown.
156
slsDetectorCalibration/circularFifo.h
Normal file
156
slsDetectorCalibration/circularFifo.h
Normal file
@ -0,0 +1,156 @@
|
||||
#pragma once
|
||||
/* CircularFifo.h
|
||||
* Code & platform dependent issues with it was originally
|
||||
* published at http://www.kjellkod.cc/threadsafecircularqueue
|
||||
* 2009-11-02
|
||||
* @author Kjell Hedstr<74>m, hedstrom@kjellkod.cc
|
||||
* modified by the sls detetor group
|
||||
* */
|
||||
|
||||
//#include "sls_receiver_defs.h"
|
||||
#include <semaphore.h>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
typedef double double32_t;
|
||||
typedef float float32_t;
|
||||
typedef int int32_t;
|
||||
|
||||
|
||||
|
||||
/** Circular Fifo (a.k.a. Circular Buffer)
|
||||
* Thread safe for one reader, and one writer */
|
||||
template<typename Element>
|
||||
class CircularFifo {
|
||||
public:
|
||||
|
||||
CircularFifo(unsigned int Size) : tail(0), head(0){
|
||||
Capacity = Size + 1;
|
||||
array.resize(Capacity);
|
||||
sem_init(&data_mutex,0,0);
|
||||
sem_init(&free_mutex,0,Size);
|
||||
}
|
||||
virtual ~CircularFifo() {
|
||||
sem_destroy(&data_mutex);
|
||||
sem_destroy(&free_mutex);
|
||||
}
|
||||
|
||||
bool push(Element*& item_, bool no_block=false);
|
||||
bool pop(Element*& item_, bool no_block=false);
|
||||
|
||||
bool isEmpty() const;
|
||||
bool isFull() const;
|
||||
|
||||
int getDataValue() const;
|
||||
int getFreeValue() const;
|
||||
|
||||
private:
|
||||
std::vector <Element*> array;
|
||||
unsigned int tail; // input index
|
||||
unsigned int head; // output index
|
||||
unsigned int Capacity;
|
||||
mutable sem_t data_mutex;
|
||||
mutable sem_t free_mutex;
|
||||
unsigned int increment(unsigned int idx_) const;
|
||||
};
|
||||
|
||||
template<typename Element>
|
||||
int CircularFifo<Element>::getDataValue() const
|
||||
{
|
||||
int value;
|
||||
sem_getvalue(&data_mutex, &value);
|
||||
return value;
|
||||
}
|
||||
|
||||
template<typename Element>
|
||||
int CircularFifo<Element>::getFreeValue() const
|
||||
{
|
||||
int value;
|
||||
sem_getvalue(&free_mutex, &value);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/** Producer only: Adds item to the circular queue.
|
||||
* If queue is full at 'push' operation no update/overwrite
|
||||
* will happen, it is up to the caller to handle this case
|
||||
*
|
||||
* \param item_ copy by reference the input item
|
||||
* \param no_block if true, return immediately if fifo is full
|
||||
* \return whether operation was successful or not */
|
||||
template<typename Element>
|
||||
bool CircularFifo<Element>::push(Element*& item_, bool no_block)
|
||||
{
|
||||
// check for fifo full
|
||||
if (no_block && isFull())
|
||||
return false;
|
||||
|
||||
sem_wait(&free_mutex);
|
||||
array[tail] = item_;
|
||||
tail = increment(tail);
|
||||
sem_post(&data_mutex);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Consumer only: Removes and returns item from the queue
|
||||
* If queue is empty at 'pop' operation no retrieve will happen
|
||||
* It is up to the caller to handle this case
|
||||
*
|
||||
* \param item_ return by reference the wanted item
|
||||
* \param no_block if true, return immediately if fifo is full
|
||||
* \return whether operation was successful or not */
|
||||
template<typename Element>
|
||||
bool CircularFifo<Element>::pop(Element*& item_, bool no_block)
|
||||
{
|
||||
// check for fifo empty
|
||||
if (no_block && isEmpty())
|
||||
return false;
|
||||
|
||||
sem_wait(&data_mutex);
|
||||
item_ = array[head];
|
||||
head = increment(head);
|
||||
sem_post(&free_mutex);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Useful for testinng and Consumer check of status
|
||||
* Remember that the 'empty' status can change quickly
|
||||
* as the Procuder adds more items.
|
||||
*
|
||||
* \return true if circular buffer is empty */
|
||||
template<typename Element>
|
||||
bool CircularFifo<Element>::isEmpty() const
|
||||
{
|
||||
return (getDataValue() == 0);
|
||||
}
|
||||
|
||||
/** Useful for testing and Producer check of status
|
||||
* Remember that the 'full' status can change quickly
|
||||
* as the Consumer catches up.
|
||||
*
|
||||
* \return true if circular buffer is full. */
|
||||
template<typename Element>
|
||||
bool CircularFifo<Element>::isFull() const
|
||||
{
|
||||
return (getFreeValue() == 0);
|
||||
}
|
||||
|
||||
/** Increment helper function for index of the circular queue
|
||||
* index is inremented or wrapped
|
||||
*
|
||||
* \param idx_ the index to the incremented/wrapped
|
||||
* \return new value for the index */
|
||||
template<typename Element>
|
||||
unsigned int CircularFifo<Element>::increment(unsigned int idx_) const
|
||||
{
|
||||
// increment or wrap
|
||||
// =================
|
||||
// index++;
|
||||
// if(index == array.lenght) -> index = 0;
|
||||
//
|
||||
//or as written below:
|
||||
// index = (index+1) % array.length
|
||||
idx_ = (idx_+1) % Capacity;
|
||||
return idx_;
|
||||
}
|
||||
|
@ -0,0 +1,238 @@
|
||||
#ifndef JUNGFRAUHIGHZSINGLECHIPDATA_H
|
||||
#define JUNGFRAUHIGHZSINGLECHIPDATA_H
|
||||
#include "slsDetectorData.h"
|
||||
|
||||
//#define VERSION_V2
|
||||
/**
|
||||
@short structure for a Detector Packet or Image Header
|
||||
@li frameNumber is the frame number
|
||||
@li expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others)
|
||||
@li packetNumber is the packet number
|
||||
@li bunchId is the bunch id from beamline
|
||||
@li timestamp is the time stamp with 10 MHz clock
|
||||
@li modId is the unique module id (unique even for left, right, top, bottom)
|
||||
@li xCoord is the x coordinate in the complete detector system
|
||||
@li yCoord is the y coordinate in the complete detector system
|
||||
@li zCoord is the z coordinate in the complete detector system
|
||||
@li debug is for debugging purposes
|
||||
@li roundRNumber is the round robin set number
|
||||
@li detType is the detector type see :: detectorType
|
||||
@li version is the version number of this structure format
|
||||
*/
|
||||
typedef struct {
|
||||
uint64_t bunchNumber; /**< is the frame number */
|
||||
uint64_t pre; /**< something */
|
||||
|
||||
} jf_header;
|
||||
|
||||
|
||||
|
||||
|
||||
class jungfrauHighZSingleChipData : public slsDetectorData<uint16_t> {
|
||||
|
||||
private:
|
||||
|
||||
int iframe;
|
||||
public:
|
||||
/**
|
||||
Implements the slsReceiverData structure for the moench02 prototype read out by a module i.e. using the slsReceiver
|
||||
(160x160 pixels, 40 packets 1286 large etc.)
|
||||
\param c crosstalk parameter for the output buffer
|
||||
|
||||
*/
|
||||
jungfrauHighZSingleChipData(): slsDetectorData<uint16_t>(256, 256, 256*256*2+sizeof(jf_header)) {
|
||||
|
||||
|
||||
for (int ix=0; ix<256; ix++) {
|
||||
for (int iy=0; iy<256; iy++) {
|
||||
dataMap[iy][ix]=sizeof(jf_header)+(256*iy+ix)*2;
|
||||
#ifdef HIGHZ
|
||||
dataMask[iy][ix]=0x3fff;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
iframe=0;
|
||||
// cout << "data struct created" << endl;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Returns the value of the selected channel for the given dataset as double.
|
||||
\param data pointer to the dataset (including headers etc)
|
||||
\param ix pixel number in the x direction
|
||||
\param iy pixel number in the y direction
|
||||
\returns data for the selected channel, with inversion if required as double
|
||||
|
||||
*/
|
||||
virtual double getValue(char *data, int ix, int iy=0) {
|
||||
|
||||
uint16_t val=getChannel(data, ix, iy)&0x3fff;
|
||||
return val;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* virtual void calcGhost(char *data, int ix, int iy) { */
|
||||
/* double val=0; */
|
||||
/* ghost[iy][ix]=0; */
|
||||
|
||||
/* } */
|
||||
|
||||
|
||||
|
||||
/* virtual void calcGhost(char *data) { */
|
||||
/* for (int ix=0; ix<25; ix++){ */
|
||||
/* for (int iy=0; iy<200; iy++) { */
|
||||
/* calcGhost(data, ix,iy); */
|
||||
/* } */
|
||||
/* } */
|
||||
/* // cout << "*" << endl; */
|
||||
/* } */
|
||||
|
||||
|
||||
/* double getGhost(int ix, int iy) { */
|
||||
/* return 0; */
|
||||
/* }; */
|
||||
|
||||
/**
|
||||
|
||||
Returns the frame number for the given dataset. Purely virtual func.
|
||||
\param buff pointer to the dataset
|
||||
\returns frame number
|
||||
|
||||
*/
|
||||
|
||||
/* class jfrau_packet_header_t { */
|
||||
/* public: */
|
||||
/* unsigned char reserved[4]; */
|
||||
/* unsigned char packetNumber[1]; */
|
||||
/* unsigned char frameNumber[3]; */
|
||||
/* unsigned char bunchid[8]; */
|
||||
/* }; */
|
||||
|
||||
|
||||
|
||||
int getFrameNumber(char *buff){return ((jf_header*)buff)->bunchNumber;};//*((int*)(buff+5))&0xffffff;};
|
||||
|
||||
/**
|
||||
|
||||
Returns the packet number for the given dataset. purely virtual func
|
||||
\param buff pointer to the dataset
|
||||
\returns packet number number
|
||||
|
||||
|
||||
|
||||
*/
|
||||
int getPacketNumber(char *buff){return 0;}//((*(((int*)(buff+4))))&0xff)+1;};
|
||||
|
||||
/* /\** */
|
||||
|
||||
/* Loops over a memory slot until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). purely virtual func */
|
||||
/* \param data pointer to the memory to be analyzed */
|
||||
/* \param ndata reference to the amount of data found for the frame, in case the frame is incomplete at the end of the memory slot */
|
||||
/* \param dsize size of the memory slot to be analyzed */
|
||||
/* \returns pointer to the beginning of the last good frame (might be incomplete if ndata smaller than dataSize), or NULL if no frame is found */
|
||||
|
||||
/* *\/ */
|
||||
/* virtual char *findNextFrame(char *data, int &ndata, int dsize){ndata=dsize; setDataSize(dsize); return data;}; */
|
||||
|
||||
|
||||
/* /\** */
|
||||
|
||||
/* Loops over a file stream until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). Can be overloaded for different kind of detectors! */
|
||||
/* \param filebin input file stream (binary) */
|
||||
/* \returns pointer to the begin of the last good frame, NULL if no frame is found or last frame is incomplete */
|
||||
|
||||
/* *\/ */
|
||||
/* virtual char *readNextFrame(ifstream &filebin){ */
|
||||
/* // int afifo_length=0; */
|
||||
/* uint16_t *afifo_cont; */
|
||||
/* int ib=0; */
|
||||
/* if (filebin.is_open()) { */
|
||||
/* afifo_cont=new uint16_t[dataSize/2]; */
|
||||
/* while (filebin.read(((char*)afifo_cont)+ib,2)) { */
|
||||
/* ib+=2; */
|
||||
/* if (ib==dataSize) break; */
|
||||
/* } */
|
||||
/* if (ib>0) { */
|
||||
/* iframe++; */
|
||||
/* // cout << ib << "-" << endl; */
|
||||
/* return (char*)afifo_cont; */
|
||||
/* } else { */
|
||||
/* delete [] afifo_cont; */
|
||||
/* return NULL; */
|
||||
/* } */
|
||||
/* } */
|
||||
/* return NULL; */
|
||||
/* }; */
|
||||
|
||||
|
||||
virtual char *readNextFrame(ifstream &filebin) {
|
||||
int ff=-1, np=-1;
|
||||
return readNextFrame(filebin, ff, np);
|
||||
};
|
||||
|
||||
virtual char *readNextFrame(ifstream &filebin, int &ff) {
|
||||
int np=-1;
|
||||
return readNextFrame(filebin, ff, np);
|
||||
};
|
||||
|
||||
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np) {
|
||||
char *data=new char[dataSize];
|
||||
char *d=readNextFrame(filebin, ff, np, data);
|
||||
if (d==NULL) {delete [] data; data=NULL;}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np, char *data) {
|
||||
char *retval=0;
|
||||
int nd;
|
||||
int fnum = -1;
|
||||
np=0;
|
||||
int pn;
|
||||
|
||||
// cout << dataSize << endl;
|
||||
if (ff>=0)
|
||||
fnum=ff;
|
||||
|
||||
if (filebin.is_open()) {
|
||||
if (filebin.read(data, dataSize) ){
|
||||
ff=getFrameNumber(data);
|
||||
np=getPacketNumber(data);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Loops over a memory slot until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). purely virtual func
|
||||
\param data pointer to the memory to be analyzed
|
||||
\param ndata reference to the amount of data found for the frame, in case the frame is incomplete at the end of the memory slot
|
||||
\param dsize size of the memory slot to be analyzed
|
||||
\returns pointer to the beginning of the last good frame (might be incomplete if ndata smaller than dataSize), or NULL if no frame is found
|
||||
|
||||
*/
|
||||
virtual char *findNextFrame(char *data, int &ndata, int dsize){
|
||||
if (dsize<dataSize) ndata=dsize;
|
||||
else ndata=dataSize;
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
//int getPacketNumber(int x, int y) {return dataMap[y][x]/packetSize;};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -14,6 +14,8 @@ class moench03T1ZmqDataNew : public slsDetectorData<uint16_t> {
|
||||
const int nSamples;
|
||||
const int offset;
|
||||
|
||||
|
||||
|
||||
double ghost[200][25];
|
||||
double xtalk;
|
||||
|
||||
@ -29,17 +31,22 @@ class moench03T1ZmqDataNew : public slsDetectorData<uint16_t> {
|
||||
|
||||
*/
|
||||
// moench03T1ZmqDataNew(int ns=5000): slsDetectorData<uint16_t>(400, 400, ns*32*2+sizeof(int)), nSamples(ns), offset(sizeof(int)), xtalk(0.00021) {
|
||||
moench03T1ZmqDataNew(int ns=5000, int oo=0): slsDetectorData<uint16_t>(400, 400, ns*32*2+oo), nSamples(ns), offset(oo), xtalk(0.00021) {
|
||||
|
||||
moench03T1ZmqDataNew(int ns=5000, int oo=2*2): slsDetectorData<uint16_t>(400, 400, ns*32*2+oo), nSamples(ns), offset(oo), xtalk(0.00021) {
|
||||
cout << "M0.3" << endl;
|
||||
int nadc=32;
|
||||
int sc_width=25;
|
||||
int sc_height=200;
|
||||
|
||||
int adc_nr[32]={300,325,350,375,300,325,350,375, \
|
||||
|
||||
int adc_nr[32]={300,325,350,375,300,325,350,375, \
|
||||
200,225,250,275,200,225,250,275,\
|
||||
100,125,150,175,100,125,150,175,\
|
||||
0,25,50,75,0,25,50,75};
|
||||
|
||||
|
||||
/* int adc_nr[32]={350,375,150,175,350,375,150,175, \
|
||||
300,325,100,125,300,325,100,125,\
|
||||
250,275,50,75,250,275,50,75,\
|
||||
200,225,0,25,200,225,0,25};
|
||||
*/
|
||||
int row, col;
|
||||
|
||||
int isample;
|
||||
@ -50,11 +57,11 @@ class moench03T1ZmqDataNew : public slsDetectorData<uint16_t> {
|
||||
int i;
|
||||
int adc4(0);
|
||||
|
||||
for (int ip=0; ip<npackets; ip++) {
|
||||
for (int is=0; is<128; is++) {
|
||||
|
||||
//for (int ip=0; ip<npackets; ip++) {
|
||||
// for (int is=0; is<128; is++) {
|
||||
for (i=0; i<nSamples; i++) {
|
||||
for (iadc=0; iadc<nadc; iadc++) {
|
||||
i=128*ip+is;
|
||||
//i=128*ip+is;
|
||||
adc4=(int)iadc/4;
|
||||
if (i<sc_width*sc_height) {
|
||||
// for (int i=0; i<sc_width*sc_height; i++) {
|
||||
@ -70,7 +77,7 @@ class moench03T1ZmqDataNew : public slsDetectorData<uint16_t> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
int ii=0;
|
||||
|
798
slsDetectorCalibration/energyCalibration.cpp
Normal file
798
slsDetectorCalibration/energyCalibration.cpp
Normal file
@ -0,0 +1,798 @@
|
||||
#include "energyCalibration.h"
|
||||
|
||||
#ifdef __CINT
|
||||
#define MYROOT
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef MYROOT
|
||||
#include <TMath.h>
|
||||
#include <TH1F.h>
|
||||
#include <TH2F.h>
|
||||
#include <TGraphErrors.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#define max(a,b) ((a) > (b) ? (a) : (b))
|
||||
#define min(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define ELEM_SWAP(a,b) { register int t=(a);(a)=(b);(b)=t; }
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
#ifdef MYROOT
|
||||
|
||||
Double_t energyCalibrationFunctions::pedestal(Double_t *x, Double_t *par) {
|
||||
return par[0]-par[1]*sign*x[0];
|
||||
}
|
||||
|
||||
|
||||
Double_t energyCalibrationFunctions::gaussChargeSharing(Double_t *x, Double_t *par) {
|
||||
Double_t f, arg=0;
|
||||
// Gaussian exponent
|
||||
if (par[3]!=0) {
|
||||
arg=sign*(x[0]-par[2])/par[3];
|
||||
}
|
||||
// the Gaussian
|
||||
f=TMath::Exp(-1*arg*arg/2.);
|
||||
// Gaussian + error function
|
||||
f=f+par[5]/2.*(TMath::Erfc(arg/(TMath::Sqrt(2.))));
|
||||
// Gaussian + error function + pedestal
|
||||
return par[4]*f+pedestal(x,par);
|
||||
}
|
||||
|
||||
Double_t energyCalibrationFunctions::gaussChargeSharingKb(Double_t *x, Double_t *par) {
|
||||
Double_t f, arg=0,argb=0;
|
||||
// Gaussian exponent
|
||||
if (par[3]!=0) {
|
||||
arg=sign*(x[0]-par[2])/par[3];
|
||||
argb=sign*(x[0]-(par[6]*par[2]))/par[3]; // using absolute kb mean might seem better but like this the ratio can be fixed
|
||||
}
|
||||
// the Gaussian
|
||||
f=TMath::Exp(-1*arg*arg/2.);
|
||||
f=f+par[7]*(TMath::Exp(-1*argb*argb/2.));
|
||||
// Gaussian + error function
|
||||
f=f+par[5]/2.*(TMath::Erfc(arg/(TMath::Sqrt(2.))));
|
||||
f=f+par[7]*par[5]/2.*(TMath::Erfc(argb/(TMath::Sqrt(2.))));
|
||||
// Gaussian + error function + pedestal
|
||||
return par[4]*f+pedestal(x,par);
|
||||
}
|
||||
|
||||
Double_t energyCalibrationFunctions::gaussChargeSharingKaDoublet(Double_t *x, Double_t *par) {
|
||||
Double_t f, f2, arg=0, arg2=0;
|
||||
// Gaussian exponent
|
||||
if (par[3]!=0) {
|
||||
arg=sign*(x[0]-par[2])/par[3];
|
||||
arg2=sign*(x[0]-par[6])/par[3];
|
||||
}
|
||||
// the Gaussian
|
||||
f=TMath::Exp(-1*arg*arg/2.);
|
||||
f2=TMath::Exp(-1*arg2*arg2/2.);
|
||||
// Gaussian + error function
|
||||
f=f+par[5]/2.*(TMath::Erfc(arg/(TMath::Sqrt(2.))));
|
||||
f2=f2+par[5]/2.*(TMath::Erfc(arg/(TMath::Sqrt(2.)))); // shouldn't this be arg2?
|
||||
// Gaussian + error function + pedestal
|
||||
return par[4]*f+par[7]*f2+pedestal(x,par);
|
||||
}
|
||||
|
||||
Double_t energyCalibrationFunctions::gaussChargeSharingPixel(Double_t *x, Double_t *par) {
|
||||
Double_t f;
|
||||
if (par[3]<=0 || par[2]*(*x)<=0 || par[5]<0 || par[4]<=0) return 0;
|
||||
|
||||
Double_t pp[3];
|
||||
|
||||
pp[0]=0;
|
||||
pp[1]=par[2];
|
||||
pp[2]=par[3];
|
||||
|
||||
|
||||
f=(par[5]-par[6]*(TMath::Log(*x/par[2])))*erfBox(x,pp);
|
||||
f+=par[4]*TMath::Gaus(*x, par[2], par[3], kTRUE);
|
||||
return f+pedestal(x,par);
|
||||
}
|
||||
|
||||
Double_t energyCalibrationFunctions::erfBox(Double_t *z, Double_t *par) {
|
||||
|
||||
|
||||
|
||||
Double_t m=par[0];
|
||||
Double_t M=par[1];
|
||||
|
||||
if (par[0]>par[1]) {
|
||||
m=par[1];
|
||||
M=par[0];
|
||||
}
|
||||
|
||||
if (m==M)
|
||||
return 0;
|
||||
|
||||
|
||||
if (par[2]<=0) {
|
||||
if (*z>=m && *z<=M)
|
||||
return 1./(M-m);
|
||||
else
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
return (TMath::Erfc((z[0]-M)/par[2])-TMath::Erfc((z[0]-m)/par[2]))*0.5/(M-m);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// basic erf function
|
||||
Double_t energyCalibrationFunctions::erfFunction(Double_t *x, Double_t *par) {
|
||||
double arg=0;
|
||||
if (par[1]!=0) arg=(par[0]-x[0])/par[1];
|
||||
return ((par[2]/2.*(1+TMath::Erf(sign*arg/(TMath::Sqrt(2))))));
|
||||
};
|
||||
|
||||
|
||||
Double_t energyCalibrationFunctions::erfFunctionChargeSharing(Double_t *x, Double_t *par) {
|
||||
Double_t f;
|
||||
|
||||
f=erfFunction(x, par+2)*(1+par[5]*(par[2]-x[0]))+par[0]-par[1]*x[0]*sign;
|
||||
return f;
|
||||
};
|
||||
|
||||
|
||||
Double_t energyCalibrationFunctions::erfFuncFluo(Double_t *x, Double_t *par) {
|
||||
Double_t f;
|
||||
f=erfFunctionChargeSharing(x, par)+erfFunction(x, par+6)*(1+par[9]*(par[6]-x[0]));
|
||||
return f;
|
||||
};
|
||||
#endif
|
||||
|
||||
double energyCalibrationFunctions::median(double *x, int n){
|
||||
// sorts x into xmed array and returns median
|
||||
// n is number of values already in the xmed array
|
||||
double xmed[n];
|
||||
int k,i,j;
|
||||
|
||||
for (i=0; i<n; i++) {
|
||||
k=0;
|
||||
for (j=0; j<n; j++) {
|
||||
if(*(x+i)>*(x+j))
|
||||
k++;
|
||||
if (*(x+i)==*(x+j)) {
|
||||
if (i>j)
|
||||
k++;
|
||||
}
|
||||
}
|
||||
xmed[k]=*(x+i);
|
||||
}
|
||||
k=n/2;
|
||||
return xmed[k];
|
||||
}
|
||||
|
||||
|
||||
int energyCalibrationFunctions::quick_select(int arr[], int n){
|
||||
int low, high ;
|
||||
int median;
|
||||
int middle, ll, hh;
|
||||
|
||||
low = 0 ; high = n-1 ; median = (low + high) / 2;
|
||||
for (;;) {
|
||||
if (high <= low) /* One element only */
|
||||
return arr[median] ;
|
||||
|
||||
if (high == low + 1) { /* Two elements only */
|
||||
if (arr[low] > arr[high])
|
||||
ELEM_SWAP(arr[low], arr[high]) ;
|
||||
return arr[median] ;
|
||||
}
|
||||
|
||||
/* Find median of low, middle and high items; swap into position low */
|
||||
middle = (low + high) / 2;
|
||||
if (arr[middle] > arr[high]) ELEM_SWAP(arr[middle], arr[high]) ;
|
||||
if (arr[low] > arr[high]) ELEM_SWAP(arr[low], arr[high]) ;
|
||||
if (arr[middle] > arr[low]) ELEM_SWAP(arr[middle], arr[low]) ;
|
||||
|
||||
/* Swap low item (now in position middle) into position (low+1) */
|
||||
ELEM_SWAP(arr[middle], arr[low+1]) ;
|
||||
|
||||
/* Nibble from each end towards middle, swapping items when stuck */
|
||||
ll = low + 1;
|
||||
hh = high;
|
||||
for (;;) {
|
||||
do ll++; while (arr[low] > arr[ll]) ;
|
||||
do hh--; while (arr[hh] > arr[low]) ;
|
||||
|
||||
if (hh < ll)
|
||||
break;
|
||||
|
||||
ELEM_SWAP(arr[ll], arr[hh]) ;
|
||||
}
|
||||
|
||||
/* Swap middle item (in position low) back into correct position */
|
||||
ELEM_SWAP(arr[low], arr[hh]) ;
|
||||
|
||||
/* Re-set active partition */
|
||||
if (hh <= median)
|
||||
low = ll;
|
||||
if (hh >= median)
|
||||
high = hh - 1;
|
||||
}
|
||||
}
|
||||
|
||||
int energyCalibrationFunctions::kth_smallest(int *a, int n, int k){
|
||||
register int i,j,l,m ;
|
||||
register double x ;
|
||||
|
||||
l=0 ; m=n-1 ;
|
||||
while (l<m) {
|
||||
x=a[k] ;
|
||||
i=l ;
|
||||
j=m ;
|
||||
do {
|
||||
while (a[i]<x) i++ ;
|
||||
while (x<a[j]) j-- ;
|
||||
if (i<=j) {
|
||||
ELEM_SWAP(a[i],a[j]) ;
|
||||
i++ ; j-- ;
|
||||
}
|
||||
} while (i<=j) ;
|
||||
if (j<k) l=i ;
|
||||
if (k<i) m=j ;
|
||||
}
|
||||
return a[k] ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef MYROOT
|
||||
Double_t energyCalibrationFunctions::spectrum(Double_t *x, Double_t *par) {
|
||||
return gaussChargeSharing(x,par);
|
||||
}
|
||||
|
||||
Double_t energyCalibrationFunctions::spectrumkb(Double_t *x, Double_t *par) {
|
||||
return gaussChargeSharingKb(x,par);
|
||||
}
|
||||
|
||||
Double_t energyCalibrationFunctions::spectrumkadoublet(Double_t *x, Double_t *par) {
|
||||
return gaussChargeSharingKaDoublet(x,par);
|
||||
}
|
||||
|
||||
Double_t energyCalibrationFunctions::spectrumPixel(Double_t *x, Double_t *par) {
|
||||
return gaussChargeSharingPixel(x,par);
|
||||
}
|
||||
|
||||
|
||||
Double_t energyCalibrationFunctions::scurve(Double_t *x, Double_t *par) {
|
||||
return erfFunctionChargeSharing(x,par);
|
||||
}
|
||||
|
||||
|
||||
Double_t energyCalibrationFunctions::scurveFluo(Double_t *x, Double_t *par) {
|
||||
return erfFuncFluo(x,par);
|
||||
}
|
||||
#endif
|
||||
|
||||
energyCalibration::energyCalibration() :
|
||||
#ifdef MYROOT
|
||||
fit_min(-1),
|
||||
fit_max(-1),
|
||||
bg_offset(-1),
|
||||
bg_slope(-1),
|
||||
flex(-1),
|
||||
noise(-1),
|
||||
ampl(-1),
|
||||
cs_slope(-1),
|
||||
kb_mean(-1),
|
||||
kb_frac(-1),
|
||||
mean2(-1),
|
||||
ampl2(-1),
|
||||
fscurve(NULL),
|
||||
fspectrum(NULL),
|
||||
fspectrumkb(NULL),
|
||||
fspectrumkadoublet(NULL),
|
||||
#endif
|
||||
funcs(NULL),
|
||||
plot_flag(1), // fit parameters output to screen
|
||||
cs_flag(1)
|
||||
{
|
||||
|
||||
#ifdef MYROOT
|
||||
funcs=new energyCalibrationFunctions();
|
||||
|
||||
fscurve=new TF1("fscurve",funcs,&energyCalibrationFunctions::scurve,0,1000,6,"energyCalibrationFunctions","scurve");
|
||||
fscurve->SetParNames("Background Offset","Background Slope","Inflection Point","Noise RMS", "Number of Photons","Charge Sharing Slope");
|
||||
|
||||
fspectrum=new TF1("fspectrum",funcs,&energyCalibrationFunctions::spectrum,0,1000,6,"energyCalibrationFunctions","spectrum");
|
||||
fspectrum->SetParNames("Background Pedestal","Background slope", "Peak position","Noise RMS", "Number of Photons","Charge Sharing Pedestal");
|
||||
fspectrumkb=new TF1("fspectrumkb",funcs,&energyCalibrationFunctions::spectrumkb,0,1000,8,"energyCalibrationFunctions","spectrumkb");
|
||||
fspectrumkb->SetParNames("Background Pedestal","Background slope", "Peak position","Noise RMS", "Number of Photons","Charge Sharing Pedestal","kb mean","kb frac");
|
||||
|
||||
fspectrumkadoublet=new TF1("fspectrumkadoublet",funcs,&energyCalibrationFunctions::spectrumkadoublet,0,1000,8,"energyCalibrationFunctions","spectrumkadoublet");
|
||||
fspectrumkadoublet->SetParNames("Background Pedestal","Background slope", "Peak position","Noise RMS", "Number of Photons","Charge Sharing Pedestal","ka2 mean","n2");
|
||||
|
||||
fspixel=new TF1("fspixel",funcs,&energyCalibrationFunctions::spectrumPixel,0,1000,7,"energyCalibrationFunctions","spectrumPixel");
|
||||
fspixel->SetParNames("Background Pedestal","Background slope", "Peak position","Noise RMS", "Number of Photons","Charge Sharing Pedestal","Corner");
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void energyCalibration::fixParameter(int ip, Double_t val){
|
||||
|
||||
fscurve->FixParameter(ip, val);
|
||||
fspectrum->FixParameter(ip, val);
|
||||
fspectrumkb->FixParameter(ip, val);
|
||||
fspectrumkadoublet->FixParameter(ip, val);
|
||||
}
|
||||
|
||||
|
||||
void energyCalibration::releaseParameter(int ip){
|
||||
|
||||
fscurve->ReleaseParameter(ip);
|
||||
fspectrum->ReleaseParameter(ip);
|
||||
fspectrumkb->ReleaseParameter(ip);
|
||||
fspectrumkadoublet->ReleaseParameter(ip);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
energyCalibration::~energyCalibration(){
|
||||
#ifdef MYROOT
|
||||
delete fscurve;
|
||||
delete fspectrum;
|
||||
delete fspectrumkb;
|
||||
delete fspectrumkadoublet;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#ifdef MYROOT
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TH1F* energyCalibration::createMedianHistogram(TH2F* h2, int ch0, int nch, int direction) {
|
||||
|
||||
if (h2==NULL || nch==0)
|
||||
return NULL;
|
||||
|
||||
double *x=new double[nch];
|
||||
TH1F *h1=NULL;
|
||||
|
||||
double val=-1;
|
||||
|
||||
if (direction==0) {
|
||||
h1=new TH1F("median","Median",h2->GetYaxis()->GetNbins(),h2->GetYaxis()->GetXmin(),h2->GetYaxis()->GetXmax());
|
||||
for (int ib=0; ib<h1->GetXaxis()->GetNbins(); ib++) {
|
||||
for (int ich=0; ich<nch; ich++) {
|
||||
x[ich]=h2->GetBinContent(ch0+ich+1,ib+1);
|
||||
}
|
||||
val=energyCalibrationFunctions::median(x, nch);
|
||||
h1->SetBinContent(ib+1,val);
|
||||
}
|
||||
} else if (direction==1) {
|
||||
h1=new TH1F("median","Median",h2->GetXaxis()->GetNbins(),h2->GetXaxis()->GetXmin(),h2->GetXaxis()->GetXmax());
|
||||
for (int ib=0; ib<h1->GetYaxis()->GetNbins(); ib++) {
|
||||
for (int ich=0; ich<nch; ich++) {
|
||||
x[ich]=h2->GetBinContent(ib+1,ch0+ich+1);
|
||||
}
|
||||
val=energyCalibrationFunctions::median(x, nch);
|
||||
h1->SetBinContent(ib+1,val);
|
||||
}
|
||||
}
|
||||
delete [] x;
|
||||
|
||||
return h1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void energyCalibration::setStartParameters(Double_t *par){
|
||||
bg_offset=par[0];
|
||||
bg_slope=par[1];
|
||||
flex=par[2];
|
||||
noise=par[3];
|
||||
ampl=par[4];
|
||||
cs_slope=par[5];
|
||||
}
|
||||
|
||||
void energyCalibration::setStartParametersKb(Double_t *par){
|
||||
bg_offset=par[0];
|
||||
bg_slope=par[1];
|
||||
flex=par[2];
|
||||
noise=par[3];
|
||||
ampl=par[4];
|
||||
cs_slope=par[5];
|
||||
kb_mean=par[6];
|
||||
kb_frac=par[7];
|
||||
//fit_min = 400; // used for soleil flat field
|
||||
//fit_max = 800;
|
||||
}
|
||||
|
||||
void energyCalibration::setStartParametersKaDoublet(Double_t *par){
|
||||
bg_offset=par[0];
|
||||
bg_slope=par[1];
|
||||
flex=par[2];
|
||||
noise=par[3];
|
||||
ampl=par[4];
|
||||
cs_slope=par[5];
|
||||
mean2=par[6];
|
||||
ampl2=par[7];
|
||||
//fit_min = 400; // used for soleil flat field
|
||||
//fit_max = 800;
|
||||
}
|
||||
|
||||
|
||||
void energyCalibration::getStartParameters(Double_t *par){
|
||||
par[0]=bg_offset;
|
||||
par[1]=bg_slope;
|
||||
par[2]=flex;
|
||||
par[3]=noise;
|
||||
par[4]=ampl;
|
||||
par[5]=cs_slope;
|
||||
}
|
||||
|
||||
#endif
|
||||
int energyCalibration::setChargeSharing(int p) {
|
||||
if (p>=0) {
|
||||
cs_flag=p;
|
||||
#ifdef MYROOT
|
||||
if (p) {
|
||||
fscurve->ReleaseParameter(5);
|
||||
fspectrum->ReleaseParameter(1);
|
||||
fspectrumkb->ReleaseParameter(1);
|
||||
fspectrumkadoublet->ReleaseParameter(1);
|
||||
} else {
|
||||
fscurve->FixParameter(5,0);
|
||||
fspectrum->FixParameter(1,0);
|
||||
fspectrumkb->FixParameter(1,0);
|
||||
fspectrumkadoublet->FixParameter(1,0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return cs_flag;
|
||||
}
|
||||
|
||||
|
||||
#ifdef MYROOT
|
||||
void energyCalibration::initFitFunction(TF1 *fun, TH1 *h1) {
|
||||
|
||||
Double_t min=fit_min, max=fit_max;
|
||||
|
||||
Double_t mypar[6];
|
||||
|
||||
if (max==-1)
|
||||
max=h1->GetXaxis()->GetXmax();
|
||||
|
||||
if (min==-1)
|
||||
min=h1->GetXaxis()->GetXmin();
|
||||
|
||||
|
||||
if (bg_offset==-1)
|
||||
mypar[0]=0;
|
||||
else
|
||||
mypar[0]=bg_offset;
|
||||
|
||||
|
||||
if (bg_slope==-1)
|
||||
mypar[1]=0;
|
||||
else
|
||||
mypar[1]=bg_slope;
|
||||
|
||||
|
||||
if (flex==-1)
|
||||
mypar[2]=(min+max)/2.;
|
||||
else
|
||||
mypar[2]=flex;
|
||||
|
||||
|
||||
if (noise==-1)
|
||||
mypar[3]=0.1;
|
||||
else
|
||||
mypar[3]=noise;
|
||||
|
||||
if (ampl==-1)
|
||||
mypar[4]=h1->GetBinContent(h1->GetXaxis()->FindBin(0.5*(max+min)));
|
||||
else
|
||||
mypar[4]=ampl;
|
||||
|
||||
if (cs_slope==-1)
|
||||
mypar[5]=0;
|
||||
else
|
||||
mypar[5]=cs_slope;
|
||||
|
||||
fun->SetParameters(mypar);
|
||||
|
||||
fun->SetRange(min,max);
|
||||
|
||||
}
|
||||
|
||||
void energyCalibration::initFitFunctionKb(TF1 *fun, TH1 *h1) {
|
||||
|
||||
Double_t min=fit_min, max=fit_max;
|
||||
|
||||
Double_t mypar[8];
|
||||
|
||||
if (max==-1)
|
||||
max=h1->GetXaxis()->GetXmax();
|
||||
|
||||
if (min==-1)
|
||||
min=h1->GetXaxis()->GetXmin();
|
||||
|
||||
|
||||
if (bg_offset==-1)
|
||||
mypar[0]=0;
|
||||
else
|
||||
mypar[0]=bg_offset;
|
||||
|
||||
|
||||
if (bg_slope==-1)
|
||||
mypar[1]=0;
|
||||
else
|
||||
mypar[1]=bg_slope;
|
||||
|
||||
|
||||
if (flex==-1)
|
||||
mypar[2]=(min+max)/2.;
|
||||
else
|
||||
mypar[2]=flex;
|
||||
|
||||
|
||||
if (noise==-1)
|
||||
mypar[3]=0.1;
|
||||
else
|
||||
mypar[3]=noise;
|
||||
|
||||
if (ampl==-1)
|
||||
mypar[4]=h1->GetBinContent(h1->GetXaxis()->FindBin(0.5*(max+min)));
|
||||
else
|
||||
mypar[4]=ampl;
|
||||
|
||||
if (cs_slope==-1)
|
||||
mypar[5]=0;
|
||||
else
|
||||
mypar[5]=cs_slope;
|
||||
|
||||
if (kb_mean==-1)
|
||||
mypar[6]=0;
|
||||
else
|
||||
mypar[6]=kb_mean;
|
||||
|
||||
if (kb_frac==-1)
|
||||
mypar[7]=0;
|
||||
else
|
||||
mypar[7]=kb_frac;
|
||||
|
||||
fun->SetParameters(mypar);
|
||||
|
||||
fun->SetRange(min,max);
|
||||
|
||||
}
|
||||
|
||||
void energyCalibration::initFitFunctionKaDoublet(TF1 *fun, TH1 *h1) {
|
||||
|
||||
Double_t min=fit_min, max=fit_max;
|
||||
|
||||
Double_t mypar[8];
|
||||
|
||||
if (max==-1)
|
||||
max=h1->GetXaxis()->GetXmax();
|
||||
|
||||
if (min==-1)
|
||||
min=h1->GetXaxis()->GetXmin();
|
||||
|
||||
|
||||
if (bg_offset==-1)
|
||||
mypar[0]=0;
|
||||
else
|
||||
mypar[0]=bg_offset;
|
||||
|
||||
|
||||
if (bg_slope==-1)
|
||||
mypar[1]=0;
|
||||
else
|
||||
mypar[1]=bg_slope;
|
||||
|
||||
|
||||
if (flex==-1)
|
||||
mypar[2]=(min+max)/2.;
|
||||
else
|
||||
mypar[2]=flex;
|
||||
|
||||
|
||||
if (noise==-1)
|
||||
mypar[3]=0.1;
|
||||
else
|
||||
mypar[3]=noise;
|
||||
|
||||
if (ampl==-1)
|
||||
mypar[4]=h1->GetBinContent(h1->GetXaxis()->FindBin(0.5*(max+min)));
|
||||
else
|
||||
mypar[4]=ampl;
|
||||
|
||||
if (cs_slope==-1)
|
||||
mypar[5]=0;
|
||||
else
|
||||
mypar[5]=cs_slope;
|
||||
|
||||
if (mean2==-1)
|
||||
mypar[6]=0;
|
||||
else
|
||||
mypar[6]=mean2;
|
||||
|
||||
if (ampl2==-1)
|
||||
mypar[7]=0;
|
||||
else
|
||||
mypar[7]=ampl2;
|
||||
|
||||
fun->SetParameters(mypar);
|
||||
|
||||
fun->SetRange(min,max);
|
||||
|
||||
}
|
||||
|
||||
TF1* energyCalibration::fitFunction(TF1 *fun, TH1 *h1, Double_t *mypar, Double_t *emypar) {
|
||||
|
||||
|
||||
TF1* fitfun;
|
||||
|
||||
char fname[100];
|
||||
|
||||
strcpy(fname, fun->GetName());
|
||||
|
||||
if (plot_flag) {
|
||||
h1->Fit(fname,"R0Q");
|
||||
} else
|
||||
h1->Fit(fname,"R0Q");
|
||||
|
||||
fitfun= h1->GetFunction(fname);
|
||||
fitfun->GetParameters(mypar);
|
||||
for (int ip=0; ip<6; ip++) {
|
||||
emypar[ip]=fitfun->GetParError(ip);
|
||||
}
|
||||
return fitfun;
|
||||
}
|
||||
|
||||
TF1* energyCalibration::fitFunctionKb(TF1 *fun, TH1 *h1, Double_t *mypar, Double_t *emypar) {
|
||||
|
||||
|
||||
TF1* fitfun;
|
||||
|
||||
char fname[100];
|
||||
|
||||
strcpy(fname, fun->GetName());
|
||||
|
||||
if (plot_flag) {
|
||||
h1->Fit(fname,"R0Q");
|
||||
} else
|
||||
h1->Fit(fname,"R0Q");
|
||||
|
||||
fitfun= h1->GetFunction(fname);
|
||||
fitfun->GetParameters(mypar);
|
||||
for (int ip=0; ip<8; ip++) {
|
||||
emypar[ip]=fitfun->GetParError(ip);
|
||||
}
|
||||
return fitfun;
|
||||
}
|
||||
|
||||
TF1* energyCalibration::fitFunctionKaDoublet(TF1 *fun, TH1 *h1, Double_t *mypar, Double_t *emypar) {
|
||||
|
||||
|
||||
TF1* fitfun;
|
||||
|
||||
char fname[100];
|
||||
|
||||
strcpy(fname, fun->GetName());
|
||||
|
||||
if (plot_flag) {
|
||||
h1->Fit(fname,"R0Q");
|
||||
} else
|
||||
h1->Fit(fname,"R0Q");
|
||||
|
||||
|
||||
fitfun= h1->GetFunction(fname);
|
||||
fitfun->GetParameters(mypar);
|
||||
for (int ip=0; ip<8; ip++) {
|
||||
emypar[ip]=fitfun->GetParError(ip);
|
||||
}
|
||||
return fitfun;
|
||||
}
|
||||
|
||||
TF1* energyCalibration::fitSCurve(TH1 *h1, Double_t *mypar, Double_t *emypar) {
|
||||
initFitFunction(fscurve,h1);
|
||||
return fitFunction(fscurve, h1, mypar, emypar);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
TF1* energyCalibration::fitSpectrum(TH1 *h1, Double_t *mypar, Double_t *emypar) {
|
||||
initFitFunction(fspectrum,h1);
|
||||
return fitFunction(fspectrum, h1, mypar, emypar);
|
||||
}
|
||||
|
||||
TF1* energyCalibration::fitSpectrumKb(TH1 *h1, Double_t *mypar, Double_t *emypar) {
|
||||
initFitFunctionKb(fspectrumkb,h1);
|
||||
return fitFunctionKb(fspectrumkb, h1, mypar, emypar);
|
||||
}
|
||||
|
||||
TF1* energyCalibration::fitSpectrumKaDoublet(TH1 *h1, Double_t *mypar, Double_t *emypar) {
|
||||
initFitFunctionKaDoublet(fspectrumkadoublet,h1);
|
||||
return fitFunctionKaDoublet(fspectrumkadoublet, h1, mypar, emypar);
|
||||
}
|
||||
|
||||
|
||||
TGraphErrors* energyCalibration::linearCalibration(int nscan, Double_t *en, Double_t *een, Double_t *fl, Double_t *efl, Double_t &gain, Double_t &off, Double_t &egain, Double_t &eoff) {
|
||||
|
||||
TGraphErrors *gr;
|
||||
|
||||
Double_t mypar[2];
|
||||
|
||||
gr = new TGraphErrors(nscan,en,fl,een,efl);
|
||||
|
||||
if (plot_flag) {
|
||||
gr->Fit("pol1");
|
||||
gr->SetMarkerStyle(20);
|
||||
} else
|
||||
gr->Fit("pol1","0Q");
|
||||
|
||||
TF1 *fitfun= gr->GetFunction("pol1");
|
||||
fitfun->GetParameters(mypar);
|
||||
|
||||
egain=fitfun->GetParError(1);
|
||||
eoff=fitfun->GetParError(0);
|
||||
|
||||
gain=funcs->setScanSign()*mypar[1];
|
||||
|
||||
off=mypar[0];
|
||||
|
||||
return gr;
|
||||
}
|
||||
|
||||
|
||||
TGraphErrors* energyCalibration::calibrate(int nscan, Double_t *en, Double_t *een, TH1F **h1, Double_t &gain, Double_t &off, Double_t &egain, Double_t &eoff, int integral) {
|
||||
|
||||
TH1F *h;
|
||||
|
||||
Double_t mypar[6], emypar[6];
|
||||
Double_t fl[nscan], efl[nscan];
|
||||
|
||||
|
||||
for (int ien=0; ien<nscan; ien++) {
|
||||
h=h1[ien];
|
||||
if (integral)
|
||||
fitSCurve(h,mypar,emypar);
|
||||
else
|
||||
fitSpectrum(h,mypar,emypar);
|
||||
|
||||
fl[ien]=mypar[2];
|
||||
efl[ien]=emypar[2];
|
||||
}
|
||||
return linearCalibration(nscan,en,een,fl,efl,gain,off, egain, eoff);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -98,6 +98,8 @@ class energyCalibrationFunctions {
|
||||
par[5] is the fractional height of the charge sharing pedestal (scales with par[3])
|
||||
*/
|
||||
Double_t gaussChargeSharing(Double_t *x, Double_t *par);
|
||||
Double_t gaussChargeSharingKb(Double_t *x, Double_t *par);
|
||||
Double_t gaussChargeSharingKaDoublet(Double_t *x, Double_t *par);
|
||||
/**
|
||||
Gaussian Function with charge sharing pedestal
|
||||
par[0] is the absolute height of the background pedestal
|
||||
@ -153,6 +155,8 @@ Double_t erfFuncFluo(Double_t *x, Double_t *par);
|
||||
par[5] is the fractional height of the charge sharing pedestal (scales with par[4]
|
||||
*/
|
||||
Double_t spectrum(Double_t *x, Double_t *par);
|
||||
Double_t spectrumkb(Double_t *x, Double_t *par);
|
||||
Double_t spectrumkadoublet(Double_t *x, Double_t *par);
|
||||
|
||||
/**
|
||||
static function Gaussian with charge sharing pedestal with the correct scan sign
|
||||
@ -285,7 +289,9 @@ class energyCalibration {
|
||||
par[5] is the angual coefficient of the charge sharing slope (scales with par[3]) -- always positive
|
||||
*/
|
||||
void setStartParameters(Double_t *par);
|
||||
|
||||
void setStartParametersKb(Double_t *par);
|
||||
void setStartParametersKaDoublet(Double_t *par);
|
||||
|
||||
/** get start parameters for the s-curve function
|
||||
\param par parameters, -1 means auto-calculated
|
||||
par[0] is the pedestal
|
||||
@ -315,16 +321,8 @@ class energyCalibration {
|
||||
\returns the fitted function - can be used e.g. to get the Chi2 or similar
|
||||
*/
|
||||
TF1 *fitSpectrum(TH1 *h1, Double_t *mypar, Double_t *emypar);
|
||||
|
||||
|
||||
/**
|
||||
fits histogram with the spectrum
|
||||
\param h1 1d-histogram to be fitted
|
||||
\param mypar pointer to fit parameters array
|
||||
\param emypar pointer to fit parameter errors
|
||||
\returns the fitted function - can be used e.g. to get the Chi2 or similar
|
||||
*/
|
||||
TF1 *fitSpectrumPixel(TH1 *h1, Double_t *mypar, Double_t *emypar);
|
||||
TF1 *fitSpectrumKb(TH1 *h1, Double_t *mypar, Double_t *emypar);
|
||||
TF1 *fitSpectrumKaDoublet(TH1 *h1, Double_t *mypar, Double_t *emypar);
|
||||
|
||||
|
||||
/**
|
||||
@ -399,6 +397,8 @@ class energyCalibration {
|
||||
*/
|
||||
|
||||
void initFitFunction(TF1 *fun, TH1 *h1);
|
||||
void initFitFunctionKb(TF1 *fun, TH1 *h1);
|
||||
void initFitFunctionKaDoublet(TF1 *fun, TH1 *h1);
|
||||
|
||||
|
||||
/**
|
||||
@ -410,6 +410,8 @@ class energyCalibration {
|
||||
\returns the fitted function - can be used e.g. to get the Chi2 or similar
|
||||
*/
|
||||
TF1 *fitFunction(TF1 *fun, TH1 *h1, Double_t *mypar, Double_t *emypar);
|
||||
TF1 *fitFunctionKb(TF1 *fun, TH1 *h1, Double_t *mypar, Double_t *emypar);
|
||||
TF1 *fitFunctionKaDoublet(TF1 *fun, TH1 *h1, Double_t *mypar, Double_t *emypar);
|
||||
|
||||
#endif
|
||||
|
||||
@ -423,11 +425,16 @@ class energyCalibration {
|
||||
Double_t noise; /**< start value for the noise */
|
||||
Double_t ampl; /**< start value for the number of photons */
|
||||
Double_t cs_slope; /**< start value for the charge sharing slope */
|
||||
|
||||
Double_t kb_mean;
|
||||
Double_t kb_frac;
|
||||
Double_t mean2;
|
||||
Double_t ampl2;
|
||||
|
||||
TF1 *fscurve; /**< function with which the s-curve will be fitted */
|
||||
|
||||
TF1 *fspectrum; /**< function with which the spectrum will be fitted */
|
||||
TF1 *fspectrumkb; /**< function with which the spectrum will be fitted */
|
||||
TF1 *fspectrumkadoublet; /**< function with which the spectrum will be fitted */
|
||||
|
||||
TF1 *fspixel; /**< function with which the spectrum will be fitted */
|
||||
|
||||
|
@ -0,0 +1,47 @@
|
||||
#module add CBFlib/0.9.5
|
||||
INCDIR=-I. -I../ -I../interpolations -I../interpolations/etaVEL -I../dataStructures -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/
|
||||
|
||||
LDFLAG= ../tiffIO.cpp -L/usr/lib64/ -lpthread -lm -lstdc++ -pthread -lrt -ltiff -O3 -std=c++11
|
||||
|
||||
MAIN=jungfrauClusterFinder.cpp
|
||||
|
||||
|
||||
all: jungfrauClusterFinder jungfrauMakeEta jungfrauInterpolation jungfrauNoInterpolation jungfrauPhotonCounter jungfrauAnalog
|
||||
|
||||
|
||||
|
||||
jungfrauClusterFinder: jungfrauClusterFinder.cpp $(INCS) clean
|
||||
g++ -o jungfrauClusterFinder jungfrauClusterFinder.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL
|
||||
|
||||
|
||||
jungfrauClusterFinderHighZ: jungfrauClusterFinder.cpp $(INCS) clean
|
||||
g++ -o jungfrauClusterFinderHighZ jungfrauClusterFinder.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL -DHIGHZ
|
||||
|
||||
|
||||
|
||||
|
||||
jungfrauMakeEta: jungfrauInterpolation.cpp $(INCS) clean
|
||||
g++ -o jungfrauMakeEta jungfrauInterpolation.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DFF
|
||||
|
||||
jungfrauInterpolation: jungfrauInterpolation.cpp $(INCS) clean
|
||||
g++ -o jungfrauInterpolation jungfrauInterpolation.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF)
|
||||
|
||||
jungfrauNoInterpolation: jungfrauNoInterpolation.cpp $(INCS) clean
|
||||
g++ -o jungfrauNoInterpolation jungfrauNoInterpolation.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF)
|
||||
|
||||
jungfrauPhotonCounter: jungfrauPhotonCounter.cpp $(INCS) clean
|
||||
g++ -o jungfrauPhotonCounter jungfrauPhotonCounter.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWRECEIVER
|
||||
|
||||
jungfrauAnalog: jungfrauPhotonCounter.cpp $(INCS) clean
|
||||
g++ -o jungfrauAnalog jungfrauPhotonCounter.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWRECEIVER -DANALOG
|
||||
|
||||
jungfrauPhotonCounterHighZ: jungfrauPhotonCounter.cpp $(INCS) clean
|
||||
g++ -o jungfrauPhotonCounterHighZ jungfrauPhotonCounter.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWRECEIVER -DHIGHZ
|
||||
|
||||
jungfrauAnalogHighZ: jungfrauPhotonCounter.cpp $(INCS) clean
|
||||
g++ -o jungfrauAnalogHighZ jungfrauPhotonCounter.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWRECEIVER -DANALOG -DHIGHZ
|
||||
|
||||
clean:
|
||||
rm -f jungfrauClusterFinder jungfrauMakeEta jungfrauInterpolation jungfrauNoInterpolation jungfrauPhotonCounter jungfrauAnalog
|
||||
|
||||
|
@ -0,0 +1,47 @@
|
||||
#module add CBFlib/0.9.5
|
||||
INCDIR=-I. -I../ -I../interpolations -I../interpolations/etaVEL -I../dataStructures -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/
|
||||
|
||||
LDFLAG= ../tiffIO.cpp -L/usr/lib64/ -lpthread -lm -lstdc++ -pthread -lrt -ltiff -O3 -std=c++11
|
||||
|
||||
MAIN=moench03ClusterFinder.cpp
|
||||
|
||||
|
||||
all: moenchClusterFinder moenchMakeEta moenchInterpolation moenchNoInterpolation moenchPhotonCounter moenchAnalog
|
||||
|
||||
|
||||
|
||||
moenchClusterFinder: moench03ClusterFinder.cpp $(INCS) clean
|
||||
g++ -o moenchClusterFinder moench03ClusterFinder.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL -DNEWRECEIVER
|
||||
|
||||
|
||||
moenchClusterFinderHighZ: moench03ClusterFinder.cpp $(INCS) clean
|
||||
g++ -o moenchClusterFinderHighZ moench03ClusterFinder.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL -DNEWRECEIVER -DHIGHZ
|
||||
|
||||
|
||||
|
||||
|
||||
moenchMakeEta: moench03Interpolation.cpp $(INCS) clean
|
||||
g++ -o moenchMakeEta moench03Interpolation.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DFF
|
||||
|
||||
moenchInterpolation: moench03Interpolation.cpp $(INCS) clean
|
||||
g++ -o moenchInterpolation moench03Interpolation.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF)
|
||||
|
||||
moenchNoInterpolation: moench03NoInterpolation.cpp $(INCS) clean
|
||||
g++ -o moenchNoInterpolation moench03NoInterpolation.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF)
|
||||
|
||||
moenchPhotonCounter: moenchPhotonCounter.cpp $(INCS) clean
|
||||
g++ -o moenchPhotonCounter moenchPhotonCounter.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWRECEIVER
|
||||
|
||||
moenchAnalog: moenchPhotonCounter.cpp $(INCS) clean
|
||||
g++ -o moenchAnalog moenchPhotonCounter.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWRECEIVER -DANALOG
|
||||
|
||||
moenchPhotonCounterHighZ: moenchPhotonCounter.cpp $(INCS) clean
|
||||
g++ -o moenchPhotonCounterHighZ moenchPhotonCounter.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWRECEIVER -DHIGHZ
|
||||
|
||||
moenchAnalogHighZ: moenchPhotonCounter.cpp $(INCS) clean
|
||||
g++ -o moenchAnalogHighZ moenchPhotonCounter.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWRECEIVER -DANALOG -DHIGHZ
|
||||
|
||||
clean:
|
||||
rm -f moenchClusterFinder moenchMakeEta moenchInterpolation moenchNoInterpolation moenchPhotonCounter moenchAnalog
|
||||
|
||||
|
23
slsDetectorCalibration/jungfrauExecutables/Makefile.zmq
Normal file
23
slsDetectorCalibration/jungfrauExecutables/Makefile.zmq
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
INCDIR= -I. -I../dataStructures ../tiffIO.cpp -I../ -I../interpolations/ -I../../slsSupportLib/include/ -I../../slsReceiverSoftware/include/ -I../../libs/rapidjson/
|
||||
LDFLAG= -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -O3 -std=c++11 -Wall -L../../build/bin/ -lSlsSupport
|
||||
#-L../../bin -lhdf5 -L.
|
||||
|
||||
#DESTDIR?=../bin
|
||||
|
||||
all: moenchZmqProcess moenchZmq04Process
|
||||
#moenchZmqProcessCtbGui
|
||||
|
||||
moenchZmqProcess: moenchZmqProcess.cpp clean
|
||||
g++ -o moenchZmqProcess moenchZmqProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWZMQ -DINTERP
|
||||
|
||||
moenchZmq04Process: moenchZmqProcess.cpp clean
|
||||
g++ -o moench04ZmqProcess moenchZmqProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWZMQ -DINTERP -DMOENCH04
|
||||
|
||||
#moenchZmqProcessCtbGui: moenchZmqProcess.cpp clean
|
||||
# g++ -o moenchZmqProcessCtbGui moenchZmqProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DNEWZMQ -DINTERP -DCTBGUI
|
||||
|
||||
clean:
|
||||
rm -f moenchZmqProcess
|
||||
|
||||
|
BIN
slsDetectorCalibration/jungfrauExecutables/jungfrauClusterFinder
Executable file
BIN
slsDetectorCalibration/jungfrauExecutables/jungfrauClusterFinder
Executable file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user