Jpp  15.0.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hydrophone-t0: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 
11 zmodload zsh/mathfunc
12 
13 set_variable: DEBUG ACOUSTICS_DEBUG 2
14 set_variable: WORKDIR ACOUSTICS_WORKDIR ./
15 set_variable: XMIN HYDROPHONE_XMIN -1.0e-3
16 set_variable: XMAX HYDROPHONE_XMAX +1.0e-3
17 set_variable: FORMAT GRAPHICS_FORMAT gif
18 set_variable+ BATCH GRAPHICS_BATCH -B
19 
20 if do_usage $*; then
21  usage "$script <detector file> <string identifier> [<detector file>]"
22 fi
23 
24 if (( $# == 0 || $# > 3 )); then
25  fatal "Wrong number of arguments."
26 fi
27 
30 set_array QUANTILES 0.333 0.666
31 set_variable FORMULA "[0] * exp(-0.5 * (x-[1])*(x-[1]) / ([2]*[2]))"
32 set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"`
33 
34 typeset -Z 4 STRING
35 
36 JOpera1D \
37  -f hydrophone.root:$MODULE \
38  -o /tmp/H\[${STRING}\].root \
39  -u Add -d 0
40 
41 JPrintQuantiles \
42  -f /tmp/H\[${STRING}\].root:Add \
43  -Q "$QUANTILES[*]" \
44  -d 0 | read -A RESULT
45 
46 P1=$((0.5*($RESULT[-1] + $RESULT[1]))) # average
47 P2=$((1.5*($RESULT[-1] - $RESULT[1]))) # width
48 
49 JFit \
50  -f /tmp/H\[${STRING}\].root:Add \
51  -o /tmp/F\[${STRING}\].root \
52  -F "$FORMULA" \
53  -@"p0 = GetMaximum * 0.8" \
54  -@"p1 = $P1" \
55  -@"p2 = $P2" \
56  -d $DEBUG
57 
58 JPrintFit -f /tmp/F\[${STRING}\].root:Add -@p1 | read -A P1
59 JPrintFit -f /tmp/F\[${STRING}\].root:Add -@p2 | read -A P2
60 
61 printf "string t0 %4d %9.3f +/- %9.3f us\n" $STRING $(($P1[1] * 1.0e6)) $(($P1[2] * 1.0e6))
62 printf "string sigma %4d %9.3f +/- %9.3f us\n" $STRING $(($P2[1] * 1.0e6)) $(($P2[2] * 1.0e6))
63 
64 if (( ${#} == 3 )); then
65 
67 
68  set_array P1 `JPrintFit -f /tmp/F\[${STRING}\].root:Add -@p1`
69 
70  let TIME_OFFSET_NS="$P1[1] * 1.0e9"
71 
72  printf "Add time offset %12.6d to hydrophone.\n" $TIME_OFFSET_NS
73 
74  JEditDetector \
75  -a $DETECTOR \
76  -o $DETECTOR \
77  -M "$MODULE SUB $TIME_OFFSET_NS" \
78  -d $DEBUG
79 fi
80 
81 JPlot1D \
82  -f /tmp/F\[${STRING}\].root:Add \
83  -x "$XMIN $XMAX" \
84  -\> "#Deltat [s]" \
85  -\^ "number of events [a.u.]" \
86  -N "X 505" \
87  -T "$STRING" \
88  -o hydrophonet0_${STRING}.$FORMAT $BATCH
then usage $script< detector file >< detectorfile > nIf the range of floors is the first detector file is aligned to the second before the comparison fi case set_variable RANGE $argv[3]
Q(UTCMax_s-UTCMin_s)-livetime_s
TPaveText * p1
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
clean eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY set_variable STRING
then JMuonPostfit f
then usage $script< detector file >< inputfile > nUtility script to create PDF and CDF of transition time distribution fi case set_variable WORKDIR
Definition: JLegolas.sh:31
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
static const double H
Planck constant [eV s].
exit
Definition: JPizza.sh:36
then echo
then fatal Invalid string $STRING
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
Definition: JAcoustics.sh:20
do set_variable OUTPUT_DIRECTORY $WORKDIR T
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
then awk F
* usage
&set_variable FORMULA
p2
Definition: module-Z:fit.sh:74
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
then JCalibrateToT a
Definition: JTuneHV.sh:116
then set_variable MODULE getModule a $DETECTOR L $STRING $FLOOR JEditDetector a $DETECTOR M $MODULE add $X o $DETECTOR else echo No update of detector $DETECTOR
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
then let XMIN
set_variable DETECTOR
double u[N+1]
Definition: JPolint.hh:739
script
Definition: JAcoustics.sh:2
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
const JModule & getModule(const JDetector &detector, const JModuleLocation &location)
find module with a given string and floor number
then QUANTILES