Jpp 20.0.0-72-g597b30bc9
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 JDetectorDB -D $DETID -r $RUN -o $DETID.datx
38fi
39
40eval `JPrintDetector -a $DETID.datx -O IDENTIFIER`
41eval `JPrintDetector -a $DETID.datx -O SUMMARY`
42
43set_variable INPUT_FILE KM3NeT_${(l:8::0::0:)DETECTOR_ID}_${(l:8::0::0:)RUN}.root
44
45if [[ ! -f $INPUT_FILE ]]; then
46 iget /in2p3/km3net/data/raw/darkroom/KM3NeT_${(l:8::0::0:)DETECTOR_ID}/0/$INPUT_FILE
47fi
48
49JConvertDetectorFormat \
50 -a $DETID.datx \
51 -o detector.datx
52
53JPulsar \
54 -a detector.datx \
55 -A \
56 -f $INPUT_FILE \
57 -!"-1 "${^PMTS} \
58 -o pulsar.root \
59 -C $DAQ_TIMESLICE \
60 -d $DEBUG
61
62JPulsar \
63 -a detector.datx \
64 -f $INPUT_FILE \
65 -!"-1 "${^PMTS} \
66 -o pulsar.root \
67 -C $DAQ_TIMESLICE \
68 -d $DEBUG
69
70typeset -Z 4 STRING
71typeset -Z 2 FLOOR
72
73for MODULE in $MODULES[*]; do
74
75 getLocation -a detector.datx -M $MODULE | read STRING FLOOR
76
77 if (( $FLOOR != 0 )); then
78
79 JPlot1D \
80 -f pulsar.root:$MODULE \
81 -x "-20.0 +50.0" \
82 -Y \
83 -> "#Deltat [ns]" \
84 -\^ "number of events [a.u.]" \
85 -T "?" \
86 -O hist \
87 -o M_${STRING}_${FLOOR}.$FORMAT -B
88 fi
89done
90
91for STRING in $STRINGS[*]; do
92
93 echo "Creating graphics M_${STRING}.$FORMAT."
94
95 montage \
96 -tile 6x3 \
97 -geometry +0+0 \
98 M_${STRING}_{01..18}.$FORMAT \
99 M_${STRING}.$FORMAT >& /dev/null
100done
101
102JLegolas \
103 -f pulsar.root \
104 -o legolas.root \
105 -C cdf.txt \
106 -P pdf.txt \
107 -d $DEBUG
108
109$JPP_DIR/examples/JDetector/JTransitTime \
110 -o PMT\[$TYPE\].root \
111 -O $TYPE \
112 -d $DEBUG
113
114JPlot1D \
115 -f legolas.root:pmt \
116 -f PMT\[$TYPE\].root:tts \
117 -x "-30.0 +100.0" \
118 -y "2.0e-6 1.0" \
119 -Y \
120 -> "#Deltat [ns]" \
121 -\^ "probability" \
122 -O hist \
123 -T "HAMA-R12199" \
124 -L TR \
125 -o PMT.$FORMAT $BATCH
126
127
128