~chirality-flow/chiralityflow/ChiralityFlowMG

« back to all changes in this revision

Viewing changes to Template/NLO/MCatNLO/shower_template.sh

  • Committer: andrew.lifson at lu
  • Date: 2021-09-02 13:57:34 UTC
  • Revision ID: andrew.lifson@thep.lu.se-20210902135734-4eybgli0iljkax9b
added fresh copy of MG5_aMC_v3.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
SHOWER=$1
 
4
#HEP-> hepmc/stdhep
 
5
#TOP-> top
 
6
OUTPUT=$2
 
7
RUN_NAME=$3
 
8
NFILE=$4
 
9
 
 
10
export %(ld_library_path)s=$%(ld_library_path)s:%(extralibs)s
 
11
 
 
12
if [ $SHOWER == "HERWIGPP" ] ; then
 
13
    export PYTHIA8DATA=""
 
14
else
 
15
    export PYTHIA8DATA=`pwd`/xmldoc
 
16
fi
 
17
 
 
18
# if one is splitting file cd to a new dir and link all files here
 
19
if [[ "$NFILE" != "" ]]; then
 
20
    mkdir run_$NFILE
 
21
    cd run_$NFILE
 
22
    cp -H ../events_$NFILE.lhe events.lhe
 
23
    if [ $SHOWER == "PYTHIA8" ] ; then
 
24
        cp ../Pythia8.exe ../Pythia8.cmd .
 
25
        if [ -f ../config.sh ] ; then cp ../config.sh . ; fi
 
26
    else
 
27
        if [ $SHOWER == "HERWIGPP" ] ; then
 
28
            cp ../Herwig* ../HepMCFortran.so .
 
29
        fi
 
30
        cp ../MCATNLO_$SHOWER\_EXE ../MCATNLO_$SHOWER\_input .
 
31
    fi
 
32
fi
 
33
 
 
34
if [ -e events.lhe.gz ] ; then
 
35
    gunzip $RUN_NAME/events.lhe.gz
 
36
fi
 
37
 
 
38
if [ "$SHOWER" == "HERWIG6" ] || [ "$SHOWER" == "PYTHIA6Q" ] || [ "$SHOWER" == "PYTHIA6PT" ] || [ "$SHOWER" == "HERWIGPP" ] ; then
 
39
    ./MCATNLO_$SHOWER\_EXE < MCATNLO_$SHOWER\_input > mcatnlo_run.log 2>&1
 
40
 
 
41
elif [ "$SHOWER" == "PYTHIA8" ] ; then
 
42
    if [ -f config.sh ] ; then source config.sh ; fi
 
43
    ./Pythia8.exe Pythia8.cmd > mcatnlo_run.log 2>&1
 
44
fi
 
45
 
 
46
if [ "$OUTPUT" == "HEP" ] ; then
 
47
    # hep or hepmc output
 
48
    # this is for the final filename
 
49
    if [[ "$NFILE" != "" ]]; then
 
50
        NAME="../events_$NFILE"
 
51
    else
 
52
        NAME="events"
 
53
    fi
 
54
    # at the end a file called events.hep.gz or events.hepmc.gz will be delivered
 
55
    if [ "$SHOWER" == "HERWIG6" ] || [ "$SHOWER" == "PYTHIA6Q" ] || [ "$SHOWER" == "PYTHIA6PT" ] ; then
 
56
        mv events.lhe.hep $NAME.hep
 
57
        gzip $NAME.hep
 
58
    elif [ "$SHOWER" == "HERWIGPP" ] ; then
 
59
        mv MCATNLO_HERWIGPP.hepmc $NAME.hepmc
 
60
        gzip $NAME.hepmc
 
61
    elif [ "$SHOWER" == "PYTHIA8" ] ; then
 
62
        mv Pythia8.hep $NAME.hepmc
 
63
        gzip $NAME.hepmc
 
64
    fi
 
65
 
 
66
elif [ "$OUTPUT" == "TOP" ] || [ "$OUTPUT" == "HWU" ]; then
 
67
    #top output 
 
68
    # this is for the final filename
 
69
    if [[ "$NFILE" != "" ]]; then
 
70
        NAME="../histfile_$NFILE"
 
71
    else
 
72
        NAME="histfile"
 
73
    fi
 
74
    # just tar all the topfiles which are found
 
75
    tar -cf $NAME.tar *.top *.TOP *.HwU *.hwu *.HWU > tarlog.txt 2>&1
 
76
fi
 
77
 
 
78
if [[ "$NFILE" != "" ]]; then
 
79
    mv mcatnlo_run.log ../mcatnlo_run_$NFILE.log
 
80
fi