Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
thresholdCalibration.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3#
4# \author acreusot
5#
6version=1.0
7script=${0##*/}
8
9# ------------------------------------------------------------------------------------------
10#
11# Utility script to test threshold calibration.
12#
13# ------------------------------------------------------------------------------------------
14# all data related to the threshold calibration have to be set in the same directory
15
16
17if [ -z $JPP_DIR ]; then
18 echo "Variable JPP_DIR undefined."
19 exit
20fi
21
22source $JPP_DIR/setenv.sh $JPP_DIR
23
24set_variable DEBUG 1
25
26if do_usage $*; then
27 usage "$script <working directory> <detector file> <threshold data directory>"
28fi
29
30case $# in
31 3) set_variable THDIR $3;
32 set_variable DETX $2;
33 set_variable WORKDIR $1;;
34 *) fatal "wrong number of arguments!";;
35esac
36
37# Retrieve cookie
38JCookie.sh
39
40for FILEPATH in $(ls ${WORKDIR}/${THDIR}/); do
41 CURFILE=("${WORKDIR}/${THDIR}/${FILEPATH}")
42 TMP1=${FILEPATH#*_}
43 TMP2=${TMP1#*_}
44 RUNNB=${TMP2%.root}
45 if (( 1 )); then
46 JCalibrateToT \
47 -d $DEBUG \
48 -f ${CURFILE} \
49 -a ${WORKDIR}/${DETX} \
50 -C JDAQTimesliceL0 \
51 -o ${WORKDIR}/${FILEPATH%.root}_calibrateToT.root
52 fi
53
54 if (( 1 )); then
55 JIntegrateToT \
56 -d $DEBUG \
57 -f ${WORKDIR}/${FILEPATH%.root}_calibrateToT.root \
58 -o ${WORKDIR}/${DETX%.detx}_integrateToT.txt \
59 -a ${WORKDIR}/${DETX} \
60 -r ${RUNNB}
61 fi
62
63done
64
65if (( 1 )); then
66 JTuneTH \
67 -d $DEBUG \
68 -a ${WORKDIR}/${DETX} \
69 -f ${WORKDIR}/${DETX%.detx}_integrateToT.txt \
70 -o ${WORKDIR}/${DETX%.detx}_thresholdTuning.json \
71 -t 0.5 \
72 -T "TH-TUNING-SEA-v1"
73fi