From 26740a128d4c1aac696b913543e9ebe2b0ddd8a9 Mon Sep 17 00:00:00 2001 From: Alexander Booth Date: Fri, 21 Aug 2026 10:56:46 +0100 Subject: [PATCH 1/3] Initial commit for caffluxsyst step. --- run-caffluxsyst/install_caffluxsyst.sh | 31 ++++++++++++++++++++++++ run-caffluxsyst/run_caffluxsyst.sh | 33 ++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100755 run-caffluxsyst/install_caffluxsyst.sh create mode 100755 run-caffluxsyst/run_caffluxsyst.sh diff --git a/run-caffluxsyst/install_caffluxsyst.sh b/run-caffluxsyst/install_caffluxsyst.sh new file mode 100755 index 0000000..504f795 --- /dev/null +++ b/run-caffluxsyst/install_caffluxsyst.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +export ND_PRODUCTION_RUNTIME=${ND_PRODUCTION_RUNTIME:-SHIFTER} + +export ND_PRODUCTION_CONTAINER=${ND_PRODUCTION_CONTAINER:-$ND_PRODUCTION_CONTAINER_CAF} +export ND_PRODUCTION_CONTAINER=${ND_PRODUCTION_CONTAINER:-fermilab/fnal-wn-sl7:latest} + +source ../util/reload_in_container.inc.sh + +set +o errexit + +if [[ -d install ]]; then + echo "caffluxsyst appears to be installed already." + echo "To force a reinstall, please delete the directory run-caffluxsyst/install" + exit +fi + +mkdir install +cd install + +. /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh +setup duneanaobj v04_01_00 -q "e20:prof" +setup cmake v3_27_4 + +git clone --depth 1 --branch v0.9.0 https://github.com/DUNE/duneanafluxtools.git +mkdir duneanafluxtools/build +cd duneanafluxtools/build + +cmake ../ +make install +ldd bin/caffluxweighter diff --git a/run-caffluxsyst/run_caffluxsyst.sh b/run-caffluxsyst/run_caffluxsyst.sh new file mode 100755 index 0000000..d15ab19 --- /dev/null +++ b/run-caffluxsyst/run_caffluxsyst.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +export ND_PRODUCTION_CONTAINER=${ND_PRODUCTION_CONTAINER:-fermilab/fnal-wn-sl7:latest} + +source ../util/reload_in_container.inc.sh + +# Setup environment. +setup() { + . /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh + setup duneanaobj v04_01_00 -q "e20:prof" + + source "${PWD}"/install/duneanafluxtools/build/bin/setup.duneanafluxtools.sh +} + +set +o errexit +setup +set -o errexit + +# Must go after setup. +source ../util/init.inc.sh + +inDir=${ND_PRODUCTION_OUTDIR_BASE}/run-cafmaker/$ND_PRODUCTION_IN_NAME +inName=$ND_PRODUCTION_IN_NAME.$globalIdx +inFile=$(realpath "$inDir"/CAF/$subDir/${inName}.CAF.root) + +outFile=$tmpOutDir/${outName}.CAF.root +rm -f "$outFile" + +run caffluxweighter "$inFile" "$outFile" + +cafOutDir=$outDir/CAF/$subDir +mkdir -p "$cafOutDir" +mv "$outFile" "$cafOutDir" From e4d96b7b8f16b7549173d53a3af25a20fad26433 Mon Sep 17 00:00:00 2001 From: Alexander Booth Date: Fri, 21 Aug 2026 15:37:57 +0100 Subject: [PATCH 2/3] Remove hardcoding of duneanaobj version. --- run-caffluxsyst/install_caffluxsyst.sh | 14 ++++++++++++-- run-caffluxsyst/run_caffluxsyst.sh | 1 - 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/run-caffluxsyst/install_caffluxsyst.sh b/run-caffluxsyst/install_caffluxsyst.sh index 504f795..d2a9db6 100755 --- a/run-caffluxsyst/install_caffluxsyst.sh +++ b/run-caffluxsyst/install_caffluxsyst.sh @@ -19,10 +19,20 @@ mkdir install cd install . /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh -setup duneanaobj v04_01_00 -q "e20:prof" setup cmake v3_27_4 -git clone --depth 1 --branch v0.9.0 https://github.com/DUNE/duneanafluxtools.git +# TODO: switch back to the v0.9.0 tag (or a newer release tag) once +# https://github.com/DUNE/duneanafluxtools/pull/new/feature/abooth-add_duneanaobj_setup +# is merged upstream. For now use the feature branch that adds the +# 'setup duneanaobj' call to the generated setup.duneanafluxtools.sh. +git clone --depth 1 --branch feature/abooth-add_duneanaobj_setup https://github.com/DUNE/duneanafluxtools.git + +# The duneanaobj version is defined by duneanafluxtools itself (its +# DUNE_ANAOBJ_BRANCH CMake default), not by ND_Production. Read it out so we +# don't have to duplicate/hardcode the version here. +duneanaobj_version=$(sed -n 's/^\s*set(DUNE_ANAOBJ_BRANCH \(.*\))/\1/p' duneanafluxtools/CMakeLists.txt) +setup duneanaobj "$duneanaobj_version" -q "e20:prof" + mkdir duneanafluxtools/build cd duneanafluxtools/build diff --git a/run-caffluxsyst/run_caffluxsyst.sh b/run-caffluxsyst/run_caffluxsyst.sh index d15ab19..08b0cf5 100755 --- a/run-caffluxsyst/run_caffluxsyst.sh +++ b/run-caffluxsyst/run_caffluxsyst.sh @@ -7,7 +7,6 @@ source ../util/reload_in_container.inc.sh # Setup environment. setup() { . /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh - setup duneanaobj v04_01_00 -q "e20:prof" source "${PWD}"/install/duneanafluxtools/build/bin/setup.duneanafluxtools.sh } From 39feaef60516358cf277ae5670f002ad9e488394 Mon Sep 17 00:00:00 2001 From: Alexander Booth Date: Fri, 21 Aug 2026 18:09:50 +0100 Subject: [PATCH 3/3] Revert to cloning the main branch of duneanafluxtools now that everything has been tested --- run-caffluxsyst/install_caffluxsyst.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/run-caffluxsyst/install_caffluxsyst.sh b/run-caffluxsyst/install_caffluxsyst.sh index d2a9db6..8aaf6bf 100755 --- a/run-caffluxsyst/install_caffluxsyst.sh +++ b/run-caffluxsyst/install_caffluxsyst.sh @@ -21,11 +21,8 @@ cd install . /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh setup cmake v3_27_4 -# TODO: switch back to the v0.9.0 tag (or a newer release tag) once -# https://github.com/DUNE/duneanafluxtools/pull/new/feature/abooth-add_duneanaobj_setup -# is merged upstream. For now use the feature branch that adds the -# 'setup duneanaobj' call to the generated setup.duneanafluxtools.sh. -git clone --depth 1 --branch feature/abooth-add_duneanaobj_setup https://github.com/DUNE/duneanafluxtools.git +# Should maybe checkout a tag here the first time we run real production. +git clone https://github.com/DUNE/duneanafluxtools.git # The duneanaobj version is defined by duneanafluxtools itself (its # DUNE_ANAOBJ_BRANCH CMake default), not by ND_Production. Read it out so we