CheckPhotonPrescale.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 fhicl=$1
4 artfile=$2
5 
6 artscale=`config_dumper -S $artfile | grep "ScintPreScale" | awk '{ print $2 }'`
7 fhiclscale=`ART_DEBUG_CONFIG=1 lar -c $fhicl 2>&1 | grep "ScintPreScale" | awk '{ print $2 }'`
8 fhiclqe=`ART_DEBUG_CONFIG=1 lar -c $fhicl 2>&1 | grep -m 1 "QuantumEfficiency" | awk '{ print $2 }'`
9 
10 if [[ $artscale != $fhiclscale ]]; then
11  echo "You need to set the prescale in your fhicl to match this file:"
12  echo "services.LArProperties.ScintPreScale: $artscale"
13  exit 1
14 fi
15 
16 scalem=${fhiclscale/[eE]/*10^}
17 qem=${fhiclqe/[eE]/*10^}
18 
19 if (( $(echo "$scalem < $qem" | bc -l) )); then
20  echo "Your quantum efficiency, $fhiclqe, is too high. It needs to"
21  echo "be below the Scintillation pre-scale $fhiclscale"
22  exit 1
23 fi
24 
25 echo "Good to go!"
26