Compare commits

...

106 Commits

Author SHA1 Message Date
7d7a4e79d0 minor fixes 2023-03-31 09:40:03 +02:00
3b8c612103 Fixed build of the moenchZmqExecutables (#706)
* changed to pure virtual methods for Clone and setClusterSize

* added std::

* added moench to the github actions build
2023-03-29 15:01:22 +02:00
08c0c59a28 Added github actions for build and run unit tests (#705) 2023-03-28 16:27:01 +02:00
7e01095684 Fix tests (#698)
* fix firmwareversion to reqd version as fw version cannot be 0 for virtual
2023-03-28 15:22:36 +02:00
500442fd6b modified ZMQonline display for stripsel usage. (#699)
* modified ZMQonline display for stripsel usage. modified dataprocessor to overwrite header.detspec1 with ROI in case of ROI.
* Removing changes to the slsReceiver, moved to branch jf_zeromq_display_rxroi
2023-03-22 14:25:02 +01:00
b67c6dea08 ensuring no duplicate rx hostname port combo (#604)
* rx_hostname and port combo to one, or hostname to all, or a vector of hostnames and ports, ignoring none or empty, then verifying no duplicates for the host port combo including from shared memory

* extracted function for rx_hostname (#694)

* c++14 revert

* unique hostname-port combo for port, hostname, rx_tcpport (#696)

* verify unique combo for rx_port as well

* check unique hostname-port combo also when setting control port, hostname, rx_hostname and rx_tcpport

---------

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
Co-authored-by: Erik Frojdh <erik.frojdh@psi.ch>
2023-03-20 12:30:12 +01:00
c9215a6d9b fix old server version in 64 bits (#697)
* check server version before initial checks, catch old server version exception, get old server version as 64 bit and print it alon gwith exception
2023-03-20 10:31:27 +01:00
1bdf83e101 Resolve merge conflict in jungfrauExecutables 2023-03-17 16:43:08 +01:00
1bd813d620 Fix bug to allow larger clusters 2023-03-17 15:34:08 +01:00
943a85cbd5 Update data structures and eta functions for JF strixels 2023-03-17 15:33:01 +01:00
fc24558314 formatting 2023-03-17 14:42:11 +01:00
d23722a4b7 Eiger: add hardware version (#688)
* eiger: hardwareversion, fix firmware version unable to read version scenarios, check to see if febl, febr and beb have same fw version

* feb versions can be picked up only after feb initialization
2023-03-16 11:59:06 +01:00
bc46d0f6ab rx_arping handle sigchld (#691)
* rx_arping pclose gave -1 due to sigchld being ignored, fixed with sig handler doing a wait
2023-03-16 11:57:30 +01:00
532f76ed4f fix hdf5 compilation using det spec fields in header (#693)
* fix hdf5 compilation using det spec fields in header
2023-03-16 09:23:27 +01:00
21db57dd89 binaries in 2023-02-24 10:44:17 +01:00
dc5db905d4 merge from 7.0.0 2023-02-24 10:39:51 +01:00
48a684b95f dev:Eiger febl febr (#601)
* eiger: get febl and febr versions in versions command, also added in python
2023-02-24 10:06:11 +01:00
276dc52196 dev:removed storage cells for moench (#603)
* removed storage cells for moench
* rxr: also setting moench like jungfrau in implementation of ports
2023-02-24 10:00:31 +01:00
e942678139 Merge branch 'main' into 7.0.0.rc 2023-02-24 09:48:22 +01:00
72a028eaf3 Update README.md 2023-02-23 17:30:47 +01:00
907257891d updated readme 2023-02-23 17:24:23 +01:00
0a79ae523b updating documentation 2023-02-23 16:52:04 +01:00
90496bcee8 updated release date and lib api date 2023-02-23 16:38:10 +01:00
ed2894dafd python additions (#686)
* python: fixed versions when no receiver, added clearbusy, serialnumber and readoutspeedlist. commandline: modified versions to look like python versions

* python: added clkphase, fixed clkdiv, maxphase

* python added adcvpp

* gaincaps for python

---------

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
2023-02-23 16:29:54 +01:00
a74c9498e2 m3, individual chip index back in for hw 1.2, need the linux drivers for chipdac0-9 (#685) 2023-02-23 09:13:31 +01:00
403989e2f8 trigger, blockingtrigger in python and m3 timefix 2023-02-22 18:01:46 +01:00
7e8d11098a release date 2023-02-22 17:15:51 +01:00
f9c9a53c8c fix python compare script from g to sls_detector_get 2023-02-22 17:09:47 +01:00
90b1b97ffa release notes 2023-02-22 16:30:41 +01:00
50003cbc08 release notes 2023-02-22 16:30:27 +01:00
a799c4d2e2 minor 2023-02-22 15:37:13 +01:00
700f532b5a examples udp before rx_hostame 2023-02-22 15:16:00 +01:00
a098bc4674 fixes for tests for m3 2023-02-22 14:34:01 +01:00
13bbd54a21 formatting 2023-02-22 11:42:06 +01:00
d84e9652d3 updated versions for the servers 2023-02-22 11:36:47 +01:00
1ce39c48c7 updated client versions 2023-02-22 11:29:58 +01:00
9ddff523cd minor 2023-02-22 11:28:39 +01:00
f7618fbb93 error message 'unrecognized function enum' from detector or receiver prepended with Software version mismatch to handle enum start change between v6 and v7 (#680) 2023-02-22 11:11:46 +01:00
8501e1fb1f eiger server moved to fw 31 (#681)
* eiger server moved to fw 31
2023-02-22 11:10:56 +01:00
6faa4c821f udp_srcip auto to detector ip (#683)
* udp_srcip now points to detectorip for 'auto' argument. and not allowed for G1
2023-02-22 11:09:52 +01:00
da291d535e fix ctb test, non blocking will not return for 1g (#684)
* fix ctb test, non blocking will not return for 1g
2023-02-22 11:09:18 +01:00
adcde9fd49 user friendly message added from ' dangerous to continue' to 'check firmware' (#665) 2023-02-20 16:35:33 +01:00
dde99a16b3 fixed documentation for fw upgrade and cmk script show all options (#674)
* fixed documentation for fw upgrade and cmk script show all options

* much more clear definition of the sls receiver header
2023-02-20 15:24:09 +01:00
b200a2efc1 Fix jf softwre trigger and tests with real jungfrau detector (#673)
* jungfrau: software triggers do not work, fixed

* eiger test: get highvoltage must be read twice to get the real voltage
2023-02-20 15:22:46 +01:00
fe281bd1b1 Fix stop rx stuck (#669)
stop should really stop even if receiver had crashed, so check rx status after sending stop; also ensuring restream  in acquire happens only if thers a callback
2023-02-20 15:21:22 +01:00
878eab9fc3 Fix gui browse (#662)
Choosing file path in dialog should already set file path when returning from dialog, must not wait to press enter
2023-02-20 15:20:02 +01:00
4259d49b63 added release notes from 7.0.0.rc1 to rc2 (#639)
* added release notes from 7.0.0.rc1 to rc2
2023-02-17 08:51:05 +01:00
4dac9f2193 zmq4.3 changed default buffer size to -1 instead of 0 (#667) 2023-02-15 09:45:02 +01:00
cb8e4365e3 formatting 2023-02-14 15:08:31 +01:00
eb025b54ef Merge branch '7.0.0.rc' into developer 2023-01-18 13:59:04 +01:00
3bf6be41b4 merge from 7.0.0.rc 2023-01-17 09:48:59 +01:00
7729e47685 also for rx_hostname 2023-01-16 13:34:07 +01:00
f31fa92516 fixed hostname not split (+) in python 2023-01-16 13:34:01 +01:00
39b1f5bbf2 Moench rewrite (#597)
* copied jungfrau server to moench and adapted

* fixed image size and num packets

* read n rows allows 16

* commneted out configure_asic_timer at server startup. To be removed later the ASIC_CTRL_REG and storage cell options

* moench:removing the decrement (which was in jf)  in read n rows to register

* removed lblsamples from gui
2022-12-15 09:16:51 +01:00
7ab3b25f87 formatting 2022-12-13 10:07:13 +01:00
0f6f20a720 merge from 7.0.0.rc1 2022-12-13 10:03:57 +01:00
1340408c2d Merge branch '7.0.0.rc' into developer 2022-12-13 09:58:55 +01:00
7b7c4a2b86 Merge branch '7.0.0.rc' into developer 2022-12-08 09:01:03 +01:00
8fc45676b9 Merge branch '7.0.0.rc' into developer 2022-12-07 16:22:30 +01:00
53fe5f5116 Merge branch '7.0.0.rc' into developer 2022-12-07 11:14:02 +01:00
50f2165c55 Merge branch '7.0.0.rc' into developer 2022-12-06 11:30:14 +01:00
056f650b92 Test for moench done 2022-12-06 11:15:53 +01:00
3d54a4aa26 fix for tests ctb 2022-12-06 11:15:45 +01:00
3a89c2a61e fix tests for gottthard1 2022-12-06 11:15:31 +01:00
570a567a8c fix m3 tests 2022-12-06 11:15:22 +01:00
9874f596f6 fix to tests m3 2022-12-06 10:35:00 +01:00
984a59a9d7 fix tests to not allow setting veto stream at a single module level 2022-12-06 10:34:52 +01:00
e02b11fd1e fix tests to not allow setting udp interfaces at a single module level 2022-12-06 10:08:53 +01:00
68beba732e tests: transmission delay cannot be got for a single module for jf and m3, resetting fpga is not an option to test others 2022-12-05 17:45:00 +01:00
104bc6f619 fixed tests to get headwareversion number instead of serial number to know ic 2.0 jf boards nd also the set master fail only if more than 1 detector (fix intests only) 2022-12-05 17:44:54 +01:00
66cf1825ea fixed tests 2022-12-05 17:44:48 +01:00
d8e497dbb3 fix for changing udp socket buffer size 2022-12-05 17:44:42 +01:00
60502cfa8f datastream help, versions fix for eiger (hardwareversion not impl), fix for tests 2022-12-05 17:44:33 +01:00
b089dc90cd fix for changing udp socket buffer size 2022-12-05 16:34:13 +01:00
4caf10c12b datastream help, versions fix for eiger (hardwareversion not impl), fix for tests 2022-12-05 16:33:59 +01:00
32cbb11bb6 Corrected typo 2022-12-05 12:49:04 +01:00
339cb925c7 removed decrement for sls detector header version number for virtual servers for ctb moench jungfrau g2 and m3 2022-12-02 12:13:13 +01:00
f8a29c3000 reverted versions as the firmware dont increment (#590) 2022-11-29 16:37:28 +01:00
d431443dda allowing jungfrau to continue with just a waning if detid.txt file not found (#589) 2022-11-29 16:28:55 +01:00
ae0a54a774 Merge branch 'main' into 6.1.2.rc 2022-11-25 16:12:02 +01:00
ae33622da2 updated pybind and catch (#588)
* updated pybind and catch
* added to release notes
Co-authored-by: Erik Frojdh <erik.frojdh@psi.ch>
2022-11-25 16:08:36 +01:00
c4a453fdbd updated release version 2022-11-25 10:31:10 +01:00
672c0f4a07 updated client date 2022-11-25 10:26:23 +01:00
05af370883 update server bin 2022-11-25 10:23:49 +01:00
a6022b7cec updated release notes and eiger server 2022-11-25 10:18:37 +01:00
72316fa2ce release notes 2022-11-25 10:09:15 +01:00
65523dcc94 release notes 2022-11-25 10:08:17 +01:00
df40665c5e Using a loop to stop (#585)
* loop for stop, 10 retries
  For example, if module A got a "stop" during an acquisition, it stops to an 'Idle' state. If module B gets a "stop" before an acquisition, it will return it is in 'Idle' state and continue to start the next acquisition, but module B then waits for "ready  for trigger" synchronization from module A, which it will never get. Since module B missed the asynchronous stop command, the workaround in the client is to send another "stop" command (upto 10 retries) till it returns Idle.
2022-11-25 09:55:51 +01:00
8472cca81f naming 2022-11-17 17:15:05 +01:00
110e57ff6c Eiger stop lock (#576)
* added a lock when stopping or starting state machine in eiger server

* added 5ms right after acq started to make sure it really started

* added 100ms right after acq started to make sure it really started
2022-11-17 15:23:41 +01:00
fdd6031add renaming for version 2022-11-15 08:50:39 +01:00
e7c65f44cb returning empty fail message for eiger 2022-11-11 16:56:58 +01:00
0063cc8eb2 update release notes 2022-11-11 16:51:20 +01:00
27e6fc3c73 serverbin shortcuts 2022-11-11 16:02:57 +01:00
83e0eb8b01 removed the test for allow update for kernel and server as it is eligible if the kernel is booting up anyway 2022-11-11 16:02:17 +01:00
7f8b5ac6c0 blackfin nCE pin fix for new kernel 2022-11-11 15:31:30 +01:00
340abec016 updated release txt 2022-11-07 12:47:52 +01:00
a8b37e3932 ensure eiger hot fix server version stays the same 2022-10-24 10:54:48 +02:00
0883c73e88 not updating the client versions for 'server only hot fix' 2022-10-24 10:51:50 +02:00
ef7e9d73a5 eiger server fixes:
- removed feb reset in stop acquisition as it caused processing bit to randomly not go high (leads to infinite loop waiting for it to go high). This is anyway done at prepare acquisition and set trimbits.
- left AND right registers monitored for processing bit done
- febProcessinginprogress returns STATUS_IDLE and not IDLE
- In feb stop acquisition, if processing bit is running forever, checks for 1 s, then if acq done bit is high, returns ok, else throws
- feb stop acquisition returns 1 if success and fucntion in list calling it compares properly instead of STATUS_IDLE (no effect, but incorrect logic)
- chipsignals to trimquad should only monitor right fpga (not both as it will throw)
- fixed error messages of readregister inconsistent values
- setmodule and read frame was returning fail without setting error messages (leading to broken tcp connection due to no error message)
-
2022-10-21 16:31:17 +02:00
a8bdc1495c Update issue templates 2022-03-01 10:19:57 +01:00
1c54dea9c7 Update issue templates 2022-03-01 10:18:52 +01:00
cee286b6ad Update issue templates 2022-03-01 10:16:41 +01:00
da8e0060d3 updated release notes and project version 2022-01-04 10:44:07 +01:00
85da65ca15 update versioning (prev commit) 2022-01-04 10:38:45 +01:00
4fe067363a This commit fixes the issue #336
A delay of 100ms has been added between the generation of the stop pulse and the resetCore function call. This should give enough time to the detector to readout and streamout the ongoing frame before the internal logic is reset (even after the transmission is delayed with txndelay_frame).

Conflicts:
	slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv6.1.0
2022-01-04 10:37:57 +01:00
163 changed files with 7237 additions and 6635 deletions

38
.github/workflows/cmake.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: CMake
on: [push, pull_request]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
name: Configure and build using cmake
steps:
- uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libzmq3-dev libhdf5-dev qtbase5-dev qt5-qmake libqt5svg5-dev
version: 1.0
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSLS_USE_TESTS=ON -DSLS_USE_HDF5=ON -DSLS_USE_GUI=ON -DSLS_USE_MOENCH=ON
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build -j2 --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}} -j1

279
README.md
View File

@ -1,102 +1,233 @@
### Note
## Dependencies
Before building from source make sure that you have the [software wiki](https://slsdetectorgroup.github.io/devdoc/dependencies.html) installed. If installing using conda, conda will manage the dependencies. Avoid also installing packages with pip.
Please do not update to any xxxx.xx.xx.dev0 tags. They are not releases, but tags for internal usage.
Use only releases with tags such as x.x.x or x.x.x-rcx.
## Documentaion
Detailed documentation 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).
### Documentation
##### 5.0.0 - Latest Release
Detailed documentation on the latest release 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).
## Installation
##### Older Releases
Documentation is found in the package.
### 1. Install binaries using conda
Conda is not only useful to manage python environments but can also
be used as a user space package manager. Dates in the tag (for eg. 2020.07.23.dev0)
are from the developer branch. Please use released tags for stability.
We have three different packages available:
* **slsdetlib** shared libraries and command line utilities
* **slsdetgui** GUI
* **slsdet** Python bindings
### Binaries
Binaries for the slsDetectorPackage are available through conda.
```
#Add conda channels
#Add channels for dependencies and our library
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)
conda install slsdetgui #gui (includes qt4)
#Install specific version
conda install slsdet=2020.03.02.dev0 #developer version from 3 March 2020
#create and activate an environment with our library
#replace 6.1.1 with the required tag
conda create -n myenv slsdetlib=6.1.1
conda activate myenv
#ready to use
sls_detector_get exptime
etc ...
```
### Source code
One can also obtain the source code from this repository and compile.
```
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git
# List available versions
# lib and binaries
conda search slsdetlib
# python
conda search slsdet
# gui
conda search slsdetgui
```
### 2. Build from source
##### 2.1 Download Source Code from github
```
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch 7.0.0
```
**Pybind for Python**<br>
* **v7.0.0+**:
pybind11 packaged into 'libs/pybind'. No longer a submodule. No need for "recursive" or "submodule update".
* **Older versions**:
pybind11 is a submodule. Must be cloned using "recursive" and updated when switching between versions using the following commands.
```
#### Dependencies
# clone using recursive to get pybind11 submodule
git clone --recursive https://github.com/slsdetectorgroup/slsDetectorPackage.git
Refer [this page](https://slsdetectorgroup.github.io/devdoc/dependencies.html) for dependencies.
#### Compilation
Compiling can be done in two ways. Either with the convenience script
cmk.sh or directly with cmake for more control.
**1. Compile using script cmk.sh**<br>
These are mainly aimed at those not familiar with using ccmake and cmake.
# update submodule when switching between releases
cd slsDetectorPackage
git submodule update --init
```
The binaries are generated in slsDetectorPackage/build/bin directory.
Usage: ./cmk.sh [-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
##### 2.2 Build from source
###### Build using CMake
```
# outside slsDetecorPackage folder
mkdir build && cd build
# configure & generate Makefiles using cmake
# by listing all your options (alternately use ccmake described below)
# cmake3 for some systems
cmake ../slsDetectorPackage -DCMAKE_INSTALL_PREFIX=/your/install/path
# compiled to the build/bin directory
make -j12 #or whatever number of cores you are using to build
# install headers and libs in /your/install/path directory
make install
```
Instead of the cmake command, one can use ccmake to get a list of options to configure and generate Makefiles at ease.
```
# ccmake3 for some systems
ccmake ..
# choose the options
# first press [c] - configure
# then press [g] - generate
```
|Example cmake options|Comment|
|---|---|
| -DSLS_USE_PYTHON=ON | Python |
| -DPython_FIND_VIRTUALENV=ONLY | Python from only the conda environment |
| -DZeroMQ_HINT=/usr/lib64 | Use system zmq instead |
| -DSLS_USE_GUI=ON | GUI |
###### Build using in-built cmk.sh script
```
The binaries are generated in slsDetectorPackage/build/bin directory.
Usage: ./cmk.sh [-b] [-c] [-d <HDF5 directory>] [e] [g] [-h] [i] [-j <Number of threads>]
[-k <CMake command>] [-l <Install directory>] [m] [n] [-p] [-q <Zmq hint directory>]
[r] [s] [t] [u] [z]
-[no option]: only make
-b: Builds/Rebuilds CMake files normal mode
-c: Clean
-d: HDF5 Custom Directory
-e: Debug mode
-g: Build/Rebuilds gui
-h: Builds/Rebuilds Cmake files with HDF5 package
-i: Builds tests
-j: Number of threads to compile through
-k: CMake command
-l: Install directory
-m: Manuals
-n: Manuals without compiling doxygen (only rst)
-p: Builds/Rebuilds Python API
-q: Zmq hint directory
-r: Build/Rebuilds only receiver
-s: Simulator
-t: Build/Rebuilds only text client
-u: Chip Test Gui
-z: Moench zmq processor
# get all options
./cmk.sh -?
# display 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.
```
$ mkdir build
$ cd build
$ cmake ../slsDetectorPackage -DCMAKE_BUILD_TYPE=Debug -DSLS_USE_SANITIZER=ON
$ make -j12 #or whatever number of threads wanted
# new build and compile in parallel (recommended basic option):
./cmk.sh -cbj5
# new build, python and compile in parallel:
./cmk.sh -cbpj5
#To use the system zmq (/usr/lib64) instead
./cmk.sh -cbj5 -q /usr/lib64
```
To install binaries using CMake
###### Build on old distributions
If your linux distribution doesn't come with a C++11 compiler (gcc>4.8) then
it's possible to install a newer gcc using conda and build the slsDetectorPackage
using this compiler
```
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
#Create an environment with the dependencies
conda create -n myenv gxx_linux-64 cmake zmq
conda activate myenv
# outside slsDetecorPackage folder
mkdir build && cd build
cmake ../slsDetectorPackage -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
make -j12
```
###### Build slsDetectorGui (Qt5)
1. Using pre-built binary on conda
```
conda create -n myenv slsdetgui=7.0.0
conda activate myenv
```
2. Using system installation on RHEL7
```
yum install qt5-qtbase-devel.x86_64
yum install qt5-qtsvg-devel.x86_64
```
3. Using conda
```
#Add channels for dependencies and our library
conda config --add channels conda-forge
conda config --add channels slsdetectorgroup
conda config --set channel_priority strict
# create environment to compile
# on rhel7
conda create -n slsgui zeromq gxx_linux-64 gxx_linux-64 mesa-libgl-devel-cos6-x86_64 qt
# on fedora or newer systems
conda create -n slsgui zeromq qt
# when using conda compilers, would also need libgl, but no need for it on fedora unless maybe using it with ROOT
# activate environment
conda activate slsgui
# compile with cmake outside slsDetecorPackage folder
mkdir build && cd build
cmake ../slsDetectorPackage -DSLS_USE_GUI=ON
make -j12
# or compile with cmk.sh
cd slsDetectorPackage
./cmk.sh -cbgj9
```
###### Build documentation from package
The documentation for the slsDetectorPackage is build using a combination
of Doxygen, Sphinx and Breathe. The easiest way to install the dependencies
is to use conda
```
conda create -n myenv python sphinx_rtd_theme breathe
```
```
# using cmake or ccmake to enable DSLS_BUILD_DOCS
# outside slsDetecorPackage folder
mkdir build && cd build
cmake ../slsDetectorPackage -DSLS_BUILD_DOCS=ON
make docs # generate API docs and build Sphinx RST
make rst # rst only, saves time in case the API did not change
```
### Support
## Support
dhanya.thattil@psi.ch
erik.frojdh@psi.ch
erik.frojdh@psi.ch

View File

@ -1,828 +1,45 @@
SLS Detector Package Minor Release 7.0.0.rc1 released on 12.12.2021
===================================================================
SLS Detector Package Major Release 7.x.x released on xx.xx.2023
===============================================================
This document describes the differences between v7.0.0.rc1 and v6.1.2
This document describes the differences between v7.x.x and v7.0.0
CONTENTS
--------
1. New, Changed or Resolved Features
1.1. Compilation
1.2. Callback
1.3. Python
1.4. Client
1.5. Detector Server
1.6. Simulator
1.7. Receiver
2. On-board Detector Server Compatibility
3. Firmware Requirements
4. Kernel Requirements
5. Download, Documentation & Support
1 New, Changed or Resolved Features
1.1 Compilation
1.2 Callback
1.3 Python
1.4 Client
1.5 Detector Server
1.6 Simulator
1.7 Receiver
1.8 Gui
2 On-board Detector Server Compatibility
3 Firmware Requirements
4 Kernel Requirements
5 Download, Documentation & Support
1. New or Changed Features
==========================
1 New, Changed or Resolved Features
=====================================
1.1. Compilation
----------------
- moench being made compatible with jungfrau 2.0 boards (jungfrau structure, away from ctb)
- rx_hostname and port can be combo to one or to all, or vector or hostnames and ports. ignoring none or empty, then verifying no duplicates for the host port combo including from shared memory
- same for hostname and port combo (for virtual servers)
- eiger febl and febr in versions, ensure its the same as beb fw version
- eiger hardware version fx30 and fx70 (versions command)
- fixed rx_arping error
- fix hdf5 compilation (detspec fields)
- print server version atleast in exception msg when connecting to an older server, also able to add hostname to shm
General:
* Custom location to find ZeroMQ
Option to provide a custom location to look for ZeroMQ, if not found
using FindZeroMQ.cmake
For example, to use the system installed zmq:
Using cmake: -DZeroMQ_HINT=/usr/lib64
Using cmk.sh script: -q /usr/lib64
* Support external build
Assuming already installed version of the slsDetectorPacakge exists,
external build of python bindings, gui, ctbgui and moench has been added.
* Catch updated to latest 2.x version due to build failure in fedora
Gui:
* Qt5 and in-built compressed Qwt 6.1.5
Ported from Qt4 to Qt5. Minimum requirement: Qt 5.9
Compressed Qwt 6.1.5 added into the package in libs. It is unpacked and built
as a static library.This allows us to remove qwt as an external dependency
and reduces the risk of picking up the wrong version.
Python:
* Install python extension
Option to copy the python extension (slsdet folder and _slsdet-..so)
to CMAKE_INSTALL_PREFIX/python using
-DSLS_INSTALL_PYTHONEXT
* Pybind11 (v2.10.0)
Pybind11 is removed as a submodule and instead built into package to
simplify for users. Now, there is no more need to clone with the '--recursive'
argument or to update submodule when switching to this package version
and above.
* Conda packages
Removed conda packages for python 3.6 and 3.7. Added for python 3.11.
1.2. Callback
-------------
* Datatype of Metadata [registerCallBackRawDataReady, registerCallBackRawDataModifyReady]
Datatype changed from char* to sls_receiver_header.
* Datatype of Size [registerCallBackRawDataReady, registerCallBackRawDataModifyReady]
Datatype changed from uint32_t to size_t
* Datatype of file name and file path [registerCallBackStartAcquisition]
Datatype changed from string to const string reference.
* Incorrect image size [registerCallBackStartAcquisition]
Fixed. It used to give +120 bytes.
* [Gotthard2] 25um Image reconstruction for 2 modules
First module (master) interleaves with second modules(slave). First channel
of master is first channel of detector.
Requires firmware update to reverse channels of slaves.
1.3. Python
-----------
* Defines in sls_detector_defs
sls_detetor_defs parsed and #defines extracted into defines.py
For exmaple, one can use slsdet.LOCALHOST_IP
* Python sub-microsecond resolution
Reading back sub-microsecond exposure times from the Python API fixed by
addig Python datetime supports only micro seconds as lowest unit.
This is fixed by introducing a new C++ type (DurationWrapper), which
holds number of nanoseconds as a uint64_t (only in python bindings) and
custom typecaster to convert to and from std::chrono::nanoseconds.
A get using API now returns in DurationWrapper, instead of datetime.
Refer exptime help for examples.
1.4. Client
-----------
Breaking API:
* Versioning
The client, receiver and detector servers now have semantic Versioning
along with the date and are managed with the Version class.
--version argument to the executable gives the complete versioning with date.
Using the client to get versions gives only the semantic version. An older
server will still give date. Hence, the return type is a string, breaking API.
Compatibility checks at hostname or rx_hostname command will only be for
backwards compatibility (ie. it only checks for the major version number).
If its an old server, then its expected to have the exact same date (as
before)
Setting intitialchecks to 0 also bypasses the receiver compatibility check.
* Detector Specific fields
bunchid ->detSpec1
reserved->detSpec2
debug->detSpec3
roundRnumber->detSpec4
Header version number stays the same in the UDP header as there is no
difference in the format from the detector. Only the structure memeber names
have changed in sls_detector_defs.h
Further details about each detector specific field can be found at:
https://slsdetectorgroup.github.io/devdoc/udpdetspec.html
* Namespace sls
All files in slsSupportLib and tests have now been moved to sls namespace
including macros. Using the LOG, for example, will require the sls qualifier.
* [Eiger] Number of UDP interfaces
Command line: numinterfaces, API: getNumberofUDPInterfaces
This command now reflects the actual number of udp interfaces for Eiger,
which is 2.
* [Eiger][Jungfrau] Row column
[Jungfrau] Fixed row column indexing for multi module 2 interfaces
[Eiger] The row indicies were switched across the Y axis for the callback
only for Eiger. This is now changed and kept similar to the other detectors.
The row indices would be in the order of the half modules in the hostname
command. Therefore, to keep the image from callback, invert the hostname
order in the config file.
* Deprecated CopyDetectorServer
Command line: copydetectorserver, API: copydetectorserver
Removed. Use updatedetectorserver
* [Eiger][Jugfrau][Mythen3] Deprecated specific transmission delay commands
txndelay_frame -> txdelay_frame
txndelay_left -> txdelay_left
txndelay_right -> txdelay_right
* [Eiger] Datastream only for 10GbE
Command line: datastream, API: getDataStream/ setDataStream
This command to enable/ disable data stream from left or right port
is now allowed only for 10GbE. Previously, it incorrectly allowed to do so.
* [Eiger][Jungfrau][Moench][Ctb] Stop command effect on next frame number
Stopping acquisition sometimes results in different next frame numbers
for different moduels. Hence, after a stop, if the next frame numbers are
different, they are all set to their maximum value + 1.
* Missing packets
Command line: rx_missingpackets, API: getNumMissingPackets
This now returns a signed 64 bit instead of unsigned. The negative polarity
depicts extra packets instead of missing packets and also takes care of
disabled ports.
* Frames caught and frame index
Command line rx_framescaught, rx_frameindex, API: getFramesCaught/ getRxCurrentFrameIndex
They now return a vector for each port when there are 2 udp interfaces
in the receiver.
* [Gotthard][Gotthard2] Num modules
Only 2 modules allowed maximum in a detector shared memory.
* [Moench][Ctb][Mythen3] Deprecated commands
Patloopx, patnloopx, patwaitx, patwaittimex
Please use instead patloop, patnloop, patwait and patwaittime commands
with the level as an argument.
Old commands work with warning, but the server expects the new ones
such as a default pattern file to be loaded at startup for Moench.
Renamed patternParameters struct member from 'loop' to 'startloop' and
'stoploop'.
* [Mythen3] Clock Divider 4 and 5
Cannot be set anymore. Only read back.
New commands:
* [Eiger][Gotthard][Gotthard2][Mythen3][Jungfrau] Master
Setting up from client:
[Eiger][Gotthard2][Jungfrau]
Command line: master, API: getMaster/ setMaster
All of them can get master mode from the client.
This can also be set up on the detector server. Please refer to notes
on that section.
* [Eiger] Top
Command line: top, API: getTop/ setTop
Sets the half module to top or bottom from the client.
This can also be set up on the detector server. Please refer to notes
on that section.
* [Mythen3][Eiger] Save settings file
Command line: trimbits (sls_detector_get), API: saveTrimbits
Added
* [Gotthard2] Parallel readout added
Command line: parallel, API: getParallelMode/ setParallelMode
Default for Gotthard2 is parallel. Non parallel mode only works in
continuous mode.
* [Jungfrau] Software trigger added
Command line: trigger, API: sendSoftwareTrigger
Send software trigger instead of harware trigger.
* [Eiger][Jungfrau] Blocking trigger
Commandline: blockingtrigger, API: sendSoftwareTrigger with argument true
Sends software trigger signal to detector and blocks until the frames
are sent out for that trigger.
* [Jungfrau] Sync
Command line: sync, API: getSynchronization/ setSynchronization
Enables or disables synchronization between modules
* [Gotthard2][Mythen3] Temperature readout
Command line: temp_fpga, API: getTemperature with TEMPERATURE_FPGA enum
Added
* [Gotthard2][Mythen3] Round robin added
Command line: udp_dstlist, API: getDestinationUDPList/ setDestinationUDPList
Command line: udp_numdst, API: getNumberofUDPDestinations
One can set up to 32 (64 for Mythen3) entries in the destination list.
* [Jungfrau] Module Id
Command line: moduleid, API: getModuleId
16 bit value (ideally unique) that is streamed out in the udp header of
the detector. The on-board detector server picks it up from a file
(if it exists) called detid_jungfrau.txt.
* [Jungfrau][[Gotthard2][Myhten3][Gotthard][Ctb][Moench] Hardware version
Command line: hardwareversion, API: getHardwareVersion
Gets the board or hardware version.
For example, Jungfrau returns 1.0 or 2.0.
It is also printed at on-board detector server start up.
Also printed before starting FPGA programming.
* [Eiger][Jugfrau][Mythen3] Transmission Delay
Command line: tx_delay, API: getTransmissionDelay/ setTransmissionDelay
Sets transmission delay for all modules in the detector using the step
size provided. Sets up for every module:
[Eiger] txdelay_left to (2 * mod_index * n_delay)
[Eiger] txdelay_right to ((2 * mod_index + 1) * n_delay)
[Eiger] txdelay_frame to (2 *num_modules * n_delay)
[Jungfrau][Mythen3] txdelay_frame to (num_modules * n_delay)
* [Mythen3] Bad channels
Command line: badchannels, API: getBadChannels/ setBadChannels
Set bad channels from file with a list of channels, which will be masked
out. Also does trimming. A detector level command will require the channel
numbers accordingly. The file also extended to include commas, colons range)
and removes duplicates.
* [Moench][Ctb] Starting frame number
Command line: nextframenumber, API: getNextFrameNumber/ setNextFrameNumber
Added and default set up on detector server start up.
* [Ctb] DAC names
Command line: daclist, API: getDacNames/ setDacNames
Can set and get dac names in the dac list now.
* [Mythen3] Polarity, interpolation, pump probe, analog pulsing, digital pulsing
Command line: polarity, interpolation, pumpprobe, apulse, dpulse
API: getPolarity/ setPolarity, getInterpolation/ setInterpolation,
getPumpProbe/ setPumpProbe, getAnalogPulsing/ setAnalogPulsing,
getDigitalPulsing/ setDigitalPulsing
Added these commands.
Enabling interpolation will also enable all counters and disable vth3.
Disabling sets to previous counter mask and previous vth values.
In pump probe mode, only vth2 enabled. Disabling sets vth2 to prevevious
value.
Setting counter mask will check interpolation and pump probe mode
requirements, else sets vthx dacs according to counter mask.
Direct overwrite of any dac (including vthx) allowed using dac command
(as before).
New commands for Receiver only:
* Arping for 10GbE
Command line: rx_arping API: getRxArping/ setRxArping
Starts a thread in the receiver to arping the interface it is listening
to in 10GbE mode every 60 s.
Changes NUM_RX_THREAD_IDS (sls_detector_defs.h) from 8 to 9.
* Receiver Region of Interest
Command line: rx_roi, API: getRxROI/ setRxROI
Command line: rx_clearroi, API: clearRxROI
One can set an ROI in the receiver to write to file. 1D detectors can set
xmin and xmax, whereas the 2D can also set ymin and ymax. -1 values signify
no ROI.
This is not at network level and can only be used to reduce size of file.
Virtual HDF5 files not created when this is enabled and also no link in
master file. No file created if module not in ROI.
There can only be one ROI per detector. Therefore, can be set only at
detector level, but can be retrieved at module level as well.
The GUI still shows the entire image, but has a yellow border around the
ROI. Status bar displays a message when Rx ROI enabled.
Additonal Features:
* Non-blocking start
Allowing non-blocking start at modular level again.
* [Jungfrau][Moench][Ctb] Additional programming checks
Also checks if the drive to write to is a special file or a normal
file. If its a normal file, it throws asking to redo the command with a
'--please-delete' argument to delete the normal file and create the device
drive and restart FPGA programming.
More readable error message insetad of "programfpga not implemented for
this detector'. This happens when 'hostname' command fails due to
server-firmware/client compatibility and the detector type becomes
'GENERIC'. Fixed to suggest if 'hostname' executed properly.
* Udp Source IP
Command line: udp_srcip(2), API: getSourceUDPIP(2)/ setSourceUDPIP(2)
One can also set this to 'auto' for 1 GbE data. It will set to IP of
rx_hostname (as in udp_dstip)
* Incrementing default receiver tcp port
Automatically incrementing the default receiver tcp port for every module
when creating shared memory.
Changes or Fixes:
* [Jungfrau][Gotthard2][Mythen3][Gotthard][Moench][Ctb] Can't stop
This bug was introduced in 6.1.1, when stopping an acquisition saying it
cannot stop, even though it was successful. It is fixed now.
* Free and config command fail
Free and config command checked mismatch of size of shared memory before
freeing or loading new config. Fixed.
* sls_detector_help or sls_detector_get -h
Should not create Detector object. Fixed.
* [Jungfrau] Storage cells in running receiver
Allowing the possibility to set this when receiver in running state.
* [Eiger] Vtr
Allow Vtrim to be interpolated for settings.
* [Mythen3] Incorrect gain caps when setting threshold energy
Gain caps overwritten with settings enum. Fixed.
* [Mythen3] Non blocking start acquisition
Non-blocking start acquisition was sent out twice to the master. Fixed.
* [Mythen3] Threshold
When settings trimbits or threshold, counter mask is set and hence,
vthx dacs are set accordingly.
setAllThresholdEnergy takes 3 values for each counter and if one of them
is -1, the trimbits and setings for that counter is picked up from the
detector.
* [Moench][Ctb] Pattern levels
Changed from 3 to 6.
* [Mythen3][Moench][Ctb] Default patwait and patloop addresses
Set default wait and loop addresses to 0x1fff (max value) for all levels
before loading pattern. Please use the pattern command instead of parameters.
This ensures defaults are set up and is faster.
* [Moench] Patsetbit and patsetmask
Command line: patsetbit API: getPatternBitMask/ setPatternBitMask
Command line: patmask API: getPatternMask/ setPatternMask
Exchanging the help and masks for patsetbit and patsetmask in the detector
server, especially in loading settings.
* [Moench][Ctb] ADC Vpp
Command line: adcvpp, API: getADCVpp/ setADCVpp
Moved from SetDAC function into into its own. One can use mV values or
option numbers as before.
* [Ctb] ADC command goes back to control server
Slow ADCs, slow ADC temperature, get measured current and voltage values
are requested via the control server again insetad of the stop server
due to configuration and definitions in the control server.
1.5. Detector Server
--------------------
Config file:
* [Eiger][Gotthard2][Gotthard] Master
Using config file with 'master' with argument (master=1, slave=0)
* [Eiger] Top
Using config file with 'top' with argument (top=1, bottom=0)
Command line arguments:
* They have precedence over config files.
* [Eiger][Gotthard2 Virtual][Mythen3 Virtual][Gotthard Virtual] Master
Using command line '--master = 1' or '-m = 1' with argument
(master = 1, slave = 0)
* [Eiger] Top
Using command line '--top = 1' or '-t = 1' with argument (top=1, bottom=0)
* Ignore config file
The config files can also be ignored by an argument from the command line,
'--ignore-config' or '-i'.
Fixes:
* [Jungfrau][Eiger] Clear UDP destination
Command line: udp_cleardst, API: clearUDPDestinations
Clearing udp destination also clears it in the FPGA now.
* [Eiger] Incorrect next frame number
Command line: nextframenumber, API: getNextFrameNumber/ setNextFrameNumber
Get next frame number for 10g was connected to 1g registers and gave
incorrect values. Fixed.
* [Mythen3][Gotthard2] System clock change effects
When changing the system clock (clkdiv 2), time settings should also be
affected (exptime, period etc.). Fixed.
[Gotthard2] System frequency should be same irrespective of timing source.
Fixed.
* [Mythen3] Kernel version compatibility test
Fix added to parse properly the kernel version with CET for corrected
version compatibility test.
* [Mythen3] Server crash for setting vthrehsold
Fixed.
* [Mythen3] Incorrect gaincaps
Setting threshold energy was overwriting gaincaps with settings enum. Fixed.
* [Ctb][Moench] Hostname fail in update mode.
Fixed
Changes:
* [Jungfrau] Temporary fix for stop in 6.1.1
Temporary fix introduced in 6.1.1 for not being able to start after a
stop command has been issued is removed. Reset core right after also has
been removed. It has been fixed in firmware instead.
* [Gotthard2] Clock Divider defaults
When chancing burst mode, clock dividers (2, 3 and 4) set to their
defaults according to burst mode.
* [Mythen3] DAC check for settings
Verify DAC values for each setting has been temporarily switched off
* [Mythen3] DAC min and max values
Vtrim minimum of 600 has been removed.
The threshold dacs minimum is 200 and maximum is 2400.
The other DACs minimum is 0 and maximum is 2800.
When out of range, will not throw, just a warning.
* [Mythen3] Vicin Dac changed to 800
* [Jungfrau][Moench][Ctb] PLL reset at server start up
PLL reset now at server start up.
* [Moench] ADC9257 Vref
ADC Vref voltage modified from 1.33V to 2V
* [Ctb] Allow all clock dividers for PLL
Fixed. For example, 133 MHz would not really be set previously. Fixed by
changing totaldiv from float to an integer.
Additional Features:
* Stop server startup errors
Stop servers now also check for errors at startup (including version
compatibility) and like the control server, it will translate to the
client when connecting for the first time (hostname command).
* [Jungfrau][Moench][Ctb] Additional server update process
Removes old server binary or target of linked file when updating
detector server for blackfin detectors as there is less space on blackfin.
Clearing up absolute and respawn path (removing double '/')
Raise error if server name to be copied is the same as final soft link name.
* [Moench][Ctb] 1 GbE Non blocking acquisition
Previously non blocking acquisition in 1 GbE would not send data.
This feature added now.
* [Gotthard2] Adapted to new HDI version
HDI module ID written to FPGA register
1.6. Simulator
--------------
* Command line arguments. Please refer to previous section on Detector Server.
* [Eiger] Only one executable
Only one executable for an Eiger virtual server. Master and top mode
can be provided via command line or config file to the detector server,
as well as via the client. See in Other New Features for more details.
One can start a module using:
eigerDetectorServer_virtual # reads default config file (top master)
eigerDetectorServer_virtual -i #ignores the config file (bottom slave)
* [Eiger][Junfrau][Gotthard2][Mythen3] Module Id
Added into udp header
* Minimum Configuration
One can setup with just:
hostname localhost
rx_hostname localhost
udp_dstip auto
* [Mythen3] Packet size
Fixed packet size calculation. Previously, sending only header with no data.
1.7. Receiver
-------------
Breaking API:
* Namespace sls
All the receiver source files have also been added to namespace sls.
* HDF5 and Binary writer version
Changed from 6.3 to 6.4
* Master file format to json
The format has been changed from ASCII to json.
* Geometry metadata
Added geometry (number of modules in each direction) to metadata in file.
* HDF5 Dataset name
Changed to just "data" to simplify for user
* File write
File write is disabled by default.
Fixes:
* Refactored and fixed minor issues
Including memory structure and udp sockets.
Fixed progress also in discard partial packaets mode and deactivated ports.
Fixed 200% progress.
Completely padded images now have detector type or version in metadata.
Fixed getting stuck at stop receiver when using zmq
Fixed clang compiler warnings
* Multiple files
This bug was introduced in v6.0.0, where 1 file was created per frame
after the first file. Fixed by resetting the number of frames in
current file when creating a new one.
* [Eiger] Datastream command order
The order of commands to set datastream from client mattered previously.
Datastream had to be set before 10GbE enable. Order does not matter anymore.
* Udp destination MAC
If it has been set before, changing udp_dstip will not update udp_dstmac.
Fixed to always set it in detector even if it had a value before.
Udp_dstmac can still be used to overwrite again. This is useful when
using a router for example.
* Stuck when using zmq
More often in 6.1.1, gets stuck at stop receiver.
* [Mythen3] Incorrect number of packets calculated or tengiga not set up
Runnig config second time (with tengiga=0, dr !=32, counters !=0x7)
calculated incorrect image size expected due to inconsistent copy of
detector parameters. Fixed
* Storage cells in receiver
Previously not updated in receiver. Fixed.
* Virtual HDF5 Parameter datasets
Corner case bug when frames caught is not a multiple of frames per file.
Not found in virtual image datasets. Fixed.
Changes:
* Master file created at end of acquisition
The file is now written at the end of acquisition. So if any metadata
is changed during an acquisition, it will reflect the last value.
* File name prefix
Slash '/' not allowed.
Additional Features:
* [Gotthard2] 25um image reconstruction in virtual HDF5
Virtual HDF5 reconstructs complete image by interleaving first module
(master) with second module (slave). First channel of master is first
channel of detector.
Requires firmware update to reverse channels of slaves.
* Memory size
Increased an internal fifo header by 8 bytes to align memory allocated for
to receive images for efficiency.
1.8. Gui
--------
* [Jungfrau][Eiger] Gap pixels
Enabled by default in the gui.
* High voltage moved from Developer tab to Settings tab.
* Gain plot zooming
Zooming disabled. Instead, it automatically zooms in when you zoom in
the main plot or if min and max of x and y axis set up in plot tab.
* [Mythen3] Inconsistent timing mode
Timing mode of the slaves should be discarded before squashing. Fixed.
* [Mythen3][Gotthard2] Crashes
Additional locking Added
2. On-board Detector Server Compatibility
2 On-board Detector Server Compatibility
==========================================
@ -849,16 +66,16 @@ This document describes the differences between v7.0.0.rc1 and v6.1.2
3. Firmware Requirements
3 Firmware Requirements
========================
Eiger 17.02.2022 (v30)
Eiger 20.02.2023 (v31)
Jungfrau 04.11.2022 (v1.4, HW v1.0)
03.11.2022 (v2.4, HW v2.0)
Mythen3 05.12.2022 (v1.4)
Mythen3 24.01.2023 (v1.4)
Gotthard2 23.11.2022 (v0.3)
@ -898,22 +115,22 @@ This document describes the differences between v7.0.0.rc1 and v6.1.2
4. Kernel Requirements
4 Kernel Requirements
======================
Blackfin
========
--------
Latest version: Fri Oct 29 00:00:00 2021
Older ones will work, but might have issues with programming firmware via
the package.
Nios
====
-----
Compatible version: Mon May 10 18:00:21 CEST 2021
Kernel Upgrade
==============
---------------
Eiger via bit files
Others via command
@ -926,7 +143,7 @@ This document describes the differences between v7.0.0.rc1 and v6.1.2
5. Download, Documentation & Support
5 Download, Documentation & Support
====================================
Download
@ -982,6 +199,9 @@ This document describes the differences between v7.0.0.rc1 and v6.1.2
https://slsdetectorgroup.github.io/devdoc/udpheader.html
https://slsdetectorgroup.github.io/devdoc/udpdetspec.html
slsReceiver Zmq Format:
https://slsdetectorgroup.github.io/devdoc/slsreceiver.html#zmq-json-header-format
TroubleShooting:
https://slsdetectorgroup.github.io/devdoc/troubleshooting.html
https://slsdetectorgroup.github.io/devdoc/troubleshooting.html#receiver-pc-tuning-options
@ -998,4 +218,3 @@ This document describes the differences between v7.0.0.rc1 and v6.1.2
dhanya.thattil@psi.ch
erik.frojdh@psi.ch

2
cmk.sh
View File

@ -33,7 +33,7 @@ Usage: $0 [-b] [-c] [-d <HDF5 directory>] [e] [g] [-h] [i] [-j <Number of thread
-c: Clean
-d: HDF5 Custom Directory
-e: Debug mode
-g: Build/Rebuilds only gui
-g: Build/Rebuilds gui
-h: Builds/Rebuilds Cmake files with HDF5 package
-i: Builds tests
-j: Number of threads to compile through

View File

@ -116,12 +116,16 @@ Program from console
# Always ensure that the client and server software are of the same release.
# copies server from tftp folder of pc, links new server to jungfrauDetectorServer,
# copies server, links new server to jungfrauDetectorServer,
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga,
# reboots
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
sls_detector_put update jungfrauDetectorServervxxx pcxxx xx.pof
# v6.1.1 - present (copies server from the full path provided)
sls_detector_put update jungfrauDetectorServervxxx xx.pof
# Or only program firmware
sls_detector_put programfpga xxx.pof
@ -182,11 +186,16 @@ Program from console
# Always ensure that the client and server software are of the same release.
# copies server from tftp folder of pc, links new server to mythen3DetectorServer,
# programs fpga,
# reboots
# copies server, links new server to mythen3DetectorServer,
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
sls_detector_put update mythen3DetectorServervxxx pcxxx xxx.rbf
# v6.1.1 - present (copies server from the full path provided)
sls_detector_put update mythen3DetectorServervxxx xxx.rbf
# Or only program firmware
sls_detector_put programfpga xxx.rbf
@ -211,11 +220,16 @@ Program from console
# Always ensure that the client and server software are of the same release.
# copies server from tftp folder of pc, links new server to gotthard2DetectorServer,
# programs fpga,
# reboots
# copies server, links new server to gotthard2DetectorServer,
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
sls_detector_put update gotthard2DetectorServervxxx pcxxx xxx.rbf
# v6.1.1 - present (copies server from the full path provided)
sls_detector_put update gotthard2DetectorServervxxx xxx.rbf
# Or only program firmware
sls_detector_put programfpga xxx.rbf
@ -257,12 +271,16 @@ Program from console
# Always ensure that the client and server software are of the same release.
# copies server from tftp folder of pc, links new server to moenchDetectorServer,
# copies server, links new server to moenchDetectorServer,
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga,
# reboots
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
sls_detector_put update moenchDetectorServervxxx pcxxx xx.pof
# v6.1.1 - present (copies server from the full path provided)
sls_detector_put update moenchDetectorServervxxx xx.pof
# Or only program firmware
sls_detector_put programfpga xxx.pof
@ -288,12 +306,16 @@ Program from console
# Always ensure that the client and server software are of the same release.
# copies server from tftp folder of pc, links new server to ctbDetectorServer,
# copies server, links new server to ctbDetectorServer,
# removes old server from respawn, sets up new lnked server to respawn
# programs fpga,
# reboots
# programs fpga, reboots
# v5.0.0 - 6.0.0 (copies server from tftp folder of the pc)
sls_detector_put update ctbDetectorServervxxx pcxxx xx.pof
# v6.1.1 - present (copies server from the full path provided)
sls_detector_put update ctbDetectorServervxxx xx.pof
# Or only program firmware
sls_detector_put programfpga xxx.pof

View File

@ -1,14 +1,3 @@
.. note ::
The default branch of our git repository is developer. It contains the
latest development version. It is expected to compile and work but
features might be added or tweaked. In some cases the API might also change
without being communicated. If absolute stability of the API is needed please
use one of the release versions.
.. warning ::
Before building from source make sure that you have the
@ -161,7 +150,7 @@ Build using in-built cmk.sh script
-c: Clean
-d: HDF5 Custom Directory
-e: Debug mode
-g: Build/Rebuilds only gui
-g: Build/Rebuilds gui
-h: Builds/Rebuilds Cmake files with HDF5 package
-i: Builds tests
-j: Number of threads to compile through
@ -178,17 +167,17 @@ Build using in-built cmk.sh script
-z: Moench zmq processor
# get all options
# display all options
./cmk.sh -?
# new build and compile in parallel:
./cmk.sh -bj5
# new build and compile in parallel (recommended basic option):
./cmk.sh -cbj5
# new build, python and compile in parallel:
./cmk.sh -bpj5
./cmk.sh -cbpj5
#To use the system zmq (/usr/lib64) instead
./cmk.sh -bj5 -q /usr/lib64
./cmk.sh -cbj5 -q /usr/lib64

View File

@ -224,6 +224,45 @@ ZMQ: Json Header Format
+--------------+----------------------------------------------+
SLS Receiver Header Format
--------------------------
It is 112 bytes and consists of:
* 48 bytes of the SLS Detector Header (described in :ref:`the current detector header <detector udp header>`)
* 64 bytes of packet mask
.. code-block:: cpp
typedef struct {
uint64_t frameNumber;
uint32_t expLength;
uint32_t packetNumber;
uint64_t detSpec1;
uint64_t timestamp;
uint16_t modId;
uint16_t row;
uint16_t column;
uint16_t detSpec2;
uint32_t detSpec3;
uint16_t detSpec4;
uint8_t detType;
uint8_t version;
} sls_detector_header;
struct sls_receiver_header {
sls_detector_header detHeader; /**< is the detector header */
sls_bitset packetsMask; /**< is the packets caught bit mask */
};
.. note ::
| The packetNumber in the SLS Receiver Header will be modified to number of packets caught by receiver for that frame. For eg. Jungfrau will have 128 packets per frame. If it is less, then this is a partial frame due to missing packets.
| Furthermore, the bit mask will specify which packets have been received.
File format
--------------
@ -256,8 +295,6 @@ Some file name examples:
Each acquisition will create a master file that can be enabled/disabled using **fmaster**. This should have parameters relevant to the acquisition.
SLS Receiver Header consist of SLS Detector Header + 64 bytes of bitmask, altogether 112 bytes. The packetNumber in the sls detector header part, will be updated to number of packets caught by receiver for that frame. Furthermore, the bit mask will specify which packets have been received.
**Binary file format**
This is the default file format.

View File

@ -11,7 +11,7 @@ Current Version
**v2.0 (slsDetectorPackage v7.0.0+)**
.. table:: <---------------------------------------------------- 8 bytes ---------------------------------------------------->
.. table:: <---------------------------------------------------- 8 bytes per row --------------------------------------------->
:align: center
:widths: 30,30,30,15,15

View File

@ -1,18 +1,18 @@
# detector hostname
hostname localhost:1910
# receiver hostname
rx_hostname mpc1922:2010
# udp destination ports
udp_dstport 50010
# udp destination ip from rx_hostname
udp_dstip auto
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
# receiver hostname
rx_hostname mpc1922:2010
# udp destination ip from rx_hostname
udp_dstip auto
# output file directory
fpath /tmp
@ -27,418 +27,7 @@ dbitclk 40
# patterns
patword 0x0000 0x0000000000000000
patword 0x0001 0x0000000000000000
patword 0x0002 0x0008000900080000
patword 0x0003 0x0008000900080000
patword 0x0004 0x0008000900080000
patword 0x0005 0x0008000900080000
patword 0x0006 0x0008000900080000
patword 0x0007 0x0008000900080000
patword 0x0008 0x0008000900080000
patword 0x0009 0x0008000900080000
patword 0x000a 0x0008000900080000
patword 0x000b 0x0008000900080000
patword 0x000c 0x0008000900080000
patword 0x000d 0x0008000900080000
patword 0x000e 0x0008000900080000
patword 0x000f 0x0008000900080000
patword 0x0010 0x0008000900080000
patword 0x0011 0x0008000900080000
patword 0x0012 0x0008000900080000
patword 0x0013 0x0008000900080000
patword 0x0014 0x0008000900080000
patword 0x0015 0x0008000900080000
patword 0x0016 0x0008400900080020
patword 0x0017 0x0008400900080020
patword 0x0018 0x0008599f0418503a
patword 0x0019 0x0008599f0418503a
patword 0x001a 0x0108599f0418503a
patword 0x001b 0x0108599f0418503a
patword 0x001c 0x0108599f0418503a
patword 0x001d 0x0108599f0418503a
patword 0x001e 0x0108599f0418503a
patword 0x001f 0x0108599f0418503a
patword 0x0020 0x0108599f0418503a
patword 0x0021 0x0108599f0418503a
patword 0x0022 0x0108599f0418503a
patword 0x0023 0x0108599f0418503a
patword 0x0024 0x0108599f0418503a
patword 0x0025 0x0108599f0418503a
patword 0x0026 0x0108599f0418503a
patword 0x0027 0x0108599f0418503a
patword 0x0028 0x0108599f0418503a
patword 0x0029 0x0108599f0418503a
patword 0x002a 0x0108599f0418503a
patword 0x002b 0x0108599f0418503a
patword 0x002c 0x0108599f0418503a
patword 0x002d 0x0108599f0418503a
patword 0x002e 0x0108599f0418503a
patword 0x002f 0x0108599f0418503a
patword 0x0030 0x0108599f0418503a
patword 0x0031 0x0108599f0418503a
patword 0x0032 0x0108599f0418503a
patword 0x0033 0x0108599f0418503a
patword 0x0034 0x0108599f0418503a
patword 0x0035 0x0108599f0418503a
patword 0x0036 0x0108599f0418503a
patword 0x0037 0x0108599f0418503a
patword 0x0038 0x0108599f0418503a
patword 0x0039 0x0108599f0418503a
patword 0x003a 0x0108599f0418503a
patword 0x003b 0x0108599f0418503a
patword 0x003c 0x0108599f0418503a
patword 0x003d 0x0108599f0418503a
patword 0x003e 0x0108599f0418503a
patword 0x003f 0x0108599f0418503a
patword 0x0040 0x0108599f0418503a
patword 0x0041 0x0108599f0418503a
patword 0x0042 0x0108599f0418503a
patword 0x0043 0x0108599f0418503a
patword 0x0044 0x0108599f0418503a
patword 0x0045 0x0108599f0418503a
patword 0x0046 0x0108599f0418503a
patword 0x0047 0x0108599f0418503a
patword 0x0048 0x0108599f0418503a
patword 0x0049 0x0108599f0418503a
patword 0x004a 0x0108599f0418503a
patword 0x004b 0x0108599f0418503a
patword 0x004c 0x0108599f0418503a
patword 0x004d 0x0108599f0418503a
patword 0x004e 0x0108599f0418503a
patword 0x004f 0x0108599f0418503a
patword 0x0050 0x0108599f0418503a
patword 0x0051 0x0108599f0418503a
patword 0x0052 0x0108599f0418503a
patword 0x0053 0x0108599f0418503a
patword 0x0054 0x0108599f0418503a
patword 0x0055 0x0108599f0418503a
patword 0x0056 0x0108599f0418503a
patword 0x0057 0x0108599f0418503a
patword 0x0058 0x0108599f0418503a
patword 0x0059 0x0108599f0418503a
patword 0x005a 0x0108599f0418503a
patword 0x005b 0x0108599f0418503a
patword 0x005c 0x0108599f0418503a
patword 0x005d 0x0108599f0418503a
patword 0x005e 0x0108599f0418503a
patword 0x005f 0x0108599f0418503a
patword 0x0060 0x0108599f0418503a
patword 0x0061 0x0108599f0418503a
patword 0x0062 0x0108599f0418503a
patword 0x0063 0x0108599f0418503a
patword 0x0064 0x0108599f0418503a
patword 0x0065 0x0108599f0418503a
patword 0x0066 0x0108599f0418503a
patword 0x0067 0x0108599f0418503a
patword 0x0068 0x0108599f0418503a
patword 0x0069 0x0108599f0418503a
patword 0x006a 0x0108599f0418503a
patword 0x006b 0x0108599f0418503a
patword 0x006c 0x0108599f0418503a
patword 0x006d 0x0108599f0418503a
patword 0x006e 0x0108599f0418503a
patword 0x006f 0x0108599f0418503a
patword 0x0070 0x0108599f0418503a
patword 0x0071 0x0108599f0418503a
patword 0x0072 0x0108599f0418503a
patword 0x0073 0x0108599f0418503a
patword 0x0074 0x0108599f0418503a
patword 0x0075 0x0108599f0418503a
patword 0x0076 0x0108599f0418503a
patword 0x0077 0x0108599f0418503a
patword 0x0078 0x0108599f0418503a
patword 0x0079 0x0108599f0418503a
patword 0x007a 0x0108599f0418503a
patword 0x007b 0x0108599f0418503a
patword 0x007c 0x0108599f0418503a
patword 0x007d 0x0108599f0418503a
patword 0x007e 0x010859960418503a
patword 0x007f 0x010859960418503a
patword 0x0080 0x010859960418503a
patword 0x0081 0x010859960418503a
patword 0x0082 0x010859960418503a
patword 0x0083 0x010859960418503a
patword 0x0084 0x010859960418503a
patword 0x0085 0x010859960418503a
patword 0x0086 0x010859960418503a
patword 0x0087 0x010859960418503a
patword 0x0088 0x010859960418503a
patword 0x0089 0x010859960418503a
patword 0x008a 0x010859960418503a
patword 0x008b 0x010859960418503a
patword 0x008c 0x010859960418503a
patword 0x008d 0x010859960418503a
patword 0x008e 0x010859960418503a
patword 0x008f 0x010859960418503a
patword 0x0090 0x010859960418503a
patword 0x0091 0x010859960418503a
patword 0x0092 0x010819960418501a
patword 0x0093 0x010819960418501a
patword 0x0094 0x010819960418501a
patword 0x0095 0x010819960418501a
patword 0x0096 0x030819960418501a
patword 0x0097 0x030819960418501a
patword 0x0098 0x030819960418501a
patword 0x0099 0x030819960418501a
patword 0x009a 0x030819960418501a
patword 0x009b 0x030819960418501a
patword 0x009c 0x030819960418501a
patword 0x009d 0x030819960418501a
patword 0x009e 0x030819960418501a
patword 0x009f 0x030819960418501a
patword 0x00a0 0x030819960418501a
patword 0x00a1 0x030819960418501a
patword 0x00a2 0x030819960418501a
patword 0x00a3 0x030819960418501a
patword 0x00a4 0x030819960418501a
patword 0x00a5 0x030819960418501a
patword 0x00a6 0x030819960418501a
patword 0x00a7 0x030819960418501a
patword 0x00a8 0x030819960418501a
patword 0x00a9 0x030819960418501a
patword 0x00aa 0x030819960418501a
patword 0x00ab 0x030819960418501a
patword 0x00ac 0x030819960008501a
patword 0x00ad 0x030819960008501a
patword 0x00ae 0x030819960008501a
patword 0x00af 0x030819960008501a
patword 0x00b0 0x030819960008501a
patword 0x00b1 0x030819960008501a
patword 0x00b2 0x030819960008501a
patword 0x00b3 0x030819960008501a
patword 0x00b4 0x030819960008501a
patword 0x00b5 0x030819960008501a
patword 0x00b6 0x030819960008501a
patword 0x00b7 0x030819960008501a
patword 0x00b8 0x030819960008501a
patword 0x00b9 0x030819960008501a
patword 0x00ba 0x030819960008501a
patword 0x00bb 0x030819960008501a
patword 0x00bc 0x030819960008501a
patword 0x00bd 0x030819960008501a
patword 0x00be 0x030819960008501a
patword 0x00bf 0x030819960008501a
patword 0x00c0 0x0308199f0008501a
patword 0x00c1 0x0308199f0008501a
patword 0x00c2 0x0308199f0008501a
patword 0x00c3 0x0308199f0008501a
patword 0x00c4 0x0308199f0008501a
patword 0x00c5 0x0308199f0008501a
patword 0x00c6 0x0308199f0008501a
patword 0x00c7 0x0308199f0008501a
patword 0x00c8 0x0308199f0008501a
patword 0x00c9 0x0308199f0008501a
patword 0x00ca 0x0308199f0008501a
patword 0x00cb 0x0308199f0008501a
patword 0x00cc 0x0308199f0008501a
patword 0x00cd 0x0308199f0008501a
patword 0x00ce 0x0308199f0008501a
patword 0x00cf 0x0308199f0008501a
patword 0x00d0 0x0308199f0008501a
patword 0x00d1 0x0308199f0008501a
patword 0x00d2 0x0308199f0008501a
patword 0x00d3 0x0308199f0008501a
patword 0x00d4 0x0308599f0008503a
patword 0x00d5 0x0308599f0008503a
patword 0x00d6 0x030c599f000850ba
patword 0x00d7 0x030c599f000850ba
patword 0x00d8 0x030c599f000850ba
patword 0x00d9 0x030c599f000850ba
patword 0x00da 0x030c599f000850ba
patword 0x00db 0x030c599f000850ba
patword 0x00dc 0x030c599f000850ba
patword 0x00dd 0x030c599f000850ba
patword 0x00de 0x030c599f000850ba
patword 0x00df 0x030c599f000850ba
patword 0x00e0 0x030c599f000850ba
patword 0x00e1 0x030c599f000850ba
patword 0x00e2 0x030c599f000850ba
patword 0x00e3 0x030c599f000850ba
patword 0x00e4 0x030c599f000850ba
patword 0x00e5 0x030c599f000850ba
patword 0x00e6 0x030c599f000850ba
patword 0x00e7 0x030c599f000850ba
patword 0x00e8 0x030c599f000850ba
patword 0x00e9 0x030c599f000850ba
patword 0x00ea 0x030c799f010858ba
patword 0x00eb 0x030c799f010858ba
patword 0x00ec 0x030c599f000850ba
patword 0x00ed 0x030c599f000850ba
patword 0x00ee 0x030c599f000850ba
patword 0x00ef 0x030c599f000850ba
patword 0x00f0 0x030c599f000850ba
patword 0x00f1 0x030c599f000850ba
patword 0x00f2 0x030c599f000850ba
patword 0x00f3 0x030c599f000850ba
patword 0x00f4 0x030c599f000850ba
patword 0x00f5 0x030c599f000850ba
patword 0x00f6 0x030c599f000850ba
patword 0x00f7 0x030c599f000850ba
patword 0x00f8 0x030c599f000850ba
patword 0x00f9 0x030c599f000850ba
patword 0x00fa 0x030c599f000850ba
patword 0x00fb 0x030c599f000850ba
patword 0x00fc 0x030c599f000850ba
patword 0x00fd 0x030c599f000850ba
patword 0x00fe 0x030c599f000850ba
patword 0x00ff 0x030c599f000850ba
patword 0x0100 0x030c599f000850ba
patword 0x0101 0x030c599f000850ba
patword 0x0102 0x030c599f400850ba
patword 0x0103 0x030c599f400850ba
patword 0x0104 0x030c599f600850ba
patword 0x0105 0x030c599f400850ba
patword 0x0106 0x030c599f400850ba
patword 0x0107 0x030c599f400850ba
patword 0x0108 0x870c599f682e50ba
patword 0x0109 0x870c599f482850ba
patword 0x010a 0x870c599f000e50ba
patword 0x010b 0x870c599f000850ba
patword 0x010c 0x870c599f000e50ba
patword 0x010d 0x870c599f000850ba
patword 0x010e 0x870c599f000e50ba
patword 0x010f 0x870c599f000850ba
patword 0x0110 0x870c599f000e50ba
patword 0x0111 0x870c599f000850ba
patword 0x0112 0x870c599f000e50ba
patword 0x0113 0x870c599f000850ba
patword 0x0114 0x870c599f000e50ba
patword 0x0115 0x870c599f000850ba
patword 0x0116 0x870c599f000e50ba
patword 0x0117 0x870c599f000850ba
patword 0x0118 0x870c599f000e50ba
patword 0x0119 0x870c599f000850ba
patword 0x011a 0x870c599f000e50ba
patword 0x011b 0x870c599f000850ba
patword 0x011c 0x870c599f000e50ba
patword 0x011d 0x870c599f000850ba
patword 0x011e 0x870c599f000e50ba
patword 0x011f 0x870c599f000850ba
patword 0x0120 0x870c599f000e50ba
patword 0x0121 0x870c599f000850ba
patword 0x0122 0x870c599f200e50ba
patword 0x0123 0x870c599f000850ba
patword 0x0124 0x870c599f000e50ba
patword 0x0125 0x870c599f000850ba
patword 0x0126 0x870c599f000e50ba
patword 0x0127 0x870c599f000850ba
patword 0x0128 0x870c599f000e50ba
patword 0x0129 0x870c599f000850ba
patword 0x012a 0x870c599f000e50ba
patword 0x012b 0x870c599f000850ba
patword 0x012c 0x870c599f000e50ba
patword 0x012d 0x870c599f000850ba
patword 0x012e 0x870c599f000e50ba
patword 0x012f 0x870c599f000850ba
patword 0x0130 0x870c599f000e50ba
patword 0x0131 0x870c599f000850ba
patword 0x0132 0x870c599f000e50ba
patword 0x0133 0x870c599f000850ba
patword 0x0134 0x870c599f000e50ba
patword 0x0135 0x870c599f000850ba
patword 0x0136 0x870c599f000e50ba
patword 0x0137 0x870c599f000850ba
patword 0x0138 0x870c599f000e50ba
patword 0x0139 0x870c599f000850ba
patword 0x013a 0x870c599f282e50ba
patword 0x013b 0x870c599f082850ba
patword 0x013c 0x870c599f000e50ba
patword 0x013d 0x870c599f000850ba
patword 0x013e 0x870c599f000e50ba
patword 0x013f 0x870c599f000850ba
patword 0x0140 0x870c599f000e50ba
patword 0x0141 0x870c599f000850ba
patword 0x0142 0x870c599f000e50ba
patword 0x0143 0x870c599f000850ba
patword 0x0144 0x870c599f000e50ba
patword 0x0145 0x870c599f000850ba
patword 0x0146 0x870c599f000e50ba
patword 0x0147 0x870c599f000850ba
patword 0x0148 0x870c599f000e50ba
patword 0x0149 0x870c599f000850ba
patword 0x014a 0x870c599f000e50ba
patword 0x014b 0x870c599f000850ba
patword 0x014c 0x870c599f000e50ba
patword 0x014d 0x870c599f000850ba
patword 0x014e 0x870c599f000e50ba
patword 0x014f 0x870c599f000850ba
patword 0x0150 0x870c599f000e50ba
patword 0x0151 0x870c599f000850ba
patword 0x0152 0x870c599f000e50ba
patword 0x0153 0x870c599f000850ba
patword 0x0154 0x870c599f200e50ba
patword 0x0155 0x870c599f000850ba
patword 0x0156 0x870c599f000e50ba
patword 0x0157 0x870c599f000850ba
patword 0x0158 0x870c599f000e50ba
patword 0x0159 0x870c599f000850ba
patword 0x015a 0x870c599f000e50ba
patword 0x015b 0x870c599f000850ba
patword 0x015c 0x870c599f000e50ba
patword 0x015d 0x870c599f000850ba
patword 0x015e 0x870c599f000e50ba
patword 0x015f 0x870c599f000850ba
patword 0x0160 0x870c599f000e50ba
patword 0x0161 0x870c599f000850ba
patword 0x0162 0x870c599f000e50ba
patword 0x0163 0x870c599f000850ba
patword 0x0164 0x870c599f000e50ba
patword 0x0165 0x870c599f000850ba
patword 0x0166 0x870c599f000e50ba
patword 0x0167 0x870c599f000850ba
patword 0x0168 0x870c599f000e50ba
patword 0x0169 0x870c599f000850ba
patword 0x016a 0x870c599f000e50ba
patword 0x016b 0x870c599f000850ba
patword 0x016c 0x070c599f000850ba
patword 0x016d 0x070c599f000850ba
patword 0x016e 0x000c599f000850ba
patword 0x016f 0x000c599f000850ba
patword 0x0170 0x0008599f200e503a
patword 0x0171 0x0008599f0008503a
patword 0x0172 0x0008599f200e503a
patword 0x0173 0x0008599f0008503a
patword 0x0174 0x0008599f0008503a
patword 0x0175 0x0008599f0008503a
patword 0x0176 0x0008599f0008503a
patword 0x0177 0x0008599f0008503a
patword 0x0178 0x0008599f0008503a
patword 0x0179 0x0008599f0008503a
patword 0x017a 0x0008599f0008503a
patword 0x017b 0x0008599f0008503a
patword 0x017c 0x0008599f0008503a
patword 0x017d 0x0008599f0008503a
patword 0x017e 0x0008599f0008503a
patword 0x017f 0x0008599f0008503a
patword 0x0180 0x0008599f0008503a
patword 0x0181 0x0008599f0008503a
patword 0x0182 0x0008599f0008503a
patword 0x0183 0x0008599f0008503a
patword 0x0184 0x0008599f0008503a
patword 0x0185 0x0008599f0008503a
patword 0x0186 0x0008599f0008503a
patword 0x0187 0x0008599f0008503a
patword 0x0188 0x0008599f0008503a
patword 0x0189 0x0008599f0008503a
patword 0x018a 0x0008599f0008503a
patword 0x018b 0x0008599f0008503a
patword 0x018c 0x0008599f0008503a
patword 0x018d 0x0008599f0008503a
patioctrl 0x8f0effff6dbffdbf
patlimits 0x0000 0x018c
patloop 0 0x013a 0x016b
patnloop 0 0x199
patloop 1 0x0400 0x0400
patnloop 1 0
patloop 2 0x0400 0x0400
patnloop 2 0
patwait 0 0x00aa
patwaittime 0 10000
patwait 1 0x0400
patwaittime 1 0
patwait 2 0x0400
patwaittime 2 0
pattern /tmp/pattern.pat
# dacs
dac 6 800

View File

@ -1,13 +1,13 @@
# detector hostname
hostname localhost:1900
# receiver hostname
rx_hostname mpc1922:2000
# udp destination ports
udp_dstport 50000
udp_dstport2 50001
# receiver hostname
rx_hostname mpc1922:2000
# udp destination ip from rx_hostname
udp_dstip auto

View File

@ -1,15 +1,15 @@
# detector hostname
hostname localhost:1900+localhost:1902+
# receiver hostname
rx_hostname mpc1922:2000+mpc1922:2001+
# udp destination ports
0:udp_dstport 50000
0:udp_dstport2 50001
1:udp_dstport 50002
1:udp_dstport2 50003
# receiver hostname
rx_hostname mpc1922:2000+mpc1922:2001+
# udp destination ip from rx_hostname
udp_dstip auto

View File

@ -1,18 +1,18 @@
# detector hostname
hostname localhost:1904
# receiver hostname
rx_hostname mpc1922:2004
# udp destination ports
udp_dstport 50004
# udp destination ip from rx_hostname
udp_dstip auto
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
# receiver hostname
rx_hostname mpc1922:2004
# udp destination ip from rx_hostname
udp_dstip auto
# output file directory
fpath /tmp

View File

@ -1,24 +1,12 @@
# detector hostname
hostname localhost:1914
# receiver hostname
rx_hostname mpc1922:2014
# udp destination ports
udp_dstport 50014
# udp destination ip from rx_hostname
udp_dstip auto
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
# output file directory
fpath /tmp
# disable file writing
fwrite 0
# enable 2nd interface for veto debugging
# udp destination port for veto
udp_dstport2 50015
@ -27,6 +15,18 @@ udp_dstip2 auto
# udp source ip (same subnet as udp_dstip)
udp_srcip2 192.168.1.100
# receiver hostname
rx_hostname mpc1922:2014
# udp destination ip from rx_hostname
udp_dstip auto
# output file directory
fpath /tmp
# disable file writing
fwrite 0
# to enable 2nd interface for veto debugging
numinterfaces 2

View File

@ -1,21 +1,21 @@
# detector hostname
hostname localhost:1906
# receiver hostname
rx_hostname mpc1922:2006
# udp destination ports
udp_dstport 50006
udp_dstport2 50007
# udp destination ip from rx_hostname
udp_dstip auto
udp_dstip2 auto
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
udp_srcip2 192.168.1.100
# receiver hostname
rx_hostname mpc1922:2006
# udp destination ip from rx_hostname
udp_dstip auto
udp_dstip2 auto
# output file directory
fpath /tmp

View File

@ -4,13 +4,6 @@ detsize 2048 1024
# detector hostname
virtual 4 1952
# receiver hostname and tcpports
0:rx_tcpport 1970
1:rx_tcpport 1971
2:rx_tcpport 1972
3:rx_tcpport 1973
rx_hostname mpc1922
# udp destination ports
0:udp_dstport2 50001
0:udp_dstport2 50002
@ -21,14 +14,21 @@ rx_hostname mpc1922
3:udp_dstport 50007
3:udp_dstport2 50008
# udp destination ip from rx_hostname
udp_dstip auto
udp_dstip2 auto
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
udp_srcip2 192.168.1.100
# receiver hostname and tcpports
0:rx_tcpport 1970
1:rx_tcpport 1971
2:rx_tcpport 1972
3:rx_tcpport 1973
rx_hostname mpc1922
# udp destination ip from rx_hostname
udp_dstip auto
udp_dstip2 auto
# transmission delay frame
0:txndelay_frame 0
1:txndelay_frame 1

View File

@ -1,18 +1,18 @@
# detector hostname
hostname localhost:1908
# receiver hostname
rx_hostname mpc1922:2008
# udp destination ports
udp_dstport 50008
# udp destination ip from rx_hostname
udp_dstip auto
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
# receiver hostname
rx_hostname mpc1922:2008
# udp destination ip from rx_hostname
udp_dstip auto
# output file directory
fpath /tmp

View File

@ -1,18 +1,18 @@
# detector hostname
hostname localhost:1912
# receiver hostname
rx_hostname mpc1922:2012
# udp destination ports
udp_dstport 50012
# udp destination ip from rx_hostname
udp_dstip auto
# udp source ip (same subnet as udp_dstip)
udp_srcip 192.168.1.100
# receiver hostname
rx_hostname mpc1922:2012
# udp destination ip from rx_hostname
udp_dstip auto
# output file directory
fpath /tmp

View File

@ -34,6 +34,7 @@ set( PYTHON_FILES
slsdet/eiger.py
slsdet/enums.py
slsdet/errors.py
slsdet/gaincaps.py
slsdet/gotthard.py
slsdet/pattern.py
slsdet/gotthard2.py

View File

@ -2,7 +2,7 @@
# Copyright (C) 2021 Contributors to the SLS Detector Package
import subprocess
import locale
out = subprocess.run(['g', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
out = subprocess.run(['sls_detector_get', 'list'], stdout = subprocess.PIPE, encoding=locale.getpreferredencoding())
cmd = out.stdout.splitlines()
cmd.pop(0)
@ -99,7 +99,6 @@ intentionally_missing = [
'temp_slowadc',
'temp_sodl',
'temp_sodr',
'trigger', #use sendSoftwareTrigger
'update', #use updateServerAndFirmare
'udp_validate', #use validateUdpConfiguration
'udp_reconfigure', #use reconfigureUdpDestination

View File

@ -11,7 +11,7 @@ from .gotthard2 import Gotthard2
from .gotthard import Gotthard
from .moench import Moench
from .pattern import Pattern, patternParameters
from .gaincaps import Mythen3GainCapsWrapper
import _slsdet
xy = _slsdet.xy

View File

@ -26,6 +26,7 @@ SHORT_STR_LENGTH=20
MAX_PATTERN_LENGTH=0x2000
MAX_PATTERN_LEVELS=6
M3_MAX_PATTERN_LEVELS=3
MAX_NUM_COUNTERS=3
DEFAULT_STREAMING_TIMER_IN_MS=500
NUM_RX_THREAD_IDS=9
MAX_NUM_PACKETS=512

View File

@ -16,6 +16,7 @@ defs = slsDetectorDefs
from .utils import element_if_equal, all_equal, get_set_bits, list_to_bitmask
from .utils import Geometry, to_geo, element, reduce_time, is_iterable, hostname_list
from _slsdet import xy
from .gaincaps import Mythen3GainCapsWrapper
from . import utils as ut
from .proxy import JsonProxy, SlowAdcProxy, ClkDivProxy, MaxPhaseProxy, ClkFreqProxy, PatLoopProxy, PatNLoopProxy, PatWaitProxy, PatWaitTimeProxy
from .registers import Register, Adc_register
@ -229,9 +230,10 @@ class Detector(CppDetectorApi):
@element
def hardwareversion(self):
"""
[Jungfrau][Gotthard2][Myhten3][Gotthard][Ctb][Moench] Hardware version of detector.
[Jungfrau][Moench][Gotthard2][Myhten3][Gotthard][Ctb] Hardware version of detector. \n
[Eiger] Hardware version of front FPGA on detector.
"""
return ut.lhex(self.getHardwareVersion())
return self.getHardwareVersion()
@property
@element
@ -263,6 +265,12 @@ class Detector(CppDetectorApi):
"""Receiver version """
return self.getReceiverVersion()
@property
@element
def serialnumber(self):
"""Jungfrau][Gotthard][Mythen3][Gotthard2][CTB][Moench] Serial number of detector """
return ut.lhex(self.getSerialNumber())
@property
@element
def rx_threads(self):
@ -298,7 +306,7 @@ class Detector(CppDetectorApi):
-----
[Eiger] Options: 4, 8, 12, 16, 32. If set to 32, also sets clkdivider to 2 (quarter speed), else to 0 (full speed)\n
[Mythen3] Options: 8, 16, 32 \n
[Jungfrau][Gotthard][Ctb][Moench][Mythen3][Gotthard2] 16
[Jungfrau][Moench][Gotthard][Ctb][Mythen3][Gotthard2] 16
"""
return self.getDynamicRange()
@ -356,10 +364,9 @@ class Detector(CppDetectorApi):
-----
[Eiger] Use threshold command to load settings
[Jungfrau] GAIN0, HIGHGAIN0 \n
[Jungfrau][Moench] GAIN0, HIGHGAIN0 \n
[Gotthard] DYNAMICGAIN, HIGHGAIN, LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n
[Gotthard2] DYNAMICGAIN, FIXGAIN1, FIXGAIN2 \n
[Moench] G1_HIGHGAIN, G1_LOWGAIN, G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN, G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN \n
[Eiger] settings loaded from file found in settingspath
"""
return element_if_equal(self.getSettings())
@ -389,7 +396,7 @@ class Detector(CppDetectorApi):
@element
def framesl(self):
"""
[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] Number of frames left in acquisition.\n
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Number of frames left in acquisition.\n
[Gotthard2] only in continuous auto mode.
:setter: Not Implemented
@ -400,7 +407,7 @@ class Detector(CppDetectorApi):
@element
def framecounter(self):
"""
[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Number of frames from start run control.
[Jungfrau][Moench][Mythen3][Gotthard2][CTB] Number of frames from start run control.
Note
-----
@ -429,12 +436,11 @@ class Detector(CppDetectorApi):
@element
def powerchip(self):
"""
[Jungfrau][Mythen3][Gotthard2][Moench] Power the chip.
[Jungfrau][Moench][Mythen3][Gotthard2] Power the chip.
Note
----
[Moench] Default is disabled. \n
[Jungfrau] Default is disabled. Get will return power status. Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled. Will configure chip (only chip v1.1).\n
[Jungfrau][Moench] Default is disabled. Get will return power status. Can be off if temperature event occured (temperature over temp_threshold with temp_control enabled. Will configure chip (only chip v1.1).\n
[Mythen3][Gotthard2] Default is 1. If module not connected or wrong module, powerchip will fail.
"""
return self.getPowerChip()
@ -453,6 +459,56 @@ class Detector(CppDetectorApi):
def triggers(self, n_triggers):
self.setNumberOfTriggers(n_triggers)
def resetdacs(self, use_hardware_values):
self.resetToDefaultDacs(use_hardware_values)
def trigger(self):
self.sendSoftwareTrigger()
def blockingtrigger(self):
self.sendSoftwareTrigger(True)
@property
@element
def gaincaps(self):
"""
[Mythen3] Gain caps. Enum: M3_GainCaps \n
Note
----
Options: M3_GainCaps, M3_C15sh, M3_C30sh, M3_C50sh, M3_C225ACsh, M3_C15pre
Example
-------
>>> d.gaincaps
C15pre, C30sh
>>> d.gaincaps = M3_GainCaps.M3_C30sh
>>> d.gaincaps
C30sh
>>> d.gaincaps = M3_GainCaps.M3_C30sh | M3_GainCaps.M3_C15sh
>>> d.gaincaps
C15sh, C30sh
"""
res = [Mythen3GainCapsWrapper(it) for it in self.getGainCaps()]
return res
@gaincaps.setter
def gaincaps(self, caps):
#convert to int if called with Wrapper
if isinstance(caps, Mythen3GainCapsWrapper):
self.setGainCaps(caps.value)
elif isinstance(caps, dict):
corr = {}
for key, value in caps.items():
if isinstance(value, Mythen3GainCapsWrapper):
corr[key] = value.value
else:
corr[key] = value
ut.set_using_dict(self.setGainCaps, corr)
else:
self.setGainCaps(caps)
@property
def exptime(self):
"""
@ -500,7 +556,7 @@ class Detector(CppDetectorApi):
@exptime.setter
def exptime(self, t):
if self.type == detectorType.MYTHEN3 and is_iterable(t):
if self.type == detectorType.MYTHEN3 and is_iterable(t) and not isinstance(t,dict):
for i, v in enumerate(t):
if isinstance(v, int):
v = float(v)
@ -509,8 +565,6 @@ class Detector(CppDetectorApi):
ut.set_time_using_dict(self.setExptime, t)
@property
def period(self):
"""
@ -560,7 +614,7 @@ class Detector(CppDetectorApi):
@element
def periodl(self):
"""
[Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] Period left for current frame.
[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] Period left for current frame.
Note
-----
@ -582,7 +636,7 @@ class Detector(CppDetectorApi):
@element
def delay(self):
"""
[Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] Delay after trigger, accepts either a value in seconds, DurationWrapper or datetime.timedelta
[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] Delay after trigger, accepts either a value in seconds, DurationWrapper or datetime.timedelta
Note
-----
@ -627,7 +681,7 @@ class Detector(CppDetectorApi):
@element
def delayl(self):
"""
[Gotthard][Jungfrau][CTB][Moench][Mythen3][Gotthard2] Delay left after trigger during acquisition, accepts either a value in seconds, datetime.timedelta or DurationWrapper
[Gotthard][Jungfrau][Moench][CTB][Mythen3][Gotthard2] Delay left after trigger during acquisition, accepts either a value in seconds, datetime.timedelta or DurationWrapper
Note
-----
@ -649,6 +703,10 @@ class Detector(CppDetectorApi):
"""Start detector acquisition. Status changes to RUNNING or WAITING and automatically returns to idle at the end of acquisition."""
self.startDetector()
def clearbusy(self):
"""If acquisition aborted during acquire command, use this to clear acquiring flag in shared memory before starting next acquisition"""
self.clearAcquiringFlag()
def rx_start(self):
"""Starts receiver listener for detector data packets and create a data file (if file write enabled)."""
self.startReceiver()
@ -682,7 +740,7 @@ class Detector(CppDetectorApi):
@element
def txdelay(self):
"""
[Eiger][Jungfrau][Mythen3] Set transmission delay for all modules in the detector using the step size provided.
[Eiger][Jungfrau][Moench][Mythen3] Set transmission delay for all modules in the detector using the step size provided.
Note
----
@ -690,7 +748,7 @@ class Detector(CppDetectorApi):
\t\t[Eiger] txdelay_left to (2 * mod_index * n_delay), \n
\t\t[Eiger] txdelay_right to ((2 * mod_index + 1) * n_delay) and \n
\t\t[Eiger] txdelay_frame to (2 *num_modules * n_delay) \n
\t\t[Jungfrau][Mythen3] txdelay_frame to (num_modules * n_delay)\n\n
\t\t[Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules * n_delay)\n\n
Please refer txdelay_left, txdelay_right and txdelay_frame for details.
"""
return self.getTransmissionDelay()
@ -703,11 +761,11 @@ class Detector(CppDetectorApi):
@element
def txdelay_frame(self):
"""
[Eiger][Jungfrau][Mythen3] Transmission delay of first udp packet being streamed out of the module.\n
[Eiger][Jungfrau][Moench][Mythen3] Transmission delay of first udp packet being streamed out of the module.\n
Note
----
[Jungfrau] [0-31] Each value represents 1 ms. \n
[Jungfrau][Moench] [0-31] Each value represents 1 ms. \n
[Eiger] Additional delay to txdelay_left and txdelay_right. Each value represents 10ns. Typical value is 50000. \n
[Mythen3] [0-16777215] Each value represents 8 ns (125 MHz clock), max is 134 ms.
"""
@ -890,7 +948,7 @@ class Detector(CppDetectorApi):
@property
@element
def numinterfaces(self):
"""[Jungfrau][Gotthard2] Number of udp interfaces to stream data from detector. Default is 1.
"""[Jungfrau][Moench][Gotthard2] Number of udp interfaces to stream data from detector. Default is 1.
Note
-----
@ -1236,11 +1294,11 @@ class Detector(CppDetectorApi):
@element
def udp_dstip2(self):
"""
[Jungfrau][Gotthard2] Ip address of the receiver (destination) udp interface 2.
[Jungfrau][Moench][Gotthard2] Ip address of the receiver (destination) udp interface 2.
Note
----
[Jungfrau] bottom half \n
[Jungfrau][Moench] bottom half \n
[Gotthard2] veto debugging \n
If 'auto' used, then ip is set to ip of rx_hostname. \n
To set IPs for individual modules, use setDestinationUDPIP2.
@ -1289,13 +1347,13 @@ class Detector(CppDetectorApi):
@element
def udp_dstmac2(self):
"""
[Jungfrau][Gotthard2] Mac address of the receiver (destination) udp interface 2.
[Jungfrau][Moench][Gotthard2] Mac address of the receiver (destination) udp interface 2.
Note
----
Not mandatory to set as udp_dstip2 retrieves it from slsReceiver process but must be set if you use a custom receiver (not slsReceiver). \n
To set MACs for individual modules, use setDestinationUDPMAC2. \n
[Jungfrau] bottom half \n
[Jungfrau][Moench] bottom half \n
[Gotthard2] veto debugging \n
Use router mac if router between detector and receiver.
@ -1340,11 +1398,11 @@ class Detector(CppDetectorApi):
@element
def udp_srcmac2(self):
"""
[Jungfrau][Gotthard2] Mac address of the receiver (source) udp interface 2.
[Jungfrau][Moench][Gotthard2] Mac address of the receiver (source) udp interface 2.
Note
----
[Jungfrau] bottom half \n
[Jungfrau][Moench] bottom half \n
[Gotthard2] veto debugging \n
To set MACs for individual modules, use setSourceUDPMAC2.
@ -1390,11 +1448,11 @@ class Detector(CppDetectorApi):
@element
def udp_srcip2(self):
"""
[Jungfrau][Gotthard2] Ip address of the detector (source) udp interface 2.
[Jungfrau][Moench][Gotthard2] Ip address of the detector (source) udp interface 2.
Note
-----
[Jungfrau] bottom half \n
[Jungfrau][Moench] bottom half \n
[Gotthard2] veto debugging \n
Must be same subnet as destination udp ip2.\n
To set IPs for individual modules, use setSourceUDPIP2.
@ -1440,7 +1498,7 @@ class Detector(CppDetectorApi):
----
Default is 50002. \n
[Eiger] right half \n
[Jungfrau] bottom half \n
[Jungfrau][Moench] bottom half \n
[Gotthard2] veto debugging \n
Ports for each module is calculated (incremented by 2) \n
To set ports for individual modules, use setDestinationUDPPort2.
@ -1460,7 +1518,7 @@ class Detector(CppDetectorApi):
-----
[Gotthard] 0, 90, 110, 120, 150, 180, 200 \n
[Eiger][Mythen3][Gotthard2] 0 - 200 \n
[Jungfrau][Ctb][Moench] 0, 60 - 200
[Jungfrau][Moench][Ctb] 0, 60 - 200
"""
return self.getHighVoltage()
@ -1583,8 +1641,8 @@ class Detector(CppDetectorApi):
@element
def master(self):
"""
[Eiger][Gotthard2][Jungfrau] Sets (half) module to master and other(s) to slaves.\n
[Gotthard][Gotthard2][Mythen3][Eiger][Jungfrau] Gets if the current (half) module is master.
[Eiger][Gotthard2][Jungfrau][Moench] Sets (half) module to master and other(s) to slaves.\n
[Gotthard][Gotthard2][Mythen3][Eiger][Jungfrau][Moench] Gets if the current (half) module is master.
"""
return self.getMaster()
@ -1596,7 +1654,7 @@ class Detector(CppDetectorApi):
@element
def sync(self):
"""
[Jungfrau] Enables or disables synchronization between modules.
[Jungfrau][Moench] Enables or disables synchronization between modules.
"""
return self.getSynchronization()
@ -1725,6 +1783,11 @@ class Detector(CppDetectorApi):
"""Gets the list of timing modes (timingMode) for this detector."""
return self.getTimingModeList()
@property
def readoutspeedlist(self):
"""List of readout speed levels implemented for this detector."""
return self.getReadoutSpeedList()
@property
def templist(self):
"""List of temperature enums (dacIndex) implemented for this detector."""
@ -1745,7 +1808,7 @@ class Detector(CppDetectorApi):
@property
def adcreg(self):
"""[Jungfrau][Ctb][Moench][Gotthard] Writes to an adc register
"""[Jungfrau][Moench][Ctb][Gotthard] Writes to an adc register
Note
-----
@ -1758,7 +1821,7 @@ class Detector(CppDetectorApi):
@property
@element
def adcinvert(self):
"""[Ctb][Moench][Jungfrau] ADC Inversion Mask.
"""[Ctb][Jungfrau][Moench] ADC Inversion Mask.
Note
-----
@ -1774,7 +1837,7 @@ class Detector(CppDetectorApi):
@element
def triggersl(self):
"""
[Gotthard][Jungfrau][Mythen3][Gotthard2][CTB][Moench] Number of triggers left in acquisition.\n
[Gotthard][Jungfrau][Moench][Mythen3][Gotthard2][CTB] Number of triggers left in acquisition.\n
Note
----
@ -1787,7 +1850,7 @@ class Detector(CppDetectorApi):
@property
@element
def frametime(self):
"""[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Timestamp at a frame start.
"""[Jungfrau][Moench][Mythen3][Gotthard2][CTB] Timestamp at a frame start.
Note
----
@ -1826,23 +1889,25 @@ class Detector(CppDetectorApi):
@property
def versions(self):
version_list = {'type': self.type,
'package': self.packageversion,
'client': self.clientversion}
if self.type == detectorType.EIGER:
return {'type': self.type,
'package': self.packageversion,
'client': self.clientversion,
'firmware': self.firmwareversion,
'detectorserver': self.detectorserverversion,
'kernel': self.kernelversion,
'receiver': self.rx_version}
version_list ['firmware (Beb)'] = self.firmwareversion
version_list ['firmware(Febl)'] = self.getFrontEndFirmwareVersion(slsDetectorDefs.fpgaPosition.FRONT_LEFT)
version_list ['firmware (Febr)'] = self.getFrontEndFirmwareVersion(slsDetectorDefs.fpgaPosition.FRONT_RIGHT)
else:
version_list ['firmware'] = self.firmwareversion
return {'type': self.type,
'package': self.packageversion,
'client': self.clientversion,
'firmware': self.firmwareversion,
'detectorserver': self.detectorserverversion,
'hardware':self.hardwareversion,
'kernel': self.kernelversion,
'receiver': self.rx_version}
version_list ['detectorserver'] = self.detectorserverversion
version_list ['kernel'] = self.kernelversion
version_list ['hardware'] = self.hardwareversion
if self.use_receiver:
version_list ['receiver'] = self.rx_version
return version_list
@property
def virtual(self):
@ -1909,10 +1974,10 @@ class Detector(CppDetectorApi):
Note
-----
[Jungfrau] FULL_SPEED, HALF_SPEED (Default), QUARTER_SPEED
[Jungfrau][Moench] FULL_SPEED, HALF_SPEED (Default), QUARTER_SPEED
[Eiger] FULL_SPEED (Default), HALF_SPEED, QUARTER_SPEED
[Gottthard2] G2_108MHZ (Default), G2_144MHZ
[Jungfrau] FULL_SPEED option only available from v2.0 boards and is recommended to set number of interfaces to 2. \n
[Jungfrau][Moench] FULL_SPEED option only available from v2.0 boards and is recommended to set number of interfaces to 2. \n
Also overwrites adcphase to recommended default.
"""
return element_if_equal(self.getReadoutSpeed())
@ -1998,7 +2063,7 @@ class Detector(CppDetectorApi):
Note
-----
Default: AUTO_TIMING \n
[Jungfrau][Gotthard][Ctb][Moench][Gotthard2] AUTO_TIMING, TRIGGER_EXPOSURE \n
[Jungfrau][Moench][Gotthard][Ctb][Gotthard2] AUTO_TIMING, TRIGGER_EXPOSURE \n
[Mythen3] AUTO_TIMING, TRIGGER_EXPOSURE, GATED, TRIGGER_GATED \n
[Eiger] AUTO_TIMING, TRIGGER_EXPOSURE, GATED, BURST_TRIGGER
"""
@ -2157,13 +2222,13 @@ class Detector(CppDetectorApi):
def readnrows(self):
"""
[Eiger] Number of rows to read out per half module starting from the centre.
[Jungfrau] Number of rows to read per module starting from the centre.
[Jungfrau][Moench] Number of rows to read per module starting from the centre.
Note
----
[Eiger] Options: 1 - 256. 256 is default. \n
[Eiger]The permissible values depend on dynamic range and 10Gbe enabled.\n\n
[Jungfrau] Options: 8 - 512 (multiples of 8)
[Jungfrau][Moench] Options: 8 - 512 (multiples of 8)
"""
return self.getReadNRows()
@ -2254,7 +2319,7 @@ class Detector(CppDetectorApi):
@property
@element
def tengiga(self):
"""[Eiger][Ctb][Moench][Mythen3] 10GbE Enable."""
"""[Eiger][Ctb][Mythen3] 10GbE Enable."""
return self.getTenGiga()
@tengiga.setter
@ -2274,7 +2339,7 @@ class Detector(CppDetectorApi):
@property
@element
def flowcontrol10g(self):
"""[Eiger][Jungfrau] Enable or disable 10GbE Flow Control."""
"""[Eiger][Jungfrau][Moench] Enable or disable 10GbE Flow Control."""
return self.getTenGigaFlowControl()
@flowcontrol10g.setter
@ -2294,7 +2359,7 @@ class Detector(CppDetectorApi):
@property
@element
def gappixels(self):
"""[Eiger][Jungfrau] Include Gap pixels in client data call back in Detecor api. Will not be in detector streaming, receiver file or streaming. Default is disabled. """
"""[Eiger][Jungfrau][Moench] Include Gap pixels in client data call back in Detecor api. Will not be in detector streaming, receiver file or streaming. Default is disabled. """
return self.getRxAddGapPixels()
@gappixels.setter
@ -2350,7 +2415,7 @@ class Detector(CppDetectorApi):
@element
def chipversion(self):
"""
[Jungfrau] Chip version of module. Can be 1.0 or 1.1.
[Jungfrau][Moench] Chip version of module. Can be 1.0 or 1.1.
Example
-------
@ -2363,7 +2428,7 @@ class Detector(CppDetectorApi):
@property
@element
def autocompdisable(self):
"""[Jungfrau] Enable or disable auto comparator disable mode.
"""[Jungfrau][Moench] Enable or disable auto comparator disable mode.
Note
-----
@ -2379,7 +2444,7 @@ class Detector(CppDetectorApi):
@property
@element
def compdisabletime(self):
"""[Jungfrau] Time before end of exposure when comparator is disabled.
"""[Jungfrau][Moench] Time before end of exposure when comparator is disabled.
Note
-----
@ -2425,7 +2490,7 @@ class Detector(CppDetectorApi):
@property
@element
def runtime(self):
"""[Jungfrau][Mythen3][Gotthard2][Moench][CTB] Time from detector start up.
"""[Jungfrau][Moench][Mythen3][Gotthard2][CTB] Time from detector start up.
Note
-----
@ -2518,7 +2583,7 @@ class Detector(CppDetectorApi):
@element
def temp_threshold(self):
"""
[Jungfrau] Threshold temperature in degrees.
[Jungfrau][Moench] Threshold temperature in degrees.
Note
-----
@ -2535,7 +2600,7 @@ class Detector(CppDetectorApi):
@element
def temp_event(self):
"""
[Jungfrau] 1, if a temperature event occured. \n
[Jungfrau][Moench] 1, if a temperature event occured. \n
Note
----
@ -2563,7 +2628,7 @@ class Detector(CppDetectorApi):
@element
def temp_control(self):
"""
[Jungfrau] Temperature control enable.
[Jungfrau][Moench] Temperature control enable.
Note
-----
@ -2580,7 +2645,7 @@ class Detector(CppDetectorApi):
@property
@element
def selinterface(self):
"""[Jungfrau] The udp interface to stream data from detector.
"""[Jungfrau][Moench] The udp interface to stream data from detector.
Note
-----
@ -2600,11 +2665,11 @@ class Detector(CppDetectorApi):
@property
def gainmode(self):
"""
[Jungfrau] Detector gain mode. Enum: gainMode
[Jungfrau][Moench] Detector gain mode. Enum: gainMode
Note
-----
[Jungfrau] DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2, FIX_G1, FIX_G2, FIX_G0 \n
[Jungfrau][Moench] DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2, FIX_G1, FIX_G2, FIX_G0 \n
CAUTION: Do not use FIX_G0 without caution, you can damage the detector!!!
"""
return element_if_equal(self.getGainMode())
@ -2659,14 +2724,14 @@ class Detector(CppDetectorApi):
@element
def filterresistor(self):
"""
[Gotthard2][Jungfrau] Set filter resistor. Increasing values for increasing "
[Gotthard2][Jungfrau][Moench] Set filter resistor. Increasing values for increasing "
"resistance.
Note
----
Advanced user command.
[Gotthard2] Default is 0. Options: 0-3.
[Jungfrau] Default is 1. Options: 0-1.
[Jungfrau][Moench] Default is 1. Options: 0-1.
"""
return self.getFilterResistor()
@ -2678,11 +2743,11 @@ class Detector(CppDetectorApi):
@element
def filtercells(self):
"""
[Jungfrau] Set filter capacitor.
[Jungfrau][Moench] Set filter capacitor.
Note
----
[Jungfrau] Options: 0-12. Default: 0. Advanced user command. Only for chipv1.1.
[Jungfrau][Moench] Options: 0-12. Default: 0. Advanced user command. Only for chipv1.1.
"""
return self.getNumberOfFilterCells()
@ -3018,7 +3083,7 @@ class Detector(CppDetectorApi):
@property
@element
def adcenable(self):
"""[Ctb][Moench] ADC Enable Mask for 1Gb. Enable for each 32 ADC channel."""
"""[Ctb] ADC Enable Mask for 1Gb. Enable for each 32 ADC channel."""
return self.getADCEnableMask()
@adcenable.setter
@ -3028,7 +3093,7 @@ class Detector(CppDetectorApi):
@property
@element
def adcenable10g(self):
"""[Ctb][Moench] ADC Enable Mask for 10Gb mode for each 32 ADC channel.
"""[Ctb] ADC Enable Mask for 10Gb mode for each 32 ADC channel.
Note
-----
@ -3045,7 +3110,6 @@ class Detector(CppDetectorApi):
def samples(self):
"""
[CTB] Number of samples (both analog and digitial) expected. \n
[Moench] Number of samples (analog only)
"""
return self.getNumberOfAnalogSamples()
@ -3056,7 +3120,7 @@ class Detector(CppDetectorApi):
@property
@element
def runclk(self):
"""[Ctb][Moench] Run clock in MHz."""
"""[Ctb] Run clock in MHz."""
return self.getRUNClock()
@runclk.setter
@ -3089,7 +3153,7 @@ class Detector(CppDetectorApi):
@property
@element
def asamples(self):
"""[Ctb][Moench] Number of analog samples expected. """
"""[Ctb] Number of analog samples expected. """
return element_if_equal(self.getNumberOfAnalogSamples())
@asamples.setter
@ -3109,7 +3173,7 @@ class Detector(CppDetectorApi):
@property
@element
def dbitphase(self):
"""[Ctb][Jungfrau] Phase shift of clock to latch digital bits. Absolute phase shift.
"""[Ctb][Jungfrau][Moench] Phase shift of clock to latch digital bits. Absolute phase shift.
Note
-----
@ -3131,6 +3195,17 @@ class Detector(CppDetectorApi):
def dbitclk(self, value):
ut.set_using_dict(self.setDBITClock, value)
@property
@element
def adcvpp(self):
"""[Ctb][Moench] Vpp of ADC. [0 -> 1V | 1 -> 1.14V | 2 -> 1.33V | 3 -> 1.6V | 4 -> 2V] \n
Advanced User function!"""
return self.getADCVpp(False)
@adcvpp.setter
def adcvpp(self, value):
ut.set_using_dict(self.setADCVpp, value, False)
@property
@element
def dbitpipeline(self):
@ -3150,7 +3225,7 @@ class Detector(CppDetectorApi):
@property
@element
def maxdbitphaseshift(self):
"""[CTB][Jungfrau] Absolute maximum Phase shift of of the clock to latch digital bits.
"""[CTB][Jungfrau][Moench] Absolute maximum Phase shift of of the clock to latch digital bits.
Note
-----
@ -3197,7 +3272,7 @@ class Detector(CppDetectorApi):
@property
@element
def maxadcphaseshift(self):
"""[Jungfrau][CTB][Moench] Absolute maximum Phase shift of ADC clock.
"""[Jungfrau][Moench][CTB] Absolute maximum Phase shift of ADC clock.
Note
-----
@ -3209,12 +3284,12 @@ class Detector(CppDetectorApi):
@property
@element
def adcphase(self):
"""[Gotthard][Jungfrau][CTB][Moench] Sets phase shift of ADC clock.
"""[Gotthard][Jungfrau][Moench][CTB] Sets phase shift of ADC clock.
Note
-----
[Jungfrau] Absolute phase shift. Changing Speed also resets adcphase to recommended defaults.\n
[Ctb][Moench] Absolute phase shift. Changing adcclk also resets adcphase and sets it to previous values.\n
[Jungfrau][Moench] Absolute phase shift. Changing Speed also resets adcphase to recommended defaults.\n
[Ctb] Absolute phase shift. Changing adcclk also resets adcphase and sets it to previous values.\n
[Gotthard] Relative phase shift.
:getter: Not implemented for Gotthard
@ -3228,7 +3303,7 @@ class Detector(CppDetectorApi):
@property
@element
def adcpipeline(self):
"""[Ctb][Moench] Sets pipeline for ADC clock. """
"""[Ctb] Sets pipeline for ADC clock. """
return self.getADCPipeline()
@adcpipeline.setter
@ -3238,7 +3313,7 @@ class Detector(CppDetectorApi):
@property
@element
def adcclk(self):
"""[Ctb][Moench] Sets ADC clock frequency in MHz. """
"""[Ctb] Sets ADC clock frequency in MHz. """
return self.getADCClock()
@adcclk.setter
@ -3249,7 +3324,7 @@ class Detector(CppDetectorApi):
@element
def syncclk(self):
"""
[Ctb][Moench] Sync clock in MHz.
[Ctb] Sync clock in MHz.
Note
-----
@ -3260,7 +3335,7 @@ class Detector(CppDetectorApi):
@property
def pattern(self):
"""[Mythen3][Moench][Ctb] Loads ASCII pattern file directly to server (instead of executing line by line).
"""[Mythen3][Ctb] Loads ASCII pattern file directly to server (instead of executing line by line).
Note
----
@ -3282,7 +3357,7 @@ class Detector(CppDetectorApi):
@property
@element
def patioctrl(self):
"""[Ctb][Moench] 64 bit mask defining input (0) and output (1) signals.
"""[Ctb] 64 bit mask defining input (0) and output (1) signals.
Example
--------
@ -3299,7 +3374,7 @@ class Detector(CppDetectorApi):
@property
@element
def patlimits(self):
"""[Ctb][Moench][Mythen3] Limits (start and stop address) of complete pattern.
"""[Ctb][Mythen3] Limits (start and stop address) of complete pattern.
Example
---------
@ -3319,7 +3394,7 @@ class Detector(CppDetectorApi):
@property
@element
def patsetbit(self):
"""[Ctb][Moench][Mythen3] Sets the mask applied to every pattern to the selected bits.
"""[Ctb][Mythen3] Sets the mask applied to every pattern to the selected bits.
Example
--------
@ -3336,7 +3411,7 @@ class Detector(CppDetectorApi):
@property
@element
def patmask(self):
"""[Ctb][Moench][Mythen3] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern.
"""[Ctb][Mythen3] Selects the bits that will have a pattern mask applied to the selected patmask for every pattern.
Example
--------
@ -3354,7 +3429,7 @@ class Detector(CppDetectorApi):
# @element
def patwait(self):
"""
[Ctb][Moench][Mythen3] Wait address of loop level provided.
[Ctb][Mythen3] Wait address of loop level provided.
Example
-------
@ -3371,7 +3446,7 @@ class Detector(CppDetectorApi):
@property
@element
def patwait0(self):
"""[Ctb][Moench][Mythen3] Wait 0 address.
"""[Ctb][Mythen3] Wait 0 address.
Example
--------
@ -3391,7 +3466,7 @@ class Detector(CppDetectorApi):
@property
@element
def patwait1(self):
"""[Ctb][Moench][Mythen3] Wait 1 address.
"""[Ctb][Mythen3] Wait 1 address.
Example
--------
@ -3411,7 +3486,7 @@ class Detector(CppDetectorApi):
@property
@element
def patwait2(self):
"""[Ctb][Moench][Mythen3] Wait 2 address.
"""[Ctb][Mythen3] Wait 2 address.
Example
--------
@ -3431,7 +3506,7 @@ class Detector(CppDetectorApi):
@property
def patwaittime(self):
"""
[Ctb][Moench][Mythen3] Wait time in clock cycles of loop level provided.
[Ctb][Mythen3] Wait time in clock cycles of loop level provided.
Example
-------
@ -3448,7 +3523,7 @@ class Detector(CppDetectorApi):
@property
@element
def patwaittime0(self):
"""[Ctb][Moench][Mythen3] Wait 0 time in clock cycles."""
"""[Ctb][Mythen3] Wait 0 time in clock cycles."""
return self.getPatternWaitTime(0)
@patwaittime0.setter
@ -3459,7 +3534,7 @@ class Detector(CppDetectorApi):
@property
@element
def patwaittime1(self):
"""[Ctb][Moench][Mythen3] Wait 1 time in clock cycles."""
"""[Ctb][Mythen3] Wait 1 time in clock cycles."""
return self.getPatternWaitTime(1)
@patwaittime1.setter
@ -3470,7 +3545,7 @@ class Detector(CppDetectorApi):
@property
@element
def patwaittime2(self):
"""[Ctb][Moench][Mythen3] Wait 2 time in clock cycles."""
"""[Ctb][Mythen3] Wait 2 time in clock cycles."""
return self.getPatternWaitTime(2)
@patwaittime2.setter
@ -3482,7 +3557,7 @@ class Detector(CppDetectorApi):
@property
def patloop(self):
"""
[Ctb][Moench][Mythen3] Limits (start and stop address) of the loop provided.
[Ctb][Mythen3] Limits (start and stop address) of the loop provided.
Example
-------
@ -3499,7 +3574,7 @@ class Detector(CppDetectorApi):
@property
@element
def patloop0(self):
"""[Ctb][Moench][Mythen3] Limits (start and stop address) of loop 0.
"""[Ctb][Mythen3] Limits (start and stop address) of loop 0.
Example
---------
@ -3519,7 +3594,7 @@ class Detector(CppDetectorApi):
@property
@element
def patloop1(self):
"""[Ctb][Moench][Mythen3] Limits (start and stop address) of loop 1.
"""[Ctb][Mythen3] Limits (start and stop address) of loop 1.
Example
---------
@ -3540,7 +3615,7 @@ class Detector(CppDetectorApi):
@property
@element
def patloop2(self):
"""[Ctb][Moench][Mythen3] Limits (start and stop address) of loop 2.
"""[Ctb][Mythen3] Limits (start and stop address) of loop 2.
Example
---------
@ -3562,7 +3637,7 @@ class Detector(CppDetectorApi):
@property
def patnloop(self):
"""
[Ctb][Moench][Mythen3] Number of cycles of the loop provided.
[Ctb][Mythen3] Number of cycles of the loop provided.
Example
-------
@ -3579,7 +3654,7 @@ class Detector(CppDetectorApi):
@property
@element
def patnloop0(self):
"""[Ctb][Moench][Mythen3] Number of cycles of loop 0."""
"""[Ctb][Mythen3] Number of cycles of loop 0."""
return self.getPatternLoopCycles(0)
@patnloop0.setter
@ -3590,7 +3665,7 @@ class Detector(CppDetectorApi):
@property
@element
def patnloop1(self):
"""[Ctb][Moench][Mythen3] Number of cycles of loop 1."""
"""[Ctb][Mythen3] Number of cycles of loop 1."""
return self.getPatternLoopCycles(1)
@patnloop1.setter
@ -3601,7 +3676,7 @@ class Detector(CppDetectorApi):
@property
@element
def patnloop2(self):
"""[Ctb][Moench][Mythen3] Number of cycles of loop 2."""
"""[Ctb][Mythen3] Number of cycles of loop 2."""
return self.getPatternLoopCycles(2)
@patnloop2.setter
@ -3672,7 +3747,7 @@ class Detector(CppDetectorApi):
@property
@element
def v_limit(self):
"""[Ctb][Moench] Soft limit for power supplies (ctb only) and DACS in mV."""
"""[Ctb] Soft limit for power supplies (ctb only) and DACS in mV."""
return self.getDAC(dacIndex.V_LIMIT, True)
@v_limit.setter
@ -3741,6 +3816,23 @@ class Detector(CppDetectorApi):
"""
return self.getMeasuredCurrent(dacIndex.I_POWER_IO)
@property
def clkphase(self):
"""
[Gotthard2][Mythen3] Phase shift of all clocks.
Example
-------
>>> d.clkphase[0] = 20
>>> d.clkphase
0: 20
1: 10
2: 20
3: 10
4: 10
5: 5
"""
return ClkPhaseProxy(self)
@property
def clkdiv(self):

42
python/slsdet/gaincaps.py Normal file
View File

@ -0,0 +1,42 @@
import _slsdet
gc = _slsdet.slsDetectorDefs.M3_GainCaps
class Mythen3GainCapsWrapper:
"""Holds M3_GainCaps enums and facilitates printing"""
# 'M3_C10pre', 'M3_C15pre', 'M3_C15sh', 'M3_C225ACsh', 'M3_C30sh', 'M3_C50sh'
all_bits = gc.M3_C10pre | gc.M3_C15pre | gc.M3_C15sh | gc.M3_C225ACsh | gc.M3_C30sh | gc.M3_C50sh
all_caps = (gc.M3_C10pre, gc.M3_C15pre, gc.M3_C15sh, gc.M3_C225ACsh, gc.M3_C30sh, gc.M3_C50sh)
def __init__(self, value = 0):
self._validate(value)
self.value = value
def __eq__(self, other) -> bool:
if isinstance(other, Mythen3GainCapsWrapper):
return self.value == other.value
else:
return self.value == other
def __ne__(self, other) -> bool:
return not self.__eq__(other)
def __str__(self) -> str:
s = ', '.join(str(c).rsplit('_', 1)[1] for c in self.all_caps if self.value & c)
return s
def __repr__(self) -> str:
return self.__str__()
def _validate(self, value):
"""Check that only bits representing real capacitors are set"""
if isinstance(value, gc):
return True
elif isinstance(value, int):
if value & (~self.all_bits):
raise ValueError(f"The value: {value} is not allowed for Mythen3GainCapsWrapper")
else:
raise ValueError("GainCaps can only be initialized from int or M3_GainCaps enum")

View File

@ -13,6 +13,7 @@ from .detector import Detector, freeze
from .dacs import DetectorDacs
import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex
gc_enums = _slsdet.slsDetectorDefs.M3_GainCaps
from .detector_property import DetectorProperty
@ -62,4 +63,6 @@ class Mythen3(Detector):
@property
def dacs(self):
return self._dacs
return self._dacs

View File

@ -4,6 +4,7 @@ from .utils import element_if_equal
from .enums import dacIndex
from .defines import M3_MAX_PATTERN_LEVELS, MAX_PATTERN_LEVELS
from _slsdet import slsDetectorDefs
detectorType = slsDetectorDefs.detectorType
def set_proxy_using_dict(func, key, value, unpack = False):
@ -87,7 +88,10 @@ class ClkDivProxy:
def __repr__(self):
rstr = ''
for i in range(6):
num_clocks = 6
if self.det.type == detectorType.MYTHEN3:
num_clocks = 5
for i in range(num_clocks):
r = element_if_equal(self.__getitem__(i))
if isinstance(r, list):
rstr += ' '.join(f'{item}' for item in r)
@ -96,10 +100,35 @@ class ClkDivProxy:
return rstr.strip('\n')
class ClkPhaseProxy:
"""
Proxy class to allow for more intuitive reading clock phase
"""
def __init__(self, det):
self.det = det
def __getitem__(self, key):
return element_if_equal(self.det.getClockPhase(key))
def __setitem__(self, key, value):
set_proxy_using_dict(self.det.setClockPhase, key, value)
def __repr__(self):
rstr = ''
if self.det.type == detectorType.MYTHEN3:
num_clocks = 5
for i in range(num_clocks):
r = element_if_equal(self.__getitem__(i))
if isinstance(r, list):
rstr += ' '.join(f'{item}' for item in r)
else:
rstr += f'{i}: {r}\n'
return rstr.strip('\n')
class MaxPhaseProxy:
"""
Proxy class to allow for more intuitive reading clockdivider
Proxy class to allow for more intuitive reading max clock phase shift
"""
def __init__(self, det):
self.det = det
@ -109,7 +138,9 @@ class MaxPhaseProxy:
def __repr__(self):
rstr = ''
for i in range(5):
if self.det.type == detectorType.MYTHEN3:
num_clocks = 5
for i in range(num_clocks):
r = element_if_equal(self.__getitem__(i))
if isinstance(r, list):
rstr += ' '.join(f'{item}' for item in r)
@ -120,7 +151,7 @@ class MaxPhaseProxy:
class ClkFreqProxy:
"""
Proxy class to allow for more intuitive reading clockdivider
Proxy class to allow for more intuitive reading clock frequency
"""
def __init__(self, det):
self.det = det
@ -130,7 +161,9 @@ class ClkFreqProxy:
def __repr__(self):
rstr = ''
for i in range(5):
if self.det.type == detectorType.MYTHEN3:
num_clocks = 5
for i in range(num_clocks):
r = element_if_equal(self.__getitem__(i))
if isinstance(r, list):
rstr += ' '.join(f'{item}' for item in r)

View File

@ -61,6 +61,11 @@ void init_det(py::module &m) {
(Result<int64_t>(Detector::*)(sls::Positions) const) &
Detector::getFirmwareVersion,
py::arg() = Positions{});
CppDetectorApi.def("getFrontEndFirmwareVersion",
(Result<int64_t>(Detector::*)(const defs::fpgaPosition,
sls::Positions) const) &
Detector::getFrontEndFirmwareVersion,
py::arg(), py::arg() = Positions{});
CppDetectorApi.def(
"getDetectorServerVersion",
(Result<std::string>(Detector::*)(sls::Positions) const) &

View File

@ -286,6 +286,11 @@ void init_enums(py::module &m) {
.value("BOTTOM", slsDetectorDefs::portPosition::BOTTOM)
.export_values();
py::enum_<slsDetectorDefs::fpgaPosition>(Defs, "fpgaPosition")
.value("FRONT_LEFT", slsDetectorDefs::fpgaPosition::FRONT_LEFT)
.value("FRONT_RIGHT", slsDetectorDefs::fpgaPosition::FRONT_RIGHT)
.export_values();
py::enum_<slsDetectorDefs::streamingInterface>(Defs, "streamingInterface",
py::arithmetic())
.value("NONE", slsDetectorDefs::streamingInterface::NONE)

View File

@ -0,0 +1,24 @@
import pytest
from slsdet import Mythen3GainCapsWrapper
from slsdet.enums import M3_GainCaps #this is the c++ enum
def test_comapre_with_int():
c = Mythen3GainCapsWrapper(128) #C10pre
assert c == 128
assert c != 5
assert c != 1280
def test_compare_with_other():
a = Mythen3GainCapsWrapper(128)
b = Mythen3GainCapsWrapper(1<<10)
c = Mythen3GainCapsWrapper(128)
assert a!=b
assert (a==b) == False
assert a==c
def test_can_be_default_constructed():
c = Mythen3GainCapsWrapper()
assert c == 0

View File

@ -0,0 +1 @@
../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv7.0.0

View File

@ -1 +0,0 @@
../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv7.0.0.rc3

View File

@ -0,0 +1 @@
../slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv7.0.0

View File

@ -1 +0,0 @@
../slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv7.0.0.rc3

View File

@ -0,0 +1 @@
../slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv7.0.0

View File

@ -1 +0,0 @@
../slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv7.0.0.rc3

View File

@ -0,0 +1 @@
../slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv7.0.0

View File

@ -1 +0,0 @@
../slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv7.0.0.rc3

View File

@ -0,0 +1 @@
../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv7.0.0

View File

@ -1 +0,0 @@
../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv7.0.0.rc3

View File

@ -0,0 +1 @@
../slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv7.0.0

View File

@ -1 +0,0 @@
../slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv7.0.0.rc3

View File

@ -0,0 +1 @@
../slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer

View File

@ -0,0 +1 @@
../slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv7.0.0

View File

@ -1 +0,0 @@
../slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServerv7.0.0.rc3

View File

@ -220,7 +220,7 @@ template <class dataType> class analogDetector {
clone. Must be virtual!
\returns a clone of the original analog detector
*/
virtual analogDetector *Clone() { return new analogDetector(this); }
virtual analogDetector *Clone() = 0;
/**
Gives an id to the structure. For debugging purposes in case of
@ -298,8 +298,8 @@ template <class dataType> class analogDetector {
if (gmap)
delete[] gmap;
gmap = new double[nnx * nny];
for (iy = 0; iy < nny; ++iy) {
for (ix = 0; ix < nnx; ++ix) {
for (iy = 0; iy < static_cast<int>(nny); ++iy) {
for (ix = 0; ix < static_cast<int>(nnx); ++ix) {
gmap[iy * nnx + ix] = gm[iy * nnx + ix];
// cout << gmap[iy*nnx+ix] << " " ;
}
@ -1097,6 +1097,8 @@ template <class dataType> class analogDetector {
return thr;
};
virtual int setClusterSize(int n = -1) = 0;
/**
gets threshold value for conversion into number of photons
\returns threshold value

View File

@ -2,7 +2,11 @@
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef JUNGFRAULGADSTRIXELDATA_H
#define JUNGFRAULGADSTRIXELDATA_H
#ifdef CINT
#include "sls/sls_detector_defs_CINT.h"
#else
#include "sls/sls_detector_defs.h"
#endif
#include "slsDetectorData.h"
/*
@ -32,7 +36,7 @@ typedef struct {
uint64_t bunchNumber; /**< is the frame number */
uint64_t pre; /**< something */
} jf_header;
} jf_header; //Aldo's header
using namespace std;
@ -41,7 +45,11 @@ class jungfrauLGADStrixelsData : public slsDetectorData<uint16_t> {
private:
int iframe;
#ifdef ALDO //VH
using header = jf_header; //VH
#else //VH
using header = sls::defs::sls_receiver_header;
#endif //VH
public:
/**
Implements the slsReceiverData structure for the moench02 prototype read
@ -49,103 +57,137 @@ class jungfrauLGADStrixelsData : public slsDetectorData<uint16_t> {
1286 large etc.) \param c crosstalk parameter for the output buffer
*/
int groupmap[512*5][1024/5];
jungfrauLGADStrixelsData()
: slsDetectorData<uint16_t>(1024/5, 512*5,
512 * 1024 * 2 + sizeof(header)) {
cout << "aaa" << endl;
// cout << "aaa" << endl;
#ifdef ALDO //VH
cout<< "using reduced jf_header" << endl; //VH
#endif //VH
for (int ix = 0; ix < 1024/5; ix++) {
for (int iy = 0; iy < 512*5; iy++) {
dataMap[iy][ix] = sizeof(header);//+ ( 1024 * 5 + 300) * 2; //somewhere on the guardring of the LGAD
groupmap[iy][ix]=-1;
#ifdef HIGHZ
dataMask[iy][ix] = 0x3fff;
#endif
}
}
int x0=256+10, x1=256+246;
int y0=10, y1=256-10;
int ix,iy;
int ox=0, oy=0, ooy=0;
ox=0;
ox=2;//0; //original value is 0
cout << "G0" << endl;
//chip1
/*
* TL;DR comments: y0 is too high by 1, group 1 and group 2 are by one row too short
* group34 by 2 rows, x is by one column too short
* NOTE: If x0, x1, y0 are changed, likely also ox (and oy and ooy) will be affected!
*/
cout << "G0" << endl; //chip coordinates of chip1 group1: x=255+10 to x=255+246, y=10 to y=64
//9 pixels guard ring, bonding shift by one pixel in y, one square pixel in x on the left
int x0=256+10, x1=256+246; //excludes first column (in chip coordinates)
int y0=10, y1=256-10; //y1 does nothing
int ix,iy;
int ox=0, oy=0, ooy=0;
ox=0;
for (int ipx=x0; ipx<x1; ipx++) {
for (int ipy=y0; ipy<y0+54; ipy++) {
ix=(ipx-x0+ox)/3;
for (int ipy=y0; ipy<y0+54; ipy++) { //y0+54 excludes the last row (in chip coordinates), should be y0+55 to include all rows
iy=(ipx-x0+ox)%3+(ipy-y0+oy)*3+ooy;
ix=(ipx-x0+ox)/3;
dataMap[iy][ix] = sizeof(header) + (1024 * ipy + ipx) * 2;
groupmap[iy][ix]=0;
// cout << ipx << " " << ipy << " " << ix << " " << iy << endl;
}
}
cout << "G1" << endl;
cout << "G1" << endl; //chip coordinates of chip1 group2: x=255+12 to x=255+246, y=65 to y=128
//3 square pixels in x on the left
oy=-54;
ooy=54*3;
ox=3;
ox=2;//; //original value is 3
for (int ipx=x0; ipx<x1; ipx++) {
for (int ipy=y0+54; ipy<y0+64+54; ipy++) {
for (int ipy=y0+54; ipy<y0+64+54; ipy++) { //I think y0+54 catches the last row of group1! Should be y0+55 if we want to include all rows? And y0+55+64
ix=(ipx-x0+ox)/5;
iy=(ipx-x0+ox)%5+(ipy-y0+oy)*5+ooy;
dataMap[iy][ix] = sizeof(header) + (1024 * ipy + ipx) * 2;
groupmap[iy][ix]=1;
}
}
cout << "G2" << endl;
cout << "G2" << endl; //chip coordinates of chip1 group34: x=255+11 to x=255+246, y=129 to y=247
//2 square pixels on the left
oy=-54-64;
ooy=54*3+64*5;
ox=3;
for (int ipx=x0; ipx<x1; ipx++) {
for (int ipy=y0+64+54; ipy<y0+64*2+54*2; ipy++) {
for (int ipy=y0+64+54; ipy<y0+64*2+54*2; ipy++) { //Same as above, I think it should be y0+55+64 and y0+55*2+64*2 to include all rows
ix=(ipx-x0+ox)/4;
iy=(ipx-x0+ox)%4+(ipy-y0+oy)*4+ooy;
dataMap[iy][ix] = sizeof(header) + (1024 * ipy + ipx) * 2;
groupmap[iy][ix]=2;
}
}
//chip 6
/*
* TL;DR comments: y0 is too high by 3, group34 and group 1 are by one row too short
* x is by two columns too short
* NOTE: If x0, x1, y0 are changed, likely also ox (and oy and ooy) will be affected!
*/
cout << "G0" << endl; //chip coordinates of chip6 group34: x=255+256+9 to x=255+256+244, y=255+8 to y=255+126
//9 pixels guard ring, bonding shift by one pixel in -y, 2 square pixels in x on the right
x0=256*2+10;
y0=256+10;
x1=256*2+246;
ooy=256*5;
oy=0;
ox=1;
cout << "G0" << endl;
for (int ipx=x0; ipx<x1; ipx++) {
for (int ipy=y0; ipy<y0+54+64; ipy++) {
for (int ipy=y0; ipy<y0+54+64; ipy++) { //shifted by 3 rows because of y0, if y0 is corrected it should be y0+55+64 to include all rows
ix=(ipx-x0+ox)/4;
iy=(ipx-x0+ox)%4+(ipy-y0+oy)*4+ooy;
dataMap[iy][ix] = sizeof(header) + (1024 * ipy + ipx) * 2;
if (ipx==x0)
cout << ipx << " " << ipy << " " << ix << " " << iy << endl;
//if (ipx==x0) cout << ipx << " " << ipy << " " << ix << " " << iy << endl;
groupmap[iy][ix]=2;
}
}
cout << "G1" << endl;
cout << "G1" << endl; //chip coordinates of chip6 group2: x=255+256+9 to x=255+256+243, y=255+127 to y=255+190
//3 square pixels in x on the right
oy=-54-64;
ooy+=(54+64)*4;
ox=1;
for (int ipx=x0; ipx<x1; ipx++) {
for (int ipy=y0+54+64; ipy<y0+64*2+54; ipy++) {
for (int ipy=y0+54+64; ipy<y0+64*2+54; ipy++) { //shifted by 3 rows because of y0, if y0 is corrected it should be y0+55+64 and y0+55+64*2 to include all rows
ix=(ipx-x0+ox)/5;
iy=(ipx-x0+ox)%5+(ipy-y0+oy)*5+ooy;
dataMap[iy][ix] = sizeof(header) + (1024 * ipy + ipx) * 2;
groupmap[iy][ix]=1;
}
}
cout << "G2" << endl;
cout << "G2" << endl; //chip coordinates of chip6 group1: x=255+256+9 to x=255+256+245, y=255+191 to y=255+245
//one square pixel in x on the right
oy=-54-64*2;
ooy+=64*5;
ox=1;
for (int ipx=x0; ipx<x1; ipx++) {
for (int ipy=y0+64*2+54; ipy<y0+64*2+54*2; ipy++) {
for (int ipy=y0+64*2+54; ipy<y0+64*2+54*2; ipy++) { //shifted by 3 rows because of y0, if y0 is corrected it should be y0+55+64*2 and y0+55*2+64*2
ix=(ipx-x0+ox)/3;
iy=(ipx-x0+ox)%3+(ipy-y0+oy)*3+ooy;
dataMap[iy][ix] = sizeof(header) + (1024 * ipy + ipx) * 2;
groupmap[iy][ix]=0;
}
}
@ -206,7 +248,11 @@ class jungfrauLGADStrixelsData : public slsDetectorData<uint16_t> {
int getFrameNumber(char *buff) {
return ((header *)buff)->detHeader.frameNumber;
#ifdef ALDO //VH
return ((header *)buff)->bunchNumber; //VH
#else //VH
return ((header *)buff)->detHeader.frameNumber;
#endif //VH
};
/**
@ -219,7 +265,11 @@ class jungfrauLGADStrixelsData : public slsDetectorData<uint16_t> {
*/
int getPacketNumber(char *buff) {
return ((header *)buff)->detHeader.packetNumber;
#ifdef ALDO //VH
return -1; //VH //TODO: Keep in mind in case of bugs!
#else //VH
return ((header *)buff)->detHeader.packetNumber;
#endif //VH
};
@ -265,8 +315,6 @@ class jungfrauLGADStrixelsData : public slsDetectorData<uint16_t> {
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 */

View File

@ -0,0 +1,305 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef JUNGFRAULGADSTRIXELSDATASINGLECHIP_H
#define JUNGFRAULGADSTRIXELSDATASINGLECHIP_H
#ifdef CINT
#include "sls/sls_detector_defs_CINT.h"
#else
#include "sls/sls_detector_defs.h"
#endif
#include "slsDetectorData.h"
/*
/afs/psi.ch/project/mythen/Anna/slsDetectorPackageDeveloperMpc2011/slsDetectorCalibration/jungfrauExecutables
make -f Makefile.rawdataprocess jungfrauRawDataProcessStrx
../dataStructures/jungfrauLGADStrixelsData.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
*/
namespace strixelSingleChip {
constexpr int nc_chip = 256;
constexpr int nr_chip = 256;
constexpr int gr = 9;
//Group 1: 25um pitch, groups of 3, 1 column of square pixels
constexpr int g1_ncols{ (nc_chip-(2*gr)-1)/3 }; //79
constexpr int g1_nrows{ ( (nr_chip/4)-gr )*3 }; //165
//Group 2: 15um pitch, groups of 5, 3 columns of square pixels
constexpr int g2_ncols{ (nc_chip-(2*gr)-3)/5 }; //47
constexpr int g2_nrows{ (nr_chip/4)*5 }; //320
//Group 3: 18.75um pitch, groups of 4, 2 columns of square pixels (double the size of the other groups)
constexpr int g3_ncols{ (nc_chip-(2*gr)-2)/4 }; //59
constexpr int g3_nrows{ ( ((nr_chip/4)*2)-gr )*4 }; //476
constexpr int nc_strixel = 2*gr + 1 + g1_ncols; //group 1 is the "longest" group in x and has one extra square pixel
constexpr int nr_strixel = 2*gr + g1_nrows + g2_nrows + g3_nrows;
}
typedef struct {
uint64_t bunchNumber; /**< is the frame number */
uint64_t pre; /**< something */
} jf_header; //Aldo's header
using namespace strixelSingleChip;
class jungfrauLGADStrixelsDataSingleChip : public slsDetectorData<uint16_t> {
private:
int iframe;
int mchip;
void remapGroup( const int group ) {
int ix, iy;
int x0, y0, x1, y1, shifty;
int multiplicator;
switch (group) {
default:
case 1:
multiplicator = 3;
break;
case 2:
multiplicator = 5;
break;
case 3:
multiplicator = 4;
break;
}
if ( mchip == 1 ) {
switch (group) {
default:
case 1:
x0 = 10;
x1 = 247;
y0 = 10;
y1 = 65;
shifty = 0;
break;
case 2:
x0 = 12;
x1 = 247;
y0 = 65;
y1 = 129;
shifty = ( (nr_chip/4)-gr )*3;
break;
case 3:
x0 = 11;
x1 = 247;
y0 = 129;
y1 = 248;
shifty = ( (nr_chip/4)-gr )*3 + (nr_chip/4)*5;
break;
}
}
if ( mchip == 6 ) {
switch (group) {
default:
case 1:
x0 = 9;
x1 = 246;
y0 = 191;
y1 = 246;
shifty = ( (nr_chip/4)-gr+(nr_chip/4) )*4 + (nr_chip/4)*5;
break;
case 2:
x0 = 9;
x1 = 244;
y0 = 127;
y1 = 191;
shifty = ( (nr_chip/4)-gr+(nr_chip/4) )*4;
break;
case 3:
x0 = 9;
x1 = 245;
y0 = 8;
y1 = 127;
shifty = 0;
break;
}
}
//remapping loop
for ( int ipx=x0; ipx!=x1; ++ipx ) {
for ( int ipy=y0; ipy!=y1; ++ipy) {
ix = (ipx-x0)/multiplicator;
for ( int m=0; m!=multiplicator; ++m ) {
if ( (ipx-x0)%multiplicator==m ) iy=(ipy-y0)*multiplicator + m + shifty;
}
dataMap[iy][ix] = sizeof(header) + (nc_chip * ipy + ipx) * 2;
}
}
}
public:
#ifdef ALDO //VH
using header = jf_header; //VH
#else //VH
using header = sls::defs::sls_receiver_header;
#endif //VH
jungfrauLGADStrixelsDataSingleChip( const int chip )
: slsDetectorData<uint16_t>( /*nc_strixel*/nc_chip/3, /*nr_strixel*/ nr_chip*5,
nc_chip * nr_chip * 2 + sizeof(header) ) {
std::cout << "Jungfrau strixels single chip" << std::endl;
#ifdef ALDO //VH
std::cout<< "using reduced jf_header" << std::endl; //VH
#endif //VH
mchip = chip;
//Fill all strixels with dummy values
for (int ix = 0; ix != nc_strixel; ++ix) {
for (int iy = 0; iy != nr_strixel; ++iy) {
dataMap[iy][ix] = sizeof(header);
#ifdef HIGHZ
dataMask[iy][ix] = 0x3fff;
#endif
}
}
remapGroup(1);
remapGroup(2);
remapGroup(3);
iframe = 0;
std::cout << "data struct created" << std::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;
};
/**
Returns the frame number for the given dataset. Purely virtual func.
\param buff pointer to the dataset
\returns frame number
*/
int getFrameNumber(char *buff) {
#ifdef ALDO //VH
return ((header *)buff)->bunchNumber; //VH
#else //VH
return ((header *)buff)->detHeader.frameNumber;
#endif //VH
};
/**
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) {
#ifdef ALDO //VH
//uint32_t fakePacketNumber = 1000;
//return fakePacketNumber; //VH //TODO: Keep in mind in case of bugs! //This is definitely bad!
return 1000;
#else //VH
return ((header *)buff)->detHeader.packetNumber;
#endif //VH
};
char *readNextFrame(std::ifstream &filebin) {
int ff = -1, np = -1;
return readNextFrame(filebin, ff, np);
};
char *readNextFrame(std::ifstream &filebin, int &ff) {
int np = -1;
return readNextFrame(filebin, ff, np);
};
char *readNextFrame(std::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;
};
char *readNextFrame(std::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

View File

@ -0,0 +1,336 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef JUNGFRAULGADSTRIXELSDATA_H
#define JUNGFRAULGADSTRIXELSDATA_H
#ifdef CINT
#include "sls/sls_detector_defs_CINT.h"
#else
#include "sls/sls_detector_defs.h"
#endif
#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
*/
namespace strixelSingleChip {
constexpr int nc_rawimg = 1024; //for full images //256;
constexpr int nr_rawimg = 512;
constexpr int nr_chip = 256;
constexpr int gr = 9;
//Group 1: 25um pitch, groups of 3, 1 column of square pixels
constexpr int g1_ncols{ (nc_rawimg-(2*gr)-1)/3 }; //79
constexpr int g1_nrows{ ( (nr_chip/4)-gr )*3 }; //165
//Group 2: 15um pitch, groups of 5, 3 columns of square pixels
constexpr int g2_ncols{ (nc_rawimg-(2*gr)-3)/5 }; //47
constexpr int g2_nrows{ (nr_chip/4)*5 }; //320
//Group 3: 18.75um pitch, groups of 4, 2 columns of square pixels (double the size of the other groups)
constexpr int g3_ncols{ (nc_rawimg-(2*gr)-2)/4 }; //59
constexpr int g3_nrows{ ( ((nr_chip/4)*2)-gr )*4 }; //476
constexpr int nc_strixel = 2*gr + 1 + g1_ncols; //group 1 is the "longest" group in x and has one extra square pixel
constexpr int nr_strixel = 2*gr + g1_nrows + g2_nrows + g3_nrows;
}
typedef struct {
uint64_t bunchNumber; /**< is the frame number */
uint64_t pre; /**< something */
} jf_header; //Aldo's header
using namespace strixelSingleChip;
class jungfrauLGADStrixelsData : public slsDetectorData<uint16_t> {
private:
int iframe;
int mchip;
int chip_x0;
int chip_y0;
void remapGroup( const int group ) {
int ix, iy=0;
int x0, y0, x1, y1, shifty;
int multiplicator;
int shiftx;
switch (group) {
default:
case 1:
multiplicator = 3;
break;
case 2:
multiplicator = 5;
break;
case 3:
multiplicator = 4;
break;
}
if ( mchip == 1 ) {
chip_x0=256;
chip_y0=1; //because of bump bonding issues(+1 row) on M408
switch (group) {
default:
case 1:
x0 = 10+chip_x0; //9 gr + 1 sq pixel
x1 = 246+chip_x0;
y0 = 9+chip_y0;
y1 = 64+chip_y0;
shifty = 0;
break;
case 2:
x0 = 12+chip_x0;
x1 = 247+chip_x0;
y0 = 64+chip_y0;
y1 = 128+chip_y0;
shifty = g1_nrows;
break;
case 3:
x0 = 11+chip_x0;
x1 = 247+chip_x0;
y0 = 128+chip_y0;
y1 = 247+chip_y0;
shifty = g2_nrows+g1_nrows;
break;
}
}
if ( mchip == 6 ) {
chip_x0=512;
chip_y0=255; //should be 256 but is 255 because of bump bonding issues (+1 row) on M408
switch (group) {
default:
case 1:
x0 = 9+chip_x0; //9 gr sq pixel
x1 = 246+chip_x0;
y0 = 192+chip_y0;
y1 = 244+chip_y0;
shifty = g1_nrows+2*g2_nrows+2*g3_nrows;
break;
case 2:
x0 = 9+chip_x0;
x1 = 244+chip_x0;
y0 = 128+chip_y0;
y1 = 191+chip_y0;
shifty = g1_nrows+g2_nrows+2*g3_nrows;;
break;
case 3:
x0 = 9+chip_x0;
x1 = 244+chip_x0;
y0 = 9+chip_y0;
y1 = 127+chip_y0;
shifty =g1_nrows+g2_nrows+g3_nrows;
break;
}
}
//remapping loop
for ( int ipy=y0; ipy<=y1;ipy++) {
for ( int ipx=x0; ipx<=x1; ipx++ ) {
ix = int ((ipx-x0)/multiplicator);
for ( int m=0; m<multiplicator;m++ ) {
if ( (ipx-x0)%multiplicator==m ) iy=(ipy-y0)*multiplicator +m + shifty;
}
// if (iy< 40) cout << iy << " " << ix <<endl;
dataMap[iy][ix] = sizeof(header) + (nc_rawimg * ipy + ipx) * 2;
groupmap[iy][ix]=group-1;
}
}
}
public:
int groupmap[512*5][1024/3];
using header = sls::defs::sls_receiver_header;
jungfrauLGADStrixelsData()
: slsDetectorData<uint16_t>( /*nc_strixel*/g1_ncols, /*nr_strixel*/ 2*g1_nrows+2*g2_nrows+2*g3_nrows,
g1_ncols* (2*g1_nrows+2*g2_nrows+2*g3_nrows) * 2 + sizeof(header) ) {
std::cout << "Jungfrau strixels 2X single chip with full module data " << std::endl;
//Fill all strixels with dummy values
for (int ix = 0; ix != g1_ncols; ++ix) {
for (int iy = 0; iy != 2*g1_nrows+2*g2_nrows+2*g3_nrows; ++iy) {
dataMap[iy][ix] = sizeof(header);
}
}
cout << "sizeofheader = "<<sizeof(header)<<endl;
std::cout << "Jungfrau strixels 2X single chip with full module data " << std::endl;
mchip = 1;
remapGroup(1);
remapGroup(2);
remapGroup(3);
mchip = 6;
remapGroup(1);
remapGroup(2);
remapGroup(3);
iframe = 0;
std::cout << "data struct created" << std::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;
};
/**
Returns the frame number for the given dataset. Purely virtual func.
\param buff pointer to the dataset
\returns frame number
*/
int getFrameNumber(char *buff) {
#ifdef ALDO //VH
return ((header *)buff)->bunchNumber; //VH
#else //VH
return ((header *)buff)->detHeader.frameNumber;
#endif //VH
};
/**
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) {
#ifdef ALDO //VH
//uint32_t fakePacketNumber = 1000;
//return fakePacketNumber; //VH //TODO: Keep in mind in case of bugs! //This is definitely bad!
return 1000;
#else //VH
return ((header *)buff)->detHeader.packetNumber;
#endif //VH
};
char *readNextFrame(std::ifstream &filebin) {
int ff = -1, np = -1;
return readNextFrame(filebin, ff, np);
};
char *readNextFrame(std::ifstream &filebin, int &ff) {
int np = -1;
return readNextFrame(filebin, ff, np);
};
char *readNextFrame(std::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;
};
char *readNextFrame(std::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

View File

@ -0,0 +1,271 @@
// SPDX-License-Identifier: LGPL-3.0-or-other
// Copyright (C) 2021 Contributors to the SLS Detector Package
#ifndef JUNGFRAUSTRIXELSHALFMODULEOLD_H
#define JUNGFRAUSTRIXELSHALFMODULEOLD_H
#ifdef CINT
#include "sls/sls_detector_defs_CINT.h"
#else
#include "sls/sls_detector_defs.h"
#endif
#include "slsDetectorData.h"
/*
/afs/psi.ch/project/mythen/Anna/slsDetectorPackageDeveloperMpc2011/slsDetectorCalibration/jungfrauExecutables
make -f Makefile.rawdataprocess jungfrauRawDataProcessStrx
../dataStructures/jungfrauLGADStrixelsData.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
*/
namespace strixelsOldDesign {
constexpr int NC_STRIXEL = (1024*3);
constexpr int NR_TOTAL = (512/3);
constexpr int NR_STRIXEL = ( (256-4)/3 );
}
typedef struct {
uint64_t bunchNumber; /**< is the frame number */
uint64_t pre; /**< something */
} jf_header; //Aldo's header
using namespace strixelsOldDesign;
class jungfrauStrixelsHalfModuleOldDesign : public slsDetectorData<uint16_t> {
private:
int iframe;
#ifdef ALDO //VH
using header = jf_header; //VH
#else //VH
using header = sls::defs::sls_receiver_header;
#endif //VH
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
*/
jungfrauStrixelsHalfModuleOldDesign()
: slsDetectorData<uint16_t>( 1024*3, 512/3,
512 * 1024 * 2 + sizeof(header) ) {
std::cout << "Jungfrau strixels old design" << std::endl;
#ifdef ALDO //VH
std::cout<< "using reduced jf_header" << std::endl; //VH
#endif //VH
for (int ix = 0; ix != 1024*3; ++ix) {
for (int iy = 0; iy != 512/3; ++iy) {
dataMap[iy][ix] = sizeof(header);//+ ( 1024 * 5 + 300) * 2; //somewhere on the guardring of the LGAD
#ifdef HIGHZ
dataMask[iy][ix] = 0x3fff;
#endif
}
}
//remap
int ix, iy;
for (int ipx=0; ipx!=1024; ++ipx) {
for (int ipy=0; ipy!=256-4; ++ipy) {
iy=ipy/3;
/* //1
if (ipy%3==0) ix=ipx*3+2;
if (ipy%3==1) ix=ipx*3+1;
if (ipy%3==2) ix=ipx*3;
*/
/* //2
if (ipy%3==2) ix=ipx*3+2;
if (ipy%3==0) ix=ipx*3+1;
if (ipy%3==1) ix=ipx*3;
*/
/* //3
if (ipy%3==1) ix=ipx*3+2;
if (ipy%3==2) ix=ipx*3+1;
if (ipy%3==0) ix=ipx*3;
*/
//4 //This seems to be correct //corresponds to looking from the backside of the sensor
if (ipy%3==0) ix=ipx*3;
if (ipy%3==1) ix=ipx*3+1;
if (ipy%3==2) ix=ipx*3+2;
/* //5
if (ipy%3==2) ix=ipx*3;
if (ipy%3==0) ix=ipx*3+1;
if (ipy%3==1) ix=ipx*3+2;
*/
/* //6
if (ipy%3==1) ix=ipx*3;
if (ipy%3==2) ix=ipx*3+1;
if (ipy%3==0) ix=ipx*3+2;
*/
if ( ipx!=255 && ipx!=256 && ipx!=511 && ipx!=512 && ipx!=767 && ipx!=768 ) //avoid double pixels
// ( !( ipx%256==0 || ipx%256==255 ) || ipx==0 || ipx==1023 )
dataMap[iy][ix] = sizeof(header) + (1024 * ipy + ipx) * 2;
// cout << ipx << " " << ipy << " " << ix << " " << iy << endl;
}
}
iframe = 0;
std::cout << "data struct created" << std::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) {
#ifdef ALDO //VH
return ((header *)buff)->bunchNumber; //VH
#else //VH
return ((header *)buff)->detHeader.frameNumber;
#endif //VH
};
/**
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) {
#ifdef ALDO //VH
//uint32_t fakePacketNumber = 1000;
//return fakePacketNumber; //VH //TODO: Keep in mind in case of bugs! //This is definitely bad!
return 1000;
#else //VH
return ((header *)buff)->detHeader.packetNumber;
#endif //VH
};
char *readNextFrame(std::ifstream &filebin) {
int ff = -1, np = -1;
return readNextFrame(filebin, ff, np);
};
char *readNextFrame(std::ifstream &filebin, int &ff) {
int np = -1;
return readNextFrame(filebin, ff, np);
};
char *readNextFrame(std::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;
};
char *readNextFrame(std::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

View File

@ -54,28 +54,28 @@ class moench04CtbZmq10GbData : public slsDetectorData<uint16_t> {
#endif
#endif
cout << "off is " << off << endl;
cout << "off is " << off << endl;
if (off>0)
if (off>0)
cout << "M04 RAW DATA NEW " << endl;
else
else
cout << "M04 ZMQ DATA NEW " << endl;
int adc_nr[32] = {9, 8, 11, 10, 13, 12, 15, 14, 1, 0, 3,
2, 5, 4, 7, 6, 23, 22, 21, 20, 19, 18,
17, 16, 31, 30, 29, 28, 27, 26, 25, 24};
int adc_nr[32] = {9, 8, 11, 10, 13, 12, 15, 14, 1, 0, 3,
2, 5, 4, 7, 6, 23, 22, 21, 20, 19, 18,
17, 16, 31, 30, 29, 28, 27, 26, 25, 24};
int row, col;
int row, col;
// int isample;
int iadc;
// int ix, iy;
// int isample;
int iadc;
// int ix, iy;
// int npackets=40;
int i;
// int adc4(0);
// int npackets=40;
int i;
// int adc4(0);
for (int is = 0; is < aSamples; is++) {

View File

@ -12,8 +12,7 @@ template <class dataType> class slsDetectorData {
const int nx; /**< Number of pixels in the x direction */
const int ny; /**< Number of pixels in the y direction */
int dataSize; /**<size of the data constituting one frame */
int **dataMap; /**< Array of size nx*ny storing the pointers to the data in
the dataset (as offset)*/
dataType **dataMask; /**< Array of size nx*ny storing the polarity of the
data in the dataset (should be 0 if no inversion is
required, 0xffffffff is inversion is required) */
@ -25,6 +24,9 @@ template <class dataType> class slsDetectorData {
int isOrdered;
public:
int **dataMap; /**< Array of size nx*ny storing the pointers to the data in
the dataset (as offset)*/
/**
General slsDetectors data structure. Works for data acquired using the
slsDetectorReceiver. Can be generalized to other detectors (many virtual
@ -196,19 +198,18 @@ template <typename dataType> slsDetectorData<dataType>::~slsDetectorData() {
template <typename dataType>
void slsDetectorData<dataType>::setDataMap(int **dMap) {
int ip = 0;
int ix, iy;
// int ip = 0;
if (dMap == NULL) {
for (iy = 0; iy < ny; iy++) {
for (ix = 0; ix < nx; ix++) {
for (int iy = 0; iy < ny; iy++) {
for (int ix = 0; ix < nx; ix++) {
dataMap[iy][ix] = (iy * nx + ix) * sizeof(dataType);
}
}
} else {
// cout << "set dmap "<< dataMap << " " << dMap << endl;
for (iy = 0; iy < ny; iy++) {
for (int iy = 0; iy < ny; iy++) {
// cout << iy << endl;
for (ix = 0; ix < nx; ix++) {
for (int ix = 0; ix < nx; ix++) {
dataMap[iy][ix] = dMap[iy][ix];
// cout << ix << " " << iy << endl;
/*ip=dataMap[ix][iy]/sizeof(dataType);
@ -217,14 +218,15 @@ void slsDetectorData<dataType>::setDataMap(int **dMap) {
}
}
}
for (iy = 0; iy < ny; iy++) {
for (ix = 0; ix < nx; ix++) {
/* //commented this part because it causes out-of-bound issues if nx or ny are larger than dataMap bounds (single-chip readout of strixel with groups of different pitches) VH 2023-02-24
for (int iy = 0; iy < ny; iy++) {
for (int ix = 0; ix < nx; ix++) {
ip = dataMap[iy][ix] / sizeof(dataType);
xmap[ip] = ix;
ymap[ip] = iy;
}
}
*/
// cout << "nx:" <<nx << " ny:" << ny << endl;
}
@ -290,7 +292,6 @@ template <typename dataType>
dataType **slsDetectorData<dataType>::getData(char *ptr, int dsize) {
int el = dsize / sizeof(dataType);
// dataType **data;
int ix, iy;
// data=new dataType*[ny];
// for(int i = 0; i < ny; i++) {
// data[i]=new dataType[nx];
@ -300,6 +301,7 @@ dataType **slsDetectorData<dataType>::getData(char *ptr, int dsize) {
dsize = dataSize;
for (int ip = 0; ip < (el); ip++) {
int ix, iy;
getPixel(ip, ix, iy);
if (ix >= 0 && ix < nx && iy >= 0 && iy < ny) {
// data[iy][ix]=getChannel(ptr,ix,iy);

View File

@ -23,7 +23,7 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
/* if (etamin>=etamax) { */
/* etamin=-1; */
/* etamax=2; */
/* // cout << ":" <<endl; */
/* // std::cout << ":" <<endl; */
/* } */
/* etastep=(etamax-etamin)/nbeta; */
@ -164,7 +164,7 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
dY = -1.;
break;
default:
cout << "bad quadrant" << endl;
std::cout << "bad quadrant" << std::endl;
dX = 0.;
dY = 0.;
}
@ -174,19 +174,19 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
ex = (etax - etamin) / etastepX;
ey = (etay - etamin) / etastepY;
if (ex < 0) {
cout << "x*" << ex << endl;
std::cout << "x*" << ex << std::endl;
ex = 0;
}
if (ex >= nbetaX) {
cout << "x?" << ex << endl;
std::cout << "x?" << ex << std::endl;
ex = nbetaX - 1;
}
if (ey < 0) {
cout << "y*" << ey << " " << nbetaY << endl;
std::cout << "y*" << ey << " " << nbetaY << std::endl;
ey = 0;
}
if (ey >= nbetaY) {
cout << "y?" << ey << " " << nbetaY << endl;
std::cout << "y?" << ey << " " << nbetaY << std::endl;
ey = nbetaY - 1;
}
@ -236,7 +236,7 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
// calcMyEta(totquad,quad,cl,etax, etay);
calcEta(totquad, cc, etax, etay);
// cout <<"******"<< etax << " " << etay << endl;
// std::cout <<"******"<< etax << " " << etay << std::endl;
return addToFlatFieldDistribution(etax, etay);
}
@ -270,16 +270,16 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
/* cc[0][1] = cl[yoff * 3 + xoff + 1]; */
/* cc[1][1] = cl[(yoff + 1) * 3 + xoff + 1]; */
/* /\* cout << cl[0] << " " << cl[1] << " " << cl[2] << endl; *\/ */
/* /\* cout << cl[3] << " " << cl[4] << " " << cl[5] << endl; *\/ */
/* /\* cout << cl[6] << " " << cl[7] << " " << cl[8] << endl; *\/ */
/* /\* cout <<"******"<<totquad << " " << quad << endl; *\/ */
/* /\* cout << cc[0][0]<< " " << cc[0][1] << endl; *\/ */
/* /\* cout << cc[1][0]<< " " << cc[1][1] << endl; *\/ */
/* /\* std::cout << cl[0] << " " << cl[1] << " " << cl[2] << std::endl; *\/ */
/* /\* std::cout << cl[3] << " " << cl[4] << " " << cl[5] << std::endl; *\/ */
/* /\* std::cout << cl[6] << " " << cl[7] << " " << cl[8] << std::endl; *\/ */
/* /\* std::cout <<"******"<<totquad << " " << quad << std::endl; *\/ */
/* /\* std::cout << cc[0][0]<< " " << cc[0][1] << std::endl; *\/ */
/* /\* std::cout << cc[1][0]<< " " << cc[1][1] << std::endl; *\/ */
/* // calcMyEta(totquad,quad,cl,etax, etay); */
/* calcEta(totquad, cc, etax, etay); */
/* // cout <<"******"<< etax << " " << etay << endl; */
/* // std::cout <<"******"<< etax << " " << etay << std::endl; */
/* return addToFlatFieldDistribution(etax, etay); */
/* } */
@ -331,7 +331,7 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
virtual int *getInterpolatedImage() {
int ipx, ipy;
// cout << "ff" << endl;
// std::cout << "ff" << std::endl;
calcDiff(1, hhx, hhy); // get flat
double avg = 0;
for (ipx = 0; ipx < nSubPixelsX; ipx++)
@ -347,8 +347,8 @@ class eta2InterpolationBase : public virtual etaInterpolationBase {
ipy = iby % nSubPixelsY - nSubPixelsY / 2;
if (ipy < 0)
ipy = nSubPixelsY + ipy;
// cout << ipx << " " << ipy << " " << ibx << " " << iby <<
// endl;
// std::cout << ipx << " " << ipy << " " << ibx << " " << iby <<
// std::endl;
if (flat[ipx + ipy * nSubPixelsX] > 0)
hintcorr[ibx + iby * nSubPixelsX * nPixelsX] =
hint[ibx + iby * nSubPixelsX * nPixelsX] *

View File

@ -21,14 +21,14 @@ class etaInterpolationBase : public slsInterpolation {
double emax = 0)
: slsInterpolation(nx, ny, ns, nsy), hhx(NULL), hhy(NULL), heta(NULL),
nbetaX(nb), nbetaY(nby), etamin(emin), etamax(emax) {
// cout << "eb " << nb << " " << emin << " " << emax << endl;
// cout << nb << " " << etamin << " " << etamax << endl;
// std::cout << "eb " << nb << " " << emin << " " << emax << std::endl;
// std::cout << nb << " " << etamin << " " << etamax << std::endl;
if (nbetaX <= 0) {
// cout << "aaa:" <<endl;
// std::cout << "aaa:" <<endl;
nbetaX = nSubPixelsX * 10;
}
if (nbetaY <= 0) {
// cout << "aaa:" <<endl;
// std::cout << "aaa:" <<endl;
nbetaY = nSubPixelsY * 10;
}
if (etamin >= etamax) {
@ -145,9 +145,9 @@ class etaInterpolationBase : public slsInterpolation {
uint32_t nny;
float *gm = ReadFromTiff(imgname, nnx, nny);
/* if (nnx!=nny) { */
/* cout << "different number of bins in x " << nnx << " and y " <<
* nny<< " !"<< endl; */
/* cout << "Aborting read"<< endl; */
/* std::cout << "different number of bins in x " << nnx << " and y " <<
* nny<< " !"<< std::endl; */
/* std::cout << "Aborting read"<< std::endl; */
/* return 0; */
/* } */
nbetaX = nnx;
@ -254,12 +254,12 @@ class etaInterpolationBase : public slsInterpolation {
if (ibx >= 0 && ibx < nSubPixelsX && iby >= 0 &&
iby < nSubPixelsY) {
//
// if (ibx>0 && iby>0) cout << ibx << " " << iby << " " << ii <<
// endl;
// if (ibx>0 && iby>0) std::cout << ibx << " " << iby << " " << ii <<
// std::endl;
ftest[ibx + iby * nSubPixelsX] += heta[ii];
} else
cout << "Bad interpolation " << ii << " " << ibx << " " << iby
<< endl;
std::cout << "Bad interpolation " << ii << " " << ibx << " " << iby
<< std::endl;
}
sprintf(tit, "/scratch/ftest_%d.tiff", ind);
@ -282,7 +282,7 @@ class etaInterpolationBase : public slsInterpolation {
}
sprintf(tit, "/scratch/eta_bad_%d.tiff", ind);
WriteToTiff(etah, tit, nbetaX, nbetaY);
// cout << "Index: " << ind << "\t Bad bins: "<< nbad << endl;
// std::cout << "Index: " << ind << "\t Bad bins: "<< nbad << std::endl;
// int ibx=0, iby=0;
delete[] ftest;
@ -330,9 +330,9 @@ class etaInterpolationBase : public slsInterpolation {
}
}
// cout << endl << endl;
// std::cout << std::endl << std::endl;
for (ipy = 0; ipy < nSubPixelsY; ipy++) {
cout.width(5);
std::cout.width(5);
// flat_y[ipy]=p_tot_y[ipy];//avg/nSubPixels;
for (ipx = 0; ipx < nSubPixelsX; ipx++) {
@ -353,19 +353,19 @@ class etaInterpolationBase : public slsInterpolation {
//" ";
}
/* cout << "** " << setprecision(4) << flat_y[ipy]; */
// cout << "\n";
/* std::cout << "** " << setprecision(4) << flat_y[ipy]; */
// std::cout << "\n";
}
/* cout << "**" << endl; cout.width(5); */
/* std::cout << "**" << std::endl; std::cout.width(5); */
/* for (ipx=0; ipx<nSubPixels; ipx++) { */
/* cout << setprecision(4) << flat_x[ipx] << " "; */
/* std::cout << setprecision(4) << flat_x[ipx] << " "; */
/* } */
// cout << "**" << endl; cout.width(5);
// cout << "Min diff: " << mindiff/sqrt(avg) << " Max diff: " <<
// maxdiff/sqrt(avg) << " Nbad: " << nbad << endl;
// std::cout << "**" << std::endl; std::cout.width(5);
// std::cout << "Min diff: " << mindiff/sqrt(avg) << " Max diff: " <<
// maxdiff/sqrt(avg) << " Nbad: " << nbad << std::endl;
// cout << "Bad pixels: " <<
// 100.*(float)nbad/((float)(nSubPixels*nSubPixels)) << " %" << endl;
// std::cout << "Bad pixels: " <<
// 100.*(float)nbad/((float)(nSubPixels*nSubPixels)) << " %" << std::endl;
delete[] p_tot_x;
delete[] p_tot_y;
delete[] p_tot;

View File

@ -14,8 +14,8 @@ class etaInterpolationPosXY : public virtual etaInterpolationBase {
int nb = -1, int nby = -1, double emin = 1,
double emax = 0)
: etaInterpolationBase(nx, ny, ns, nsy, nb, nby, emin, emax){
// cout << "epxy " << nb << " " << emin << " " << emax << endl;
// cout << nbeta << " " << etamin << " " << etamax << endl;
// std::cout << "epxy " << nb << " " << emin << " " << emax << std::endl;
// std::cout << nbeta << " " << etamin << " " << etamax << std::endl;
};
etaInterpolationPosXY(etaInterpolationPosXY *orig)
@ -32,14 +32,14 @@ class etaInterpolationPosXY : public virtual etaInterpolationBase {
///*Eta Distribution Rebinning*///
// double bsize=1./nSubPixels; //precision
// cout<<"nPixelsX = "<<nPixelsX<<" nPixelsY = "<<nPixelsY<<" nSubPixels
// std::cout<<"nPixelsX = "<<nPixelsX<<" nPixelsY = "<<nPixelsY<<" nSubPixels
// = "<<nSubPixels<<endl;
double tot_eta = 0;
double tot_eta_x = 0;
double tot_eta_y = 0;
for (int ip = 0; ip < nbetaX * nbetaY; ip++)
tot_eta += heta[ip];
cout << "total eta entries is :" << tot_eta << endl;
std::cout << "total eta entries is :" << tot_eta << std::endl;
if (tot_eta <= 0) {
ok = 0;
return;
@ -57,7 +57,7 @@ class etaInterpolationPosXY : public virtual etaInterpolationBase {
for (int iby = 0; iby < nbetaY; iby++) {
etay = etamin + iby * etastepY;
// cout << etax << endl;
// std::cout << etax << std::endl;
// tot_eta_x+=hx[iby];
if (etay >= 0 && etay <= 1)
@ -90,7 +90,7 @@ class etaInterpolationPosXY : public virtual etaInterpolationBase {
for (int ibx = 0; ibx < nbetaX; ibx++) {
etax = etamin + ibx * etastepX;
// cout << etax << endl;
// std::cout << etax << std::endl;
if (etax >= 0 && etax <= 1)
hx[ibx] = heta[ibx + ib * nbetaX];
else {
@ -178,7 +178,7 @@ class eta2InterpolationPosXY : public virtual eta2InterpolationBase,
: etaInterpolationBase(nx, ny, ns, nsy, nb, nby, emin, emax),
eta2InterpolationBase(nx, ny, ns, nsy, nb, nby, emin, emax),
etaInterpolationPosXY(nx, ny, ns, nsy, nb, nby, emin, emax){
// cout << "e2pxy " << nb << " " << emin << " " << emax << endl;
// std::cout << "e2pxy " << nb << " " << emin << " " << emax << std::endl;
};
eta2InterpolationPosXY(eta2InterpolationPosXY *orig)
@ -198,8 +198,8 @@ class eta3InterpolationPosXY : public virtual eta3InterpolationBase,
: etaInterpolationBase(nx, ny, ns, nsy, nb, nby, emin, emax),
eta3InterpolationBase(nx, ny, ns, nsy, nb, nby, emin, emax),
etaInterpolationPosXY(nx, ny, ns, nsy, nb, nby, emin, emax){
// cout << "e3pxy " << nbeta << " " << etamin << " " << etamax
// << " " << nSubPixels<< endl;
// std::cout << "e3pxy " << nbeta << " " << etamin << " " << etamax
// << " " << nSubPixels<< std::endl;
};
eta3InterpolationPosXY(eta3InterpolationPosXY *orig)

View File

@ -22,7 +22,7 @@ enum quadrant {
#include <iostream>
#include <stdio.h>
using namespace std;
//using namespace std;
//#ifdef MYROOT1
//: public TObject
@ -128,7 +128,7 @@ class slsInterpolation {
nSubPixelsY * nPixelsY);
delete[] gm;
} else
cout << "Could not allocate float image " << endl;
std::cout << "Could not allocate float image " << std::endl;
return NULL;
}
@ -323,7 +323,7 @@ class slsInterpolation {
if (ix > 1)
sumR += cl[ix + iy * 3];
if (iy < 1)
sumB = cl[ix + iy * 3];
sumB = cl[ix + iy * 3]; //???? not "+="? VH
if (iy > 1)
sumT += cl[ix + iy * 3];
}
@ -472,13 +472,13 @@ class slsInterpolation {
val = cl[ix + 3 * iy];
sum += val;
if (iy == 0)
l += val;
if (iy == 2)
r += val;
if (ix == 0)
b += val;
if (ix == 2)
if (iy == 2)
t += val;
if (ix == 0)
l += val;
if (ix == 2)
r += val;
}
}
if (sum > 0) {
@ -526,6 +526,185 @@ class slsInterpolation {
return calcEta3X(cli, etax, etay, sum);
}
/************************************************/
/* Additional strixel eta functions by Viktoria */
/************************************************/
//Etax: only central row, etay: only central column
static int calcEta1x3( double* cl, double& etax, double& etay, double& toth, double& totv ) {
double l, r, t, b;
//sum = cl[0] + cl[1] + cl[2] + cl[3] + cl[4] + cl[5] + cl[6] + cl[7] + cl[8];
toth = cl[3] + cl[4] + cl[5];
if (toth > 0) {
l = cl[3];
r = cl[5];
}
etax = (-l + r) / toth;
totv = cl[1] + cl[4] + cl[7];
if (toth > 0) {
b = cl[1];
t = cl[7];
}
etay = (-b + t) / totv;
return -1;
}
static int calcEta1x3( int* cl, double& etax, double& etay, double& toth, double& totv ) {
double cli[9];
for ( int ix = 0; ix != 9; ++ix )
cli[ix] = cl[ix];
return calcEta1x3( cli, etax, etay, toth , totv );
}
//Eta 1x2 essentially the same as etaL, but we also return toth and totv
static int calcEta1x2(double totquad, int corner, double sDum[2][2],
double &etax, double &etay, double& toth, double& totv) {
double t, r;
if (totquad > 0) {
switch (corner) {
case TOP_LEFT:
t = sDum[1][1];
r = sDum[0][1];
toth = sDum[0][1] + sDum[0][0];
totv = sDum[0][1] + sDum[1][1];
break;
case TOP_RIGHT:
t = sDum[1][0];
r = sDum[0][1];
toth = sDum[0][1] + sDum[0][0];
totv = sDum[1][0] + sDum[0][0];
break;
case BOTTOM_LEFT:
r = sDum[1][1];
t = sDum[1][1];
toth = sDum[1][0] + sDum[1][1];
totv = sDum[0][1] + sDum[1][1];
break;
case BOTTOM_RIGHT:
t = sDum[1][0];
r = sDum[1][1];
toth = sDum[1][0] + sDum[1][1];
totv = sDum[1][0] + sDum[0][0];
break;
default:
etax = -1000;
etay = -1000;
return 0;
}
// etax=r/totquad;
// etay=t/totquad;
etax = r / toth;
etay = t / totv;
}
return 0;
}
static int calcEta1x2( double *cl, double &etax, double &etay, double &sum,
double &totquad, double sDum[2][2], double& toth, double& totv ) {
int corner = calcQuad( cl, sum, totquad, sDum );
calcEta1x2( totquad, corner, sDum, etax, etay, toth, totv );
return corner;
}
static int calcEta1x2( int *cl, double &etax, double &etay, double &sum,
double &totquad, double sDum[2][2], double& toth, double& totv ) {
int corner = calcQuad( cl, sum, totquad, sDum );
calcEta1x2( totquad, corner, sDum, etax, etay, toth , totv );
return corner;
}
//Two functions to calculate 2x3 or 3x2 eta
static int calcEta2x3( double* cl, double totquad, int corner, double& etax, double& etay, double& tot6 ) {
double t, b, r;
if (totquad > 0) {
switch (corner) {
case TOP_LEFT:
case BOTTOM_LEFT:
t = cl[6] + cl[7];
b = cl[0] + cl[1];
r = cl[1] + cl[4] + cl[7];
tot6 = cl[0] + cl[1] + cl[3] + cl[4] + cl[6] + cl[7];
break;
case TOP_RIGHT:
case BOTTOM_RIGHT:
t = cl[7] + cl[8];
b = cl[1] + cl[2];
r = cl[2] + cl[5] + cl[8];
tot6 = cl[1] + cl[2] + cl[4] + cl[5] + cl[7] + cl[8];
break;
default:
etax = -1000;
etay = -1000;
return -1;
}
etax = r / tot6;
etay = (-b + t) / tot6;
}
return -1;
}
static int calcEta3x2( double* cl, double totquad, int corner, double& etax, double& etay, double& tot6 ) {
double t, l, r;
if (totquad > 0) {
switch (corner) {
case TOP_LEFT:
case TOP_RIGHT:
l = cl[3] + cl[6];
r = cl[5] + cl[8];
t = cl[6] + cl[7] + cl[8];
tot6 = cl[3] + cl[4] + cl[5] + cl[6] + cl[7] + cl[8];
break;
case BOTTOM_LEFT:
case BOTTOM_RIGHT:
l = cl[0] + cl[3];
r = cl[2] + cl[5];
t = cl[3] + cl[4] + cl[5];
tot6 = cl[0] + cl[1] + cl[2] + cl[3] + cl[4] + cl[5];
break;
default:
etax = -1000;
etay = -1000;
return -1;
}
etax = (-l + r) / tot6;
etay = t / tot6;
}
return -1;
}
//overload including both eta2x3 and eta3x2
//ornt (orientation of long side (3) of eta) decides which eta is chosen
enum orientation {
HORIZONTAL_ORIENTATION = 0,
VERTICAL_ORIENTATION = 1,
UNDEFINED_ORIENTATION = -1
};
static int calcEta2x3( int ornt, double* cl, double& etax, double& etay, double& tot6 ) {
double sum{};
double totquad{};
double sDum[2][2]{};
int corner = calcQuad( cl, sum, totquad, sDum );
switch (ornt) {
case HORIZONTAL_ORIENTATION:
calcEta3x2( cl, totquad, corner, etax, etay, tot6 );
break;
case VERTICAL_ORIENTATION:
calcEta2x3( cl, totquad, corner, etax, etay, tot6 );
break;
default:
etax = -1000;
etay = -1000;
return -1;
}
return corner;
}
static int calcEta2x3( int strxo, int* cl, double& etax, double& etay, double& tot6 ) {
double cli[9]{};
for ( int ix = 0; ix != 9; ++ix )
cli[ix] = cl[ix];
return calcEta2x3( strxo, cli, etax, etay, tot6 );
}
/* static int calcMyEta(double totquad, int quad, double *cl, double &etax,
* double &etay) { */
/* double l,r,t,b, sum; */

View File

@ -0,0 +1 @@
Makefile.zmqrootdisp

View File

@ -14,7 +14,19 @@ jungfrauRawDataProcess: jungfrauRawDataProcess.cpp $(INCS) clean
g++ -o jungfrauRawDataProcess jungfrauRawDataProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL -DMODULE
jungfrauRawDataProcessStrx: jungfrauRawDataProcess.cpp $(INCS) clean
g++ -o jungfrauRawDataProcessStrx jungfrauRawDataProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL -DJFSTRX
g++ -o jungfrauRawDataProcessStrx jungfrauRawDataProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL -DJFSTRX
jungfrauRawDataProcessStrxChip1: jungfrauRawDataProcess.cpp $(INCS) clean
g++ -o jungfrauRawDataProcessStrxChip1 jungfrauRawDataProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL -DJFSTRXCHIP1
jungfrauRawDataProcessStrxChip6: jungfrauRawDataProcess.cpp $(INCS) clean
g++ -o jungfrauRawDataProcessStrxChip6 jungfrauRawDataProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL -DJFSTRXCHIP6
jungfrauRawDataProcessStrxChip1Aldo: jungfrauRawDataProcess.cpp $(INCS) clean
g++ -o jungfrauRawDataProcessStrxChip1Aldo jungfrauRawDataProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL -DJFSTRXCHIP1 -DALDO
jungfrauRawDataProcessStrxChip6Aldo: jungfrauRawDataProcess.cpp $(INCS) clean
g++ -o jungfrauRawDataProcessStrxChip6Aldo jungfrauRawDataProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL -DJFSTRXCHIP6 -DALDO
jungfrauRawDataProcessStrxAldo: jungfrauRawDataProcess.cpp $(INCS) clean
g++ -o jungfrauRawDataProcessStrxAldo jungfrauRawDataProcess.cpp $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF) -DSAVE_ALL -DJFSTRX -DALDO

View File

@ -18,7 +18,7 @@ LDFLAG= -L/usr/lib64/ -lpthread -lm -lstdc++ -lzmq -pthread -lrt -ltiff -O3
default: onlinedisp_zmq
onlinedisp_zmq: onlinedisp_zmq.cpp onlinedisp_zmq.h
onlinedisp_zmq: onlinedisp_zmq.cpp onlinedisp_zmq.h ../dataStructures/jungfrauLGADStrixelsData_new.h
# flags from root-config --cflags --glibs
g++ -o onlinedisp_zmq onlinedisp_zmq.cpp -I. -I$(ROOTSYS)/include -Wall -g -lm -L. -lzmq -pthread -lrt -L$(ROOTSYS)/lib -lGui -lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -m64 $(LDFLAG) $(INCDIR) $(LIBHDF5) $(LIBRARYCBF)

View File

@ -10,8 +10,7 @@
#define RAWDATA
#ifndef JFSTRX
#ifndef JFSTRXOLD
#if !defined JFSTRX && !defined JFSTRXOLD && !defined JFSTRXCHIP1 && !defined JFSTRXCHIP6
#ifndef MODULE
#include "jungfrauHighZSingleChipData.h"
#endif
@ -19,10 +18,13 @@
#include "jungfrauModuleData.h"
#endif
#endif
#endif
#ifdef JFSTRX
#include "jungfrauLGADStrixelsData.h"
#endif
#if defined JFSTRXCHIP1 || defined JFSTRXCHIP6
#include "jungfrauLGADStrixelsDataSingleChip.h"
#endif
#ifdef JFSTRXOLD
#include "jungfrauStrixelsHalfModuleOldDesign.h"
#endif
@ -56,15 +58,14 @@ int main(int argc, char *argv[]) {
int fifosize = 1000;
int nthreads = 10;
int csize = 3;
int csize = 3; //3
int nsigma = 5;
int nped = 10000;
int cf = 0;
#ifndef JFSTRX
#ifndef JFSTRXOLD
#if !defined JFSTRX && !defined JFSTRXOLD && !defined JFSTRXCHIP1 && !defined JFSTRXCHIP6
#ifndef MODULE
jungfrauHighZSingleChipData *decoder = new jungfrauHighZSingleChipData();
int nx = 256, ny = 256;
@ -72,17 +73,26 @@ int main(int argc, char *argv[]) {
#ifdef MODULE
jungfrauModuleData *decoder = new jungfrauModuleData();
int nx = 1024, ny = 512;
#endif
#endif
#endif
#endif
#endif
#ifdef JFSTRX
cout << "bbb" << endl;
cout << "Jungfrau strixel full module readout" << endl;
jungfrauLGADStrixelsData *decoder = new jungfrauLGADStrixelsData();
int nx = 1024/5, ny = 512*5;
#endif
#ifdef JFSTRXCHIP1
std::cout << "Jungfrau strixel LGAD single chip 1" << std::endl;
jungfrauLGADStrixelsDataSingleChip *decoder = new jungfrauLGADStrixelsDataSingleChip(1);
int nx = 256/3, ny = 256*5;
#endif
#ifdef JFSTRXCHIP6
std::cout << "Jungfrau strixel LGAD single chip 6" << std::endl;
jungfrauLGADStrixelsDataSingleChip *decoder = new jungfrauLGADStrixelsDataSingleChip(6);
int nx = 256/3, ny = 256*5;
#endif
#ifdef JFSTRXOLD
cout << "ccc" << endl;
std::cout << "Jungfrau strixels old design" << std::endl;
jungfrauStrixelsHalfModuleOldDesign *decoder = new jungfrauStrixelsHalfModuleOldDesign();
int nx = 1024*3, ny = 512/3;
#endif
@ -180,7 +190,7 @@ int main(int argc, char *argv[]) {
uint32_t nnx, nny;
singlePhotonDetector *filter = new singlePhotonDetector(
decoder, csize, nsigma, 1, NULL, nped, 200, -1, -1, gainmap, NULL);
decoder, 3, nsigma, 1, NULL, nped, 200, -1, -1, gainmap, NULL);
if (gainfname) {
@ -211,6 +221,8 @@ int main(int argc, char *argv[]) {
// multiThreadedAnalogDetector(filter,nthreads,fifosize);
multiThreadedCountingDetector *mt =
new multiThreadedCountingDetector(filter, nthreads, fifosize);
mt->setClusterSize(csize,csize);
#ifndef ANALOG
mt->setDetectorMode(ePhotonCounting);
cout << "Counting!" << endl;

View File

@ -7,17 +7,23 @@ sls::zmqHeader zHeader;
#define NPRO 50
#define NPRI 50
//#define JFSTRX
#define JFSTRX
#ifdef JFSTRX
#include "jungfrauLGADStrixelsData.h"
#else
#include "jungfrauModuleData.h"
#include "jungfrauLGADStrixelsData_new.h"
#include "sls/sls_detector_defs.h"
#include "slsDetectorData.h"
using header = sls::defs::sls_receiver_header;
#endif
int main(int argc, char* argv[])
{
goout=1;
hasallpede=false;
dophotonmap=true; if ((argc<3)) {printf("USAGE: command photon_energy_(peakinADC) [rx_ip] [port] \n"); return -1 ;}
@ -43,9 +49,19 @@ int main(int argc, char* argv[])
#ifdef JFSTRX
cout << "JFSTRX" << endl;
jungfrauLGADStrixelsData *decoder = new jungfrauLGADStrixelsData();
nx = 1024/5; ny= 512*5;
decoder->getDetectorSize(nx,ny);
cout<< decoder->dataMap[22][22] <<endl;
#else
nx = 1024; ny= 512;
#endif
@ -57,7 +73,7 @@ int main(int argc, char* argv[])
HDraw_every=20;
fixranges=false;
int group;
hchptr = (short*) malloc(NCH*sizeof(short));
@ -80,29 +96,85 @@ int main(int argc, char* argv[])
char hname[100];
#ifdef JFSTRX
int nxx=79; int nyy=165;
his1000= new TH2F("his1000","2d, chip 1 group 1 (25um) pede corr.",nxx,-0.5,nxx-0.5,nyy,-0.5,nyy-0.5);
his1060= new TH2F("his1060","2d, chip 6 group 1 (25um) pede corr.",nxx,-0.5,nxx-0.5,nyy,-0.5,nyy-0.5);
nxx=47; nyy=320; //320;
his1001= new TH2F("his1001","2d, chip 1 group 2 (15um) pede corr.",nxx,-0.5,nxx-0.5,nyy,-0.5,nyy-0.5);
his1061= new TH2F("his1061","2d, chip 6 group 2 (15um) pede corr.",nxx,-0.5,nxx-0.5,nyy,-0.5,nyy-0.5);
nxx=59; nyy=476; //476;
his1002= new TH2F("his1002","2d, chip 1 group 3 (18.75um) pede corr.",nxx,-0.5,nxx-0.5,nyy,-0.5,nyy-0.5);
his1062= new TH2F("his1002","2d, chip 6 group 3 (18.75um) pede corr.",nxx,-0.5,nxx-0.5,nyy,-0.5,nyy-0.5);
his1000->SetOption("colz");
his1001->SetOption("colz");
his1002->SetOption("colz");
his1060->SetOption("colz");
his1061->SetOption("colz");
his1062->SetOption("colz");
#else
his1000= new TH2F("his1000","2d , ev. pede corrected",nx,-0.5,nx-0.5,ny,-0.5,ny-0.5);
his1000->SetOption("colz");
#endif
his2000= new TH2F("his2000","2d gain ",nx,-0.5,nx-0.5,ny,-0.5,ny-0.5);
his2000->GetZaxis()->SetRangeUser(0,4);
if (dophotonmap) {
his3000= new TH2F("his3000"," photon map ",nx,-0.5,nx-0.5,ny,-0.5,ny-0.5);
his3000= new TH2F("his3000"," photon map ",1024,-0.5,1024-0.5,512,-0.5,512-0.5);
}
else {
his3000= new TH2F("his3000"," raw adc ",nx,-0.5,nx-0.5,ny,-0.5,ny-0.5);
his3000= new TH2F("his3000"," raw adc ",1024,-0.5,1024-0.5,512,-0.5,512-0.5);
}
his4500= new TH2F("his45000","L vs R",101,-50,500,101,-50,500);
his4500= new TH2F("his4500","T vs B",101,-500,MAX_POS,101,-500,MAX_POS);
hchip=new TH1I*[8];
#ifdef JFSTRX
for (i=0;i<8;i++) {
if(i<3)
sprintf(hname,"%d_hchip1group%d",i,i+1);
else if (i>4)
sprintf(hname,"%d_hchip6group%d",i, i-4);
else
sprintf(hname,"%d_",i);
hchip[i] = new TH1I(hname,hname,NBIN,MIN_POS,MAX_POS);
}
#else
for (i=0;i<8;i++) {
sprintf(hname,"hchip%d",i);
hchip[i] = new TH1I(hname,hname,NBIN,MIN_POS,MAX_POS);
}
#endif
cout <<"end of histo booking" <<endl;
if (A2==NULL) A2 = new TCanvas("A2","Plotting Canvas gain",150,10,500,250);
if (A3==NULL) A3 = new TCanvas("A3","Plotting Canvas ADC",150,360,1200,550);
if (A3==NULL) {
#ifdef JFSTRX
A3 = new TCanvas("A3","Plotting Canvas ADC",150,360,1200,750);
p1 = new TPad("p1","p1",0.01,0.5,0.49,1.);
p1->Draw();
p2 = new TPad("p2","p2",0.51,0.75,0.99,0.97);
p2->Draw();
p3 = new TPad("p3","p3",0.01,0.25,0.49,0.47);
p3->Draw();
p4 = new TPad("p4","p4",0.51,0.53,0.99,0.75);
p4->Draw();
p5 = new TPad("p5","p5",0.01,0.03,0.49,0.25);
p5->Draw();
p6 = new TPad("p6","p6",0.51,0.,0.99,0.5);
p6->Draw();
//A3->Divide(2,3);
// TVirtualPad* g=A3->cd(1);
// g->SetCanvasSize( g->GetWw(), 2*g->GetWw());
// g=A3->cd(6);
// g->SetCanvasSize( g->GetWw(), 2*g->GetWw());
#else
A3 = new TCanvas("A3","Plotting Canvas ADC",150,360,1200,550);
#endif
}
if (A4==NULL) A4 = new TCanvas("A4","Plotting Canvas PHs",750,300,1000,800);
A4->Clear();
A4->Divide(4,2,0.005,0.005);
@ -131,7 +203,14 @@ int main(int argc, char* argv[])
}
{
memcpy(&croi, &zHeader.detSpec1, 8);
ROIxmin=croi.xmin;
ROIxmax=croi.xmax;
ROIymin=croi.ymin;
ROIymax=croi.ymax;
cout<<" ROIymin "<< ROIymin<<endl;
framesinstream++;
running++;
@ -143,7 +222,19 @@ int main(int argc, char* argv[])
npacket=0;
if (show2Ds) {
#ifdef JFSTRX
his1000->Reset();
his1001->Reset();
his1002->Reset();
his1060->Reset();
his1061->Reset();
his1062->Reset();
#else
his1000->Reset();
#endif
his2000->Reset();
if (!dophotonmap) his3000->Reset(); //FOR RAW ADC DISPLAY
}
@ -187,10 +278,28 @@ int main(int argc, char* argv[])
if (fill1Ds) {
if (((i%1024)<1004)&&((i%1024)>20)&&((i/1024)>20)) { //skip the pix near guardring for PH plots
ichip= i/(256*256*4)*4+((i/256)%4) ;
#ifdef JFSTRX
int new_ichip=0;
//exclude border rows of each group
if (ichip==1) {
if (i<=(1024*(64-2))) new_ichip=0; //chip 1 group 1
if (i>(1024*(64+6))&&(i<=(1024*(64*2-4)))) new_ichip=1; //chip 1 group 2
if (i>(1024*(64*2+5))) new_ichip=2; //chip 1 group 3
}
if (ichip==6) {
if (i<=(1024*(256+2*64-5))) new_ichip=7; //chip 6 group 3
if (i>(1024*(256+2*64+4))&&(i<=(1024*(256+64*3-6)))) new_ichip=6; //chip 6 group 2
if (i>(1024*(256+64*3-4))) new_ichip=5; //chip 6 group 1
}
hchip[new_ichip]->Fill(adcpedecorr,1);
#else
hchip[ichip]->Fill(adcpedecorr,1);
#endif
if (((i%256)<253)&&((i%256)>2)) his4500->Fill(adcpedecorrold,adcpedecorr,1);
// if (((i%256)<253)&&((i%256)>2)) his4500->Fill(adcpedecorrold,adcpedecorr,1);
adcpedecorrold=adcpedecorr;
@ -200,33 +309,110 @@ int main(int argc, char* argv[])
if ((show2Ds)) {
factor=2.0;
value=adcpedecorr;
if ((i%256==0)||(i%256==255)) value=int(value/factor);
if ((i/1024==255)||(i/1024==256)||(i/1024==767)||(i/1024==768)) value=int(value/factor);
his1000->Fill(float(i%1024),float(int (i/1024)),value);
if (!dophotonmap) his3000->Fill(float(i%1024),float(int (i/1024)) ,adcvalue);
his2000->Fill(float(i%1024),float(int (i/1024)) ,gain);
value=(int)(hchptr[i]);
if ((i%256==0)||(i%256==255)) value=int(value/factor);
if ((i/1024==255)||(i/1024==256)||(i/1024==767)||(i/1024==768)) value=int(value/factor);
if (dophotonmap) his3000->Fill(float(i%1024),float(int (i/1024)),float(value));
}
}// for (i=0 ;i<NCH-0;i++)
if ((show2Ds)) {
for (ipx=0;ipx<nx;ipx++){
for (ipy=0;ipy<ny;ipy++){
// for (ipx=0;ipx<nx;ipx++){
#ifdef JFSTRX
//cout<<i<< " cdcsdcvsvcsc " << group << " " << (decoder->dataMap[ipy][ipx])/2 << endl;
i=int (((decoder->dataMap[ipy][ipx])-sizeof(header)) /2);
group=(decoder->groupmap[ipy][ipx]);
// cout<<i<< " "<<ipx<<" "<<ipy<< " " << group <<endl;
#else
i=ipx+ipy*1024;
#endif
value= ((image_data[i]) & 0x3fff) -fpeded[i];
#ifndef JFSTRX
if ((i%256==0)||(i%256==255)) value=int(value/factor);
if ((i/1024==255)||(i/1024==256)||(i/1024==767)||(i/1024==768)) value=int(value/factor);
#endif
// his1000->Fill(float(ipx),float(ipy),value);
// if ((ipy>165)&&(ipy<320+165)){ his1000->Fill(float(ipx)*5/3.0,float(ipy),value);}
// else { his1000->Fill(float(ipx),float(ipy),value);}
#ifdef JFSTRX
static const int mc1g1y_start = 0;
static const int mc1g2y_start = g1_nrows;
static const int mc1g3y_start = g1_nrows+g2_nrows;
static const int mc6g3y_start = g1_nrows+g2_nrows+g3_nrows;
static const int mc6g2y_start = mc6g3y_start + g3_nrows;
static const int mc6g1y_start = mc6g3y_start + g3_nrows + g2_nrows;
if (group==0) {
if (ipy<165){
his1000->Fill(float(ipx),float(ipy-mc1g1y_start),value);}
if (ipy>=mc6g1y_start){
his1060->Fill(float(ipx),float(ipy-mc6g1y_start),value);}
}
if (group==1) {
if (ipy<(165+320)){
his1001->Fill(float(ipx),float(ipy-mc1g2y_start),value);}
if ( (ipy>=mc6g2y_start) && (ipy<mc6g1y_start) ){his4500->Fill(value,oldvalue,1.0);
oldvalue=value;
his1061->Fill(float(ipx),float(ipy-mc6g2y_start),value);}
}
if (group==2) {
if (ipy<(165+320+476))
his1002->Fill(float(ipx),float(ipy-mc1g3y_start),value);
if ( (ipy>=mc6g3y_start) && (ipy<mc6g2y_start) )
his1062->Fill(float(ipx),float(ipy-mc6g3y_start),value);
}
#else
his1000->Fill(float(ipx),float(ipy),value);
#endif
his2000->Fill(float(ipx),float(ipy) ,gain);
// if (!dophotonmap)his3000->Fill(float(ipx),float(ipy) ,value);
// value=(int)(hchptr[i]);
// if (dophotonmap) his3000->Fill(float(ipx),float(ipy),float(value));
}// for ipx
} //for ipy
for (ipx=0;ipx<1024;ipx++){
for (ipy=0;ipy<512;ipy++){
i=ipx+ipy*1024;
value= ((image_data[i]) & 0x3fff) -fpeded[i];
if (!dophotonmap)his3000->Fill(float(ipx),float(ipy) ,value);
value=(int)(hchptr[i]);
if (dophotonmap) his3000->Fill(float(ipx),float(ipy),float(value));
}
}
}// endo of show2d
}// /end of do something
if ((show2Ds)) {
for (ipx=0;ipx<NCH;ipx++) hchptr[(ipx)]=0;
for (i=0;i<NCH;i++) hchptr[(i)]=0;
@ -419,10 +605,31 @@ void SetRanges() {
void axisreset(){
fixranges=false;
#ifdef JFSTRX
his1000->GetXaxis()->UnZoom();
his1000->GetYaxis()->UnZoom();
his1000->GetZaxis()->UnZoom();
his1001->GetXaxis()->UnZoom();
his1001->GetYaxis()->UnZoom();
his1001->GetZaxis()->UnZoom();
his1002->GetXaxis()->UnZoom();
his1002->GetYaxis()->UnZoom();
his1002->GetZaxis()->UnZoom();
his1060->GetXaxis()->UnZoom();
his1060->GetYaxis()->UnZoom();
his1060->GetZaxis()->UnZoom();
his1061->GetXaxis()->UnZoom();
his1061->GetYaxis()->UnZoom();
his1061->GetZaxis()->UnZoom();
his1062->GetXaxis()->UnZoom();
his1062->GetYaxis()->UnZoom();
his1062->GetZaxis()->UnZoom();
#else
his1000->GetXaxis()->UnZoom();
his1000->GetYaxis()->UnZoom();
his1000->GetZaxis()->UnZoom();
#endif
his2000->GetXaxis()->UnZoom();
his2000->GetYaxis()->UnZoom();
@ -540,7 +747,6 @@ void Plot1DHistos(void){
void Plot2DHistos(void){
gStyle->SetOptStat(0);
A3->cd();
// if (bw_flag) LoadPaletteBW(1.0);
@ -553,8 +759,24 @@ void Plot2DHistos(void){
}
his1000->SetMinimum(-200);
his1000->Draw();
#ifdef JFSTRX
p5->cd();
his1000->Draw("colz");
p3->cd();
his1001->Draw("colz");
p1->cd();
his1002->Draw("colz");
p2->cd();
his1060->Draw("colz");
p4->cd();
his1061->Draw("colz");
p6->cd();
his1062->Draw("colz");
#else
A3->cd();
his1000->Draw("colz");
#endif
A3->Update();
A2->cd();
// if (bw_flag) LoadPaletteFalse();
@ -565,9 +787,16 @@ void Plot2DHistos(void){
A2->Update();
A5->cd();
his3000->GetXaxis()->SetRange(his1000->GetXaxis()->GetFirst(),his1000->GetXaxis()->GetLast());
his3000->GetYaxis()->SetRange(his1000->GetYaxis()->GetFirst(),his1000->GetYaxis()->GetLast());
//his3000->GetXaxis()->SetRange(his1000->GetXaxis()->GetFirst(),his1000->GetXaxis()->GetLast());
//his3000->GetYaxis()->SetRange(his1000->GetYaxis()->GetFirst(),his1000->GetYaxis()->GetLast());
his3000->Draw("colz");
box = new TBox(ROIxmin,ROIymin,ROIxmax,ROIymax);
box->SetLineColor(kRed);
box->SetFillStyle(0);
box->SetLineWidth(2);
box->Draw();
A5->Update();
A6->cd();

View File

@ -56,6 +56,7 @@ using namespace sls;
#include "TMath.h"
#include "TFile.h"
#include "TStyle.h"
#include "TBox.h"
#include "TSystem.h"
#include "TTimer.h"
#include "TProfile.h"
@ -81,7 +82,7 @@ using namespace sls;
#define OFFSET 0
#define NBIN 500
#define MIN_POS -500.5 // 400.5
#define MAX_POS 3499.5 //-100.5
#define MAX_POS 8499.5 //-100.5
#define NCH 524288
@ -92,7 +93,7 @@ int portnum;
FILE * sfilefd;
short* hchptr; // photon counted map "histogram"
int value;
int value,oldvalue;
float factor=1.84;
int npacket=0;
int totalnpacket=0;
@ -105,6 +106,7 @@ struct hostent *server;
int i=0;
int ipx=0;
int ipy=0;
bool haveconnection;
@ -112,6 +114,12 @@ TStyle *gStyle;
TApplication* rootapp;
TCanvas *A2;
TCanvas *A3;
TPad *p1;
TPad *p2;
TPad *p3;
TPad *p4;
TPad *p5;
TPad *p6;
TCanvas *A4;
TCanvas *A5;
TCanvas *A6;
@ -139,6 +147,18 @@ bool fill1Ds;
bool pede_flag;
bool dophotonmap;
typedef struct {
uint16_t xmin;
uint16_t xmax;
uint16_t ymin;
uint16_t ymax;
} receriverRoi_compact;
receriverRoi_compact croi;
TBox *box;
uint16_t ROIxmin;
uint16_t ROIxmax;
uint16_t ROIymin;
uint16_t ROIymax;
int nx, ny;
int nframes;
int goout;
@ -154,7 +174,8 @@ int frameIndex_old;
char pedefilename[128];
int framenum,bunchid;
TH2F* his1000;
TH2F* his1000;TH2F* his1001;TH2F* his1002;
TH2F* his1060;TH2F* his1061;TH2F* his1062;
TH2F* his2000;
TH2F* his3000;
TH2F* his4500;

View File

@ -30,13 +30,14 @@ int main(int argc, char *argv[]) {
int runmax = atoi(argv[5]);
int nsubpix = atoi(argv[6]);
int etabins = 1000; // nsubpix*2*100;
double etamin = -1, etamax = 2;
// int etabins = 1000; // nsubpix*2*100;
// double etamin = -1, etamax = 2;
int quad;
double sum, totquad;
double sDum[2][2];
double etax, etay, int_x, int_y;
int ok;
// double etax, etay;
double int_x, int_y;
// int ok;
int ix, iy, isx, isy;

View File

@ -86,17 +86,10 @@ int main(int argc, char *argv[]) {
#endif
int nx = 400, ny = 400;
//Read detector size from decoder
int nx , ny;
decoder->getDetectorSize(nx, ny);
#ifdef CORR
int ncol_cm = CM_ROWS;
double xt_ghost = C_GHOST;
#endif
moench03CommonMode *cm = NULL;
moench03GhostSummation *gs;
double *gainmap = NULL;
//float *gm;
int ff, np;
@ -171,8 +164,15 @@ int main(int argc, char *argv[]) {
uint32_t nnx, nny;
moench03CommonMode *cm = nullptr;
moench03GhostSummation *gs = nullptr;
double *gainmap = nullptr;
#ifdef CORR
cout << "Applying common mode " << ncol_cm << endl;
int ncol_cm = CM_ROWS;
double xt_ghost = C_GHOST;
std::cout << "Applying common mode " << ncol_cm << endl;
cm = new moench03CommonMode(ncol_cm);
// cout << "Applying ghost corrections " << xt_ghost << endl;

View File

@ -69,6 +69,11 @@ class threadedAnalogDetector {
};
virtual double setThreshold(double th) { return det->setThreshold(th); };
virtual double setClusterSize(int csx, int csy) {
//cout << "44" << endl;
return det->setClusterSize(csx);
};
virtual void setROI(int xmin, int xmax, int ymin, int ymax) {
det->setROI(xmin, xmax, ymin, ymax);
};

View File

@ -19,7 +19,7 @@ using namespace std;
class multiThreadedCountingDetector : public multiThreadedAnalogDetector {
public:
multiThreadedCountingDetector(singlePhotonDetector *d, int n, int fs = 1000)
multiThreadedCountingDetector(singlePhotonDetector *d, int n, int fs = 1000)
: multiThreadedAnalogDetector(d, n, fs){};
// virtual
// ~multiThreadedCountingDetector{multiThreadedAnalogDetector::~multiThreadedAnalogDetector();};
@ -33,6 +33,11 @@ class multiThreadedCountingDetector : public multiThreadedAnalogDetector {
for (int i = 0; i < nThreads; i++)
(dets[i])->setEnergyRange(emi, ema);
};
virtual void setClusterSize(int sizex, int sizey) {
for (int i = 0; i < nThreads; i++)
((dets[i]))->setClusterSize(sizex, sizey);
//std::cout << "+++++++++++++ sizex " << sizex << std::endl;
};
};
#endif

View File

@ -174,8 +174,9 @@ class singlePhotonDetector : public analogDetector<uint16_t> {
clusterSizeY = clusterSize;
else
clusterSizeY = 1;
for (int ip = 0; ip < nx * ny; ip++)
for (int ip = 0; ip < nx * ny; ip++) {
(clusters + ip)->set_cluster_size(clusterSize, clusterSizeY);
}
// cluster=new single_photon_hit(clusterSize,clusterSizeY);
}
return clusterSize;
@ -533,6 +534,7 @@ class singlePhotonDetector : public analogDetector<uint16_t> {
(clusters + nph)->print();
cout << max << " " << val[iy * nx + ix] << endl;
}
//else (clusters + nph)->print();
good = 1;
if (eMin > 0 && tot < eMin)
good = 0;

View File

@ -44,14 +44,12 @@ class single_photon_hit {
// fwrite((void*)this, 1, 3*sizeof(int)+4*sizeof(double)+sizeof(quad),
// myFile); // if (fwrite((void*)this, 1,
// sizeof(int)+2*sizeof(int16_t), myFile))
#ifdef OLDFORMAT
if (fwrite((void *)&iframe, 1, sizeof(int), myFile)) {
};
#endif
#ifndef WRITE_QUAD
// printf("no quad ");
if (fwrite((void *)&x, sizeof(int16_t), 2, myFile))
if ( fwrite( (void*)&x, sizeof(int16_t), 1, myFile ) ) {
if ( fwrite( (void*)&y, sizeof(int16_t), 1, myFile ) )
return fwrite((void *)data, sizeof(int), dx * dy, myFile);
}
#endif
#ifdef WRITE_QUAD
// printf("quad ");
@ -109,14 +107,27 @@ class single_photon_hit {
// fread((void*)this, 1, 3*sizeof(int)+4*sizeof(double)+sizeof(quad),
// myFile);
#ifdef OLDFORMAT
if (fread((void *)&iframe, 1, sizeof(int), myFile)) {
}
#endif
#ifndef WRITE_QUAD
// printf( "no quad \n");
//printf( "no quad \n");
//This reads two values of size int16_t into x
//If x is located next to y (int16_t distance), this reads the values into x and y
//How can I be sure, this is always the case?
//If, e.g., the memory is padded after int16_t x, do we read the padding instead of y?
//How can I be sure the memory is packed and y follows right after x with no padding?
//Anyway, this is dangerous if anyone, at any point, changes the order of variable declaration,
//or uses another architecture (64 bit vs 32 bit for instance).
/*
if (fread((void *)&x, sizeof(int16_t), 2, myFile))
return fread((void *)data, sizeof(int), dx * dy, myFile);
*/
//Suggestion
if ( fread( (void*)&x, sizeof(int16_t), 1, myFile) ) { //reads x
if ( fread( (void*)&y, sizeof(int16_t), 1, myFile ) ) //reads y
return fread( (void*)data, sizeof(int), dx*dy, myFile ); //reads and returns data
}
#endif
#ifdef WRITE_QUAD
int qq[4];
@ -217,7 +228,7 @@ class single_photon_hit {
// int ix, iy;
printf("***************\n");
printf("** %d %d **\n",x,y);
printf("** %d %d ** %d %d **\n", x, y, dx, dy);
for (int iy = 0; iy < dy; iy++) {
for (int ix = 0; ix < dx; ix++) {
printf("%d \t", data[ix + iy * dx]);
@ -261,10 +272,11 @@ class single_photon_hit {
x within the cluster (center is (0,0)) \param iy coordinate y within the
cluster (center is (0,0)) \returns value of the cluster element
*/
double get_data(int ix, int iy = 0) {
return data[(iy + dy / 2) * dx + ix + dx / 2];
//Why not make these const? VH
double get_data(int ix, int iy = 0) const {
return data[(iy + dy / 2) * dx + ix + dx / 2]; //NOTE: those are int divisions
};
int *get_cluster() { return data; };
int *get_cluster() const { return data; };
int iframe; /**< frame number */
double

File diff suppressed because it is too large Load Diff

View File

@ -68,7 +68,6 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
void Zoom1DGainPlot(const QRectF &rect);
void Zoom2DGainPlot(const QRectF &rect);
void SetSaveFileName(QString val);
// void UpdatePlot();
signals:
void AcquireFinishedSignal();

View File

@ -32,7 +32,6 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
void SetNumFrames(int val);
void SetNumTriggers(int val);
void SetNumBursts(int val);
void SetNumSamples(int val);
void SetNumGates(int val);
void SetExposureTime();
void SetAcquisitionPeriod();
@ -64,7 +63,6 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
void GetNumFrames();
void GetNumTriggers();
void GetNumBursts();
void GetNumSamples();
void GetNumGates();
void GetExposureTime();
void GetAcquisitionPeriod();
@ -96,7 +94,6 @@ class qTabMeasurement : public QWidget, private Ui::TabMeasurementObject {
QString errPeriodTip;
QPalette red;
bool delayImplemented;
bool sampleImplemented;
bool gateImplemented;
bool startingFnumImplemented;
bool isAcquisitionStopped{false};

View File

@ -52,6 +52,7 @@ void qDrawPlot::SetupWidgetWindow() {
detType = det->getDetectorType().squash();
switch (detType) {
case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
pixelMask = ((1 << 14) - 1);
gainMask = (3 << 14);
gainOffset = 14;
@ -1142,7 +1143,8 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size,
break;
case 16:
if (detType == slsDetectorDefs::JUNGFRAU ||
if (detType == slsDetectorDefs::MOENCH ||
detType == slsDetectorDefs::JUNGFRAU ||
detType == slsDetectorDefs::GOTTHARD2) {
// show gain plot

View File

@ -48,6 +48,10 @@ void qTabAdvanced::SetupWidgetWindow() {
lblDiscardBits->setEnabled(true);
spinDiscardBits->setEnabled(true);
break;
case slsDetectorDefs::JUNGFRAU:
lblNumStoragecells->setEnabled(true);
spinNumStoragecells->setEnabled(true);
break;
default:
break;
}

View File

@ -40,13 +40,11 @@ void qTabDataOutput::SetupWidgetWindow() {
comboClkDivider->setEnabled(true);
chkParallel->setEnabled(true);
break;
case slsDetectorDefs::MOENCH:
chkTenGiga->setEnabled(true);
break;
case slsDetectorDefs::MYTHEN3:
chkParallel->setEnabled(true);
break;
case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
lblClkDivider->setEnabled(true);
comboClkDivider->setEnabled(true);
break;
@ -182,8 +180,10 @@ void qTabDataOutput::BrowseOutputDir() {
LOG(logDEBUG) << "Browsing output directory";
QString directory = QFileDialog::getExistingDirectory(
this, tr("Choose Output Directory "), dispOutputDir->text());
if (!directory.isEmpty())
if (!directory.isEmpty()) {
dispOutputDir->setText(directory);
ForceSetOutputDir();
}
}
void qTabDataOutput::SetOutputDir(bool force) {

View File

@ -111,6 +111,7 @@ void qTabDeveloper::SetupWidgetWindow() {
break;
case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
dacWidgets.push_back(
new qDacWidget(this, det, true,
"v vb comp: ", getSLSIndex(detType, tempid++)));
@ -139,72 +140,6 @@ void qTabDeveloper::SetupWidgetWindow() {
"Temperature ADC: ", getSLSIndex(detType, tempid++)));
break;
case slsDetectorDefs::MOENCH:
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vbp_colbuf: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vipre: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vin_cm: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vb_sda: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vcasc_sfp: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vout_cm: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vipre_cds: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(
new qDacWidget(this, det, true,
"ibias_sfp: ", getSLSIndex(detType, tempid++)));
break;
case slsDetectorDefs::MYTHEN3:
dacWidgets.push_back(new qDacWidget(
this, det, true, "vcassh: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vth2: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vrshaper: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vrshaper_n: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vipre_out: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vth3: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vth1: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vicin: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vcas: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vrpreamp: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vcal_p: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vipre: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vishaper: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vcal_n: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vtrim: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(new qDacWidget(
this, det, true, "vdcsh: ", getSLSIndex(detType, tempid++)));
dacWidgets.push_back(
new qDacWidget(this, det, true,
"vthreshold: ", getSLSIndex(detType, tempid++)));
adcWidgets.push_back(new qDacWidget(
this, det, false,
"Temperature FPGA: ", getSLSIndex(detType, tempid++)));
break;
case slsDetectorDefs::GOTTHARD2:
dacWidgets.push_back(
new qDacWidget(this, det, true,
@ -386,6 +321,7 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
break;
case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
switch (index) {
case 0:
return slsDetectorDefs::VB_COMP;
@ -411,30 +347,6 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
}
break;
case slsDetectorDefs::MOENCH:
switch (index) {
case 0:
return slsDetectorDefs::VBP_COLBUF;
case 1:
return slsDetectorDefs::VIPRE;
case 2:
return slsDetectorDefs::VIN_CM;
case 3:
return slsDetectorDefs::VB_SDA;
case 4:
return slsDetectorDefs::VCASC_SFP;
case 5:
return slsDetectorDefs::VOUT_CM;
case 6:
return slsDetectorDefs::VIPRE_CDS;
case 7:
return slsDetectorDefs::IBIAS_SFP;
default:
throw RuntimeError(std::string("Unknown dac/adc index") +
std::to_string(index));
}
break;
case slsDetectorDefs::MYTHEN3:
switch (index) {
case 0:

View File

@ -35,7 +35,6 @@ void qTabMeasurement::SetupWidgetWindow() {
// timer to update the progress bar
progressTimer = new QTimer(this);
sampleImplemented = false;
gateImplemented = false;
delayImplemented = true;
startingFnumImplemented = false;
@ -47,18 +46,11 @@ void qTabMeasurement::SetupWidgetWindow() {
// default is triggers and delay (not #bursts and burst period for gotthard2
// in auto mode)
ShowTriggerDelay();
// default is to show samples, mythen3, show gates
ShowGates();
// enabling according to det type
lblBurstMode->hide();
comboBurstMode->hide();
switch (det->getDetectorType().squash()) {
case slsDetectorDefs::MOENCH:
lblNumSamples->setEnabled(true);
spinNumSamples->setEnabled(true);
sampleImplemented = true;
break;
case slsDetectorDefs::EIGER:
delayImplemented = false;
lblNextFrameNumber->setEnabled(true);
@ -66,6 +58,7 @@ void qTabMeasurement::SetupWidgetWindow() {
startingFnumImplemented = true;
break;
case slsDetectorDefs::JUNGFRAU:
case slsDetectorDefs::MOENCH:
lblNextFrameNumber->setEnabled(true);
spinNextFrameNumber->setEnabled(true);
startingFnumImplemented = true;
@ -112,10 +105,6 @@ void qTabMeasurement::Initialization() {
connect(spinNumBursts, SIGNAL(valueChanged(int)), this,
SLOT(SetNumBursts(int)));
}
if (spinNumSamples->isEnabled()) {
connect(spinNumSamples, SIGNAL(valueChanged(int)), this,
SLOT(SetNumSamples(int)));
}
if (gateImplemented) {
connect(spinNumGates, SIGNAL(valueChanged(int)), this,
SLOT(SetNumGates(int)));
@ -198,16 +187,6 @@ void qTabMeasurement::ShowTriggerDelay() {
}
}
void qTabMeasurement::ShowGates() {
if (det->getDetectorType().squash() == slsDetectorDefs::MYTHEN3) {
stackedLblSamplesGates->setCurrentWidget(pageLblGates);
stackedSpinSamplesGates->setCurrentWidget(pageSpinGates);
} else {
stackedLblSamplesGates->setCurrentWidget(pageLblSamples);
stackedSpinSamplesGates->setCurrentWidget(pageSpinSamples);
}
}
void qTabMeasurement::SetupTimingMode() {
QStandardItemModel *model =
qobject_cast<QStandardItemModel *>(comboTimingMode->model());
@ -510,31 +489,6 @@ void qTabMeasurement::SetNumBursts(int val) {
&qTabMeasurement::GetNumBursts)
}
void qTabMeasurement::GetNumSamples() {
LOG(logDEBUG) << "Getting number of samples";
disconnect(spinNumSamples, SIGNAL(valueChanged(int)), this,
SLOT(SetNumSamples(int)));
try {
auto retval = det->getNumberOfAnalogSamples().tsquash(
"Inconsistent number of analog samples for all detectors.");
spinNumSamples->setValue(retval);
}
CATCH_DISPLAY("Could not get number of samples.",
"qTabMeasurement::GetNumSamples")
connect(spinNumSamples, SIGNAL(valueChanged(int)), this,
SLOT(SetNumSamples(int)));
}
void qTabMeasurement::SetNumSamples(int val) {
LOG(logINFO) << "Setting number of samples to " << val;
try {
det->setNumberOfAnalogSamples(val);
}
CATCH_HANDLE("Could not set number of samples.",
"qTabMeasurement::SetNumSamples", this,
&qTabMeasurement::GetNumSamples)
}
void qTabMeasurement::GetNumGates() {
LOG(logDEBUG) << "Getting number of gates";
disconnect(spinNumGates, SIGNAL(valueChanged(int)), this,
@ -1003,9 +957,6 @@ void qTabMeasurement::Refresh() {
if (spinBurstPeriod->isEnabled()) {
GetBurstPeriod();
}
if (sampleImplemented) {
GetNumSamples();
}
if (gateImplemented) {
GetNumGates();
}

View File

@ -62,6 +62,11 @@ void qTabPlot::SetupWidgetWindow() {
chkGainPlot->setChecked(true);
plot->EnableGainPlot(true);
break;
case slsDetectorDefs::MOENCH:
chkGainPlot->setEnabled(true);
chkGainPlot->setChecked(true);
plot->EnableGainPlot(true);
break;
default:
break;
}
@ -799,6 +804,9 @@ void qTabPlot::Refresh() {
chkGainPlot->setEnabled(true);
GetGapPixels();
break;
case slsDetectorDefs::MOENCH:
chkGainPlot->setEnabled(true);
break;
case slsDetectorDefs::GOTTHARD2:
chkGainPlot1D->setEnabled(true);
break;

View File

@ -92,7 +92,8 @@ void qTabSettings::SetupWidgetWindow() {
comboDynamicRange->setEnabled(true);
lblThreshold->setEnabled(true);
spinThreshold->setEnabled(true);
} else if (detType == slsDetectorDefs::JUNGFRAU) {
} else if (detType == slsDetectorDefs::JUNGFRAU ||
detType == slsDetectorDefs::MOENCH) {
lblSpinHV->show();
spinHV->show();
lblGainMode->setEnabled(true);
@ -100,9 +101,6 @@ void qTabSettings::SetupWidgetWindow() {
} else if (detType == slsDetectorDefs::GOTTHARD) {
comboHV->show();
lblComboHV->show();
} else if (detType == slsDetectorDefs::MOENCH) {
lblSpinHV->show();
spinHV->show();
} else if (detType == slsDetectorDefs::GOTTHARD2) {
lblSpinHV->show();
spinHV->show();

View File

@ -3,12 +3,12 @@
# empty branch = developer branch in updateAPIVersion.sh
branch=""
det_list=("ctbDetectorServer"
"gotthardDetectorServer"
"gotthard2DetectorServer"
"jungfrauDetectorServer"
"mythen3DetectorServer"
"moenchDetectorServer"
det_list=("ctbDetectorServer
gotthardDetectorServer
gotthard2DetectorServer
jungfrauDetectorServer
mythen3DetectorServer
moenchDetectorServer"
)
usage="\nUsage: compileAllServers.sh [server|all(opt)] [branch(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tNo 'branch' input means 'developer branch'"
@ -25,9 +25,11 @@ elif [ $# -eq 1 ] || [ $# -eq 2 ]; then
else
# only one server
# arg not in list
if [[ $det_list != *$1* ]]; then
echo $det_list | grep -w -q $1
#if [[ $det_list != *$1* ]]; then
if ! [[ $? ]] ; then
echo -e "Invalid argument 1: $1. $usage"
return -1
return 1
fi
declare -a det=("${1}")
#echo "Compiling only $1"
@ -37,14 +39,14 @@ elif [ $# -eq 1 ] || [ $# -eq 2 ]; then
# arg in list
if [[ $det_list == *$2* ]]; then
echo -e "Invalid argument 2: $2. $usage"
return -1
return 1
fi
branch+=$2
#echo "with branch $branch"
fi
else
echo -e "Too many arguments.$usage"
return -1
return 1
fi
declare -a deterror=("OK" "OK" "OK" "OK" "OK" "OK")

View File

@ -99,7 +99,7 @@ void basictests() {
#endif
if (mapCSP0() == FAIL) {
strcpy(initErrorMessage,
"Could not map to memory. Dangerous to continue.\n");
"Could not map to memory. Cannot proceed. Check Firmware.\n");
LOG(logERROR, (initErrorMessage));
initError = FAIL;
return;
@ -109,8 +109,10 @@ void basictests() {
if ((!debugflag) && (!updateFlag) &&
((checkType() == FAIL) || (testFpga() == FAIL) ||
(testBus() == FAIL))) {
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
"Dangerous to continue.\n");
sprintf(initErrorMessage,
"Could not pass basic tests of FPGA and bus. Cannot proceed. "
"Check Firmware. (Firmware version:0x%llx) \n",
getFirmwareVersion());
LOG(logERROR, ("%s\n\n", initErrorMessage));
initError = FAIL;
return;
@ -330,7 +332,7 @@ void getServerVersion(char *version) { strcpy(version, APICTB); }
uint64_t getFirmwareVersion() {
#ifdef VIRTUAL
return 0;
return REQRD_FRMWR_VRSN;
#endif
return ((bus_r(FPGA_VERSION_REG) & FPGA_VERSION_BRD_RVSN_MSK) >>
FPGA_VERSION_BRD_RVSN_OFST);
@ -446,7 +448,7 @@ void initStopServer() {
if (mapCSP0() == FAIL) {
initError = FAIL;
strcpy(initErrorMessage,
"Stop Server: Map Fail. Dangerous to continue. Goodbye!\n");
"Stop Server: Map Fail. Cannot proceed. Check Firmware.\n");
LOG(logERROR, (initErrorMessage));
initCheckDone = 1;
return;

View File

@ -1742,6 +1742,7 @@ int Feb_Control_WriteRegister_BitMask(uint32_t offset, uint32_t data,
int Feb_Control_ReadRegister_BitMask(uint32_t offset, uint32_t *retval,
uint32_t bitmask) {
uint32_t actualOffset = offset;
char side[2][10] = {"right", "left"};
unsigned int addr[2] = {Feb_Control_rightAddress, Feb_Control_leftAddress};
@ -2206,6 +2207,51 @@ int Feb_Control_GetRightFPGATemp() {
return (int)temperature;
}
int Feb_Control_GetFPGAHardwareVersion(int *retval) {
if (!Feb_Control_activated) {
return 0;
}
unsigned int value = 0;
if (!Feb_Control_ReadRegister_BitMask(FEB_REG_STATUS, &value,
FEB_REG_STATUS_FX30_MSK)) {
LOG(logERROR,
("Trouble reading FEB_REG_STATUS reg to feb hardware version\n"));
return 0;
}
*retval = (value >> FEB_REG_STATUS_FX30_OFST);
return 1;
}
int64_t Feb_Control_GetFrontLeftFirmwareVersion() {
if (!Feb_Control_activated) {
return 0;
}
unsigned int value = 0;
if (!Feb_Interface_ReadRegister(Feb_Control_leftAddress, FEB_REG_STATUS,
&value)) {
LOG(logERROR, ("Trouble reading FEB_REG_STATUS reg to get left feb "
"fw version\n"));
return 0;
}
return ((value & FEB_REG_STATUS_FW_VERSION_MSK) >>
FEB_REG_STATUS_FW_VERSION_OFST);
}
int64_t Feb_Control_GetFrontRightFirmwareVersion() {
if (!Feb_Control_activated) {
return 0;
}
unsigned int value = 0;
if (!Feb_Interface_ReadRegister(Feb_Control_rightAddress, FEB_REG_STATUS,
&value)) {
LOG(logERROR, ("Trouble reading FEB_REG_STATUS reg to get right feb "
"fw version\n"));
return 0;
}
return ((value & FEB_REG_STATUS_FW_VERSION_MSK) >>
FEB_REG_STATUS_FW_VERSION_OFST);
}
int64_t Feb_Control_GetMeasuredPeriod() {
if (!Feb_Control_activated) {
return 0;

View File

@ -119,5 +119,7 @@ int Feb_Control_PrintCorrectedValues();
// adcs
int Feb_Control_GetLeftFPGATemp();
int Feb_Control_GetRightFPGATemp();
int64_t Feb_Control_GetFrontLeftFirmwareVersion();
int64_t Feb_Control_GetFrontRightFirmwareVersion();
int64_t Feb_Control_GetMeasuredPeriod();
int64_t Feb_Control_GetSubMeasuredPeriod();

View File

@ -46,6 +46,10 @@
#define FEB_REG_STATUS_WAIT_FOR_TRGGR_MSK (0x00000001 << FEB_REG_STATUS_WAIT_FOR_TRGGR_OFST)
#define FEB_REG_STATUS_ACQ_DONE_OFST (6)
#define FEB_REG_STATUS_ACQ_DONE_MSK (0x00000001 << FEB_REG_STATUS_ACQ_DONE_OFST)
#define FEB_REG_STATUS_FX30_OFST (7)
#define FEB_REG_STATUS_FX30_MSK (0x00000001 << FEB_REG_STATUS_FX30_OFST)
#define FEB_REG_STATUS_FW_VERSION_OFST (8)
#define FEB_REG_STATUS_FW_VERSION_MSK (0x000000FF << FEB_REG_STATUS_FW_VERSION_OFST)
#define FEB_REG_STATUS_TEMP_OFST (16)
#define FEB_REG_STATUS_TEMP_MSK (0x0000FFFF << FEB_REG_STATUS_TEMP_OFST)

View File

@ -123,18 +123,18 @@ void basictests() {
int64_t sw_fw_apiversion = getFirmwareAPIVersion();
LOG(logINFOBLUE,
("**************************************************\n"
"Detector IP Addr:\t\t 0x%x\n"
"Detector MAC Addr:\t\t 0x%llx\n"
("\n********************************************************\n"
"Detector IP Addr : 0x%x\n"
"Detector MAC Addr : 0x%llx\n"
"Firmware Version:\t\t %lld\n"
"Software Version:\t\t %s\n"
"F/w-S/w API Version:\t\t %lld\n"
"Required Firmware Version:\t %d\n"
"Firmware (Beb) Version : %lld\n"
"F/w-S/w API Version : %lld\n"
"Required Firmware Version: %d\n"
"Software Version : %s\n"
"********************************************************\n",
(unsigned int)ipadd, (long long unsigned int)macadd,
(long long int)fwversion, swversion, (long long int)sw_fw_apiversion,
REQUIRED_FIRMWARE_VERSION));
(long long int)fwversion, (long long int)sw_fw_apiversion,
REQUIRED_FIRMWARE_VERSION, swversion));
// update default udpdstip and udpdstmac (1g is hardware ip and hardware
// mac)
@ -161,9 +161,9 @@ void basictests() {
// check for API compatibility - old server
if (sw_fw_apiversion > REQUIRED_FIRMWARE_VERSION) {
sprintf(initErrorMessage,
"This firmware-software api version (0x%llx) is incompatible "
"This firmware-software api version (0x%lld) is incompatible "
"with the software's minimum required firmware version "
"(0x%llx).\nPlease update detector software to be compatible "
"(0x%lld).\nPlease update detector software to be compatible "
"with this firmware.\n",
(long long int)sw_fw_apiversion,
(long long int)REQUIRED_FIRMWARE_VERSION);
@ -210,20 +210,70 @@ void getServerVersion(char *version) { strcpy(version, APIEIGER); }
u_int64_t getFirmwareVersion() {
#ifdef VIRTUAL
return 0;
return REQUIRED_FIRMWARE_VERSION;
#else
return Beb_GetFirmwareRevision();
#endif
}
uint64_t getFrontEndFirmwareVersion(enum fpgaPosition fpgaPosition) {
uint64_t retval = 0;
#ifdef VIRTUAL
return REQUIRED_FIRMWARE_VERSION;
#else
sharedMemory_lockLocalLink();
switch (fpgaPosition) {
case FRONT_LEFT:
retval = Feb_Control_GetFrontLeftFirmwareVersion(fpgaPosition);
break;
case FRONT_RIGHT:
retval = Feb_Control_GetFrontRightFirmwareVersion(fpgaPosition);
break;
default:
LOG(logERROR,
("unknown index for fpga position to read firmware version\n"));
retval = 0;
}
sharedMemory_unlockLocalLink();
#endif
return retval;
}
u_int64_t getFirmwareAPIVersion() {
#ifdef VIRTUAL
return 0;
return REQUIRED_FIRMWARE_VERSION;
#else
return (u_int64_t)Beb_GetFirmwareSoftwareAPIVersion();
return Beb_GetFirmwareSoftwareAPIVersion();
#endif
}
void getHardwareVersion(char *version) {
strcpy(version, "unknown");
int hwversion = getHardwareVersionNumber();
const int hwNumberList[] = HARDWARE_VERSION_NUMBERS;
const char *hwNamesList[] = HARDWARE_VERSION_NAMES;
for (int i = 0; i != NUM_HARDWARE_VERSIONS; ++i) {
LOG(logDEBUG, ("0x%x %d 0x%x %s\n", hwversion, i, hwNumberList[i],
hwNamesList[i]));
if (hwNumberList[i] == hwversion) {
strcpy(version, hwNamesList[i]);
return;
}
}
}
int getHardwareVersionNumber() {
int retval = 0;
#ifndef VIRTUAL
sharedMemory_lockLocalLink();
if (!Feb_Control_GetFPGAHardwareVersion(&retval)) {
retval = -1;
}
sharedMemory_unlockLocalLink();
#endif
return retval;
}
int getModuleId(int *ret, char *mess) {
return getModuleIdInFile(ret, mess, ID_FILE);
}
@ -355,6 +405,37 @@ void initControlServer() {
Beb_SetTopVariable(top);
Beb_Beb();
LOG(logDEBUG1, ("Control server: BEB Initialization done\n"));
// Getting the feb versions after initialization
char hversion[MAX_STR_LENGTH] = {0};
memset(hversion, 0, MAX_STR_LENGTH);
getHardwareVersion(hversion);
int64_t fwversion = getFirmwareVersion();
int64_t feblfwversion = getFrontEndFirmwareVersion(FRONT_LEFT);
int64_t febrfwversion = getFrontEndFirmwareVersion(FRONT_RIGHT);
LOG(logINFOBLUE,
("\n********************************************************\n"
"Feb Versions\n"
"Hardware Version : %s\n"
"Firmware (Febl) Version : %lld\n"
"Firmware (Febr) Version : %lld\n"
"********************************************************\n",
hversion, (long long int)feblfwversion,
(long long int)febrfwversion));
// ensure febl, febr and beb fw versions are the same
if (fwversion != feblfwversion || fwversion != febrfwversion) {
sprintf(
initErrorMessage,
"Inconsistent firmware versions in feb and beb. [Beb: %lld, "
"Febl: %lld Febr: %lld]\n",
(long long int)fwversion, (long long int)feblfwversion,
(long long int)febrfwversion);
LOG(logERROR, (initErrorMessage));
initError = FAIL;
return;
}
#endif
// also reads config file and deactivates
setupDetector();
@ -1457,6 +1538,12 @@ int setHighVoltage(int val) {
sharedMemory_unlockLocalLink();
return -3;
}
// need to read the file twice to get the proper value
if (!Feb_Control_GetHighVoltage(&eiger_highvoltage)) {
LOG(logERROR, ("Could not read high voltage\n"));
sharedMemory_unlockLocalLink();
return -3;
}
sharedMemory_unlockLocalLink();
// tolerance of 5

View File

@ -5,7 +5,12 @@
#define LINKED_SERVER_NAME "eigerDetectorServer"
#define REQUIRED_FIRMWARE_VERSION (30)
#define NUM_HARDWARE_VERSIONS (2)
#define HARDWARE_VERSION_NUMBERS {0x0, 0x1};
#define HARDWARE_VERSION_NAMES \
{ "FX70T", "FX30T" }
#define REQUIRED_FIRMWARE_VERSION (31)
// virtual ones renamed for consistency
// real ones keep previous name for compatibility (already in production)
#ifdef VIRTUAL

View File

@ -93,7 +93,7 @@ void basictests() {
#endif
if (mapCSP0() == FAIL) {
strcpy(initErrorMessage,
"Could not map to memory. Dangerous to continue.\n");
"Could not map to memory. Cannot proceed. Check Firmware.\n");
LOG(logERROR, (initErrorMessage));
initError = FAIL;
return;
@ -105,8 +105,8 @@ void basictests() {
(checkType() == FAIL) || (testFpga() == FAIL) ||
(testBus() == FAIL))) {
sprintf(initErrorMessage,
"Could not pass basic tests of FPGA and bus. Dangerous to "
"continue. (Firmware version:0x%llx) \n",
"Could not pass basic tests of FPGA and bus. Cannot proceed. "
"Check Firmware. (Firmware version:0x%llx) \n",
getFirmwareVersion());
LOG(logERROR, ("%s\n\n", initErrorMessage));
initError = FAIL;
@ -256,7 +256,7 @@ void getServerVersion(char *version) { strcpy(version, APIGOTTHARD2); }
u_int64_t getFirmwareVersion() {
#ifdef VIRTUAL
return 0;
return REQRD_FRMWRE_VRSN;
#endif
return ((bus_r(FPGA_VERSION_REG) & FPGA_COMPILATION_DATE_MSK) >>
FPGA_COMPILATION_DATE_OFST);
@ -396,7 +396,7 @@ void initStopServer() {
if (mapCSP0() == FAIL) {
initError = FAIL;
strcpy(initErrorMessage,
"Stop Server: Map Fail. Dangerous to continue. Goodbye!\n");
"Stop Server: Map Fail. Cannot proceed. Check Firmware.\n");
LOG(logERROR, (initErrorMessage));
initCheckDone = 1;
return;

View File

@ -87,7 +87,7 @@ void basictests() {
#endif
if (mapCSP0() == FAIL) {
strcpy(initErrorMessage,
"Could not map to memory. Dangerous to continue.\n");
"Could not map to memory. Cannot proceed. Check Firmware.\n");
LOG(logERROR, (initErrorMessage));
initError = FAIL;
}
@ -97,7 +97,7 @@ void basictests() {
((checkType() == FAIL) || (testFpga() == FAIL) ||
(testBus() == FAIL))) {
strcpy(initErrorMessage, "Could not pass basic tests of FPGA and bus. "
"Dangerous to continue.\n");
"Cannot proceed. Check Firmware.\n");
LOG(logERROR, ("%s\n\n", initErrorMessage));
initError = FAIL;
return;
@ -275,7 +275,7 @@ void getServerVersion(char *version) { strcpy(version, APIGOTTHARD); }
u_int64_t getFirmwareVersion() {
#ifdef VIRTUAL
return 0;
return 1;
#endif
return ((bus_r(FPGA_VERSION_REG) & FPGA_VERSION_MSK) >> FPGA_VERSION_OFST);
}
@ -381,7 +381,7 @@ void initStopServer() {
if (mapCSP0() == FAIL) {
initError = FAIL;
strcpy(initErrorMessage,
"Stop Server: Map Fail. Dangerous to continue. Goodbye!\n");
"Stop Server: Map Fail. Cannot proceed. Check Firmware.\n");
LOG(logERROR, (initErrorMessage));
initCheckDone = 1;
return;

Some files were not shown because too many files have changed in this diff Show More