Jpp 21.0.1
the software that should make you happy
Loading...
Searching...
No Matches
JTransitTime_D0DU003MA.sh
Go to the documentation of this file.
1#!/usr/bin/env zsh
2#
3# \author mdejong
4version=1.0
5script=${0##*/}
6
7# ------------------------------------------------------------------------------------------
8#
9# Utility script to produce the transit time probability and generator for HAMA-R12199.
10# See https://elog.km3net.de/Calibration/329.
11#
12# ------------------------------------------------------------------------------------------
13
14source $JPP_DIR/setenv.sh $JPP_DIR
15
16set_variable DEBUG 2
17set_variable DETID D0DU003MA
18set_variable RUN 98
19set_variable DAQ_TIMESLICE JDAQTimeslice
20PMTS=(7 15)
21set_variable TYPE 38
22
23set_variable: FORMAT GRAPHICS_FORMAT gif
24set_variable+ BATCH GRAPHICS_BATCH -B
25
26if do_usage $*; then
27 usage "$script"
28fi
29
30if (( $# != 0 )); then
31 fatal "Wrong number of arguments."
32fi
33
34expand_array RUNS
35
36if [[ ! -f $DETID.datx ]]; then
37
38 JDetectorDB -D $DETID -r $RUN -o $DETID.datx
39
40 if (( $? != 0 )); then
41 JDetectorDB -D $DETID -@ "tcal = ?" -@ "pcal = ?" -@ "rcal = ?" -@ "acal = ?" -@ "ccal = ?" -@ "scal = ?" -o $DETID.datx
42 fi
43fi
44
45eval `JPrintDetector -a $DETID.datx -O IDENTIFIER`
46eval `JPrintDetector -a $DETID.datx -O SUMMARY`
47
48set_variable INPUT_FILE KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}.root
49
50if [[ ! -f $INPUT_FILE ]]; then
51 iget /in2p3/km3net/data/raw/darkroom/KM3NeT_${(l:8::0::0:)DETECTOR_ID}/0/$INPUT_FILE
52fi
53
54JConvertDetectorFormat \
55 -a $DETID.datx \
56 -o detector.datx
57
58JPulsar \
59 -a detector.datx \
60 -A \
61 -f $INPUT_FILE \
62 -!"-1 "${^PMTS} \
63 -o pulsar.root \
64 -C $DAQ_TIMESLICE \
65 -d $DEBUG
66
67JPulsar \
68 -a detector.datx \
69 -f $INPUT_FILE \
70 -!"-1 "${^PMTS} \
71 -o pulsar.root \
72 -C $DAQ_TIMESLICE \
73 -d $DEBUG
74
75typeset -Z 4 STRING
76typeset -Z 2 FLOOR
77
78for MODULE in $MODULES[*]; do
79
80 getLocation -a detector.datx -M $MODULE | read STRING FLOOR
81
82 if (( $FLOOR != 0 )); then
83
84 JPlot1D \
85 -f pulsar.root:$MODULE \
86 -x "-20.0 +50.0" \
87 -Y \
88 -> "#Deltat [ns]" \
89 -\^ "number of events [a.u.]" \
90 -T "?" \
91 -O hist \
92 -o M_${STRING}_${FLOOR}.$FORMAT -B
93 fi
94done
95
96for STRING in $STRINGS[*]; do
97
98 echo "Creating graphics M_${STRING}.$FORMAT."
99
100 montage \
101 -tile 6x3 \
102 -geometry +0+0 \
103 M_${STRING}_{01..18}.$FORMAT \
104 M_${STRING}.$FORMAT >& /dev/null
105done
106
107JLegolas \
108 -f pulsar.root \
109 -o legolas.root \
110 -C cdf.txt \
111 -P pdf.txt \
112 -d $DEBUG
113
114$JPP_DIR/examples/JDetector/JTransitTime \
115 -o PMT\[$TYPE\].root \
116 -O $TYPE \
117 -d $DEBUG
118
119JPlot1D \
120 -f legolas.root:pmt \
121 -f PMT\[$TYPE\].root:tts \
122 -x "-30.0 +100.0" \
123 -y "2.0e-6 1.0" \
124 -Y \
125 -> "#Deltat [ns]" \
126 -\^ "probability" \
127 -O hist \
128 -T "HAMA-R12199" \
129 -L TR \
130 -o PMT.$FORMAT $BATCH
131
132
133