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