Jpp  19.1.0-rc.1
the software that should make you happy
thresholdCalibration.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 #
4 # \author acreusot
5 #
6 version=1.0
7 script=${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 
17 if [ -z $JPP_DIR ]; then
18  echo "Variable JPP_DIR undefined."
19  exit
20 fi
21 
22 source $JPP_DIR/setenv.sh $JPP_DIR
23 
24 set_variable DEBUG 1
25 
26 if do_usage $*; then
27  usage "$script <working directory> <detector file> <threshold data directory>"
28 fi
29 
30 case $# in
31  3) set_variable THDIR $3;
32  set_variable DETX $2;
33  set_variable WORKDIR $1;;
34  *) fatal "wrong number of arguments!";;
35 esac
36 
37 # Retrieve cookie
38 JCookie.sh
39 
40 for 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 
63 done
64 
65 if (( 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"
73 fi