mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-15 14:27:13 +02:00
Compare commits
340 Commits
gotthardDo
...
olddevelop
Author | SHA1 | Date | |
---|---|---|---|
18ab437ae5 | |||
3b56091e2f | |||
dcad6c80ce | |||
6abfdcb2c8 | |||
9e5ec6a57b | |||
9d3134c3de | |||
563d644d2f | |||
e379b98631 | |||
f98259adc9 | |||
88e0914405 | |||
9d8aa5fe91 | |||
dceea92f1a | |||
2815458652 | |||
d8140d8db9 | |||
4d0090dfcc | |||
e98d60c26e | |||
cd3135c01d | |||
40dedb8b07 | |||
2e83db7d45 | |||
817736fcd5 | |||
660ed4c177 | |||
0d96272db5 | |||
38a6393dde | |||
4aa720eecb | |||
d68c3b73a8 | |||
def79807f6 | |||
eb89d12f41 | |||
c477970cf0 | |||
03ae32dcf3 | |||
5a394c080f | |||
e631414526 | |||
d2bce7e372 | |||
f9b95b63eb | |||
c2db073d5e | |||
970d448e73 | |||
b236c14a66 | |||
80c0d4e10e | |||
46db575cc4 | |||
6f0c505c01 | |||
06d698166f | |||
5a139d70b5 | |||
33d1b11279 | |||
b163180d6f | |||
cab9dff225 | |||
7d8188fc11 | |||
64229ca32b | |||
ae8678cdc2 | |||
4aa0d26f26 | |||
c52025dd7c | |||
9f84bf7175 | |||
235002cdd4 | |||
c784f0f539 | |||
961489edb1 | |||
255931bbde | |||
781152a772 | |||
7b4910ee87 | |||
021212372b | |||
59cb9c84c2 | |||
e8612a481c | |||
d67b4765ea | |||
8773de93e9 | |||
ef20fa6f3c | |||
19e7ced332 | |||
f288390255 | |||
30e060b3b1 | |||
29ba9ae6f7 | |||
2b2b53f598 | |||
1ebb07198a | |||
ed0b22b500 | |||
548036a602 | |||
1b55fdad86 | |||
14c899e7cf | |||
b3d4e90f7f | |||
cedd275892 | |||
588037fd18 | |||
1700d9884a | |||
e0b8fb3609 | |||
b7f62fcd47 | |||
5b6ec303d7 | |||
cea6c30ded | |||
0781344117 | |||
63c130a380 | |||
7945d15beb | |||
4e446f1f39 | |||
83600fcb15 | |||
2a28333a96 | |||
830f92dedc | |||
87e8333dfd | |||
b3ccd5e1a1 | |||
f0ac49190a | |||
921ae01bbe | |||
fa175ac934 | |||
0018fa46f8 | |||
c934e92a41 | |||
da4253fe13 | |||
3cab1bc0fe | |||
d74a8368b8 | |||
39ebd81230 | |||
823c855ef4 | |||
7fadf4feb4 | |||
f86578cfc3 | |||
a0512a01d5 | |||
bdd37fa7c2 | |||
a96a019435 | |||
dd3f4aa81d | |||
1102153d2b | |||
ab7e63c20f | |||
f1333c7a90 | |||
e77cdb35dd | |||
52b1e98726 | |||
df75fef6f6 | |||
44fdc46c11 | |||
147194e8af | |||
05055eb283 | |||
0dc1e10bd3 | |||
e38e500e16 | |||
134f13fc52 | |||
41fb6c26a2 | |||
73fcef5f6d | |||
e9cc91698e | |||
6213b5e07a | |||
08aacf76ac | |||
711e0d771e | |||
2fc98c7a54 | |||
3b6ead7783 | |||
40c96b5562 | |||
6bb7195a2c | |||
53423a42ac | |||
c2b1eef75c | |||
f5a86bbfe1 | |||
9af0ec74b6 | |||
45de361b22 | |||
260f237990 | |||
37dd5fb902 | |||
ecd0c810ca | |||
7c29327b47 | |||
c366e94a96 | |||
ca8cb33569 | |||
7db6b7bca8 | |||
7e16f3ebeb | |||
233c145791 | |||
d7cc9fc023 | |||
ed1135566a | |||
3595c586d4 | |||
11de3dfde2 | |||
14d227f8db | |||
144bd7124b | |||
f6660c0dac | |||
73ac8bab38 | |||
d76568d6d9 | |||
72f47b2375 | |||
3114512c3f | |||
95254619c6 | |||
a0016cb005 | |||
0b140111b3 | |||
d7831f6c64 | |||
a97b725f43 | |||
69c71e48f6 | |||
54fc63dd55 | |||
5e9871720b | |||
55517e6d4c | |||
2853f97fe7 | |||
fc0f8ef9da | |||
99bf6446fe | |||
283dfa2b05 | |||
5316fed5d4 | |||
dda013a85b | |||
2eecf43fbb | |||
eba0fa277d | |||
e6e3561dcb | |||
b294b3e8b1 | |||
025e7b8f44 | |||
aa25d86310 | |||
a7551cca4e | |||
8e79f9094a | |||
2dece5c635 | |||
24db58e615 | |||
bab7d8e3fb | |||
2339fb2a0e | |||
378392c0f5 | |||
fcde40b854 | |||
ceed0eaa9b | |||
e3088d822f | |||
27ebd9c713 | |||
f33b3cdc79 | |||
b0ea458d3a | |||
7e2f2cd31b | |||
6cf7bf2e06 | |||
fc7ae98eee | |||
542dda8ece | |||
0f6cb4dc41 | |||
ecc970bc73 | |||
15aaa93130 | |||
34b659fa15 | |||
cf8b0de433 | |||
32c1a45e11 | |||
da1b6ad62d | |||
49d6dcb6e2 | |||
22ef1cee8b | |||
9d3fdaaadc | |||
06f84585af | |||
a970bacbe5 | |||
5be2979fff | |||
4765849613 | |||
05ed8dca4e | |||
4f600f3129 | |||
4b72d685f3 | |||
bbd7e7906a | |||
f735baf9d7 | |||
ad14381ab4 | |||
7702865409 | |||
2f8c1b453e | |||
883317dd28 | |||
8ed67119b9 | |||
f45e2b4ab9 | |||
abdf4b1ada | |||
228d624d8f | |||
e0c9805ee8 | |||
4eef81fbe9 | |||
301600e720 | |||
4d4e4a4ce7 | |||
ad3ac2cdee | |||
b10abd07ee | |||
e65b416215 | |||
24df69d57f | |||
183c306166 | |||
1dfdcfcb7e | |||
212218396a | |||
b78b8425fd | |||
12832a3a96 | |||
621b7cfb2a | |||
a67d9e60da | |||
d71008bd10 | |||
a154d0a088 | |||
c5262458d5 | |||
cb635d800a | |||
0ed82d4ef7 | |||
bdf9373e0d | |||
3f61206289 | |||
e19a27bf62 | |||
a1831c38ed | |||
c4b8c6385f | |||
f393751771 | |||
94ce042401 | |||
49b8024c43 | |||
8b39443197 | |||
dcce66ee9f | |||
563b1bb8b7 | |||
b4d9a6a09d | |||
51fd9ed423 | |||
23d73ae5ae | |||
8986b008dd | |||
30f1e6ad3f | |||
02cc284422 | |||
e6c0304af1 | |||
16fe4d305e | |||
68e9648854 | |||
0417a7e97d | |||
6653cc9cb1 | |||
a37bbc50fe | |||
5b01b4cbd8 | |||
d3a0319863 | |||
fdd19bc316 | |||
1152555663 | |||
9ae1289616 | |||
3baa677a2e | |||
516336963e | |||
99281e2690 | |||
501d2478a5 | |||
08b6eb78c5 | |||
d096a5efeb | |||
9f24bb0a98 | |||
173d8f740e | |||
16428f3828 | |||
1247f760f2 | |||
11475316fd | |||
a09c2e38a3 | |||
1c49fbb090 | |||
b5909044f6 | |||
62a88dadba | |||
e0bb7d74f4 | |||
d09a1a0a95 | |||
d38108e527 | |||
c9675d111a | |||
8f9c657fa0 | |||
c35203ebfb | |||
1069bf5979 | |||
cac913831c | |||
03e781a0ac | |||
a5a3d4bc78 | |||
bc70cc3a26 | |||
e024774323 | |||
bdcccb7732 | |||
5ff2e86060 | |||
70e193b0fd | |||
c3a9d3c342 | |||
d3c807975f | |||
1c5250ea7f | |||
7cb3b3f8de | |||
7cd35f24b8 | |||
28af3c2642 | |||
2bd8e6c166 | |||
ccdc7d22e9 | |||
3831896a78 | |||
9847729f3c | |||
0eff9e1401 | |||
4323a837ef | |||
649cb0aed9 | |||
8cf6e0cbd6 | |||
753290b228 | |||
d28f293485 | |||
da010a03d7 | |||
72b71f3fcd | |||
e4868671ae | |||
61897cbd41 | |||
9e8d3e598f | |||
252e924f92 | |||
fe2ba8621b | |||
b8bdbf4da6 | |||
5340b8ef24 | |||
807189a492 | |||
593f5b6c65 | |||
b029f1fa26 | |||
14546247e4 | |||
a74e8f68f7 | |||
a1936cb884 | |||
a36b715eab | |||
17c20748bc | |||
d5f8a1b4e7 | |||
70ce8c1653 | |||
5203a0d621 | |||
59ad15b54e | |||
afac5be3c3 | |||
688dd15fe9 | |||
98752e1cdb | |||
d59f419370 | |||
9ba3fb9279 | |||
50111bcea7 | |||
ab06c33107 | |||
10209b75df |
45
.travis.yml
Normal file
45
.travis.yml
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
sudo: false
|
||||||
|
|
||||||
|
language: cpp
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: linux
|
||||||
|
env: CONDA_PY=3.6
|
||||||
|
|
||||||
|
dist: trusty
|
||||||
|
|
||||||
|
install:
|
||||||
|
- sudo apt-get update
|
||||||
|
- ldd --version
|
||||||
|
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
|
||||||
|
- bash miniconda.sh -b -p $HOME/miniconda
|
||||||
|
- export PATH="$HOME/miniconda/bin:$PATH"
|
||||||
|
- rm -f miniconda.sh
|
||||||
|
- hash -r
|
||||||
|
- conda config --set always_yes yes --set changeps1 no
|
||||||
|
- conda config --add channels conda-forge
|
||||||
|
- conda config --add channels slsdetectorgroup
|
||||||
|
- conda update conda
|
||||||
|
- conda update --all
|
||||||
|
- conda install conda-build anaconda-client
|
||||||
|
|
||||||
|
# Useful for debugging any issues with conda
|
||||||
|
- conda info -a
|
||||||
|
|
||||||
|
|
||||||
|
# Replace dep1 dep2 ... with your dependencies
|
||||||
|
- conda create -q -n test-environment python=$CONDA_PY
|
||||||
|
- source activate test-environment
|
||||||
|
- conda-build .
|
||||||
|
|
||||||
|
script:
|
||||||
|
- echo "No test scripts to be run!"
|
||||||
|
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
provider: script
|
||||||
|
script: find $HOME/miniconda/conda-bld/${TRAVIS_OS_NAME}-64 -name "*.tar.bz2" -exec anaconda -t $CONDA_TOKEN upload --force {} \;
|
||||||
|
on:
|
||||||
|
branch: developer
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 2.8)
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
||||||
set (CALIBRATE OFF)
|
set (CALIBRATE OFF)
|
||||||
|
|
||||||
option (USE_HDF5 "HDF5 File format" OFF)
|
option (USE_HDF5 "HDF5 File format" OFF)
|
||||||
@ -7,13 +7,18 @@ option (USE_TEXTCLIENT "Text Client" OFF)
|
|||||||
option (USE_RECEIVER "Receiver" OFF)
|
option (USE_RECEIVER "Receiver" OFF)
|
||||||
option (USE_GUI "GUI" OFF)
|
option (USE_GUI "GUI" OFF)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-misleading-indentation")
|
|
||||||
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98 -Wno-misleading-indentation")
|
||||||
|
else ()
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98")
|
||||||
|
endif ()
|
||||||
|
|
||||||
find_package(Qt4)
|
find_package(Qt4)
|
||||||
find_package(Qwt 6)
|
find_package(Qwt 6)
|
||||||
find_package(CBF)
|
find_package(CBF)
|
||||||
find_package(Doxygen)
|
find_package(Doxygen)
|
||||||
find_package(PNG REQUIRED)
|
# find_package(PNG REQUIRED)
|
||||||
|
|
||||||
if (USE_HDF5)
|
if (USE_HDF5)
|
||||||
find_package(HDF5 1.10 COMPONENTS CXX)
|
find_package(HDF5 1.10 COMPONENTS CXX)
|
||||||
@ -31,8 +36,10 @@ endif (USE_TEXTCLIENT)
|
|||||||
|
|
||||||
if (USE_RECEIVER)
|
if (USE_RECEIVER)
|
||||||
add_subdirectory(slsReceiverSoftware)
|
add_subdirectory(slsReceiverSoftware)
|
||||||
|
add_subdirectory(manual/manual-api)
|
||||||
endif (USE_RECEIVER)
|
endif (USE_RECEIVER)
|
||||||
|
|
||||||
|
|
||||||
if (USE_GUI)
|
if (USE_GUI)
|
||||||
if (QT4_FOUND AND QWT_FOUND)
|
if (QT4_FOUND AND QWT_FOUND)
|
||||||
add_subdirectory(slsDetectorGui)
|
add_subdirectory(slsDetectorGui)
|
||||||
|
5
Makefile
5
Makefile
@ -19,11 +19,12 @@ RECEIVERDIR = $(LIBRARYRXRDIR)
|
|||||||
CALWIZDIR = $(WD)/calibrationWizards
|
CALWIZDIR = $(WD)/calibrationWizards
|
||||||
MANDIR = $(WD)/manual
|
MANDIR = $(WD)/manual
|
||||||
CALIBDIR = $(WD)/slsDetectorCalibration
|
CALIBDIR = $(WD)/slsDetectorCalibration
|
||||||
|
MANAPIDIR = $(MANDIR)/manual-api
|
||||||
|
|
||||||
TABSPACE := "\t"
|
TABSPACE := "\t"
|
||||||
|
|
||||||
|
|
||||||
INCLUDES=-I. -I$(LIBRARYDIR)/commonFiles -I$(LIBRARYDIR)/slsDetector -I$(LIBRARYDIR)/usersFunctions -I$(LIBRARYDIR)/multiSlsDetector -I$(LIBRARYDIR)/slsDetectorUtils -I$(LIBRARYDIR)/slsDetectorCommand -I$(LIBRARYDIR)/slsDetectorAnalysis -I$(LIBRARYDIR)/slsReceiverInterface -I$(LIBRARYRXRDIR)/include -I$(LIBRARYDIR)/threadFiles -I$(ASM)
|
INCLUDES=-I. -I$(LIBRARYDIR)/commonFiles -I$(LIBRARYDIR)/slsDetector -I$(LIBRARYDIR)/usersFunctions -I$(LIBRARYDIR)/multiSlsDetector -I$(LIBRARYDIR)/slsDetectorUtils -I$(LIBRARYDIR)/slsDetectorCommand -I$(LIBRARYDIR)/slsDetectorAnalysis -I$(LIBRARYDIR)/slsReceiverInterface -I$(LIBRARYRXRDIR)/include -I$(LIBRARYDIR)/threadFiles -I$(LIBRARYDIR)/sharedMemory -I$(ASM)
|
||||||
|
|
||||||
INCLUDESRXR += -I. -I$(LIBRARYRXRDIR)/include -I$(CALIBDIR) -I$(ASM)
|
INCLUDESRXR += -I. -I$(LIBRARYRXRDIR)/include -I$(CALIBDIR) -I$(ASM)
|
||||||
#LIBFLAGRXR +=
|
#LIBFLAGRXR +=
|
||||||
@ -79,6 +80,7 @@ slsReceiver_static: receiver
|
|||||||
receiver: #libreceiver
|
receiver: #libreceiver
|
||||||
# cd $(RECEIVERDIR) && $(MAKE) receiver FLAGS='$(FLAGS)' DESTDIR='$(BINDIR)' LIBS='$(LDFLAGRXR)' INCLUDES='$(INCLUDESRXR)' LIBDIR='$(LIBDIR)'
|
# cd $(RECEIVERDIR) && $(MAKE) receiver FLAGS='$(FLAGS)' DESTDIR='$(BINDIR)' LIBS='$(LDFLAGRXR)' INCLUDES='$(INCLUDESRXR)' LIBDIR='$(LIBDIR)'
|
||||||
cd $(RECEIVERDIR) && $(MAKE) FLAGS='$(FLAGS)' DESTDIR='$(BINDIR)' LIBS='$(LDFLAGRXR)' INCLUDES='$(INCLUDESRXR)' LIBDIR='$(LIBDIR)'
|
cd $(RECEIVERDIR) && $(MAKE) FLAGS='$(FLAGS)' DESTDIR='$(BINDIR)' LIBS='$(LDFLAGRXR)' INCLUDES='$(INCLUDESRXR)' LIBDIR='$(LIBDIR)'
|
||||||
|
cd $(MANAPIDIR) && $(MAKE) slsMultiReceiver
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "#######################################"
|
@echo "#######################################"
|
||||||
@echo "# Back in slsDetectorPackage Makefile #"
|
@echo "# Back in slsDetectorPackage Makefile #"
|
||||||
@ -151,6 +153,7 @@ clean:
|
|||||||
cd $(DOCDIR) && rm -rf *
|
cd $(DOCDIR) && rm -rf *
|
||||||
rm -rf slsDetectorPackageDocs;
|
rm -rf slsDetectorPackageDocs;
|
||||||
rm -rf $(DETAILDOC)
|
rm -rf $(DETAILDOC)
|
||||||
|
rm -rf $(MANAPIDIR)/slsMultiReceiver
|
||||||
|
|
||||||
|
|
||||||
#install_lib:
|
#install_lib:
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Detailed documentation can be found on the [official site.](https://www.psi.ch/detectors/users-support)
|
Detailed documentation can be found on the [official site.](https://www.psi.ch/detectors/users-support)
|
||||||
|
|
||||||
### Binaries
|
### Binaries
|
||||||
Documentation to obtain the binaries via the conda package is available [here.](https://github.com/slsdetectorgroup/sls_detector_software)
|
Documentation to obtain the binaries via the conda package is available for [lib](https://github.com/slsdetectorgroup/sls_detector_lib) and [gui](https://github.com/slsdetectorgroup/sls_detector_gui)
|
||||||
|
|
||||||
### Source code
|
### Source code
|
||||||
One can also obtain the source code from this repository and compile while realizing the setup dependencies as required.
|
One can also obtain the source code from this repository and compile while realizing the setup dependencies as required.
|
||||||
@ -19,7 +19,7 @@ Requirements: Qt 4.8 and Qwt 6.0
|
|||||||
```
|
```
|
||||||
If either of them does not exist, the GUI client will not be built.
|
If either of them does not exist, the GUI client will not be built.
|
||||||
|
|
||||||
* Calibration wizards<br>
|
* Advanced user Calibration wizards<br>
|
||||||
Requirements: ROOT
|
Requirements: ROOT
|
||||||
```
|
```
|
||||||
export ROOTSYS=/usr/local/root-5.34
|
export ROOTSYS=/usr/local/root-5.34
|
||||||
@ -43,6 +43,7 @@ Usage: [-c] [-b] [-h] [-d HDF5 directory] [-j]<br>
|
|||||||
* -r: Build/Rebuilds only receiver<br>
|
* -r: Build/Rebuilds only receiver<br>
|
||||||
* -g: Build/Rebuilds only gui<br>
|
* -g: Build/Rebuilds only gui<br>
|
||||||
* -j: Number of threads to compile through<br>
|
* -j: Number of threads to compile through<br>
|
||||||
|
* -e: Debug mode
|
||||||
|
|
||||||
Basic Option:
|
Basic Option:
|
||||||
./cmk.sh -b
|
./cmk.sh -b
|
||||||
@ -86,5 +87,5 @@ After compiling, the libraries and executables will be found at `bin` directory
|
|||||||
```
|
```
|
||||||
$ ls bin/
|
$ ls bin/
|
||||||
gui_client libSlsDetector.a libSlsDetector.so libSlsReceiver.a libSlsReceiver.so
|
gui_client libSlsDetector.a libSlsDetector.so libSlsReceiver.a libSlsReceiver.so
|
||||||
sls_detector_acquire sls_detector_get slsDetectorGui sls_detector_help sls_detector_put slsReceiver
|
sls_detector_acquire sls_detector_get slsDetectorGui sls_detector_help sls_detector_put slsReceiver slsMultiReceiver
|
||||||
```
|
```
|
||||||
|
495
RELEASE.txt
495
RELEASE.txt
@ -1,113 +1,508 @@
|
|||||||
SLS Detector Package 3.1.1 released on 2018-03-12
|
SLS Detector Package 4.0.0 released on 27.09.2018
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
INTRODUCTION
|
INTRODUCTION
|
||||||
|
|
||||||
This document describes the differences between 3.1.0 and 3.1.0 releases.
|
This document describes the differences between 4.0.0 and 3.1.4 releases.
|
||||||
|
|
||||||
The conda package of the binaries can be downloaded from
|
Download
|
||||||
|
--------
|
||||||
|
|
||||||
https://github.com/slsdetectorgroup/sls_detector_software.git
|
The Source Code (Default C++ API):
|
||||||
|
https://github.com/slsdetectorgroup/slsDetectorPackage
|
||||||
|
|
||||||
The Python interface to the software package (including the package) is at
|
The Conda Lib Package:
|
||||||
|
https://github.com/slsdetectorgroup/sls_detector_lib
|
||||||
|
|
||||||
https://github.com/slsdetectorgroup/sls_detector.git
|
The Conda GUI Package:
|
||||||
|
https://github.com/slsdetectorgroup/sls_detector_gui
|
||||||
|
|
||||||
Manual (both HTML and pdf versions) are provided in
|
The Python Interface (including the package):
|
||||||
manual/docs/
|
https://github.com/slsdetectorgroup/sls_detector
|
||||||
|
|
||||||
Documentation from Source Code can be found for the Command Line and for the API in
|
|
||||||
html:
|
Documentation
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Manual (HTML & PDF):
|
||||||
|
https://www.psi.ch/detectors/documentation
|
||||||
|
slsDetectorPackage/manual/docs/
|
||||||
|
|
||||||
|
Command Line Documentation:
|
||||||
manual/docs/html/slsDetectorClientDocs/index.html
|
manual/docs/html/slsDetectorClientDocs/index.html
|
||||||
manual/docs/html/slsDetectorUsersDocs/index.html
|
|
||||||
pdf:
|
|
||||||
manual/docs/pdf/slsDetectorClientDocs.pdf
|
manual/docs/pdf/slsDetectorClientDocs.pdf
|
||||||
|
|
||||||
|
C++ API Documentation:
|
||||||
|
manual/docs/html/slsDetectorUsersDocs/index.html
|
||||||
manual/docs/pdf/slsDetectorUsersDocs.pdf
|
manual/docs/pdf/slsDetectorUsersDocs.pdf
|
||||||
|
|
||||||
Example including binaries for detector and receiver user classes can be found in
|
C++ API Example:
|
||||||
|
manual/manual-api/mainClient.cpp
|
||||||
|
manual/manual-api/mainReceiver.cpp
|
||||||
|
|
||||||
manual/manual-api
|
Python API Documentation:
|
||||||
|
https://slsdetectorgroup.github.io/sls_detector/
|
||||||
User documentation can also be accessed directly at this location:
|
|
||||||
|
|
||||||
|
Further Documentation:
|
||||||
https://www.psi.ch/detectors/users-support
|
https://www.psi.ch/detectors/users-support
|
||||||
|
|
||||||
If you have any software related questions or comments, please send them to:
|
|
||||||
|
|
||||||
|
Support
|
||||||
|
-------
|
||||||
|
|
||||||
|
General Software related:
|
||||||
dhanya.thattil@psi.ch
|
dhanya.thattil@psi.ch
|
||||||
anna.bergamaschi@psi.ch
|
anna.bergamaschi@psi.ch
|
||||||
|
|
||||||
If you have any python related questions or comments, please send them to:
|
Python related:
|
||||||
|
|
||||||
erik.frojdh@psi.ch
|
erik.frojdh@psi.ch
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CONTENTS
|
CONTENTS
|
||||||
|
|
||||||
- Firmware Requirements
|
1. Firmware Requirements
|
||||||
- Changes in User Interface
|
2. Changes in User Interface
|
||||||
- New Features
|
3. New/Modified Commands
|
||||||
- Resolved Issues
|
4. Other New Features
|
||||||
- Known Issues
|
5. Resolved Issues
|
||||||
|
6. Known Issues
|
||||||
|
7. Next Major Release Plans
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Firmware Requirements
|
1. Firmware Requirements
|
||||||
=====================
|
========================
|
||||||
|
|
||||||
Please refer to the link below for more details on the firmware versions.
|
|
||||||
https://www.psi.ch/detectors/firmware.
|
|
||||||
|
|
||||||
Gotthard
|
Gotthard
|
||||||
========
|
========
|
||||||
Minimum compatible version : 11.01.2013
|
Minimum compatible version : 11.01.2013
|
||||||
Latest version : 08.02.2018 (50um and 25um Master)
|
Latest version : 08.02.2018 (50um and 25um Master)
|
||||||
09.02.2018 (25 um Slave)
|
09.02.2018 (25 um Slave)
|
||||||
|
|
||||||
-Can not be upgraded remotely.
|
|
||||||
|
|
||||||
|
|
||||||
Eiger
|
Eiger
|
||||||
=====
|
=====
|
||||||
Minimum compatible version : 16
|
Minimum compatible version : 22
|
||||||
Latest version : 20
|
Latest version : 22
|
||||||
|
|
||||||
-Can be upgraded remotely via bit files.
|
|
||||||
|
|
||||||
|
|
||||||
Jungfrau
|
Jungfrau
|
||||||
========
|
========
|
||||||
Minimum compatible version : 13.11.2017
|
Minimum compatible version : 15.06.2018
|
||||||
Latest version : 13.11.2017
|
Latest version : 15.06.2018
|
||||||
|
|
||||||
-Can be upgraded remotely via sls_detector_put programfpga <pof>.
|
|
||||||
|
Detector Upgrade
|
||||||
|
================
|
||||||
|
Gotthard Cannot be upgraded remotely. Requires programming via USB blaster
|
||||||
|
Eiger Can be upgraded remotely via bit files
|
||||||
|
Jungfrau Can be upgraded remotely using sls_detector_put programfpga <pof>
|
||||||
|
|
||||||
|
Instructions available at
|
||||||
|
https://www.psi.ch/detectors/installation-instructions
|
||||||
|
under Detector Upgrade -> [Detector Type] -> Firmware.
|
||||||
|
|
||||||
|
|
||||||
|
Please refer to the link below for more details on the firmware versions.
|
||||||
|
https://www.psi.ch/detectors/firmware.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Changes in User Interface
|
2. Changes in User Interface
|
||||||
=========================
|
============================
|
||||||
|
|
||||||
|
Client
|
||||||
|
------
|
||||||
|
|
||||||
|
1. Shared Memory:
|
||||||
|
|
||||||
|
POSIX shared memory has been implemented and they are typically created in
|
||||||
|
/dev/shm/ folder.
|
||||||
|
|
||||||
|
A multiSlsDetector object will create a shared memory segment with naming style:
|
||||||
|
slsDetectorPackage_x_[_z]
|
||||||
|
and an slsDetector object will create a shared memory segment with naming style:
|
||||||
|
slsDetectorPackage_x_sls_y[_z]
|
||||||
|
|
||||||
|
where
|
||||||
|
x is the multi detector id
|
||||||
|
y is the sls detector id
|
||||||
|
z is the environment variable SLSDETNAME, if set.
|
||||||
|
They can be deleted directly.
|
||||||
|
|
||||||
|
Environment variable SLSDETNAME included for user-friendliness
|
||||||
|
of using 2 different detectors from the same client pc. One needn't use
|
||||||
|
different multi detector id if the SLSDETNAME is different for both consoles.
|
||||||
|
|
||||||
|
Constructor will fail if shared memory size is different (different package
|
||||||
|
releases/detectors). Loading config file cleans shared memory.
|
||||||
|
|
||||||
|
|
||||||
|
2. Exceptions in constructors:
|
||||||
|
|
||||||
|
All constructors that have an error throws an exception. For this release,
|
||||||
|
this is caught within the package and interfaced as error codes or messages
|
||||||
|
to the users using command line or API.
|
||||||
|
|
||||||
|
As a result:
|
||||||
|
- slsDetectorsUsers constructor signature now includes a success flag.
|
||||||
|
- If one uses multiSlsDetector, slsDetector, ZmqSocket classes directly,
|
||||||
|
catch exceptions from constructors.
|
||||||
|
- In future releases, the exception will be thrown
|
||||||
|
outside the package for the users to handle it.
|
||||||
|
|
||||||
|
|
||||||
|
3. API Compatibility:
|
||||||
|
|
||||||
|
Client now checks API version of Detector Server - Client and Receiver - Client
|
||||||
|
when connecting for the first time to detector server or receiver server
|
||||||
|
and the online flags have not been set in shm.
|
||||||
|
|
||||||
|
Upon failure, error messages will ensue and further commands will not
|
||||||
|
be executed. Detector servers referred to are only for Eiger, Jungfrau and Gotthard.
|
||||||
|
|
||||||
|
Previously, the detector server would exit on mismatched Firmware-Detector
|
||||||
|
server mismatch. They now wait for client to ask for compatibility check,
|
||||||
|
which is done the first time client connects to the detector and the
|
||||||
|
online flag in shm has not been set.
|
||||||
|
|
||||||
|
|
||||||
|
4. Commands "type", "id" and "replace" are removed.
|
||||||
|
|
||||||
|
|
||||||
|
Receiver
|
||||||
|
--------
|
||||||
|
|
||||||
|
1. Reciever Header Structure in file writing and call back:
|
||||||
|
|
||||||
|
sls_receiver_header structure added to sls_receiver_defs.h for image headers
|
||||||
|
in file writing.
|
||||||
|
|
||||||
|
#define MAX_NUM_PACKETS 512
|
||||||
|
typedef std::bitset<MAX_NUM_PACKETS> sls_bitset;
|
||||||
|
typedef struct {
|
||||||
|
sls_detector_header detHeader; /**< is the detector header */
|
||||||
|
sls_bitset packetsMask; /**< is the packets caught bit mask */
|
||||||
|
} sls_receiver_header;
|
||||||
|
|
||||||
|
It includes the detector header structure + bitmask of 512 bits,
|
||||||
|
where each bit represents a packet caught. This is useful in saving time
|
||||||
|
in writing to file by not padding missing packets and still retaining useful data.
|
||||||
|
|
||||||
|
The binary and HDF5 writer version number changed from 1.0 to 2.0.
|
||||||
|
The detector header version remains as 1.0.
|
||||||
|
|
||||||
|
registerCallBackRawDataReady modified to give this structure pointer,
|
||||||
|
instead of individual structure member pointers.
|
||||||
|
|
||||||
|
|
||||||
|
2. ZmqSocket class:
|
||||||
|
|
||||||
|
If one uses ZmqSocket.h, then the json header has to be parsed outside
|
||||||
|
the class to allow the user to remove the restriction in extracting all data
|
||||||
|
from the json header.
|
||||||
|
|
||||||
|
|
||||||
|
3. Receiver Call back with modified size:
|
||||||
|
|
||||||
|
registerCallBackRawDataModifyReady call back that is similar to the receiver
|
||||||
|
registerCallBackRawDataReady has been added to allow the call back to
|
||||||
|
specify an updated size of image after call back. This is in view to process
|
||||||
|
an image in call back (including extract only a region of the image) and
|
||||||
|
provide this updated size in callback. This new resized/processed image
|
||||||
|
will be written to file or streamed out via zmq. This is useful in ROI
|
||||||
|
selection in the receiver.
|
||||||
|
|
||||||
|
This also means that the call back is now called before writing to file.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
3. New/Modified Commands
|
||||||
|
========================
|
||||||
|
|
||||||
|
Client
|
||||||
|
------
|
||||||
|
|
||||||
|
1. add (modified):
|
||||||
|
appends detector to end of multi detector list.
|
||||||
|
|
||||||
|
2. replace:
|
||||||
|
sets hostname/ip address for a single detector.
|
||||||
|
|
||||||
|
3. user:
|
||||||
|
get user details from shared memory.
|
||||||
|
|
||||||
|
4. checkdetversion:
|
||||||
|
checks client version compatibility with detector server.
|
||||||
|
|
||||||
|
5. checkrecversion:
|
||||||
|
checks client version compatibility with receiver server.
|
||||||
|
|
||||||
|
|
||||||
|
Receiver
|
||||||
|
--------
|
||||||
|
|
||||||
|
1. rx_zmqip:
|
||||||
|
sets/gets the zmq (TCP) ip of the receiver from where data is streamed
|
||||||
|
out from. (Eg. to the gui or intermediate process). By default, it is
|
||||||
|
the same as the zmqip.
|
||||||
|
|
||||||
|
2. zmqip:
|
||||||
|
sets/gets the zmq (TCP) ip, where client listens to, to reconstuct images.
|
||||||
|
(Eg. from receiver or intermediate process). By default, it is the same
|
||||||
|
as rx_zmqip.
|
||||||
|
|
||||||
|
3. rx_jsonaddheader:
|
||||||
|
sets/gets additional json header to be streamed out with the zmq from
|
||||||
|
receiver. Default is empty. Eg. p rx_jsonaddheader \"what\":\"nothing\"
|
||||||
|
|
||||||
|
4. r_discardpolicy:
|
||||||
|
sets/gets the frame discard policy in the receiver.
|
||||||
|
nodiscard - no discard (default),
|
||||||
|
discardempty - discard only empty frames,
|
||||||
|
discardpartial - discard any partial frame(fastest)
|
||||||
|
|
||||||
|
5. r_padding:
|
||||||
|
sets/gets the frame padding in the receiver.
|
||||||
|
0 does not pad partial frames(fastest),
|
||||||
|
1 (default) pads partial frames.
|
||||||
|
One can look at bitmask in the sls_receiver_header to process the unpadded
|
||||||
|
partial frames later.
|
||||||
|
|
||||||
|
6. activate (modified):
|
||||||
|
Extra option added to pad or unpad images in receivers when deactivated.
|
||||||
|
activate i [padding option], where i is activate/deactivate and padding
|
||||||
|
option is "padding" (default) or "nopadding".
|
||||||
|
|
||||||
|
7. rx_udpsocksize:
|
||||||
|
sets/gets the UDP socket buffer size. Already attempts to set by default
|
||||||
|
to 100mb, 2gb for Jungfrau. Does not remember custom values in client
|
||||||
|
shared memory, so must be initialized each time after setting receiver
|
||||||
|
hostname in config file.
|
||||||
|
|
||||||
|
8. rx_realudpsocksize:
|
||||||
|
gets the actual UDP socket buffer size. Usually double the set udp socket
|
||||||
|
buffer size due to kernel bookkeeping.
|
||||||
|
|
||||||
|
9. r_framesperfile:
|
||||||
|
sets/gets the frames per file in receiver. 0 means infinite or all frames
|
||||||
|
in a single file. Default of Eiger changed from 2k to 10k.
|
||||||
|
|
||||||
|
|
||||||
|
Eiger Specific
|
||||||
|
--------------
|
||||||
|
|
||||||
|
1. status trigger:
|
||||||
|
To trigger internally via software, one can use "status trigger".
|
||||||
|
|
||||||
|
2. subdeadtime:
|
||||||
|
sets/gets sub frame dead time in s in 32 bit mode. Subperiod is set in
|
||||||
|
the detector by subexptime + subdeadtime. This value is normally a
|
||||||
|
constant set by an expert catered to individual detector modules in the
|
||||||
|
config file. Receiver files writes master file metadata subperiod
|
||||||
|
instead of subdeadtime.
|
||||||
|
|
||||||
|
3. gappixels:
|
||||||
|
enables/disables gap pixels in system (detector & receiver). 1 sets,
|
||||||
|
0 unsets. In Receiver, 4 bit gap pixels mode is not implemented, but is
|
||||||
|
implemented in client data call back. Gap pixels are at module level
|
||||||
|
and not at multi module level.
|
||||||
|
|
||||||
|
4. measuredperiod:
|
||||||
|
gets the measured frame period (time between last frame and the previous
|
||||||
|
one) in s. Makes sense only for acquisitions of more than 1 frame.
|
||||||
|
|
||||||
|
5. measuredsubperiod:
|
||||||
|
gets the measured subframe period (time between last subframe and the
|
||||||
|
previous one) in s in 32 bit mode.
|
||||||
|
|
||||||
|
6. flags(modified):
|
||||||
|
extra flags "nooverflow" (default) and "overflow" for sub images in 32
|
||||||
|
bit mode. If set to overflow, it will set MSB of pixel data high if
|
||||||
|
there was any saturation in any of the sub images 32 bit mode.
|
||||||
|
|
||||||
|
|
||||||
|
Jungfrau Specific
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
1. storagecells:
|
||||||
|
sets/gets number of additional storage cells per acquisition. For very
|
||||||
|
advanced users only. Range: 0-15. Default: 0.
|
||||||
|
The #images = #frames * #cycles * (#storagecells +1).
|
||||||
|
|
||||||
|
2. storage_start:
|
||||||
|
sets/gets the storage cell that stores the first acquisition of the series.
|
||||||
|
For very advanced users only. Range: 0-15. Default: 15(0xf).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
4. Other New Features
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Client
|
||||||
|
------
|
||||||
|
|
||||||
|
1. (Jungfrau & Gotthard) Settingsdir and caldir is removed from config file.
|
||||||
|
Default dacs are stored in detector server. Hence, these folders
|
||||||
|
are also removed from slsDetectorPackage/settingsdir. Eiger and Mythen
|
||||||
|
continue to have them.
|
||||||
|
|
||||||
|
2. Depending on 1d position of detectors and detsizechan in config file,
|
||||||
|
row and column (previously xcoord and ycoord) are given to detector
|
||||||
|
servers (Eiger and Jungfrau) to encode into the udp header.
|
||||||
|
|
||||||
|
3. (Eiger) Setting threshold energy changes such as CAL dac is irrelevant
|
||||||
|
when interpolating between two energies and VRS dac is interpolated, not copied.
|
||||||
|
|
||||||
|
4. Users API updated with the following functions:
|
||||||
|
- setReceiverFramesDiscardPolicy
|
||||||
|
- setReceiverPartialFramesPadding
|
||||||
|
- setReceiverFramesPerFile
|
||||||
|
- sendSoftwareTrigger
|
||||||
|
- setSubFrameExposureDeadTime
|
||||||
|
- setSubFrameExposureTime
|
||||||
|
- enableGapPixels
|
||||||
|
- getMeasuredPeriod
|
||||||
|
- getMeasuredSubFramePeriod
|
||||||
|
- setOverflowMode
|
||||||
|
- setNumberOfStorageCells
|
||||||
|
- setStoragecellStart
|
||||||
|
- setThresholdEnergy (overloaded)
|
||||||
|
- resetFramesCaughtInReceiver
|
||||||
|
- setReceiverFifoDepth
|
||||||
|
- setFlowControl10G
|
||||||
|
- setTenGigabitEthernet
|
||||||
|
- getNMods
|
||||||
|
- setReceiverDataStreamingOutIP
|
||||||
|
- setClientDataStreamingInIP
|
||||||
|
|
||||||
|
SlsReceiver
|
||||||
|
-----------
|
||||||
|
|
||||||
|
1. slsMultiReceiver executable added that creates multiple receiver child processes.
|
||||||
|
./slsMultiReceiver [start_tcp_port] [num_receivers] [1 for call back, 0 for none]
|
||||||
|
|
||||||
|
2. Default row and column (previously xcoord and ycoord) are hardcoded
|
||||||
|
for missing packets. (Eiger and Jungfrau)
|
||||||
|
|
||||||
|
|
||||||
|
Gui
|
||||||
|
---
|
||||||
|
|
||||||
|
1. (Jungfrau) Gain plot included. Option under 2D options in Plot tab.
|
||||||
|
|
||||||
|
2. Option to maintain aspect ratio
|
||||||
|
|
||||||
|
3. Start and Stop separated to prevent multiple click syndrome.
|
||||||
|
|
||||||
|
|
||||||
|
Detector Server
|
||||||
|
---------------
|
||||||
|
|
||||||
|
1. (Jungfrau) To use programfpga command, one must start server with -update
|
||||||
|
mode and then restart server without -update mode.
|
||||||
|
|
||||||
|
2. (Jungfrau) ASIC Timer configured at server start up and changed a few
|
||||||
|
startup values for firmware v0.7 such as adc phase, ADC_PORT_INVERT_VAL
|
||||||
|
and ADC offset half speed value.
|
||||||
|
|
||||||
|
3. (Jungfrau) Minimum exposure time of 50 us was implemented.
|
||||||
|
|
||||||
|
4. (Eiger and Jungfrau) They can be configured to have x and y coord values
|
||||||
|
of the detector in their udp header.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
New Features
|
5. Resolved Issues
|
||||||
============
|
==================
|
||||||
|
|
||||||
|
Client
|
||||||
|
------
|
||||||
|
memory leak for multi threading
|
||||||
|
|
||||||
|
1. Compiler flag -std=c++98 enforced. Debug flag removed.
|
||||||
|
|
||||||
|
2. If trimen gives different list from different detectors, it returns a -1.
|
||||||
|
|
||||||
|
3. Version format for each submodule of the package changed to just date YYMMDD.
|
||||||
|
Users class fixed to give correct version, instead of -1.
|
||||||
|
|
||||||
|
4. Getting settings in users class gave -1. Fixed now.
|
||||||
|
|
||||||
|
5. (Jungfrau) Programming FPGA now creates the rawbin file from pof in tmp
|
||||||
|
rather than source file location (for permission issues).
|
||||||
|
|
||||||
|
6. (Gotthard) ROI segmentation fault fixed.
|
||||||
|
|
||||||
|
Receiver
|
||||||
|
--------
|
||||||
|
|
||||||
|
1. Silent feature of receiver fixed.
|
||||||
|
|
||||||
|
2. Socket descriptor misused earlier for success flag, instead exceptions
|
||||||
|
used that are handled inside the package.
|
||||||
|
|
||||||
|
3. Global optind variable initialized to instantiate multiple receivers
|
||||||
|
in same process. Also removed static members to enable this feature.
|
||||||
|
|
||||||
|
4. Socket buffer size attempts to set for each acquiistion and provide
|
||||||
|
warning if no capabilities. Warnings can be removed using instruction with
|
||||||
|
error provided. Default Jungfrau UDP socket buffer size if 2 GB, default is
|
||||||
|
100 MB.
|
||||||
|
|
||||||
|
5. Refactored code a bit for performance and robustness, blocking push
|
||||||
|
in buffer between listener and dataprocessor
|
||||||
|
|
||||||
|
|
||||||
|
Detector Server
|
||||||
|
---------------
|
||||||
|
|
||||||
Resolved Issues
|
1. (Jungfrau) Stop server also mapped during a reset. Reading power status
|
||||||
|
instead of user input register for power.
|
||||||
|
|
||||||
|
2. (Eiger) Bug fix for saving trimbits to file (Advanced users).
|
||||||
|
|
||||||
|
3. (Gotthard 25um) config.txt is not read again after detector startup,
|
||||||
|
no matter the number of times the detector server is restarted.
|
||||||
|
|
||||||
|
|
||||||
|
6. Known Issues
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
Receiver
|
||||||
|
--------
|
||||||
|
|
||||||
Known Issues
|
1. HDF5 compression and filters are not implemented yet.
|
||||||
============
|
|
||||||
|
|
||||||
|
Detector Server
|
||||||
|
---------------
|
||||||
|
|
||||||
|
1. (Eiger) Registers mapped differently between firmware v20 and v22.
|
||||||
|
So, please ensure correct on-board server before switching between
|
||||||
|
firmware versions. Else one cannot ping it anymore. Will need to flash firmware
|
||||||
|
again to recover.
|
||||||
|
|
||||||
|
2. (Gotthard) To switch back to all ADC from single ADC ROI, one must take
|
||||||
|
even number of images for the receiver to understand complete images.
|
||||||
|
This will be fixed in the next firmware upgrade.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
7. Next Major Release Plans
|
||||||
|
===========================
|
||||||
|
|
||||||
|
Client
|
||||||
|
------
|
||||||
|
|
||||||
|
1. Exceptions thrown to the user to be handled.
|
||||||
|
|
||||||
|
2. Compilation using c++11.
|
||||||
|
|
||||||
|
3. Support of Mythen II restricted to this major and its minor releases.
|
||||||
|
|
||||||
|
4. Restructuring and refactoring of client code.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
for i in seq `ipcs -m | cut -d ' ' -f1`; do ipcrm -M $i; done;
|
rm /dev/shm/slsDetectorPackage*;
|
||||||
|
15
cmk.sh
15
cmk.sh
@ -6,6 +6,7 @@ COMPILERTHREADS=0
|
|||||||
TEXTCLIENT=0
|
TEXTCLIENT=0
|
||||||
RECEIVER=0
|
RECEIVER=0
|
||||||
GUI=0
|
GUI=0
|
||||||
|
DEBUG=0
|
||||||
|
|
||||||
|
|
||||||
CLEAN=0
|
CLEAN=0
|
||||||
@ -24,6 +25,7 @@ Usage: $0 [-c] [-b] [-h] [-d <HDF5 directory>] [-j]
|
|||||||
-r: Build/Rebuilds only receiver
|
-r: Build/Rebuilds only receiver
|
||||||
-g: Build/Rebuilds only gui
|
-g: Build/Rebuilds only gui
|
||||||
-j: Number of threads to compile through
|
-j: Number of threads to compile through
|
||||||
|
-e: Debug mode
|
||||||
|
|
||||||
For only make:
|
For only make:
|
||||||
./cmk.sh
|
./cmk.sh
|
||||||
@ -53,7 +55,7 @@ For rebuilding only certain sections
|
|||||||
|
|
||||||
" ; exit 1; }
|
" ; exit 1; }
|
||||||
|
|
||||||
while getopts ":bchd:j:trg" opt ; do
|
while getopts ":bchd:j:trge" opt ; do
|
||||||
case $opt in
|
case $opt in
|
||||||
b)
|
b)
|
||||||
echo "Building of CMake files Required"
|
echo "Building of CMake files Required"
|
||||||
@ -91,6 +93,10 @@ while getopts ":bchd:j:trg" opt ; do
|
|||||||
GUI=1
|
GUI=1
|
||||||
REBUILD=1
|
REBUILD=1
|
||||||
;;
|
;;
|
||||||
|
e)
|
||||||
|
echo "Compiling Options: Debug"
|
||||||
|
DEBUG=1
|
||||||
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo "Invalid option: -$OPTARG"
|
echo "Invalid option: -$OPTARG"
|
||||||
usage
|
usage
|
||||||
@ -145,7 +151,12 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
|
#Debug
|
||||||
|
if [ $DEBUG -eq 1 ]; then
|
||||||
|
CMAKE_POST+=" -DCMAKE_BUILD_TYPE=Debug "
|
||||||
|
echo "Debug Option enabled"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#hdf5 rebuild
|
#hdf5 rebuild
|
||||||
if [ $HDF5 -eq 1 ]; then
|
if [ $HDF5 -eq 1 ]; then
|
||||||
|
61
examples/bchip2modules.config
Normal file
61
examples/bchip2modules.config
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
detsizechan 2560 1
|
||||||
|
|
||||||
|
hostname bchip074+bchip075+
|
||||||
|
|
||||||
|
#replace my_installation_path
|
||||||
|
settingsdir /my_installation_path/slsDetectorPackage/settingsdir/gotthard
|
||||||
|
caldir /my_installation_path/slsDetectorPackage/settingsdir/gotthard
|
||||||
|
|
||||||
|
0:extsig:0 trigger_in_rising_edge
|
||||||
|
0:rx_tcpport 1954
|
||||||
|
0:rx_udpport 50001
|
||||||
|
0:vhighvoltage 0
|
||||||
|
|
||||||
|
1:extsig:0 trigger_in_rising_edge
|
||||||
|
1:rx_tcpport 1955
|
||||||
|
1:rx_udpport 50002
|
||||||
|
#1:detectorip 10.1.1.52
|
||||||
|
1:vhighvoltage 0
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
#########
|
||||||
|
######### Uncomment this part to use the gotthard25umZmq process
|
||||||
|
#########
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# #replace my_receiver_hostname with the hostname of IP of the machine where the receiver runs
|
||||||
|
#0:rx_zmqip my_receiver_hostname
|
||||||
|
#0:rx_zmqport 30003
|
||||||
|
# #replace my_client_hostname with the hostname of IP of the machine where the client/GUI or softIOC runs
|
||||||
|
#0:zmqip my_client_hostname
|
||||||
|
#0:zmqport 40003
|
||||||
|
|
||||||
|
# #replace my_receiver_hostname with the hostname of IP of the machine where the receiver runs
|
||||||
|
#1:rx_zmqip my_receiver_hostname
|
||||||
|
#1:rx_zmqport 30004
|
||||||
|
# #replace my_client_hostname with the hostname of IP of the machine where the client/GUI or softIOC runs
|
||||||
|
#1:zmqip my_client_hostname
|
||||||
|
#1:zmqport 40004
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
#########
|
||||||
|
######### until here
|
||||||
|
#########
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
r_readfreq 1
|
||||||
|
rx_datastream 1
|
||||||
|
|
||||||
|
#replace my_receiver_hostname with the hostname of 1Gb IP of the machine where the receiver runs
|
||||||
|
rx_hostname my_receiver_hostname
|
||||||
|
rx_datastream 1
|
||||||
|
outdir /tmp/
|
||||||
|
angconv none
|
||||||
|
threaded 1
|
||||||
|
|
||||||
|
settings veryhighgain
|
||||||
|
exptime 0.000005
|
||||||
|
period 0.0001
|
||||||
|
|
||||||
|
vhighvoltage 90
|
61
examples/bchip2modules_pc8829.config
Normal file
61
examples/bchip2modules_pc8829.config
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
detsizechan 2560 1
|
||||||
|
|
||||||
|
hostname bchip074+bchip075+
|
||||||
|
|
||||||
|
#replace my_installation_path
|
||||||
|
settingsdir /my_installation_path/slsDetectorPackage/settingsdir/gotthard
|
||||||
|
caldir /my_installation_path/slsDetectorPackage/settingsdir/gotthard
|
||||||
|
|
||||||
|
0:extsig:0 trigger_in_rising_edge
|
||||||
|
0:rx_tcpport 1954
|
||||||
|
0:rx_udpport 50001
|
||||||
|
0:vhighvoltage 0
|
||||||
|
|
||||||
|
1:extsig:0 trigger_in_rising_edge
|
||||||
|
1:rx_tcpport 1955
|
||||||
|
1:rx_udpport 50002
|
||||||
|
#1:detectorip 10.1.1.52
|
||||||
|
1:vhighvoltage 0
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
#########
|
||||||
|
######### Uncomment this part to use the gotthard25umZmq process
|
||||||
|
#########
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# #replace my_receiver_hostname with the hostname of IP of the machine where the receiver runs
|
||||||
|
#0:rx_zmqip my_receiver_hostname
|
||||||
|
#0:rx_zmqport 30003
|
||||||
|
# #replace my_client_hostname with the hostname of IP of the machine where the client/GUI or softIOC runs
|
||||||
|
#0:zmqip my_client_hostname
|
||||||
|
#0:zmqport 40003
|
||||||
|
|
||||||
|
# #replace my_receiver_hostname with the hostname of IP of the machine where the receiver runs
|
||||||
|
#1:rx_zmqip my_receiver_hostname
|
||||||
|
#1:rx_zmqport 30004
|
||||||
|
# #replace my_client_hostname with the hostname of IP of the machine where the client/GUI or softIOC runs
|
||||||
|
#1:zmqip my_client_hostname
|
||||||
|
#1:zmqport 40004
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
#########
|
||||||
|
######### until here
|
||||||
|
#########
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
r_readfreq 1
|
||||||
|
rx_datastream 1
|
||||||
|
|
||||||
|
#replace my_receiver_hostname with the hostname of 1Gb IP of the machine where the receiver runs
|
||||||
|
rx_hostname my_receiver_hostname
|
||||||
|
rx_datastream 1
|
||||||
|
outdir /tmp/
|
||||||
|
angconv none
|
||||||
|
threaded 1
|
||||||
|
|
||||||
|
settings veryhighgain
|
||||||
|
exptime 0.000005
|
||||||
|
period 0.0001
|
||||||
|
|
||||||
|
vhighvoltage 90
|
@ -3,12 +3,8 @@ hostname bchip007
|
|||||||
#0:port 1952
|
#0:port 1952
|
||||||
#0:stopport 1953
|
#0:stopport 1953
|
||||||
#0:rx_tcpport 1956 must also have this in receiver config file
|
#0:rx_tcpport 1956 must also have this in receiver config file
|
||||||
0:settingsdir /home/l_maliakal_d/mySoft/newMythenSoftware/settingsdir/gotthard
|
|
||||||
0:angdir 1.000000
|
0:angdir 1.000000
|
||||||
0:moveflag 0.000000
|
0:moveflag 0.000000
|
||||||
0:lock 0
|
|
||||||
0:caldir /home/l_maliakal_d/mySoft/newMythenSoftware/settingsdir/gotthard
|
|
||||||
0:ffdir /home/l_maliakal_d
|
|
||||||
0:extsig:0 off
|
0:extsig:0 off
|
||||||
#0:detectorip 129.129.202.9
|
#0:detectorip 129.129.202.9
|
||||||
0:detectormac 00:aa:bb:cc:dd:ee
|
0:detectormac 00:aa:bb:cc:dd:ee
|
||||||
@ -20,7 +16,6 @@ hostname bchip007
|
|||||||
master -1
|
master -1
|
||||||
sync none
|
sync none
|
||||||
outdir /bigRAID/datadir_gotthard/rec_test_data
|
outdir /bigRAID/datadir_gotthard/rec_test_data
|
||||||
ffdir /home/l_maliakal_d
|
|
||||||
headerbefore none
|
headerbefore none
|
||||||
headerafter none
|
headerafter none
|
||||||
headerbeforepar none
|
headerbeforepar none
|
||||||
@ -29,4 +24,4 @@ badchannels none
|
|||||||
angconv none
|
angconv none
|
||||||
globaloff 0.000000
|
globaloff 0.000000
|
||||||
binsize 0.001000
|
binsize 0.001000
|
||||||
threaded 1
|
|
||||||
|
14
examples/howto_gotthatd_twomodules.txt
Normal file
14
examples/howto_gotthatd_twomodules.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
Turn on the two receivers:
|
||||||
|
slsReceiver --rx_tcpport 1954 &
|
||||||
|
slsReceiver --rx_tcpport 1955 &
|
||||||
|
|
||||||
|
Switch on the photon conversion on the receiver machine (replace my_receiver_hostname):
|
||||||
|
gotthard25umZmq my_receiver_hostname 30003 my_receiver_hostname 40003 &
|
||||||
|
|
||||||
|
Run the configuration file:
|
||||||
|
sls_detector_put config bchip2modules.config
|
||||||
|
|
||||||
|
|
||||||
|
Start your measurements using the command line, the slsDetectorGui or the EPICS driver
|
||||||
|
|
||||||
|
|
@ -1,18 +1,15 @@
|
|||||||
hostname bchip038+
|
hostname bchip038+
|
||||||
|
|
||||||
settingsdir /home/mySoft/slsDetectorsPackage/settingsdir/jungfrau
|
|
||||||
caldir /home/mySoft/slsDetectorsPackage/settingsdir/jungfrau
|
|
||||||
lock 0
|
|
||||||
|
|
||||||
0:rx_udpport 50004
|
0:rx_udpport 50004
|
||||||
0:rx_udpip 10.1.1.100
|
0:rx_udpip 10.1.1.100
|
||||||
0:detectorip 10.1.1.10
|
0:detectorip 10.1.1.10
|
||||||
|
|
||||||
rx_hostname pcmoench01
|
rx_hostname pcmoench01
|
||||||
|
|
||||||
powerchip 1
|
powerchip 1
|
||||||
timing auto
|
|
||||||
|
#extsig:0 trigger_in_rising_edge
|
||||||
|
#timing trigger
|
||||||
|
|
||||||
outdir /external_pool/jungfrau_data/softwaretest
|
outdir /external_pool/jungfrau_data/softwaretest
|
||||||
threaded 1
|
|
||||||
|
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
detsizechan 1024 1024
|
detsizechan 1024 1024
|
||||||
hostname bchip048+bchip052+
|
hostname bchip048+bchip052+
|
||||||
|
|
||||||
settingsdir /home/mySoft/slsDetectorsPackage/settingsdir/jungfrau
|
|
||||||
caldir /home/mySoft/slsDetectorsPackage/settingsdir/jungfrau
|
|
||||||
lock 0
|
|
||||||
|
|
||||||
|
|
||||||
0:rx_udpport 50004
|
0:rx_udpport 50004
|
||||||
0:rx_udpip 10.1.1.100
|
0:rx_udpip 10.1.1.100
|
||||||
0:rx_udpmac F4:52:14:2F:32:00
|
0:rx_udpmac F4:52:14:2F:32:00
|
||||||
@ -22,9 +17,9 @@ lock 0
|
|||||||
rx_hostname pcmoench01
|
rx_hostname pcmoench01
|
||||||
|
|
||||||
powerchip 1
|
powerchip 1
|
||||||
extsig:0 trigger_in_rising_edge
|
#extsig:0 trigger_in_rising_edge
|
||||||
timing auto
|
#timing trigger
|
||||||
|
|
||||||
outdir /external_pool/jungfrau_data/softwaretest
|
outdir /external_pool/jungfrau_data/softwaretest
|
||||||
threaded 1
|
|
||||||
|
|
||||||
|
489
examples/moench03_T1_lab.config
Normal file
489
examples/moench03_T1_lab.config
Normal file
@ -0,0 +1,489 @@
|
|||||||
|
hostname bchip085+
|
||||||
|
|
||||||
|
patword 0000 0000000000000000
|
||||||
|
patword 0001 0000000000000000
|
||||||
|
patword 0002 0008000900080000
|
||||||
|
patword 0003 0008000900080000
|
||||||
|
patword 0004 0008000900080000
|
||||||
|
patword 0005 0008000900080000
|
||||||
|
patword 0006 0008000900080000
|
||||||
|
patword 0007 0008000900080000
|
||||||
|
patword 0008 0008000900080000
|
||||||
|
patword 0009 0008000900080000
|
||||||
|
patword 000a 0008000900080000
|
||||||
|
patword 000b 0008000900080000
|
||||||
|
patword 000c 0008000900080000
|
||||||
|
patword 000d 0008000900080000
|
||||||
|
patword 000e 0008000900080000
|
||||||
|
patword 000f 0008000900080000
|
||||||
|
patword 0010 0008000900080000
|
||||||
|
patword 0011 0008000900080000
|
||||||
|
patword 0012 0008000900080000
|
||||||
|
patword 0013 0008000900080000
|
||||||
|
patword 0014 0008000900080000
|
||||||
|
patword 0015 0008000900080000
|
||||||
|
patword 0016 0008400900080020
|
||||||
|
patword 0017 0008400900080020
|
||||||
|
patword 0018 0008599f0418503a
|
||||||
|
patword 0019 0008599f0418503a
|
||||||
|
patword 001a 0108599f0418503a
|
||||||
|
patword 001b 0108599f0418503a
|
||||||
|
patword 001c 0108599f0418503a
|
||||||
|
patword 001d 0108599f0418503a
|
||||||
|
patword 001e 0108599f0418503a
|
||||||
|
patword 001f 0108599f0418503a
|
||||||
|
patword 0020 0108599f0418503a
|
||||||
|
patword 0021 0108599f0418503a
|
||||||
|
patword 0022 0108599f0418503a
|
||||||
|
patword 0023 0108599f0418503a
|
||||||
|
patword 0024 0108599f0418503a
|
||||||
|
patword 0025 0108599f0418503a
|
||||||
|
patword 0026 0108599f0418503a
|
||||||
|
patword 0027 0108599f0418503a
|
||||||
|
patword 0028 0108599f0418503a
|
||||||
|
patword 0029 0108599f0418503a
|
||||||
|
patword 002a 0108599f0418503a
|
||||||
|
patword 002b 0108599f0418503a
|
||||||
|
patword 002c 0108599f0418503a
|
||||||
|
patword 002d 0108599f0418503a
|
||||||
|
patword 002e 0108599f0418503a
|
||||||
|
patword 002f 0108599f0418503a
|
||||||
|
patword 0030 0108599f0418503a
|
||||||
|
patword 0031 0108599f0418503a
|
||||||
|
patword 0032 0108599f0418503a
|
||||||
|
patword 0033 0108599f0418503a
|
||||||
|
patword 0034 0108599f0418503a
|
||||||
|
patword 0035 0108599f0418503a
|
||||||
|
patword 0036 0108599f0418503a
|
||||||
|
patword 0037 0108599f0418503a
|
||||||
|
patword 0038 0108599f0418503a
|
||||||
|
patword 0039 0108599f0418503a
|
||||||
|
patword 003a 0108599f0418503a
|
||||||
|
patword 003b 0108599f0418503a
|
||||||
|
patword 003c 0108599f0418503a
|
||||||
|
patword 003d 0108599f0418503a
|
||||||
|
patword 003e 0108599f0418503a
|
||||||
|
patword 003f 0108599f0418503a
|
||||||
|
patword 0040 0108599f0418503a
|
||||||
|
patword 0041 0108599f0418503a
|
||||||
|
patword 0042 0108599f0418503a
|
||||||
|
patword 0043 0108599f0418503a
|
||||||
|
patword 0044 0108599f0418503a
|
||||||
|
patword 0045 0108599f0418503a
|
||||||
|
patword 0046 0108599f0418503a
|
||||||
|
patword 0047 0108599f0418503a
|
||||||
|
patword 0048 0108599f0418503a
|
||||||
|
patword 0049 0108599f0418503a
|
||||||
|
patword 004a 0108599f0418503a
|
||||||
|
patword 004b 0108599f0418503a
|
||||||
|
patword 004c 0108599f0418503a
|
||||||
|
patword 004d 0108599f0418503a
|
||||||
|
patword 004e 0108599f0418503a
|
||||||
|
patword 004f 0108599f0418503a
|
||||||
|
patword 0050 0108599f0418503a
|
||||||
|
patword 0051 0108599f0418503a
|
||||||
|
patword 0052 0108599f0418503a
|
||||||
|
patword 0053 0108599f0418503a
|
||||||
|
patword 0054 0108599f0418503a
|
||||||
|
patword 0055 0108599f0418503a
|
||||||
|
patword 0056 0108599f0418503a
|
||||||
|
patword 0057 0108599f0418503a
|
||||||
|
patword 0058 0108599f0418503a
|
||||||
|
patword 0059 0108599f0418503a
|
||||||
|
patword 005a 0108599f0418503a
|
||||||
|
patword 005b 0108599f0418503a
|
||||||
|
patword 005c 0108599f0418503a
|
||||||
|
patword 005d 0108599f0418503a
|
||||||
|
patword 005e 0108599f0418503a
|
||||||
|
patword 005f 0108599f0418503a
|
||||||
|
patword 0060 0108599f0418503a
|
||||||
|
patword 0061 0108599f0418503a
|
||||||
|
patword 0062 0108599f0418503a
|
||||||
|
patword 0063 0108599f0418503a
|
||||||
|
patword 0064 0108599f0418503a
|
||||||
|
patword 0065 0108599f0418503a
|
||||||
|
patword 0066 0108599f0418503a
|
||||||
|
patword 0067 0108599f0418503a
|
||||||
|
patword 0068 0108599f0418503a
|
||||||
|
patword 0069 0108599f0418503a
|
||||||
|
patword 006a 0108599f0418503a
|
||||||
|
patword 006b 0108599f0418503a
|
||||||
|
patword 006c 0108599f0418503a
|
||||||
|
patword 006d 0108599f0418503a
|
||||||
|
patword 006e 0108599f0418503a
|
||||||
|
patword 006f 0108599f0418503a
|
||||||
|
patword 0070 0108599f0418503a
|
||||||
|
patword 0071 0108599f0418503a
|
||||||
|
patword 0072 0108599f0418503a
|
||||||
|
patword 0073 0108599f0418503a
|
||||||
|
patword 0074 0108599f0418503a
|
||||||
|
patword 0075 0108599f0418503a
|
||||||
|
patword 0076 0108599f0418503a
|
||||||
|
patword 0077 0108599f0418503a
|
||||||
|
patword 0078 0108599f0418503a
|
||||||
|
patword 0079 0108599f0418503a
|
||||||
|
patword 007a 0108599f0418503a
|
||||||
|
patword 007b 0108599f0418503a
|
||||||
|
patword 007c 0108599f0418503a
|
||||||
|
patword 007d 0108599f0418503a
|
||||||
|
patword 007e 010859960418503a
|
||||||
|
patword 007f 010859960418503a
|
||||||
|
patword 0080 010859960418503a
|
||||||
|
patword 0081 010859960418503a
|
||||||
|
patword 0082 010859960418503a
|
||||||
|
patword 0083 010859960418503a
|
||||||
|
patword 0084 010859960418503a
|
||||||
|
patword 0085 010859960418503a
|
||||||
|
patword 0086 010859960418503a
|
||||||
|
patword 0087 010859960418503a
|
||||||
|
patword 0088 010859960418503a
|
||||||
|
patword 0089 010859960418503a
|
||||||
|
patword 008a 010859960418503a
|
||||||
|
patword 008b 010859960418503a
|
||||||
|
patword 008c 010859960418503a
|
||||||
|
patword 008d 010859960418503a
|
||||||
|
patword 008e 010859960418503a
|
||||||
|
patword 008f 010859960418503a
|
||||||
|
patword 0090 010859960418503a
|
||||||
|
patword 0091 010859960418503a
|
||||||
|
patword 0092 010819960418501a
|
||||||
|
patword 0093 010819960418501a
|
||||||
|
patword 0094 010819960418501a
|
||||||
|
patword 0095 010819960418501a
|
||||||
|
patword 0096 030819960418501a
|
||||||
|
patword 0097 030819960418501a
|
||||||
|
patword 0098 030819960418501a
|
||||||
|
patword 0099 030819960418501a
|
||||||
|
patword 009a 030819960418501a
|
||||||
|
patword 009b 030819960418501a
|
||||||
|
patword 009c 030819960418501a
|
||||||
|
patword 009d 030819960418501a
|
||||||
|
patword 009e 030819960418501a
|
||||||
|
patword 009f 030819960418501a
|
||||||
|
patword 00a0 030819960418501a
|
||||||
|
patword 00a1 030819960418501a
|
||||||
|
patword 00a2 030819960418501a
|
||||||
|
patword 00a3 030819960418501a
|
||||||
|
patword 00a4 030819960418501a
|
||||||
|
patword 00a5 030819960418501a
|
||||||
|
patword 00a6 030819960418501a
|
||||||
|
patword 00a7 030819960418501a
|
||||||
|
patword 00a8 030819960418501a
|
||||||
|
patword 00a9 030819960418501a
|
||||||
|
patword 00aa 030819960418501a
|
||||||
|
patword 00ab 030819960418501a
|
||||||
|
patword 00ac 030819960008501a
|
||||||
|
patword 00ad 030819960008501a
|
||||||
|
patword 00ae 030819960008501a
|
||||||
|
patword 00af 030819960008501a
|
||||||
|
patword 00b0 030819960008501a
|
||||||
|
patword 00b1 030819960008501a
|
||||||
|
patword 00b2 030819960008501a
|
||||||
|
patword 00b3 030819960008501a
|
||||||
|
patword 00b4 030819960008501a
|
||||||
|
patword 00b5 030819960008501a
|
||||||
|
patword 00b6 030819960008501a
|
||||||
|
patword 00b7 030819960008501a
|
||||||
|
patword 00b8 030819960008501a
|
||||||
|
patword 00b9 030819960008501a
|
||||||
|
patword 00ba 030819960008501a
|
||||||
|
patword 00bb 030819960008501a
|
||||||
|
patword 00bc 030819960008501a
|
||||||
|
patword 00bd 030819960008501a
|
||||||
|
patword 00be 030819960008501a
|
||||||
|
patword 00bf 030819960008501a
|
||||||
|
patword 00c0 0308199f0008501a
|
||||||
|
patword 00c1 0308199f0008501a
|
||||||
|
patword 00c2 0308199f0008501a
|
||||||
|
patword 00c3 0308199f0008501a
|
||||||
|
patword 00c4 0308199f0008501a
|
||||||
|
patword 00c5 0308199f0008501a
|
||||||
|
patword 00c6 0308199f0008501a
|
||||||
|
patword 00c7 0308199f0008501a
|
||||||
|
patword 00c8 0308199f0008501a
|
||||||
|
patword 00c9 0308199f0008501a
|
||||||
|
patword 00ca 0308199f0008501a
|
||||||
|
patword 00cb 0308199f0008501a
|
||||||
|
patword 00cc 0308199f0008501a
|
||||||
|
patword 00cd 0308199f0008501a
|
||||||
|
patword 00ce 0308199f0008501a
|
||||||
|
patword 00cf 0308199f0008501a
|
||||||
|
patword 00d0 0308199f0008501a
|
||||||
|
patword 00d1 0308199f0008501a
|
||||||
|
patword 00d2 0308199f0008501a
|
||||||
|
patword 00d3 0308199f0008501a
|
||||||
|
patword 00d4 0308599f0008503a
|
||||||
|
patword 00d5 0308599f0008503a
|
||||||
|
patword 00d6 030c599f000850ba
|
||||||
|
patword 00d7 030c599f000850ba
|
||||||
|
patword 00d8 030c599f000850ba
|
||||||
|
patword 00d9 030c599f000850ba
|
||||||
|
patword 00da 030c599f000850ba
|
||||||
|
patword 00db 030c599f000850ba
|
||||||
|
patword 00dc 030c599f000850ba
|
||||||
|
patword 00dd 030c599f000850ba
|
||||||
|
patword 00de 030c599f000850ba
|
||||||
|
patword 00df 030c599f000850ba
|
||||||
|
patword 00e0 030c599f000850ba
|
||||||
|
patword 00e1 030c599f000850ba
|
||||||
|
patword 00e2 030c599f000850ba
|
||||||
|
patword 00e3 030c599f000850ba
|
||||||
|
patword 00e4 030c599f000850ba
|
||||||
|
patword 00e5 030c599f000850ba
|
||||||
|
patword 00e6 030c599f000850ba
|
||||||
|
patword 00e7 030c599f000850ba
|
||||||
|
patword 00e8 030c599f000850ba
|
||||||
|
patword 00e9 030c599f000850ba
|
||||||
|
patword 00ea 030c799f010858ba
|
||||||
|
patword 00eb 030c799f010858ba
|
||||||
|
patword 00ec 030c599f000850ba
|
||||||
|
patword 00ed 030c599f000850ba
|
||||||
|
patword 00ee 030c599f000850ba
|
||||||
|
patword 00ef 030c599f000850ba
|
||||||
|
patword 00f0 030c599f000850ba
|
||||||
|
patword 00f1 030c599f000850ba
|
||||||
|
patword 00f2 030c599f000850ba
|
||||||
|
patword 00f3 030c599f000850ba
|
||||||
|
patword 00f4 030c599f000850ba
|
||||||
|
patword 00f5 030c599f000850ba
|
||||||
|
patword 00f6 030c599f000850ba
|
||||||
|
patword 00f7 030c599f000850ba
|
||||||
|
patword 00f8 030c599f000850ba
|
||||||
|
patword 00f9 030c599f000850ba
|
||||||
|
patword 00fa 030c599f000850ba
|
||||||
|
patword 00fb 030c599f000850ba
|
||||||
|
patword 00fc 030c599f000850ba
|
||||||
|
patword 00fd 030c599f000850ba
|
||||||
|
patword 00fe 030c599f000850ba
|
||||||
|
patword 00ff 030c599f000850ba
|
||||||
|
patword 0100 030c599f000850ba
|
||||||
|
patword 0101 030c599f000850ba
|
||||||
|
patword 0102 030c599f400850ba
|
||||||
|
patword 0103 030c599f400850ba
|
||||||
|
patword 0104 030c599f600850ba
|
||||||
|
patword 0105 030c599f400850ba
|
||||||
|
patword 0106 030c599f400850ba
|
||||||
|
patword 0107 030c599f400850ba
|
||||||
|
patword 0108 870c599f682e50ba
|
||||||
|
patword 0109 870c599f482850ba
|
||||||
|
patword 010a 870c599f000e50ba
|
||||||
|
patword 010b 870c599f000850ba
|
||||||
|
patword 010c 870c599f000e50ba
|
||||||
|
patword 010d 870c599f000850ba
|
||||||
|
patword 010e 870c599f000e50ba
|
||||||
|
patword 010f 870c599f000850ba
|
||||||
|
patword 0110 870c599f000e50ba
|
||||||
|
patword 0111 870c599f000850ba
|
||||||
|
patword 0112 870c599f000e50ba
|
||||||
|
patword 0113 870c599f000850ba
|
||||||
|
patword 0114 870c599f000e50ba
|
||||||
|
patword 0115 870c599f000850ba
|
||||||
|
patword 0116 870c599f000e50ba
|
||||||
|
patword 0117 870c599f000850ba
|
||||||
|
patword 0118 870c599f000e50ba
|
||||||
|
patword 0119 870c599f000850ba
|
||||||
|
patword 011a 870c599f000e50ba
|
||||||
|
patword 011b 870c599f000850ba
|
||||||
|
patword 011c 870c599f000e50ba
|
||||||
|
patword 011d 870c599f000850ba
|
||||||
|
patword 011e 870c599f000e50ba
|
||||||
|
patword 011f 870c599f000850ba
|
||||||
|
patword 0120 870c599f000e50ba
|
||||||
|
patword 0121 870c599f000850ba
|
||||||
|
patword 0122 870c599f200e50ba
|
||||||
|
patword 0123 870c599f000850ba
|
||||||
|
patword 0124 870c599f000e50ba
|
||||||
|
patword 0125 870c599f000850ba
|
||||||
|
patword 0126 870c599f000e50ba
|
||||||
|
patword 0127 870c599f000850ba
|
||||||
|
patword 0128 870c599f000e50ba
|
||||||
|
patword 0129 870c599f000850ba
|
||||||
|
patword 012a 870c599f000e50ba
|
||||||
|
patword 012b 870c599f000850ba
|
||||||
|
patword 012c 870c599f000e50ba
|
||||||
|
patword 012d 870c599f000850ba
|
||||||
|
patword 012e 870c599f000e50ba
|
||||||
|
patword 012f 870c599f000850ba
|
||||||
|
patword 0130 870c599f000e50ba
|
||||||
|
patword 0131 870c599f000850ba
|
||||||
|
patword 0132 870c599f000e50ba
|
||||||
|
patword 0133 870c599f000850ba
|
||||||
|
patword 0134 870c599f000e50ba
|
||||||
|
patword 0135 870c599f000850ba
|
||||||
|
patword 0136 870c599f000e50ba
|
||||||
|
patword 0137 870c599f000850ba
|
||||||
|
patword 0138 870c599f000e50ba
|
||||||
|
patword 0139 870c599f000850ba
|
||||||
|
patword 013a 870c599f282e50ba
|
||||||
|
patword 013b 870c599f082850ba
|
||||||
|
patword 013c 870c599f000e50ba
|
||||||
|
patword 013d 870c599f000850ba
|
||||||
|
patword 013e 870c599f000e50ba
|
||||||
|
patword 013f 870c599f000850ba
|
||||||
|
patword 0140 870c599f000e50ba
|
||||||
|
patword 0141 870c599f000850ba
|
||||||
|
patword 0142 870c599f000e50ba
|
||||||
|
patword 0143 870c599f000850ba
|
||||||
|
patword 0144 870c599f000e50ba
|
||||||
|
patword 0145 870c599f000850ba
|
||||||
|
patword 0146 870c599f000e50ba
|
||||||
|
patword 0147 870c599f000850ba
|
||||||
|
patword 0148 870c599f000e50ba
|
||||||
|
patword 0149 870c599f000850ba
|
||||||
|
patword 014a 870c599f000e50ba
|
||||||
|
patword 014b 870c599f000850ba
|
||||||
|
patword 014c 870c599f000e50ba
|
||||||
|
patword 014d 870c599f000850ba
|
||||||
|
patword 014e 870c599f000e50ba
|
||||||
|
patword 014f 870c599f000850ba
|
||||||
|
patword 0150 870c599f000e50ba
|
||||||
|
patword 0151 870c599f000850ba
|
||||||
|
patword 0152 870c599f000e50ba
|
||||||
|
patword 0153 870c599f000850ba
|
||||||
|
patword 0154 870c599f200e50ba
|
||||||
|
patword 0155 870c599f000850ba
|
||||||
|
patword 0156 870c599f000e50ba
|
||||||
|
patword 0157 870c599f000850ba
|
||||||
|
patword 0158 870c599f000e50ba
|
||||||
|
patword 0159 870c599f000850ba
|
||||||
|
patword 015a 870c599f000e50ba
|
||||||
|
patword 015b 870c599f000850ba
|
||||||
|
patword 015c 870c599f000e50ba
|
||||||
|
patword 015d 870c599f000850ba
|
||||||
|
patword 015e 870c599f000e50ba
|
||||||
|
patword 015f 870c599f000850ba
|
||||||
|
patword 0160 870c599f000e50ba
|
||||||
|
patword 0161 870c599f000850ba
|
||||||
|
patword 0162 870c599f000e50ba
|
||||||
|
patword 0163 870c599f000850ba
|
||||||
|
patword 0164 870c599f000e50ba
|
||||||
|
patword 0165 870c599f000850ba
|
||||||
|
patword 0166 870c599f000e50ba
|
||||||
|
patword 0167 870c599f000850ba
|
||||||
|
patword 0168 870c599f000e50ba
|
||||||
|
patword 0169 870c599f000850ba
|
||||||
|
patword 016a 870c599f000e50ba
|
||||||
|
patword 016b 870c599f000850ba
|
||||||
|
patword 016c 070c599f000850ba
|
||||||
|
patword 016d 070c599f000850ba
|
||||||
|
patword 016e 000c599f000850ba
|
||||||
|
patword 016f 000c599f000850ba
|
||||||
|
patword 0170 0008599f200e503a
|
||||||
|
patword 0171 0008599f0008503a
|
||||||
|
patword 0172 0008599f200e503a
|
||||||
|
patword 0173 0008599f0008503a
|
||||||
|
patword 0174 0008599f0008503a
|
||||||
|
patword 0175 0008599f0008503a
|
||||||
|
patword 0176 0008599f0008503a
|
||||||
|
patword 0177 0008599f0008503a
|
||||||
|
patword 0178 0008599f0008503a
|
||||||
|
patword 0179 0008599f0008503a
|
||||||
|
patword 017a 0008599f0008503a
|
||||||
|
patword 017b 0008599f0008503a
|
||||||
|
patword 017c 0008599f0008503a
|
||||||
|
patword 017d 0008599f0008503a
|
||||||
|
patword 017e 0008599f0008503a
|
||||||
|
patword 017f 0008599f0008503a
|
||||||
|
patword 0180 0008599f0008503a
|
||||||
|
patword 0181 0008599f0008503a
|
||||||
|
patword 0182 0008599f0008503a
|
||||||
|
patword 0183 0008599f0008503a
|
||||||
|
patword 0184 0008599f0008503a
|
||||||
|
patword 0185 0008599f0008503a
|
||||||
|
patword 0186 0008599f0008503a
|
||||||
|
patword 0187 0008599f0008503a
|
||||||
|
patword 0188 0008599f0008503a
|
||||||
|
patword 0189 0008599f0008503a
|
||||||
|
patword 018a 0008599f0008503a
|
||||||
|
patword 018b 0008599f0008503a
|
||||||
|
patword 018c 0008599f0008503a
|
||||||
|
patword 018d 0008599f0008503a
|
||||||
|
patioctrl 8f0effff6dbffdbf
|
||||||
|
patclkctrl 0000000000000000
|
||||||
|
patlimits 0000 018c
|
||||||
|
patloop0 013a 016b
|
||||||
|
patnloop0 199
|
||||||
|
patloop1 0400 0400
|
||||||
|
patnloop1 0
|
||||||
|
patloop2 0400 0400
|
||||||
|
patnloop2 0
|
||||||
|
patwait0 00aa
|
||||||
|
patwaittime0 40000
|
||||||
|
patwait1 0400
|
||||||
|
patwaittime1 0
|
||||||
|
patwait2 0400
|
||||||
|
patwaittime2 0
|
||||||
|
|
||||||
|
|
||||||
|
####mcp2011
|
||||||
|
#0:rx_udpip 10.1.1.102
|
||||||
|
#0:detectorip 10.1.1.19
|
||||||
|
#0:rx_udpport 32410
|
||||||
|
####gui listening to
|
||||||
|
#zmqip 129.129.202.131
|
||||||
|
#zmqport 30001
|
||||||
|
####data streaming out of
|
||||||
|
#rx_zmqip 10.1.2.103
|
||||||
|
#rx_zmqport 30003
|
||||||
|
#0:rx_hostname mpc2011
|
||||||
|
|
||||||
|
####mx-test-1
|
||||||
|
0:rx_udpip 10.1.1.100
|
||||||
|
0:detectorip 10.1.1.19
|
||||||
|
0:rx_udpport 32410
|
||||||
|
####gui listening to (on receiver pc)
|
||||||
|
zmqip 129.129.202.92
|
||||||
|
zmqport 30001
|
||||||
|
####data streaming out of
|
||||||
|
rx_zmqip 10.1.1.100
|
||||||
|
rx_zmqport 30003
|
||||||
|
0:rx_hostname pcmoench01
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#turn on datastream from commandline
|
||||||
|
rx_datastream 1
|
||||||
|
|
||||||
|
r_readfreq 1
|
||||||
|
|
||||||
|
#0:configuremac -1
|
||||||
|
rx_datastream 1
|
||||||
|
|
||||||
|
r_readfreq 1
|
||||||
|
|
||||||
|
|
||||||
|
dac:6 800
|
||||||
|
dac:0 1300
|
||||||
|
dac:4 1428
|
||||||
|
dac:1 1000
|
||||||
|
dac:7 900
|
||||||
|
dac:3 680
|
||||||
|
dac:2 1400
|
||||||
|
dac:5 1200
|
||||||
|
adcinvert 4a342593
|
||||||
|
samples 5000
|
||||||
|
adcphase 90
|
||||||
|
adcpipeline 15
|
||||||
|
adcreg 14 40
|
||||||
|
powerchip 1
|
||||||
|
vhighvoltage 90
|
||||||
|
period 0.005
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
frames 100
|
||||||
|
period 0.1
|
||||||
|
outdir /scratch/
|
||||||
|
enablefwrite 0
|
||||||
|
|
@ -8,13 +8,11 @@ hostname bchip007+bchip009+
|
|||||||
#0:port 1952
|
#0:port 1952
|
||||||
#0:stopport 1953
|
#0:stopport 1953
|
||||||
#0:rx_tcpport 1956
|
#0:rx_tcpport 1956
|
||||||
0:settingsdir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
|
|
||||||
0:angdir 1.000000
|
0:angdir 1.000000
|
||||||
0:moveflag 0.000000
|
0:moveflag 0.000000
|
||||||
0:lock 0
|
|
||||||
0:caldir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
|
|
||||||
0:ffdir /home/l_msdetect
|
0:ffdir /home/l_msdetect
|
||||||
0:extsig:0 off
|
0:extsig:0 off
|
||||||
|
|
||||||
0:detectorip 10.1.1.2
|
0:detectorip 10.1.1.2
|
||||||
#0:detectormac 00:aa:bb:cc:dd:ee
|
#0:detectormac 00:aa:bb:cc:dd:ee
|
||||||
#0:rx_udpport 50001
|
#0:rx_udpport 50001
|
||||||
@ -28,13 +26,11 @@ hostname bchip007+bchip009+
|
|||||||
#1:port 1952
|
#1:port 1952
|
||||||
#1:stopport 1953
|
#1:stopport 1953
|
||||||
1:rx_tcpport 1957
|
1:rx_tcpport 1957
|
||||||
1:settingsdir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
|
|
||||||
1:angdir 1.000000
|
1:angdir 1.000000
|
||||||
1:moveflag 0.000000
|
1:moveflag 0.000000
|
||||||
1:lock 0
|
|
||||||
1:caldir /home/l_msdetect/dhanya/slsDetectorsPackage/settingsdir/gotthard
|
|
||||||
1:ffdir /home/l_msdetect
|
1:ffdir /home/l_msdetect
|
||||||
1:extsig:0 off
|
1:extsig:0 off
|
||||||
|
|
||||||
1:detectorip 10.1.2.2
|
1:detectorip 10.1.2.2
|
||||||
#1:detectormac 00:aa:bb:cc:dd:ee
|
#1:detectormac 00:aa:bb:cc:dd:ee
|
||||||
1:rx_udpport 50004
|
1:rx_udpport 50004
|
||||||
@ -56,4 +52,4 @@ badchannels none
|
|||||||
angconv none
|
angconv none
|
||||||
globaloff 0.000000
|
globaloff 0.000000
|
||||||
binsize 0.001000
|
binsize 0.001000
|
||||||
threaded 1
|
|
||||||
|
35
manual/manual-api/CMakeLists.txt
Normal file
35
manual/manual-api/CMakeLists.txt
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
set(SOURCES
|
||||||
|
mainReceiver.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
include_directories(
|
||||||
|
../../slsReceiverSoftware/include
|
||||||
|
../../slsDetectorSoftware/slsDetectorAnalysis
|
||||||
|
../../build/bin
|
||||||
|
../../slsdetectorSoftware/slsDetector
|
||||||
|
)
|
||||||
|
|
||||||
|
add_executable(slsMultiReceiver
|
||||||
|
${SOURCES}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(slsMultiReceiver
|
||||||
|
slsReceiverShared
|
||||||
|
pthread
|
||||||
|
zmq
|
||||||
|
rt
|
||||||
|
${HDF5_LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (HDF5_FOUND)
|
||||||
|
target_link_libraries(slsMultiReceiver
|
||||||
|
${HDF5_LIBRARIES}
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
set_target_properties(slsMultiReceiver PROPERTIES
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||||
|
)
|
||||||
|
|
||||||
|
install(TARGETS slsMultiReceiver DESTINATION bin)
|
@ -1,18 +1,26 @@
|
|||||||
INCLUDES = -I .
|
PKGDIR = ../..
|
||||||
|
LIBDIR = $(PKGDIR)/build/bin
|
||||||
|
INCLUDES = -I . -I$(PKGDIR)/slsReceiverSoftware/include -I$(PKGDIR)/slsDetectorSoftware/slsDetectorAnalysis -I$(LIBDIR) -I$(PKGDIR)/slsDetectorSoftware/slsDetector
|
||||||
SRC_DET = mainClient.cpp
|
SRC_DET = mainClient.cpp
|
||||||
SRC_REC = mainReceiver.cpp
|
SRC_REC = mainReceiver.cpp
|
||||||
LIBDIR = .
|
ZMQLIBDIR = $(PKGDIR)/slsReceiverSoftware/include
|
||||||
LDFLAG_DET = -I. -L$(LIBDIR) -lSlsDetector -L/usr/lib64/ -pthread -lrt -L. -lzmq
|
LDFLAG_DET = -I. -L$(LIBDIR) -Wl,-rpath=$(LIBDIR) -lSlsDetector -L/usr/lib64/ -pthread -lrt -L$(ZMQLIBDIR) -Wl,-rpath=$(ZMQLIBDIR) -lzmq
|
||||||
LDFLAG_REC = -I. -L$(LIBDIR) -lSlsReceiver -L/usr/lib64/ -pthread -lrt -L. -lzmq
|
LDFLAG_REC = -I. -L$(LIBDIR) -Wl,-rpath=$(LIBDIR) -lSlsReceiver -L/usr/lib64/ -pthread -lrt -L$(ZMQLIBDIR) -Wl,-rpath=$(ZMQLIBDIR) -lzmq
|
||||||
DESTDIR ?= ../docs
|
DESTDIR ?= ../docs
|
||||||
|
|
||||||
|
HDF5 ?= no
|
||||||
|
HDF5_DIR ?= /opt/hdf5v1.10.0
|
||||||
|
|
||||||
all: docs detUser detReceiver
|
ifeq ($(HDF5),yes)
|
||||||
|
LDFLAG_REC += -L$(HDF5_DIR)/lib -Wl,-rpath=$(HDF5_DIR)/lib -lhdf5 -lhdf5_cpp -lsz -lz -DHDF5C
|
||||||
|
endif
|
||||||
|
|
||||||
|
all: docs detUser slsMultiReceiver
|
||||||
#all: docs
|
#all: docs
|
||||||
|
|
||||||
docs: createdocs docspdf docshtml removedocs
|
docs: createdocs docspdf docshtml removedocs
|
||||||
|
|
||||||
createdocs: slsDetectorUsers.doxy slsDetectorUsers.h detectorData.h slsReceiverUsers.h mainClient.cpp mainReceiver.cpp
|
createdocs: slsDetectorUsers.doxy mainClient.cpp mainReceiver.cpp
|
||||||
doxygen slsDetectorUsers.doxy
|
doxygen slsDetectorUsers.doxy
|
||||||
|
|
||||||
docspdf:
|
docspdf:
|
||||||
@ -35,18 +43,20 @@ detUser:$(SRC_DET)
|
|||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
g++ -o bin/detUser $(SRC_DET) $(INCLUDES) $(LDFLAG_DET) -lm -lstdc++
|
g++ -o bin/detUser $(SRC_DET) $(INCLUDES) $(LDFLAG_DET) -lm -lstdc++
|
||||||
|
|
||||||
detReceiver:$(SRC_REC)
|
slsMultiReceiver:$(SRC_REC)
|
||||||
echo "creating receiver"
|
echo "creating receiver"
|
||||||
|
echo $LDFLAG_REC
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
g++ -o bin/detReceiver $(SRC_REC) $(INCLUDES) $(LDFLAG_REC) -lm -lstdc++
|
g++ -o bin/slsMultiReceiver $(SRC_REC) $(INCLUDES) $(LDFLAG_REC) -lm -lstdc++
|
||||||
|
cp bin/slsMultiReceiver $(LIBDIR)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
echo "cleaning for manual-api"
|
echo "cleaning for manual-api"
|
||||||
rm -rf bin/detUser bin/detReceiver slsDetectorUsersDocs
|
rm -rf bin/detUser bin/slsMultiReceiver bin/detReceiver slsDetectorUsersDocs
|
||||||
rm -rf slsDetectorUsersDocs
|
rm -rf slsDetectorUsersDocs
|
||||||
rm -rf $(DESTDIR)/html/slsDetectorUsersDocs
|
rm -rf $(DESTDIR)/html/slsDetectorUsersDocs
|
||||||
rm -rf $(DESTDIR)/pdf/slsDetectorUsersDocs.pdf
|
rm -rf $(DESTDIR)/pdf/slsDetectorUsersDocs.pdf
|
||||||
|
rm -rf $(LIBDIR)/slsMultiReceiver
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
../../slsReceiverSoftware/include/ansi.h
|
|
@ -1 +0,0 @@
|
|||||||
../../slsDetectorSoftware/slsDetectorAnalysis/detectorData.h
|
|
@ -1 +0,0 @@
|
|||||||
../../build/bin/libSlsDetector.so
|
|
@ -1 +0,0 @@
|
|||||||
../../build/bin/libSlsReceiver.so
|
|
@ -1 +0,0 @@
|
|||||||
../../slsReceiverSoftware/include/libzmq.a
|
|
@ -54,7 +54,12 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
|
|
||||||
/** - slsDetectorUsers Object is instantiated with appropriate ID */
|
/** - slsDetectorUsers Object is instantiated with appropriate ID */
|
||||||
slsDetectorUsers *pDetector = new slsDetectorUsers (id);
|
int ret = 1;
|
||||||
|
slsDetectorUsers *pDetector = new slsDetectorUsers (ret, id);
|
||||||
|
if (ret == 1) {
|
||||||
|
std::cout << "Error: Could not instantiate slsDetectorUsers" << std::endl;
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** - if specified, load configuration file (necessary at least the first time it is called to properly configure advanced settings in the shared memory) */
|
/** - if specified, load configuration file (necessary at least the first time it is called to properly configure advanced settings in the shared memory) */
|
||||||
@ -71,10 +76,6 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
/** - registering data callback */
|
/** - registering data callback */
|
||||||
pDetector->registerDataCallback(&dataCallback, NULL);
|
pDetector->registerDataCallback(&dataCallback, NULL);
|
||||||
/** - if receiver exists, enable data streaming from receiver to get the data */
|
|
||||||
pDetector->enableDataStreamingFromReceiver(1);
|
|
||||||
/** - create zmq sockets in client to enable data streaming in of data from receiver/different process */
|
|
||||||
pDetector->enableDataStreamingToClient(1);
|
|
||||||
|
|
||||||
|
|
||||||
/** - ensuring detector status is idle before starting acquisition. exiting if not idle */
|
/** - ensuring detector status is idle before starting acquisition. exiting if not idle */
|
||||||
@ -93,7 +94,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
/** - start measurement */
|
/** - start measurement */
|
||||||
pDetector->startMeasurement();
|
pDetector->startMeasurement();
|
||||||
std::cout << "measurement finished" << std::endl; usleep(1*1000*1000);
|
std::cout << "measurement finished" << std::endl;
|
||||||
|
|
||||||
/** - returning when acquisition is finished or data are avilable */
|
/** - returning when acquisition is finished or data are avilable */
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ void sigInterruptHandler(int p){
|
|||||||
*/
|
*/
|
||||||
void printHelp() {
|
void printHelp() {
|
||||||
cprintf(RESET, "Usage:\n"
|
cprintf(RESET, "Usage:\n"
|
||||||
"./detReceiver [start_tcp_port] [num_receivers] [1 for call back, 0 for none]\n\n");
|
"./slsMultiReceiver(detReceiver) [start_tcp_port] [num_receivers] [1 for call back, 0 for none]\n\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ void printHelp() {
|
|||||||
*/
|
*/
|
||||||
int StartAcq(char* filepath, char* filename, uint64_t fileindex, uint32_t datasize, void*p){
|
int StartAcq(char* filepath, char* filename, uint64_t fileindex, uint32_t datasize, void*p){
|
||||||
cprintf(BLUE, "#### StartAcq: filepath:%s filename:%s fileindex:%llu datasize:%u ####\n",
|
cprintf(BLUE, "#### StartAcq: filepath:%s filename:%s fileindex:%llu datasize:%u ####\n",
|
||||||
filepath, filename, fileindex, datasize);
|
filepath, filename, (long long unsigned int)fileindex, datasize);
|
||||||
|
|
||||||
cprintf(BLUE, "--StartAcq: returning 0\n");
|
cprintf(BLUE, "--StartAcq: returning 0\n");
|
||||||
return 0;
|
return 0;
|
||||||
@ -83,45 +83,80 @@ int StartAcq(char* filepath, char* filename, uint64_t fileindex, uint32_t datasi
|
|||||||
* @param p pointer to object
|
* @param p pointer to object
|
||||||
*/
|
*/
|
||||||
void AcquisitionFinished(uint64_t frames, void*p){
|
void AcquisitionFinished(uint64_t frames, void*p){
|
||||||
cprintf(BLUE, "#### AcquisitionFinished: frames:%llu ####\n",frames);
|
cprintf(BLUE, "#### AcquisitionFinished: frames:%llu ####\n",(long long unsigned int)frames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Receiver Data Call back
|
* Get Receiver Data Call back
|
||||||
* Prints in different colors(for each receiver process) the different headers for each image call back.
|
* Prints in different colors(for each receiver process) the different headers for each image call back.
|
||||||
* @param frameNumber frame number
|
* @param metadata sls_receiver_header metadata
|
||||||
* @param expLength real time exposure length (in 100ns) or sub frame number (Eiger 32 bit mode only)
|
|
||||||
* @param packetNumber number of packets caught for this frame
|
|
||||||
* @param bunchId bunch id from beamline
|
|
||||||
* @param timestamp time stamp in 10MHz clock (not implemented for most)
|
|
||||||
* @param modId module id (not implemented for most)
|
|
||||||
* @param xCoord x coordinates (detector id in 1D)
|
|
||||||
* @param yCoord y coordinates (not implemented)
|
|
||||||
* @param zCoord z coordinates (not implemented)
|
|
||||||
* @param debug debug values if any
|
|
||||||
* @param roundRNumber (not implemented)
|
|
||||||
* @param detType detector type see :: detectorType
|
|
||||||
* @param version version of standard header (structure format)
|
|
||||||
* @param datapointer pointer to data
|
* @param datapointer pointer to data
|
||||||
* @param datasize data size in bytes
|
* @param datasize data size in bytes.
|
||||||
* @param p pointer to object
|
* @param p pointer to object
|
||||||
*/
|
*/
|
||||||
void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, uint64_t bunchId, uint64_t timestamp,
|
void GetData(char* metadata, char* datapointer, uint32_t datasize, void* p){
|
||||||
uint16_t modId, uint16_t xCoord, uint16_t yCoord, uint16_t zCoord, uint32_t debug, uint16_t roundRNumber, uint8_t detType, uint8_t version,
|
slsReceiverDefs::sls_receiver_header* header = (slsReceiverDefs::sls_receiver_header*)metadata;
|
||||||
char* datapointer, uint32_t datasize, void* p){
|
slsReceiverDefs::sls_detector_header detectorHeader = header->detHeader;
|
||||||
|
|
||||||
PRINT_IN_COLOR (modId?modId:xCoord,
|
PRINT_IN_COLOR (detectorHeader.modId?detectorHeader.modId:detectorHeader.row,
|
||||||
"#### %d GetData: ####\n"
|
"#### %d GetData: ####\n"
|
||||||
"frameNumber: %llu\t\texpLength: %u\t\tpacketNumber: %u\t\tbunchId: %llu\t\ttimestamp: %llu\t\tmodId: %u\t\t"
|
"frameNumber: %llu\t\texpLength: %u\t\tpacketNumber: %u\t\tbunchId: %llu"
|
||||||
"xCoord: %u\t\tyCoord: %u\t\tzCoord: %u\t\tdebug: %u\t\troundRNumber: %u\t\tdetType: %u\t\t"
|
"\t\ttimestamp: %llu\t\tmodId: %u\t\t"
|
||||||
"version: %u\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
|
"row: %u\t\tcolumn: %u\t\treserved: %u\t\tdebug: %u"
|
||||||
xCoord, frameNumber, expLength, packetNumber, bunchId, timestamp, modId,
|
"\t\troundRNumber: %u\t\tdetType: %u\t\tversion: %u"
|
||||||
xCoord, yCoord, zCoord, debug, roundRNumber, detType, version,
|
//"\t\tpacketsMask:%s"
|
||||||
|
"\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
|
||||||
|
detectorHeader.row, (long long unsigned int)detectorHeader.frameNumber,
|
||||||
|
detectorHeader.expLength, detectorHeader.packetNumber, (long long unsigned int)detectorHeader.bunchId,
|
||||||
|
(long long unsigned int)detectorHeader.timestamp, detectorHeader.modId,
|
||||||
|
detectorHeader.row, detectorHeader.column, detectorHeader.reserved,
|
||||||
|
detectorHeader.debug, detectorHeader.roundRNumber,
|
||||||
|
detectorHeader.detType, detectorHeader.version,
|
||||||
|
//header->packetsMask.to_string().c_str(),
|
||||||
((uint8_t)(*((uint8_t*)(datapointer)))), datasize);
|
((uint8_t)(*((uint8_t*)(datapointer)))), datasize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Receiver Data Call back (modified)
|
||||||
|
* Prints in different colors(for each receiver process) the different headers for each image call back.
|
||||||
|
* @param metadata sls_receiver_header metadata
|
||||||
|
* @param datapointer pointer to data
|
||||||
|
* @param datasize data size in bytes.
|
||||||
|
* @param revDatasize new data size in bytes after the callback.
|
||||||
|
* This will be the size written/streamed. (only smaller value is allowed).
|
||||||
|
* @param p pointer to object
|
||||||
|
*/
|
||||||
|
void GetData(char* metadata, char* datapointer, uint32_t &revDatasize, void* p){
|
||||||
|
slsReceiverDefs::sls_receiver_header* header = (slsReceiverDefs::sls_receiver_header*)metadata;
|
||||||
|
slsReceiverDefs::sls_detector_header detectorHeader = header->detHeader;
|
||||||
|
|
||||||
|
PRINT_IN_COLOR (detectorHeader.modId?detectorHeader.modId:detectorHeader.row,
|
||||||
|
"#### %d GetData: ####\n"
|
||||||
|
"frameNumber: %llu\t\texpLength: %u\t\tpacketNumber: %u\t\tbunchId: %llu"
|
||||||
|
"\t\ttimestamp: %llu\t\tmodId: %u\t\t"
|
||||||
|
"row: %u\t\tcolumn: %u\t\treserved: %u\t\tdebug: %u"
|
||||||
|
"\t\troundRNumber: %u\t\tdetType: %u\t\tversion: %u"
|
||||||
|
//"\t\tpacketsMask:%s"
|
||||||
|
"\t\tfirstbytedata: 0x%x\t\tdatsize: %u\n\n",
|
||||||
|
detectorHeader.row, (long long unsigned int)detectorHeader.frameNumber,
|
||||||
|
detectorHeader.expLength, detectorHeader.packetNumber, (long long unsigned int)detectorHeader.bunchId,
|
||||||
|
(long long unsigned int)detectorHeader.timestamp, detectorHeader.modId,
|
||||||
|
detectorHeader.row, detectorHeader.column, detectorHeader.reserved,
|
||||||
|
detectorHeader.debug, detectorHeader.roundRNumber,
|
||||||
|
detectorHeader.detType, detectorHeader.version,
|
||||||
|
//header->packetsMask.to_string().c_str(),
|
||||||
|
((uint8_t)(*((uint8_t*)(datapointer)))), revDatasize);
|
||||||
|
|
||||||
|
// if data is modified, eg ROI and size is reduced
|
||||||
|
revDatasize = 26000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Example of main program using the slsReceiverUsers class
|
* Example of main program using the slsReceiverUsers class
|
||||||
*
|
*
|
||||||
@ -209,7 +244,8 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
/* - Call back for raw data */
|
/* - Call back for raw data */
|
||||||
cprintf(BLUE, "Registering GetData() \n");
|
cprintf(BLUE, "Registering GetData() \n");
|
||||||
receiver->registerCallBackRawDataReady(GetData,NULL);
|
if (withCallback == 1) receiver->registerCallBackRawDataReady(GetData,NULL);
|
||||||
|
else if (withCallback == 2) receiver->registerCallBackRawDataModifyReady(GetData,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,6 +82,10 @@ SOURCE_BROWSER = YES
|
|||||||
|
|
||||||
PREDEFINED = __cplusplus
|
PREDEFINED = __cplusplus
|
||||||
|
|
||||||
INPUT = slsDetectorUsers.h detectorData.h slsReceiverUsers.h mainClient.cpp mainReceiver.cpp
|
INPUT = ../../slsDetectorSoftware/slsDetector/slsDetectorUsers.h \
|
||||||
|
../../slDetectorSoftware/slsDetectorAnalysis/detectorData.h \
|
||||||
|
../../slsReceiverSoftware/include/slsReceiverUsers.h \
|
||||||
|
mainClient.cpp \
|
||||||
|
mainReceiver.cpp
|
||||||
|
|
||||||
OUTPUT_DIRECTORY = slsDetectorUsersDocs
|
OUTPUT_DIRECTORY = slsDetectorUsersDocs
|
||||||
|
@ -1 +0,0 @@
|
|||||||
../../slsDetectorSoftware/slsDetector/slsDetectorUsers.h
|
|
@ -1 +0,0 @@
|
|||||||
../../slsReceiverSoftware/include/slsReceiverUsers.h
|
|
@ -1 +0,0 @@
|
|||||||
../../slsReceiverSoftware/include/sls_receiver_defs.h
|
|
@ -1 +0,0 @@
|
|||||||
../../slsReceiverSoftware/include/sls_receiver_funcs.h
|
|
@ -1 +0,0 @@
|
|||||||
../../slsReceiverSoftware/include/zmq.h
|
|
BIN
manual/manual-client/Boards.png
Normal file
BIN
manual/manual-client/Boards.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 432 KiB |
BIN
manual/manual-client/Eiger_short.pdf
Normal file
BIN
manual/manual-client/Eiger_short.pdf
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
manual/manual-client/GapPixels.png
Normal file
BIN
manual/manual-client/GapPixels.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
BIN
manual/manual-client/LEDSim.png
Normal file
BIN
manual/manual-client/LEDSim.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 863 KiB |
BIN
manual/manual-client/TansmissionRates.png
Normal file
BIN
manual/manual-client/TansmissionRates.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
BIN
manual/manual-client/tiggerIN.png
Normal file
BIN
manual/manual-client/tiggerIN.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 167 KiB |
@ -61,6 +61,11 @@ The \textit{data receiver}, which can be run on a different machine than the
|
|||||||
client, receives the data from the detector and processes it. The receiver can
|
client, receives the data from the detector and processes it. The receiver can
|
||||||
be configured, controlled and monitored by the client.
|
be configured, controlled and monitored by the client.
|
||||||
|
|
||||||
|
\item \textcolor{blue}{slsMultiReceiver}: \\
|
||||||
|
It is the same as the \textit{slsReceiver}, but that it is a single process
|
||||||
|
for many multiple slsReceiver child processes. One can configure the start TCP port,
|
||||||
|
number of slsReceiver processes and if call back should be enabled or not.
|
||||||
|
|
||||||
\item \textcolor{blue}{slsDetectorGUI}: \\
|
\item \textcolor{blue}{slsDetectorGUI}: \\
|
||||||
The \textit{graphical user interface}, which provides a user friendly way
|
The \textit{graphical user interface}, which provides a user friendly way
|
||||||
of operating the detectors and data receivers with online data preview.
|
of operating the detectors and data receivers with online data preview.
|
||||||
@ -110,13 +115,13 @@ conda config --add channels conda-forge
|
|||||||
conda config --add channels slsdetectorgroup
|
conda config --add channels slsdetectorgroup
|
||||||
|
|
||||||
#Install latest version
|
#Install latest version
|
||||||
conda install sls_detector_software
|
conda install sls_detector_lib
|
||||||
|
conda install sls_detector_gui
|
||||||
|
|
||||||
#Install specific release (GLIBC2.14)
|
#Install specific release
|
||||||
conda install sls_detector_software=3.1.0
|
conda install sls_detector_lib=4.0.0
|
||||||
|
conda install sls_detector_gui=4.0.0
|
||||||
|
|
||||||
#Scientific Linux 6 version (GLIBC2.12)
|
|
||||||
conda install sls_detector_software=SL6_3.1.0
|
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\item The package including Python interface
|
\item The package including Python interface
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
@ -127,11 +132,9 @@ conda config --add channels sls_detector
|
|||||||
#Install latest version
|
#Install latest version
|
||||||
conda install sls_detector
|
conda install sls_detector
|
||||||
|
|
||||||
#Install specific release (GLIBC2.14)
|
#Install specific release
|
||||||
conda install sls_detector=3.1.0
|
conda install sls_detector=4.0.0
|
||||||
|
|
||||||
#Scientific Linux 6 version (GLIBC2.12)
|
|
||||||
conda install sls_detector=SL6_3.1.0
|
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
@ -148,13 +151,13 @@ acquisition system, or if one wants to download the source code and compile.
|
|||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
#Clone source code with specific release
|
#Clone source code with specific release
|
||||||
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch
|
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch
|
||||||
3.1.0
|
4.0.0
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\item The package including Python interface
|
\item The package including Python interface
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
#Clone source code with specific release
|
#Clone source code with specific release
|
||||||
git clone https://github.com/slsdetectorgroup/sls_detector.git --branch
|
git clone https://github.com/slsdetectorgroup/sls_detector.git --branch
|
||||||
3.1.0
|
4.0.0
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
@ -437,14 +440,11 @@ the SLS Detector Package or a different detector type.
|
|||||||
One can use the \verb=cleansharedmemory.sh= script available under the
|
One can use the \verb=cleansharedmemory.sh= script available under the
|
||||||
slsDetector Package.
|
slsDetector Package.
|
||||||
|
|
||||||
One can also just use the following commands to clean the shared memory
|
One can also just delete the files that are typically located under /dev/shm/ folder
|
||||||
segments one by one.
|
and starts with slsDetectorPackage.
|
||||||
\begin{verbatim}
|
|
||||||
#displays list of shared memeory segments
|
One no longer has to delete segments using ipcs.
|
||||||
ipcs -m
|
|
||||||
#remove segments that have nattach equal to zero. They key is the first column
|
|
||||||
ipcrm -M [key]
|
|
||||||
\end{verbatim}
|
|
||||||
|
|
||||||
\section{Software Upgrade}
|
\section{Software Upgrade}
|
||||||
|
|
||||||
@ -544,14 +544,14 @@ detector board the programming files and/or software package provided by
|
|||||||
the SLS Detectors group.
|
the SLS Detectors group.
|
||||||
|
|
||||||
\subsubsection{GOTTHARD Firmware}
|
\subsubsection{GOTTHARD Firmware}
|
||||||
\textit{For SLS Detector Package v3.1.0} \\
|
\textit{For SLS Detector Package v4.0.0} \\
|
||||||
\indent Minimum compatible version: \\
|
\indent Minimum compatible version: \\
|
||||||
\indent \indent 11.01.2013 \\
|
\indent \indent 11.01.2013 \\
|
||||||
\indent Latest version: \\
|
\indent Latest version: \\
|
||||||
\indent \indent 08.02.2018 (50um and 25um Master) \\
|
\indent \indent 08.02.2018 (50um) \\
|
||||||
|
\indent \indent 08.02.2018 (25 um Master) \\
|
||||||
\indent \indent 09.02.2018 (25 um Slave) \\
|
\indent \indent 09.02.2018 (25 um Slave) \\
|
||||||
|
|
||||||
|
|
||||||
Normally, the firmware will be upgraded by us as it requires programming the
|
Normally, the firmware will be upgraded by us as it requires programming the
|
||||||
FPGA via the USB-Blaster.
|
FPGA via the USB-Blaster.
|
||||||
|
|
||||||
@ -636,9 +636,9 @@ detector board the programming files and/or software package provided by
|
|||||||
the SLS Detectors group.
|
the SLS Detectors group.
|
||||||
|
|
||||||
\subsubsection{EIGER Firmware}
|
\subsubsection{EIGER Firmware}
|
||||||
\textit{For SLS Detector Package v3.1.0} \\
|
\textit{For SLS Detector Package v4.0.0} \\
|
||||||
\indent Minimum compatible version: 16 \\
|
\indent Minimum compatible version: 22 \\
|
||||||
\indent Latest version: 20 \\
|
\indent Latest version: 22 \\
|
||||||
|
|
||||||
|
|
||||||
\begin{enumerate}
|
\begin{enumerate}
|
||||||
@ -647,6 +647,20 @@ Detector Group.
|
|||||||
\item If one does not have the bcp script, that should also be obtained from
|
\item If one does not have the bcp script, that should also be obtained from
|
||||||
the SLS Detector Group. It is required to program the bit files and requires
|
the SLS Detector Group. It is required to program the bit files and requires
|
||||||
that tftp be installed on the pc.
|
that tftp be installed on the pc.
|
||||||
|
\item Bring the detector into programmable mode by either of the following ways.
|
||||||
|
Both ways end up in just the central LED blinking.
|
||||||
|
\begin{enumerate}
|
||||||
|
\item hard reset on the back panel boards resulting in blinking LEDS
|
||||||
|
\item by having the following program running in the background.
|
||||||
|
\begin{verbatim}
|
||||||
|
boot_recovery
|
||||||
|
\end{verbatim}
|
||||||
|
\end{enumerate}
|
||||||
|
\item Start a terminal for each half module and run the following to see
|
||||||
|
progress.
|
||||||
|
\begin{verbatim}
|
||||||
|
nc -p 3000 -u bebxxx 3000
|
||||||
|
\end{verbatim}
|
||||||
\item Run the following to update firmware
|
\item Run the following to update firmware
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
#update back end fpga
|
#update back end fpga
|
||||||
@ -715,9 +729,9 @@ detector board the programming files and/or software package provided by
|
|||||||
the SLS Detectors group.
|
the SLS Detectors group.
|
||||||
|
|
||||||
\subsubsection{JUNGFRAU Firmware}
|
\subsubsection{JUNGFRAU Firmware}
|
||||||
\textit{For SLS Detector Package v3.1.0} \\
|
\textit{For SLS Detector Package v4.0.0} \\
|
||||||
\indent Minimum compatible version: 13.11.2017 \\
|
\indent Minimum compatible version: 15.06.2018 \\
|
||||||
\indent Latest version: 13.11.2017 \\
|
\indent Latest version: 15.06.2018 \\
|
||||||
|
|
||||||
|
|
||||||
At times, one has to update the firmware, which then also requires updating the
|
At times, one has to update the firmware, which then also requires updating the
|
||||||
@ -733,7 +747,7 @@ Detector Group.
|
|||||||
\item Update the latest SLS Detector package installed.
|
\item Update the latest SLS Detector package installed.
|
||||||
\item Update the on-board software as per the instructions in the next
|
\item Update the on-board software as per the instructions in the next
|
||||||
section.
|
section.
|
||||||
\item Start the on-board server in debug mode:
|
\item Start the on-board server in update mode:
|
||||||
\begin{enumerate}
|
\begin{enumerate}
|
||||||
\item Connect to the blackfin on the detector\\
|
\item Connect to the blackfin on the detector\\
|
||||||
\verb=telnet bchipxxx=
|
\verb=telnet bchipxxx=
|
||||||
@ -743,10 +757,10 @@ section.
|
|||||||
\item Comment out the line
|
\item Comment out the line
|
||||||
\verb=#ttyS0::respawn:/jungfrauDetectorServervxxx=
|
\verb=#ttyS0::respawn:/jungfrauDetectorServervxxx=
|
||||||
\item Reboot blackfin using \verb=reboot=
|
\item Reboot blackfin using \verb=reboot=
|
||||||
\item Run \verb=ps= to ensure no gotthardDetectorServers are running
|
\item Run \verb=ps= to ensure no jungfrauDetectorServers are running
|
||||||
\end{enumerate}
|
\end{enumerate}
|
||||||
\item Start the server in debug mode using: \\
|
\item Start the server in update mode using: \\
|
||||||
\verb=./jungfrauDetectorServerxxx -debug= \\
|
\verb=./jungfrauDetectorServerxxx -update= \\
|
||||||
Leave this console on to come back to it later.
|
Leave this console on to come back to it later.
|
||||||
\end{enumerate}
|
\end{enumerate}
|
||||||
\item From the command line of the pc, clear shared memory \\
|
\item From the command line of the pc, clear shared memory \\
|
||||||
@ -759,7 +773,7 @@ script in \verb=slsDetectorPackage/cleansharedmemory.sh=
|
|||||||
\verb=./sls_detector_put programfpga xxx.pof=
|
\verb=./sls_detector_put programfpga xxx.pof=
|
||||||
\item Once the programming is done:
|
\item Once the programming is done:
|
||||||
\begin{enumerate}
|
\begin{enumerate}
|
||||||
\item Switch to the console that has the debug server running and kill it
|
\item Switch to the console that has the update server running and kill it
|
||||||
using Ctrl+C and ensure no jungfrauDetectorServers are
|
using Ctrl+C and ensure no jungfrauDetectorServers are
|
||||||
running
|
running
|
||||||
\item Restart the new server to see if it runs with the new firmware \\
|
\item Restart the new server to see if it runs with the new firmware \\
|
||||||
|
15
recipe/build.sh
Normal file
15
recipe/build.sh
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
mkdir build
|
||||||
|
mkdir install
|
||||||
|
cd build
|
||||||
|
cmake .. \
|
||||||
|
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=install \
|
||||||
|
-DUSE_TEXTCLIENT=ON \
|
||||||
|
-DUSE_RECEIVER=ON \
|
||||||
|
-DUSE_GUI=ON \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DUSE_HDF5=OFF\
|
||||||
|
|
||||||
|
|
||||||
|
cmake --build . -- -j10
|
||||||
|
cmake --build . --target install
|
15
recipe/copy_gui.sh
Normal file
15
recipe/copy_gui.sh
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
mkdir $PREFIX/lib
|
||||||
|
mkdir $PREFIX/bin
|
||||||
|
mkdir $PREFIX/include
|
||||||
|
|
||||||
|
#No libs for gui?
|
||||||
|
|
||||||
|
#Binaries
|
||||||
|
cp build/bin/gui_client $PREFIX/bin/.
|
||||||
|
cp build/bin/slsDetectorGui $PREFIX/bin/.
|
||||||
|
|
||||||
|
|
||||||
|
#Which headers do we need for development??
|
||||||
|
|
||||||
|
# cp include/some_lib.h $PREFIX/include/.
|
23
recipe/copy_lib.sh
Normal file
23
recipe/copy_lib.sh
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
mkdir $PREFIX/lib
|
||||||
|
mkdir $PREFIX/bin
|
||||||
|
mkdir $PREFIX/include
|
||||||
|
mkdir $PREFIX/include/slsDetectorPackage
|
||||||
|
|
||||||
|
#Shared and static libraries
|
||||||
|
cp build/bin/libSlsDetector.so $PREFIX/lib/.
|
||||||
|
cp build/bin/libSlsDetector.a $PREFIX/lib/.
|
||||||
|
cp build/bin/libSlsReceiver.so $PREFIX/lib/.
|
||||||
|
cp build/bin/libSlsReceiver.a $PREFIX/lib/.
|
||||||
|
|
||||||
|
#Binaries
|
||||||
|
cp build/bin/sls_detector_acquire $PREFIX/bin/.
|
||||||
|
cp build/bin/sls_detector_get $PREFIX/bin/.
|
||||||
|
cp build/bin/sls_detector_put $PREFIX/bin/.
|
||||||
|
cp build/bin/sls_detector_help $PREFIX/bin/.
|
||||||
|
cp build/bin/slsReceiver $PREFIX/bin/.
|
||||||
|
cp build/bin/slsMultiReceiver $PREFIX/bin/.
|
||||||
|
|
||||||
|
#Which headers do we need for development??
|
||||||
|
cp build/install/include/* $PREFIX/include/slsDetectorPackage/
|
||||||
|
# cp include/some_lib.h $PREFIX/include/.
|
89
recipe/meta.yaml
Normal file
89
recipe/meta.yaml
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
|
||||||
|
package:
|
||||||
|
name: sls_detector_software
|
||||||
|
version: "developer"
|
||||||
|
|
||||||
|
source:
|
||||||
|
- path: ..
|
||||||
|
|
||||||
|
build:
|
||||||
|
number: 0
|
||||||
|
rpaths:
|
||||||
|
- lib/
|
||||||
|
|
||||||
|
requirements:
|
||||||
|
build:
|
||||||
|
- {{ compiler('c') }}
|
||||||
|
- {{compiler('cxx')}}
|
||||||
|
- cmake
|
||||||
|
- qwt 6.*
|
||||||
|
- qt=4.8.7=7
|
||||||
|
- zeromq=4.2.5=hfc679d8_5
|
||||||
|
- pyzmq
|
||||||
|
- xorg-libx11
|
||||||
|
- xorg-libice
|
||||||
|
- xorg-libxext
|
||||||
|
- xorg-libsm
|
||||||
|
- xorg-libxau
|
||||||
|
- xorg-libxrender
|
||||||
|
- xorg-libxfixes
|
||||||
|
- {{ cdt('mesa-libgl-devel') }} # [linux]
|
||||||
|
- {{ cdt('mesa-libegl-devel') }} # [linux]
|
||||||
|
- {{ cdt('mesa-dri-drivers') }} # [linux]
|
||||||
|
- {{ cdt('libselinux') }} # [linux]
|
||||||
|
- {{ cdt('libxdamage') }} # [linux]
|
||||||
|
- {{ cdt('libxxf86vm') }} # [linux]
|
||||||
|
|
||||||
|
host:
|
||||||
|
- libstdcxx-ng
|
||||||
|
- libgcc-ng
|
||||||
|
- libpng >=1.6.32,<1.6.35
|
||||||
|
- xorg-libx11
|
||||||
|
- xorg-libice
|
||||||
|
- xorg-libxext
|
||||||
|
- xorg-libsm
|
||||||
|
- xorg-libxau
|
||||||
|
- xorg-libxrender
|
||||||
|
- xorg-libxfixes
|
||||||
|
|
||||||
|
run:
|
||||||
|
- libstdcxx-ng
|
||||||
|
- libgcc-ng
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
- name: sls_detector_lib
|
||||||
|
version: "developer"
|
||||||
|
script: copy_lib.sh
|
||||||
|
requirements:
|
||||||
|
build:
|
||||||
|
- {{ compiler('c') }}
|
||||||
|
- {{compiler('cxx')}}
|
||||||
|
- name: sls_detector_gui
|
||||||
|
version: "developer"
|
||||||
|
script: copy_gui.sh
|
||||||
|
requirements:
|
||||||
|
build:
|
||||||
|
- {{ compiler('c') }}
|
||||||
|
- {{compiler('cxx')}}
|
||||||
|
- cmake
|
||||||
|
- qwt 6.*
|
||||||
|
- qt=4.8.7=7
|
||||||
|
- zeromq=4.2.5=hfc679d8_5
|
||||||
|
- pyzmq
|
||||||
|
- xorg-libx11
|
||||||
|
- xorg-libice
|
||||||
|
- xorg-libxext
|
||||||
|
- xorg-libsm
|
||||||
|
- xorg-libxau
|
||||||
|
- xorg-libxrender
|
||||||
|
- xorg-libxfixes
|
||||||
|
- {{ cdt('mesa-libgl-devel') }} # [linux]
|
||||||
|
- {{ cdt('mesa-libegl-devel') }} # [linux]
|
||||||
|
- {{ cdt('mesa-dri-drivers') }} # [linux]
|
||||||
|
- {{ cdt('libselinux') }} # [linux]
|
||||||
|
- {{ cdt('libxdamage') }} # [linux]
|
||||||
|
- {{ cdt('libxxf86vm') }} # [linux]
|
||||||
|
run:
|
||||||
|
- sls_detector_lib=developer
|
||||||
|
- qwt 6.*
|
||||||
|
- qt=4.8.7=7
|
@ -1 +0,0 @@
|
|||||||
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualMaster
|
|
@ -1 +0,0 @@
|
|||||||
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualSlave
|
|
@ -1 +0,0 @@
|
|||||||
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.1.0.16.1
|
|
@ -1 +0,0 @@
|
|||||||
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.1.0.21.0
|
|
1
serverBin/eigerDetectorServerv4.0.0.22.0
Symbolic link
1
serverBin/eigerDetectorServerv4.0.0.22.0
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv4.0.0.22.0
|
@ -1 +0,0 @@
|
|||||||
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServer_virtual
|
|
@ -1 +0,0 @@
|
|||||||
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.1.0.1
|
|
1
serverBin/gotthardDetectorServerv4.0.0.3
Symbolic link
1
serverBin/gotthardDetectorServerv4.0.0.3
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv4.0.0.3
|
@ -1 +0,0 @@
|
|||||||
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_virtual
|
|
@ -1 +0,0 @@
|
|||||||
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.12
|
|
@ -1 +0,0 @@
|
|||||||
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.1.0.2
|
|
1
serverBin/jungfrauDetectorServerv4.0.0.0
Symbolic link
1
serverBin/jungfrauDetectorServerv4.0.0.0
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv4.0.0.0
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
Vref 660
|
|
||||||
VcascN 650
|
|
||||||
VcascP 1480
|
|
||||||
Vout 1520
|
|
||||||
Vcasc 1320
|
|
||||||
Vin 1350
|
|
||||||
Vref_comp 350
|
|
||||||
Vib_test 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
Vref 660
|
|
||||||
VcascN 650
|
|
||||||
VcascP 1480
|
|
||||||
Vout 1520
|
|
||||||
Vcasc 1320
|
|
||||||
Vin 1350
|
|
||||||
Vref_comp 350
|
|
||||||
Vib_test 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
Vref 660
|
|
||||||
VcascN 650
|
|
||||||
VcascP 1480
|
|
||||||
Vout 1520
|
|
||||||
Vcasc 1320
|
|
||||||
Vin 1350
|
|
||||||
Vref_comp 350
|
|
||||||
Vib_test 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
Vref 660
|
|
||||||
VcascN 650
|
|
||||||
VcascP 1480
|
|
||||||
Vout 1520
|
|
||||||
Vcasc 1320
|
|
||||||
Vin 1350
|
|
||||||
Vref_comp 350
|
|
||||||
Vib_test 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
Vref 660
|
|
||||||
VcascN 650
|
|
||||||
VcascP 1480
|
|
||||||
Vout 1520
|
|
||||||
Vcasc 1320
|
|
||||||
Vin 1350
|
|
||||||
Vref_comp 350
|
|
||||||
Vib_test 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
VDAC0 1220
|
|
||||||
VDAC1 3000
|
|
||||||
VDAC2 1053
|
|
||||||
VDAC3 1450
|
|
||||||
VDAC4 750
|
|
||||||
VDAC5 1000
|
|
||||||
VDAC6 480
|
|
||||||
VDAC7 420
|
|
@ -1 +0,0 @@
|
|||||||
dynamicgain
|
|
@ -1 +0,0 @@
|
|||||||
dynamicgain
|
|
@ -1 +0,0 @@
|
|||||||
dynamicgain
|
|
@ -1 +0,0 @@
|
|||||||
dynamicgain
|
|
@ -1 +0,0 @@
|
|||||||
dynamicgain
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
VDAC0 660
|
|
||||||
VDAC1 650
|
|
||||||
VDAC2 1480
|
|
||||||
VDAC3 1520
|
|
||||||
VDAC4 1320
|
|
||||||
VDAC5 1350
|
|
||||||
VDAC6 887
|
|
||||||
VDAC7 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
VDAC0 660
|
|
||||||
VDAC1 650
|
|
||||||
VDAC2 1480
|
|
||||||
VDAC3 1520
|
|
||||||
VDAC4 1320
|
|
||||||
VDAC5 1350
|
|
||||||
VDAC6 887
|
|
||||||
VDAC7 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
VDAC0 660
|
|
||||||
VDAC1 650
|
|
||||||
VDAC2 1480
|
|
||||||
VDAC3 1520
|
|
||||||
VDAC4 1320
|
|
||||||
VDAC5 1350
|
|
||||||
VDAC6 887
|
|
||||||
VDAC7 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
VDAC0 660
|
|
||||||
VDAC1 650
|
|
||||||
VDAC2 1480
|
|
||||||
VDAC3 1520
|
|
||||||
VDAC4 1320
|
|
||||||
VDAC5 1350
|
|
||||||
VDAC6 887
|
|
||||||
VDAC7 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
VDAC0 660
|
|
||||||
VDAC1 650
|
|
||||||
VDAC2 1480
|
|
||||||
VDAC3 1520
|
|
||||||
VDAC4 1320
|
|
||||||
VDAC5 1350
|
|
||||||
VDAC6 887
|
|
||||||
VDAC7 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
Vref 660
|
|
||||||
VcascN 650
|
|
||||||
VcascP 1480
|
|
||||||
Vout 1520
|
|
||||||
Vcasc 1320
|
|
||||||
Vin 1350
|
|
||||||
Vref_comp 887
|
|
||||||
Vib_test 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
Vref 660
|
|
||||||
VcascN 650
|
|
||||||
VcascP 1480
|
|
||||||
Vout 1520
|
|
||||||
Vcasc 1320
|
|
||||||
Vin 1350
|
|
||||||
Vref_comp 887
|
|
||||||
Vib_test 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
Vref 660
|
|
||||||
VcascN 650
|
|
||||||
VcascP 1480
|
|
||||||
Vout 1520
|
|
||||||
Vcasc 1320
|
|
||||||
Vin 1350
|
|
||||||
Vref_comp 887
|
|
||||||
Vib_test 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
Vref 660
|
|
||||||
VcascN 650
|
|
||||||
VcascP 1480
|
|
||||||
Vout 1520
|
|
||||||
Vcasc 1320
|
|
||||||
Vin 1350
|
|
||||||
Vref_comp 887
|
|
||||||
Vib_test 2001
|
|
@ -1 +0,0 @@
|
|||||||
227 5.6
|
|
@ -1,8 +0,0 @@
|
|||||||
Vref 660
|
|
||||||
VcascN 650
|
|
||||||
VcascP 1480
|
|
||||||
Vout 1520
|
|
||||||
Vcasc 1320
|
|
||||||
Vin 1350
|
|
||||||
Vref_comp 887
|
|
||||||
Vib_test 2001
|
|
45
slsDetectorCalibration/Stat.h
Normal file
45
slsDetectorCalibration/Stat.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
class Stat
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
Stat() : n(0), m(0.), m2(0.) {}
|
||||||
|
|
||||||
|
void Clear()
|
||||||
|
{
|
||||||
|
n = 0;
|
||||||
|
m=0;
|
||||||
|
m2=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Push(double x)
|
||||||
|
{
|
||||||
|
|
||||||
|
m+=x;
|
||||||
|
m2+=x*x;
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
|
||||||
|
int NumDataValues() const
|
||||||
|
{
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
double Mean() const
|
||||||
|
{
|
||||||
|
return (n > 0) ? m/n : 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
double Variance() const
|
||||||
|
{
|
||||||
|
return ( (n >0 ) ? (m2/n-m*m/(n*n)) : 0.0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
double StandardDeviation() const
|
||||||
|
{
|
||||||
|
return sqrt( Variance() );
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
int n;
|
||||||
|
double m, m2;
|
||||||
|
};
|
@ -8,8 +8,20 @@
|
|||||||
#include "pedestalSubtraction.h"
|
#include "pedestalSubtraction.h"
|
||||||
#include "commonModeSubtraction.h"
|
#include "commonModeSubtraction.h"
|
||||||
#include "tiffIO.h"
|
#include "tiffIO.h"
|
||||||
|
#include "slsInterpolation.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
#include <TPaveText.h>
|
||||||
|
#include <TLegend.h>
|
||||||
|
#include <TF1.h>
|
||||||
|
#include <TGraphErrors.h>
|
||||||
|
#include <TH2F.h>
|
||||||
|
#include <TASImage.h>
|
||||||
|
#include <TImage.h>
|
||||||
|
#include <TFile.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#ifndef FRAMEMODE_DEF
|
#ifndef FRAMEMODE_DEF
|
||||||
@ -18,6 +30,10 @@ using namespace std;
|
|||||||
enum to define the flags of the data set, which are needed to seect the type of processing it should undergo: frame, pedestal, flat
|
enum to define the flags of the data set, which are needed to seect the type of processing it should undergo: frame, pedestal, flat
|
||||||
*/
|
*/
|
||||||
enum frameMode { eFrame, ePedestal, eFlat };
|
enum frameMode { eFrame, ePedestal, eFlat };
|
||||||
|
/**
|
||||||
|
enum to define the detector mode
|
||||||
|
*/
|
||||||
|
enum detectorMode { eAnalog, ePhotonCounting, eInterpolating };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -65,12 +81,30 @@ template <class dataType> class analogDetector {
|
|||||||
fMode=ePedestal;
|
fMode=ePedestal;
|
||||||
thr=0;
|
thr=0;
|
||||||
myFile=NULL;
|
myFile=NULL;
|
||||||
fm=new pthread_mutex_t ;
|
#ifdef ROOTSPECTRUM
|
||||||
|
hs=new TH2F("hs","hs",2000,-100,10000,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
#ifdef ROOTCLUST
|
||||||
|
hs3=new TH2F("hs3","hs3",2000,-100,3*3*10000,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
hs5=new TH2F("hs5","hs5",2000,-100,5*5*10000,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
hs7=new TH2F("hs7","hs7",2000,-100,7*7*10000,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
hs9=new TH2F("hs9","hs9",2000,-100,9*9*10000,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
destructor. Deletes the pdestalSubtraction array and the image
|
destructor. Deletes the pdestalSubtraction array and the image
|
||||||
*/
|
*/
|
||||||
virtual ~analogDetector() {for (int i=0; i<ny; i++) delete [] stat[i]; delete [] stat; delete [] image;};
|
virtual ~analogDetector() {for (int i=0; i<ny; i++) delete [] stat[i]; delete [] stat; delete [] image;
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
delete hs;
|
||||||
|
#ifdef ROOTCLUST
|
||||||
|
delete hs3;
|
||||||
|
delete hs5;
|
||||||
|
delete hs7;
|
||||||
|
delete hs9;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
constructor cloning another analog detector
|
constructor cloning another analog detector
|
||||||
@ -94,7 +128,6 @@ template <class dataType> class analogDetector {
|
|||||||
// nSigma=orig->nSigma;
|
// nSigma=orig->nSigma;
|
||||||
fMode=orig->fMode;
|
fMode=orig->fMode;
|
||||||
myFile=orig->myFile;
|
myFile=orig->myFile;
|
||||||
fm=orig->fm;
|
|
||||||
|
|
||||||
|
|
||||||
stat=new pedestalSubtraction*[ny];
|
stat=new pedestalSubtraction*[ny];
|
||||||
@ -111,6 +144,15 @@ template <class dataType> class analogDetector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
image=new int[nx*ny];
|
image=new int[nx*ny];
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
hs=(TH2F*)(orig->hs)->Clone();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
#ifdef ROOTCLUST
|
||||||
|
hs3=(TH2F*)(orig->hs3)->Clone();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
hs5=(TH2F*)(orig->hs5)->Clone();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
hs7=(TH2F*)(orig->hs7)->Clone();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
hs9=(TH2F*)(orig->hs9)->Clone();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,8 +221,8 @@ template <class dataType> class analogDetector {
|
|||||||
if (gm) {
|
if (gm) {
|
||||||
if (gmap) delete [] gmap;
|
if (gmap) delete [] gmap;
|
||||||
gmap=new double[nnx*nny];
|
gmap=new double[nnx*nny];
|
||||||
for (int ix=0; ix<nnx; ix++) {
|
|
||||||
for (int iy=0; iy<nny; iy++) {
|
for (int iy=0; iy<nny; iy++) {
|
||||||
|
for (int ix=0; ix<nnx; ix++) {
|
||||||
gmap[iy*nnx+ix]=gm[iy*nnx+ix];
|
gmap[iy*nnx+ix]=gm[iy*nnx+ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -198,8 +240,8 @@ template <class dataType> class analogDetector {
|
|||||||
void *ret;
|
void *ret;
|
||||||
if (gmap) {
|
if (gmap) {
|
||||||
gm=new float[nx*ny];
|
gm=new float[nx*ny];
|
||||||
for (int ix=0; ix<nx; ix++) {
|
|
||||||
for (int iy=0; iy<ny; iy++) {
|
for (int iy=0; iy<ny; iy++) {
|
||||||
|
for (int ix=0; ix<nx; ix++) {
|
||||||
gm[iy*nx+ix]=gmap[iy*nx+ix];
|
gm[iy*nx+ix]=gmap[iy*nx+ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -220,6 +262,15 @@ template <class dataType> class analogDetector {
|
|||||||
image[iy*nx+ix]=0;
|
image[iy*nx+ix]=0;
|
||||||
}
|
}
|
||||||
if (cmSub) cmSub->Clear();
|
if (cmSub) cmSub->Clear();
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
hs->Reset();
|
||||||
|
#ifdef ROOTCLUST
|
||||||
|
hs3->Reset();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
hs5->Reset();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
hs7->Reset();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
hs9->Reset();//new TH2F("hs","hs",(orig->hs)-getNbins,-500,9500,nx*ny,-0.5,nx*ny-0.5);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/** resets the commonModeSubtraction and increases the frame index */
|
/** resets the commonModeSubtraction and increases the frame index */
|
||||||
@ -253,16 +304,46 @@ template <class dataType> class analogDetector {
|
|||||||
\param iy pixel y coordinate
|
\param iy pixel y coordinate
|
||||||
\param cm 1 adds the value to common mod, 0 skips it. Defaults to 0. - not properly implemented
|
\param cm 1 adds the value to common mod, 0 skips it. Defaults to 0. - not properly implemented
|
||||||
*/
|
*/
|
||||||
virtual void addToPedestal(double val, int ix, int iy=0){
|
virtual void addToPedestal(double val, int ix, int iy=0, int cm=0){
|
||||||
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
|
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
|
||||||
|
if (cmSub && cm>0) {
|
||||||
|
val-= getCommonMode(ix, iy);
|
||||||
|
}
|
||||||
stat[iy][ix].addToPedestal(val);
|
stat[iy][ix].addToPedestal(val);
|
||||||
if (cmSub) {
|
/* if (cmSub && cm>0) { */
|
||||||
if (det) if (det->isGood(ix, iy)==0) return;
|
/* if (det) if (det->isGood(ix, iy)==0) return; */
|
||||||
cmSub->addToCommonMode(val, ix, iy);
|
/* cmSub->addToCommonMode(val, ix, iy); */
|
||||||
};
|
/* }; */
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double getCommonMode(int ix, int iy) {
|
||||||
|
if (cmSub) return cmSub->getCommonMode(ix, iy);
|
||||||
|
else return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
virtual void addToCommonMode(char *data){
|
||||||
|
if (cmSub) {
|
||||||
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
|
for (int ix=xmin; ix<xmax; ix++) {
|
||||||
|
// if (getNumpedestals(ix,iy)>0)
|
||||||
|
if (det->isGood(ix,iy))
|
||||||
|
addToCommonMode(data, ix, iy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//cout << "cm " << getCommonMode(0,0) << " " << getCommonMode(1,0) << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
virtual void addToCommonMode(char *data, int ix, int iy=0){
|
||||||
|
if (cmSub) {
|
||||||
|
if (det) if (det->isGood(ix, iy)==0) return;
|
||||||
|
if (getNumpedestals(ix,iy)>0){
|
||||||
|
cmSub->addToCommonMode(subtractPedestal(data,ix,iy,0), ix, iy);
|
||||||
|
// cout << ix << " " <<subtractPedestal(data,ix,iy,0) << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
gets pedestal (and common mode)
|
gets pedestal (and common mode)
|
||||||
\param ix pixel x coordinate
|
\param ix pixel x coordinate
|
||||||
@ -270,7 +351,14 @@ template <class dataType> class analogDetector {
|
|||||||
\param cm 0 (default) without common mode subtraction, 1 with common mode subtraction (if defined)
|
\param cm 0 (default) without common mode subtraction, 1 with common mode subtraction (if defined)
|
||||||
\returns pedestal value
|
\returns pedestal value
|
||||||
*/
|
*/
|
||||||
virtual double getPedestal(int ix, int iy, int cm=0){if (ix>=0 && ix<nx && iy>=0 && iy<ny) if (cmSub && cm>0) return stat[iy][ix].getPedestal()-cmSub->getCommonMode(); else return stat[iy][ix].getPedestal(); else return -1;};
|
virtual double getPedestal(int ix, int iy, int cm=0){
|
||||||
|
if (ix>=0 && ix<nx && iy>=0 && iy<ny)
|
||||||
|
if (cmSub && cm>0)
|
||||||
|
return stat[iy][ix].getPedestal()+getCommonMode(ix,iy);
|
||||||
|
else return stat[iy][ix].getPedestal();
|
||||||
|
else return -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
gets pedestal rms (i.e. noise)
|
gets pedestal rms (i.e. noise)
|
||||||
@ -278,9 +366,17 @@ template <class dataType> class analogDetector {
|
|||||||
\param iy pixel y coordinate
|
\param iy pixel y coordinate
|
||||||
\returns pedestal rms
|
\returns pedestal rms
|
||||||
*/
|
*/
|
||||||
virtual double getPedestalRMS(int ix, int iy){if (ix>=0 && ix<nx && iy>=0 && iy<ny) return stat[iy][ix].getPedestalRMS();else return -1;};
|
virtual double getPedestalRMS(int ix, int iy){
|
||||||
|
if (ix>=0 && ix<nx && iy>=0 && iy<ny)
|
||||||
|
return stat[iy][ix].getPedestalRMS();
|
||||||
|
else return -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual int getNumpedestals(int ix, int iy){
|
||||||
|
if (ix>=0 && ix<nx && iy>=0 && iy<ny)
|
||||||
|
return stat[iy][ix].getNumpedestals();
|
||||||
|
else return -1;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
gets pedestal (and common mode)
|
gets pedestal (and common mode)
|
||||||
\param ix pixel x coordinate
|
\param ix pixel x coordinate
|
||||||
@ -291,9 +387,10 @@ template <class dataType> class analogDetector {
|
|||||||
virtual double* getPedestal(double *ped){
|
virtual double* getPedestal(double *ped){
|
||||||
if (ped==NULL)
|
if (ped==NULL)
|
||||||
ped=new double[nx*ny];
|
ped=new double[nx*ny];
|
||||||
for (int ix=0; ix<nx; ix++) {
|
|
||||||
for (int iy=0; iy<ny; iy++) {
|
for (int iy=0; iy<ny; iy++) {
|
||||||
|
for (int ix=0; ix<nx; ix++) {
|
||||||
ped[iy*nx+ix]=stat[iy][ix].getPedestal();
|
ped[iy*nx+ix]=stat[iy][ix].getPedestal();
|
||||||
|
//cout << ped[iy*nx+ix] << " " ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ped;
|
return ped;
|
||||||
@ -308,8 +405,8 @@ template <class dataType> class analogDetector {
|
|||||||
virtual double* getPedestalRMS(double *ped=NULL){
|
virtual double* getPedestalRMS(double *ped=NULL){
|
||||||
if (ped==NULL)
|
if (ped==NULL)
|
||||||
ped=new double[nx*ny];
|
ped=new double[nx*ny];
|
||||||
for (int ix=0; ix<nx; ix++) {
|
|
||||||
for (int iy=0; iy<ny; iy++) {
|
for (int iy=0; iy<ny; iy++) {
|
||||||
|
for (int ix=0; ix<nx; ix++) {
|
||||||
ped[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
|
ped[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -328,7 +425,6 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
sets pedestal
|
sets pedestal
|
||||||
\param ix pixel x coordinate
|
\param ix pixel x coordinate
|
||||||
@ -349,8 +445,8 @@ template <class dataType> class analogDetector {
|
|||||||
*/
|
*/
|
||||||
virtual void setPedestal(double *ped, double *rms=NULL, int m=-1){
|
virtual void setPedestal(double *ped, double *rms=NULL, int m=-1){
|
||||||
double rr=0;
|
double rr=0;
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
|
for (int ix=xmin; ix<xmax; ix++) {
|
||||||
if (rms) rr=rms[iy*nx+ix];
|
if (rms) rr=rms[iy*nx+ix];
|
||||||
stat[iy][ix].setPedestal(ped[iy*nx+ix],rr, m);
|
stat[iy][ix].setPedestal(ped[iy*nx+ix],rr, m);
|
||||||
};
|
};
|
||||||
@ -378,8 +474,8 @@ template <class dataType> class analogDetector {
|
|||||||
\param rms pointer to array of pedestal rms
|
\param rms pointer to array of pedestal rms
|
||||||
*/
|
*/
|
||||||
virtual void setPedestalRMS(double *rms){
|
virtual void setPedestalRMS(double *rms){
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
|
for (int ix=xmin; ix<xmax; ix++) {
|
||||||
stat[iy][ix].setPedestalRMS(rms[iy*nx+ix]);
|
stat[iy][ix].setPedestalRMS(rms[iy*nx+ix]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -396,17 +492,45 @@ template <class dataType> class analogDetector {
|
|||||||
virtual void *writeImage(const char * imgname) {
|
virtual void *writeImage(const char * imgname) {
|
||||||
float *gm=NULL;
|
float *gm=NULL;
|
||||||
void *ret;
|
void *ret;
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
|
||||||
|
TH2F *hmap=new TH2F("hmap","hmap",nx, -0.5,nx-0.5, ny, -0.5, ny-0.5);
|
||||||
|
|
||||||
|
#endif
|
||||||
gm=new float[nx*ny];
|
gm=new float[nx*ny];
|
||||||
for (int ix=0; ix<nx; ix++) {
|
|
||||||
for (int iy=0; iy<ny; iy++) {
|
for (int iy=0; iy<ny; iy++) {
|
||||||
|
for (int ix=0; ix<nx; ix++) {
|
||||||
gm[iy*nx+ix]=image[iy*nx+ix];
|
gm[iy*nx+ix]=image[iy*nx+ix];
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
hmap->SetBinContent(ix+1, iy+1,image[iy*nx+ix]);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret=WriteToTiff(gm, imgname, ny, nx);
|
ret=WriteToTiff(gm, imgname, ny, nx);
|
||||||
delete [] gm;
|
delete [] gm;
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
char rootfn[10000];
|
||||||
|
sprintf(rootfn,"%s.root",imgname);
|
||||||
|
TFile *f=new TFile(rootfn,"RECREATE");
|
||||||
|
hs->Write("hs");
|
||||||
|
#ifdef ROOTCLUST
|
||||||
|
hs3->Write("hs3");
|
||||||
|
hs5->Write("hs5");
|
||||||
|
hs7->Write("hs7");
|
||||||
|
hs9->Write("hs9");
|
||||||
|
#endif
|
||||||
|
hmap->Write("hmap");
|
||||||
|
|
||||||
|
|
||||||
|
f->Close();
|
||||||
|
delete f;
|
||||||
|
delete hmap;
|
||||||
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
TH2F *getSpectrum(){return hs;};
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
write 32bit tiff file containing the pedestals
|
write 32bit tiff file containing the pedestals
|
||||||
\param imgname file name to be written
|
\param imgname file name to be written
|
||||||
@ -417,16 +541,41 @@ template <class dataType> class analogDetector {
|
|||||||
float *gm=NULL;
|
float *gm=NULL;
|
||||||
void *ret;
|
void *ret;
|
||||||
gm=new float[nx*ny];
|
gm=new float[nx*ny];
|
||||||
for (int ix=0; ix<nx; ix++) {
|
#ifdef ROOTSPECTRUM
|
||||||
|
|
||||||
|
TH2F *hmap=new TH2F("hmap","hmap",nx, -0.5,nx-0.5, ny, -0.5, ny-0.5);
|
||||||
|
|
||||||
|
#endif
|
||||||
for (int iy=0; iy<ny; iy++) {
|
for (int iy=0; iy<ny; iy++) {
|
||||||
if (cmSub)
|
for (int ix=0; ix<nx; ix++) {
|
||||||
gm[iy*nx+ix]=stat[iy][ix].getPedestal()-cmSub->getCommonMode();
|
/* if (cmSub) */
|
||||||
else
|
/* gm[iy*nx+ix]=stat[iy][ix].getPedestal()-cmSub->getCommonMode(); */
|
||||||
|
/* else */
|
||||||
gm[iy*nx+ix]=stat[iy][ix].getPedestal();
|
gm[iy*nx+ix]=stat[iy][ix].getPedestal();
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
hmap->SetBinContent(ix+1, iy+1,gm[iy*nx+ix]);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret=WriteToTiff(gm, imgname, ny, nx);
|
ret=WriteToTiff(gm, imgname, ny, nx);
|
||||||
delete [] gm;
|
delete [] gm;
|
||||||
|
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
char rootfn[10000];
|
||||||
|
sprintf(rootfn,"%s.root",imgname);
|
||||||
|
TFile *f=new TFile(rootfn,"RECREATE");
|
||||||
|
hs->Write("hs");
|
||||||
|
#ifdef ROOTCLUST
|
||||||
|
hs3->Write("hs3");
|
||||||
|
hs5->Write("hs5");
|
||||||
|
hs7->Write("hs7");
|
||||||
|
hs9->Write("hs9");
|
||||||
|
#endif
|
||||||
|
hmap->Write("hmap");
|
||||||
|
f->Close();
|
||||||
|
delete f;
|
||||||
|
delete hmap;
|
||||||
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -444,8 +593,8 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
|
|
||||||
if (gm) {
|
if (gm) {
|
||||||
for (int ix=0; ix<nnx; ix++) {
|
|
||||||
for (int iy=0; iy<nny; iy++) {
|
for (int iy=0; iy<nny; iy++) {
|
||||||
|
for (int ix=0; ix<nnx; ix++) {
|
||||||
stat[iy][ix].setPedestal(gm[iy*nx+ix],-1,-1);
|
stat[iy][ix].setPedestal(gm[iy*nx+ix],-1,-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -469,8 +618,8 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
|
|
||||||
if (gm) {
|
if (gm) {
|
||||||
for (int ix=0; ix<nnx; ix++) {
|
|
||||||
for (int iy=0; iy<nny; iy++) {
|
for (int iy=0; iy<nny; iy++) {
|
||||||
|
for (int ix=0; ix<nnx; ix++) {
|
||||||
image[iy*nx+ix]=gm[iy*nx+ix];
|
image[iy*nx+ix]=gm[iy*nx+ix];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -495,8 +644,8 @@ template <class dataType> class analogDetector {
|
|||||||
float *gm=NULL;
|
float *gm=NULL;
|
||||||
void *ret;
|
void *ret;
|
||||||
gm=new float[nx*ny];
|
gm=new float[nx*ny];
|
||||||
for (int ix=0; ix<nx; ix++) {
|
|
||||||
for (int iy=0; iy<ny; iy++) {
|
for (int iy=0; iy<ny; iy++) {
|
||||||
|
for (int ix=0; ix<nx; ix++) {
|
||||||
gm[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
|
gm[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -517,8 +666,8 @@ template <class dataType> class analogDetector {
|
|||||||
if (nnx>nx) nnx=nx;
|
if (nnx>nx) nnx=nx;
|
||||||
if (nny>ny) nny=ny;
|
if (nny>ny) nny=ny;
|
||||||
if (gm) {
|
if (gm) {
|
||||||
for (int ix=0; ix<nnx; ix++) {
|
|
||||||
for (int iy=0; iy<nny; iy++) {
|
for (int iy=0; iy<nny; iy++) {
|
||||||
|
for (int ix=0; ix<nnx; ix++) {
|
||||||
stat[iy][ix].setPedestalRMS(gm[iy*nx+ix]);
|
stat[iy][ix].setPedestalRMS(gm[iy*nx+ix]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -538,18 +687,28 @@ template <class dataType> class analogDetector {
|
|||||||
\param data pointer to the data
|
\param data pointer to the data
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual void addToPedestal(char *data) {
|
|
||||||
|
|
||||||
|
virtual void addToPedestal(char *data, int cm=0) {
|
||||||
|
|
||||||
|
// cout << "add to pedestal " << endl;
|
||||||
newFrame();
|
newFrame();
|
||||||
|
|
||||||
|
if (cmSub) {
|
||||||
|
addToCommonMode(data);
|
||||||
|
}
|
||||||
|
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
//cout << xmin << " " << xmax << endl;
|
||||||
|
// cout << ymin << " " << ymax << endl;
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
|
for (int ix=xmin; ix<xmax; ix++) {
|
||||||
|
if (det->isGood(ix,iy)) {
|
||||||
addToPedestal(data,ix,iy);
|
addToPedestal(data,ix,iy,1);
|
||||||
|
//if (ix==10 && iy==10)
|
||||||
|
// cout <<ix << " " << iy << " " << getPedestal(ix,iy)<< endl;
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
subtractPedestal(data,ix,iy,cm);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -559,6 +718,7 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets region of interest in which data should be processed
|
Sets region of interest in which data should be processed
|
||||||
\param xmi minimum x. if -1 or out of range remains unchanged
|
\param xmi minimum x. if -1 or out of range remains unchanged
|
||||||
@ -585,6 +745,20 @@ template <class dataType> class analogDetector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
delete hs;
|
||||||
|
hs=new TH2F("hs","hs",2000,-100,10000,(xmax-xmin)*(ymax-ymin),-0.5,(xmax-xmin)*(ymax-ymin)-0.5);
|
||||||
|
#ifdef ROOTCLUST
|
||||||
|
delete hs3;
|
||||||
|
hs3=new TH2F("hs3","hs3",2000,-100,3*3*10000,(xmax-xmin)*(ymax-ymin),-0.5,(xmax-xmin)*(ymax-ymin)-0.5);
|
||||||
|
delete hs5;
|
||||||
|
hs5=new TH2F("hs5","hs5",2000,-100,5*5*10000,(xmax-xmin)*(ymax-ymin),-0.5,(xmax-xmin)*(ymax-ymin)-0.5);
|
||||||
|
delete hs7;
|
||||||
|
hs7=new TH2F("hs7","hs7",2000,-100,7*7*10000,(xmax-xmin)*(ymax-ymin),-0.5,(xmax-xmin)*(ymax-ymin)-0.5);
|
||||||
|
delete hs9;
|
||||||
|
hs9=new TH2F("hs9","hs9",2000,-100,9*9*10000,(xmax-xmin)*(ymax-ymin),-0.5,(xmax-xmin)*(ymax-ymin)-0.5);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
@ -608,7 +782,7 @@ template <class dataType> class analogDetector {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
virtual void addToPedestal(char *data, int ix, int iy=0) {
|
virtual void addToPedestal(char *data, int ix, int iy=0, int cm=0) {
|
||||||
|
|
||||||
|
|
||||||
double val;
|
double val;
|
||||||
@ -619,7 +793,15 @@ template <class dataType> class analogDetector {
|
|||||||
else
|
else
|
||||||
val=((double*)data)[iy*nx+ix];
|
val=((double*)data)[iy*nx+ix];
|
||||||
|
|
||||||
|
/* if (ix==10 && iy==10) */
|
||||||
|
/* cout << ix << " " << iy << " " << val ; */
|
||||||
|
/* if (ix==100 && iy==100) */
|
||||||
|
/* cout << ix << " " << iy << " " << val; */
|
||||||
addToPedestal(val,ix,iy);
|
addToPedestal(val,ix,iy);
|
||||||
|
/* if (ix==10 && iy==10) */
|
||||||
|
/* cout <<" " << getPedestal(ix,iy)<< endl; */
|
||||||
|
/* if (ix==100 && iy==100) */
|
||||||
|
/* cout << " " << getPedestal(ix,iy)<< endl; */
|
||||||
}
|
}
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
@ -632,18 +814,19 @@ template <class dataType> class analogDetector {
|
|||||||
\param val pointer where the pedestal subtracted data should be added. If NULL, the internal image is used
|
\param val pointer where the pedestal subtracted data should be added. If NULL, the internal image is used
|
||||||
\returns pointer to the pedestal subtracted data
|
\returns pointer to the pedestal subtracted data
|
||||||
*/
|
*/
|
||||||
|
// virtual int *subtractPedestal(char *data, int *val=NULL) {
|
||||||
|
|
||||||
|
virtual int *subtractPedestal(char *data, int *val=NULL, int cm=0) {
|
||||||
virtual double *subtractPedestal(char *data, double *val=NULL) {
|
|
||||||
|
|
||||||
newFrame();
|
newFrame();
|
||||||
|
|
||||||
if (val==NULL)
|
if (val==NULL)
|
||||||
val=new double[nx*ny];
|
val=image;//new double[nx*ny];
|
||||||
|
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
val[iy*nx+ix]+=subtractPedestal(data, ix, iy);
|
for (int ix=xmin; ix<xmax; ix++) {
|
||||||
|
if (det->isGood(ix,iy))
|
||||||
|
val[iy*nx+ix]+=subtractPedestal(data, ix, iy,cm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
@ -662,8 +845,9 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual double subtractPedestal(char *data, int ix, int iy=0) {
|
virtual double subtractPedestal(char *data, int ix, int iy=0, int cm=0) {
|
||||||
double g=1.;
|
double g=1.;
|
||||||
|
double val;
|
||||||
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
|
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
|
||||||
if (gmap) {
|
if (gmap) {
|
||||||
g=gmap[iy*nx+ix];
|
g=gmap[iy*nx+ix];
|
||||||
@ -671,9 +855,40 @@ template <class dataType> class analogDetector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (det)
|
if (det)
|
||||||
return (dataSign*det->getValue(data, ix, iy)-getPedestal(ix,iy))/g;
|
val= (dataSign*det->getValue(data, ix, iy)-getPedestal(ix,iy,cm))/g;
|
||||||
else
|
else
|
||||||
return (((double*)data)[iy*nx+ix]-getPedestal(ix,iy))/g;
|
val= (((double*)data)[iy*nx+ix]-getPedestal(ix,iy))/g;
|
||||||
|
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
hs->Fill(val,(iy-ymin)*(xmax-xmin)+(ix-xmin));
|
||||||
|
#ifdef ROOTCLUST
|
||||||
|
double v3=0,v5=0,v7=0,v9=0;
|
||||||
|
for (int iix=-4; iix<5; iix++)
|
||||||
|
for (int iiy=-4; iiy<5; iiy++) {
|
||||||
|
if (det)
|
||||||
|
val= (dataSign*det->getValue(data, ix+iix, iy+iiy)-getPedestal(ix+iix,iy+iiy,cm))/g;
|
||||||
|
else
|
||||||
|
val= (((double*)data)[(iy+iiy)*nx+ix+iix]-getPedestal(ix+iix,iy+iiy,cm))/g;
|
||||||
|
|
||||||
|
if (iix>-4 && iiy>-4 && iix<4 && iiy<4) {
|
||||||
|
if (iix>-3 && iiy>-3 && iix<3 && iiy<3){
|
||||||
|
if (iix>-2 && iiy>-2 && iix<2 && iiy<2){
|
||||||
|
v3+=val;
|
||||||
|
}
|
||||||
|
v5+=val;
|
||||||
|
}
|
||||||
|
v7+=val;
|
||||||
|
}
|
||||||
|
v9+=val;
|
||||||
|
}
|
||||||
|
hs3->Fill(v3,(iy-ymin)*(xmax-xmin)+(ix-xmin));
|
||||||
|
hs5->Fill(v5,(iy-ymin)*(xmax-xmin)+(ix-xmin));
|
||||||
|
hs7->Fill(v7,(iy-ymin)*(xmax-xmin)+(ix-xmin));
|
||||||
|
hs9->Fill(v9,(iy-ymin)*(xmax-xmin)+(ix-xmin));
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -703,11 +918,19 @@ template <class dataType> class analogDetector {
|
|||||||
double v;
|
double v;
|
||||||
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
|
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
|
||||||
v=subtractPedestal(data,ix,iy);
|
v=subtractPedestal(data,ix,iy);
|
||||||
|
|
||||||
|
/* // cout << v << " " ; */
|
||||||
|
/* #ifdef ROOTSPECTRUM */
|
||||||
|
/* // cout << (iy-ymin)*(xmax-xmin)+(ix-xmin) << endl; */
|
||||||
|
/* hs->Fill(v,(iy-ymin)*(xmax-xmin)+(ix-xmin)); */
|
||||||
|
/* #endif */
|
||||||
if (thr>0) {
|
if (thr>0) {
|
||||||
v+=0.5*thr;
|
v+=0.5*thr;
|
||||||
nph=v/thr;
|
nph=v/thr;
|
||||||
|
if (nph>0)
|
||||||
return nph;
|
return nph;
|
||||||
} else
|
return 0;
|
||||||
|
}
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -725,8 +948,12 @@ template <class dataType> class analogDetector {
|
|||||||
if (nph==NULL)
|
if (nph==NULL)
|
||||||
nph=image;
|
nph=image;
|
||||||
newFrame();
|
newFrame();
|
||||||
for (int ix=xmin; ix<xmax; ix++) {
|
|
||||||
|
addToCommonMode(data);
|
||||||
|
|
||||||
for (int iy=ymin; iy<ymax; iy++) {
|
for (int iy=ymin; iy<ymax; iy++) {
|
||||||
|
for (int ix=xmin; ix<xmax; ix++) {
|
||||||
|
if (det->isGood(ix,iy))
|
||||||
nph[iy*nx+ix]+=getNPhotons(data, ix, iy);
|
nph[iy*nx+ix]+=getNPhotons(data, ix, iy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -739,11 +966,28 @@ template <class dataType> class analogDetector {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
virtual void clearImage(){
|
virtual void clearImage(){
|
||||||
for (int ix=0; ix<nx; ix++) {
|
|
||||||
for (int iy=0; iy<ny; iy++) {
|
for (int iy=0; iy<ny; iy++) {
|
||||||
|
for (int ix=0; ix<nx; ix++) {
|
||||||
image[iy*nx+ix]=0;
|
image[iy*nx+ix]=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
|
//cout << "reset histogram " << endl;
|
||||||
|
if (hs)
|
||||||
|
hs->Reset();
|
||||||
|
#ifdef ROOTCLUST
|
||||||
|
|
||||||
|
if (hs3)
|
||||||
|
hs3->Reset();
|
||||||
|
if (hs5)
|
||||||
|
hs5->Reset();
|
||||||
|
if (hs7)
|
||||||
|
hs7->Reset();
|
||||||
|
if (hs9)
|
||||||
|
hs9->Reset();
|
||||||
|
#endif
|
||||||
|
//cout << "done " << endl;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/** sets/gets number of samples for moving average pedestal calculation
|
/** sets/gets number of samples for moving average pedestal calculation
|
||||||
@ -753,8 +997,8 @@ template <class dataType> class analogDetector {
|
|||||||
int SetNPedestals(int i=-1) {
|
int SetNPedestals(int i=-1) {
|
||||||
int ix=0, iy=0;
|
int ix=0, iy=0;
|
||||||
if (i>0)
|
if (i>0)
|
||||||
for (ix=0; ix<nx; ix++)
|
|
||||||
for (iy=0; iy<ny; iy++)
|
for (iy=0; iy<ny; iy++)
|
||||||
|
for (ix=0; ix<nx; ix++)
|
||||||
stat[iy][ix].SetNPedestals(i);
|
stat[iy][ix].SetNPedestals(i);
|
||||||
return stat[0][0].SetNPedestals();
|
return stat[0][0].SetNPedestals();
|
||||||
};
|
};
|
||||||
@ -786,10 +1030,13 @@ template <class dataType> class analogDetector {
|
|||||||
if (ymi<0) ymi=ymin;
|
if (ymi<0) ymi=ymin;
|
||||||
if (yma<0) yma=ymax;
|
if (yma<0) yma=ymax;
|
||||||
|
|
||||||
for (int ix=xmi; ix<xma; ix++)
|
|
||||||
for (int iy=ymi; iy<yma; iy++)
|
for (int iy=ymi; iy<yma; iy++)
|
||||||
|
for (int ix=xmi; ix<xma; ix++)
|
||||||
|
if (det->isGood(ix,iy)) {
|
||||||
if (ix>=0 && ix<nx && iy>=0 && iy<ny)
|
if (ix>=0 && ix<nx && iy>=0 && iy<ny)
|
||||||
val+=getNPhotons(data, ix, iy);
|
val+=getNPhotons(data, ix, iy);
|
||||||
|
}
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -806,14 +1053,17 @@ template <class dataType> class analogDetector {
|
|||||||
virtual void processData(char *data,int *val=NULL) {
|
virtual void processData(char *data,int *val=NULL) {
|
||||||
switch(fMode) {
|
switch(fMode) {
|
||||||
case ePedestal:
|
case ePedestal:
|
||||||
|
//cout << "analog ped " << endl;
|
||||||
addToPedestal(data);
|
addToPedestal(data);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
getNPhotons(data,val);
|
// cout << "analog " << endl;
|
||||||
|
//subtractPedestal(data);
|
||||||
|
getNPhotons(data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual char *getInterpolation(){return NULL;};
|
// virtual char *getInterpolation(){return NULL;};
|
||||||
|
|
||||||
/** sets the current frame mode for the detector
|
/** sets the current frame mode for the detector
|
||||||
\param f frame mode to be set
|
\param f frame mode to be set
|
||||||
@ -827,17 +1077,57 @@ template <class dataType> class analogDetector {
|
|||||||
*/
|
*/
|
||||||
frameMode getFrameMode() {return fMode;};
|
frameMode getFrameMode() {return fMode;};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//enum detectorMode { eAnalog, ePhotonCounting, eInterpolating };
|
||||||
|
/** sets the current detector mode for the detector
|
||||||
|
\param f detector mode to be set
|
||||||
|
\returns current detector mode
|
||||||
|
*/
|
||||||
|
detectorMode setDetectorMode(detectorMode f) {dMode=f; return dMode;};
|
||||||
|
|
||||||
|
/** gets the current detector mode for the detector
|
||||||
|
\returns current detector mode
|
||||||
|
*/
|
||||||
|
detectorMode getDetectorMode() {return dMode;};
|
||||||
|
|
||||||
|
|
||||||
/** sets file pointer where to write the clusters to
|
/** sets file pointer where to write the clusters to
|
||||||
\param f file pointer
|
\param f file pointer
|
||||||
\returns current file pointer
|
\returns current file pointer
|
||||||
*/
|
*/
|
||||||
FILE *setFilePointer(FILE *f){myFile=f; return myFile;};
|
FILE *setFilePointer(FILE *f){myFile=f; return myFile;};
|
||||||
|
|
||||||
/** gets file pointer where to write the clusters to
|
/** gets file pointer where to write the clusters to
|
||||||
\returns current file pointer
|
\returns current file pointer
|
||||||
*/
|
*/
|
||||||
FILE *getFilePointer(){return myFile;};
|
FILE *getFilePointer(){return myFile;};
|
||||||
void setMutex(pthread_mutex_t *m){fm=m;};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
virtual slsInterpolation *getInterpolation(){
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual slsInterpolation *setInterpolation(slsInterpolation *ii){return NULL;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
virtual double setNSigma(double n) {return 0;};
|
||||||
|
virtual void setEnergyRange(double emi, double ema) {;};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
slsDetectorData<dataType> *det; /**< slsDetectorData to be used */
|
slsDetectorData<dataType> *det; /**< slsDetectorData to be used */
|
||||||
@ -858,9 +1148,17 @@ template <class dataType> class analogDetector {
|
|||||||
double thr; /**< threshold to be used for conversion into number of photons */
|
double thr; /**< threshold to be used for conversion into number of photons */
|
||||||
// int nSigma; /**< number of sigma to be used for conversion into number of photons if threshold is undefined */
|
// int nSigma; /**< number of sigma to be used for conversion into number of photons if threshold is undefined */
|
||||||
frameMode fMode; /**< current detector frame mode */
|
frameMode fMode; /**< current detector frame mode */
|
||||||
|
detectorMode dMode; /**< current detector frame mode */
|
||||||
FILE *myFile; /**< file pointer to write to */
|
FILE *myFile; /**< file pointer to write to */
|
||||||
|
#ifdef ROOTSPECTRUM
|
||||||
pthread_mutex_t *fm;
|
TH2F *hs;
|
||||||
|
#ifdef ROOTCLUST
|
||||||
|
TH2F *hs3;
|
||||||
|
TH2F *hs5;
|
||||||
|
TH2F *hs7;
|
||||||
|
TH2F *hs9;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
116
slsDetectorCalibration/commonModeSubtractionNew.h
Normal file
116
slsDetectorCalibration/commonModeSubtractionNew.h
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
#ifndef COMMONMODESUBTRACTION_H
|
||||||
|
#define COMMONMODESUBTRACTION_H
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
class commonModeSubtraction {
|
||||||
|
|
||||||
|
/** @short class to calculate the common mode of the pedestals based on an approximated moving average*/
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
/** constructor
|
||||||
|
\param nn number of samples for the moving average to calculate the average common mode
|
||||||
|
\param iroi number of regions on which one can calculate the common mode separately. Defaults to 1 i.e. whole detector
|
||||||
|
|
||||||
|
*/
|
||||||
|
commonModeSubtraction(int iroi=1, int ns=3) : nROI(iroi), nsigma(ns) {
|
||||||
|
mean=new double[nROI];
|
||||||
|
mean2=new double[nROI];
|
||||||
|
nCm=new double[nROI];
|
||||||
|
};
|
||||||
|
|
||||||
|
/** destructor - deletes the moving average(s) and the sum of pedestals calculator(s) */
|
||||||
|
virtual ~commonModeSubtraction() {delete [] mean; delete [] mean2; delete [] nCm;};
|
||||||
|
|
||||||
|
|
||||||
|
/** clears the moving average and the sum of pedestals calculation - virtual func*/
|
||||||
|
virtual void Clear(){
|
||||||
|
for (int i=0; i<nROI; i++) {
|
||||||
|
mean[i]=0;
|
||||||
|
nCm[i]=0;
|
||||||
|
mean2[i]=0;
|
||||||
|
}};
|
||||||
|
|
||||||
|
/** adds the average of pedestals to the moving average and reinitializes the calculation of the sum of pedestals for all ROIs. - virtual func*/
|
||||||
|
virtual void newFrame(){
|
||||||
|
for (int i=0; i<nROI; i++) {
|
||||||
|
// if (nCm[i]>0) cmStat[i].Calc(cmPed[i]/nCm[i]);
|
||||||
|
nCm[i]=0;
|
||||||
|
mean[i]=0;
|
||||||
|
mean2[i]=0;
|
||||||
|
}};
|
||||||
|
|
||||||
|
/** adds the pixel to the sum of pedestals -- virtual func must be overloaded to define the regions of interest
|
||||||
|
\param val value to add
|
||||||
|
\param ix pixel x coordinate
|
||||||
|
\param iy pixel y coordinate
|
||||||
|
*/
|
||||||
|
virtual void addToCommonMode(double val, int ix=0, int iy=0) {
|
||||||
|
|
||||||
|
int iroi=getROI(ix,iy);
|
||||||
|
// if (iroi==0) val=100;
|
||||||
|
// else val=-100;
|
||||||
|
// if (isc>=0 && isc<nROI) {
|
||||||
|
if (iroi>=0 && iroi<nROI) {
|
||||||
|
mean[iroi]+=val;
|
||||||
|
mean2[iroi]+=val*val;
|
||||||
|
nCm[iroi]++;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** gets the common mode i.e. the difference between the current average sum of pedestals mode and the average pedestal
|
||||||
|
\param ix pixel x coordinate
|
||||||
|
\param iy pixel y coordinate
|
||||||
|
\return the difference between the current average sum of pedestals and the average pedestal
|
||||||
|
*/
|
||||||
|
virtual double getCommonMode(int ix=0, int iy=0) {
|
||||||
|
int iroi=getROI(ix,iy);
|
||||||
|
/* if (iroi==0) */
|
||||||
|
/* return 100; */
|
||||||
|
/* else */
|
||||||
|
/* return -100; */
|
||||||
|
|
||||||
|
if (iroi>=0 && iroi<nROI) {
|
||||||
|
if (nCm[iroi]>0)
|
||||||
|
return mean[iroi]/nCm[iroi];
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** gets the common mode i.e. the difference between the current average sum of pedestals mode and the average pedestal
|
||||||
|
\param ix pixel x coordinate
|
||||||
|
\param iy pixel y coordinate
|
||||||
|
\return the difference between the current average sum of pedestals and the average pedestal
|
||||||
|
*/
|
||||||
|
virtual double getCommonModeRMS(int ix=0, int iy=0) {
|
||||||
|
int iroi=getROI(ix,iy);
|
||||||
|
if (iroi>=0 && iroi<nROI) {
|
||||||
|
if (nCm[iroi]>0)
|
||||||
|
return sqrt(mean2[iroi]/nCm[iroi]-(mean[iroi]/nCm[iroi])*(mean[iroi]/nCm[iroi]));
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
gets the common mode ROI for pixel ix, iy -should be overloaded!
|
||||||
|
*/
|
||||||
|
virtual int getROI(int ix, int iy){ (void) ix; (void) iy; return 0;};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
double *mean; /**<array of moving average of the pedestal average per region of interest */
|
||||||
|
double *mean2; /**< array storing the sum of pedestals per region of interest */
|
||||||
|
double *nCm; /**< array storing the number of pixels currently contributing to the pedestals */
|
||||||
|
int nsigma; /** number of rms above which the pedestal should be considered as a photon */
|
||||||
|
const int nROI; /**< constant parameter for number of regions on which the common mode should be calculated separately e.g. supercolumns */
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -43,7 +43,7 @@ class mythen3_01_jctbData : public slsDetectorData<short unsigned int> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static short unsigned int* mythen03_frame(char *ptr, int dr=24, int nch=64*3, int off=5) {
|
virtual short unsigned int* mythen03_frame(char *ptr, int dr=24, int nch=64*3, int off=5) {
|
||||||
// off=0;
|
// off=0;
|
||||||
int iarg;
|
int iarg;
|
||||||
int64_t word, *wp;
|
int64_t word, *wp;
|
||||||
@ -74,7 +74,7 @@ class mythen3_01_jctbData : public slsDetectorData<short unsigned int> {
|
|||||||
for (ib=0; ib<nb; ib++) {
|
for (ib=0; ib<nb; ib++) {
|
||||||
if (word&(1<<bit[ib])) {
|
if (word&(1<<bit[ib])) {
|
||||||
cout << "+" ;
|
cout << "+" ;
|
||||||
val[iw+nch*(ib/nb)]|=(1<<idr);
|
val[iw+nch/nb*(ib)]|=(1<<idr);
|
||||||
} else {
|
} else {
|
||||||
cout << "-" ;
|
cout << "-" ;
|
||||||
}
|
}
|
||||||
@ -96,8 +96,8 @@ class mythen3_01_jctbData : public slsDetectorData<short unsigned int> {
|
|||||||
ii++;
|
ii++;
|
||||||
}//end for
|
}//end for
|
||||||
|
|
||||||
cout << "Decoded "<<ii << " samples"<< endl;
|
cout << "M3.01 Decoded "<<ii << " samples"<< endl;
|
||||||
cout << "Should be "<< nch/nb*dr+off << " samples"<< endl;
|
cout << "M3.01 Should be "<< nch/nb*dr+off << " samples"<< endl;
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
130
slsDetectorCalibration/dataStructures/Mythen3_02_jctbData.h
Normal file
130
slsDetectorCalibration/dataStructures/Mythen3_02_jctbData.h
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
#ifndef MYTHEN302JCTBDATA_H
|
||||||
|
#define MYTHEN302JCTBDATA_H
|
||||||
|
|
||||||
|
|
||||||
|
#include "Mythen3_01_jctbData.h"
|
||||||
|
//class mythen3_02_jctbData : public slsDetectorData<short unsigned int> {
|
||||||
|
class mythen3_02_jctbData : public mythen3_01_jctbData {
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
mythen3_02_jctbData( int nch=64*3,int dr=24, int off=5): mythen3_01_jctbData( nch,dr, off)
|
||||||
|
//slsDetectorData<short unsigned int>(64*3,1,dr*8*nch,NULL,NULL,NULL), dynamicRange(dr), serialOffset(off), frameNumber(0), numberOfCounters(nch)
|
||||||
|
{};
|
||||||
|
|
||||||
|
/* virtual void getPixel(int ip, int &x, int &y) {x=-1; y=-1;}; */
|
||||||
|
|
||||||
|
/* virtual short unsigned int getChannel(char *data, int ix, int iy=0) { */
|
||||||
|
/* int ret=-1; */
|
||||||
|
/* short unsigned int *val=mythen03_frame(data,dynamicRange,numberOfCounters,serialOffset); */
|
||||||
|
/* if (ix>=0 && ix<numberOfCounters) ret=val[ix]; */
|
||||||
|
/* delete [] val; */
|
||||||
|
/* return ret; */
|
||||||
|
/* }; */
|
||||||
|
|
||||||
|
/* virtual int getFrameNumber(char *buff) {return frameNumber;}; */
|
||||||
|
|
||||||
|
/* virtual char *findNextFrame(char *data, int &ndata, int dsize) { */
|
||||||
|
/* ndata=dsize; */
|
||||||
|
/* return data; */
|
||||||
|
/* } */
|
||||||
|
|
||||||
|
/* virtual char *readNextFrame(ifstream &filebin) { */
|
||||||
|
/* char *data=NULL; */
|
||||||
|
/* if (filebin.is_open()) { */
|
||||||
|
/* data=new char[dataSize]; */
|
||||||
|
/* filebin.read(data,dataSize); */
|
||||||
|
/* } */
|
||||||
|
/* return data; */
|
||||||
|
/* } */
|
||||||
|
|
||||||
|
/* virtual short unsigned int **getData(char *ptr, int dsize=-1) { */
|
||||||
|
/* short unsigned int **val; */
|
||||||
|
/* val=new short unsigned int*[1]; */
|
||||||
|
/* val[0]=mythen03_frame(ptr,dynamicRange,nx,serialOffset); */
|
||||||
|
/* return val; */
|
||||||
|
|
||||||
|
/* } */
|
||||||
|
|
||||||
|
|
||||||
|
virtual short unsigned int* mythen03_frame(char *ptr, int dr=24, int nch=64*3, int off=5) {
|
||||||
|
// off=0;
|
||||||
|
int iarg;
|
||||||
|
int64_t word, *wp;
|
||||||
|
short unsigned int* val=new short unsigned int[nch];
|
||||||
|
int bit[64];
|
||||||
|
int nb=2;
|
||||||
|
int ioff=0;
|
||||||
|
int idr=0;
|
||||||
|
int ib=0;
|
||||||
|
int ich=0;
|
||||||
|
int ii=0;
|
||||||
|
int iw=0;
|
||||||
|
bit[0]=17;//19;
|
||||||
|
bit[1]=6;//8;
|
||||||
|
idr=0;
|
||||||
|
for (ib=0; ib<nch; ib++) {
|
||||||
|
val[ib]=0;
|
||||||
|
}
|
||||||
|
wp=(int64_t*)ptr;
|
||||||
|
|
||||||
|
for (iw=0; iw<nch/nb; iw) {
|
||||||
|
word=*wp;
|
||||||
|
|
||||||
|
if (ioff<off) {
|
||||||
|
ioff++;
|
||||||
|
cout <<"*";
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (idr<16) {
|
||||||
|
for (ib=0; ib<nb; ib++) {
|
||||||
|
if (word&(1<<bit[ib])) {
|
||||||
|
cout << "+" ;
|
||||||
|
val[iw+nch/nb*(ib)]|=(1<<idr);
|
||||||
|
} else {
|
||||||
|
cout << "-" ;
|
||||||
|
}
|
||||||
|
// cout << iw+nch/nb*(ib)<< " " ;
|
||||||
|
}//end for()
|
||||||
|
}
|
||||||
|
|
||||||
|
idr++;
|
||||||
|
|
||||||
|
|
||||||
|
if (idr==dr) {
|
||||||
|
idr=0;
|
||||||
|
// cout << dec << " " << iw << " " << val[iw] << " " << val[iw+nch/2] << endl;
|
||||||
|
cout <<dec << iw<<endl;
|
||||||
|
iw++;
|
||||||
|
}//end if()
|
||||||
|
|
||||||
|
}//end else()
|
||||||
|
wp+=1;
|
||||||
|
ii++;
|
||||||
|
}//end for
|
||||||
|
|
||||||
|
cout << "M3.02 Decoded "<<ii << " samples"<< endl;
|
||||||
|
cout << "M3.02 Should be "<< nch/nb*dr+off << " samples"<< endl;
|
||||||
|
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* virtual int setFrameNumber(int f=0) {if (f>=0) frameNumber=f; return frameNumber; }; */
|
||||||
|
/* virtual int setDynamicRange(int d=-1) {if (d>0 && d<=24) dynamicRange=d; return dynamicRange;}; */
|
||||||
|
/* virtual int setSerialOffset(int d=-1) {if (d>=0) serialOffset=d; return serialOffset;}; */
|
||||||
|
/* virtual int setNumberOfCounters(int d=-1) {if (d>=0) numberOfCounters=d; return numberOfCounters;}; */
|
||||||
|
|
||||||
|
|
||||||
|
/* private: */
|
||||||
|
|
||||||
|
/* int dynamicRange; */
|
||||||
|
/* int serialOffset; */
|
||||||
|
/* int frameNumber; */
|
||||||
|
/* int numberOfCounters; */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -34,6 +34,9 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef BCHIP074_BCHIP075
|
||||||
|
cout << "This is a bchip074-bchip075 system " << endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
uint16_t **dMask;
|
uint16_t **dMask;
|
||||||
@ -59,6 +62,11 @@ public:
|
|||||||
dMap[0][ix] = 1280*2+2*offset+ipix*2;//dataSize-2-ix;//+2*offset;
|
dMap[0][ix] = 1280*2+2*offset+ipix*2;//dataSize-2-ix;//+2*offset;
|
||||||
// dMap[0][ix] = 2*ipix+offset*(imod+1)+1280*2*imod;
|
// dMap[0][ix] = 2*ipix+offset*(imod+1)+1280*2*imod;
|
||||||
dMask[0][ix] = 0x0;
|
dMask[0][ix] = 0x0;
|
||||||
|
#ifdef BCHIP074_BCHIP075
|
||||||
|
int ibad=ix/2+1280*imod;
|
||||||
|
if ((ibad>=128*4 && ibad<128*5) || (ibad>=9*128 && ibad<10*128) || (ibad>=(1280+128*4) && ibad<ibad>=(1280+128*6)))
|
||||||
|
dataROIMask[0][ix]=0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
setDataMap(dMap);
|
setDataMap(dMap);
|
||||||
|
@ -8,6 +8,23 @@ class jungfrau10ModuleData : public slsDetectorData<uint16_t> {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint64_t frameNumber; /**< is the frame number */
|
||||||
|
uint32_t expLength; /**< is the subframe number (32 bit eiger) or real time exposure time in 100ns (others) */
|
||||||
|
uint32_t packetNumber; /**< is the packet number */
|
||||||
|
uint64_t bunchId; /**< is the bunch id from beamline */
|
||||||
|
uint64_t timestamp; /**< is the time stamp with 10 MHz clock */
|
||||||
|
uint16_t modId; /**< is the unique module id (unique even for left, right, top, bottom) */
|
||||||
|
uint16_t xCoord; /**< is the x coordinate in the complete detector system */
|
||||||
|
uint16_t yCoord; /**< is the y coordinate in the complete detector system */
|
||||||
|
uint16_t zCoord; /**< is the z coordinate in the complete detector system */
|
||||||
|
uint32_t debug; /**< is for debugging purposes */
|
||||||
|
uint16_t roundRNumber; /**< is the round robin set number */
|
||||||
|
uint8_t detType; /**< is the detector type see :: detectorType */
|
||||||
|
uint8_t version; /**< is the version number of this structure format */
|
||||||
|
} sls_detector_header;
|
||||||
|
|
||||||
|
|
||||||
int iframe;
|
int iframe;
|
||||||
int nadc;
|
int nadc;
|
||||||
int sc_width;
|
int sc_width;
|
||||||
@ -25,7 +42,7 @@ class jungfrau10ModuleData : public slsDetectorData<uint16_t> {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
jungfrau10ModuleData(int ns=16384): slsDetectorData<uint16_t>(256*4, 256*2, 256*256*8*2, NULL, NULL, NULL) , iframe(0), nadc(32), sc_width(64), sc_height(256) {
|
jungfrau10ModuleData(int ns=16384): slsDetectorData<uint16_t>(256*4, 256*2, 256*256*8*2+48, NULL, NULL, NULL) , iframe(0) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -38,43 +55,51 @@ class jungfrau10ModuleData : public slsDetectorData<uint16_t> {
|
|||||||
int ichip;
|
int ichip;
|
||||||
|
|
||||||
// cout << sizeof(uint16_t) << endl;
|
// cout << sizeof(uint16_t) << endl;
|
||||||
|
int ip=0;
|
||||||
for (iadc=0; iadc<nadc; iadc++) {
|
for (int iy=0; iy<256*2; iy++) {
|
||||||
ichip=iadc/4;
|
for (int ix=0; ix<256*4; ix++){
|
||||||
|
dataMap[iy][ix]=ip*2+48;
|
||||||
for (int i=0; i<sc_width*sc_height; i++) {
|
ip++;
|
||||||
|
}
|
||||||
if (ichip%2==0) {
|
|
||||||
row=sc_height+i/sc_width;
|
|
||||||
col=(ichip/2)*256+iadc%4*sc_width+(i%sc_width);
|
|
||||||
} else {
|
|
||||||
row=sc_height-1-i/sc_width;
|
|
||||||
col=((ichip/2)*256+iadc%4*sc_width)+sc_width-(i%sc_width)-1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* for (iadc=0; iadc<nadc; iadc++) { */
|
||||||
|
/* ichip=iadc/4; */
|
||||||
|
|
||||||
/* if (iadc<nadc/2) { */
|
/* for (int i=0; i<sc_width*sc_height; i++) { */
|
||||||
|
|
||||||
|
/* if (ichip%2==0) { */
|
||||||
/* row=sc_height+i/sc_width; */
|
/* row=sc_height+i/sc_width; */
|
||||||
/* col=iadc*sc_width+(i%sc_width); */
|
/* col=(ichip/2)*256+iadc%4*sc_width+(i%sc_width); */
|
||||||
/* } else { */
|
/* } else { */
|
||||||
/* row=sc_height-1-i/sc_width; */
|
/* row=sc_height-1-i/sc_width; */
|
||||||
/* col=(nx-1)-((iadc-16)*sc_width)-(i%sc_width); */
|
/* col=((ichip/2)*256+iadc%4*sc_width)+sc_width-(i%sc_width)-1; */
|
||||||
/* } */
|
/* } */
|
||||||
if (row<0 || row>=ny || col<0 || col>=nx) {
|
|
||||||
cout << "Wrong row, column " << row << " " << col << " " << iadc << " " << i << endl;
|
|
||||||
} else
|
|
||||||
dataMap[row][col]=(nadc*i+iadc)*2;
|
|
||||||
if (dataMap[row][col]<0 || dataMap[row][col]>=dataSize)
|
|
||||||
cout << "Error: pointer " << dataMap[row][col] << " out of range " << row << " " << col <<" " << iadc << " " << i << endl;
|
|
||||||
else {
|
|
||||||
xmap[nadc*i+iadc]=col;
|
|
||||||
ymap[nadc*i+iadc]=row;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
/* /\* if (iadc<nadc/2) { *\/ */
|
||||||
|
/* /\* row=sc_height+i/sc_width; *\/ */
|
||||||
|
/* /\* col=iadc*sc_width+(i%sc_width); *\/ */
|
||||||
|
/* /\* } else { *\/ */
|
||||||
|
/* /\* row=sc_height-1-i/sc_width; *\/ */
|
||||||
|
/* /\* col=(nx-1)-((iadc-16)*sc_width)-(i%sc_width); *\/ */
|
||||||
|
/* /\* } *\/ */
|
||||||
|
/* if (row<0 || row>=ny || col<0 || col>=nx) { */
|
||||||
|
/* cout << "Wrong row, column " << row << " " << col << " " << iadc << " " << i << endl; */
|
||||||
|
/* } else */
|
||||||
|
/* dataMap[row][col]=(nadc*i+iadc)*2; */
|
||||||
|
/* if (dataMap[row][col]<0 || dataMap[row][col]>=dataSize) */
|
||||||
|
/* cout << "Error: pointer " << dataMap[row][col] << " out of range " << row << " " << col <<" " << iadc << " " << i << endl; */
|
||||||
|
/* else { */
|
||||||
|
/* xmap[nadc*i+iadc]=col; */
|
||||||
|
/* ymap[nadc*i+iadc]=row; */
|
||||||
|
|
||||||
|
/* } */
|
||||||
|
/* } */
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -91,7 +116,7 @@ class jungfrau10ModuleData : public slsDetectorData<uint16_t> {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
int getFrameNumber(char *buff){(void)buff; return iframe;};
|
int getFrameNumber(return (sls_detector_header*)buff)->frameNumber;};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
@ -123,28 +148,65 @@ class jungfrau10ModuleData : public slsDetectorData<uint16_t> {
|
|||||||
\returns pointer to the begin of the last good frame, NULL if no frame is found or last frame is incomplete
|
\returns pointer to the begin of the last good frame, NULL if no frame is found or last frame is incomplete
|
||||||
|
|
||||||
*/
|
*/
|
||||||
char *readNextFrame(ifstream &filebin){
|
virtual char *readNextFrame(ifstream &filebin) {
|
||||||
// int afifo_length=0;
|
int ff=-1, np=-1;
|
||||||
uint16_t *afifo_cont;
|
return readNextFrame(filebin, ff, np);
|
||||||
int ib=0;
|
|
||||||
if (filebin.is_open()) {
|
|
||||||
afifo_cont=new uint16_t[dataSize/2];
|
|
||||||
while (filebin.read(((char*)afifo_cont)+ib,2)) {
|
|
||||||
ib+=2;
|
|
||||||
if (ib==dataSize) break;
|
|
||||||
}
|
|
||||||
if (ib>0) {
|
|
||||||
iframe++;
|
|
||||||
// cout << ib << "-" << endl;
|
|
||||||
return (char*)afifo_cont;
|
|
||||||
} else {
|
|
||||||
delete [] afifo_cont;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtual char *readNextFrame(ifstream &filebin, int &ff) {
|
||||||
|
int np=-1;
|
||||||
|
return readNextFrame(filebin, ff, np);
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np) {
|
||||||
|
char *data=new char[dataSize];
|
||||||
|
char *d=readNextFrame(filebin, ff, np, data);
|
||||||
|
if (d==NULL) {delete [] data; data=NULL;}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np, char *data) {
|
||||||
|
// char *readNextFrame(ifstream &filebin){
|
||||||
|
// int afifo_length=0;
|
||||||
|
/* uint16_t *afifo_cont; */
|
||||||
|
/* int ib=0; */
|
||||||
|
/* if (filebin.is_open()) { */
|
||||||
|
/* afifo_cont=new uint16_t[dataSize/2]; */
|
||||||
|
/* while (filebin.read(((char*)afifo_cont)+ib,2)) { */
|
||||||
|
/* ib+=2; */
|
||||||
|
/* if (ib==dataSize) break; */
|
||||||
|
/* } */
|
||||||
|
/* if (ib>0) { */
|
||||||
|
/* iframe++; */
|
||||||
|
/* // cout << ib << "-" << endl; */
|
||||||
|
/* return (char*)afifo_cont; */
|
||||||
|
/* } else { */
|
||||||
|
/* delete [] afifo_cont; */
|
||||||
|
/* return NULL; */
|
||||||
|
/* } */
|
||||||
|
/* } */
|
||||||
|
/* return NULL; */
|
||||||
|
/* }; */
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,23 +31,28 @@ class moench02CtbData : public slsDetectorData<uint16_t> {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
moench02CtbData(int ns=6400): slsDetectorData<uint16_t>(160, 160, ns*2*32, NULL, NULL) , nadc(4), sc_width(40), sc_height(160) {
|
moench02CtbData(int ns=6400): slsDetectorData<uint16_t>(160, 160, ns*2*32, NULL, NULL) , nadc(32), sc_width(40), sc_height(160) {
|
||||||
|
|
||||||
|
|
||||||
int adc_nr[4]={120,0,80,40};
|
int adc_off[4]={40,0,120,80};
|
||||||
|
int adc_nr[4]={8,10,20,22};
|
||||||
int row, col;
|
int row, col;
|
||||||
|
|
||||||
int isample;
|
int isample;
|
||||||
int iadc;
|
int iadc, iiadc;
|
||||||
int ix, iy;
|
int ix, iy;
|
||||||
maplength=this->getDataSize()/2;
|
maplength=this->getDataSize()/2;
|
||||||
|
//cout << maplength << endl;
|
||||||
|
|
||||||
|
for (iiadc=0; iiadc<4; iiadc++) {
|
||||||
|
|
||||||
for (iadc=0; iadc<nadc; iadc++) {
|
iadc=adc_nr[iiadc];
|
||||||
|
//cout << iiadc << endl;
|
||||||
for (int i=0; i<sc_width*sc_height; i++) {
|
for (int i=0; i<sc_width*sc_height; i++) {
|
||||||
col=adc_nr[iadc]+(i%sc_width);
|
|
||||||
|
col=adc_off[iiadc]+(i%sc_width);
|
||||||
row=i/sc_width;
|
row=i/sc_width;
|
||||||
dataMap[row][col]=(32*i+iadc+2)*2;
|
dataMap[row][col]=(32*i+iadc)*2;
|
||||||
if (dataMap[row][col]<0 || dataMap[row][col]>=dataSize) {
|
if (dataMap[row][col]<0 || dataMap[row][col]>=dataSize) {
|
||||||
cout << "Error: pointer " << dataMap[row][col] << " out of range "<< endl;
|
cout << "Error: pointer " << dataMap[row][col] << " out of range "<< endl;
|
||||||
}
|
}
|
||||||
@ -56,12 +61,17 @@ class moench02CtbData : public slsDetectorData<uint16_t> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<maplength; i++) {
|
for (int i=0; i<maplength; i++) {
|
||||||
|
//cout << i << endl;
|
||||||
isample=i/32;
|
isample=i/32;
|
||||||
iadc=i%32;
|
iiadc=i%32;
|
||||||
|
iadc=-1;
|
||||||
|
for (int iii=0; iii<4; iii++) {
|
||||||
|
if (iiadc==adc_nr[iii]) iadc=iii;
|
||||||
|
}
|
||||||
ix=isample%sc_width;
|
ix=isample%sc_width;
|
||||||
iy=isample/sc_width;
|
iy=isample/sc_width;
|
||||||
if(iadc>1 && iadc<6){
|
if(iadc>=0){
|
||||||
xmap[i]=adc_nr[iadc-2]+ix;
|
xmap[i]=adc_off[iadc]+ix;
|
||||||
ymap[i]=iy;
|
ymap[i]=iy;
|
||||||
}else{
|
}else{
|
||||||
xmap[i]=-1;
|
xmap[i]=-1;
|
||||||
@ -76,10 +86,10 @@ class moench02CtbData : public slsDetectorData<uint16_t> {
|
|||||||
if(ip>=0 && ip<maplength){
|
if(ip>=0 && ip<maplength){
|
||||||
x=xmap[ip];
|
x=xmap[ip];
|
||||||
y=ymap[ip];
|
y=ymap[ip];
|
||||||
}else{
|
}/*else{
|
||||||
cerr<<"WRONG ARRAY LENGTH"<<endl;
|
cerr<<"WRONG ARRAY LENGTH"<<endl;
|
||||||
cerr<<"Trying to access the "<<ip<<"-th element"<<endl;
|
cerr<<"Trying to access the "<<ip<<"-th element"<<endl;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -137,7 +147,9 @@ class moench02CtbData : public slsDetectorData<uint16_t> {
|
|||||||
}
|
}
|
||||||
if (ib>0) {
|
if (ib>0) {
|
||||||
iframe++;
|
iframe++;
|
||||||
//cout << ib << "-" << endl;
|
//cout << ib/2 << "-" << endl;
|
||||||
|
//for (int i=0; i<ib/2; i++)
|
||||||
|
//cout << i << " " << afifo_cont[i] << endl;
|
||||||
return (char*)afifo_cont;
|
return (char*)afifo_cont;
|
||||||
} else {
|
} else {
|
||||||
delete [] afifo_cont;
|
delete [] afifo_cont;
|
||||||
|
187
slsDetectorCalibration/dataStructures/moench02CtbDataDGS.h
Normal file
187
slsDetectorCalibration/dataStructures/moench02CtbDataDGS.h
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
#ifndef MOENCH02CTBDATADGS_H
|
||||||
|
#define MOENCH02CTBDATADGS_H
|
||||||
|
#include "slsDetectorData.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class moench02CtbData : public slsDetectorData<uint16_t> {
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
int iframe;
|
||||||
|
// int *xmap, *ymap;
|
||||||
|
//int nadc;
|
||||||
|
int sc_width;
|
||||||
|
int sc_height;
|
||||||
|
|
||||||
|
int maplength;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
moench02CtbDataDGS(int ns=6400): slsDetectorData<uint16_t>(160, 160, ns*(2*32+8), NULL, NULL) , sc_width(40), sc_height(160) {
|
||||||
|
|
||||||
|
|
||||||
|
int adc_off[4]={40,0,120,80};
|
||||||
|
int adc_nr[4]={8,10,20,23};
|
||||||
|
int row, col;
|
||||||
|
|
||||||
|
int isample;
|
||||||
|
int iadc, iiadc;
|
||||||
|
int ix, iy;
|
||||||
|
maplength=this->getDataSize()/2;
|
||||||
|
//cout << maplength << endl;
|
||||||
|
|
||||||
|
for (iiadc=0; iiadc<4; iiadc++) {
|
||||||
|
|
||||||
|
iadc=adc_nr[iiadc];
|
||||||
|
//cout << iiadc << endl;
|
||||||
|
for (int i=0; i<sc_width*sc_height; i++) {
|
||||||
|
col=adc_off[iiadc]+(i%sc_width);
|
||||||
|
row=i/sc_width;
|
||||||
|
dataMap[row][col]=(32*i+iadc)*2;
|
||||||
|
if (dataMap[row][col]<0 || dataMap[row][col]>=dataSize) {
|
||||||
|
cout << "Error: pointer " << dataMap[row][col] << " out of range "<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<maplength; i++) {
|
||||||
|
//cout << i << endl;
|
||||||
|
isample=i/32;
|
||||||
|
iiadc=i%32;
|
||||||
|
iadc=-1;
|
||||||
|
for (int iii=0; iii<4; iii++) {
|
||||||
|
if (iiadc==adc_nr[iii]) iadc=iii;
|
||||||
|
}
|
||||||
|
ix=isample%sc_width;
|
||||||
|
iy=isample/sc_width;
|
||||||
|
if(iadc>=0){
|
||||||
|
xmap[i]=adc_off[iadc]+ix;
|
||||||
|
ymap[i]=iy;
|
||||||
|
}else{
|
||||||
|
xmap[i]=-1;
|
||||||
|
ymap[i]=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
iframe=0;
|
||||||
|
cout << "data struct created" << endl;
|
||||||
|
};
|
||||||
|
|
||||||
|
void getPixel(int ip, int &x, int &y) {
|
||||||
|
if(ip>=0 && ip<maplength){
|
||||||
|
x=xmap[ip];
|
||||||
|
y=ymap[ip];
|
||||||
|
}/*else{
|
||||||
|
cerr<<"WRONG ARRAY LENGTH"<<endl;
|
||||||
|
cerr<<"Trying to access the "<<ip<<"-th element"<<endl;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns the gain for the selected pixel (at the moemnt only 3rd supercolumn)
|
||||||
|
\param buff pointer to the dataset
|
||||||
|
\param ix x coordinate
|
||||||
|
\param iy y coordinate
|
||||||
|
\returns gain value
|
||||||
|
*/
|
||||||
|
|
||||||
|
int getGain(char *buff, int ix, int iy) {
|
||||||
|
int isample=iy*sc_width+iy;
|
||||||
|
if (ix<sc_width) return 0; //first supercolumn no gain switching - could return the static gain if wished
|
||||||
|
if (ix<2*sc_width) return 0; //second supercolumn no gain switching - could return the static gain if wished
|
||||||
|
if (ix<3*sc_width){
|
||||||
|
if(*((long*)(buff+(32*2*isample+8*(isample-1)))&(1>>31)) return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 0; //not yet implemented for 4th supercolumn
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
Returns the frame number for the given dataset. Purely virtual func.
|
||||||
|
\param buff pointer to the dataset
|
||||||
|
\returns frame number
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
virtual int getFrameNumber(char *buff){(void)buff; return iframe;};
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
Returns the packet number for the given dataset. purely virtual func
|
||||||
|
\param buff pointer to the dataset
|
||||||
|
\returns packet number number
|
||||||
|
|
||||||
|
|
||||||
|
virtual int getPacketNumber(char *buff)=0;
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
Loops over a memory slot until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). purely virtual func
|
||||||
|
\param data pointer to the memory to be analyzed
|
||||||
|
\param ndata reference to the amount of data found for the frame, in case the frame is incomplete at the end of the memory slot
|
||||||
|
\param dsize size of the memory slot to be analyzed
|
||||||
|
\returns pointer to the beginning of the last good frame (might be incomplete if ndata smaller than dataSize), or NULL if no frame is found
|
||||||
|
|
||||||
|
*/
|
||||||
|
virtual char *findNextFrame(char *data, int &ndata, int dsize){ndata=dsize; setDataSize(dsize); return data;};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
Loops over a file stream until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). Can be overloaded for different kind of detectors!
|
||||||
|
\param filebin input file stream (binary)
|
||||||
|
\returns pointer to the begin of the last good frame, NULL if no frame is found or last frame is incomplete
|
||||||
|
|
||||||
|
*/
|
||||||
|
virtual char *readNextFrame(ifstream &filebin){
|
||||||
|
// int afifo_length=0;
|
||||||
|
uint16_t *afifo_cont;
|
||||||
|
int ib=0;
|
||||||
|
if (filebin.is_open()) {
|
||||||
|
afifo_cont=new uint16_t[dataSize/2];
|
||||||
|
while (filebin.read(((char*)afifo_cont)+ib,2)) {
|
||||||
|
ib+=2;
|
||||||
|
if (ib==dataSize) break;
|
||||||
|
}
|
||||||
|
if (ib>0) {
|
||||||
|
iframe++;
|
||||||
|
//cout << ib/2 << "-" << endl;
|
||||||
|
//for (int i=0; i<ib/2; i++)
|
||||||
|
//cout << i << " " << afifo_cont[i] << endl;
|
||||||
|
return (char*)afifo_cont;
|
||||||
|
} else {
|
||||||
|
delete [] afifo_cont;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user