Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
Enable xrootd writing for singles (#21)
Browse files Browse the repository at this point in the history
### Briefly, what does this PR introduce?
Enable xrootd writing for singles

### What kind of change does this PR introduce?
- [ ] Bug fix (issue #__)
- [ ] New feature (issue #__)
- [ ] Documentation update
- [ ] Other: __

### Please check if this PR fulfills the following:
- [ ] Tests for the changes have been added
- [ ] Documentation has been added / updated
- [ ] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?

### Does this PR change default behavior?

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
rahmans1 and pre-commit-ci[bot] authored Sep 1, 2024
1 parent 2ed30e0 commit ed0ec04
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ test -f .machine.ad && cat .machine.ad

# Load container environment (include ${DETECTOR_VERSION})
export DETECTOR_CONFIG_REQUESTED=${DETECTOR_CONFIG:-}
source /opt/detector/epic-${DETECTOR_VERSION:-main}/bin/thisepic.sh
export DETECTOR_VERSION_REQUESTED=${DETECTOR_VERSION:-main}
source /opt/detector/epic-${DETECTOR_VERSION_REQUESTED}/bin/thisepic.sh
export DETECTOR_VERSION=${DETECTOR_VERSION_REQUESTED}
export DETECTOR_CONFIG=${DETECTOR_CONFIG_REQUESTED:-${DETECTOR_CONFIG:-$DETECTOR}}

# Argument parsing
Expand All @@ -63,7 +65,7 @@ BASEDIR=${DATADIR:-${PWD}}

# XRD Write locations
XRDWURL="xroots://dtn2201.jlab.org/"
XRDWBASE=${XRDWBASE:-"/eic/eic2/EPIC/xrdtest"}
XRDWBASE=${XRDWBASE:-"/eic/eic2/EPIC"}

# XRD Read locations
XRDRURL="root://dtn-eic.jlab.org/"
Expand Down Expand Up @@ -151,9 +153,10 @@ mkdir -p ${RECO_TEMP} ${BASEDIR}/${RECO_DIR}

# Data egress to directory
if [ "${COPYFULL:-false}" == "true" ] ; then
# Token for write authentication
export BEARER_TOKEN=$(cat ${_CONDOR_CREDS}/eic.use)
xrdfs ${XRDWURL} mkdir -p ${XRDWBASE}/${FULL_DIR} || echo "Cannot write simulation outputs to xrootd server"
xrdcp --force --recursive ${FULL_TEMP}/${TASKNAME}.edm4hep.root ${XRDWURL}/${XRDWBASE}/${FULL_DIR} || \
cp ${FULL_TEMP}/${TASKNAME}.edm4hep.root ${BASEDIR}/${FULL_DIR} || true
xrdcp --force --recursive ${FULL_TEMP}/${TASKNAME}.edm4hep.root ${XRDWURL}/${XRDWBASE}/${FULL_DIR}
fi

# Run eicrecon reconstruction
Expand All @@ -178,14 +181,16 @@ ls -al ${LOG_TEMP}/${TASKNAME}.*

# Data egress to directory
if [ "${COPYRECO:-false}" == "true" ] ; then
# Token for write authentication
export BEARER_TOKEN=$(cat ${_CONDOR_CREDS}/eic.use)
xrdfs ${XRDWURL} mkdir -p ${XRDWBASE}/${RECO_DIR} || echo "Cannot write reconstructed outputs to xrootd server"
xrdcp --force --recursive ${RECO_TEMP}/${TASKNAME}*.edm4eic.root ${XRDWURL}/${XRDWBASE}/${RECO_DIR} || \
cp ${RECO_TEMP}/${TASKNAME}*.edm4eic.root ${BASEDIR}/${RECO_DIR} || true
xrdcp --force --recursive ${RECO_TEMP}/${TASKNAME}*.edm4eic.root ${XRDWURL}/${XRDWBASE}/${RECO_DIR}
fi
if [ "${COPYLOG:-false}" == "true" ] ; then
# Token for write authentication
export BEARER_TOKEN=$(cat ${_CONDOR_CREDS}/eic.use)
xrdfs ${XRDWURL} mkdir -p ${XRDWBASE}/${LOG_DIR} || echo "Cannot write log outputs to xrootd server"
xrdcp --force --recursive ${LOG_TEMP}/${TASKNAME}.* ${XRDWURL}/${XRDWBASE}/${LOG_DIR} || \
cp ${LOG_TEMP}/${TASKNAME}.* ${BASEDIR}/${LOG_DIR} || true
xrdcp --force --recursive ${LOG_TEMP}/${TASKNAME}.* ${XRDWURL}/${XRDWBASE}/${LOG_DIR}
fi

# closeout
Expand Down

0 comments on commit ed0ec04

Please sign in to comment.