Jpp  19.1.0
the software that should make you happy
JAcousticsDisable.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 script=${0##*/}
3 
4 if [ -z $JPP_DIR ]; then
5  echo "Variable JPP_DIR undefined."
6  exit
7 fi
8 
9 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
10 
11 set_variable: DEBUG ACOUSTICS_DEBUG 2
12 set_variable: WORKDIR ACOUSTICS_WORKDIR .
13 set_variable: NMIN ACOUSTICS_NMIN 150
14 set_variable: TMAX_US ACOUSTICS_TMAX_US 300
15 set_variable: QUANTILES ACOUSTICS_QUANTILES 0.01 0.99
16 
17 if do_usage $*; then
18  usage "$script <detector file> (input file)+ <disable file>"\
19  "\nAuxiliary script for disabling transmissions."\
20  "\nInput files correspond to the output of JAcousticsEventBuilder[.sh]."
21 fi
22 
23 if (( $# < 3 )); then
24  fatal "Wrong number of arguments."
25 fi
26 
27 set_variable DETECTOR $argv[1]
28 set_array INPUT_FILES $argv[2,-2]
29 set_variable DISABLE $argv[-1]
30 
31 eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
32 
33 JAcoustics.sh $DETECTOR_ID
34 
35 CHECK_EXIT_CODE
36 
37 mv acoustics_fit_parameters.txt .acoustics_fit_parameters.txt
38 
39 cat>acoustics_fit_parameters.txt<<EOF
40 Nmin = 3;
41 Tmax_s = 600.0;
42 chi2perNDF = 100.0;
43 mestimator = 0;
44 option = 2;
45 sigma_s = 50.0e-6;
46 stdev = 10.0;
47 EOF
48 
49 set_variable DIR `mktemp -d $WORKDIR/XXXXXX`
50 
51 JKatoomba.sh $DETECTOR $INPUT_FILES[*] $DIR/katoomba.root
52 JCanberra.sh $DETECTOR $DIR/katoomba.root $DIR/canberra\[%\].root
53 
54 mv .acoustics_fit_parameters.txt acoustics_fit_parameters.txt
55 
56 echo "\n"
57 
58 JAcousticsDisable \
59  -f $DIR/canberra\*.root \
60  -o /dev/null \
61  -N $NMIN \
62  -T $TMAX_US \
63  -Q "$QUANTILES" \
64  -! $DISABLE \
65  -d $DEBUG --!
66 
67 JEditDisable \
68  -f $DISABLE \
69  -o $DISABLE \
70  -a $DETECTOR \
71  -q \
72  -d $DEBUG --!
73 
74 rm -rf $DIR