Skip to content
Snippets Groups Projects
Commit da19088c authored by FASER Reco's avatar FASER Reco
Browse files

script updates for production

parent 1eb52d1e
No related branches found
No related tags found
1 merge request!321script updates for production
Pipeline #4975196 passed
...@@ -109,7 +109,7 @@ useCal = False ...@@ -109,7 +109,7 @@ useCal = False
useLHC = False useLHC = False
# Enable ACTS material corrections, this crashes testbeam geometries # Enable ACTS material corrections, this crashes testbeam geometries
ConfigFlags.TrackingGeometry.MaterialSource = "/cvmfs/faser.cern.ch/repo/sw/database/DBRelease/current/acts/material-maps.json" ConfigFlags.TrackingGeometry.MaterialSource = "/cvmfs/faser.cern.ch/repo/sw/database/DBRelease/1.2.0/acts/material-maps.json"
# TI12 Cosmics geometry # TI12 Cosmics geometry
if runtype == "TI12Data": if runtype == "TI12Data":
...@@ -315,5 +315,11 @@ b = time.time() ...@@ -315,5 +315,11 @@ b = time.time()
from AthenaCommon.Logging import log from AthenaCommon.Logging import log
log.info(f"Finish execution in {b-a} seconds") log.info(f"Finish execution in {b-a} seconds")
sys.exit(int(sc.isFailure())) # Signal errors
if sc.isSuccess():
log.info("Execution succeeded")
sys.exit(0)
else:
log.info("Execution failed, return 1")
sys.exit(1)
...@@ -217,6 +217,8 @@ else ...@@ -217,6 +217,8 @@ else
fi fi
# #
faser_reco.py "--nevents=$nevents" $geomstr $tagstr $mcstr "$file_path" faser_reco.py "--nevents=$nevents" $geomstr $tagstr $mcstr "$file_path"
reco_code=$?
echo "Return code: $reco_code"
# #
# Print out ending time # Print out ending time
date date
...@@ -230,11 +232,27 @@ if ! [ -z "$outdest" ] ...@@ -230,11 +232,27 @@ if ! [ -z "$outdest" ]
then then
echo "Output directory:" echo "Output directory:"
ls -l ls -l
echo "copy *-xAOD.root to $outdest" thefile=`ls *-xAOD.root`
eos mkdir -p $outdest if [ $? -eq 0 ]; then
# Keep this line from stopping script, so we might get a log file echo "copy $thefile to $outdest"
# || true ensures script continues even if copy fails eos mkdir -p $outdest
eos cp *-xAOD.root ${outdest}/ || true # Keep this line from stopping script, so we might get a log file
# || true ensures script continues even if copy fails
eos cp $thefile ${outdest}/${thefile} || true
# Check that it worked
eos ls ${outdest}/${thefile} > /dev/null
if [ $? -eq 0 ]; then
echo "file $thefile copied to $outdest"
copy_code=0
else
echo "didnt find $thefile in $outdest !"
copy_code=1
fi
else
echo "ls *-xAOD.root returned nothing!"
copy_code=1
fi
fi fi
# #
# Copy log file second # Copy log file second
...@@ -255,3 +273,11 @@ then ...@@ -255,3 +273,11 @@ then
eos mkdir -p $outdest eos mkdir -p $outdest
eos cp $logfile $outdest/$logfile eos cp $logfile $outdest/$logfile
fi fi
# Make sure to return an error is calypso failed
if [ $reco_code -ne 0 ] || [ $copy_code -ne 0 ]; then
exit 1
else
exit 0
fi
...@@ -217,4 +217,10 @@ b = time.time() ...@@ -217,4 +217,10 @@ b = time.time()
log.info(f"Finish execution in {b-a} seconds") log.info(f"Finish execution in {b-a} seconds")
# Success should be 0 # Success should be 0
sys.exit(int(sc.isFailure())) if sc.isSuccess():
log.info("Execution succeeded")
sys.exit(0)
else:
log.info("Execution failed, return 1")
sys.exit(1)
...@@ -220,6 +220,8 @@ export EOS_MGM_URL=root://eospublic.cern.ch ...@@ -220,6 +220,8 @@ export EOS_MGM_URL=root://eospublic.cern.ch
# Run job # Run job
# #
faser_ntuple_maker.py $last_file_str $partialstr $tagstr $ismc --slice $slice --files $nfiles $dir_path faser_ntuple_maker.py $last_file_str $partialstr $tagstr $ismc --slice $slice --files $nfiles $dir_path
ntup_code=$?
echo "Return code: $ntup_code"
# #
# Print out ending time # Print out ending time
date date
...@@ -250,3 +252,6 @@ then ...@@ -250,3 +252,6 @@ then
mkdir -p $outdest mkdir -p $outdest
eos cp $logfile $outdest/$logfile eos cp $logfile $outdest/$logfile
fi fi
# Make sure to return an error if ntuple failed
exit $ntup_code
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment