7 # ------------------------------------------------------------------------------------------
9 # Example script to run JDataFilter and JDataWriter using JDOMSimulator(s)
11 # ------------------------------------------------------------------------------------------
14 if [ -z $JPP_DIR ];
then
15 echo "Variable JPP_DIR undefined."
19 source $JPP_DIR/setenv.sh $JPP_DIR
32 set_array SOURCE_HOST $IP_ADDRESS $IP_ADDRESS $IP_ADDRESS
43 usage "$script [working directory]"
49 *) fatal
"Wrong number of arguments."
74 killall JDOMSimulator >& /dev/
null
82 debug "IP address $IP_ADDRESS"
96 JLigier-local.sh
continue
109 echo "Detector $DETECTOR aleady exists; remove to overwrite."
115 -@
"detectorType = $detectorType" \
116 -@
"numberOfLines = $numberOfLines" \
117 -@
"numberOfFloors = $numberOfFloors" \
118 -@
"floorDistance_m = $floorDistance_m" \
119 -@
"lineDistance_m = $lineDistance_m" \
120 -z $heightOfFirstFloor_m \
127 JRandomTimesliceWriter \
130 -B
"$SINGLESRATE_HZ $DOUBLESRATE_HZ" \
131 -
n $NUMBER_OF_SLICES \
137 set_variable NUMBER_OF_FRAMES `JPrintDetector -
a $DETECTOR -O modules |
awk '/Module/ {if ($4 != 0) {print $0}}' | wc -l`
140 # JDataFilter configure data
157 # JDOMSimulator configure data.
160 numberOfFrames = ${NUMBER_OF_FRAMES};
163 target = 0 ${FILTER_HOST}:${
PORT};
169 for (( i = 1;
$i <= $NUMBER_OF_DOM_SIMULATORS ; ++i ));
do
171 let
"index = ${#SOURCE_HOST} - $i % ${#SOURCE_HOST}"
173 echo "source = 0 $DOM_SIMULATOR/$i;" >>
$WORKDIR/ev_configure_domsimulator.txt
175 echo "process $DOM_SIMULATOR/$i $SOURCE_HOST[$index] \
176 csh -c '(setenv ROOTSYS $ROOTSYS && source $JPP_DIR/setenv.csh $JPP_DIR && ($DOM_SIMULATOR \
181 </dev/null >&/dev/null &))';" >>
$WORKDIR/driver.txt
186 process ${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 &))';
187 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 &))';
198 RC_DFLTR %<
$WORKDIR/ev_configure_datafilter.txt>%
199 RC_DOM %<
$WORKDIR/ev_configure_domsimulator.txt>%
234 if [[ -
n "$PID" ]]
then
235 error
"$PROCESS still running (${PID})."
243 echo -
n "clean [Y/N]? "
246 if [[ $ANSWER ==
"Y" || $ANSWER ==
"y" ]];
then
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
remove to overwrite exit fi JDetector D $ID detectorType
then usage $script[port]< option > nPossible restart fi case set_variable OPTION set_variable PORT
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
then JLigier sh continue fi cat
o $QUALITY_ROOT d $DEBUG!JPlot1D f
static const double H
Planck constant [eV s].
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
do set_variable PID ps h o p C $PROCESS debug Check $PROCESS(${PID})." if [[ -n "$PID" ]] then error "$PROCESS still running($
static const double C
Physics constants.
do JPrintDAQHeader f $INPUT_FILE d read DETECTOR_ID RUN FRAME_INDEX TIMESLICE_START set_variable OUTPUT_FILE $WORKDIR KM3NeT_
event< ev_daq > ev_configure
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
do set_variable STRING_TXT awk
case $OPTION in clean clean
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR if do_usage *then usage $script[(input file)+] fi set_variable DEBUG set_variable WORKDIR TMPDIR
then rm i $OUTPUT_FILE fi let RUN
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DEBUG set_variable WORKDIR
$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_DOM<$WORKDIR/ev_configure_domsimulator.txt > RC_DWRT path
then JFileTuna f $INPUT_FILE
&set_variable OUTPUT_FILE
then usage $script[detector file[output file[PMT parameters file[number of slices]]]] nAuxiliary script to produce random time slice data fi case set_variable NUMBER_OF_SLICES
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
rm i $OUTPUT_FILE fi set_variable DOM_SIMULATOR JDOMSimulator set_variable NUMBER_OF_DOM_SIMULATORS
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
static const JNET::JTag RC_CMD
$WORKDIR ev_configure_domsimulator txt echo process $DOM_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DOM_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
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
do echo Generating $dir eval D
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
#define DEBUG(A)
Message macros.