8 # ------------------------------------------------------------------------------------------
10 # Script to jointly run JRandomTimesliceWriter and JTriggerProcessor in run-by-run mode.
12 # ------------------------------------------------------------------------------------------
14 if [ -z $JPP_DIR ];
then
15 echo "Variable JPP_DIR undefined."
19 # set environment for Jpp
20 source $JPP_DIR/setenv.sh $JPP_DIR
34 set_variable FACTOR ${RANDOMEVENT_FACTOR:-${FACTOR:-1.0}}
38 if ( do_usage $* );
then
39 usage "$script [daq file [detector file [pipe [output file [trigger file [PMT parameters file]]]]]]"
53 check_input_file
$DETECTOR $TRIGGER $PMT_FILE
54 check_output_file $OUTPUT_FILE
56 #################################################################################################
58 # The sampler values correspond to N_on N_off, respectively (note that sampler calls JSampler),
60 # N_on = number of time slices to read;
61 # N_off = number of time slices to skip.
63 # The sampler option works as follows.
65 # read -on average- N_on consecutive time slices and
66 # skip -on average- N_off time slices
67 # modulo the number of time slices in the file.
69 # The larger N_on, the faster the reading, because this reduces the random accesses
70 # of the data taking file to pick up a next time slice.
71 # The smaller N_off, the less time slices are skipped.
72 # So, N_on = 0 guarantees that all time slices are sampled.
73 # Note that if the number of time slices to be produced is small, then too small a value of N_off
74 # could create a bias because only the first time slices of the data taking file are then sampled.
75 #################################################################################################
77 RUNBYRUN=
"file=$DAQ_FILE; sampler=1 1000; range_Hz=1e3 1e5"
82 if [[ -p $PIPE ]];
then
86 JRandomTimesliceWriter \
89 -
n ${NUMBER_OF_SLICES} \
118 fatal
"Error opening $PIPE."
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
&set_variable JDAQ_TIMESLICE
static const double C
Physics constants.
then timer_start(JRandomTimesliceWriter-a ${DETECTOR}-o ${PIPE}-n ${NUMBER_OF_SLICES}-P ${PMT_FILE}-d ${DEBUG}-S ${SEED}-B"$BACKGROUND_HZ"-N"$RECYCLING"--!&&for((i=0;$i!=10;++i));do;echo 'EOF' > $PIPE;usleep 100000;done &&rm-f $PIPE)&JTimesliceReprocessor-a $
esac print_variable DETECTOR TRIGGER OUTPUT_FILE BACKGROUND_HZ PMT_FILE check_input_file $DETECTOR $TRIGGER $PMT_FILE check_output_file $OUTPUT_FILE RUNBYRUN
&set_variable DETECTOR_FILE set_variable DAQ_FILE
do set_variable SIGMA_NS set_variable OUTLIERS set_variable OUTPUT_FILE matrix[${ALPHA_DEG}\deg\] root $JPP JMatrixNZ a $DETECTOR f $INPUT_FILE o $OUTPUT_FILE S
&set_variable OUTPUT_FILE
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
alias put_queue eval echo n
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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR set_variable DEBUG set_variable WORKDIR set_variable PIPE $WORKDIR pipe dat set_variable OUTPUT_FILE $WORKDIR timeslice root set_variable DETECTOR $JPP_DATA km3net_reference detx set_variable TRIGGER $JPP_DATA trigger_parameters_arca txt set_variable PMT_FILE $JPP_DATA PMT_parameters txt set_variable BACKGROUND_HZ
then usage $script[input file[working directory[option]]] nWhere option can be N
then usage $script< detector file >< inputfile > fi case set_variable WORKDIR
#define DEBUG(A)
Message macros.