Jpp 20.0.0-72-g597b30bc9
the software that should make you happy
Loading...
Searching...
No Matches
JRandomTimesliceWriterRunByRun.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3# \author mdejong
4#
5script=${0##*/}
6
7# ------------------------------------------------------------------------------------------
8#
9# Example script to run JRandomTimesliceWriter.
10#
11# ------------------------------------------------------------------------------------------
12
13if [ -z $JPP_DIR ]; then
14 echo "Variable JPP_DIR undefined."
15 exit
16fi
17
18source $JPP_DIR/setenv.sh $JPP_DIR
19
20set_variable: DEBUG TIMESLICE_DEBUG 1
21set_variable: WORKDIR TIMESLICE_WORKDIR ./
22set_variable: BACKGROUND_HZ TIMESLICE_BACKGROUND_HZ `getK40Rates`
23set_variable: MIXED_BACKGROUND_HZ TIMESLICE_MIXED_BACKGROUND_HZ 8.0 6.0
24set_variable: SEED TIMESLICE_SEED 0
25set_variable: NUMBER_OF_SLICES TIMESLICE_SLICES 10
26set_variable: RECYCLING TIMESLICE_RECYCLING "0 0"
27set_variable: FACTOR TIMESLICE_FACTOR 1.0
28set_variable: SAMPLER TIMESLICE_SAMPLER "1 1000"
29
30if do_usage $*; then
31 usage "$script <detector file> <output file> <DAQ file> <PMT parameters file>"\
32 "\nAuxiliary script to produce random time slice data."
33fi
34
35if (( $# == 4 )); then
36 set_variable DETECTOR $1
37 set_variable OUTPUT_FILE $2
38 set_variable DAQ_FILE $3
39 set_variable PMT_FILE $4
40else
41 fatal "Wrong number of arguments."
42fi
43
44eval `JPrintDetector -a $DETECTOR -O GEOMETRY`
45
46if (( $MINIMAL_DISTANCE_M > 15.0 )); then
47 MIXED_BACKGROUND_HZ="0.0 0.0"
48fi
49
50JPrintTree -f $DAQ_FILE -@ "type = JDAQSummaryslice" -k number_of_entries | read N
51
52set_variable RUNBYRUN "file=$DAQ_FILE; sampler=${SAMPLER%% *} $(($N / 2))"
53
54JRandomTimesliceWriter \
55 -a ${DETECTOR} \
56 -o ${OUTPUT_FILE} \
57 -n ${NUMBER_OF_SLICES} \
58 -P ${PMT_FILE} \
59 -P "QE=${FACTOR}" \
60 -S ${SEED} \
61 -B "$BACKGROUND_HZ" \
62 -X "$MIXED_BACKGROUND_HZ" \
63 -N "$RECYCLING" \
64 -r "${RUNBYRUN}" \
65 -d ${DEBUG} \
66 --!