3
# First get to main level directory for this process
6
if [[ ! -d ./bin || ! -d ./SubProcesses ]]; then
8
if [[ ! -d ./bin || ! -d ./SubProcesses ]]; then
9
echo "Error: store must be executed from the main, or bin directory"
14
# Check that mg5 exists
17
if [[ ! -x $mgdir/mg5 ]]; then
18
mgdir=$main/../madgraph5/bin
20
if [[ ! -x $mgdir/mg5 ]]; then
21
echo "Error no mg5 executable $mgdir/mg5 found"
28
# Local versions to work on the cluster
30
while [[ "$1" != "" ]]; do
31
if [[ "$1" == "--web" ]]; then
32
mgdir=$MADGRAPH_BASE/MG_ME/mg5
33
dirbin=$MADGRAPH_BASE/MG_ME/WebBin
39
# some external executable
40
gen_card=$dirbin/gen_cardhtml-pl
41
gen_info=$dirbin/gen_infohtml-pl
43
# Check if we have to use MG4 proc_card.dat or MG5 proc_card.dat
44
if [[ -e ./Cards/proc_card_mg5.dat ]]; then
45
if [[ -e ./Cards/proc_card.dat ]]; then
46
if [[ $tag != '--web' ]]; then
47
echo "both mg4 and mg5 proc_card.dat are detected. Which one do you want to use? [4/5]"
55
elif [[ -e ./Cards/proc_card.dat ]]; then
58
echo "neither proc_card.dat or proc_card_mg5.dat"
59
echo "are present in directory Cards"
60
echo "Prepare a card (see examples on the web) and"
66
rm proc_log.txt >& /dev/null
67
echo "Started `date`" > ./proc_log.txt
70
$gen_card >& /dev/null
72
# launch the mg5 program
73
if [[ $card_use == '4' ]]; then
74
# Run ./mg5 with stderr going to both the file proc_log.txt and to terminal
75
# output. See http://acs.lbl.gov/~ksb/Scratch/sh_redir_pipe.html
76
((echo import proc_v4 ./Cards/proc_card.dat | $mgdir/mg5 3>&1 1>&2 2>&3) | tee /dev/tty) >> proc_log.txt 2>&1
78
elif [[ $card_use == '5' ]]; then
79
# Run ./mg5 with stderr going to both the file proc_log.txt and to terminal
80
# output. See http://acs.lbl.gov/~ksb/Scratch/sh_redir_pipe.html
81
(($mgdir/mg5 ./Cards/proc_card_mg5.dat 3>&1 1>&2 2>&3) | tee /dev/tty) >> proc_log.txt 2>&1
83
echo 'not recognized mode'
86
echo "Finished `date` " >> ./proc_log.txt
87
echo "`date` " >& ./CREATED
92
if [[ $tag == "--web" ]]; then
97
$gen_card >& /dev/null