Jpp  19.1.0
the software that should make you happy
JDB/plot-PMTParameters.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 #
4 # \author mdejong
5 #
6 version=1.0
7 script=${0##*/}
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
15 
16 set_variable DEBUG 2
17 set_variable WORKDIR `pwd`
18 set_variable OUTPUT_FILE $WORKDIR/pmt_parameters.root
19 set_variable DIR $JPP_DIR/examples/JDB/
20 set_variable: FORMAT GRAPHICS_FORMAT gif
21 set_variable+ BATCH GRAPHICS_BATCH -B
22 
23 if do_usage $*; then
24  usage "$script <detector file> <PMT parameters file>"
25 fi
26 
27 if (( $# != 2 )); then
28  fatal "Wrong number of parameters."
29 fi
30 
31 set_variable DETECTOR $argv[1]
32 set_variable INPUT_FILE $argv[2]
33 
34 eval `JPrintDetector -a $DETECTOR -O IDENTIFIER`
35 
36 set_variable DETID `getDetector -D $DETECTOR_ID -O string`
37 
38 $DIR/JPlotPMTParameters \
39  -a $DETECTOR \
40  -P $INPUT_FILE \
41  -o $OUTPUT_FILE \
42  -d $DEBUG
43 
44 for KEY in TTS_ns QE gain gainSpread; do
45 
46  JPlot1D \
47  -f "${OUTPUT_FILE}:${KEY}\[.*\]" \
48  -> "$KEY" \
49  -\^ "number of PMTs" \
50  -T "$DETID" \
51  -L "TL 0.8" \
52  -o $KEY.$FORMAT $BATCH
53 done