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