-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathntuple.jobscript
More file actions
63 lines (47 loc) · 1.71 KB
/
ntuple.jobscript
File metadata and controls
63 lines (47 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
:<<'EOF'
Use this jobscript with justIN to create ntuples from files:
justin quick-request \
--mql "YOUR_MQL_EXPRESSION" \
--jobscript ntuple.jobscript --max-distance 100 --rss-mb 4000 \
--scope usertests \
--output-pattern 'duneana_ntuple.*.root:output-test-01' \
--output-pattern 'duneana_ntuple.*.log:output-test-01'
The root ntuple file and the lar log file is put into Rucio managed storage
AT THE MOMENT, NO METADATA IS GENERATED BY THIS JOBSCRIPT AND ONLY THE DEFAULT
JOB METADATA CREATED BY justIN WILL BE PUT INTO MetaCat FOR THESE FILES!
The following optional environment variables can be set when creating the
workflow/stage: FCLFILE, NEVENTS, OUTPREFIX, DUNE_VERSION, DUNE_QUALIFIER
For example, add this line to the justin quick-request command to limit the
processing to 10 events per file:
--env NEVENTS=10
EOF
echo "Will setup"
#Setup general dune software
source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh
#Setup recent lar software suite
setup dunesw \
"${DUNE_VERSION:-v09_79_00d00}" \
-q "${DUNE_QUALIFIER:-e26:prof}"
echo "Will use justin-get-file"
FILE=`$JUSTIN_PATH/justin-get-file | cut -f2 -d' '`
now=$(date -u +"%Y-%m-%dT_%H%M%SZ")
OUTFILE="${OUTPREFIX:-duneana_ntuple}.${JUSTIN_REQUEST_ID}"
OUTFILE="$OUTFILE.$JUSTIN_JOBSUB_ID.${now}"
lar -c "${FCLFILE:-pduneana_Prod4a_MC_sce.fcl}" \
-T "$OUTFILE.root" \
-n "${NEVENTS:--1}" \
"$FILE" >$OUTFILE.log 2>&1
larExit=$?
echo "lar exit code $larExit"
if [ $larExit -eq 0 ] ; then
# Success !
echo "$FILE" > justin-processed-pfns.txt
jobscriptExit=0
else
# Oh :(
jobscriptExit=1
fi
# Put last 100 lines of lar log into the HTCondor and Jobscript logs
tail -100 $OUTFILE.log
exit $jobscriptExit