Compare commits

...

284 Commits

Author SHA1 Message Date
40210ae26f jungfrauserver adcphase fix: bug was if adcphase was same as previous value, it still shifted 2018-03-14 17:20:26 +01:00
dd6301d66d updated for compilation 2018-03-14 16:19:30 +01:00
b58c3e8951 solving merging conflicts from 3.1.0 to developer 2018-03-14 15:45:35 +01:00
85aa47b835 updated link in documentation 2018-03-12 16:38:01 +01:00
da9b0bdc0b updated link in documentation 2018-03-12 16:27:45 +01:00
258de4947a updated doc 2018-03-12 15:46:20 +01:00
9197ab6e4b sls detector install omitted, added 2018-03-12 15:36:36 +01:00
6c1c203782 documentation updated 2018-03-12 15:01:23 +01:00
721d2a30f2 read me updated 2018-03-12 14:25:39 +01:00
72970c9669 updated binaries, updated manuals, updated git versioning 2018-03-12 14:21:02 +01:00
b389402d64 Merge branch '3.1.0-rc' of github.com:slsdetectorgroup/slsDetectorPackage into 3.1.0-rc 2018-03-08 17:13:20 +01:00
0d2dd93498 changed setBit and getBit to uint32_t 2018-03-08 17:13:13 +01:00
fee6465213 eiger and jungfrau servers int to uint32_t for read and write registers 2018-03-08 16:46:15 +01:00
8b02aa9e91 Merge branch '3.1.0-rc' of github.com:slsdetectorgroup/slsDetectorPackage into 3.1.0-rc 2018-03-08 16:08:45 +01:00
339956e5de changed from int to uint32_t in read and writeRegister 2018-03-08 16:08:31 +01:00
deb59530ab eiger gui fix: delay after trigger and number of gates upon measurements tab refresh doesnt exist for eiger/jungfrau 2018-03-08 15:49:01 +01:00
ec5e779225 added binary 2018-03-08 15:19:11 +01:00
3878212ffd jungfrau server adcphase not responding to a get properly 2018-03-08 15:17:14 +01:00
7649865a8f jungfrau bug fix: adc phase corrected to correctly return value in -1 2018-03-08 14:02:02 +01:00
06cdf8ad92 overloading access operator 2018-02-28 17:34:55 +01:00
28101bed22 updated binaries 2018-02-27 14:37:46 +01:00
1f6c289fd4 gotthard server : bugfix for getting id 2018-02-27 14:33:58 +01:00
675d69392a updating versions 2018-02-27 12:52:48 +01:00
61e7c0148f updating versions to 3.1.0 2018-02-27 12:40:53 +01:00
7364f674ed [JUNGFRAU] - Modified memory map address shift for the interface between FPGA and Blackfin SOM. Shift has to be set to 1 since the basic AMC data transfers is 8-bit and not 16-bit. 2018-02-22 11:15:24 +01:00
a536f8ac9b added png and Qt in CMakesList for gui 2018-02-19 17:44:57 +01:00
d48ca4a9fe merge from 3.0.1 in readme and makefle for manual 2018-02-09 14:12:27 +01:00
459b588b9f merge from 3.0.1 for gotthard 25um server start acq delay 2018-02-08 15:17:52 +01:00
8bf03a7712 Merge branch '3.0.1' into developer 2018-02-08 15:16:49 +01:00
895f8ccf81 Merge branch '3.0.1' into developer 2018-02-08 14:51:20 +01:00
a654febb7e merge from 3.0.1 parallalize dr 2018-02-07 15:48:39 +01:00
aa190fda7a merge from 3.0.1: eiger server detip and mac client updated back 2018-02-07 15:24:44 +01:00
897cbac27d merge from 3.0.1 for server binaries (adcphase,server dates, temp control, settings file 2018-02-07 11:02:36 +01:00
3da6a6df65 merge conflict removed, jungfrau server and eiger server re compiled 2018-02-05 12:33:05 +01:00
08fda2b662 in between in terms of mythen3 server, done with setdac and set power 2018-02-01 17:48:43 +01:00
6af3a6d33a Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2018-01-31 11:46:17 +01:00
b11b2dcfa9 in between stage 2018-01-31 11:45:34 +01:00
3782a56ef2 second My3 commit 2018-01-30 11:02:08 +01:00
e95b444908 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2018-01-30 10:25:21 +01:00
d1ef6bf94b some fixes in the cluster finder 2018-01-30 10:24:56 +01:00
3aeb3f58d1 first mythen3Server commit 2018-01-22 14:01:46 +01:00
09a707d7ff Merge branch '3.0.1' into developer 2018-01-19 16:12:36 +01:00
f264691dc1 renamed sebastians interpolation - must be edited to avoid root 2018-01-18 18:08:55 +01:00
3854c82b90 added iterative interpolation 2018-01-18 18:07:58 +01:00
92b4b3324e first mythen3 server commit 2018-01-18 09:25:06 +01:00
ac536ebdf7 cluster finder for phoenix data (i.e. old raw data format) 2018-01-15 11:52:28 +01:00
59c0861131 Merge branch '3.0.1' into developer 2017-12-19 17:51:31 +01:00
31589ce352 added and fixed gotthard 25um file and zmq photon finder 2017-12-19 13:40:05 +01:00
7602ffc5ac gotthard on the fly to be stested 2017-12-14 17:01:28 +01:00
13078d0ef2 gotthardDataStructures added 2017-12-14 17:00:30 +01:00
9f3468bd15 Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer 2017-12-14 16:59:04 +01:00
b50c1d966a on the fly moench photon finder and cluster saving 2017-12-14 16:58:22 +01:00
65a91c519e Merge branch '3.0.1' into developer 2017-12-14 14:29:16 +01:00
5958cf9278 Merge remote branch 'slsDetectorCalibration/developer' into developer 2017-12-12 11:14:38 +01:00
f6e1c21137 Merge branch '3.0.1' into developer 2017-12-12 09:05:50 +01:00
d2319459df Merge branch '3.0.1' into developer 2017-12-11 18:03:01 +01:00
d6bdbf8524 Merge branch '3.0.1' into developer 2017-12-11 13:51:20 +01:00
4c0a16cd75 Merge branch '3.0.1' into developer 2017-12-11 11:13:32 +01:00
e39d0aee56 Merge branch '3.0.1' into developer 2017-12-11 10:51:28 +01:00
1e849097ea merge conflict fixed in filename bug 2017-12-08 12:09:10 +01:00
7577d03e75 Merge branch '3.0.1' into developer 2017-12-08 11:50:15 +01:00
6e876d79ee conflict merged fix, lockin in stop and startandreadallnowait, r_restreamstop moved to stop 2017-12-08 11:45:29 +01:00
4718378d0a corrected bug fix in r_restreamstop 2017-12-06 19:21:28 +01:00
24c305ec59 solved conflicts from merge of version being used to binary 2017-12-06 19:07:06 +01:00
1bf7b4a6a1 directory restuctured 2017-12-06 09:10:13 +01:00
2f3dc8d109 Merge branch '3.0.1' into developer 2017-12-06 08:44:21 +01:00
7e932bf84b Merge branch '3.0.1' into developer 2017-12-05 16:04:26 +01:00
98e09b29d5 merge conflict solved -1 in adc in gui 2017-12-05 15:39:02 +01:00
a51f4f1252 Merge branch '3.0.1' into developer 2017-12-05 14:49:32 +01:00
2d14da545d Merge branch '3.0.1' into developer 2017-12-05 13:47:09 +01:00
9150556209 merge from 3.0.1 added more to write config/paramters 2017-12-05 13:42:35 +01:00
3b684c4662 Merge branch '3.0.1' into developer 2017-12-05 13:41:26 +01:00
0ef52138e1 merge conflict sorted, removing rest 2017-12-05 11:25:10 +01:00
28211af5af Makefile for Receiver merged incorrectly sometime back, also in archived project 2017-12-05 11:23:35 +01:00
2ae5a959fe fix in receiver merge conflict (before the respos merge) 2017-12-04 18:35:57 +01:00
263d702535 Merge remote branch 'slsDetectorGui/developer' into developer 2017-12-04 16:48:32 +01:00
7512f818cb Merge remote branch 'slsReceiverSoftware/developer' into developer 2017-12-04 16:48:32 +01:00
25023f6971 Merge remote branch 'slsDetectorSoftware/developer' into developer 2017-12-04 16:48:30 +01:00
9f152ce1f3 merge conflict resolved 2017-12-01 12:44:34 +01:00
12348ac76c merge conflict fix 2017-12-01 09:20:44 +01:00
0e26734023 restreaming stop fix 2017-11-30 19:13:55 +01:00
fd64ba289e Merge branch '3.0.1' into developer 2017-11-30 19:07:21 +01:00
6f3898441e merge conflict from 3.0.1 to restream stop from recieveR 2017-11-30 19:05:47 +01:00
5b88203bd9 merge conflict from 3.0.1 to restream stop from recieveR 2017-11-30 19:05:35 +01:00
385e6714cc merge conflict from 3.0.1 to restream stop from recieveR 2017-11-30 19:05:19 +01:00
1edb41242c ensure gui gets measurement finished after dummy packet received from receiver/ext process 2017-11-29 15:22:10 +01:00
397344a264 Merge branch '3.0.1' into developer 2017-11-29 12:13:09 +01:00
e17e4c3171 Merge branch '3.0.1' into developer 2017-11-28 18:50:27 +01:00
8bba57e77d fix to not have sls_receiver_defs in zmqSocket.h incldue 2017-11-28 16:32:15 +01:00
7c1423d654 zmqip fix to restart reciever streaming form command line, fix to not have sls_receiver_defs in zmqSocket.h incldue 2017-11-28 16:31:43 +01:00
8388d1f503 using file index from zmq 2017-11-28 14:45:48 +01:00
6a41b5ce3a using file index from zmq 2017-11-28 14:45:29 +01:00
1c606df752 using file index from zmq 2017-11-28 14:45:01 +01:00
1e85482d09 make updated 2017-11-28 11:30:23 +01:00
a89847538d merge ocnflict for white background 2017-11-28 11:29:15 +01:00
130f3d2e6f Merge branch '3.0.1' into developer 2017-11-28 11:18:43 +01:00
57fc89a6bb comment users 2017-11-28 10:51:05 +01:00
f49998ccd9 Merge branch '3.0.1' into developer 2017-11-28 10:35:24 +01:00
41f24489bc zmqip in users fixed 2017-11-28 10:33:40 +01:00
addf964901 Merge branch '3.0.1' into developer 2017-11-28 09:37:09 +01:00
bca7c649d7 Merge branch '3.0.1' into developer 2017-11-28 09:37:09 +01:00
747e9af431 Merge branch '3.0.1' into developer 2017-11-28 09:26:55 +01:00
620f7651a0 Merge branch '3.0.1' into developer 2017-11-28 09:24:57 +01:00
4466213882 makng the zmq work without external flag 2017-11-27 17:06:27 +01:00
ca19993149 makng the zmq work without external flag 2017-11-27 17:06:18 +01:00
e29371ca8d makng the zmq work without external flag 2017-11-27 17:06:11 +01:00
3439ccbec9 updates for merge for r_readfreq without reciever 2017-11-23 18:30:48 +01:00
a0c9018455 Merge branch '3.0.1' into developer 2017-11-23 18:24:34 +01:00
f0431bd873 Merge branch '3.0.1' into developer 2017-11-23 18:24:33 +01:00
ab5229bcbf bugfix zmq ip was being overwritten 2017-11-23 17:48:30 +01:00
585661412c Merge branch '3.0.1' into developer 2017-11-23 17:20:13 +01:00
935fecefde copy zmq ip even if receiver not online, else it is lost 2017-11-23 17:18:40 +01:00
2c276db579 solved merge conflict in changes to use ZmqSocket.h externally 2017-11-23 16:35:31 +01:00
a57e8edd88 jctb setting dr correctly 2017-11-23 16:15:38 +01:00
2ac170db98 removed data streaming shutdown from command line to allow external gui 2017-11-23 11:52:46 +01:00
ab93835ce2 merge conflict to include datastreaming in client comment 2017-11-23 10:29:08 +01:00
43140811bd one measurement in users class 2017-11-23 10:25:35 +01:00
34908edd6a Merge branch '3.0.1' into developer 2017-11-23 10:22:03 +01:00
29f3387d73 Merge branch '3.0.1' into developer 2017-11-23 09:34:22 +01:00
a1d325a115 Merge branch '3.0.1' into developer 2017-11-23 09:20:22 +01:00
3034cf87d0 changes that might be reverted in detser 2017-11-23 09:20:20 +01:00
0b45d73e0c Merge branch '3.0.1' into developer 2017-11-22 18:02:45 +01:00
c0bfe46aa1 enabling client in developer user api 2017-11-22 18:00:41 +01:00
26829585dc Merge branch '3.0.1' into developer 2017-11-22 17:47:28 +01:00
c0a1f83691 Merge branch '3.0.1' into developer 2017-11-22 17:43:49 +01:00
fb3c903c04 Merge branch '3.0.1' into developer 2017-11-22 17:06:51 +01:00
db6947cc9c Merge branch 'developer' of git.psi.ch:sls_detectors_software/sls_detector_software into developer 2017-11-22 15:08:33 +01:00
590fac9e07 making nx and ny available for jctb in call back 2017-11-22 15:08:09 +01:00
400585be6a Merge branch 'developer' of git.psi.ch:sls_detectors_software/sls_detector_software into developer 2017-11-22 12:34:28 +01:00
dcfa6fb100 Fixed filename problem with CPU readout and trimval command for mythen 2017-11-22 12:34:14 +01:00
39a20e1616 comment 2017-11-22 11:34:55 +01:00
114c45c04a making gui work temporarily for jctb 2017-11-22 09:27:42 +01:00
4159e83fd6 making gui work temporarily for jctb 2017-11-22 09:27:01 +01:00
3a26c95c0d Merge branch '3.0.1' into developer 2017-11-21 15:46:21 +01:00
f2f00fec06 Merge branch '3.0.1' into developer 2017-11-21 15:35:19 +01:00
7f58b77dfb Merge branch '3.0.1' into developer 2017-11-21 15:12:32 +01:00
5d34358f44 changin zmqip in rxr should also restart streaming 2017-11-21 15:11:29 +01:00
8328b30cbd removed merge conflicts from bug fix of zmq buffering while acquire from command line 2017-11-21 14:58:07 +01:00
9c55cb4974 removed merge conflicts from bug fix of zmq buffering while acquire from command line 2017-11-21 14:57:52 +01:00
a0ad1fb3a3 Merge branch '3.0.1' into developer 2017-11-21 14:15:59 +01:00
2067f47f34 Merge branch '3.0.1' into developer 2017-11-21 14:15:59 +01:00
46aeee00f1 somewhere 2017-11-21 12:30:58 +01:00
5f0575236e Merge branch 'developer' of git.psi.ch:sls_detectors_software/sls_detector_software into developer 2017-11-21 12:10:33 +01:00
45e0cf71eb put trimval should work also for MYTHEN 2017-11-21 12:09:52 +01:00
bd228fac27 bug fix in cleanup code, indexing 2017-11-20 17:19:03 +01:00
b7ca7f5319 just cleanuped code 2017-11-20 17:15:13 +01:00
11c9ab16f9 Merge branch '3.0.1' into developer 2017-11-20 16:44:21 +01:00
e6d22a97e2 Merge branch '3.0.1' into developer 2017-11-20 15:14:13 +01:00
99037449f4 in between moench stuff 2017-11-20 14:23:32 +01:00
97260510f2 gap pixels should be allowed to set to 0 for other detectors 2017-11-20 09:43:41 +01:00
662f502d4c zmq always needs an ip in header 2017-11-17 17:40:57 +01:00
c5c23e73d5 works zmq separated for client and rx, ports and ip included in expert advanced mode 2017-11-17 17:39:04 +01:00
70e4c6e2a2 zmq separated for client and rx, ports and ip included in expert advanced mode 2017-11-17 17:37:00 +01:00
428855d801 in between 2017-11-17 14:02:00 +01:00
2e234f1bbd Merge branch '3.0.1' into developer 2017-11-17 11:36:02 +01:00
1dee950870 merge conflict from 3.0.1 2017-11-17 11:35:15 +01:00
51499fa503 merge conflict from 3.0.1 2017-11-17 11:35:02 +01:00
dcf4d98a75 show warnings, update binaries conflict from merge 2017-11-17 11:33:52 +01:00
28e2ebf75a merge conflict resolved from 3.0.1 2017-11-17 09:40:42 +01:00
bf89dd44f3 updated binaries 2017-11-16 12:34:12 +01:00
d9fcac0236 updated merge from 3.0 hotfix setdac 2017-11-16 12:32:38 +01:00
7f256c868b fixed bug for 1D detector in slsDetectorData 2017-11-15 14:39:35 +01:00
06b9efd229 modifications for on the fly analysis working at cSAXS 2017-11-15 12:23:21 +01:00
9ad0fd0bc9 modifications for on the fly analysis working at cSAXS 2017-11-15 12:21:58 +01:00
7c9958db04 updated binary merge from 3.0 regarding settings 2017-11-15 10:36:55 +01:00
956625bb50 Merge branch '3.0' into developer 2017-11-15 10:35:20 +01:00
4f74f6d08f Merge branch '3.0.1' into developer 2017-11-14 15:19:14 +01:00
2d962dfead Merge branch '3.0.1' into developer 2017-11-14 12:43:19 +01:00
db2fef5d69 conflict resolved in merge from 3.0.1 to include file index in zmq streaming 2017-11-14 12:14:26 +01:00
cf4498cf78 Merge branch '3.0.1' into developer 2017-11-14 10:59:01 +01:00
c127eebeaa Merge branch '3.0.1' into developer 2017-11-14 09:13:39 +01:00
363aa9124e Merge branch '3.0.1' into developer 2017-11-14 09:08:16 +01:00
8872f86e31 Merge branch '3.0.1' into developer 2017-11-13 15:32:47 +01:00
4c4a26c0e3 Merge branch '3.0.1' into developer 2017-11-13 13:39:39 +01:00
e33ba2cd76 merge from 3.0.1 compiling with rpath and updating detector binaries 2017-11-13 12:32:08 +01:00
1af065fdb1 infinite loop with gettotalnumberofchannels in gappixels initialization resulting in bus error fix 2017-11-13 11:13:26 +01:00
678ef89e17 conflict resolved from merge developer to gappixels insignificant 2017-11-10 16:54:18 +01:00
dc70c45ef2 Merge branch 'developer' into gappixels 2017-11-10 16:53:14 +01:00
c0ec315b04 Merge branch 'developer' into gappixels 2017-11-10 16:53:14 +01:00
6fa4e4cef8 Merge branch '3.0.1' into gappixels 2017-11-10 16:37:28 +01:00
3886a0c9ad merge fix from 3.0.1 regarding gethostbyname thread safety 2017-11-10 16:37:20 +01:00
5b65d44303 Merge branch '3.0.1' into developer 2017-11-10 16:34:43 +01:00
23ddb3d4b5 merge fix from 3.0.1 regarding gethostbyname thread safety 2017-11-10 16:34:31 +01:00
a2210c0118 Merge branch '3.0.1' into gappixels 2017-11-09 14:08:04 +01:00
6d0f751104 Merge branch '3.0.1' into developer 2017-11-09 14:07:48 +01:00
3c6d572369 including dynamic range in gui call back 2017-11-02 11:02:40 +01:00
7ba90f98fc including dynamic range in gui call back 2017-11-02 11:02:22 +01:00
589a5c7852 Merge branch '3.0.1' into gappixels 2017-11-02 10:55:05 +01:00
0df4576874 Merge branch '3.0.1' into developer 2017-11-02 10:54:40 +01:00
82f503aa09 dynamic range also updates offsets, 4 bit mode gap pixels work in call back from gui 2017-10-31 12:50:31 +01:00
3da8bca462 allowing receiver to know of gap pixels enable even in 4 bit mode, but not doing anything useful 2017-10-31 12:39:36 +01:00
9d4c14b724 gap pixels should now work for 4 bit mode and a bug fix in decoding for 4 bit mode 2017-10-31 12:38:42 +01:00
6ff249c3f2 Merge branch 'developer' into gappixels 2017-10-27 16:18:52 +02:00
e12229633c update binaries 2017-10-27 16:18:21 +02:00
b75dde4613 merge bug fix of set module 2017-10-27 16:17:12 +02:00
f6989d5539 merge bug fix of set module 2017-10-27 16:16:38 +02:00
7ff23b25b3 merge bug fix of set module 2017-10-27 16:16:29 +02:00
79bce5e006 4 bit mode works without gappixels 2017-10-26 16:01:18 +02:00
9c82a8f726 temp in between, trying to get 4 bitmode to work without gap pixels 2017-10-26 11:19:58 +02:00
6812961836 temp in between, trying to get 4 bitmode to work without gap pixels 2017-10-26 11:09:55 +02:00
003239cddd gap pixels for 4 bit mode restrictions, not completed 2017-10-24 14:16:08 +02:00
ce7386e230 merge solved from developer, xcoord from detector if given 2017-10-23 17:21:45 +02:00
fde4194f9b merged with developer, receiver call back merged with no call back 2017-10-23 17:12:00 +02:00
7f9ac86862 Merge branch 'developer' into gappixels 2017-10-23 17:09:13 +02:00
16a939c0c0 Merge branch '3.0.1' into developer 2017-10-23 17:08:12 +02:00
4084e2c31e updated release doc 2017-10-23 17:06:12 +02:00
1f138abac1 fix in receiver as x, y and z are properly integrated with detector server for eiger and jungfrau, and handling previous versions of detector where x y and z were all 0 (hardcoding them in 1 d) 2017-10-23 12:21:41 +02:00
d2fd0cbee9 x y and z coordinates are pushed into eiger server and its fixed in appropriate client side as well 2017-10-23 12:20:18 +02:00
210bcb081d xcoord should not be hardcoded for this version for eiger and jungfrau 2017-10-20 10:49:02 +02:00
673b7f1652 merge conflict fixed with developer 2017-10-19 15:36:28 +02:00
b6ae3300a9 merge conflict fixed with developer(patches for file write disable, xcoord) 2017-10-19 15:35:34 +02:00
801817b749 bug fix to the merge 2017-10-19 14:41:12 +02:00
1cddb9a542 merge from 3.0.1 with patches for file write disable 2017-10-18 17:53:55 +02:00
927e776353 Merge branch 'developer' into gappixels 2017-10-12 15:09:35 +02:00
36a200ceba Merge branch 'developer' into gappixels 2017-10-12 15:09:30 +02:00
0fe43c75f2 merge branch developer into gappixels, added .project into gitignore 2017-10-12 15:08:32 +02:00
4d92744dea .project added to gitignore 2017-10-12 15:08:12 +02:00
ae72df7b14 .project added to gitignore 2017-10-12 15:07:54 +02:00
e814aee300 .project added to gitignore 2017-10-12 15:07:33 +02:00
4f2af046d3 Merge branch 'developer' into gappixels 2017-10-12 14:58:41 +02:00
91588ecc21 Merge branch 'developer' into gappixels 2017-10-12 14:58:25 +02:00
d2767afa7c added the eiger server binary with merges from 3.0.1 2017-10-12 14:57:12 +02:00
311059d748 merge fix from 3.0.1 which includes server without crash, multi settimer -1 bug, need to recompile eiger server for this branch 2017-10-12 14:42:57 +02:00
10e57319bf moench03OnTheFlyAnalysis multipthreaded with interpolation works 2017-10-12 10:31:11 +02:00
2e5f64d9bc gap pixels for 8, 16, 32 in receiver at udp level 2017-10-05 15:59:07 +02:00
0d92b11055 print out comment, not print if mythen else access to null 2017-10-05 15:58:37 +02:00
4260dc0baf conflict resolution 2017-10-03 15:18:56 +02:00
0f302e3446 conflict resolution 2017-10-03 15:17:15 +02:00
e54767b69d conflict resolution with developer 2017-10-03 15:12:56 +02:00
812606a7b4 conflict resolution with developer 2017-10-03 15:12:49 +02:00
fc025bd28b conflict resolution with developer 2017-10-03 15:12:35 +02:00
34f10b382e one more conflict resolved from mergin with 3.0.1 (silent mode, this had changes for zmq source ip) 2017-10-03 15:01:30 +02:00
0b82aabd2b merge with 3.0.1 conflicts resolved 2017-10-03 14:52:53 +02:00
03a2f979a9 fixing merge conflict in error_Defs 2017-10-03 14:32:30 +02:00
4669d408d4 somewhere in between 2017-10-03 12:09:31 +02:00
c594870fdd Merge branch 'realgappixels' into gappixels 2017-10-03 10:49:47 +02:00
34062b6e0b fixed 32 bit gui masking problem in qdrawplot (conversion from char* to double) mythen clause not activated 2017-10-03 10:49:26 +02:00
7cde5dbe38 changes upto the receiver, not incl gui 2017-10-03 10:44:08 +02:00
bb817733ff changes upto the receiver, not incl gui 2017-10-03 10:44:05 +02:00
7cf7d9eb79 changes upto the receiver, not incl gui 2017-10-03 10:44:01 +02:00
907ab2f0bd changes upto the receiver, not incl gui 2017-10-03 10:43:47 +02:00
d0b379a2d5 double* changed to char* in gui data call back, effect in receiver is change in zmqsocket.h from int* to char* 2017-10-02 13:21:49 +02:00
afc08f8c30 double* changed to char* in gui data call back, decoding to be done by caller. enablegappixels skeleton created 2017-10-02 13:21:38 +02:00
5a7800768b double* to char* in detector call back. 2017-10-02 13:20:19 +02:00
63c0fe863d missing packets 0xffff are also anded with the mask, fixed 2017-09-29 18:33:41 +02:00
fa79a36089 should work, but jungfrau needs debugging 2017-09-29 16:43:07 +02:00
9bdb361d08 works but needs to be verified. the void* in call back 2017-09-29 11:39:36 +02:00
1a8b0692fe works but needs to be verified. the void* in call back 2017-09-29 11:39:10 +02:00
352ade6457 just skeleton of gappixels 2017-09-27 17:08:00 +02:00
986826cbe9 x y z and id are written to the udp header for eiger 2017-09-26 16:39:02 +02:00
e0d82ad92d only 3d positins in x y z coord, so receiver not overwriting them 2017-09-22 15:29:28 +02:00
663fd557ff client gives now 3d positions of detector to be configured in udp header, only in jungfrau firmware till now 2017-09-22 15:28:57 +02:00
5a8f30fee8 Merge branch '3.0.1' of git.psi.ch:sls_detectors_software/sls_detector_software into developer 2017-09-22 12:28:24 +02:00
e8bb186ff8 removed setframeindexenable from being set by client, redundant. removed read_frame from list of functions, obsolete. 2017-09-22 12:25:08 +02:00
ab27437604 removed setframeindexenable from going to the receiver, it can figure it out on its own now 2017-09-22 12:23:39 +02:00
c2f6e5b20c modifying to adjust to common basic tests debug mode for jungfrau 2017-09-21 17:58:10 +02:00
7e0481eeff renamed server names 2017-09-21 16:45:40 +02:00
2b3d2bb4d7 removed changing number of samples by setting dynamic range 2017-09-21 16:36:33 +02:00
d8803ca5e4 improved library structure for analog detectors and interpolation t.b.t. 2017-09-21 15:03:43 +02:00
2bd5386c29 Merge branch '3.0.1' into developer 2017-09-21 13:35:16 +02:00
c5ff578d10 Merge branch '3.0.1' into developer 2017-09-21 13:35:16 +02:00
6eb5167c70 Merge branch '3.0.1' into developer 2017-09-21 13:35:16 +02:00
862169e178 jungfrau with the option to start in debug mode to bypass the checks and tests 2017-09-20 16:20:39 +02:00
e2832d2e1b Merge branch '3.0.1' into developer 2017-09-19 17:19:37 +02:00
092487c08e Merge branch '3.0.1' into developer 2017-09-19 17:19:36 +02:00
b78dcf869b Merge branch '3.0' into developer 2017-09-15 13:27:18 +02:00
c635b19941 fixed jungfrau image after programfpga, fixed resetfpga 2017-09-14 15:55:55 +02:00
5ff574b33f made default streamer to be the ip related to hostname, otherwise can be specified from the client, also made it compatible with chip test board detector now 2017-09-12 15:04:56 +02:00
49378e6d09 added streamsrcip command to be able to change the interface from which receiver streams data from 2017-09-12 14:33:11 +02:00
aef462da32 merge error fixed 2017-09-08 09:31:26 +02:00
1ba325e902 Merge branch 'developer' of git.psi.ch:sls_detectors_software/sls_detector_software into developer 2017-09-07 11:27:52 +02:00
1c14b146a2 T1 data structure from CPU added 2017-09-04 14:28:30 +02:00
e95ffde95d T1 data structure finally correct 2017-09-04 14:26:28 +02:00
4ed3859c75 Merge branch 'virtualclass' into developer 2017-09-01 15:40:28 +02:00
069d044e17 fixed gain plot, aspect ratio, 1/4size of mainplat, keeping limits also for gain plot at start up, removing gain plot titles 2017-09-01 15:37:05 +02:00
272167435d gainplot added, masking done separately before converting to double 2017-09-01 12:04:04 +02:00
277dc2cfd9 gainplot added for jungfrau, aspect ratio check in gui added, npixels-1 as endpixel bug fix 2017-09-01 12:03:09 +02:00
1510fa71d3 T1 data structure fixed 2017-09-01 10:08:07 +02:00
ca865a6636 Merge branch 'developer' of git.psi.ch:sls_detectors_software/sls_detector_software into developer 2017-08-16 09:27:48 +02:00
3aeb15648c Anna's modifications 2017-08-11 15:55:07 +02:00
52e1bd32b9 Anna's modifications 2017-08-11 15:52:08 +02:00
0b6aeac364 Merge branch 'developer' of git.psi.ch:sls_detectors_software/sls_detector_software into developer 2017-06-27 10:40:19 +02:00
ffd3cb6511 Merge branch 'developer' of git.psi.ch:sls_detectors_software/sls_detector_software into developer 2017-06-26 13:03:08 +02:00
dfb8a1f7ad small modifications for jctb and moench03 module 2017-06-26 13:03:01 +02:00
299 changed files with 16933 additions and 14326 deletions

View File

@ -1,10 +1,13 @@
### Documentation
Detailed documentation can be found on the [official site.](https://www.psi.ch/detectors/users-support)
### Binaries
Documentation to obtain the binaries via the conda package is available [here.](https://github.com/slsdetectorgroup/sls_detector_software)
### Source code
One can also obtain the source code from this repository and compile while realizing the setup dependencies as required.
```
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch 3.0.1
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git
```
#### Setup dependencies
@ -41,6 +44,9 @@ Usage: [-c] [-b] [-h] [-d HDF5 directory] [-j]<br>
* -g: Build/Rebuilds only gui<br>
* -j: Number of threads to compile through<br>
Basic Option:
./cmk.sh -b
For only make:
./cmk.sh

View File

@ -1,37 +1,31 @@
SLS Detector Package 3.0.1 released on 2018-02-12
SLS Detector Package 3.1.1 released on 2018-03-12
=================================================
INTRODUCTION
This document describes the differences between 3.0.0 and 3.0.1 release.
This document describes the differences between 3.1.0 and 3.1.0 releases.
The conda package of the binaries can be downloaded from
https://github.com/erikfrojdh/sls_detector_software.git
https://github.com/slsdetectorgroup/sls_detector_software.git
The conda package of the python API wrap-around to the software package is at
The Python interface to the software package (including the package) is at
https://github.com/slsdetectorgroup/sls_detector.git
Manual (both HTML and pdf versions) are provided in
manual/docs/
Documentation from Source Code can be found for the Command Line and C++ API in
Documentation from Source Code can be found for the Command Line and for the API in
html:
manual/docs/html/slsDetectorClientDocs/index.html
manual/docs/html/slsDetectorUsersDocs/index.html
pdf:
manual/docs/pdf/slsDetectorClientDocs.pdf
manual/docs/pdf/slsDetectorUsersDocs.pdf
Documentation to the python API is available at
https://slsdetectorgroup.github.io/sls_detector/
Example including binaries for detector and receiver user classes can be found in
manual/manual-api
@ -63,284 +57,53 @@ CONTENTS
Firmware Requirements
=====================
Please refer to the link below for more details on the firmware versions.
https://www.psi.ch/detectors/firmware.
Please refer to the link below for more details on the firmware versions.
https://www.psi.ch/detectors/firmware.
Gotthard
========
Minimum compatible version : old one
Latest version : 08.02.2018 (50um and 25um Master)
09.02.2018 (25 um Slave)
Gotthard
========
Minimum compatible version : 11.01.2013
Latest version : 08.02.2018 (50um and 25um Master)
09.02.2018 (25 um Slave)
-Can not be upgraded remotely.
Eiger
=====
Minimum compatible version : 16
Latest version : 21
Eiger
=====
Minimum compatible version : 16
Latest version : 20
-Can be upgraded remotely via bit files.
-Can be upgraded remotely via bit files.
Jungfrau
========
Minimum compatible version : 13.11.2017
Latest version : 13.11.2017
Jungfrau
========
Minimum compatible version : 13.11.2017
Latest version : 13.11.2017
-Can be upgraded remotely via sls_detector_put programfpga <pof>.
-Can be upgraded remotely via sls_detector_put programfpga <pof>.
Changes in User Interface
=========================
Client
------
1. Additional functions added for advanced users in users class:
(setSpeed, setClockDivider, setReadOutFlags, setDac, getADC,
setAllTrimbits, startReceiver, stopReceiver,
startAcquisition non blocking, setReceiverSilentMode, setHighVoltage,
enableDataStreamingToClient, enableDataStreamingFromReceiver,
setReceiverDataStreamingOutPort, setClientDataStreamingInPort)
2. Zmq set up for client and receiver are separated.
zmqport for client and rx_zmqport for receiver. By default, they are the
same for the slsDetectorGui to work.
3. Users example also works without config file, where detector already
configured in shared memory.
4. Use "sls_detector_get busy 0" to clear acquiring flag in shared memory
caused due to an earlier interrupted acquisition from Ctrl+C"
5. Set bit, clear bit, read register and write register cannot give -1 for
inconsistent values from multiple detectors. One has to check error from
API or read the values individually.
6. multiSlsDetector::char* getSettingsFile() function signature has been
changed to string getSettingsFile().
Receiver
--------
7. Modified the help manaual/main-api/mainReceiver.cpp to make it more
robust (handling child process exit) and flexible to determine upon
start up the number of receivers (child processes), the start TCP port
and whether to call back data.
detReceiver is now executed with [start tcp port] [number of receivers]
[1 for call back, 0 for none] as arguments.
By default, start tcp port is 1954, number of receivers is 1, and call
back is initiated.
8. rx_datastream to enable/disable data streaming in receiver. Using the GUI
or registering data call back in client automatically enables zmq in
receiver and client. "externalgui" is removed from the command line. Use
this command instead.
9. Rx_tcpport argument to the slsReceiver can be given using -t.
Eg. slsReceiver -t1955
New Features
============
Package
-------
1. In addition to the C++ API, the Python API is also now provided.
2. CMAKE now with debug flag and rpath, show warnings, compile only certain
components (such as receiver or gui)
3. One repository for entire package and made available at github.
4. One can do --version or -v to all the binaries to find out the release
version of the particular executable.
5. All the software version numbers have only date in format YYMMDD.
Client
------
6. Parallelized more commands to detector. Beneficial for large detectors.
(setTimer, setFileIndex, setOnline, setReceiverOnline, getReceiverStatus,
resetFramesCaught, setFrameIndex, setFileName, getFramesCaughtByReceiver,
setDynamicRange, setRateCorrection)
Option to also use "sls_detector_put threaded 0" to improve speed by
eliminating progress display during acquisition. Effective only for
large detectors.
Detector Server
---------------
7. (Eiger) Virtual class to execute on pc.
8. One can now read temperatures during acquisition. It goes via the stop
server.
9. (Jungfrau) One can start server in "debug" mode and then program the
new firmware via software command "sls_detector_put programfpga xx.pof".
10. (Jungfrau) Server can exit on start up if either the firmware or the
server is incompatible with each other.
11. (Jungfrau) One is able to set transmission delay (ms) of image for each
individual detector using "txndelay_frame" command. Beneficial for
large detectors.
12. (Jungfrau) One can set a threshold temperature (temp_threshold) and
enable the temperature control feature (temp_control). When the
temperature (temp_fpga) overshoots the threshold temperature, it will
set the temperature event (temp_event) and power off the chip. One must
then switch off the detector and check cooling. Switching back on starts
with defaults.
13. (25um Gotthard) Added start acquisition delay to master module.
14. (Gotthard) New constraints include minimum exposure time is 186 ns and
minimum period is 1278 ns + current exposure time.
Receiver
--------
14. The detectorip and rx_udpip does not have to be in the same subnet anymore.
Add the following commands after rx_hostname in config file to overwrite
mac configuration:
rx_udpmac [router mac]
configuremac 0
15. Added silent mode to receiver using command r_silent [i] from client.
It might be beneficial for max frame rate applications.
16. Receiver print out can handle black or white backgrounds.
17. zmq package included updated to v4.0.8.
18. Zmq streaming from receiver also sends file index in json header.
Gui
---
18. If acquisition is done, but "stop dummy packet" to the gui was lost in
the network, stop acquisition command will restream it so that the gui
doesnt hang forever. This is used only for very fast detectors like
Moench.
Resolved Issues
===============
Client
------
1. gethostbyname used in connecting to sockets was not thread safe for
multiple detectors. Using getaddrinfo for stability in multi threaded
environment.
2. Updated writing content of config and parameter dump into files.
3. More locking to handle main and processing threads using the threadpool.
Removing unlock twice, which is undefined behavior.
Detector Server
---------------
4. (Eiger) The hardware MAC of the detector is used during configuration
and relayed back to client. Similarly, hardware IP for 1 Gbe data mode.
5. (Eiger) Status will return error if there was the unlikely trouble
reading status register in the front end board. Earlier, it would only
return idle.
6. (Jungfrau) patch server v3.0.0.6.3
Able to set settings, high voltage now correctly reads 0 when
switched off, dacs are properly set.
7. (Jungfrau) FPGA reset and programming FPGA firmware via software is done
properly
8. (Gotthard) patch server v3.0.0.5.1
Able to read temperature properly.
9. (Gotthard) butst mode if set too fast had unwanted behavior such as
sending same image continuously. Now it is handled to display error
and stop acquisition.
10. (Gotthard) completely removed the possibility to set timing modes
other than auto and trigger as they are not implemented anyway. Also
signal index 1, 2 and 3 are reserved and hence, cannot be configured for
an external trigger.
11. Non Mythen and non Eiger detectors can also now get settings file from
board.
12. (Gotthard) Did not get first few images initially after configuring MAC
of detector. Fixed.
Receiver
--------
12. Made it easier to disable the standard receiver and fixing bugs related
to the use of a custom one.
13. (Jungfrau) HDF5 dimensions (npixelsY) required for mapping fixed.
14. patch2-v3.0.0-slsReceiverSoftware.patch
x, y and z coordinates in the call backs and the files are hardcoded
for this release.
15. Rest implementation (not used by standard receiver) removed.
Gui
---
16. patch1-v3.0.0-slsDetectorGui.patch
(Eiger) In expert mode and in advanced tab, when trimbits
loaded are different for every pixel, the gui complains and sets
all trimbits to zero. This has been resolved. Now, the "Set All
Trimbits" field is just set to -1.
17. Fixed segmentation fault of xputsn properly.
18. Upon clicking on "Start", clears acquiring flag in shared memory
caused due to an earlier interrupted acquisition from Ctrl+C"
19. Fixed plotting twice caused due to unzooming the first time.
20. Removed option for compression in Gui as it is not available currently.
21. Can also show Jungfrau multi detector in x direction in gui.
22. Switching tabs sometimes results in delay and gates fields being incorrectly
enabled. Fixed.
Known Issues
============
Client
------
1. File name prefix can only be done at multi deector level. Changing at
individual detector level will not include scan or position variables.
Detector Server
---------------
2. Standard header fills x-coord in 1D. y-coord and z-coord is not
implemented (3D).
Receiver
--------
3. HDF5 compression and filters are not implemented yet.

View File

@ -1,13 +0,0 @@
No implementation found for style `graphicx'
No implementation found for style `eucal'
No implementation found for style `amsxtra'
No implementation found for style `upref'
No implementation found for style `layout'
No implementation found for style `calc'
No implementation found for style `framed'
? brace missing for \
Substitution of arg to newlabelxx delayed.
? brace missing for \textit

View File

@ -1,101 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 2008 (1.71)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Footnotes</TITLE>
<META NAME="description" CONTENT="Footnotes">
<META NAME="keywords" CONTENT="slsDetectors-FAQ">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="slsDetectors-FAQ.css">
</HEAD>
<BODY >
<DL>
<DT><A NAME="foot1316">... tab&nbsp;</A><A
HREF="MYTHEN.html#tex2html20"><SUP>3.1</SUP></A></DT>
<DD>The default name of the calibrated trimfiles is <I>trimbits/beamline/</I><I>settings</I><I>/noise.snxxx</I> where <I>settings</I> is the chosen settings. You can change it in <I>src/qDetector.h</I> and then recompile the acquisition program as described in&nbsp;<A HREF="#sec:installation"><IMG ALIGN="BOTTOM" BORDER="1" ALT="[*]"
SRC="file:/usr/share/latex2html/icons/crossref.png"></A>.
<PRE>.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
</PRE>
</DD>
<DT><A NAME="foot1317">....snxxx&nbsp;</A><A
HREF="MYTHEN.html#tex2html21"><SUP>3.2</SUP></A></DT>
<DD>The default name of the calibration file <I>calibration/</I><I>settings</I><I>.snxxx</I> where <I>settings</I> is the chosen settings. You can change it in <I>src/qDetector.h</I> and then recompile the acquisition program.
<PRE>.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
</PRE>
</DD>
</DL>
</BODY>
</HTML>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1,41 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 2008 (1.71)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>SLS Detectors
Frequently Asked Questions</TITLE>
<META NAME="description" CONTENT="SLS Detectors
Frequently Asked Questions">
<META NAME="keywords" CONTENT="slsDetectors-FAQ">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="slsDetectors-FAQ.css">
</HEAD>
<BODY >
<P>
<H1 ALIGN=CENTER>SLS Detectors
<BR>
Frequently Asked Questions</H1>
<P ALIGN=CENTER><STRONG>Anna Bergamaschi</STRONG>
</P>
<BR><P ALIGN=CENTER><B>Date:</B> February 27, 2018</P>
<HR>
<BR><HR>
</BODY>
</HTML>

View File

@ -1,134 +0,0 @@
# LaTeX2HTML 2008 (1.71)
# Associate internals original text with physical files.
$key = q/sec:usersFunc/;
$ref_files{$key} = "$dir".q|How_can_detector_movement_p.html|;
$noresave{$key} = "$nosave";
$key = q/sec:merging/;
$ref_files{$key} = "$dir".q|How_are_different_positions.html|;
$noresave{$key} = "$nosave";
$key = q/sec:timing/;
$ref_files{$key} = "$dir".q|How_can_I_synchronize_my.html|;
$noresave{$key} = "$nosave";
$key = q/fig:gating/;
$ref_files{$key} = "$dir".q|How_can_I_synchronize_my.html|;
$noresave{$key} = "$nosave";
$key = q/sec:improvetrimming/;
$ref_files{$key} = "$dir".q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/fig:multidet/;
$ref_files{$key} = "$dir".q|How_can_I_control_many.html|;
$noresave{$key} = "$nosave";
$key = q/eq:acqflow/;
$ref_files{$key} = "$dir".q|Which_is_sequence_acquisiti.html|;
$noresave{$key} = "$nosave";
$key = q/fig:autotiming/;
$ref_files{$key} = "$dir".q|How_can_I_synchronize_my.html|;
$noresave{$key} = "$nosave";
$key = q/sec:3/;
$ref_files{$key} = "$dir".q|Scaling_Poisson_variates.html|;
$noresave{$key} = "$nosave";
$key = q/fig:samplefluo/;
$ref_files{$key} = "$dir".q|How_do_I_chose_comparator.html|;
$noresave{$key} = "$nosave";
$key = q/fig:settings/;
$ref_files{$key} = "$dir".q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/sec:2/;
$ref_files{$key} = "$dir".q|Advanced_binning.html|;
$noresave{$key} = "$nosave";
$key = q/fig:effidet/;
$ref_files{$key} = "$dir".q|Sensors.html|;
$noresave{$key} = "$nosave";
$key = q/sec:11/;
$ref_files{$key} = "$dir".q|Basic_binning.html|;
$noresave{$key} = "$nosave";
$key = q/fig:thrscanfluo/;
$ref_files{$key} = "$dir".q|How_do_I_chose_comparator.html|;
$noresave{$key} = "$nosave";
$key = q/sec:dataFormat/;
$ref_files{$key} = "$dir".q|In_which_data_format_are.html|;
$noresave{$key} = "$nosave";
$key = q/fig:mythensett/;
$ref_files{$key} = "$dir".q|Frontend_electronics.html|;
$noresave{$key} = "$nosave";
$key = q/sec:sync/;
$ref_files{$key} = "$dir".q|How_can_several_controllers.html|;
$noresave{$key} = "$nosave";
$key = q/fig:badff/;
$ref_files{$key} = "$dir".q|Why_isn_t_my_flat_field_fla.html|;
$noresave{$key} = "$nosave";
$key = q/fig:datareceiver/;
$ref_files{$key} = "$dir".q|How_can_I_configure_data.html|;
$noresave{$key} = "$nosave";
$key = q/fig:effiback/;
$ref_files{$key} = "$dir".q|Sensors.html|;
$noresave{$key} = "$nosave";
$key = q/fig:trig/;
$ref_files{$key} = "$dir".q|How_can_I_synchronize_my.html|;
$noresave{$key} = "$nosave";
$key = q/fig:ffsetup/;
$ref_files{$key} = "$dir".q|Dynamic_acquisition_flat_fi.html|;
$noresave{$key} = "$nosave";
$key = q/fig:thresholdscanuntrimmed/;
$ref_files{$key} = "$dir".q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/fig:trimdistribution/;
$ref_files{$key} = "$dir".q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/sec:angcal/;
$ref_files{$key} = "$dir".q|How_is_channel_number_cover.html|;
$noresave{$key} = "$nosave";
$key = q/sec:trimdir/;
$ref_files{$key} = "$dir".q|What_are_settings_calibrati.html|;
$noresave{$key} = "$nosave";
$key = q/fig:trimplot/;
$ref_files{$key} = "$dir".q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/fig:thresholdscantrimmed/;
$ref_files{$key} = "$dir".q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/sec:noisetrim/;
$ref_files{$key} = "$dir".q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/sec:encal/;
$ref_files{$key} = "$dir".q|In_what_consists_energy_cal.html|;
$noresave{$key} = "$nosave";
$key = q/fig:thrscan/;
$ref_files{$key} = "$dir".q|How_do_I_chose_comparator.html|;
$noresave{$key} = "$nosave";
1;

View File

@ -1,269 +0,0 @@
# LaTeX2HTML 2008 (1.71)
# Associate labels original text with physical files.
$key = q/sec:usersFunc/;
$external_labels{$key} = "$URL/" . q|How_can_detector_movement_p.html|;
$noresave{$key} = "$nosave";
$key = q/sec:merging/;
$external_labels{$key} = "$URL/" . q|How_are_different_positions.html|;
$noresave{$key} = "$nosave";
$key = q/sec:timing/;
$external_labels{$key} = "$URL/" . q|How_can_I_synchronize_my.html|;
$noresave{$key} = "$nosave";
$key = q/fig:gating/;
$external_labels{$key} = "$URL/" . q|How_can_I_synchronize_my.html|;
$noresave{$key} = "$nosave";
$key = q/sec:improvetrimming/;
$external_labels{$key} = "$URL/" . q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/fig:multidet/;
$external_labels{$key} = "$URL/" . q|How_can_I_control_many.html|;
$noresave{$key} = "$nosave";
$key = q/eq:acqflow/;
$external_labels{$key} = "$URL/" . q|Which_is_sequence_acquisiti.html|;
$noresave{$key} = "$nosave";
$key = q/fig:autotiming/;
$external_labels{$key} = "$URL/" . q|How_can_I_synchronize_my.html|;
$noresave{$key} = "$nosave";
$key = q/sec:3/;
$external_labels{$key} = "$URL/" . q|Scaling_Poisson_variates.html|;
$noresave{$key} = "$nosave";
$key = q/fig:samplefluo/;
$external_labels{$key} = "$URL/" . q|How_do_I_chose_comparator.html|;
$noresave{$key} = "$nosave";
$key = q/fig:settings/;
$external_labels{$key} = "$URL/" . q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/sec:2/;
$external_labels{$key} = "$URL/" . q|Advanced_binning.html|;
$noresave{$key} = "$nosave";
$key = q/fig:effidet/;
$external_labels{$key} = "$URL/" . q|Sensors.html|;
$noresave{$key} = "$nosave";
$key = q/sec:11/;
$external_labels{$key} = "$URL/" . q|Basic_binning.html|;
$noresave{$key} = "$nosave";
$key = q/fig:thrscanfluo/;
$external_labels{$key} = "$URL/" . q|How_do_I_chose_comparator.html|;
$noresave{$key} = "$nosave";
$key = q/sec:dataFormat/;
$external_labels{$key} = "$URL/" . q|In_which_data_format_are.html|;
$noresave{$key} = "$nosave";
$key = q/fig:mythensett/;
$external_labels{$key} = "$URL/" . q|Frontend_electronics.html|;
$noresave{$key} = "$nosave";
$key = q/sec:sync/;
$external_labels{$key} = "$URL/" . q|How_can_several_controllers.html|;
$noresave{$key} = "$nosave";
$key = q/fig:badff/;
$external_labels{$key} = "$URL/" . q|Why_isn_t_my_flat_field_fla.html|;
$noresave{$key} = "$nosave";
$key = q/fig:datareceiver/;
$external_labels{$key} = "$URL/" . q|How_can_I_configure_data.html|;
$noresave{$key} = "$nosave";
$key = q/fig:effiback/;
$external_labels{$key} = "$URL/" . q|Sensors.html|;
$noresave{$key} = "$nosave";
$key = q/fig:trig/;
$external_labels{$key} = "$URL/" . q|How_can_I_synchronize_my.html|;
$noresave{$key} = "$nosave";
$key = q/fig:ffsetup/;
$external_labels{$key} = "$URL/" . q|Dynamic_acquisition_flat_fi.html|;
$noresave{$key} = "$nosave";
$key = q/fig:thresholdscanuntrimmed/;
$external_labels{$key} = "$URL/" . q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/fig:trimdistribution/;
$external_labels{$key} = "$URL/" . q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/sec:angcal/;
$external_labels{$key} = "$URL/" . q|How_is_channel_number_cover.html|;
$noresave{$key} = "$nosave";
$key = q/sec:trimdir/;
$external_labels{$key} = "$URL/" . q|What_are_settings_calibrati.html|;
$noresave{$key} = "$nosave";
$key = q/fig:trimplot/;
$external_labels{$key} = "$URL/" . q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/fig:thresholdscantrimmed/;
$external_labels{$key} = "$URL/" . q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/sec:noisetrim/;
$external_labels{$key} = "$URL/" . q|MYTHEN.html|;
$noresave{$key} = "$nosave";
$key = q/sec:encal/;
$external_labels{$key} = "$URL/" . q|In_what_consists_energy_cal.html|;
$noresave{$key} = "$nosave";
$key = q/fig:thrscan/;
$external_labels{$key} = "$URL/" . q|How_do_I_chose_comparator.html|;
$noresave{$key} = "$nosave";
1;
# LaTeX2HTML 2008 (1.71)
# labels from external_latex_labels array.
$key = q/sec:usersFunc/;
$external_latex_labels{$key} = q|1.10|;
$noresave{$key} = "$nosave";
$key = q/sec:merging/;
$external_latex_labels{$key} = q|5.2|;
$noresave{$key} = "$nosave";
$key = q/sec:timing/;
$external_latex_labels{$key} = q|1.8|;
$noresave{$key} = "$nosave";
$key = q/fig:gating/;
$external_latex_labels{$key} = q|1.4|;
$noresave{$key} = "$nosave";
$key = q/sec:improvetrimming/;
$external_latex_labels{$key} = q|3.4.1|;
$noresave{$key} = "$nosave";
$key = q/fig:multidet/;
$external_latex_labels{$key} = q|1.1|;
$noresave{$key} = "$nosave";
$key = q/eq:acqflow/;
$external_latex_labels{$key} = q|1.7|;
$noresave{$key} = "$nosave";
$key = q/fig:autotiming/;
$external_latex_labels{$key} = q|1.3|;
$noresave{$key} = "$nosave";
$key = q/sec:3/;
$external_latex_labels{$key} = q|5.2.6|;
$noresave{$key} = "$nosave";
$key = q/fig:samplefluo/;
$external_latex_labels{$key} = q|3.4|;
$noresave{$key} = "$nosave";
$key = q/fig:settings/;
$external_latex_labels{$key} = q|3.1|;
$noresave{$key} = "$nosave";
$key = q/sec:2/;
$external_latex_labels{$key} = q|5.2.3|;
$noresave{$key} = "$nosave";
$key = q/fig:effidet/;
$external_latex_labels{$key} = q|2.1|;
$noresave{$key} = "$nosave";
$key = q/sec:11/;
$external_latex_labels{$key} = q|5.2.2|;
$noresave{$key} = "$nosave";
$key = q/fig:thrscanfluo/;
$external_latex_labels{$key} = q|3.3|;
$noresave{$key} = "$nosave";
$key = q/sec:dataFormat/;
$external_latex_labels{$key} = q|1.11|;
$noresave{$key} = "$nosave";
$key = q/fig:mythensett/;
$external_latex_labels{$key} = q|2.3|;
$noresave{$key} = "$nosave";
$key = q/sec:sync/;
$external_latex_labels{$key} = q|1.9|;
$noresave{$key} = "$nosave";
$key = q/fig:badff/;
$external_latex_labels{$key} = q|3.5|;
$noresave{$key} = "$nosave";
$key = q/fig:datareceiver/;
$external_latex_labels{$key} = q|1.2|;
$noresave{$key} = "$nosave";
$key = q/fig:effiback/;
$external_latex_labels{$key} = q|2.2|;
$noresave{$key} = "$nosave";
$key = q/fig:trig/;
$external_latex_labels{$key} = q|1.6|;
$noresave{$key} = "$nosave";
$key = q/fig:ffsetup/;
$external_latex_labels{$key} = q|3.6|;
$noresave{$key} = "$nosave";
$key = q/fig:thresholdscanuntrimmed/;
$external_latex_labels{$key} = q|3.7|;
$noresave{$key} = "$nosave";
$key = q/fig:trimdistribution/;
$external_latex_labels{$key} = q|3.8|;
$noresave{$key} = "$nosave";
$key = q/sec:angcal/;
$external_latex_labels{$key} = q|5.1|;
$noresave{$key} = "$nosave";
$key = q/sec:trimdir/;
$external_latex_labels{$key} = q|1.4|;
$noresave{$key} = "$nosave";
$key = q/fig:trimplot/;
$external_latex_labels{$key} = q|3.9|;
$noresave{$key} = "$nosave";
$key = q/fig:thresholdscantrimmed/;
$external_latex_labels{$key} = q|3.10|;
$noresave{$key} = "$nosave";
$key = q/sec:noisetrim/;
$external_latex_labels{$key} = q|3.4.1|;
$noresave{$key} = "$nosave";
$key = q/sec:encal/;
$external_latex_labels{$key} = q|3.5|;
$noresave{$key} = "$nosave";
$key = q/fig:thrscan/;
$external_latex_labels{$key} = q|3.2|;
$noresave{$key} = "$nosave";
1;

View File

@ -1,30 +0,0 @@
/* Century Schoolbook font is very similar to Computer Modern Math: cmmi */
.MATH { font-family: "Century Schoolbook", serif; }
.MATH I { font-family: "Century Schoolbook", serif; font-style: italic }
.BOLDMATH { font-family: "Century Schoolbook", serif; font-weight: bold }
/* implement both fixed-size and relative sizes */
SMALL.XTINY { font-size : xx-small }
SMALL.TINY { font-size : x-small }
SMALL.SCRIPTSIZE { font-size : smaller }
SMALL.FOOTNOTESIZE { font-size : small }
SMALL.SMALL { }
BIG.LARGE { }
BIG.XLARGE { font-size : large }
BIG.XXLARGE { font-size : x-large }
BIG.HUGE { font-size : larger }
BIG.XHUGE { font-size : xx-large }
/* heading styles */
H1 { }
H2 { }
H3 { }
H4 { }
H5 { }
/* mathematics styles */
DIV.displaymath { } /* math displays */
TD.eqno { } /* equation-number cells */
/* document-specific styles come next */

View File

@ -1,41 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 2008 (1.71)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>SLS Detectors
Frequently Asked Questions</TITLE>
<META NAME="description" CONTENT="SLS Detectors
Frequently Asked Questions">
<META NAME="keywords" CONTENT="slsDetectors-FAQ">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="slsDetectors-FAQ.css">
</HEAD>
<BODY >
<P>
<H1 ALIGN=CENTER>SLS Detectors
<BR>
Frequently Asked Questions</H1>
<P ALIGN=CENTER><STRONG>Anna Bergamaschi</STRONG>
</P>
<BR><P ALIGN=CENTER><B>Date:</B> February 27, 2018</P>
<HR>
<BR><HR>
</BODY>
</HTML>

Binary file not shown.

View File

@ -77,7 +77,6 @@ int main(int argc, char **argv) {
pDetector->enableDataStreamingToClient(1);
/** - ensuring detector status is idle before starting acquisition. exiting if not idle */
int status = pDetector->getDetectorStatus();
if (status != 0){
@ -94,7 +93,7 @@ int main(int argc, char **argv) {
/** - start measurement */
pDetector->startMeasurement();
std::cout << "measurement finished" << std::endl;
std::cout << "measurement finished" << std::endl; usleep(1*1000*1000);
/** - returning when acquisition is finished or data are avilable */

View File

@ -4,31 +4,46 @@ DESTDIR=../docs
TEX=latex
MAINTEXS= slsDetectorInstall.tex slsDetectors-FAQ.tex
MAINTEXS2= slsDetectorInstall.tex
MAINTEXS=slsDetectors-FAQ.tex
TEXS=slsDetector-softFAQ.tex singlePhotonCounting-FAQ.tex angConv-FAQ.tex generalDet-FAQ.tex
DVIS = $(MAINTEXS:.tex=.dvi)
PSS = $(MAINTEXS:.tex=.ps)
PDFS = $(MAINTEXS:.tex=.pdf)
PDFS2 = $(MAINTEXS2:.tex=.pdf)
HTMLS = $(MAINTEXS:%.tex=%)
HTMLS2 = $(MAINTEXS2:%.tex=%)
all: pdf html
echo $(PWD)
echo $(PDFS)
echo $(PDFS2)
echo $(HTMLS)
echo $(HTMLS2)
pdf: $(PDFS)
pdf: $(PDFS) $(PDFS2)
$(shell test -d $(DESTDIR) || mkdir -p $(DESTDIR))
$(shell test -d $(DESTDIR)/pdf || mkdir -p $(DESTDIR)/pdf)
mv $(PDFS) $(DESTDIR)/pdf
mv $(PDFS) $(DESTDIR)/pdf
mv $(PDFS2) $(DESTDIR)/pdf
html: $(HTMLS)
html: $(HTMLS) $(HTMLS2)
$(HTMLS): $(TEXS) $(MAINTEXS)
$(shell test -d $(DESTDIR) || mkdir -p $(DESTDIR))
$(shell test -d $(DESTDIR)/html || mkdir -p $(DESTDIR)/html)
$(shell test -d $(DESTDIR)/html/$@ && rm -fr $(DESTDIR)/html/$@)
echo "***************************** $@"
latex $@.tex
latex2html $@.tex
mv $@ $(DESTDIR)/html
$(HTMLS2): $(MAINTEXS2)
$(shell test -d $(DESTDIR) || mkdir -p $(DESTDIR))
$(shell test -d $(DESTDIR)/html || mkdir -p $(DESTDIR)/html)
$(shell test -d $(DESTDIR)/html/$@ && rm -fr $(DESTDIR)/html/$@)
@ -53,7 +68,7 @@ $(HTMLS): $(TEXS) $(MAINTEXS)
clean:
rm -rf *.aux *.log *.toc *.out $(DVIS) $(PSS) $(PDFS) $(HTMLS)
rm -rf *.aux *.log *.toc *.out $(DVIS) $(PSS) $(PDFS) $(PDFS2) $(HTMLS) $(HTMLS2)
rm -rf $(DESTDIR)/html/slsDetectors-FAQ
rm -rf $(DESTDIR)/html/slsDetectorInstall
rm -rf $(DESTDIR)/pdf/slsDetectors-FAQ.pdf

View File

@ -28,9 +28,10 @@
The SLS detectors software is intended to control the detectors developed by
the SLS Detectors group. The detectors currently supported are:
MYTHEN, GOTTHARD, EIGER and JUNGFRAU.\bigskip
\indent MYTHEN, GOTTHARD, EIGER and JUNGFRAU.
\noindent The package provides software for the distributed system that comprises of
The package provides software for the distributed system that comprises of
detectors, data receivers (to process detector data), and the client (to control
or monitor the system). The client and data receivers can be embedded in
the user's acquisitions system. Furthermore, the package also provides some
@ -78,18 +79,28 @@ However, only control commands work, not the data acquisition itself.
\section{Install Binaries via Conda}
This section is useful only if one wants to download only the binaries for
specific distribution and use the package via command line. Please refer later
sections to download source code and compile them.\bigskip
sections to download source code and compile them.
\noindent One can download and install Miniconda via
\url{https://conda.io/miniconda.html} \bigskip
One can download and install Miniconda via
\noindent The conda package uses Travis CI for continuous integration with
\url{https://conda.io/miniconda.html}
The conda package uses Travis CI for continuous integration with
automatic deployment to Anaconda Cloud. One can download only the package or the
package including the python interface. \bigskip
package including the python interface.
\noindent After the installation, the binaries will be available in your path.
After the installation, the binaries will be available in your path.
Please remember to clear shared memory after installation.
\begin{verbatim}
#displays list of shared memeory segments
ipcs -m
#remove segments that have nattach equal to zero. They key is the first column
ipcrm -M [key]
\end{verbatim}
\begin{itemize}
\item Only the package
@ -102,10 +113,10 @@ conda config --add channels slsdetectorgroup
conda install sls_detector_software
#Install specific release (GLIBC2.14)
conda install sls_detector_software=3.0.1
conda install sls_detector_software=3.1.0
#Scientific Linux 6 version (GLIBC2.12)
conda install sls_detector_software=SL6_3.0.1
conda install sls_detector_software=SL6_3.1.0
\end{verbatim}
\item The package including Python interface
\begin{verbatim}
@ -117,10 +128,10 @@ conda config --add channels sls_detector
conda install sls_detector
#Install specific release (GLIBC2.14)
conda install sls_detector=3.0.1
conda install sls_detector=3.1.0
#Scientific Linux 6 version (GLIBC2.12)
conda install sls_detector=SL6_3.0.1
conda install sls_detector=SL6_3.1.0
\end{verbatim}
\end{itemize}
@ -137,13 +148,13 @@ acquisition system, or if one wants to download the source code and compile.
\begin{verbatim}
#Clone source code with specific release
git clone https://github.com/slsdetectorgroup/slsDetectorPackage.git --branch
3.0.1
3.1.0
\end{verbatim}
\item The package including Python interface
\begin{verbatim}
#Clone source code with specific release
git clone https://github.com/slsdetectorgroup/sls_detector.git --branch
3.0.1
3.1.0
\end{verbatim}
\end{itemize}
@ -194,9 +205,10 @@ required. One can install it:
\item via download from:\\
\url{
https://download.qt.io/archive/qt/4.8/4.8.2/qt-everywhere-opensource-src-4.8.2.t
ar.gz} \bigskip
ar.gz}
\noindent To install:
To install:
\begin{verbatim}
> gunzip qt-everywhere-opensource-src-4.8.2.tar.gz
> tar xvf qt-everywhere-opensource-src-4.8.2.tar
@ -207,14 +219,17 @@ ar.gz} \bigskip
By default Qt4 will be installed in /usr/local/Trolltech/Qt-4.8.2/.
\end{itemize}
\noindent \textbf{Setup Environment}
\noindent One has to ensure that \verb=PATH= and \verb=LD_LIBRARY_PATH= have
\textbf{Setup Environment}
One has to ensure that \verb=PATH= and \verb=LD_LIBRARY_PATH= have
been updated to include Qt4 install path, binaries and libraries.
Confirm by executing \verb=qmake -v= and ensuring the result points to Qt4 (not
Qt3 or Qt5). \bigskip
Qt3 or Qt5).
\noindent If the environment is not set up, one can add the libraries and
If the environment is not set up, one can add the libraries and
executables to the .bashrc by adding
\verb=LD_LIBRARY_PATH= and \verb=PATH=:
\begin{verbatim}
@ -228,9 +243,10 @@ export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
Before installing Qwt, one must install Qt
and ensure that \verb=QTDIR=, \verb=LD_LIBRARY_PATH= and \verb=PATH= point to
the correct Qt4
version. \bigskip
version.
\noindent A Qwt version equal or higher than 6 is required. One can
A Qwt version equal or higher than 6 is required. One can
install it:
\begin{itemize}
\item via YUM:
@ -240,9 +256,9 @@ install it:
\item via download from:\\
\url{
https://sourceforge.net/projects/qwt/files/qwt/6.0.0/qwt-6.0.0.zip/download}
\bigskip
\noindent To install:
To install:
\begin{verbatim}
> cd qwt-6.0.0
> qmake
@ -252,12 +268,14 @@ https://sourceforge.net/projects/qwt/files/qwt/6.0.0/qwt-6.0.0.zip/download}
By default Qwt will be installed int /usr/local/qwt-6.0.0
\end{itemize}
\noindent \textbf{Setup Environment}
\textbf{Setup Environment}
\noindent One has to ensure that \verb=QWTDIR= and \verb=LD_LIBRARY_PATH= have
been updated to include Qwt install path and libraries. \bigskip
\noindent If the environment is not set up, one can add the libraries to the
One has to ensure that \verb=QWTDIR= and \verb=LD_LIBRARY_PATH= have
been updated to include Qwt install path and libraries.
If the environment is not set up, one can add the libraries to the
.bashrc by adding \verb=LD_LIBRARY_PATH=:
\begin{verbatim}
export QWTDIR=/usr/local/qwt-6.0.0/
@ -324,6 +342,8 @@ Usage: [-c] [-b] [-h] [-d HDF5 directory] [-j]
Some example options for compilation:
Most basic option: \verb=./cmk.sh -b=
For only make: \verb=./cmk.sh=
For make clean;make: \verb=./cmk.sh -c=
@ -367,10 +387,69 @@ sls_detector_help sls_detector_put slsReceiver
\subsection{Setting environment variables}
One can set up the environment variables in the following ways.
\subsubsection{Using .bashrc file}
\begin{enumerate}
\item \verb=emacs ~/.bashrc=
\item Add the following function \verb=setup_slsdet= and replace \verb=path=
with absolute path of installed directory
\begin{verbatim}
function setup_slsdet
{
export PKGPATH=[path]
export LD_LIBRARY_PATH=$PKGPATH/slsDetectorPackage/build/bin:$LD_LIBRARY_PATH
export PATH=$PKGPATH/slsDetectorPackage/build/bin:$PATH
cd $PKGPATH/slsDetectorPackage/build/bin
}
\end{verbatim}
\item \verb=source ~/.bashrc=
\item Next time, just run \verb=setup_slsdet= to load the environment
variables.
\end{enumerate}
One can also add the GUI environment variables if installed locally by adding
the following in the function \verb=setup_sldet= \\
\begin{verbatim}
export QTDIR=/path-where-it-is/Qt-4.8.2
export QWTDIR=/path-where-it-is/qwt-6.0.1
export QWT3D=/path-where-it-is/qwtplot3d
export QMAKESPEC=$QTDIR/mkspecs/linux-g++
export LD_LIBRARY_PATH=$QTDIR/lib:$QWTDIR/lib:$QWT3D/lib:$LD_LIBRARY _PATH
export PATH=$QTDIR/bin:$PATH
\end{verbatim}
\subsubsection{Without .bashrc file}
Go to binaries folder slsDetectorPackage/build/bin and execute the following:
\begin{verbatim}
export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH
export PATH=$PWD:$PATH
\end{verbatim}
\subsection{Clean Shared Memory}
It is very crucial to clean the shared memory, before using a new version of
the SLS Detector Package or a different detector type.
One can use the \verb=cleansharedmemory.sh= script available under the
slsDetector Package.
One can also just use the following commands to clean the shared memory
segments one by one.
\begin{verbatim}
#displays list of shared memeory segments
ipcs -m
#remove segments that have nattach equal to zero. They key is the first column
ipcrm -M [key]
\end{verbatim}
\section{Software Upgrade}
The upgrade of the package could require an upgrade of the on-board detector
server and/or firmware running on the detector as well.
server and/or firmware running on the detector as well.
\subsection{MYTHEN}
@ -379,7 +458,7 @@ themselves (which would require dedicated softwares) but only to download on the
detector board the programming files and/or software package provided by
the SLS Detectors group.
\subsubsection{Firmware}
\subsubsection{MYTHEN Firmware}
To upgrade the firmware you need either a working version of the Altera
Quartus software or of the Quartus programmer, which can easily be downloaded
@ -389,9 +468,10 @@ from: \\
\noindent Normally, installation of the software and of the driver for the
USB-Blaster (provided together with the MYTHEN detector) are simpler under
Windows. \bigskip
Windows.
\noindent Under Windows, the first time that you connect the USB-Blaster to one
Under Windows, the first time that you connect the USB-Blaster to one
of your USB ports, you will be asked to install new hardware. Set the path to
search for the driver to:
\verb=C:\altera\80sp1\qprogrammer\drivers\usb-blasterp= (where
@ -414,7 +494,7 @@ your cable (pin1 corresponds) and that you have selected the correct programming
connector.
\end{enumerate}
\subsubsection{On-board Software}
\subsubsection{MYTHEN On-board Software}
\begin{enumerate}
\item Connect to the board using telnet:
\begin{verbatim}
@ -454,6 +534,297 @@ acqusition program correctly start.
\end{enumerate}
\subsection{GOTTHARD}
In such cases, the users are not expected to compile the software
themselves (which would require dedicated softwares) but only to download on the
detector board the programming files and/or software package provided by
the SLS Detectors group.
\subsubsection{GOTTHARD Firmware}
\textit{For SLS Detector Package v3.1.0} \\
\indent Minimum compatible version: \\
\indent \indent 11.01.2013 \\
\indent Latest version: \\
\indent \indent 08.02.2018 (50um and 25um Master) \\
\indent \indent 09.02.2018 (25 um Slave) \\
Normally, the firmware will be upgraded by us as it requires programming the
FPGA via the USB-Blaster.
To upgrade the firmware you need either a working version of the Altera
Quartus software or of the Quartus programmer, which can easily be downloaded
from: \\
\url{https://www.altera.com/download/programming/quartus2/pq2-index.jsp}
Normally, installation of the software and of the driver for the
USB-Blaster (provided together with the MYTHEN detector) are simpler under
Windows.
Under Windows, the first time that you connect the USB-Blaster to one
of your USB ports, you will be asked to install new hardware. Set the path to
search for the driver to:
\verb=C:\altera\80sp1\qprogrammer\drivers\usb-blasterp= (where
\verb=C:\altera\80sp1\qprogrammer\= is assumed to be ther path where your
Quartus version is installed).
\begin{enumerate}
\item After starting the Quartus programmer, click on Hardware Setup and in the
"Currently selected hardware" window select USB-Blaster.
\item In the Mode combo box select "Active Serial Programming".
\item Plug the end of your USB-Blaster WITH THE ADAPTER PROVIDED in the
connector ASMI on the MCS board taking care that pin1 corresponds to the one
indexed and with the rectangualr pad.
\item Click on add file and from select the programming file provided when
the upgrade has been reccomended.
\item Check "Program/Configure" and "Verify".
\item Push the start button and wait until the programming process is
finished (progress bar top left).
\item In case the programmer gives you error messages, check the polarity of
your cable (pin1 corresponds) and that you have selected the correct programming
connector.
\end{enumerate}
\subsubsection{GOTTHARD On-board Software}
Every SLS Detector package release will have its coresponding matching on-board
server under \textbf{slsDetectorPackage/serverBin}.
\begin{enumerate}
\item Install tftp if the pc does not have it.
\item Copy the server from serverBin folder to /tftpboot (or equivalent tftp
folder) of the pc
\item Copy the server to the detector by:
\begin{enumerate}
\item Connect to the blackfin on the detector\\
\verb=telnet bchipxxx=
\item Prevent existing on-board server from respawning by:
\begin{enumerate}
\item Edit \verb=/etc/inittab=
\item Comment out the line
\verb=#ttyS0::respawn:/gotthardDetectorServervxxx=
\item Reboot blackfin using \verb=reboot=
\item Run \verb=ps= to ensure no gotthardDetectorServers are running
\end{enumerate}
\item Copy new on-board server from pc to the blackfin using: \\
\verb=tftp pcxxx -r gotthardDetectorServerxxx -g=
\item Respawn the new server (server starts at detector statup):
\begin{enumerate}
\item Edit \verb=/etc/inittab=
\item Uncomment out the line
\verb=ttyS0::respawn:/gotthardDetectorServervxxx=
\item Reboot blackfin using \verb=reboot=
\item Run \verb=ps= to ensure that both the gotthardDetectorServers are
running.\\
\verb=gotthardDetectorServerxxx= \\
\verb=gotthardDetectorServerxxx 1953=
\end{enumerate}
\end{enumerate}
\end{enumerate}
\subsection{EIGER}
In such cases, the users are not expected to compile the software
themselves (which would require dedicated softwares) but only to download on the
detector board the programming files and/or software package provided by
the SLS Detectors group.
\subsubsection{EIGER Firmware}
\textit{For SLS Detector Package v3.1.0} \\
\indent Minimum compatible version: 16 \\
\indent Latest version: 20 \\
\begin{enumerate}
\item One must get the latest package's corresponding bit files from the SLS
Detector Group.
\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
that tftp be installed on the pc.
\item Run the following to update firmware
\begin{verbatim}
#update back end fpga
bcp download.bit bebxxx:/fw0
#update front left fpga
bcp download.bit bebxxx:/febl
#update front right fpga
bcp download.bit bebxxx:/febr
#update kernel
bcp download.bit bebxxx:/kernel
\end{verbatim}
Please update bit files with great caution as it could make your board
inaccessible, if done incorrectly.
\end{enumerate}
\subsubsection{EIGER On-board Software}
Every SLS Detector package release will have its coresponding matching on-board
server under \textbf{slsDetectorPackage/serverBin}.
Update the on-board software without connecting to the detector
\begin{verbatim}
#password for the boards: root
#Kill existing servers that are running on the detector
ssh root@beb031 killall eigerDetectorServer;
#Copy on-board server to detector inside executables folder
scp ~/path-where-it-is/eigerDetectorServerxxx root@bebxxx:~/executables;
#Overwrite the actual eigerDetectorServer on board
scp ~/path-where-it-is/eigerDetectorServerxxx
root@bebxxx:~/executables/eigerDetectorServer;
#sync
ssh root@bebxxx sync;
#reboot the eiger board
\end{verbatim}
\bigskip One can connect to the detector by:
\begin{verbatim}
ssh root@bebxxx
password: root
\end{verbatim}
The on-board server is in ~/executables folder and respawned at startup in \\
\verb=/etc/rc5.d/S50board_com.sh=
\subsection{JUNGFRAU}
In such cases, the users are not expected to compile the software
themselves (which would require dedicated softwares) but only to download on the
detector board the programming files and/or software package provided by
the SLS Detectors group.
\subsubsection{JUNGFRAU Firmware}
\textit{For SLS Detector Package v3.1.0} \\
\indent Minimum compatible version: 13.11.2017 \\
\indent Latest version: 13.11.2017 \\
At times, one has to update the firmware, which then also requires updating the
on-board software.
\textbf{\textit{Jungfrau firmware can be upgraded via the SLS Detector Package
binaries from the command line.}}
\begin{enumerate}
\item One must get the latest package's corresponding POF file from the SLS
Detector Group.
\item Update the latest SLS Detector package installed.
\item Update the on-board software as per the instructions in the next
section.
\item Start the on-board server in debug mode:
\begin{enumerate}
\item Connect to the blackfin on the detector\\
\verb=telnet bchipxxx=
\item Prevent existing on-board server from respawning by:
\begin{enumerate}
\item Edit \verb=/etc/inittab=
\item Comment out the line
\verb=#ttyS0::respawn:/jungfrauDetectorServervxxx=
\item Reboot blackfin using \verb=reboot=
\item Run \verb=ps= to ensure no gotthardDetectorServers are running
\end{enumerate}
\item Start the server in debug mode using: \\
\verb=./jungfrauDetectorServerxxx -debug= \\
Leave this console on to come back to it later.
\end{enumerate}
\item From the command line of the pc, clear shared memory \\
\verb=./sls_detector_get free= \\
If one gets shmget error, please clean the shared memory properly using the
script in \verb=slsDetectorPackage/cleansharedmemory.sh=
\item Add the detector to shared memory using \\
\verb=./sls_detector_put hostname bchipxxx=
\item Program the FPGA using \\
\verb=./sls_detector_put programfpga xxx.pof=
\item Once the programming is done:
\begin{enumerate}
\item Switch to the console that has the debug server running and kill it
using Ctrl+C and ensure no jungfrauDetectorServers are
running
\item Restart the new server to see if it runs with the new firmware \\
\verb=./jungfrauDetectorServerxxx= \\
If the server didn't start properly, please contact us with the error message
shown when starting the server up, else continue with the following steps.
\item Respawn the new server (server starts at detector statup):
\begin{enumerate}
\item Edit \verb=/etc/inittab=
\item Uncomment out the line
\verb=ttyS0::respawn:/jungfrauDetectorServervxxx=
\item Reboot blackfin using \verb=reboot=
\item Run \verb=ps= to ensure that both the gotthardDetectorServers are
running.\\
\verb=jungfrauDetectorServervxxx= \\
\verb=jungfrauDetectorServervxxx 1953=
\end{enumerate}
\end{enumerate}
\end{enumerate}
\subsubsection{JUNGFRAU On-board Software}
Every SLS Detector package release will have its coresponding matching on-board
server under \textbf{slsDetectorPackage/serverBin}.
\begin{enumerate}
\item Install tftp if the pc does not have it.
\item Copy the server from serverBin folder to /tftpboot (or equivalent tftp
folder) of the pc
\item Copy the server to the detector by:
\begin{enumerate}
\item Connect to the blackfin on the detector\\
\verb=telnet bchipxxx=
\item Prevent existing on-board server from respawning by:
\begin{enumerate}
\item Edit \verb=/etc/inittab=
\item Comment out the line
\verb=#ttyS0::respawn:/jungfrauDetectorServervxxx=
\item Reboot blackfin using \verb=reboot=
\item Run \verb=ps= to ensure no gotthardDetectorServers are running
\end{enumerate}
\item Copy new on-board server from pc to the blackfin using: \\
\verb=tftp pcxxx -r jungfrauDetectorServervxxx -g=
\item Respawn the new server (server starts at detector statup):
\begin{enumerate}
\item Edit \verb=/etc/inittab=
\item Uncomment out the line
\verb=ttyS0::respawn:/jungfrauDetectorServervxxx=
\item Reboot blackfin using \verb=reboot=
\item Run \verb=ps= to ensure that both the gotthardDetectorServers are
running.\\
\verb=jungfrauDetectorServervxxx= \\
\verb=jungfrauDetectorServervxxx 1953=
\end{enumerate}
\end{enumerate}
\end{enumerate}
\begin{comment}
\section{Detector system architecture}

View File

@ -0,0 +1 @@
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualMaster

View File

@ -0,0 +1 @@
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServer_virtualSlave

View File

@ -1 +0,0 @@
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.0.0.16.10

View File

@ -0,0 +1 @@
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.1.0.16.1

View File

@ -0,0 +1 @@
../slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.1.0.21.0

View File

@ -0,0 +1 @@
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServer_virtual

View File

@ -1 +0,0 @@
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.0.0.6

View File

@ -0,0 +1 @@
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv3.1.0.1

View File

@ -0,0 +1 @@
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServer_virtual

View File

@ -0,0 +1 @@
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.12

View File

@ -1 +0,0 @@
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.0.0.6.3

View File

@ -0,0 +1 @@
../slsDetectorSoftware/jungfrauDetectorServer/bin/jungfrauDetectorServerv3.1.0.2

View File

@ -1 +0,0 @@
../slsDetectorSoftware/moenchDetectorServer/moenchDetectorServerv2.0.3

View File

@ -1,113 +0,0 @@
#ifndef INTMAP_H
#define INTMAP_H
#define N 60
#include <stdio.h>
#include <math.h>
class IntMap{
public:
IntMap(){};
~IntMap(){};
void Init(){
//lookup table of the output intensity for IR laser
//measurements performed by Dominic april 2014
//intensity[59]=intensity with 0 Optical Density
//intensity[0]=intensity with 5.9 Optical Density
intensity[0]=29;//5.9
intensity[1]=21;//5.8
intensity[2]=31;//5.7
intensity[3]=43;//5.6
intensity[4]=60;//5.5
intensity[5]=91;//5.4
intensity[6]=69;//5.3
intensity[7]=102;//5.2
intensity[8]=136;//5.1
intensity[9]=196;//5.0
intensity[10]=425;//4.9
intensity[11]=311;//4.8
intensity[12]=462;//4.7
intensity[13]=653;//4.6
intensity[14]=926;//4.5
intensity[15]=1423;//4.4
intensity[16]=1072;//4.3
intensity[17]=1592;//4.2
intensity[18]=2142;//4.1
intensity[19]=3085;//4.0
intensity[20]=729;//3.9
intensity[21]=533;//3.8
intensity[22]=793;//3.7
intensity[23]=1121;//3.6
intensity[24]=1588;//3.5
intensity[25]=2439;//3.4
intensity[26]=1842;//3.3
intensity[27]=2730;//3.2
intensity[28]=3663;//3.1
intensity[29]=5271;//3.0
intensity[30]=8102;//2.9
intensity[31]=5933;//2.8
intensity[32]=8789;//2.7
intensity[33]=12350;//2.6
intensity[34]=17358;//2.5
intensity[35]=26300;//2.4
intensity[36]=20029;//2.3
intensity[37]=29414;//2.2
intensity[38]=39202;//2.1
intensity[39]=55724;//2.0
intensity[40]=15697;//1.9
intensity[41]=11541;//1.8
intensity[42]=16976;//1.7
intensity[43]=23866;//1.6
intensity[44]=33478;//1.5
intensity[45]=50567;//1.4
intensity[46]=38552;//1.3
intensity[47]=56394;//1.2
intensity[48]=74897;//1.1
intensity[49]=106023;//1.0
intensity[50]=157384;//0.9
intensity[51]=117677;//0.8
intensity[52]=171101;//0.7
intensity[53]=236386;//0.6
intensity[54]=327248;//0.5
intensity[55]=492781;//0.4
intensity[56]=379641;//0.3
intensity[57]=546927;//0.2
intensity[58]=717203;//0.1
intensity[59]=1000000;//0.
return;
};
//_od is the total Optical Density
int getIntensity(float _od){
int _int(-1);
//these lines are to take into account rounding errors with floats
float hun_od = 100.*_od;
int Ihun_od = (int)round(hun_od);
float R_od =(float) Ihun_od/10.;
int I_od = (int)R_od;
if(I_od >-1 && I_od <60){
int index=59-I_od;
cerr<<index<<endl;
_int=intensity[index];
}else{
cerr<<"Optical density out of range!"<<endl;
}
return _int;
};
private:
int intensity[N];
};
#endif

View File

@ -29,28 +29,41 @@ class MovingStat
/**
clears the moving average number of samples parameter, mean and standard deviation
*/
void Set(double val, double rms=0)
void Set(double val, double rms=0, int m=-1)
{
m_n = n;
m_newM=val*n;
if (rms<=0)
m_newM2=val*val*n;
else
m_newM2=(n*rms*rms+m_newM*m_newM/n);
if (m>=0) m_n = m; else m_n = n;
m_newM=val*m_n;
SetRMS(rms);
}
/**
clears the moving average number of samples parameter, mean and standard deviation
*/
void SetRMS(double rms)
{
if (rms<=0) {
m_newM2=m_newM*m_newM/n;
m_n=0;
} else {
if (m_n>0)
m_newM2=(m_n*rms*rms+m_newM*m_newM/m_n);
else {
m_newM2=(m_n*rms*rms+m_newM*m_newM/n);
m_n=0;
}
}
}
/** sets number of samples parameter
\param i number of samples parameter to be set
*/
void SetN(int i) {if (i>=1) n=i;};
int SetN(int i) {if (i>=1) n=i; return n;};
/**
gets number of samples parameter
\returns actual number of samples parameter
*/
int GetN() {return n;};
int GetN() {return m_n;};
/** calculates the moving average i.e. adds if number of elements is lower than number of samples parameter, pushes otherwise
\param x value to calculate the moving average

View File

@ -1,194 +0,0 @@
#include "moench03ReadData.C"
/************************************************************************/
TH2F *readExactImage(char *fname, int iframe=0, int frperfile,TH2F *hped=NULL) {
ifstream filebin;
filebin.open((const char *)(fname), ios::in | ios::binary);
TH2F *h2=new TH2F("h2","",400,0,400,400,0,400);
int framen(0);
moench03CtbData *decoder=new moench03CtbData();
char *buff=decoder->readNextFrame(filebin);
framen=decoder->getFrameNumber(buff);
int counter(0);
while(framen<iframe && counter<frperfile){
buff=decoder->readNextFrame(filebin);
framen=decoder->getFrameNumber(buff);
cerr<<"...";
if(framen%1000==0) cerr<<framen;
counter++;
}
if(counter<frperfile){
h2->SetName(Form("frame_%d",framen));
h2->SetTitle(Form("frame_%d",framen));
cout << "==" << endl;
for (int ix=0; ix<400; ix++) {
for (int iy=0; iy<400; iy++) {
// cout << decoder->getDataSize() << " " << decoder->getValue(buff,ix,iy)<< endl;
h2->SetBinContent(ix+1,iy+1,decoder->getValue(buff,ix,iy));
// h1->SetBinContent(++ip,decoder->getValue(buff,ix,iy));
}
}
if (hped) h2->Add(hped,-1);
}else{
cerr<<"frame number not found"<<endl;
}
return h2;
}
/************************************************************/
//fnamein filename: ..._f0_%d.raw
//runmin, runmax to calculate pedestals
//framen0, framen1 first and last frame you want to add to the gif
//frperfile number of frames per file
void PlotRawFrameGif(char * fnamein, int runmin, int runmax, int framen0,int framen1, int frperfile){
cerr<<"/***********************************/"<<endl;
cerr<<"calculating pedestals"<<endl;
TH2F * hp = calcPedestal(fnamein,runmin,runmax);
int filen = (int)(framen0/frperfile);
char fname[1000];
sprintf(fname,fnamein,filen);
cerr<<"/***********************************/"<<endl;
cerr<<"retrieving frame from"<<fname<<endl;
int fileframe0 = framen0%frperfile;
int fileframe1 = framen1%frperfile;
TImage * img = NULL;
TH2F * hf = NULL;
TCanvas * c1 =NULL;
for(int fileframe=fileframe0; fileframe<fileframe1; fileframe++){
hf=readExactImage(fname, fileframe,frperfile,hp);
delete img;
delete c1;
c1 = new TCanvas("c1","",800,600);
c1->cd();
hf->SetTitle(Form("Frame_%d",fileframe+framen0));
hf->SetName(Form("Frame_%d",fileframe+framen0));
hf->GetXaxis()->SetRangeUser(0,50);
hf->GetXaxis()->SetTitle("Column");
hf->GetYaxis()->SetRangeUser(240,290);
hf->GetYaxis()->SetTitle("Row");
hf->GetZaxis()->SetRangeUser(-50.,1300.);
hf->SetStats(kFALSE);
// c1->SetLogz();
hf->Draw("colz");
c1->Print(Form("/afs/psi/project/mythen/Marco/Pics/Fe_Raw3_%d.png",fileframe));
img = TImage::Open(Form("/afs/psi/project/mythen/Marco/Pics/Fe_Raw3_%d.png",fileframe));
if(fileframe<fileframe1-1){
img->WriteImage(Form("/afs/psi/project/mythen/Marco/Pics/Fe_Raw3_%d.gif+200",fileframe1-fileframe0));
}else{
img->WriteImage(Form("/afs/psi/project/mythen/Marco/Pics/Fe_Raw3_%d.gif++200++",fileframe1-fileframe0));
}
}
return;
}
/*********************************************************************/
TProfile2D * GetHitMap(TTree * treein, int framen,double zlow, double zup){
TProfile2D* map = new TProfile2D("map","",400,-0.5,399.5,400,-0.5,399.5,zlow,zup);
int x, y, iFrame;
double data[9];
TBranch * b_x = (TBranch*)treein->GetBranch("x");
TBranch * b_y = (TBranch*)treein->GetBranch("y");
TBranch * b_data = (TBranch*)treein->GetBranch("data");
TBranch * b_iFrame = (TBranch*)treein->GetBranch("iFrame");
b_x->SetAddress(&x);
b_y->SetAddress(&y);
b_data->SetAddress(data);
b_iFrame->SetAddress(&iFrame);
Int_t nEnt=treein->GetEntries();
for(Int_t i=0; i<nEnt; i++){
b_iFrame->GetEntry(i);
if(iFrame==framen){
b_x->GetEntry(i);
b_y->GetEntry(i);
b_data->GetEntry(i);
map->SetBinEntries(map->FindFixBin(x-1,y-1),1);
map->SetBinEntries(map->FindFixBin(x,y-1),1);
map->SetBinEntries(map->FindFixBin(x+1,y-1),1);
map->SetBinEntries(map->FindFixBin(x-1,y),1);
map->SetBinEntries(map->FindFixBin(x,y),1);
map->SetBinEntries(map->FindFixBin(x+1,y),1);
map->SetBinEntries(map->FindFixBin(x-1,y+1),1);
map->SetBinEntries(map->FindFixBin(x,y+1),1);
map->SetBinEntries(map->FindFixBin(x+1,y+1),1);
map->SetBinContent(map->FindFixBin(x-1,y-1),data[0]);
map->SetBinContent(map->FindFixBin(x,y-1),data[1]);
map->SetBinContent(map->FindFixBin(x+1,y-1),data[2]);
map->SetBinContent(map->FindFixBin(x-1,y),data[3]);
map->SetBinContent(map->FindFixBin(x,y),data[4]);
map->SetBinContent(map->FindFixBin(x+1,y),data[5]);
map->SetBinContent(map->FindFixBin(x-1,y+1),data[6]);
map->SetBinContent(map->FindFixBin(x,y+1),data[7]);
map->SetBinContent(map->FindFixBin(x+1,y+1),data[8]);
}
}
return map;
}
/*********************************************************/
/** creates an infinitely looping gif from clustered data
**/
void PlotClusterHitMapGif(std::string filename, std::string treename,int framen0,int framen1){
TFile * fin = new TFile(filename.c_str(),"read");
TTree * treein = (TTree*)fin->Get(treename.c_str());
TCanvas * c1 = NULL;
TProfile2D* hmap = NULL;
TImage * img = NULL;
for(int framen=framen0; framen<framen1; framen++){
delete c1;
c1 = new TCanvas("c1","",800,600);
c1->cd();
// c1->SetLogz();
hmap=GetHitMap(treein,framen,-50.,1300.);
hmap->SetName(Form("Frame_%d",framen));
hmap->SetTitle(Form("Frame_%d",framen));
hmap->GetXaxis()->SetRangeUser(0,50);
hmap->GetXaxis()->SetTitle("Column");
hmap->GetYaxis()->SetRangeUser(240,290);
hmap->GetYaxis()->SetTitle("Row");
hmap->GetZaxis()->SetRangeUser(-50.,1300.);
hmap->SetStats(kFALSE);
hmap->Draw("colz");
c1->Print(Form("/afs/psi/project/mythen/Marco/Pics/Fe_Cluster3_%d.png",framen));
img = TImage::Open(Form("/afs/psi/project/mythen/Marco/Pics/Fe_Cluster3_%d.png",framen));
if(framen<framen1-1){
img->WriteImage(Form("/afs/psi/project/mythen/Marco/Pics/Fe_Cluster3_%d.gif+200",framen1-framen0));
}else{
img->WriteImage(Form("/afs/psi/project/mythen/Marco/Pics/Fe_Cluster3_%d.gif++200++",framen1-framen0));
}
}
return;
}

View File

@ -0,0 +1,866 @@
#ifndef ANALOGDETECTOR_H
#define ANALOGDETECTOR_H
//#include <mutex>
#include <pthread.h>
#include "slsDetectorData.h"
#include "pedestalSubtraction.h"
#include "commonModeSubtraction.h"
#include "tiffIO.h"
using namespace std;
#ifndef FRAMEMODE_DEF
#define FRAMEMODE_DEF
/**
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 };
#endif
template <class dataType> class analogDetector {
/** @short class to perform pedestal subtraction etc. for an analog detector */
public:
/**
Constructor (no error checking if datasize and offsets are compatible!)
\param d detector data structure to be used - if null it is assumed that the data are in ordered ip=iy*nx+ix
\param sign is the sign of the data
\param nped number of samples for pedestal averaging
\param cm common mode subtraction algorithm, if any. Defaults to NULL i.e. none
\param nnx detector size in x - must be specified if no data structure is defined, otherwise defaults to the size of the data structure.
\param nny detector size in y - must be specified if no data structure is defined, otherwise defaults to the size of the data structure.
\param gm pointer to tha gain map matrix
*/
analogDetector(slsDetectorData<dataType> *d, int sign=1,
commonModeSubtraction *cm=NULL, int nped=1000, int nnx=-1, int nny=-1, double *gm=NULL) : det(d), nx(nnx), ny(nny), stat(NULL), cmSub(cm), iframe(-1), dataSign(sign), gmap(gm), id(0) {
if (det)
det->getDetectorSize(nx,ny);
stat=new pedestalSubtraction*[ny];
for (int i=0; i<ny; i++) {
stat[i]=new pedestalSubtraction[nx];
for (int ix=0; ix<nx; ix++) {
stat[i][ix].SetNPedestals(nped);
}
}
image=new int[nx*ny];
xmin=0;
xmax=nx;
ymin=0;
ymax=ny;
fMode=ePedestal;
thr=0;
myFile=NULL;
fm=new pthread_mutex_t ;
};
/**
destructor. Deletes the pdestalSubtraction array and the image
*/
virtual ~analogDetector() {for (int i=0; i<ny; i++) delete [] stat[i]; delete [] stat; delete [] image;};
/**
constructor cloning another analog detector
\param orig analog Detector structure to be cloned
*/
analogDetector(analogDetector* orig) {
/* copy construction from orig*/
det=orig->det;
nx=orig->nx;
ny=orig->ny;
dataSign=orig->dataSign;
iframe=orig->iframe;
gmap=orig->gmap;
cmSub=orig->cmSub;
id=orig->id;
xmin=orig->xmin;
xmax=orig->xmax;
ymin=orig->ymin;
ymax=orig->ymax;
thr=orig->thr;
// nSigma=orig->nSigma;
fMode=orig->fMode;
myFile=orig->myFile;
fm=orig->fm;
stat=new pedestalSubtraction*[ny];
for (int i=0; i<ny; i++) {
stat[i]=new pedestalSubtraction[nx];
}
int nped=orig->SetNPedestals();
//cout << nped << " " << orig->getPedestal(ix,iy) << orig->getPedestalRMS(ix,iy) << endl;
for (int iy=0; iy<ny; iy++) {
for (int ix=0; ix<nx; ix++) {
stat[iy][ix].SetNPedestals(nped);
setPedestal(ix,iy,orig->getPedestal(ix,iy),orig->getPedestalRMS(ix,iy),orig->GetNPedestals(ix,iy));
}
}
image=new int[nx*ny];
}
/**
clone. Must be virtual!
\returns a clone of the original analog detector
*/
virtual analogDetector *Clone() {
return new analogDetector(this);
}
/**
Gives an id to the structure. For debugging purposes in case of multithreading.
\param i is to be set
\returns current id
*/
int setId(int i){id=i; return id;};
/**
Returns id of the structure. For debugging purposes in case of multithreading.
\returns current id
*/
int getId() {return id; };
/**
Returns data size of the detector data structure
\returns data size of the detector data structurein bytes
*/
int getDataSize(){return det->getDataSize();};
/**
Returns data size of the detector image matrix
\param nnx reference to image size in x
\param nny reference to image size in y
\param nns reference to number of subpixels for interpolating detector, will always be 1 in this case
\returns number of pixels of the detector image
*/
virtual int getImageSize(int &nnx, int &nny, int &nns){nnx=nx; nny=ny; nns=1; return nx*ny;};
/**
Returns data size of the detector image matrix
\param nnx reference to pixel size in x
\param nny reference to pixel size in y
\returns number of pixels of the detector image
*/
virtual int getDetectorSize(int &nnx, int &nny){nnx=nx; nny=ny; return nx*ny;};
/**
set gain map
\param gm pointer to gain map matrix to be set - NULL unsets
\returns pointer to current gain map
*/
double *setGainMap(double *gm) {gmap=gm; return gmap;};
/**
return gain map
\returns pointer to current gain map
*/
double *getGainMap() {return gmap;};
/**
reads a 32 bit tiff file of the size of the detector and sets its values as gain map for the detector. If file does not exist returns NULL, but does not change gainmap compared to previous settings.
\param imgname complete name of the file containing the gain map data
\returns pointer to current gain map is file reading succeeded, NULL is file reading didn't work.
*/
double *readGainMap(const char * imgname) {
uint32 nnx, nny;
float *gm=ReadFromTiff( imgname, nny, nnx);
if (gm) {
if (gmap) delete [] gmap;
gmap=new double[nnx*nny];
for (int ix=0; ix<nnx; ix++) {
for (int iy=0; iy<nny; iy++) {
gmap[iy*nnx+ix]=gm[iy*nnx+ix];
}
}
return gmap;
}
return NULL;
}
/**
writes a 32 bit tiff file of the size of the detector and contaning the gain map value, if any. If file doesn'e exist or gainmap is undefined, does not do anything.
\param imgname complete name of the file to be written
\returns NULL if file writing didn't succeed, else a pointer
*/
void *writeGainMap(const char * imgname) {
float *gm=NULL;
void *ret;
if (gmap) {
gm=new float[nx*ny];
for (int ix=0; ix<nx; ix++) {
for (int iy=0; iy<ny; iy++) {
gm[iy*nx+ix]=gmap[iy*nx+ix];
}
}
ret=WriteToTiff(gm, imgname, ny, nx);
delete [] gm;
}
return ret;
}
/** resets the pedestalSubtraction array, the commonModeSubtraction and the image data*/
virtual void newDataSet(){
iframe=-1;
for (int iy=0; iy<ny; iy++)
for (int ix=0; ix<nx; ix++) {
stat[iy][ix].Clear();
image[iy*nx+ix]=0;
}
if (cmSub) cmSub->Clear();
};
/** resets the commonModeSubtraction and increases the frame index */
virtual void newFrame(){iframe++; if (cmSub) cmSub->newFrame();};
/** sets the commonModeSubtraction algorithm to be used
\param cm commonModeSubtraction algorithm to be used (NULL unsets)
\returns pointer to the actual common mode subtraction algorithm
*/
commonModeSubtraction *setCommonModeSubtraction(commonModeSubtraction *cm) {cmSub=cm; return cmSub;};
/**
gets the commonModeSubtraction algorithm to be used
\returns pointer to the actual common mode subtraction algorithm
*/
commonModeSubtraction *getCommonModeSubtraction() {return cmSub;};
/**
sets the sign of the data
\param sign 1 means positive values for photons, -1 negative, 0 gets
\returns current sign for the data
*/
int setDataSign(int sign=0) {if (sign==1 || sign==-1) dataSign=sign; return dataSign;};
/**
adds value to pedestal (and common mode) for the given pixel
\param val value to be added
\param ix pixel x coordinate
\param iy pixel y coordinate
\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){
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
stat[iy][ix].addToPedestal(val);
if (cmSub) {
if (det) if (det->isGood(ix, iy)==0) return;
cmSub->addToCommonMode(val, ix, iy);
};
};
}
/**
gets pedestal (and common mode)
\param ix pixel x coordinate
\param iy pixel y coordinate
\param cm 0 (default) without common mode subtraction, 1 with common mode subtraction (if defined)
\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;};
/**
gets pedestal rms (i.e. noise)
\param ix pixel x coordinate
\param iy pixel y coordinate
\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;};
/**
gets pedestal (and common mode)
\param ix pixel x coordinate
\param iy pixel y coordinate
\param cm 0 (default) without common mode subtraction, 1 with common mode subtraction (if defined)
\returns pedestal value
*/
virtual double* getPedestal(double *ped){
if (ped==NULL)
ped=new double[nx*ny];
for (int ix=0; ix<nx; ix++) {
for (int iy=0; iy<ny; iy++) {
ped[iy*nx+ix]=stat[iy][ix].getPedestal();
}
}
return ped;
};
/**
gets pedestal rms (i.e. noise)
\param ix pixel x coordinate
\param iy pixel y coordinate
\returns pedestal rms
*/
virtual double* getPedestalRMS(double *ped=NULL){
if (ped==NULL)
ped=new double[nx*ny];
for (int ix=0; ix<nx; ix++) {
for (int iy=0; iy<ny; iy++) {
ped[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
}
}
return ped;
};
/**
sets pedestal
\param ix pixel x coordinate
\param iy pixel y coordinate
\param val value to set
\param rms rms to be set if any, defaults to 0
\param m number of pedestal samples to be set or the moving stat structure is any, defaults to 0
*/
virtual void setPedestal(int ix, int iy, double val, double rms=0, int m=-1){if (ix>=0 && ix<nx && iy>=0 && iy<ny) stat[iy][ix].setPedestal(val,rms, m);};
/**
sets pedestal
\param ix pixel x coordinate
\param iy pixel y coordinate
\param val value to set
\param rms rms to be set if any, defaults to 0
\param m number of pedestal samples to be set or the moving stat structure is any, defaults to 0
*/
virtual void setPedestal(double *ped, double *rms=NULL, int m=-1){
double rr=0;
for (int ix=xmin; ix<xmax; ix++) {
for (int iy=ymin; iy<ymax; iy++) {
if (rms) rr=rms[iy*nx+ix];
stat[iy][ix].setPedestal(ped[iy*nx+ix],rr, m);
};
};
}
/**
sets pedestal rms
\param ix pixel x coordinate
\param iy pixel y coordinate
\param rms value to set
*/
virtual void setPedestalRMS(int ix, int iy, double rms=0){if (ix>=0 && ix<nx && iy>=0 && iy<ny) stat[iy][ix].setPedestalRMS(rms);};
/**
sets pedestal rms for all pixels
\param rms pointer to array of pedestal rms
*/
virtual void setPedestalRMS(double *rms){
for (int ix=xmin; ix<xmax; ix++) {
for (int iy=ymin; iy<ymax; iy++) {
stat[iy][ix].setPedestalRMS(rms[iy*nx+ix]);
};
};
}
/**
write 32bit tiff file with detector image data
\param imgname file name to be written
\returns NULL if file writing didn't succed, otherwise a pointer
*/
virtual void *writeImage(const char * imgname) {
float *gm=NULL;
void *ret;
gm=new float[nx*ny];
for (int ix=0; ix<nx; ix++) {
for (int iy=0; iy<ny; iy++) {
gm[iy*nx+ix]=image[iy*nx+ix];
}
}
ret=WriteToTiff(gm, imgname, ny, nx);
delete [] gm;
return ret;
}
/**
write 32bit tiff file containing the pedestals
\param imgname file name to be written
\returns NULL if file writing didn't succed, otherwise a pointer
*/
virtual void *writePedestals(const char * imgname) {
float *gm=NULL;
void *ret;
gm=new float[nx*ny];
for (int ix=0; ix<nx; ix++) {
for (int iy=0; iy<ny; iy++) {
if (cmSub)
gm[iy*nx+ix]=stat[iy][ix].getPedestal()-cmSub->getCommonMode();
else
gm[iy*nx+ix]=stat[iy][ix].getPedestal();
}
}
ret=WriteToTiff(gm, imgname, ny, nx);
delete [] gm;
return ret;
}
/**
read 32bit tiff file containing the pedestals
\param imgname file name to be read
\returns 0 if file reading didn't succed, otherwise 1
*/
int readPedestals(const char * imgname) {
uint32 nnx, nny;
float *gm=ReadFromTiff( imgname, nny, nnx);
if (nnx>nx) nnx=nx;
if (nny>ny) nny=ny;
if (gm) {
for (int ix=0; ix<nnx; ix++) {
for (int iy=0; iy<nny; iy++) {
stat[iy][ix].setPedestal(gm[iy*nx+ix],-1,-1);
}
}
delete [] gm;
return 1;
}
return NULL;
}
/**
read 32bit tiff file containing the image data
\param imgname file name to be read
\returns 0 if file reading didn't succed, otherwise 1
*/
int readImage(const char * imgname) {
uint32 nnx, nny;
float *gm=ReadFromTiff( imgname, nny, nnx);
if (nnx>nx) nnx=nx;
if (nny>ny) nny=ny;
if (gm) {
for (int ix=0; ix<nnx; ix++) {
for (int iy=0; iy<nny; iy++) {
image[iy*nx+ix]=gm[iy*nx+ix];
}
}
delete [] gm;
return 1;
}
return NULL;
}
/**
returns pointer to image data
\returns pointer to image data
*/
virtual int *getImage(){return image;};
/**
write 32bit tiff file containing the pedestals RMS
\param imgname file name to be written
\returns NULL if file writing didn't succed, otherwise a pointer
*/
void *writePedestalRMS(const char * imgname) {
float *gm=NULL;
void *ret;
gm=new float[nx*ny];
for (int ix=0; ix<nx; ix++) {
for (int iy=0; iy<ny; iy++) {
gm[iy*nx+ix]=stat[iy][ix].getPedestalRMS();
}
}
ret=WriteToTiff(gm, imgname, ny, nx);
delete [] gm;
return ret;
}
/**
read 32bit tiff file containing the pedestals RMS
\param imgname file name to be read
\returns 0 if file reading didn't succed, otherwise 1
*/
int readPedestalRMS(const char * imgname) {
uint32 nnx, nny;
float *gm=ReadFromTiff( imgname, nny, nnx);
if (nnx>nx) nnx=nx;
if (nny>ny) nny=ny;
if (gm) {
for (int ix=0; ix<nnx; ix++) {
for (int iy=0; iy<nny; iy++) {
stat[iy][ix].setPedestalRMS(gm[iy*nx+ix]);
}
}
delete [] gm;
return 1;
}
return 0;
}
/**
Adds all the data for each pixels in the selected region of interest to the pedestal
\param data pointer to the data
*/
virtual void addToPedestal(char *data) {
newFrame();
for (int ix=xmin; ix<xmax; ix++) {
for (int iy=ymin; iy<ymax; iy++) {
addToPedestal(data,ix,iy);
}
}
return ;
};
/**
Sets region of interest in which data should be processed
\param xmi minimum x. if -1 or out of range remains unchanged
\param xma maximum x. if -1 or out of range remains unchanged
\param ymi minimum y. if -1 or out of range remains unchanged
\param yma maximum y. if -1 or out of range remains unchanged
*/
void setROI(int xmi=-1, int xma=-1, int ymi=-1, int yma=-1) {
if (xmi>=0 && xmi<=nx) xmin=xmi;
if (xma>=0 && xma<=nx) xmax=xma;
if (xmax<xmin) {
xmi=xmin;
xmin=xmax;
xmax=xmi;
}
if (ymi>=0 && ymi<=ny) ymin=ymi;
if (yma>=0 && yma<=ny) ymax=yma;
if (ymax<ymin) {
ymi=ymin;
ymin=ymax;
ymax=ymi;
}
};
/**
Gets region of interest in which data are processed
\param xmi reference to minimum x.
\param xma reference to maximum x.
\param ymi reference to minimum y.
\param yma reference to maximum y.
*/
void getROI(int &xmi, int &xma, int &ymi, int &yma) {xmi=xmin; xma=xmax; ymi=ymin; yma=ymax;};
/**
Adds all the data for the selected pixel to the pedestal
\param data pointer to the data
\param ix pixel x coordinate
\param iy pixel y coordinate
*/
virtual void addToPedestal(char *data, int ix, int iy=0) {
double val;
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
if (det)
val=dataSign*det->getValue(data, ix, iy);
else
val=((double*)data)[iy*nx+ix];
addToPedestal(val,ix,iy);
}
return ;
};
/**
Subtracts pedestal from the data array in the region of interest
\param data pointer to the data
\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
*/
virtual double *subtractPedestal(char *data, double *val=NULL) {
newFrame();
if (val==NULL)
val=new double[nx*ny];
for (int ix=xmin; ix<xmax; ix++) {
for (int iy=ymin; iy<ymax; iy++) {
val[iy*nx+ix]+=subtractPedestal(data, ix, iy);
}
}
return val;
};
/**
Subtracts pedestal from the data for a selected pixel
\param data pointer to the data
\param ix pixel x coordinate
\param iy pixel y coordinate
\returns pedestal subtracted value
*/
virtual double subtractPedestal(char *data, int ix, int iy=0) {
double g=1.;
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
if (gmap) {
g=gmap[iy*nx+ix];
if (g==0) g=-1.;
}
if (det)
return (dataSign*det->getValue(data, ix, iy)-getPedestal(ix,iy))/g;
else
return (((double*)data)[iy*nx+ix]-getPedestal(ix,iy))/g;
}
};
/**
sets threshold value for conversion into number of photons
\param t threshold to be set
\returns threshold value
*/
double setThreshold(double t){thr=t; return thr;};
/**
gets threshold value for conversion into number of photons
\returns threshold value
*/
double getThreshold(){return thr;};
/**
converts the data into number of photons for the selected pixel
\param data pointer to the data
\param ix pixel x coordinate
\param iy pixel y coordinate
\returns converted number of photons. If no threshold is set, returns gain converted pedestal subtracted data.
*/
virtual int getNPhotons(char *data, int ix, int iy=0) {
int nph=0;
double v;
if (ix>=0 && ix<nx && iy>=0 && iy<ny) {
v=subtractPedestal(data,ix,iy);
if (thr>0) {
v+=0.5*thr;
nph=v/thr;
return nph;
} else
return v;
}
return 0;
};
/**
converts the data into number of photons for all pixels
\param data pointer to the data
\param nph pointer where the photons should added. If NULL,the internal image is used
\returns pointer to array containing the number of photons
*/
int *getNPhotons(char *data, int *nph=NULL) {
double val;
if (nph==NULL)
nph=image;
newFrame();
for (int ix=xmin; ix<xmax; ix++) {
for (int iy=ymin; iy<ymax; iy++) {
nph[iy*nx+ix]+=getNPhotons(data, ix, iy);
}
}
return nph;
}
/**
clears the image array
*/
virtual void clearImage(){
for (int ix=0; ix<nx; ix++) {
for (int iy=0; iy<ny; iy++) {
image[iy*nx+ix]=0;
}
}
};
/** sets/gets number of samples for moving average pedestal calculation
\param i number of samples to be set (0 or negative gets)
\returns actual number of samples
*/
int SetNPedestals(int i=-1) {
int ix=0, iy=0;
if (i>0)
for (ix=0; ix<nx; ix++)
for (iy=0; iy<ny; iy++)
stat[iy][ix].SetNPedestals(i);
return stat[0][0].SetNPedestals();
};
/** gets number of samples for moving average pedestal calculation
\returns actual number of samples
*/
int GetNPedestals(int ix, int iy) {
if (ix>=0 && ix<nx && iy>=0 && iy<ny)
return stat[iy][ix].GetNPedestals();
else
return -1;
};
/** calculates the sum of photons in the specified region of interest.
\param data pointer to the data
\param xmi minimum x for the calculation. If -1 the minimum x of the predefined region of interest is used
\param xma maximum x for the calculation. If -1 the maximum x of the predefined region of interest is used
\param ymi minimum y for the calculation. If -1 the minimum y of the predefined region of interest is used
\param yma maximum y for the calculation. If -1 the maximum y of the predefined region of interest is used
\returns total number of photons in
*/
virtual int getTotalNumberOfPhotons(char *data, int xmi=-1, int xma=-1, int ymi=-1, int yma=-1) {
int val=0;
if (xmi<0) xmi=xmin;
if (xma<0) xma=xmax;
if (ymi<0) ymi=ymin;
if (yma<0) yma=ymax;
for (int ix=xmi; ix<xma; ix++)
for (int iy=ymi; iy<yma; iy++)
if (ix>=0 && ix<nx && iy>=0 && iy<ny)
val+=getNPhotons(data, ix, iy);
return val;
};
/**
calculates the image converted into number of photons. If the frame mode is pedestal, it also it to the pdedestal subtraction.
\param data pointer to the data to be processed
\param val pointer of the data to be added to. If NULL, the internal image will be used
\param pointer to the processed data
\returns
*/
virtual void processData(char *data,int *val=NULL) {
switch(fMode) {
case ePedestal:
addToPedestal(data);
break;
default:
getNPhotons(data,val);
}
};
virtual char *getInterpolation(){return NULL;};
/** sets the current frame mode for the detector
\param f frame mode to be set
\returns current frame mode
*/
frameMode setFrameMode(frameMode f) {fMode=f; return fMode;};
/** gets the current frame mode for the detector
\returns current frame mode
*/
frameMode getFrameMode() {return fMode;};
/** sets file pointer where to write the clusters to
\param f file pointer
\returns current file pointer
*/
FILE *setFilePointer(FILE *f){myFile=f; return myFile;};
/** gets file pointer where to write the clusters to
\returns current file pointer
*/
FILE *getFilePointer(){return myFile;};
void setMutex(pthread_mutex_t *m){fm=m;};
protected:
slsDetectorData<dataType> *det; /**< slsDetectorData to be used */
int nx; /**< Size of the detector in x direction */
int ny; /**< Size of the detector in y direction */
pedestalSubtraction **stat; /**< pedestalSubtraction class */
commonModeSubtraction *cmSub;/**< commonModeSubtraction class */
int dataSign; /**< sign of the data i.e. 1 if photon is positive, -1 if negative */
int iframe; /**< frame number (not from file but incremented within the dataset every time newFrame is called */
double *gmap;
int *image;
int id;
//int xmin, xmax, ymin, ymax; int xmin; /**< minimum x of the region of interest */
int xmin; /**< minimum x of the region of interest */
int xmax; /**< maximum x of the region of interest */
int ymin;/**< minimum y of the region of interest */
int ymax;/**< maximum y of the region of interest */
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 */
frameMode fMode; /**< current detector frame mode */
FILE *myFile; /**< file pointer to write to */
pthread_mutex_t *fm;
};
#endif

View File

@ -0,0 +1,164 @@
#ifndef GOTTHARD2MODULEDATANEW_H
#define GOTTHARD2MODULEDATANEW_H
#include "gotthardModuleDataNew.h"
class gotthardDoubleModuleDataNew : public slsDetectorData<uint16_t> {
private:
const int nModules;
const int offset;
int iframe;
public:
/**
Implements the slsReceiverData structure for the gotthard read out by a module i.e. using the slsReceiver
(1x1280 pixels, 2 packets 1286 large etc.)
\param c crosstalk parameter for the output buffer
*/
gotthardDoubleModuleDataNew(int off=24*2, int nmod=2): slsDetectorData<uint16_t>(1280*nmod, 1, nmod*(1280*2+off)), nModules(nmod), offset(off),iframe(0) {
uint16_t **dMask;
int **dMap;
int ix, iy;
int ypixels=1;
int xpixels=1280*nmod;
int imod, ipix;
dMask=new uint16_t*[1];
dMap=new int*[1];
dMap[0] = new int[1280*nmod];
dMask[0] = new uint16_t[1280*nmod];
for(int ix=0; ix<xpixels; ix++) {
imod=ix%2;
if (imod==0)
ipix=ix/2;
else
ipix=1280-1-ix/2;
if (imod==0)
dMap[0][ix] =ipix*2+offset;
else
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;
dMask[0][ix] = 0x0;
}
setDataMap(dMap);
setDataMask(dMask);
};
/**
Returns the frame number for the given dataset.
\param buff pointer to the dataset
\returns frame number
*/
int getFrameNumber(char *buff){if (offset>=sizeof(sls_detector_header)) return ((sls_detector_header*)buff)->frameNumber; return iframe;};//*((int*)(buff+5))&0xffffff;};
/**
gets the packets number (last packet is labelled with 0 and is replaced with 40)
\param buff pointer to the memory
\returns packet number
*/
int getPacketNumber(char *buff){if (offset>=sizeof(sls_detector_header))return ((sls_detector_header*)buff)->packetNumber;};
/**
Loops over a memory slot until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). purely virtual func
\param data pointer to the memory to be analyzed
\param ndata reference to the amount of data found for the frame, in case the frame is incomplete at the end of the memory slot
\param dsize size of the memory slot to be analyzed
\returns pointer to the beginning of the last good frame (might be incomplete if ndata smaller than dataSize), or NULL if no frame is found
*/
virtual char *findNextFrame(char *data, int &ndata, int dsize){
if (dsize<dataSize) ndata=dsize;
else ndata=dataSize;
return data;
}
virtual char *readNextFrame(ifstream &filebin) {
int ff=-1, np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int &ff) {
int np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np) {
char *data=new char[dataSize];
char *d=readNextFrame(filebin, ff, np, data);
if (d==NULL) {delete [] data; data=NULL;}
return data;
}
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np, char *data) {
char *retval=0;
int nd;
int fnum = -1;
np=0;
int pn;
// cout << dataSize << endl;
if (ff>=0)
fnum=ff;
if (filebin.is_open()) {
if (filebin.read(data, dataSize) ){
ff=getFrameNumber(data);
np=getPacketNumber(data);
return data;
}
}
return NULL;
};
};
#endif

View File

@ -0,0 +1,170 @@
#ifndef GOTTHARDMODULEDATANEW_H
#define GOTTHARDMODULEDATANEW_H
#include "slsDetectorData.h"
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;
class gotthardModuleDataNew : public slsDetectorData<uint16_t> {
private:
int iframe;
const int offset;
public:
/**
Implements the slsReceiverData structure for the gotthard read out by a module i.e. using the slsReceiver
(1x1280 pixels, 2 packets 1286 large etc.)
\param c crosstalk parameter for the output buffer
*/
gotthardModuleDataNew(int off=24*2, int nch=1280): slsDetectorData<uint16_t>(nch, 1, nch*2+off), offset(off) {
uint16_t **dMask;
int **dMap;
int ix, iy;
int ypixels=1;
int xpixels=nch;
dMask=new uint16_t*[1];
dMap=new int*[1];
dMap[0] = new int[nch];
dMask[0] = new uint16_t[nch];
for(int ix=0; ix<xpixels; ix++) {
dMap[0][ix] = 2*ix+offset;
dMask[0][ix] = 0x0;
}
setDataMap(dMap);
setDataMask(dMask);
};
/**
Returns the frame number for the given dataset.
\param buff pointer to the dataset
\returns frame number
*/
int getFrameNumber(char *buff){if (offset>=sizeof(sls_detector_header)) return ((sls_detector_header*)buff)->frameNumber; return iframe;};//*((int*)(buff+5))&0xffffff;};
/**
gets the packets number (last packet is labelled with 0 and is replaced with 40)
\param buff pointer to the memory
\returns packet number
*/
int getPacketNumber(char *buff){if (offset>=sizeof(sls_detector_header))return ((sls_detector_header*)buff)->packetNumber;};
/**
Loops over a memory slot until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). purely virtual func
\param data pointer to the memory to be analyzed
\param ndata reference to the amount of data found for the frame, in case the frame is incomplete at the end of the memory slot
\param dsize size of the memory slot to be analyzed
\returns pointer to the beginning of the last good frame (might be incomplete if ndata smaller than dataSize), or NULL if no frame is found
*/
virtual char *findNextFrame(char *data, int &ndata, int dsize){
if (dsize<dataSize) ndata=dsize;
else ndata=dataSize;
return data;
}
virtual char *readNextFrame(ifstream &filebin) {
int ff=-1, np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int &ff) {
int np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np) {
char *data=new char[dataSize];
char *d=readNextFrame(filebin, ff, np, data);
if (d==NULL) {delete [] data; data=NULL;}
return data;
}
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np, char *data) {
char *retval=0;
int nd;
int fnum = -1;
np=0;
int pn;
// cout << dataSize << endl;
if (ff>=0)
fnum=ff;
if (filebin.is_open()) {
if (filebin.read(data, dataSize) ){
ff=getFrameNumber(data);
np=getPacketNumber(data);
return data;
}
}
return NULL;
};
};
#endif

View File

@ -23,15 +23,15 @@ class moench03Ctb10GbT1Data : public slsReceiverData<uint16_t> {
\param c crosstalk parameter for the output buffer
*/
moench03Ctb10GbT1Data(int ns=5000): slsReceiverData<uint16_t>(400, 400, 40, 8208), nadc(32), sc_width(25), sc_height(200) {
// moench03Ctb10GbData(int ns=5000): slsDetectorData<uint16_t>(400, 400, 8208*40, NULL, NULL) , nadc(32), sc_width(25), sc_height(200) {
moench03Ctb10GbT1Data(int ns=5000): slsReceiverData<uint16_t>(400, 400, 40, 8208), nadc(32), sc_width(25), sc_height(200) {
int adc_nr[32]={200,225,250,275,300,325,350,375,\
0,25,50,75,100,125,150,175,\
175,150,125,100,75,50,25,0,\
375,350,325,300,275,250,225,200};
int adc_nr[32]={300,325,350,375,300,325,350,375, \
200,225,250,275,200,225,250,275,\
100,125,150,175,100,125,150,175,\
0,25,50,75,0,25,50,75};
int row, col;
int isample;
@ -40,17 +40,18 @@ class moench03Ctb10GbT1Data : public slsReceiverData<uint16_t> {
int npackets=40;
int i;
int adc4(0);
for (int ip=0; ip<npackets; ip++) {
for (int is=0; is<128; is++) {
for (iadc=0; iadc<nadc; iadc++) {
i=128*ip+is;
adc4=(int)iadc/4;
if (i<sc_width*sc_height) {
// for (int i=0; i<sc_width*sc_height; i++) {
col=adc_nr[iadc]+(i%sc_width);
if (iadc<16) {
if (adc4%2==0) {
row=199-i/sc_width;
} else {
row=200+i/sc_width;
@ -77,10 +78,10 @@ class moench03Ctb10GbT1Data : public slsReceiverData<uint16_t> {
// ii=ibyte+128*32*ipacket;
isample=ii/nadc;
iadc=ii%nadc;
adc4 = (int)iadc/4;
ix=isample%sc_width;
iy=isample/sc_width;
if (iadc<(nadc/2)) {
if (adc4%2==0) {
xmap[i]=adc_nr[iadc]+ix;
ymap[i]=ny/2-1-iy;
} else {
@ -101,6 +102,7 @@ class moench03Ctb10GbT1Data : public slsReceiverData<uint16_t> {
};
/**
Returns the frame number for the given dataset. Purely virtual func.
@ -174,24 +176,45 @@ class moench03Ctb10GbT1Data : public slsReceiverData<uint16_t> {
/* }; */
virtual char *readNextFrame(ifstream &filebin, int& fnum) {
virtual char *readNextFrame(ifstream &filebin) {
int ff=-1, np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int &ff) {
int np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np) {
char *data=new char[packetSize*nPackets];
char *d=readNextFrame(filebin, ff, np, data);
if (d==NULL) {delete [] data; data=NULL;}
return data;
}
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np, char *data) {
char *retval=0;
int np=0, nd;
fnum = -1;
int nd;
int fnum = -1;
np=0;
int pn;
char aa[8224];
char *packet=(char *)aa;
// cout << packetSize*nPackets << endl;
if (ff>=0)
fnum=ff;
if (filebin.is_open()) {
while(filebin.read((char*)packet, 8208) && np<nPackets){
while(filebin.read((char*)packet, 8208) ){
pn=getPacketNumber(packet);
if (pn==1 && fnum<0)
if (fnum<0)
fnum= getFrameNumber(packet);
// cout << "fn: " << fnum << "\t pn: " << pn << endl;
@ -199,14 +222,24 @@ class moench03Ctb10GbT1Data : public slsReceiverData<uint16_t> {
if (getFrameNumber(packet) !=fnum) {
if (np==0){
delete [] data;
// delete [] data;
return NULL;
} else
filebin.seekg(-8208,ios_base::cur);
return data;
}
if (pn>nPackets) {
cout << "Bad packet number " << pn << endl;
}
memcpy(data+(pn-1)*packetSize, packet, packetSize);
np++;
if (np==nPackets)
break;
if (pn==nPackets)
break;
}
}
@ -214,18 +247,34 @@ class moench03Ctb10GbT1Data : public slsReceiverData<uint16_t> {
}
if (np==0){
delete [] data;
// delete [] data;
return NULL;
}
};
ff=fnum;
return data;
};
int getPacketNumber(int x, int y) {return dataMap[y][x]/8208;};
virtual char *readNextFrame(ifstream &filebin) {
int fnum;
return readNextFrame(filebin, fnum);
};
};

View File

@ -4,7 +4,7 @@
class moench03TCtbData : public slsDetectorData<uint16_t> {
class moench03CtbData : public slsDetectorData<uint16_t> {
private:
@ -25,21 +25,24 @@ class moench03TCtbData : public slsDetectorData<uint16_t> {
*/
moench03TCtbData(int ns=5000): slsDetectorData<uint16_t>(400, 400, ns*2*32, NULL, NULL) , nadc(32), sc_width(25), sc_height(200) {
moench03CtbData(int ns=5000): slsDetectorData<uint16_t>(400, 400, ns*2*32, NULL, NULL) , nadc(32), sc_width(25), sc_height(200) {
int adc_nr[32]={200,225,250,275,300,325,350,375,\
0,25,50,75,100,125,150,175,\
175,150,125,100,75,50,25,0,\
375,350,325,300,275,250,225,200};
int row, col;
int isample;
int iadc;
int ix, iy;
int adc_nr[32]={200,225,250,275,300,325,350,375,\
0,25,50,75,100,125,150,175,\
175,150,125,100,75,50,25,0,\
375,350,325,300,275,250,225,200};
/* int adc_nr[32]={300,325,350,375,300,325,350,375, \ */
/* 200,225,250,275,200,225,250,275,\ */
/* 100,125,150,175,100,125,150,175,\ */
/* 0,25,50,75,0,25,50,75}; */
for (iadc=0; iadc<nadc; iadc++) {

View File

@ -0,0 +1,158 @@
#ifndef MOENCH03T1CTBDATA_H
#define MOENCH03T1CTBDATA_H
#include "slsDetectorData.h"
class moench03T1CtbData : public slsDetectorData<uint16_t> {
private:
int iframe;
int nadc;
int sc_width;
int sc_height;
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
*/
moench03T1CtbData(int ns=5000): slsDetectorData<uint16_t>(400, 400, ns*2*32, NULL, NULL) , nadc(32), sc_width(25), sc_height(200) {
int adc_nr[32]={300,325,350,375,300,325,350,375, \
200,225,250,275,200,225,250,275,\
100,125,150,175,100,125,150,175,\
0,25,50,75,0,25,50,75};
int row, col;
int isample;
int iadc;
int ix, iy;
for (iadc=0; iadc<nadc; iadc++) {
for (int i=0; i<sc_width*sc_height; i++) {
col=adc_nr[iadc]+(i%sc_width);
if (iadc<16) {
row=199-i/sc_width;
} else {
row=200+i/sc_width;
}
dataMap[row][col]=(nadc*i+iadc)*2;
if (dataMap[row][col]<0 || dataMap[row][col]>=2*400*400)
cout << "Error: pointer " << dataMap[row][col] << " out of range "<< endl;
}
}
int adc4;
for (int i=0; i<nx*ny; i++) {
isample=i/nadc;
iadc=i%nadc;
ix=isample%sc_width;
iy=isample/sc_width;
adc4 = (int)iadc/4;
// if (iadc<(nadc/2)) {
if (adc4%2==0) {
xmap[i]=adc_nr[iadc]+ix;
ymap[i]=ny/2-1-iy;
} else {
xmap[i]=adc_nr[iadc]+ix;
ymap[i]=ny/2+iy;
}
}
iframe=0;
// cout << "data struct created" << endl;
};
/**
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 << "-" << endl;
return (char*)afifo_cont;
} else {
delete [] afifo_cont;
return NULL;
}
}
return NULL;
};
};
#endif

View File

@ -0,0 +1,285 @@
#ifndef MOENCH03T1ZMQDATA_H
#define MOENCH03T1ZMQDATA_H
#include "slsDetectorData.h"
/**
@short structure for a Detector Packet or Image Header
@li frameNumber is the frame number
@li expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others)
@li packetNumber is the packet number
@li bunchId is the bunch id from beamline
@li timestamp is the time stamp with 10 MHz clock
@li modId is the unique module id (unique even for left, right, top, bottom)
@li xCoord is the x coordinate in the complete detector system
@li yCoord is the y coordinate in the complete detector system
@li zCoord is the z coordinate in the complete detector system
@li debug is for debugging purposes
@li roundRNumber is the round robin set number
@li detType is the detector type see :: detectorType
@li version is the version number of this structure format
*/
typedef struct {
uint64_t 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;
class moench03T1ReceiverData : public slsDetectorData<uint16_t> {
private:
int iframe;
int nadc;
int sc_width;
int sc_height;
const int nPackets; /**<number of UDP packets constituting one frame */
const int packetSize; /**< size of a udp packet */
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
*/
moench03T1ReceiverData(int npackets=40, int ps=8192): slsDetectorData<uint16_t>(400, 400, ps*npackets+sizeof(sls_detector_header)), packetSize(ps), nPackets(npackets) {
int nadc=32;
int sc_width=25;
int sc_height=200;
int adc_nr[32]={300,325,350,375,300,325,350,375, \
200,225,250,275,200,225,250,275,\
100,125,150,175,100,125,150,175,\
0,25,50,75,0,25,50,75};
int row, col;
int isample;
int iadc;
int ix, iy;
// int npackets=40;
int i;
int adc4(0);
for (int ip=0; ip<npackets; ip++) {
for (int is=0; is<128; is++) {
for (iadc=0; iadc<nadc; iadc++) {
i=128*ip+is;
adc4=(int)iadc/4;
if (i<sc_width*sc_height) {
// for (int i=0; i<sc_width*sc_height; i++) {
col=adc_nr[iadc]+(i%sc_width);
if (adc4%2==0) {
row=199-i/sc_width;
} else {
row=200+i/sc_width;
}
dataMap[row][col]=sizeof(sls_detector_header)+(nadc*i+iadc)*2;//+16*(ip+1);
if (dataMap[row][col]<0 || dataMap[row][col]>=8192*40)
cout << "Error: pointer " << dataMap[row][col] << " out of range "<< endl;
}
}
}
}
int ipacket;
int ibyte;
int ii=0;
for (ibyte=0; ibyte<sizeof(sls_detector_header)/2; ibyte++){
xmap[ibyte]=-1;
ymap[ibyte]=-1;
}
int off=sizeof(sls_detector_header)/2;
for (ipacket=0; ipacket<npackets; ipacket++) {
for (ibyte=0; ibyte< 8192/2; ibyte++) {
i=ipacket*8208/2+ibyte;
isample=ii/nadc;
iadc=ii%nadc;
adc4 = (int)iadc/4;
ix=isample%sc_width;
iy=isample/sc_width;
if (adc4%2==0) {
xmap[i+off]=adc_nr[iadc]+ix;
ymap[i+off]=ny/2-1-iy;
} else {
xmap[i+off]=adc_nr[iadc]+ix;
ymap[i+off]=ny/2+iy;
}
ii++;
// }
}
}
iframe=0;
// cout << "data struct created" << endl;
};
/**
Returns the frame number for the given dataset. Purely virtual func.
\param buff pointer to the dataset
\returns frame number
*/
/* class jfrau_packet_header_t { */
/* public: */
/* unsigned char reserved[4]; */
/* unsigned char packetNumber[1]; */
/* unsigned char frameNumber[3]; */
/* unsigned char bunchid[8]; */
/* }; */
int getFrameNumber(char *buff){return ((sls_detector_header*)buff)->frameNumber;};//*((int*)(buff+5))&0xffffff;};
/**
Returns the packet number for the given dataset. purely virtual func
\param buff pointer to the dataset
\returns packet number number
*/
int getPacketNumber(char *buff){((sls_detector_header*)buff)->packetNumber;}//((*(((int*)(buff+4))))&0xff)+1;};
/* /\** */
/* Loops over a memory slot until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). purely virtual func */
/* \param data pointer to the memory to be analyzed */
/* \param ndata reference to the amount of data found for the frame, in case the frame is incomplete at the end of the memory slot */
/* \param dsize size of the memory slot to be analyzed */
/* \returns pointer to the beginning of the last good frame (might be incomplete if ndata smaller than dataSize), or NULL if no frame is found */
/* *\/ */
/* virtual char *findNextFrame(char *data, int &ndata, int dsize){ndata=dsize; setDataSize(dsize); return data;}; */
/* /\** */
/* Loops over a file stream until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). Can be overloaded for different kind of detectors! */
/* \param filebin input file stream (binary) */
/* \returns pointer to the begin of the last good frame, NULL if no frame is found or last frame is incomplete */
/* *\/ */
/* virtual char *readNextFrame(ifstream &filebin){ */
/* // int afifo_length=0; */
/* uint16_t *afifo_cont; */
/* int ib=0; */
/* if (filebin.is_open()) { */
/* afifo_cont=new uint16_t[dataSize/2]; */
/* while (filebin.read(((char*)afifo_cont)+ib,2)) { */
/* ib+=2; */
/* if (ib==dataSize) break; */
/* } */
/* if (ib>0) { */
/* iframe++; */
/* // cout << ib << "-" << endl; */
/* return (char*)afifo_cont; */
/* } else { */
/* delete [] afifo_cont; */
/* return NULL; */
/* } */
/* } */
/* return NULL; */
/* }; */
virtual char *readNextFrame(ifstream &filebin) {
int ff=-1, np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int &ff) {
int np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np) {
char *data=new char[dataSize];
char *d=readNextFrame(filebin, ff, np, data);
if (d==NULL) {delete [] data; data=NULL;}
return data;
}
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np, char *data) {
char *retval=0;
int nd;
int fnum = -1;
np=0;
int pn;
// cout << dataSize << endl;
if (ff>=0)
fnum=ff;
if (filebin.is_open()) {
if (filebin.read(data, dataSize) ){
ff=getFrameNumber(data);
np=getPacketNumber(data);
return data;
}
}
return NULL;
};
/**
Loops over a memory slot until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). purely virtual func
\param data pointer to the memory to be analyzed
\param ndata reference to the amount of data found for the frame, in case the frame is incomplete at the end of the memory slot
\param dsize size of the memory slot to be analyzed
\returns pointer to the beginning of the last good frame (might be incomplete if ndata smaller than dataSize), or NULL if no frame is found
*/
virtual char *findNextFrame(char *data, int &ndata, int dsize){
if (dsize<dataSize) ndata=dsize;
else ndata=dataSize;
return data;
}
int getPacketNumber(int x, int y) {return dataMap[y][x]/packetSize;};
};
#endif

View File

@ -0,0 +1,285 @@
#ifndef MOENCH03T1RECDATANEW_H
#define MOENCH03T1RECDATANEW_H
#include "slsDetectorData.h"
/**
@short structure for a Detector Packet or Image Header
@li frameNumber is the frame number
@li expLength is the subframe number (32 bit eiger) or real time exposure time in 100ns (others)
@li packetNumber is the packet number
@li bunchId is the bunch id from beamline
@li timestamp is the time stamp with 10 MHz clock
@li modId is the unique module id (unique even for left, right, top, bottom)
@li xCoord is the x coordinate in the complete detector system
@li yCoord is the y coordinate in the complete detector system
@li zCoord is the z coordinate in the complete detector system
@li debug is for debugging purposes
@li roundRNumber is the round robin set number
@li detType is the detector type see :: detectorType
@li version is the version number of this structure format
*/
typedef struct {
uint64_t 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;
class moench03T1ReceiverDataNew : public slsDetectorData<uint16_t> {
private:
int iframe;
int nadc;
int sc_width;
int sc_height;
const int nSamples;
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
*/
moench03T1ReceiverDataNew(int ns=5000): slsDetectorData<uint16_t>(400, 400, ns*2*32+sizeof(sls_detector_header)), nSamples(ns) {
int nadc=32;
int sc_width=25;
int sc_height=200;
int adc_nr[32]={300,325,350,375,300,325,350,375, \
200,225,250,275,200,225,250,275,\
100,125,150,175,100,125,150,175,\
0,25,50,75,0,25,50,75};
int row, col;
int isample;
int iadc;
int ix, iy;
int npackets=40;
int i;
int adc4(0);
for (int ip=0; ip<npackets; ip++) {
for (int is=0; is<128; is++) {
for (iadc=0; iadc<nadc; iadc++) {
i=128*ip+is;
adc4=(int)iadc/4;
if (i<sc_width*sc_height) {
// for (int i=0; i<sc_width*sc_height; i++) {
col=adc_nr[iadc]+(i%sc_width);
if (adc4%2==0) {
row=199-i/sc_width;
} else {
row=200+i/sc_width;
}
dataMap[row][col]=sizeof(sls_detector_header)+(nadc*i+iadc)*2;//+16*(ip+1);
if (dataMap[row][col]<0 || dataMap[row][col]>=nSamples*2*32)
cout << "Error: pointer " << dataMap[row][col] << " out of range "<< endl;
}
}
}
}
int ipacket;
int ibyte;
int ii=0;
for (ibyte=0; ibyte<sizeof(sls_detector_header)/2; ibyte++){
xmap[ibyte]=-1;
ymap[ibyte]=-1;
}
int off=sizeof(sls_detector_header)/2;
for (ipacket=0; ipacket<npackets; ipacket++) {
for (ibyte=0; ibyte< 8192/2; ibyte++) {
i=ipacket*8208/2+ibyte;
isample=ii/nadc;
if (isample<nSamples) {
iadc=ii%nadc;
adc4 = (int)iadc/4;
ix=isample%sc_width;
iy=isample/sc_width;
if (adc4%2==0) {
xmap[i+off]=adc_nr[iadc]+ix;
ymap[i+off]=ny/2-1-iy;
} else {
xmap[i+off]=adc_nr[iadc]+ix;
ymap[i+off]=ny/2+iy;
}
}
ii++;
// }
}
}
iframe=0;
// cout << "data struct created" << endl;
};
/**
Returns the frame number for the given dataset. Purely virtual func.
\param buff pointer to the dataset
\returns frame number
*/
/* class jfrau_packet_header_t { */
/* public: */
/* unsigned char reserved[4]; */
/* unsigned char packetNumber[1]; */
/* unsigned char frameNumber[3]; */
/* unsigned char bunchid[8]; */
/* }; */
int getFrameNumber(char *buff){return ((sls_detector_header*)buff)->frameNumber;};//*((int*)(buff+5))&0xffffff;};
/**
Returns the packet number for the given dataset. purely virtual func
\param buff pointer to the dataset
\returns packet number number
*/
int getPacketNumber(char *buff){return ((sls_detector_header*)buff)->packetNumber;}//((*(((int*)(buff+4))))&0xff)+1;};
/* /\** */
/* Loops over a memory slot until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). purely virtual func */
/* \param data pointer to the memory to be analyzed */
/* \param ndata reference to the amount of data found for the frame, in case the frame is incomplete at the end of the memory slot */
/* \param dsize size of the memory slot to be analyzed */
/* \returns pointer to the beginning of the last good frame (might be incomplete if ndata smaller than dataSize), or NULL if no frame is found */
/* *\/ */
/* virtual char *findNextFrame(char *data, int &ndata, int dsize){ndata=dsize; setDataSize(dsize); return data;}; */
/* /\** */
/* Loops over a file stream until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). Can be overloaded for different kind of detectors! */
/* \param filebin input file stream (binary) */
/* \returns pointer to the begin of the last good frame, NULL if no frame is found or last frame is incomplete */
/* *\/ */
/* virtual char *readNextFrame(ifstream &filebin){ */
/* // int afifo_length=0; */
/* uint16_t *afifo_cont; */
/* int ib=0; */
/* if (filebin.is_open()) { */
/* afifo_cont=new uint16_t[dataSize/2]; */
/* while (filebin.read(((char*)afifo_cont)+ib,2)) { */
/* ib+=2; */
/* if (ib==dataSize) break; */
/* } */
/* if (ib>0) { */
/* iframe++; */
/* // cout << ib << "-" << endl; */
/* return (char*)afifo_cont; */
/* } else { */
/* delete [] afifo_cont; */
/* return NULL; */
/* } */
/* } */
/* return NULL; */
/* }; */
virtual char *readNextFrame(ifstream &filebin) {
int ff=-1, np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int &ff) {
int np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np) {
char *data=new char[dataSize];
char *d=readNextFrame(filebin, ff, np, data);
if (d==NULL) {delete [] data; data=NULL;}
return data;
}
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np, char *data) {
char *retval=0;
int nd;
int fnum = -1;
np=0;
int pn;
// cout << dataSize << endl;
if (ff>=0)
fnum=ff;
if (filebin.is_open()) {
if (filebin.read(data, dataSize) ){
ff=getFrameNumber(data);
np=getPacketNumber(data);
return data;
}
}
return NULL;
};
/**
Loops over a memory slot until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). purely virtual func
\param data pointer to the memory to be analyzed
\param ndata reference to the amount of data found for the frame, in case the frame is incomplete at the end of the memory slot
\param dsize size of the memory slot to be analyzed
\returns pointer to the beginning of the last good frame (might be incomplete if ndata smaller than dataSize), or NULL if no frame is found
*/
virtual char *findNextFrame(char *data, int &ndata, int dsize){
if (dsize<dataSize) ndata=dsize;
else ndata=dataSize;
return data;
}
//int getPacketNumber(int x, int y) {return dataMap[y][x]/packetSize;};
};
#endif

View File

@ -0,0 +1,268 @@
#ifndef MOENCH03T1ZMQDATA_H
#define MOENCH03T1ZMQDATA_H
#include "slsDetectorData.h"
class moench03T1ZmqData : public slsDetectorData<uint16_t> {
private:
int iframe;
int nadc;
int sc_width;
int sc_height;
const int nPackets; /**<number of UDP packets constituting one frame */
const int packetSize; /**< size of a udp packet */
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
*/
moench03T1ZmqData(int npackets=40, int ps=8192): slsDetectorData<uint16_t>(400, 400, ps*npackets), packetSize(ps), nPackets(npackets) {
int nadc=32;
int sc_width=25;
int sc_height=200;
int adc_nr[32]={300,325,350,375,300,325,350,375, \
200,225,250,275,200,225,250,275,\
100,125,150,175,100,125,150,175,\
0,25,50,75,0,25,50,75};
int row, col;
int isample;
int iadc;
int ix, iy;
// int npackets=40;
int i;
int adc4(0);
for (int ip=0; ip<npackets; ip++) {
for (int is=0; is<128; is++) {
for (iadc=0; iadc<nadc; iadc++) {
i=128*ip+is;
adc4=(int)iadc/4;
if (i<sc_width*sc_height) {
// for (int i=0; i<sc_width*sc_height; i++) {
col=adc_nr[iadc]+(i%sc_width);
if (adc4%2==0) {
row=199-i/sc_width;
} else {
row=200+i/sc_width;
}
dataMap[row][col]=(nadc*i+iadc)*2;//+16*(ip+1);
if (dataMap[row][col]<0 || dataMap[row][col]>=8192*40)
cout << "Error: pointer " << dataMap[row][col] << " out of range "<< endl;
}
}
}
}
int ipacket;
int ibyte;
int ii=0;
for (int ipacket=0; ipacket<npackets; ipacket++) {
for (int ibyte=0; ibyte< 8192/2; ibyte++) {
i=ipacket*8208/2+ibyte;
/* if (ibyte<8) { */
/* //header! */
/* xmap[i]=-1; */
/* ymap[i]=-1; */
/* } else { */
// ii=ibyte+128*32*ipacket;
isample=ii/nadc;
iadc=ii%nadc;
adc4 = (int)iadc/4;
ix=isample%sc_width;
iy=isample/sc_width;
if (adc4%2==0) {
xmap[i]=adc_nr[iadc]+ix;
ymap[i]=ny/2-1-iy;
} else {
xmap[i]=adc_nr[iadc]+ix;
ymap[i]=ny/2+iy;
}
ii++;
// }
}
}
iframe=0;
// cout << "data struct created" << endl;
};
/**
Returns the frame number for the given dataset. Purely virtual func.
\param buff pointer to the dataset
\returns frame number
*/
/* class jfrau_packet_header_t { */
/* public: */
/* unsigned char reserved[4]; */
/* unsigned char packetNumber[1]; */
/* unsigned char frameNumber[3]; */
/* unsigned char bunchid[8]; */
/* }; */
int getFrameNumber(char *buff){return iframe;};//*((int*)(buff+5))&0xffffff;};
/**
Returns the packet number for the given dataset. purely virtual func
\param buff pointer to the dataset
\returns packet number number
*/
int getPacketNumber(char *buff){return 0;}//((*(((int*)(buff+4))))&0xff)+1;};
/* /\** */
/* Loops over a memory slot until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). purely virtual func */
/* \param data pointer to the memory to be analyzed */
/* \param ndata reference to the amount of data found for the frame, in case the frame is incomplete at the end of the memory slot */
/* \param dsize size of the memory slot to be analyzed */
/* \returns pointer to the beginning of the last good frame (might be incomplete if ndata smaller than dataSize), or NULL if no frame is found */
/* *\/ */
/* virtual char *findNextFrame(char *data, int &ndata, int dsize){ndata=dsize; setDataSize(dsize); return data;}; */
/* /\** */
/* Loops over a file stream until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). Can be overloaded for different kind of detectors! */
/* \param filebin input file stream (binary) */
/* \returns pointer to the begin of the last good frame, NULL if no frame is found or last frame is incomplete */
/* *\/ */
/* virtual char *readNextFrame(ifstream &filebin){ */
/* // int afifo_length=0; */
/* uint16_t *afifo_cont; */
/* int ib=0; */
/* if (filebin.is_open()) { */
/* afifo_cont=new uint16_t[dataSize/2]; */
/* while (filebin.read(((char*)afifo_cont)+ib,2)) { */
/* ib+=2; */
/* if (ib==dataSize) break; */
/* } */
/* if (ib>0) { */
/* iframe++; */
/* // cout << ib << "-" << endl; */
/* return (char*)afifo_cont; */
/* } else { */
/* delete [] afifo_cont; */
/* return NULL; */
/* } */
/* } */
/* return NULL; */
/* }; */
virtual char *readNextFrame(ifstream &filebin) {
int ff=-1, np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int &ff) {
int np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np) {
char *data=new char[packetSize*nPackets];
char *d=readNextFrame(filebin, ff, np, data);
if (d==NULL) {delete [] data; data=NULL;}
return data;
}
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np, char *data) {
char *retval=0;
int nd;
int fnum = -1;
np=0;
int pn;
if (ff>=0)
fnum=ff;
if (filebin.is_open()) {
if (filebin.read(data, packetSize*nPackets) ){
iframe++;
ff=iframe;
return data;
}
}
return NULL;
};
/**
Loops over a memory slot until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). purely virtual func
\param data pointer to the memory to be analyzed
\param ndata reference to the amount of data found for the frame, in case the frame is incomplete at the end of the memory slot
\param dsize size of the memory slot to be analyzed
\returns pointer to the beginning of the last good frame (might be incomplete if ndata smaller than dataSize), or NULL if no frame is found
*/
virtual char *findNextFrame(char *data, int &ndata, int dsize){
if (dsize<packetSize*nPackets) ndata=dsize;
else ndata=packetSize*nPackets;
return data;
}
int getPacketNumber(int x, int y) {return dataMap[y][x]/packetSize;};
};
#endif

View File

@ -0,0 +1,268 @@
#ifndef MOENCH03T1ZMQDATANEW_H
#define MOENCH03T1ZMQDATANEW_H
#include "slsDetectorData.h"
class moench03T1ZmqDataNew : public slsDetectorData<uint16_t> {
private:
int iframe;
int nadc;
int sc_width;
int sc_height;
const int nSamples;
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
*/
moench03T1ZmqDataNew(int ns=5000): slsDetectorData<uint16_t>(400, 400, ns*32*2), nSamples(ns) {
int nadc=32;
int sc_width=25;
int sc_height=200;
int adc_nr[32]={300,325,350,375,300,325,350,375, \
200,225,250,275,200,225,250,275,\
100,125,150,175,100,125,150,175,\
0,25,50,75,0,25,50,75};
int row, col;
int isample;
int iadc;
int ix, iy;
int npackets=40;
int i;
int adc4(0);
for (int ip=0; ip<npackets; ip++) {
for (int is=0; is<128; is++) {
for (iadc=0; iadc<nadc; iadc++) {
i=128*ip+is;
adc4=(int)iadc/4;
if (i<sc_width*sc_height) {
// for (int i=0; i<sc_width*sc_height; i++) {
col=adc_nr[iadc]+(i%sc_width);
if (adc4%2==0) {
row=199-i/sc_width;
} else {
row=200+i/sc_width;
}
dataMap[row][col]=(nadc*i+iadc)*2;//+16*(ip+1);
if (dataMap[row][col]<0 || dataMap[row][col]>=nSamples*2*32)
cout << "Error: pointer " << dataMap[row][col] << " out of range "<< endl;
}
}
}
}
int ipacket;
int ibyte;
int ii=0;
for (int ipacket=0; ipacket<npackets; ipacket++) {
for (int ibyte=0; ibyte< 8192/2; ibyte++) {
i=ipacket*8208/2+ibyte;
/* if (ibyte<8) { */
/* //header! */
/* xmap[i]=-1; */
/* ymap[i]=-1; */
/* } else { */
// ii=ibyte+128*32*ipacket;
isample=ii/nadc;
if (isample<nSamples) {
iadc=ii%nadc;
adc4 = (int)iadc/4;
ix=isample%sc_width;
iy=isample/sc_width;
if (adc4%2==0) {
xmap[i]=adc_nr[iadc]+ix;
ymap[i]=ny/2-1-iy;
} else {
xmap[i]=adc_nr[iadc]+ix;
ymap[i]=ny/2+iy;
}
}
ii++;
// }
}
}
iframe=0;
// cout << "data struct created" << endl;
};
/**
Returns the frame number for the given dataset. Purely virtual func.
\param buff pointer to the dataset
\returns frame number
*/
/* class jfrau_packet_header_t { */
/* public: */
/* unsigned char reserved[4]; */
/* unsigned char packetNumber[1]; */
/* unsigned char frameNumber[3]; */
/* unsigned char bunchid[8]; */
/* }; */
int getFrameNumber(char *buff){return iframe;};//*((int*)(buff+5))&0xffffff;};
/**
Returns the packet number for the given dataset. purely virtual func
\param buff pointer to the dataset
\returns packet number number
*/
int getPacketNumber(char *buff){return 0;}//((*(((int*)(buff+4))))&0xff)+1;};
/* /\** */
/* Loops over a memory slot until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). purely virtual func */
/* \param data pointer to the memory to be analyzed */
/* \param ndata reference to the amount of data found for the frame, in case the frame is incomplete at the end of the memory slot */
/* \param dsize size of the memory slot to be analyzed */
/* \returns pointer to the beginning of the last good frame (might be incomplete if ndata smaller than dataSize), or NULL if no frame is found */
/* *\/ */
/* virtual char *findNextFrame(char *data, int &ndata, int dsize){ndata=dsize; setDataSize(dsize); return data;}; */
/* /\** */
/* Loops over a file stream until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). Can be overloaded for different kind of detectors! */
/* \param filebin input file stream (binary) */
/* \returns pointer to the begin of the last good frame, NULL if no frame is found or last frame is incomplete */
/* *\/ */
/* virtual char *readNextFrame(ifstream &filebin){ */
/* // int afifo_length=0; */
/* uint16_t *afifo_cont; */
/* int ib=0; */
/* if (filebin.is_open()) { */
/* afifo_cont=new uint16_t[dataSize/2]; */
/* while (filebin.read(((char*)afifo_cont)+ib,2)) { */
/* ib+=2; */
/* if (ib==dataSize) break; */
/* } */
/* if (ib>0) { */
/* iframe++; */
/* // cout << ib << "-" << endl; */
/* return (char*)afifo_cont; */
/* } else { */
/* delete [] afifo_cont; */
/* return NULL; */
/* } */
/* } */
/* return NULL; */
/* }; */
virtual char *readNextFrame(ifstream &filebin) {
int ff=-1, np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int &ff) {
int np=-1;
return readNextFrame(filebin, ff, np);
};
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np) {
char *data=new char[32*2*nSamples];
char *d=readNextFrame(filebin, ff, np, data);
if (d==NULL) {delete [] data; data=NULL;}
return data;
}
virtual char *readNextFrame(ifstream &filebin, int& ff, int &np, char *data) {
char *retval=0;
int nd;
int fnum = -1;
np=0;
int pn;
if (ff>=0)
fnum=ff;
if (filebin.is_open()) {
if (filebin.read(data, 32*2*nSamples) ){
iframe++;
ff=iframe;
return data;
}
}
return NULL;
};
/**
Loops over a memory slot until a complete frame is found (i.e. all packets 0 to nPackets, same frame number). purely virtual func
\param data pointer to the memory to be analyzed
\param ndata reference to the amount of data found for the frame, in case the frame is incomplete at the end of the memory slot
\param dsize size of the memory slot to be analyzed
\returns pointer to the beginning of the last good frame (might be incomplete if ndata smaller than dataSize), or NULL if no frame is found
*/
virtual char *findNextFrame(char *data, int &ndata, int dsize){
if (dsize<32*2*nSamples) ndata=dsize;
else ndata=32*2*nSamples;
return data;
}
int getPacketNumber(int x, int y) {return 0;};
};
#endif

View File

@ -4,7 +4,7 @@
class moench03CtbData : public slsDetectorData<uint16_t> {
class moench03TCtbData : public slsDetectorData<uint16_t> {
private:
@ -25,13 +25,9 @@ class moench03CtbData : public slsDetectorData<uint16_t> {
*/
moench03CtbData(int ns=5000): slsDetectorData<uint16_t>(400, 400, ns*2*32, NULL, NULL) , nadc(32), sc_width(25), sc_height(200) {
moench03TCtbData(int ns=5000): slsDetectorData<uint16_t>(400, 400, ns*2*32, NULL, NULL) , nadc(32), sc_width(25), sc_height(200) {
int adc_nr[32]={300,325,350,375,300,325,350,375, \
200,225,250,275,200,225,250,275,\
100,125,150,175,100,125,150,175,\
0,25,50,75,0,25,50,75};
int row, col;
int isample;
@ -40,6 +36,17 @@ class moench03CtbData : public slsDetectorData<uint16_t> {
int adc_nr[32]={300,325,350,375,300,325,350,375, \
200,225,250,275,200,225,250,275,\
100,125,150,175,100,125,150,175,\
0,25,50,75,0,25,50,75};
/* int adc_nr[32]={200,225,250,275,300,325,350,375,\ */
/* 0,25,50,75,100,125,150,175,\ */
/* 175,150,125,100,75,50,25,0,\ */
/* 375,350,325,300,275,250,225,200}; */
for (iadc=0; iadc<nadc; iadc++) {
@ -56,12 +63,15 @@ class moench03CtbData : public slsDetectorData<uint16_t> {
}
}
int adc4;
for (int i=0; i<nx*ny; i++) {
isample=i/nadc;
iadc=i%nadc;
ix=isample%sc_width;
iy=isample/sc_width;
if (iadc<(nadc/2)) {
adc4 = (int)iadc/4;
// if (iadc<(nadc/2)) {
if (adc4%2==0) {
xmap[i]=adc_nr[iadc]+ix;
ymap[i]=ny/2-1-iy;
} else {
@ -72,6 +82,22 @@ class moench03CtbData : public slsDetectorData<uint16_t> {
}
/* for (int i=0; i<nx*ny; i++) { */
/* isample=i/nadc; */
/* iadc=i%nadc; */
/* ix=isample%sc_width; */
/* iy=isample/sc_width; */
/* if (iadc<(nadc/2)) { */
/* xmap[i]=adc_nr[iadc]+ix; */
/* ymap[i]=ny/2-1-iy; */
/* } else { */
/* xmap[i]=adc_nr[iadc]+ix; */
/* ymap[i]=ny/2+iy; */
/* } */
/* } */

View File

@ -1,31 +0,0 @@
{
//.L moenchReadData.C
TFile *fout;
THStack *hs2N;
fout=new TFile("/scratch/outfile.root","RECREATE");
hs2N=moenchReadData("/data/moench_xbox_20140113/MoTarget_45kV_0_8mA_12us_120V_cds_g4_f00000%04d000_0.raw","dum",0,20,1500,-500,2500,1,0.,1,159,1,159, 0,1);
hs2N->SetName("cds_g4");
hs2N->SetTitle("cds_g4");
(TH2F*)(hs2N->GetHists()->At(0))->Write();
(TH2F*)(hs2N->GetHists()->At(1))->Write();
(TH2F*)(hs2N->GetHists()->At(2))->Write();
(TH2F*)(hs2N->GetHists()->At(3))->Write();
(TH2F*)(hs2N->GetHists()->At(4))->Write();
fout->Close();
}

View File

@ -1,457 +0,0 @@
TH2D *imageMacro(char *name) {
//TH2D *makeNorm(){
//TFile ff("/local_zfs_raid/tomcat_20160528/trees/img_blank_eta_gmap.root");
//TH2D *hff=(TH2D*)ff.Get("imgHR");
TFile *ff=new TFile("/mnt/moench_data/tomcat_20160528_img/img_blank_eta_nb25.root");
// TFile ff("/local_zfs_raid/tomcat_20160528/trees/img_blank_eta_gcorr_nb25.root");
TH2D *hff=(TH2D*)ff->Get("blankHR");
hff->SetName("imgBlank");
TH2D *hpixel=new TH2D("hpixel","hpixel",25,0,25,25,0,25);
for (int ibx=10*25; ibx<hff->GetNbinsX()-10*25; ibx++) {
for (int iby=20*25; iby<hff->GetNbinsY()-20*25; iby++) {
hpixel->Fill((ibx-12)%25,(iby-12)%25,hff->GetBinContent(ibx+1,iby+1));
}
}
hpixel->Scale(1./hpixel->GetBinContent(13,13));
// new TCanvas();
// hpixel->Draw("colz");
// TH2D *hraw=(TH2D*)hff->Clone("hraw");
TH2D *hpix=(TH2D*)hff->Clone("hpix");
for (int ibx=0; ibx<hff->GetNbinsX(); ibx++) {
for (int iby=0; iby<hff->GetNbinsY(); iby++) {
hpix->SetBinContent(ibx+1,iby+1,hpixel->GetBinContent(hpixel->GetXaxis()->FindBin((ibx-12)%25),hpixel->GetXaxis()->FindBin((iby-12)%25)));
}
}
// return hpix;
//}
//void imageMacro(char *name,TH2D *hpix=NULL){
// hff->Divide(hpix);
// new TCanvas();
// hff->Draw("colz");
// if (hpix==NULL)
// hpix=makeNorm();
TH2D *hg;
char nn[1000];
if (strcmp(name,"blank")==NULL) {
hg=hff;
} else {
sprintf(nn,"/mnt/moench_data/tomcat_20160528_img/img_%s_eta_nb25.root", name);
// if (strcmp(name,"blank"))
TFile *fg=new TFile(nn);
// else
// TFile fg=gDirectory;
//TFile fg("/local_zfs_raid/tomcat_20160528/trees/img_grating_1d_eta_gmap.root");
//TH2D *hg=(TH2D*)fg.Get("imgHR");
// TFile fg("/local_zfs_raid/tomcat_20160528/trees/img_grating_1d_eta_nb25.root");
// TFile fg("/local_zfs_raid/tomcat_20160528/trees/img_sample_eta_nb25.root");
// TFile fg("/local_zfs_raid/tomcat_20160528/trees/img_grating_1d_eta_gcorr_nb25.root");
sprintf(nn,"%sHR",name);
TH2D *hg=(TH2D*)fg->Get(nn);
// hg->SetName("imgGrating");
//hg->Divide(hff);
}
if (hpix)
hg->Divide(hpix);
new TCanvas();
hg->Draw("colz");
return hg;
}
void imageMacro(TH2D *hg){
Double_t imageData[200*400*25*25];
const int nsigma=5.;
int ip=0;
int max=0;
Double_t avg=0, rms=0;
for (int iby=0; iby<hg->GetNbinsY(); iby++) {
for (int ibx=0; ibx<hg->GetNbinsX(); ibx++) {
imageData[ip]=hg->GetBinContent(ibx+1,iby+1);
if (imageData[ip]>max) max=imageData[ip];
// if (imageData[ip]>3000) imageData[ip]=3000.;
avg+=((Double_t)imageData[ip])/(hg->GetNbinsY()*hg->GetNbinsX());
rms+=((Double_t)imageData[ip])*((Double_t)imageData[ip])/(hg->GetNbinsY()*hg->GetNbinsX());
ip++;
}
}
rms=TMath::Sqrt(rms-avg*avg);
ip=0;
for (int iby=0; iby<hg->GetNbinsY(); iby++) {
for (int ibx=0; ibx<hg->GetNbinsX(); ibx++) {
if (imageData[ip]>avg+nsigma*rms) imageData[ip]=avg+nsigma*rms;
// if (imageData[ip]>3000) imageData[ip]=3000.;
ip++;
}
}
cout << "MAXIMUM IS "<< max << endl;
cout << "AVERAGE IS "<< avg << endl;
cout << "RMS IS "<< rms << endl;
int nbx=hg->GetNbinsX();
int nby=hg->GetNbinsY();
Short_t *buffer=new Short_t[nbx];
// // cout << "Size of short int is "<<sizeof(char)<< endl;
// // cout << "width is "<<nbx<< endl;
// // cout << "height is "<<nby<< endl;
sprintf(nn,"%s_HR.bin", name);
ofstream myFile (nn, ios::out | ios::binary);
ip=0;
for (int iy=0; iy<nby; iy++) {
for (int ix=0; ix<nbx; ix++) {
buffer[ix]=imageData[ip]*65535/nsigma/avg;
ip++;
}
myFile.write((char*)buffer, nbx*sizeof(Short_t));
}
myFile.close();
TASImage *img=new TASImage ( "img",imageData, 400*25, 200*25);// TImagePalette * palette = 0
new TCanvas();
img->SetImageCompression(0);
img->SetImageQuality(TAttImage::kImgBest);
// img->Gray(kTRUE);
img->Draw();
sprintf(nn,"%s_HR.tiff", name);
img->WriteImage(nn, TImage::kTiff);
// new TCanvas();
// hg->SetMaximum(3000);
// hg->DrawCopy("colz");
hg->Rebin2D(25,25);
Double_t imageDataLR[200*400];
ip=0; max=0;avg=0; rms=0;
for (int iby=0; iby<hg->GetNbinsY(); iby++) {
for (int ibx=0; ibx<hg->GetNbinsX(); ibx++) {
imageDataLR[ip]=hg->GetBinContent(ibx+1,iby+1);
if (imageDataLR[ip]>max) max=imageDataLR[ip];
avg+=((Double_t)imageDataLR[ip])/(hg->GetNbinsY()*hg->GetNbinsX());
rms+=((Double_t)imageDataLR[ip])*((Double_t)imageDataLR[ip])/(hg->GetNbinsY()*hg->GetNbinsX());
ip++;
}
}
rms=TMath::Sqrt(rms-avg*avg);
ip=0;
for (int iby=0; iby<hg->GetNbinsY(); iby++) {
for (int ibx=0; ibx<hg->GetNbinsX(); ibx++) {
if (imageDataLR[ip]>avg+nsigma*rms) imageDataLR[ip]=avg+nsigma*rms;
// if (imageData[ip]>3000) imageData[ip]=3000.;
ip++;
}
}
cout << "MAXIMUM IS "<< max << endl;
cout << "AVERAGE IS "<< avg << endl;
cout << "RMS IS "<< rms << endl;
TASImage *imgLR=new TASImage ( "imgLR",imageDataLR, 400, 200);// TImagePalette * palette = 0
new TCanvas();
imgLR->SetImageCompression(0);
imgLR->SetImageQuality(TAttImage::kImgBest);
// imgLR->Gray(kTRUE);
imgLR->Draw();
sprintf(nn,"%s_LR.tiff", name);
imgLR->WriteImage(nn, TImage::kTiff);
int nbx1=hg->GetNbinsX();
int nby1=hg->GetNbinsY();
Short_t *buffer1=new Short_t[nbx1];
// // cout << "Size of short int is "<<sizeof(char)<< endl;
// // cout << "width is "<<nbx<< endl;
// // cout << "height is "<<nby<< endl;
sprintf(nn,"%s_LR.bin", name);
ofstream myFile1 (nn, ios::out | ios::binary);
ip=0;
for (int iy=0; iy<nby1; iy++) {
for (int ix=0; ix<nbx1; ix++) {
buffer1[ix]=imageDataLR[ip]*256/nsigma/avg;
ip++;
}
myFile1.write((char*)buffer1, nbx1*sizeof(Short_t));
}
myFile1.close();
cout << sizeof(Short_t) << endl;
//for grating2D the gratings are in the pixels (150-260)x(80-190)
// // hg->Draw("colz");
// int off=13;
// // hg->Divide(hpix);
// int ix,iy, sbx, sby, ibx2, iby2, sbx2, sby2;
// TH2F *hh13b=new TH2F("hh13b","hh13b",400*24,0,400,200*24,100,300);
// TH2F *hh13=new TH2F("hh13","hh13",400*23,0,400,200*23,100,300);
// TH2F *hh=new TH2F("hh","hh",400*21,0,400,200*21,100,300);
// TH2F *h1=new TH2F("h1","h1",400*23,0,400,200*23,100,300);
// for (int ibx=0; ibx<hg->GetNbinsX(); ibx++) {
// for (int iby=0; iby<hg->GetNbinsY(); iby++) {
// ix=(ibx-off)/25;
// iy=(iby-off)/25;
// sbx=(ibx-off)%25;
// sby=(iby-off)%25;
// sbx2=sbx-1;
// sby2=sby-1;
// if (sbx2<0) sbx2=0;
// if (sby2<0) sby2=0;
// if (sbx2>22) sbx2=22;
// if (sby2>22) sby2=22;
// ibx2=ix*23+(sbx2+off);
// iby2=iy*23+(sby2+off);
// hh13->Fill(hh13->GetXaxis()->GetBinCenter(ibx2+1),hh13->GetYaxis()->GetBinCenter(iby2+1),hg->GetBinContent(ibx+1,iby+1));
// // h1->Fill(h1->GetXaxis()->GetBinCenter(ibx2+1),h1->GetYaxis()->GetBinCenter(iby2+1),hpix->GetBinContent(ibx+1,iby+1));
// off=13;
// ix=(ibx-off)/25;
// iy=(iby-off)/25;
// sbx=(ibx-off)%25;
// sby=(iby-off)%25;
// sbx2=sbx-1;
// sby2=sby-1;
// // if (sbx2<0) sbx2=0;
// // if (sby2<0) sby2=0;
// ibx2=ix*24+(sbx2+off);
// iby2=iy*24+(sby2+off);
// if (sbx2<0 && sby2>=0) {
// ibx2=ix*24+(sbx2+off);
// hh13b->Fill(hh13b->GetXaxis()->GetBinCenter(ibx2+1),hh13b->GetYaxis()->GetBinCenter(iby2+1),0.5*hg->GetBinContent(ibx+1,iby+1));
// ibx2=ix*24+(sbx2+off)+1;
// hh13b->Fill(hh13b->GetXaxis()->GetBinCenter(ibx2+1),hh13b->GetYaxis()->GetBinCenter(iby2+1),0.5*hg->GetBinContent(ibx+1,iby+1));
// } else if (sby2<0 && sbx2>=0){
// iby2=iy*24+(sby2+off);
// hh13b->Fill(hh13b->GetXaxis()->GetBinCenter(ibx2+1),hh13b->GetYaxis()->GetBinCenter(iby2+1),0.5*hg->GetBinContent(ibx+1,iby+1));
// iby2=iy*24+(sby2+off)+1;
// hh13b->Fill(hh13b->GetXaxis()->GetBinCenter(ibx2+1),hh13b->GetYaxis()->GetBinCenter(iby2+1),0.5*hg->GetBinContent(ibx+1,iby+1));
// } else if (sby2<0 && sbx2<0){
// iby2=iy*24+(sby2+off);
// ibx2=ix*24+(sbx2+off);
// hh13b->Fill(hh13b->GetXaxis()->GetBinCenter(ibx2+1),hh13b->GetYaxis()->GetBinCenter(iby2+1),0.25*hg->GetBinContent(ibx+1,iby+1));
// iby2=iy*24+(sby2+off)+1;
// ibx2=ix*24+(sbx2+off);
// hh13b->Fill(hh13b->GetXaxis()->GetBinCenter(ibx2+1),hh13b->GetYaxis()->GetBinCenter(iby2+1),0.25*hg->GetBinContent(ibx+1,iby+1));
// iby2=iy*24+(sby2+off);
// ibx2=ix*24+(sbx2+off)+1;
// hh13b->Fill(hh13b->GetXaxis()->GetBinCenter(ibx2+1),hh13b->GetYaxis()->GetBinCenter(iby2+1),0.25*hg->GetBinContent(ibx+1,iby+1));
// iby2=iy*24+(sby2+off)+1;
// ibx2=ix*24+(sbx2+off)+1;
// hh13b->Fill(hh13b->GetXaxis()->GetBinCenter(ibx2+1),hh13b->GetYaxis()->GetBinCenter(iby2+1),0.25*hg->GetBinContent(ibx+1,iby+1));
// }else {
// hh13b->Fill(hh13b->GetXaxis()->GetBinCenter(ibx2+1),hh13b->GetYaxis()->GetBinCenter(iby2+1),hg->GetBinContent(ibx+1,iby+1));
// }
// ix=(ibx-off)/25;
// iy=(iby-off)/25;
// sbx=(ibx-off)%25;
// sby=(iby-off)%25;
// sbx2=sbx-2;
// sby2=sby-2;
// if (sbx2<0) sbx2=-1;
// if (sby2<0) sby2=-1;
// if (sbx2>20) sbx2=-1;
// if (sby2>20) sby2=-1;
// ibx2=ix*21+(sbx2+off);
// iby2=iy*21+(sby2+off);
// if (sbx2>=0 && sby2>=0) hh->Fill(hh->GetXaxis()->GetBinCenter(ibx2+1),hh->GetYaxis()->GetBinCenter(iby2+1),hg->GetBinContent(ibx+1,iby+1));
// }
// }
// new TCanvas();
// hg->GetXaxis()->SetRangeUser(84,87);
// hg->GetYaxis()->SetRangeUser(120,124);
// hg->Draw("colz");
// new TCanvas();
// // hh->Divide(h1);
// hh->GetXaxis()->SetRangeUser(84,87);
// hh->GetYaxis()->SetRangeUser(120,124);
// hh->Draw("colz");
// new TCanvas();
// // hh->Divide(h1);
// hh13b->GetXaxis()->SetRangeUser(84,87);
// hh13b->GetYaxis()->SetRangeUser(120,124);
// hh13b->Draw("colz");
// new TCanvas();
// // hh->Divide(h1);
// hh13->GetXaxis()->SetRangeUser(84,87);
// hh13->GetYaxis()->SetRangeUser(120,124);
// hh13->Draw("colz");
// // //TFile fsg("/local_zfs_raid/tomcat_20160528/trees/img_sample_grating_1d_eta_gmap.root");
// // //TH2D *hsg=(TH2D*)fsg.Get("sample_grating_1dHR");
// // TFile fsg("/local_zfs_raid/tomcat_20160528/trees/img_sample_grating_1d_eta.root");
// // TH2D *hsg=(TH2D*)fsg.Get("imgHR");
// // hsg->SetName("imgGratingSample");
// // hsg->Divide(hpix);
// // Double_t nf=hff->Integral(100,hff->GetNbinsX()-100,hff->GetYaxis()->FindBin(130), hff->GetYaxis()->FindBin(140))/((hff->GetNbinsX()-200)*250);
// // hff->Scale(1./nf);
// // // hg->Divide(hff);
// // //hsg->Divide(hff);
// // Double_t ng=hg->Integral(100,hg->GetNbinsX()-100,hg->GetYaxis()->FindBin(130), hg->GetYaxis()->FindBin(140))/((hg->GetNbinsX()-200)*250);
// // Double_t nsg=hsg->Integral(100,hsg->GetNbinsX()-100,hsg->GetYaxis()->FindBin(130), hsg->GetYaxis()->FindBin(140))/((hsg->GetNbinsX()-200)*250);
// // hg->Scale(1/ng);
// // hsg->Scale(1/nsg);
// // // new TCanvas();
// // // hg->SetMaximum(1.);
// // // hg->Draw("colz");
// // // new TCanvas();
// // // hsg->SetMaximum(1.);
// // // hsg->Draw("colz");
// // // TH1D *pg=hg->ProjectionX("pg",hg->GetYaxis()->FindBin(174.5)+1,hg->GetYaxis()->FindBin(175.5));
// // // TH1D *psg=hsg->ProjectionX("psg",hsg->GetYaxis()->FindBin(174.5)+1,hsg->GetYaxis()->FindBin(175.5));
// // // psg->SetLineColor(2);
// // // new TCanvas();
// // // pg->Draw("l");
// // // psg->Draw("l same");
// // int nbx=hg->GetNbinsX();
// // int nby=hg->GetNbinsY();
// // char buffer[nbx];
// // cout << "Size of short int is "<<sizeof(char)<< endl;
// // cout << "width is "<<nbx<< endl;
// // cout << "height is "<<nby<< endl;
// // ofstream myFile ("grating_1d.bin", ios::out | ios::binary);
// // for (int iy=0; iy<nby; iy++) {
// // for (int ix=0; ix<nbx; ix++) {
// // buffer[ix]=hg->GetBinContent(ix+1,iy+1);
// // }
// // myFile.write((char*)buffer, nbx*sizeof(char));
// // }
// // myFile.close();
// // nbx=hsg->GetNbinsX();
// // nby=hsg->GetNbinsY();
// // cout << "Size of short int is "<<sizeof(char)<< endl;
// // cout << "width is "<<nbx<< endl;
// // cout << "height is "<<nby<< endl;
// // ofstream myFile1 ("sample_grating_1d.bin", ios::out | ios::binary);
// // for (int iy=0; iy<nby; iy++) {
// // for (int ix=0; ix<nbx; ix++) {
// // buffer[ix]=hsg->GetBinContent(ix+1,iy+1);
// // }
// // myFile1.write((char*)buffer, nbx*sizeof(char));
// // }
// // myFile1.close();
// // NAME
// // raw2tiff - create a TIFF file from a raw data
// // SYNOPSIS
// // raw2tiff [ options ] input.raw output.tif
// // DESCRIPTION
// // raw2tiff converts a raw byte sequence into TIFF. By default, the TIFF image is created with data samples packed (PlanarConfiguration=1), compressed with the PackBits algorithm (Compression=32773),
// // and with each strip no more than 8 kilobytes. These characteristics can overridden, or explicitly specified with the options described below.
// // OPTIONS
// // -H number
// // size of input image file header in bytes (0 by default). This amount of data just will be skipped from the start of file while reading.
// // -w number
// // width of input image in pixels (can be guessed, see GUESSING THE IMAGE GEOMETRY below).
// // -l number
// // length of input image in lines (can be guessed, see GUESSING THE IMAGE GEOMETRY below).
// // -b number
// // number of bands in input image (1 by default).
// // -d data_type
// // type of samples in input image, where data_type may be:
// // byte 8-bit unsigned integer (default),
// // short 16-bit unsigned integer,
// // long 32-bit unsigned integer,
// // sbyte 8-bit signed integer,
// // sshort 16-bit signed integer,
// // slong 32-bit signed integer,
// // float 32-bit IEEE floating point,
// // double 64-bit IEEE floating point.
// // -i config
// // type of samples interleaving in input image, where config may be:
// // pixel pixel interleaved data (default),
// // band band interleaved data.
// // -p photo
// // photometric interpretation (color space) of the input image, where photo may be:
// // miniswhite white color represented with 0 value,
// // minisblack black color represented with 0 value (default),
// // rgb image has RGB color model,
// // cmyk image has CMYK (separated) color model,
// // ycbcr image has YCbCr color model,
// // cielab image has CIE L*a*b color model,
// // icclab image has ICC L*a*b color model,
// // itulab image has ITU L*a*b color model.
// // -s swap bytes fetched from the input file.
// // -L input data has LSB2MSB bit order (default).
// // -M input data has MSB2LSB bit order.
// // -c Specify a compression scheme to use when writing image data: -c none for no compression, -c packbits for the PackBits compression algorithm (the default), -c jpeg for the baseline JPEG compres-
// // sion algorithm, -c zip for the Deflate compression algorithm, and -c lzw for Lempel-Ziv & Welch.
// // -r number
// // Write data with a specified number of rows per strip; by default the number of rows/strip is selected so that each strip is approximately 8 kilobytes.
// //width is 10000
// //height is 5000
}

View File

@ -1,185 +0,0 @@
{
TColor::InitializeColors();
const Int_t NRGBs = 5;
const Int_t NCont = 255;//90;
Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
Double_t gray[NRGBs] = { 1., 0.34, 0.61, 0.84, 1.00};
Double_t zero[NRGBs] = { 0., 0.0,0.0, 0.0, 0.00};
//TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
TColor::CreateGradientColorTable(NRGBs, stops, gray, gray, gray, NCont);
gStyle->SetNumberContours(NCont);
gStyle->SetPadTopMargin(0);
gStyle->SetPadRightMargin(0);
gStyle->SetPadBottomMargin(0);
gStyle->SetPadLeftMargin(0);
gROOT->ForceStyle();
// TFile ff("/local_zfs_raid/tomcat_20160528/trees/img_blank_eta.root");
// TH2D *hff=(TH2D*)ff.Get("imgHR");
TFile ff("/mnt/moench_data/tomcat_20160528_img/img_blank_eta_nb25.root");
TH2D *hff=(TH2D*)ff.Get("blankHR");
hff->SetName("imgBlank");
TH2D *hpixel=new TH2D("hpixel","hpixel",25,0,25,25,0,25);
for (int ibx=10*25; ibx<hff->GetNbinsX()-10*25; ibx++) {
for (int iby=20*25; iby<hff->GetNbinsY()-20*25; iby++) {
hpixel->Fill((ibx-12)%25,(iby-12)%25,hff->GetBinContent(ibx+1,iby+1));
}
}
hpixel->Scale(1./hpixel->GetBinContent(13,13));
// new TCanvas();
// hpixel->Draw("colz");
TH2D *hraw=(TH2D*)hff->Clone("hraw");
TH2D *hpix=(TH2D*)hff->Clone("hpix");
for (int ibx=0; ibx<hff->GetNbinsX(); ibx++) {
for (int iby=0; iby<hff->GetNbinsY(); iby++) {
hpix->SetBinContent(ibx+1,iby+1,hpixel->GetBinContent(hpixel->GetXaxis()->FindBin((ibx-12)%25),hpixel->GetXaxis()->FindBin((iby-12)%25)));
}
}
hff->Divide(hpix);
// new TCanvas();
// hff->Draw("colz");
// TFile fg("/local_zfs_raid/tomcat_20160528/trees/img_grating_2d_eta.root");
// TH2D *hg=(TH2D*)fg.Get("imgHR");
TFile fg("/mnt/moench_data/tomcat_20160528_img/img_grating_2d_eta_nb25.root");
TH2D *hg=(TH2D*)fg.Get("grating_2dHR");
hg->SetName("imgGrating");
hg->Divide(hpix);
Double_t nf=hff->Integral(100,hff->GetNbinsX()-100,hff->GetYaxis()->FindBin(130), hff->GetYaxis()->FindBin(140))/((hff->GetNbinsX()-200)*250);
hff->Scale(1./nf);
// hg->Divide(hff);
//hsg->Divide(hff);
Double_t ng=hg->Integral(100,hg->GetNbinsX()-100,hg->GetYaxis()->FindBin(130), hg->GetYaxis()->FindBin(140))/((hg->GetNbinsX()-200)*250);
hg->Scale(1/ng);
new TCanvas("c1","c1",800,800);
hg->SetMaximum(2.);
Double_t xmin=hg->GetXaxis()->GetXmin();
Double_t xmax=hg->GetXaxis()->GetXmax();
Double_t ymin=hg->GetYaxis()->GetXmin();
Double_t ymax=hg->GetYaxis()->GetXmax();
hg->SetTitle(";mm;mm;Normalized intensity (a.u.)");
hg->GetXaxis()->Set(hg->GetXaxis()->GetNbins(),xmin*0.025-180.*0.025+0.1,xmax*0.025-180.*0.025+0.1);
hg->GetYaxis()->Set(hg->GetYaxis()->GetNbins(),ymin*0.025-180.*0.025-1.5,ymax*0.025-180*0.025-1.5);
hg->GetXaxis()->SetRangeUser(0,0.5);
hg->GetYaxis()->SetRangeUser(0,0.5);
hg->Draw("col");
hg->SetStats(kFALSE);
// new TCanvas();
// hsg->SetMaximum(1.);
// hsg->Draw("colz");
// TH1D *pg=hg->ProjectionX("pg",hg->GetYaxis()->FindBin(174.5)+1,hg->GetYaxis()->FindBin(175.5));
// TH1D *psg=hsg->ProjectionX("psg",hsg->GetYaxis()->FindBin(174.5)+1,hsg->GetYaxis()->FindBin(175.5));
// psg->SetLineColor(2);
// new TCanvas();
// pg->Draw("l");
// psg->Draw("l same");
int nbx=hg->GetNbinsX();
int nby=hg->GetNbinsY();
char buffer[nbx];
cout << "Size of short int is "<<sizeof(char)<< endl;
cout << "width is "<<nbx<< endl;
cout << "height is "<<nby<< endl;
ofstream myFile ("grating_2d.bin", ios::out | ios::binary);
for (int iy=0; iy<nby; iy++) {
for (int ix=0; ix<nbx; ix++) {
buffer[ix]=hg->GetBinContent(ix+1,iy+1);
}
myFile.write((char*)buffer, nbx*sizeof(char));
}
myFile.close();
// NAME
// raw2tiff - create a TIFF file from a raw data
// SYNOPSIS
// raw2tiff [ options ] input.raw output.tif
// DESCRIPTION
// raw2tiff converts a raw byte sequence into TIFF. By default, the TIFF image is created with data samples packed (PlanarConfiguration=1), compressed with the PackBits algorithm (Compression=32773),
// and with each strip no more than 8 kilobytes. These characteristics can overridden, or explicitly specified with the options described below.
// OPTIONS
// -H number
// size of input image file header in bytes (0 by default). This amount of data just will be skipped from the start of file while reading.
// -w number
// width of input image in pixels (can be guessed, see GUESSING THE IMAGE GEOMETRY below).
// -l number
// length of input image in lines (can be guessed, see GUESSING THE IMAGE GEOMETRY below).
// -b number
// number of bands in input image (1 by default).
// -d data_type
// type of samples in input image, where data_type may be:
// byte 8-bit unsigned integer (default),
// short 16-bit unsigned integer,
// long 32-bit unsigned integer,
// sbyte 8-bit signed integer,
// sshort 16-bit signed integer,
// slong 32-bit signed integer,
// float 32-bit IEEE floating point,
// double 64-bit IEEE floating point.
// -i config
// type of samples interleaving in input image, where config may be:
// pixel pixel interleaved data (default),
// band band interleaved data.
// -p photo
// photometric interpretation (color space) of the input image, where photo may be:
// miniswhite white color represented with 0 value,
// minisblack black color represented with 0 value (default),
// rgb image has RGB color model,
// cmyk image has CMYK (separated) color model,
// ycbcr image has YCbCr color model,
// cielab image has CIE L*a*b color model,
// icclab image has ICC L*a*b color model,
// itulab image has ITU L*a*b color model.
// -s swap bytes fetched from the input file.
// -L input data has LSB2MSB bit order (default).
// -M input data has MSB2LSB bit order.
// -c Specify a compression scheme to use when writing image data: -c none for no compression, -c packbits for the PackBits compression algorithm (the default), -c jpeg for the baseline JPEG compres-
// sion algorithm, -c zip for the Deflate compression algorithm, and -c lzw for Lempel-Ziv & Welch.
// -r number
// Write data with a specified number of rows per strip; by default the number of rows/strip is selected so that each strip is approximately 8 kilobytes.
//width is 10000
//height is 5000
}

View File

@ -1,173 +0,0 @@
{
// TFile ff("/local_zfs_raid/tomcat_20160528/trees/img_blank_eta.root");
// TH2D *hff=(TH2D*)ff.Get("imgHR");
// TFile ff("/local_zfs_raid/tomcat_20160528/trees/img_blank_eta_gmap_v2.root");
// TH2D *hff=(TH2D*)ff.Get("blankHR");
// hff->SetName("imgBlank");
// TH2D *hpixel=new TH2D("hpixel","hpixel",25,0,25,25,0,25);
// for (int ibx=10*25; ibx<hff->GetNbinsX()-10*25; ibx++) {
// for (int iby=20*25; iby<hff->GetNbinsY()-20*25; iby++) {
// hpixel->Fill((ibx-12)%25,(iby-12)%25,hff->GetBinContent(ibx+1,iby+1));
// }
// }
// hpixel->Scale(1./hpixel->GetBinContent(13,13));
// // new TCanvas();
// // hpixel->Draw("colz");
// TH2D *hraw=(TH2D*)hff->Clone("hraw");
// TH2D *hpix=(TH2D*)hff->Clone("hpix");
// for (int ibx=0; ibx<hff->GetNbinsX(); ibx++) {
// for (int iby=0; iby<hff->GetNbinsY(); iby++) {
// hpix->SetBinContent(ibx+1,iby+1,hpixel->GetBinContent(hpixel->GetXaxis()->FindBin((ibx-12)%25),hpixel->GetXaxis()->FindBin((iby-12)%25)));
// }
// }
// hff->Divide(hpix);
// Double_t nf=hff->Integral(100,hff->GetNbinsX()-100,hff->GetYaxis()->FindBin(130), hff->GetYaxis()->FindBin(140))/((hff->GetNbinsX()-200)*250);
// hff->Scale(1./nf);
// new TCanvas();
// hff->Draw("colz");
// TFile fg("/local_zfs_raid/tomcat_20160528/trees/img_grating_2d_eta.root");
// TH2D *hg=(TH2D*)fg.Get("imgHR");
TFile fg("/mnt/moench_data/tomcat_20160528_img/img_sample_eta_gmap_v2.root");
TH2D *hg=(TH2D*)fg.Get("sampleHR");
hg->SetName("imgSample");
// hg->Divide(hpix);
// hg->Divide(hff);
//hsg->Divide(hff);
Double_t ng=hg->Integral(100,hg->GetNbinsX()-100,hg->GetYaxis()->FindBin(130), hg->GetYaxis()->FindBin(140))/((hg->GetNbinsX()-200)*250);
hg->Scale(1/ng);
// new TCanvas();
// hsg->SetMaximum(1.);
// hsg->Draw("colz");
// TH1D *pg=hg->ProjectionX("pg",hg->GetYaxis()->FindBin(174.5)+1,hg->GetYaxis()->FindBin(175.5));
// TH1D *psg=hsg->ProjectionX("psg",hsg->GetYaxis()->FindBin(174.5)+1,hsg->GetYaxis()->FindBin(175.5));
// psg->SetLineColor(2);
// new TCanvas();
// pg->Draw("l");
// psg->Draw("l same");
TH2D *hpixel1=new TH2D("hpixel1","hpixel1",25,0,25,25,0,25);
for (int ibx=10*25; ibx<35*25; ibx++) {
for (int iby=25*25; iby<50*25; iby++) {
hpixel1->Fill((ibx-12)%25,(iby-12)%25,hg->GetBinContent(ibx+1,iby+1));
}
}
hpixel1->Scale(1./hpixel1->GetBinContent(13,13));
// new TCanvas();
// hpixel->Draw("colz");
TH2D *hpix1=(TH2D*)hg->Clone("hpix1");
for (int ibx=0; ibx<hg->GetNbinsX(); ibx++) {
for (int iby=0; iby<hg->GetNbinsY(); iby++) {
hpix1->SetBinContent(ibx+1,iby+1,hpixel1->GetBinContent(hpixel1->GetXaxis()->FindBin((ibx-12)%25),hpixel1->GetXaxis()->FindBin((iby-12)%25)));
}
}
hg->Divide(hpix1);
new TCanvas();
hg->SetMaximum(4);
hg->SetMinimum(0.5);
hg->Draw("colz");
int nbx=hg->GetNbinsX();
int nby=hg->GetNbinsY();
char buffer[nbx];
cout << "Size of short int is "<<sizeof(char)<< endl;
cout << "width is "<<nbx<< endl;
cout << "height is "<<nby<< endl;
ofstream myFile ("sample.bin", ios::out | ios::binary);
for (int iy=0; iy<nby; iy++) {
for (int ix=0; ix<nbx; ix++) {
buffer[ix]=hg->GetBinContent(ix+1,iy+1);
}
myFile.write((char*)buffer, nbx*sizeof(char));
}
myFile.close();
// NAME
// raw2tiff - create a TIFF file from a raw data
// SYNOPSIS
// raw2tiff [ options ] input.raw output.tif
// DESCRIPTION
// raw2tiff converts a raw byte sequence into TIFF. By default, the TIFF image is created with data samples packed (PlanarConfiguration=1), compressed with the PackBits algorithm (Compression=32773),
// and with each strip no more than 8 kilobytes. These characteristics can overridden, or explicitly specified with the options described below.
// OPTIONS
// -H number
// size of input image file header in bytes (0 by default). This amount of data just will be skipped from the start of file while reading.
// -w number
// width of input image in pixels (can be guessed, see GUESSING THE IMAGE GEOMETRY below).
// -l number
// length of input image in lines (can be guessed, see GUESSING THE IMAGE GEOMETRY below).
// -b number
// number of bands in input image (1 by default).
// -d data_type
// type of samples in input image, where data_type may be:
// byte 8-bit unsigned integer (default),
// short 16-bit unsigned integer,
// long 32-bit unsigned integer,
// sbyte 8-bit signed integer,
// sshort 16-bit signed integer,
// slong 32-bit signed integer,
// float 32-bit IEEE floating point,
// double 64-bit IEEE floating point.
// -i config
// type of samples interleaving in input image, where config may be:
// pixel pixel interleaved data (default),
// band band interleaved data.
// -p photo
// photometric interpretation (color space) of the input image, where photo may be:
// miniswhite white color represented with 0 value,
// minisblack black color represented with 0 value (default),
// rgb image has RGB color model,
// cmyk image has CMYK (separated) color model,
// ycbcr image has YCbCr color model,
// cielab image has CIE L*a*b color model,
// icclab image has ICC L*a*b color model,
// itulab image has ITU L*a*b color model.
// -s swap bytes fetched from the input file.
// -L input data has LSB2MSB bit order (default).
// -M input data has MSB2LSB bit order.
// -c Specify a compression scheme to use when writing image data: -c none for no compression, -c packbits for the PackBits compression algorithm (the default), -c jpeg for the baseline JPEG compres-
// sion algorithm, -c zip for the Deflate compression algorithm, and -c lzw for Lempel-Ziv & Welch.
// -r number
// Write data with a specified number of rows per strip; by default the number of rows/strip is selected so that each strip is approximately 8 kilobytes.
//width is 10000
//height is 5000
}

File diff suppressed because it is too large Load Diff

View File

@ -1,224 +0,0 @@
#ifndef SLS_INTERPOLATION_H
#define SLS_INTERPOLATION_H
#include <TObject.h>
#include <TTree.h>
#include <TH2F.h>
#ifndef DEF_QUAD
#define DEF_QUAD
enum quadrant {
TOP_LEFT=0,
TOP_RIGHT=1,
BOTTOM_LEFT=2,
BOTTOM_RIGHT=3,
UNDEFINED_QUADRANT=-1
};
#endif
class slsInterpolation : public TObject{
public:
slsInterpolation(int nx=40, int ny=160, int ns=25) :nPixelsX(nx), nPixelsY(ny), nSubPixels(ns) {hint=new TH2F("hint","hint",ns*nx, 0, nx, ns*ny, 0, ny);};
//create eta distribution, eta rebinnining etc.
//returns flat field image
virtual void prepareInterpolation(int &ok)=0;
//create interpolated image
//returns interpolated image
virtual TH2F *getInterpolatedImage(){return hint;};
//return position inside the pixel for the given photon
virtual void getInterpolatedPosition(Int_t x, Int_t y, Double_t *data, Double_t &int_x, Double_t &int_y)=0;
TH2F *addToImage(Double_t int_x, Double_t int_y){hint->Fill(int_x, int_y); return hint;};
virtual int addToFlatField(Double_t *cluster, Double_t &etax, Double_t &etay)=0;
virtual int addToFlatField(Double_t etax, Double_t etay)=0;
//virtual void Streamer(TBuffer &b);
static int calcQuad(Double_t *cl, Double_t &sum, Double_t &totquad, Double_t sDum[2][2]){
int corner = UNDEFINED_QUADRANT;
Double_t *cluster[3];
cluster[0]=cl;
cluster[1]=cl+3;
cluster[2]=cl+6;
sum = cluster[0][0] + cluster[1][0] + cluster[2][0] + cluster[0][1] + cluster[1][1] + cluster[2][1] + cluster[0][2] + cluster[1][2] + cluster[2][2];
double sumBL = cluster[0][0] + cluster[1][0] + cluster[0][1] + cluster[1][1]; //2 ->BL
double sumTL = cluster[1][0] + cluster[2][0] + cluster[2][1] + cluster[1][1]; //0 ->TL
double sumBR = cluster[0][1] + cluster[0][2] + cluster[1][2] + cluster[1][1]; //3 ->BR
double sumTR = cluster[1][2] + cluster[2][1] + cluster[2][2] + cluster[1][1]; //1 ->TR
double sumMax = 0;
double t, r;
// if(sumTL >= sumMax){
sDum[0][0] = cluster[0][0]; sDum[1][0] = cluster[1][0];
sDum[0][1] = cluster[0][1]; sDum[1][1] = cluster[1][1];
corner = BOTTOM_LEFT;
sumMax=sumBL;
// }
if(sumTL >= sumMax){
sDum[0][0] = cluster[1][0]; sDum[1][0] = cluster[2][0];
sDum[0][1] = cluster[1][1]; sDum[1][1] = cluster[2][1];
corner = TOP_LEFT;
sumMax=sumTL;
}
if(sumBR >= sumMax){
sDum[0][0] = cluster[0][1]; sDum[1][0] = cluster[1][1];
sDum[0][1] = cluster[0][2]; sDum[1][1] = cluster[1][2];
corner = BOTTOM_RIGHT;
sumMax=sumBR;
}
if(sumTR >= sumMax){
sDum[0][0] = cluster[1][1]; sDum[1][0] = cluster[2][1];
sDum[0][1] = cluster[1][2]; sDum[1][1] = cluster[2][2];
corner = TOP_RIGHT;
sumMax=sumTR;
}
totquad=sumMax;
return corner;
}
static int calcEta(Double_t totquad, Double_t sDum[2][2], Double_t &etax, Double_t &etay){
Double_t t,r;
if (totquad>0) {
t = sDum[1][0] + sDum[1][1];
r = sDum[0][1] + sDum[1][1];
etax=r/totquad;
etay=t/totquad;
}
return 0;
}
static int calcEta(Double_t *cl, Double_t &etax, Double_t &etay, Double_t &sum, Double_t &totquad, Double_t sDum[2][2]) {
int corner = calcQuad(cl,sum,totquad,sDum);
calcEta(totquad, sDum, etax, etay);
return corner;
}
static int calcEtaL(Double_t totquad, int corner, Double_t sDum[2][2], Double_t &etax, Double_t &etay){
Double_t t,r, toth, totv;
if (totquad>0) {
switch(corner) {
case TOP_LEFT:
t = sDum[1][1] ;
r = sDum[0][1] ;
toth=sDum[1][1]+sDum[1][0];
totv=sDum[0][1]+sDum[1][1];
break;
case TOP_RIGHT:
t = sDum[1][0] ;
r = sDum[0][1] ;
toth=sDum[0][0]+t;
totv=sDum[0][0]+r;
break;
case BOTTOM_LEFT:
r = sDum[1][1] ;
t = sDum[1][1] ;
toth=sDum[1][0]+t;
totv=sDum[0][1]+r;
break;
case BOTTOM_RIGHT:
t = sDum[1][0] ;
r = sDum[1][1] ;
toth=sDum[1][1]+t;
totv=sDum[0][1]+r;
break;
default:
etax=-1;
etay=-1;
return 0;
}
etax=r/totv;
etay=t/toth;
}
return 0;
}
static int calcEtaL(Double_t *cl, Double_t &etax, Double_t &etay, Double_t &sum, Double_t &totquad, Double_t sDum[2][2]) {
int corner = calcQuad(cl,sum,totquad,sDum);
calcEtaL(totquad, corner, sDum, etax, etay);
return corner;
}
static int calcEtaC3(Double_t *cl, Double_t &etax, Double_t &etay, Double_t &sum, Double_t &totquad, Double_t sDum[2][2]){
int corner = calcQuad(cl,sum,totquad,sDum);
calcEta(sum, sDum, etax, etay);
return corner;
}
static int calcEta3(Double_t *cl, Double_t &etax, Double_t &etay, Double_t &sum) {
Double_t l,r,t,b;
sum=cl[0]+cl[1]+cl[2]+cl[3]+cl[4]+cl[5]+cl[6]+cl[7]+cl[8];
if (sum>0) {
l=cl[0]+cl[3]+cl[6];
r=cl[2]+cl[5]+cl[8];
b=cl[0]+cl[1]+cl[2];
t=cl[6]+cl[7]+cl[8];
etax=(-l+r)/sum;
etay=(-b+t)/sum;
}
return -1;
}
static int calcEta3X(Double_t *cl, Double_t &etax, Double_t &etay, Double_t &sum) {
Double_t l,r,t,b;
sum=cl[0]+cl[1]+cl[2]+cl[3]+cl[4]+cl[5]+cl[6]+cl[7]+cl[8];
if (sum>0) {
l=cl[3];
r=cl[5];
b=cl[1];
t=cl[7];
etax=(-l+r)/sum;
etay=(-b+t)/sum;
}
return -1;
}
protected:
int nPixelsX, nPixelsY;
int nSubPixels;
TH2F *hint;
// ClassDefNV(slsInterpolation,1);
// #pragma link C++ class slsInterpolation-;
};
#endif

View File

@ -1,11 +0,0 @@
{
//.L energyCalibration.cpp+
//.L gainMap.C+
TFile fin("/data/moench_xbox_20140113/MoTarget_45kV_0_8mA_120V_cds_g4.root");
TH2F *h2=fin.Get("h2");
TH2F *gMap=gainMap(h2,4);
gMap->Draw("colz");
}

View File

@ -1,228 +0,0 @@
#define MYROOT
#include <TH2F.h>
#include <TSpectrum.h>
#include <TH1D.h>
#include <TFile.h>
#include <TList.h>
#include <TPolyMarker.h>
#include <THStack.h>
#include <TF1.h>
#include <TGraphErrors.h>
#include <iostream>
#include <energyCalibration.h>
using namespace std;
#define FOPT "0"
TH2F *gainMap(TH2F *h2, float g) {
// int npx, npy;
int npx=160, npy=160;
// det->getDetectorSize(npx, npy);
TH2F *gMap=new TH2F("gmap",h2->GetTitle(), npx, -0.5, npx-0.5, npy, -0.5, npy-0.5);
Double_t ens[3]={0,8,17.5}, eens[3]={0.,0.1,0.1};
Double_t peaks[3], epeaks[3];
int ibin;
TH1D *px;
energyCalibration *enCal=new energyCalibration();
enCal->setPlotFlag(0);
// enCal->setChargeSharing(0);
enCal->setScanSign(1);
Double_t gain, off, egain, eoff;
TList *functions;
TPolyMarker *pm ;
Double_t *peakX, *peakY;
TSpectrum *s=new TSpectrum();
Double_t mypar[10], emypar[10];
Double_t prms, np;
int iit=0;
TGraph *glin;
Double_t peakdum, hpeakdum;
for (int ix=1; ix<npx-1; ix++) {
for (int iy=1; iy<npy-1; iy++) {
// cout << ix << " " << iy << " " << ibin << endl;
ibin=ix*npy+iy;
px=h2->ProjectionX("px",ibin+1,ibin+1);
prms=10*g;
iit=0;
np=s->Search(px,prms,"",0.2);
while (np !=2) {
if (np>2)
prms+=0.5*prms;
else
prms-=0.5*prms;
iit++;
if (iit>=10)
break;
np=s->Search(px,prms,"",0.2);
}
if (np!=2)
cout << "peak search could not converge " << ibin << endl;
if (np==2) {
pm=NULL;
functions=px->GetListOfFunctions();
if (functions)
pm = (TPolyMarker*)functions->FindObject("TPolyMarker");
if (pm) {
peakX=pm->GetX();
peakY=pm->GetY();
if (peakX[0]>peakX[1]) {
peakdum=peakX[0];
hpeakdum=peakY[0];
peakX[0]= peakX[1];
peakY[0]= peakY[1];
peakX[1]= peakdum;
peakY[1]= hpeakdum;
}
cout << "("<< ix << "," << iy << ") " << endl;
for (int ip=0; ip<np; ip++) {
// cout << ip << " " << peakX[ip] << " " << peakY[ip] << endl;
enCal->setFitRange(peakX[ip]-10*g,peakX[ip]+10*g);
mypar[0]=0;
mypar[1]=0;
mypar[2]=peakX[ip];
mypar[3]=g*10;
mypar[4]=peakY[ip];
mypar[5]=0;
enCal->setStartParameters(mypar);
enCal->fitSpectrum(px,mypar,emypar);
peaks[ip+1]=mypar[2];
epeaks[ip+1]=emypar[2];
}
peaks[0]=0;
epeaks[0]=1;
// for (int i=0; i<3; i++) cout << i << " " << ens[i] << " " << eens[i]<< " "<< peaks[i]<< " " << epeaks[i] << endl;
glin= enCal->linearCalibration(3,ens,eens,peaks,epeaks,gain,off,egain,eoff);
// cout << "Gain " << gain << " off " << off << endl;
if (off>-10 && off<10) {
gMap->SetBinContent(ix+1,iy+1,gain);
gMap->SetBinError(ix+1,iy+1,egain);
}
if (glin)
delete glin;
}
}
}
}
return gMap;
}
TH2F *noiseMap(TH2F *h2) {
// int npx, npy;
int npx=160, npy=160;
// det->getDetectorSize(npx, npy);
TH2F *nMap=new TH2F("nmap",h2->GetTitle(), npx, -0.5, npx-0.5, npy, -0.5, npy-0.5);
int ibin;
TH1D *px;
for (int ix=0; ix<npx; ix++) {
for (int iy=0; iy<npy; iy++) {
cout << ix << " " << iy << " " << ibin << endl;
ibin=ix*npy+iy;
px=h2->ProjectionX("px",ibin+1,ibin+1);
px->Fit("gaus", FOPT);
if (px->GetFunction("gaus")) {
nMap->SetBinContent(ix+1,iy+1,px->GetFunction("gaus")->GetParameter(2));
}
// delete px;
}
}
return nMap;
}
THStack *noiseHistos(char *tit) {
char fname[10000];
sprintf(fname,"/data/moench_xbox_20140116/noise_map_%s.root",tit);
TFile *fn=new TFile(fname);
TH2F *nmap=(TH2F*)fn->Get("nmap");
if (nmap==NULL) {
cout << "No noise map in file " << fname << endl;
return NULL;
}
sprintf(fname,"/data/moench_xbox_20140113/gain_map_%s.root",tit);
TFile *fg=new TFile(fname);
TH2F *gmap=(TH2F*)fg->Get("gmap");
if (gmap==NULL) {
cout << "No gain map in file " << fname << endl;
return NULL;
}
nmap->Divide(gmap);
nmap->Scale(1000./3.6);
THStack *hs=new THStack(tit,tit);
hs->SetTitle(tit);
TH1F *h;
char hname[100];
cout << tit << endl;
for (int is=0; is<4; is++) {
sprintf(hname,"h%ds",is+1);
h=new TH1F(hname,tit,500,0,500);
hs->Add(h);
// cout << hs->GetHists()->GetEntries() << endl;
for (int ix=40*is+2; ix<40*(is+1)-2; ix++) {
for (int iy=2; iy<158; iy++) {
if (ix<100 || ix>120)
h->Fill(nmap->GetBinContent(ix+1,iy+1));
}
}
cout << is+1 << "SC: " << "" << h->GetMean() << "+-" << h->GetRMS();
h->Fit("gaus","0Q");
h->SetLineColor(is+1);
if (h->GetFunction("gaus")) {
h->GetFunction("gaus")->SetLineColor(is+1);
cout << " or " << h->GetFunction("gaus")->GetParameter(1) << "+-" << h->GetFunction("gaus")->GetParError(1);
}
cout << endl;
}
// cout << hs->GetHists()->GetEntries() << endl;
return hs;
}

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