#!/bin/bash MAXINDEX="--max-index -1" TRANSPORT="--transport zeromq" VERBOSE="--verbose INFO" FAIRTASKNAME="--task-name PndMvdPixelClusterTask" while [[ $# > 1 ]] do key="$1" case $key in -f|--task-name) FAIRTASKNAME="--task-name $2" shift ;; -m|--max-index) MAXINDEX="--max-index $2" shift ;; -t|--transport) TRANSPORT="--transport $2" shift ;; -v|--verbose) VERBOSE="--verbose $2" shift ;; esac shift done ########################### Define some variables # JSON file containing the configuration parameters of all FairMQ devices of this example MQCONFIGFILE="@MVDMQ_FILE_LOCATION@/mvd/MvdMQ/run/options/PixelClusterTask.json" # ASCII and ROOT parameter files for the processor device ROOTPARAM="@MVDMQ_FILE_LOCATION@/macro/run/simparams.root" ASCIIPARAM="@MVDMQ_FILE_LOCATION@/macro/params/all.par" #if [ "$FAIRTASKNAME" == "--task-name PixelFindHits" ] ; then # # input file and branch for the sampler device # INPUTFILE="@EXAMPLE9_FILE_LOCATION@/examples/MQ/9-PixelDetector/macros/pixel_TGeant3.digi.root" # # INPUTFILE+=" --file-name @EXAMPLE9_FILE_LOCATION@/examples/MQ/9-PixelDetector/macros/pixel_TGeant3.digi.f1.root" # INPUTBRANCH="PixelDigis" # # output file for sink # OUTPUTFILE="@EXAMPLE9_FILE_LOCATION@/examples/MQ/9-PixelDetector/macros/MQ.pixel_TGeant3.hit.root" # OUTPUTCLASS="--class-name TClonesArray(PixelHit)" # OUTPUTBRANCH="--branch-name PixelHits" #elif [ "$FAIRTASKNAME" == "--task-name PixelFindTracks" ] ; then # # input file and branch for the sampler device # INPUTFILE="@EXAMPLE9_FILE_LOCATION@/examples/MQ/9-PixelDetector/macros/MQ.pixel_TGeant3.hit.root" # INPUTBRANCH="PixelHits" # # output file for sink # OUTPUTFILE="@EXAMPLE9_FILE_LOCATION@/examples/MQ/9-PixelDetector/macros/MQ.pixel_TGeant3.track.root" # OUTPUTCLASS="--class-name TClonesArray(PixelTrack)" # OUTPUTBRANCH="--branch-name PixelTracks" #else # echo "TASK $FAIRTASKNAME UNKNOWN!!!" # exit #fi ########################### ########################### Start the chain of the devices ########################## start Parameter server SERVER="Users/Stockmanns/PandaSoftware/FairRoot_install/bin/parmq-server $TRANSPORT" SERVER+=" --id parmq-server --config-json-file $MQCONFIGFILE" SERVER+=" --first-input-name $ROOTPARAM --second-input-name $ASCIIPARAM --second-input-type ASCII" xterm -geometry 80x25+0+350 -hold -e @EXAMPLE9_BIN_LOCATION@/$SERVER & ########################## start SAMPLER SAMPLER="PndMQFileSampler $TRANSPORT" SAMPLER+=" --id sampler1 --config-json-file $MQCONFIGFILE" SAMPLER+=" --file-name $INPUTFILE --branch-name $INPUTBRANCH $MAXINDEX" xterm -geometry 80x25+0+0 -hold -e @EXAMPLE9_BIN_LOCATION@/$SAMPLER & ########################## start PROCESSORs #PROCESSOR1="FairMQEx9TaskProcessor $TRANSPORT" #PROCESSOR1+=" $VERBOSE" #PROCESSOR1+=" --id processor1 $FAIRTASKNAME --config-json-file $MQCONFIGFILE" ##xterm +aw -geometry 100x27+800+0 -hold -e @EXAMPLE9_BIN_LOCATION@/$PROCESSOR1 & #xterm -geometry 80x25+500+0 -hold -e @EXAMPLE9_BIN_LOCATION@/$PROCESSOR1 & #PROCESSOR2="FairMQEx9TaskProcessor $TRANSPORT" #PROCESSOR2+=" $VERBOSE" #PROCESSOR2+=" --id processor2 $FAIRTASKNAME --config-json-file $MQCONFIGFILE" #xterm -geometry 80x25+500+350 -hold -e @EXAMPLE9_BIN_LOCATION@/$PROCESSOR2 & #PROCESSOR3="FairMQEx9TaskProcessor $TRANSPORT" #PROCESSOR3+=" $VERBOSE" #PROCESSOR3+=" --id processor3 $FAIRTASKNAME --config-json-file $MQCONFIGFILE" #xterm -geometry 80x25+500+700 -hold -e @EXAMPLE9_BIN_LOCATION@/$PROCESSOR3 & #PROCESSOR4="FairMQEx9TaskProcessor $TRANSPORT" #PROCESSOR4+=" $VERBOSE" #PROCESSOR4+=" --id processor4 $FAIRTASKNAME --config-json-file $MQCONFIGFILE" #xterm -geometry 80x25+1000+0 -hold -e @EXAMPLE9_BIN_LOCATION@/$PROCESSOR4 & #PROCESSOR5="FairMQEx9TaskProcessor $TRANSPORT" #PROCESSOR5+=" $VERBOSE" #PROCESSOR5+=" --id processor5 $FAIRTASKNAME --config-json-file $MQCONFIGFILE" #xterm -geometry 80x25+1000+350 -hold -e @EXAMPLE9_BIN_LOCATION@/$PROCESSOR5 & ########################## start FILESINK #FILESINK="FairMQEx9FileSink $TRANSPORT" #FILESINK+=" --id sink1 --config-json-file $MQCONFIGFILE" #FILESINK+=" --file-name $OUTPUTFILE $OUTPUTCLASS $OUTPUTBRANCH" #xterm +aw -geometry 80x25+0+700 -hold -e @EXAMPLE9_BIN_LOCATION@/$FILESINK &