2 # ------------------------------------------------------------------------------------------
4 # Example script to run the JPP DAQ Context for DOM Testing
7 #This script originally was authored by R. Bruijn, contributors: L. Nauta, K. Graf
10 #To run stand-alone, try
11 #./JDOMDAQDriver.sh 60 192.16.192.179(180) $TMP_DIR some_detfile.detx
12 # ------------------------------------------------------------------------------------------
13 #Setting Singularity environment
14 shopt -s expand_aliases
15 if [ -z $SINGULARITY_PATH ] || [ -z $SINGULARITY_JPP_FILE ];
then
16 echo "Please export the environment variables SINGULARITY_PATH and SINGULARITY_JPP_FILE"
20 JPP_BIN_LIST=$(singularity exec $SINGULARITY_PATH/$SINGULARITY_JPP_FILE bash -
c 'export JPP_BIN_LIST=`ls -1 /Jpp/out/Linux/bin` && echo $JPP_BIN_LIST' | tail -n1)
23 alias
$i=
"singularity exec -B $HOME $SINGULARITY_PATH/$SINGULARITY_JPP_FILE $i"
25 #command line arguments
26 RUNTIME_S=$1 #
Run duration
in seconds
27 IP=$2 #IP address of the machine
28 DIR=$3 #location where the datafile
is written
31 #settings for data filter and data queue
45 #--------------------------------------------------------------
46 #check that detector file exists and that previous data file has been removed
47 #--------------------------------------------------------------
50 echo "$0: Found detector file $DETECTOR"
52 echo "ERROR: could not find detector file $DETECTOR."
56 if [ -
f $DIR/KM3NeT_00000001_00000000.root ] ;
then
57 echo "The file $DIR/KM3NeT_00000001_00000000.root already exists, please rename or remove it first, then restart this script"
62 JLigier-local.sh start
65 #--------------------------------------------------------------
66 #configure datafilter, data queue (magic)
67 #--------------------------------------------------------------
69 cat>ev_configure_dfilter_dqdf.txt<<EOF
81 cat>ev_configure_dqueue_dqdf.txt<<EOF
82 timeslice_duration=100;
85 dump_file_prefix=dump_;
86 dump_file_postfix=.dqd;
89 opto_recipients=127.0.0.1:5556;
90 acou_recipient=127.0.0.1:5800;
97 process DataQueue $DATAQUEUE
"DataQueue -u \$NAME\$ -H \$SERVER\$ -M \$LOGGER\$ -d $DEBUG -o -a </dev/null >&/dev/null &";
98 process
JDataWriter $DATAWRITER
"JDataWriter -u \$NAME\$ -H \$SERVER\$ -M \$LOGGER\$ -d $DEBUG </dev/null >&/dev/null &";
99 process
JDataFilter $DATAFILTER
"JDataFilter -u \$NAME\$ -P $PORT -H \$SERVER\$ -M \$LOGGER\$ -d $DEBUG </dev/null >&/dev/null &";
106 RC_DQUE %<ev_configure_dqueue_dqdf.txt>%
107 RC_DFLTR %<ev_configure_dfilter_dqdf.txt>%
123 JDAQDriver -
H $SERVER -M $LOGGER -
d $DEBUG -t $TIMEOUT_S -
f driver.txt -
c
EOF cat ev_configure_dqueue_dqdf txt<< EOFtimeslice_duration=100;run_start_time=0;max_dump_size=0;dump_file_prefix=dump_;dump_file_postfix=.dqd;opto_ports=56015;acou_ports=56016;opto_recipients=127.0.0.1:5556;acou_recipient=127.0.0.1:5800;EOFcat > driver txt<< EOFprocess DataQueue $DATAQUEUE"DataQueue -u \$NAME\$ -H \$SERVER\$ -M \$LOGGER\$ -d $DEBUG -o -a </dev/null >& dev null& process JDataWriter $DATAWRITER JDataWriter u $NAME H $SERVER M $LOGGER d $DEBUG</dev/null >& dev null& process JDataFilter $DATAFILTER JDataFilter u $NAME P $PORT H $SERVER M $LOGGER d $DEBUG</dev/null >& dev null& enter event ev_init
then usage $script[port]< option > nPossible restart fi case set_variable OPTION set_variable PORT
then usage $script[< detector identifier >< run range >]< QA/QCfile > nExample script to produce data quality plots nWhen a detector identifier and run range are data are downloaded from the database nand subsequently stored in the given QA QC file
then JLigier sh continue fi cat
o $QUALITY_ROOT d $DEBUG!CHECK_EXIT_CODE JPlot1D f
static const double H
Planck constant [eV s].
then echo Please export the environment variables SINGULARITY_PATH and SINGULARITY_JPP_FILE exit fi JPP_BIN_LIST
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable SERVER localhost define_variable LOGGER if do_usage *then usage $script[host[local file]] fi case set_variable LOGGER
then fatal Wrong number of arguments fi DIR
event< ev_daq > ev_configure
then rm i $OUTPUT_FILE fi let RUN
esac for TAG in RC_CMD RC_DOM RC_EVT RC_DWRT RC_DFLTR RC_DQUE
$WORKDIR driver txt done cat $WORKDIR driver txt<< EOFprocess ${DATAFILTER}$FILTER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&(JDataFilter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAFILTER}-P $PORT</dev/null > &/dev/null &))';process ${DATAWRITER}$WRITER_HOST csh-c '(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&(JDataWriter-H\$SERVER\$-M\$LOGGER\$-d $DEBUG-u ${DATAWRITER}</dev/null > &/dev/null &))';print enterevent ev_init{RC_CMD}event ev_reset{RC_CMD}event ev_init{RC_CMD}event ev_configure{RC_DFLTR%<$WORKDIR/ev_configure_datafilter.txt > RC_DQSIM<$WORKDIR/ev_configure_dqsimulator.txt > RC_DWRT path
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
then set_variable MODULE getModule a $DETECTOR L $STRING $FLOOR JEditDetector a $DETECTOR M $MODULE add $X o $DETECTOR else echo No update of detector $DETECTOR
then error Missing CDF files error Run
static const JNET::JTag RC_CMD
do set_variable DETECTOR_TXT $WORKDIR detector
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
#define DEBUG(A)
Message macros.