Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sound-V:run.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 
12 set_variable WORKDIR ${ACOUSTICS_WORKDIR:-./}
13 set_variable FIT ${ACOUSTICS_FIT:-2}
14 
15 if ( do_usage $* ); then
16  usage "$script <detector file> (input file)+"
17 fi
18 
19 if (( $# < 2 )); then
20  fatal "Wrong number of arguments."
21 fi
22 
24 set_array INPUT_FILES $argv[2,-1]
25 
26 eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
27 
28 source JAcoustics.sh $DETECTOR_ID
29 
30 print_velocity | xargs | read A B Z0
31 
32 set_variable VELOCITY_TXT $WORKDIR/soundv.txt
33 
34 for (( VELOCITY = 1530.0; $VELOCITY <= 1545; VELOCITY += 0.2 )); do
35 
36  rm -f $WORKDIR/katoomba.root
37 
38  eval JKatoomba \
39  -a $DETECTOR \
40  -f \"$INPUT_FILES[*]\" \
41  -o $WORKDIR/katoomba.root \
42  -T `print_tripods` \
43  -V \"$VELOCITY $B $Z0\" \
44  -@ `make_equation PARAMETERS` \
45  -@ \"stdev = 50\" \
46  -@ \"mestimator = 1\" \
47  -F $FIT \
48  -u \
49  -d $DEBUG --!
50 
51  set_variable CHI2 `JPrintResult -f $WORKDIR/katoomba.root:chi2 -F "GetMean"`
52  set_variable RMS `JPrintResult -f $WORKDIR/katoomba.root:chi2 -F "GetRMS / sqrt(GetEntries)"`
53 
54  printf "%12.5f %7.3f %7.3f\n" $VELOCITY $CHI2 $RMS >> $VELOCITY_TXT
55 
56 done
set_variable DETECTOR
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
bool read(Vec &v, std::istream &is)
Read a Vec(tor) from a stream.
Definition: io_ascii.hh:141
exit
Definition: JPizza.sh:36
do set_array DAQHEADER JPrintDAQHeader f
Definition: JTuneHV.sh:74
*fatal Invalid argument *esac fi function print_velocity()
Definition: JAcoustics.sh:81
VELOCITY
Definition: JAcoustics.sh:60
then echo
* usage
then fatal Not enough arguments fi set_variable DETECTOR $argv[1] INPUT_FILES
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable ACOUSTICS_DEBUG
Definition: JAcoustics.sh:17
*set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2,-2] set_variable OUTPUT_FILE $argv[-1]
Definition: JDomino.sh:39
then JCalibrateToT a
Definition: JTuneHV.sh:103
then display $WORKDIR
Definition: plot-Domino.sh:127
script
Definition: JAcoustics.sh:2
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 $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62