Jpp  16.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
acoustics-Zmul.sh File Reference

Go to the source code of this file.

Functions

then usage $script< detector
specific acoustics-fit script >
< option > nAuxiliary script
to make scan of pre stretching
of detector 
strings (see JEditDetector)." "\nPossible options
 

Variables

 script
 
then echo Variable JPP_DIR
undefined exit fi source
$JPP_DIR setenv sh $JPP_DIR
&dev null 
set_variable
 

Function Documentation

then usage $script<detector specific acoustics-fit script><option> nAuxiliary script to make scan of pre stretching of detector strings ( see  JEditDetector)

Definition at line 20 of file acoustics-Zmul.sh.

21  : run, plot or fit."
22 fi
23 
24 if (( $# < 1 || $# > 2)); then
25  fatal "Wrong number of arguments."
26 fi
27 
28 # global variables
29 
30 set_variable SCRIPT $argv[1]
31 set_variable OPTION $argv[-1]
32 
33 if [[ $OPTION != "run" && $OPTION != "plot" && $OPTION != "fit" ]]; then
34  fatal "Invalid option $OPTION."
35 fi
36 
37 if [[ $OPTION == "run" ]]; then
38 
39  for MUL in $MULS[*]; do
40 
41  set_variable DIR $WORKDIR/mul=$MUL
42 
43  mkdir -p $DIR
44  cd $DIR
45 
46  # set varibales in script
47 
48  set_variable ACOUSTICS_MUL $MUL
49  set_variable ACOUSTICS_STAGES A
50 
51  nohup $SCRIPT >& all.log &
52  done
53 fi
54 
55 if [[ $OPTION == "plot" || $OPTION == "fit" ]]; then
56 
57  set_variable ACOUSTICS_ZMUL_TXT ${TMPDIR:-/tmp}/acoustics-zmul.txt
58  set_variable ACOUSTICS_ZMUL_ROOT ${TMPDIR:-/tmp}/acoustics-zmul.root
59 
60  rm -f $ACOUSTICS_ZMUL_TXT >& /dev/null
61 
62  for MUL in $MULS[*]; do
63 
64  set_variable DIR $WORKDIR/mul=$MUL
65  set_variable FILE `ls $DIR/stage-(1|A).log`
66 
67  tail -1 $FILE | grep "Elapsed time" >& /dev/null
68 
69  if (( $? == 0 )); then
70 
71  set_array RESULT `grep -v "warning" $FILE | tail -2 | head -1`
72 
73  printf "%4.1e %6.3f\n" $MUL $RESULT[-1] >> $ACOUSTICS_ZMUL_TXT
74  fi
75  done
76 
77  JGraph \
78  -f $ACOUSTICS_ZMUL_TXT \
79  -o $ACOUSTICS_ZMUL_ROOT
80 
81  XMIN=`sort -k1g $ACOUSTICS_ZMUL_TXT | head -1 | awk '{ print $1 }'`
82  XMAX=`sort -k1g $ACOUSTICS_ZMUL_TXT | tail -1 | awk '{ print $1 }'`
83 
84  let XMIN="$XMIN - 1.0e-3"
85  let XMAX="$XMAX + 1.0e-3"
86 
87  if [[ $OPTION == "fit" ]]; then
88 
89  sort -gr -k2gr $ACOUSTICS_ZMUL_TXT | tail -1 | read X Y
90 
91  JFit \
92  -f ${ACOUSTICS_ZMUL_ROOT}:\.\* \
93  -o ${TMPDIR:-/tmp}/fit.root \
94  -F "$FORMULA" \
95  -@ "p0 = $Y" \
96  -@ "p1 = 0.1" \
97  -@ "p2 = $X" \
98  -@ "p3 = 0.002" \
99  -d $DEBUG
100 
101  set_array P2 `JPrintFit -f ${TMPDIR:-/tmp}/fit.root:\.\* -@p2`
102 
103  printf "Optimal stretching factor %8.2e\n" $P2[1]
104 
105  mv ${TMPDIR:-/tmp}/fit.root $ACOUSTICS_ZMUL_ROOT
106 
107  fi
108 
109  JPlot1D \
110  -f $ACOUSTICS_ZMUL_ROOT:\.\* \
111  -x "$XMIN $XMAX" \
112  -> "M" \
113  -\^ "#chi^{2}/NDF" \
TPaveText * p1
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
*fatal Wrong number of arguments
*fatal Wrong number of arguments esac set_variable Elapsed
then printf warning
*fatal Wrong option $OPTION
p3
Definition: module-Z:fit.sh:74

Variable Documentation

script
Initial value:
=${0##*/}
if [ -z $JPP_DIR ]

Definition at line 2 of file acoustics-Zmul.sh.

then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR& dev null set_variable

Definition at line 18 of file acoustics-Zmul.sh.