Jpp  master_rocky-43-ge265d140c
the software that should make you happy
JFitL1dt.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author lnauta
4 #
5 script=${0##*/}
6 
7 # ------------------------------------------------------------------------------------------
8 #
9 # Script to fit L1dt time offsets from triggered data and MC data.
10 #
11 # ------------------------------------------------------------------------------------------
12 
13 if [ -z $JPP_DIR ]; then
14  echo "Variable JPP_DIR undefined."
15  exit
16 fi
17 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
18 
19 set_variable DEBUG 0
20 set_variable WORKDIR ${TMPDIR:-/tmp}/
21 set_variable NUMBEROFFLOORS 18
22 set_variable DAQ_TIMESLICE JDAQTimesliceSN # SN has the most statistics in data since there is no downscaling
23 
24 if do_usage $*; then
25  usage "$script <detector file> <input file(s)> <model file(s)> [number of floors in fit]"
26 fi
27 
28 case $# in
29  4) set_variable NUMBEROFFLOORS $4;&
30  3) set_variable MODELFILE $3;
31  set_variable INPUTFILE $2;
32  set_variable DETECTOR $1;;
33  *) fatal "Wrong number of arguments.";;
34 esac
35 
36 cp -v $DETECTOR $WORKDIR/detector.detx
37 
38 # ------------------------------------------------------------------------------------------
39 # JMonitorL1dt for data
40 # ------------------------------------------------------------------------------------------
41 
42 timer_start
43 
44 JMonitorL1dt \
45  -f $INPUTFILE \
46  -C $DAQ_TIMESLICE \
47  -a $WORKDIR/detector.detx \
48  -o $WORKDIR/monitor_data.root \
49  -d $DEBUG --!
50 
51 timer_stop
52 timer_print
53 
54 # ------------------------------------------------------------------------------------------
55 # JMonitorL1dt for monte carlo
56 # ------------------------------------------------------------------------------------------
57 
58 timer_start
59 
60 JMonitorL1dt \
61  -f $MODELFILE \
62  -C $DAQ_TIMESLICE \
63  -a $WORKDIR/detector.detx \
64  -o $WORKDIR/monitor_model.root \
65  -d $DEBUG --!
66 
67 timer_stop
68 timer_print
69 
70 # ------------------------------------------------------------------------------------------
71 # JFitL1dtSlices
72 # ------------------------------------------------------------------------------------------
73 
74 timer_start
75 JFitL1dtSlices \
76  -a $WORKDIR/detector.detx \
77  -f $WORKDIR/monitor_data.root \
78  -m $WORKDIR/monitor_model.root \
79  -o $WORKDIR/slices.root \
80  -d $DEBUG --!
81 
82 timer_stop
83 timer_print
84 
85 # ------------------------------------------------------------------------------------------
86 # JFitL1dt
87 # ------------------------------------------------------------------------------------------
88 
89 timer_start
90 
91 JFitL1dt \
92  -D \
93  -F $NUMBEROFFLOORS \
94  -a $WORKDIR/detector.detx \
95  -f $WORKDIR/slices.root \
96  -o $WORKDIR/fitl1dt.root \
97  -d $DEBUG --!
98 
99 timer_stop
100 timer_print