-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from rlcee/initial_230317
initial code
- Loading branch information
Showing
9 changed files
with
1,788 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
#!/bin/bash | ||
# | ||
# run the Pass1 CRVWB (CRV wideband) teststand Reco procedure | ||
# | ||
# when this runs, offlineops should be setup and $OFFLINEOPS_DIR defined | ||
# | ||
|
||
|
||
if [ ! "$OFFLINEOPS_DIR" ]; then | ||
echo "ERROR - OFFLINEOPS_DIR needs to be defined before this script runs" | ||
exit 1 | ||
fi | ||
|
||
source /cvmfs/mu2e.opensciencegrid.org/bin/OfflineOps/functions.sh | ||
|
||
# fname is the sam project file, set by fife_wrap | ||
tee_date "Starting CRVWB reco.sh" | ||
tee_date "args are: $@" | ||
|
||
source /cvmfs/fermilab.opensciencegrid.org/products/common/etc/setups | ||
setup mu2e | ||
setup CRVTeststand $MOO_CRVTESTSTAND | ||
setup -B mu2efiletools | ||
setup -B sam_web_client | ||
setup -B ifdhc | ||
|
||
printenv | grep SAM | ||
|
||
# modify CRV exe control to use local directory | ||
cat $CRVTESTSTAND_FQ_DIR/config.txt | \ | ||
awk '{ | ||
if(index($1,"crv")==1) { | ||
print $1" ./" | ||
} else { | ||
print $0 | ||
} | ||
}' > config.txt | ||
|
||
DATE=$(date +%s) | ||
|
||
if [ "$MOO_OUTDIR" == "production" ]; then | ||
LOCROOT=tape | ||
LOCTXT=disk | ||
else | ||
LOCROOT=scratch | ||
LOCTXT=scratch | ||
fi | ||
|
||
control_summary exe | ||
|
||
get_next_SAM_file | ||
|
||
RCT=0 | ||
TOPSEQ="000000_00000000" | ||
|
||
while [ "$MOO_INPUT" ] | ||
do | ||
tee_date "processing $MOO_INPUT" | ||
|
||
BNAME=$(basename $MOO_INPUT) | ||
ifdh cp $MOO_INPUT $BNAME | ||
RCT=$((RCT+$?)) | ||
|
||
[ $RCT -ne 0 ] && break | ||
|
||
DES=$(echo $BNAME | awk -F. '{print $3}' ) | ||
CFG=$(echo $BNAME | awk -F. '{print $4}' ) | ||
SEQ=$(echo $BNAME | awk -F. '{print $5}' ) | ||
if [[ "$SEQ" > "$TOPSEQ" ]]; then | ||
TOPSEQ=$SEQ | ||
LGFN=log.mu2e.${DES}.${MOO_CONFIG}.${SEQ}.log | ||
fi | ||
CRFN=ntd.mu2e.${DES}.${MOO_CONFIG}.${SEQ}.root | ||
CPFN=etc.mu2e.${DES}_cali.${MOO_CONFIG}.${SEQ}.pdf | ||
CTFN=etc.mu2e.${DES}_cali.${MOO_CONFIG}.${SEQ}.txt | ||
RRFN=rec.mu2e.${DES}.${MOO_CONFIG}.${SEQ}.root | ||
RPFN=etc.mu2e.${DES}_reco.${MOO_CONFIG}.${SEQ}.pdf | ||
RTFN=etc.mu2e.${DES}_reco.${MOO_CONFIG}.${SEQ}.txt | ||
|
||
if [ "$MOO_FAKE" ]; then | ||
date > ntd.mu2e.${DES}.${CFG}.${SEQ}.root | ||
date > cal.mu2e.${DES}.${CFG}.${SEQ}.pdf | ||
date > cal.mu2e.${DES}.${CFG}.${SEQ}.txt | ||
date > rec.mu2e.${DES}.${CFG}.${SEQ}.root | ||
date > rec.mu2e.${DES}.${CFG}.${SEQ}.pdf | ||
date > rec.mu2e.${DES}.${CFG}.${SEQ}.txt | ||
else | ||
parserCrv $SEQ | ||
RCT=$((RCT+$?)) | ||
|
||
calibCrv $SEQ | ||
RCT=$((RCT+$?)) | ||
|
||
recoCrv $SEQ -p | ||
RCT=$((RCT+$?)) | ||
fi | ||
|
||
mv ntd.mu2e.${DES}.${CFG}.${SEQ}.root $CRFN | ||
mv cal.mu2e.${DES}.${CFG}.${SEQ}.pdf $CPFN | ||
mv cal.mu2e.${DES}.${CFG}.${SEQ}.txt $CTFN | ||
mv rec.mu2e.${DES}.${CFG}.${SEQ}.root $RRFN | ||
mv rec.mu2e.${DES}.${CFG}.${SEQ}.pdf $RPFN | ||
mv rec.mu2e.${DES}.${CFG}.${SEQ}.txt $RTFN | ||
|
||
echo $BNAME > parents_${BNAME} | ||
|
||
echo "$LOCROOT $CRFN parents_${BNAME}" >> output.txt | ||
echo "$LOCTXT $CPFN parents_${BNAME}" >> output.txt | ||
echo "$LOCTXT $CTFN parents_${BNAME}" >> output.txt | ||
echo "$LOCROOT $RRFN parents_${BNAME}" >> output.txt | ||
echo "$LOCTXT $RPFN parents_${BNAME}" >> output.txt | ||
echo "$LOCTXT $RTFN parents_${BNAME}" >> output.txt | ||
|
||
if [ $RCT -eq 0 ]; then | ||
release_SAM_file consumed | ||
get_next_SAM_file | ||
else | ||
release_SAM_file skipped | ||
fi | ||
done | ||
|
||
tee_date "Done file loop, RCT=$RCT" | ||
|
||
if [ $RCT -ne 0 ]; then | ||
tee_date "removing data files from output list" | ||
rm output.txt | ||
fi | ||
echo "$LOCTXT $LGFN none" >> output.txt | ||
|
||
|
||
tee_date "cat output.txt" | ||
cat ouput.txt | ||
|
||
control_summary final | ||
|
||
if [ "$MOO_LOCAL" ]; then | ||
RCP=0 | ||
else | ||
pushOutput output.txt | ||
RCP=$? | ||
fi | ||
|
||
RC=$((RCT+RCP)) | ||
|
||
tee_date "done CRVWB/reco.sh RC=$RC" | ||
|
||
exit $RC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
#!/bin/bash | ||
# | ||
# run the Pass1 Demo Reco procedure | ||
# | ||
|
||
[[ "$MOO_FAIL" && $((RANDOM%400)) -lt $MOO_FAIL ]] && exit 1 | ||
|
||
RCT=0 | ||
|
||
source /cvmfs/mu2e.opensciencegrid.org/bin/OfflineOps/functions.sh | ||
RCT=$((RCT+$?)) | ||
|
||
tee_date "Starting Demo reco.sh" | ||
|
||
if [ ! "$OFFLINEOPS_DIR" ]; then | ||
echo "ERROR - OFFLINEOPS_DIR needs to be defined before this script runs" | ||
RCT=$((RCT+$?)) | ||
fi | ||
|
||
if [[ -z "$MOO_CONDITIONS" || "$MOO_CONDITIONS" == "none" ]]; then | ||
echo "ERROR - MOO_CONDITIONS required but not set: $MOO_CONDITIONS" | ||
RCT=$((RCT+1)) | ||
fi | ||
|
||
source /cvmfs/fermilab.opensciencegrid.org/products/common/etc/setups | ||
setup mu2e | ||
muse setup SimJob $MOO_SIMJOB | ||
RCT=$((RCT+$?)) | ||
|
||
setup -B mu2efiletools | ||
setup -B sam_web_client | ||
setup -B ifdhc | ||
|
||
muse status | ||
|
||
if [ "$MOO_OUTDIR" == "production" ]; then | ||
LOCART=tape | ||
LOCTXT=disk | ||
else | ||
LOCART=scratch | ||
LOCTXT=scratch | ||
fi | ||
|
||
control_summary exe | ||
|
||
get_next_SAM_file | ||
RCT=$((RCT+$?)) | ||
|
||
if [[ $RCT -eq 0 && -n "$MOO_INPUT" ]]; then | ||
|
||
tee_date "processing $MOO_INPUT" | ||
|
||
BNAME=$(basename $MOO_INPUT) | ||
|
||
DES=$(echo $BNAME | awk -F. '{print $3}' ) | ||
CFG=$(echo $BNAME | awk -F. '{print $4}' ) | ||
SEQ=$(echo $BNAME | awk -F. '{print $5}' ) | ||
LGFN=log.mu2e.${DES}.${MOO_CONFIG}.${SEQ}.log | ||
RAFN=rec.mu2e.${DES}.${MOO_CONFIG}.${SEQ}.art | ||
|
||
echo "#include \"Production/JobConfig/reco/Reco.fcl\"" > local.fcl | ||
DBP=$(echo $MOO_CONDITIONS | awk -F: '{print $1}') | ||
DBV=$(echo $MOO_CONDITIONS | awk -F: '{print $2}') | ||
DBE=$(echo $MOO_CONDITIONS | awk -F: '{print $3}') | ||
[ -z "$DBE" ] && DBE=2 | ||
echo "services.DbService.purpose : $DBP" >> local.fcl | ||
echo "services.DbService.version : $DBV" >> local.fcl | ||
echo "services.DbService.verbose : $DBE" >> local.fcl | ||
|
||
|
||
NEVARG="" | ||
[ "$MOO_FAKE" == "true" ] && NEVARG="-n 5" | ||
|
||
tee_date "processing $MOO_INPUT" | ||
|
||
mu2e $NEVARG -s $MOO_INPUT -o $RAFN -c local.fcl | ||
RC=$? | ||
|
||
[[ "$MOO_FAIL" && $((RANDOM%400)) -lt $MOO_FAIL ]] && exit 1 | ||
|
||
tee_date "done processing, art RC=$RC" | ||
|
||
RCT=$((RCT+RC)) | ||
|
||
echo $BNAME > parents.txt | ||
|
||
echo "$LOCART $RAFN parents.txt" >> output.txt | ||
|
||
if [ $RCT -eq 0 ]; then | ||
tee_date "Release $MOO_INPUT consumed" | ||
release_SAM_file consumed | ||
else | ||
tee_date "Release $MOO_INPUT skipped" | ||
release_SAM_file skipped | ||
fi | ||
fi | ||
|
||
|
||
if [ $RCT -ne 0 ]; then | ||
tee_date "removing data files from output list" | ||
rm output.txt | ||
fi | ||
echo "$LOCTXT $LGFN none" >> output.txt | ||
|
||
[[ "$MOO_FAIL" && $((RANDOM%400)) -lt $MOO_FAIL ]] && exit 1 | ||
|
||
control_summary final | ||
|
||
if [ "$MOO_LOCAL" ]; then | ||
RCP=0 | ||
else | ||
pushOutput output.txt | ||
RCP=$? | ||
fi | ||
|
||
RC=$((RCT+RCP)) | ||
|
||
tee_date "done Demo/reco.sh RC=$RC" | ||
|
||
[[ "$MOO_FAIL" && $((RANDOM%400)) -lt $MOO_FAIL ]] && exit 1 | ||
|
||
exit $RC |
Oops, something went wrong.