-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME
46 lines (34 loc) · 931 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
SNO+ Dispatcher
===============
Installation
------------
To install the dispatcher library::
$ git clone git@github.com:snoplus/disp.git
$ cd disp
$ make
$ source env.sh
Running the Dispatcher
----------------------
To run the dispatcher, simply run::
$ dispatch
To run the dispatcher as a daemon::
$ nohup dispatch &>[path/to/logfile] &
Reading from the Dispatcher
---------------------------
You can read events from the dispatch stream
using the python module dispatch::
>>> from dispatch import *
>>> d = Dispatch('localhost')
>>> record = d.recv()
>>> id, record = unpack_header(record)
>>> id == RECORD_IDS['PMT_RECORD']
True
>>> pmt_record_gen = unpack_pmt_record(record)
>>> pmt_event_record = next(pmt_record_gen)
>>> pmt_event_record.NPmtHit
20
>>> for uncal_pmt in pmt_record_gen:
... print uncal_pmt.BoardID
...
11
3