5 if [ $argssize -ne 3 ];then
7 echo "Three input arguments must be provided! Exiting..."
17 INFILE=`basename $infile`
20 outhistfile=${INFILE%$fileend}_evd.root
22 export LOCKFILE=${INFILE}EVD.LOCK
23 export DONEFILE=${INFILE}EVD.DONE
27 # Touch a lock file...
28 echo "Creating file ${infile}EVD.LOCK"
29 touch $RunDir/$LOCKFILE
31 # Create a hard link...
32 ln ${infile} /data/lbnedaq/data/nearline-monitoring-links/${INFILE}
34 # Setup the LArSoft environment...
36 echo "Setting up LArSoft/DUNETPC:"
37 source /grid/fermiapp/products/dune/setup_dune.sh
44 # Move into the appropriate output directory...
47 export infilesize=`ls -l $infile | awk '{ print $5 }'`
50 # Skip files that are too small and probably DAQ junk...
51 if [ $infilesize -gt 500 ];
53 echo "Processing /data/lbnedaq/data/nearline-monitoring-links/${INFILE}"
55 PEDESTAL=`cat /data/lbnedaq/pedestals/current_run.txt`
56 NEARLINE_PEDESTAL=/data/lbnedaq/pedestals/database_pedestals/offline_databaseRun_${PEDESTAL}.csv
57 if [ -e $NEARLINE_PEDESTAL ];then
58 export NEARLINE_PEDESTAL=$NEARLINE_PEDESTAL
60 export NEARLINE_PEDESTAL="/home/lbnedaq/nearline/pedestal_files/offline_databaseRun_9754.csv"
63 echo "Setting pedestal to: $NEARLINE_PEDESTAL"
65 lar -c ctreeraw35t_trigTPC.fcl -n 10 /data/lbnedaq/data/nearline-monitoring-links/${INFILE}
67 # Rename the output file for the RED35 EVD so that the script that looks for the most recent file
68 # knows that the processing is finished.
69 mv sample.root sample_done.root
71 # Don't know why this text file gets created. Probably could be turned off at the fcl level.
72 # Just going to remove it manually for now...
73 rm -fv WireGeometry.txt
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_DATE $END_DATE" >> $RunDir/$DONEFILE
91 echo "NEARLINE_PEDESTAL $NEARLINE_PEDESTAL" >> $RunDir/$DONEFILE
94 echo "Done with file $infile..."