Jpp - the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sound-V:fit.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 BACKGROUND ${ACOUSTICS_BACKGROUND:+-B}
14 set_variable FORMULA "[0] + [1]*(sqrt(1.0 + 0.5*(x-[2])*(x-[2])/([3]*[3])) - 1.0)"
15 
16 if ( do_usage $* ); then
17  usage "$script"
18 fi
19 
20 if (( $# != 0 )); then
21  fatal "Wrong number of arguments."
22 fi
23 
24 set_variable VELOCITY_TXT $WORKDIR/soundv.txt
25 set_variable VELOCITY_ROOT $WORKDIR/soundv.root
26 
27 if [[ ! -f $VELOCITY_TXT ]]; then
28  fatal "No sound velocity file $VELOCITY_TXT."
29 fi
30 
31 JGraph \
32  -f $VELOCITY_TXT \
34 
35 sort -gr -k 2,2 $VELOCITY_TXT | tail -1 | read X Y RMS
36 
37 JFit \
38  -f ${VELOCITY_ROOT}:\.\* \
39  -o $WORKDIR/fit.root \
40  -F "$FORMULA" \
41  -@"p0 = $Y" \
42  -@"p1 = 1.0" \
43  -@"p2 = $X" \
44  -@"p3 = 1.0" \
45  -d $DEBUG
46 
47 set_array P2 `JPrintFit -f $WORKDIR/fit.root:\.\* -@p2`
48 
49 printf "result %10.5f +/- %10.5f\n" $P2[1] $P2[2]
50 
51 mv $WORKDIR/fit.root $VELOCITY_ROOT
52 
53 JPlot1D \
54  -f $VELOCITY_ROOT:\.\* \
55  -\> "V [m/s]" \
56  -\^ "#chi^{2}/NDF" \
57  -T "" \
58  -o $WORKDIR/velocity.gif $BACKGROUND
59 
60 rm -f $VELOCITY_ROOT
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
then cat $WORKDIR tripod txt<< EOF 12 587888 4017079-3450.0 14 587436 4016992-3450.0 16 587843 4016727-3450.0EOF fi if[[!-f $WORKDIR/base.txt]];then $DIR/JBaseModuleWriter-a $WORKDIR/detector.detx-o $WORKDIR/base.txt fi if[[!-f $WORKDIR/toashort.root]];then JConvertDB-q toashort-@"detid = `getDetector -D $DETECTOR`"-@"minrun = $RUN"-@"maxrun = $RUN"-o $WORKDIR/toashort.root-d $DEBUG--!fi if(!reuse_file $VELOCITY_TXT);then for A in 1500.0 1510.0 1520.0 1530.0 1532.0 1534.0 1536.0 1538.0 1540.0 1542.0 1544.0 1546.0 1548.0 1550.0 1560.0 1570.0 1580.0;do rm-f event.root JAcousticsEventBuilder-a $WORKDIR/detector.detx-f $WORKDIR/toashort.root-@"Q = $QUANTILE;"-@"TMax_s = $TMAX_S;"-@"numberOfHits = $NUMBER_OF_HITS;"-T $WORKDIR/tripod.txt-B $WORKDIR/base.txt-o $WORKDIR/event.root-V"$A"-d $DEBUG--!RMS=`$DIR/JPrintRMS-f $WORKDIR/event.root-N 1-d0`let RMS="$RMS*1000"echo"$A $RMS" > $VELOCITY_TXT done fi JGraph f $VELOCITY_TXT o $VELOCITY_ROOT JPlot1D f $VELOCITY_ROOT
bool read(Vec &v, std::istream &is)
Read a Vec(tor) from a stream.
Definition: io_ascii.hh:141
then fatal No sound hydrophone file $HYDROPHONE_TXT fi JGraph f $HYDROPHONE_TXT o $HYDROPHONE_ROOT sort gr k
exit
Definition: JPizza.sh:36
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
then JPizza f
Definition: JPizza.sh:46
then echo
do set_variable OUTPUT_DIRECTORY $WORKDIR T
then break fi done getCenter read X Y Z let X
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
then awk F
* usage
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
p2
Definition: module-Z:fit.sh:72
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:45
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
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62