-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathntuple_script.sh
executable file
·77 lines (68 loc) · 1.26 KB
/
ntuple_script.sh
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
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
#POSITIONAL_ARGS=()
NEVENTS=-1
OUTFILE="pduneana_ntuple.root"
while [[ $# -gt 0 ]]; do
case $1 in
-c)
FCLFILE="$2"
shift # past argument
shift # past value
;;
#-s|--searchpath)
# SEARCHPATH="$2"
# shift # past argument
# shift # past value
# ;;
--samweb)
DOSAMWEB="1"
shift # past argument
;;
-n|--nevents)
NEVENTS="$2"
shift
shift
;;
-o)
OUTFILE="$2"
shift
shift
;;
--nosetup)
NOSETUP=YES
shift # past argument
;;
--dry_run)
DRYRUN=1
shift
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
FILE="$1" # save positional arg
break
;;
esac
done
if [ -z $NOSETUP ]; then
echo "Will setup"
#Setup general dune software
source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh
#Setup recent lar software suite
setup dunesw v09_79_00d00 -q e26:prof
else
echo "Will not setup"
fi
if [ -z ${DOSAMWEB+x} ]; then
echo "Will not samweb"
else
echo "Will samweb"
FILE=$(samweb2xrootd ${FILE})
fi
if [ -z ${DRYRUN+x} ]; then
lar -c $FCLFILE -T $OUTFILE -n $NEVENTS $FILE
else
echo lar -c $FCLFILE -T $OUTFILE -n $NEVENTS $FILE
fi