run_35t_evd.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 args=("$@")
4 argssize=${#args[*]}
5 if [ $argssize -ne 1 ];then
6  echo ""
7  echo ""
8  echo ""
9  echo "Usage: ./run_35t_evd.sh {run number - in 6 digit format please!}"
10  echo ""
11  echo "To get the most recent run, use run number 0."
12  echo ""
13  echo ""
14  exit
15 fi
16 
17 run=${args[0]}
18 
19 
20 # Setup necessary pathways:
21 export version=v04_36_01
22 export comp=e9
23 export RelDir=/dune/app/home/duneana/35t_EventDisplay/larsoft_${version}
24 export LPDir=${RelDir}/localProducts_larsoft_${version}_${comp}_prof
25 export EVDfclPath=${RelDir}/srcs/dunetpc/dune/NearlineMonitor/evd
26 export InputPath=/dune/data2/users/lbnedaq/nearline_evd/${version}
27 export FileSearch='/dune/data2/users/lbnedaq/nearline_evd/*/*/*/sliced_pedestal.root'
28 export filepos=9
29 
30 
31 
32 # Set up the LArSoft environment
33 echo ""
34 echo ""
35 echo "Setting up LArSoft/DUNETPC:"
36 echo "=========================="
37 echo ""
38 source /grid/fermiapp/products/dune/setup_dune.sh
39 cd $LPDir
40 source ./setup
41 cd ..
42 mrbslp
43 echo ""
44 echo ""
45 
46 
47 
48 
49 # Find the most recent file
50 for file in $( find ${FileSearch} -mmin +1 | sort -t "/" -k$filepos -r )
51 do {
52  # This is a sloppy way of getting only the most recent file but I don't
53  # know how else to do it... ...don't judge me...
54  break
55  } done
56 
57 
58 if [ $run -ne 0 ];then
59  run=`printf %06i $run`
60  bigRun=${run:0:3}
61  file=${InputPath}/${bigRun}/${run}_01/sliced_pedestal.root
62 fi
63 
64 echo "Opening file:"
65 echo $file
66 
67 
68 
69 # Run the evd!
70 lar -c ${EVDfclPath}/evd_dune35t_slicer.fcl $file
71 
72 
73 
74 
75 echo ""
76 echo ""
77 echo "Finished running the 35t EVD..."
78 echo ""
79 echo ""