Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
software/JDataFilter/JDataFilter.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author rbruijn
4 #
5 script=${0##*/}
6 
7 # ------------------------------------------------------------------------------------------
8 #
9 # Example script to run JDataFilter and JDOMSimulator(s)
10 #
11 # ------------------------------------------------------------------------------------------
12 
13 
14 if [ -z $JPP_DIR ]; then
15  echo "Variable JPP_DIR undefined."
16  exit
17 fi
18 
19 
20 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
21 
22 
23 if ( do_usage $* ); then
24  usage "$script"
25 fi
26 
27 
28 #local test
29 
30 SERVER=localhost
31 LOGGER=localhost
32 DEBUG=3
33 RUN=1
34 
35 HOST1=$HOST
36 HOST2=$HOST
37 
38 PORT=5552
39 
40 RUNTIME_S=1
41 
42 cat>ev_init.txt<<EOF
43 hello world
44 EOF
45 
46 # re-start ligier for command and logger messages
47 
48 if (( 1 )); then
49  JLigiers.sh continue
50 fi
51 
52 
53 
54 # driver input
55 
56 cat>driver.txt<<EOF
57 
58 process dfilter $HOST1 ssh \$HOST\$ "JDataFilter -H \$SERVER\$ -M \$LOGGER\$ -d $DEBUG &";
59 
60 enter
61 
62 event ev_init { RC_CMD %<ev_init.txt>%from me%<ev_init.txt>% }
63 event ev_configure { RC_DFLTR datawriter=localhost; }
64 
65 event ev_start { RC_CMD $RUN}
66 
67 sleep $RUNTIME_S
68 
69 event ev_pause { RC_CMD }
70 event ev_stop { RC_CMD }
71 event ev_reset { RC_CMD }
72 event ev_off { RC_CMD }
73 
74 EOF
75 
76 JDAQDriver -H $SERVER -M $LOGGER -d $DEBUG -f driver.txt -c
static const double H
Planck constant [eV s].
Definition: JConstants.hh:25
event< ev_daq > ev_reset
Definition: JDAQCHSM.chsm:180
then JLigiers sh continue fi cat driver txt<< EOFprocess dfilter $HOST1 ssh\$HOST\$"JDataFilter -H \$SERVER\$ -M \$LOGGER\$ -d $DEBUG &";enterevent ev_init{RC_CMD%< ev_init.txt > from me< ev_init.txt > event ev_configure
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
event< ev_daq > ev_stop
Definition: JDAQCHSM.chsm:179
then usage $script[host[local file]] fi case set_variable LOGGER
Definition: JStopDAQ.sh:28
exit
Definition: JPizza.sh:36
event< ev_daq > ev_pause
Definition: JDAQCHSM.chsm:177
then JPizza f
Definition: JPizza.sh:46
then cat ev_configure txt<< EOFdatawriter=$DWRITER_HOST;inputFile=$INPUT_FILE;eventRate_Hz=100.0;EOFfiif[[!-f driver.txt]];thencat > driver txt<< EOFprocess JEventGenerator $HOST ssh\$HOST\$"$JPP_BIN/JEventGenerator -u \$NAME\$ -H \$SERVER\$ -M \$LOGGER\$ -d $DEBUG </dev/null >& dev null& process JDataWriter $HOST ssh $HOST $JPP_BIN JDataWriter u $NAME H $SERVER M $LOGGER d $DEBUG</dev/null >& dev null& enter event ev_init
then echo
then print_variable DETECTOR INPUT_FILE INTERMEDIATE_FILE check_input_file $DETECTOR $INPUT_FILE check_output_file $INTERMEDIATE_FILE $OUTPUT_FILE JMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JPath.sh:52
then rm i $OUTPUT_FILE fi let RUN
* usage
do sleep done JPutMessage H $LOGGER t MSG m Hello world
event< ev_daq > ev_off
Definition: JDAQCHSM.chsm:182
static const JNET::JTag RC_CMD
Definition: JDAQTags.hh:44
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
then usage $script fi SERVER
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62