new-field-responses.sh
Go to the documentation of this file.
1 #!/bin/bash
2 #
3 # Quick and dirty processing of new field responses. This is bv-specific.
4 #
5 
6 usage () {
7  new-field-responses
8 }
9 
10 speed="1.114*mm/us"
11 origin="10*cm"
12 
13 do_one () {
14  local infile=$1 ; shift
15  local type=$1 ; shift
16  local norm=0
17  if [ $type = "wnormed" ] ; then
18  norm=-1 # by average collection integral
19  fi
20  if [ $type = "half" ] ; then
21  norm=0.5 # roughly fix Garfield's factor of ~2
22  fi
23 
24  local base=$(echo $(basename $infile .tar.gz) | tr '_' '-')
25  local destdir=$(dirname $infile)
26 
27 
28  local datastub="${datadir}/${base}-${type}"
29  local plotstub="${datadir}/../plots/${base}-${type}"
30 
31  echo "NEW $datastub"
32 
33  set -x
34  wirecell-sigproc convert-garfield -n $norm -s $speed -o $origin $infile "${datastub}.json.bz2"
35 
36  wirecell-sigproc plot-garfield-exhaustive -n $norm $infile "${plotstub}-exhaustive.pdf"
37 
38  wirecell-sigproc plot-garfield-track-response -n $norm -s 0 $infile "${plotstub}-current.pdf"
39  wirecell-sigproc plot-garfield-track-response -n $norm -a 0 $infile "${plotstub}-voltage.pdf"
40  wirecell-sigproc plot-garfield-track-response -n $norm $infile "${plotstub}-adc.pdf"
41  set +x
42 
43  echo
44 
45 }
46 
47 
48 
49 datadir=/opt/bviren/wct-dev/share/wirecell/data
50 for sample in ub_10 ub_10_uv_ground ub_10_vy_ground
51 do
52  file="${sample}.tar.gz"
53  for thing in absolute wnormed half
54  do
55  log="$sample-$thing.log"
56  echo $log
57  do_one "${datadir}/${file}" $thing > $log 2>&1 &
58  done
59 done
60