Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JMultiplicityK40.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author mdejong
4 #
5 version=1.0
6 script=${0##*/}
7 
8 # ------------------------------------------------------------------------------------------
9 #
10 # Utility script to make coincidence rate plots.
11 #
12 # ------------------------------------------------------------------------------------------
13 
14 
15 if [ -z $JPP_DIR ]; then
16  echo "Variable JPP_DIR undefined."
17  exit
18 fi
19 
20 
21 source $JPP_DIR/setenv.sh $JPP_DIR
22 
23 
24 set_variable DIR $JPP_DIR/examples/JPhysics/
27 
28 if ( do_usage $* ); then
29  usage "$script [working directory]"
30 fi
31 
32 case $# in
33  1) WORKDIR=$1;;
34 esac
35 
36 if [[ ! -f $WORKDIR/k40\[KM3NeT\].root ]]; then
37 
38  $DIR/JMultiplicityK40 \
39  -n 100000000 \
40  -F 4 \
41  -G 2 \
42  -D "0.216 5" \
43  -A 1 \
44  -U \
45  -o $WORKDIR/k40\[KM3NeT\].root
46 fi
47 
48 for (( a = 0.0; $a <= 1.0; a += 0.5 )); do
49 
50  set_variable LABEL `printf '%3.1f' $a`
51 
52  if [[ ! -f $WORKDIR/k40\[${LABEL}\].root ]]; then
53 
54  $DIR/JMultiplicityK40 \
55  -n 100000000 \
56  -F 4 \
57  -G 2 \
58  -D "0.216 5" \
59  -A 3 -a $a \
60  -U \
61  -o $WORKDIR/k40\[${LABEL}\].root
62  fi
63 done
64 
65 INPUT_FILES=(`ls $WORKDIR/k40\[*\].root`)
66 
68 
69 HISTOGRAMS=(`echo ${INPUT_FILES} | eval sed 's/\.root/\.root:pmt/g'`)
70 
71 JPlot1D \
72  -f "$HISTOGRAMS[*]" \
73  -\> "cos(#theta)" \
74  -\^ "acceptance" \
75  -y "0 1.6" \
76  -L TR \
77  -T "PMT" \
78  -o pmt.gif
79 
80 M=2
81 
82 HISTOGRAMS=(`echo ${INPUT_FILES} | eval sed 's/\.root/\.root:M\\.${M}/g'`)
83 
84 JPlot1D \
85  -f "$HISTOGRAMS[*]" \
86  -\> "D [m]" \
87  -\^ "rate [Hz]" \
88  -x "0 5" \
89  -y "1 1e2" -Y \
90  -T "M = ${M}" \
91  -o k40.gif
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
then check_input_file $DETECTOR $INPUT_FILE for OPTION in A B C D E F
Definition: JFilter.sh:47
then usage for INPUT_FILE in $INPUT_FILES[*]
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
exit
Definition: JPizza.sh:36
do echo Generating $dir eval DIR
Definition: JPlotNPE1D.sh:52
fi JEventTimesliceWriter a
esac $JPP_DIR examples JDetector JTransitTime o $OUTPUT_FILE n N $NPE T $TTS_NS d $DEBUG for HISTOGRAM in tts tt2 pmt
Definition: JTransitTime.sh:36
then JPizza f
Definition: JPizza.sh:46
then echo
do montage tile geometry tmp
do set_variable OUTPUT_DIRECTORY $WORKDIR T
* usage
then fatal Not enough arguments fi set_variable DETECTOR $argv[1] INPUT_FILES
then HISTOGRAMS
Definition: plot-Domino.sh:39
then for DETECTOR in Antares KM3NeT
Definition: JMultiPMT.sh:42
alias put_queue eval echo n
Definition: qlib.csh:19
then display $WORKDIR
Definition: plot-Domino.sh:142
version
Definition: JCalibratePMT.sh:7
then usage $script< detector file >< inputfile > fi case set_variable WORKDIR
Definition: JLegolas.sh:28
source $JPP_DIR setenv csh $JPP_DIR eval JShellParser o a A
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62