Jpp  master_rocky-37-gf0c5bc59d
the software that should make you happy
compass_D1ORCA015.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 
3 # --------------------------------------------------------------------------------------------
4 #
5 # Steering script for the compass calibration procedure of the D1ORCA015 (146) detector.
6 #
7 # --------------------------------------------------------------------------------------------
8 
9 if [ -z $JPP_DIR ]; then
10  echo "Variable JPP_DIR undefined."
11  exit
12 fi
13 
14 source $JPP_DIR/setenv.sh $JPP_DIR >& /dev/null
15 
16 set_variable WORKDIR ${TMPDIR:-/tmp}/
17 set_array RUNS 16380-16416
18 
19 if do_usage $*; then
20  usage "$script <detector file>"
21 fi
22 
23 if (( $# != 1 )); then
24  fatal "Wrong number of arguments."
25 fi
26 
27 set_variable DETECTOR $1
28 
29 if [[ ! -f $DETECTOR ]]; then
30  fatal "Missing pre-calibrated D1ORCA015 input detector file"
31 fi
32 
33 # Some compasses have to be disabled because their unconsistent behavior perturbs the pre-calibration
34 # Compass ORCA.0001.16, ORCA.0018.11
35 JEditDetector \
36  -a $DETECTOR \
37  -W "808488997 set COMPASS_DISABLE" \
38  -W "817333825 set COMPASS_DISABLE" \
39  -o detector.datx
40 
41 rm -f $WORKDIR/compass-*.root
42 
43 JCompass.sh detector.datx $RUNS[*] $WORKDIR/compass-\[before\].root
44 
45 JConvertDetectorFormat -a detector.datx -o ${TMPDIR:-/tmp}/detector.datx
46 
47 JCompass.sh ${TMPDIR:-/tmp}/detector.datx $RUNS[*] $WORKDIR/compass-\[after\].root
48 
49 set_variable GRAPHICS_BATCH
50 
51 $JPP_DIR/examples/JCompass/plot-compass.sh detector.datx $WORKDIR/compass-\[before\].root $WORKDIR/compass-\[after\].root
52