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