Jpp  master_rocky-43-ge265d140c
the software that should make you happy
JEnergyCorrection.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 plot energy correction.
11 #
12 # ------------------------------------------------------------------------------------------
13 
14 if [ -z $JPP_DIR ]; then
15  echo "Variable JPP_DIR undefined."
16  exit
17 fi
18 
19 source $JPP_DIR/setenv.sh $JPP_DIR
20 
21 if do_usage $*; then
22  usage "$script [(input file)+]"
23 fi
24 
25 set_variable DEBUG 3
26 set_variable WORKDIR ${TMPDIR:-/tmp}/
27 set_variable DIR $JPP_DIR/examples/JReconstruction
28 set_variable: FORMAT GRAPHICS_FORMAT gif
29 set_variable+ BATCH GRAPHICS_BATCH -B
30 
31 if (( $# == 0 )); then
32  set_array INPUT_FILES `ls ${JPP_LIB}/energy_correction*.txt`
33 else
34  set_array INPUT_FILES $argv[1,-1]
35 fi
36 
37 $DIR/JEnergyCorrection \
38  -E${^INPUT_FILES} \
39  -o $WORKDIR/f1.root \
40  -d $DEBUG --!
41 
42 JPlot1D \
43  -f $WORKDIR/f1.root:\.\* \
44  -y "1e-3 5e1" -Y \
45  -XX \
46  -> "E [GeV]" \
47  -\^ "correction" \
48  -T "" -L BR \
49  -o $WORKDIR/energy-correction.$FORMAT $BATCH