5 if [ $argssize -ne 3 ];then
7 echo "Three input arguments must be provided! Exiting..."
17 INFILE=`basename $infile`
20 outhistfile=${INFILE%$fileend}_nearline_hist.root
21 outhistfilemuon=${INFILE%$fileend}_nearline_muon_counters.root
23 export LOCKFILE=$INFILE.LOCK
24 export DONEFILE=$INFILE.DONE
28 # Touch a lock file...
29 echo "Creating file $infile.LOCK"
30 touch $RunDir/$LOCKFILE
32 # Create a hard link...
33 ln ${infile} /data/lbnedaq/data/nearline-monitoring-links/${INFILE}
35 # Setup the LArSoft environment...
37 echo "Setting up LArSoft/DUNETPC:"
38 source /grid/fermiapp/products/dune/setup_dune.sh
45 # Move into the appropriate output directory...
48 export infilesize=`ls -l $infile | awk '{ print $5 }'`
51 # Skip files that are too small and probably DAQ junk...
52 if [ $infilesize -gt 500 ];
54 echo "Processing /data/lbnedaq/data/nearline-monitoring-links/${INFILE}"
56 PEDESTAL=`cat /data/lbnedaq/pedestals/current_run.txt`
57 NEARLINE_PEDESTAL=/data/lbnedaq/pedestals/database_pedestals/offline_databaseRun_${PEDESTAL}.csv
58 if [ -e $NEARLINE_PEDESTAL ];then
59 export NEARLINE_PEDESTAL=$NEARLINE_PEDESTAL
61 export NEARLINE_PEDESTAL="/home/lbnedaq/nearline/pedestal_files/offline_databaseRun_9754.csv"
64 echo "Setting pedestal to: $NEARLINE_PEDESTAL"
66 lar -c test_stitcher_nearlineana.fcl -n 10 /data/lbnedaq/data/nearline-monitoring-links/${INFILE} -T $outhistfile
68 END_NEARLINE_ANA=`date`
70 lar -c nearline_muoncounter35t.fcl /data/lbnedaq/data/nearline-monitoring-links/${INFILE} -T $outhistfilemuon
72 END_NEARLINE_MUON=`date`
79 rm -v $RunDir/$LOCKFILE
82 rm -f /data/lbnedaq/data/nearline-monitoring-links/${INFILE}
87 touch $RunDir/$DONEFILE
89 echo "START_DATE $START_DATE" >> $RunDir/$DONEFILE
90 echo "END_NEARLINE_ANA $END_NEARLINE_ANA" >> $RunDir/$DONEFILE
91 echo "END_NEARLINE_MUON $END_NEARLINE_MUON" >> $RunDir/$DONEFILE
92 echo "END_DATE $END_DATE" >> $RunDir/$DONEFILE
93 echo "NEARLINE_PEDESTAL $NEARLINE_PEDESTAL" >> $RunDir/$DONEFILE
96 echo "Done with file $infile..."