3
# This runs survey,refine,unweight_events, one after the other
5
# First we need to get into the main directory
8
# Usage: generate_events compression events parallel [name]
11
if [[ ! -d ./bin ]]; then
13
if [[ ! -d ./bin ]]; then
14
echo "Error: it must be executed from the main, or bin directory"
19
# Now let shell know where to find important executables
23
pydir=$main/../pythia-pgs/src
25
ERAdir=$main/../ExRootAnalysis
32
#if ( "$1" == "" ) then
33
# echo 'Number of unweighted events. This is ingnored and read from run_card.dat '
38
if [[ "$1" == "" ]]; then
39
echo 'Enter 1 for parallel 0 for serial run'
45
if [[ $p -gt 0 ]]; then
46
if [[ "$2" == "" ]]; then
47
echo 'Enter name for jobs on pbs queue'
52
if [[ "$3" == "" ]]; then
59
if [[ "$2" == "" ]]; then
67
if [[ ${#argv} -gt 3 ]]; then
69
webbin="$MADGRAPH_BASE/MG_ME/WebBin"
70
pydir="$webbin/pythia-pgs"
72
ERAdir="$MADGRAPH_BASE/MG_ME/ExRootAnalysis"
77
a=`awk '/^[^#].*=.*nevents/{print $1}' Cards/run_card.dat`
78
echo Generating $a events
80
# Check if run already exists. If so, store run w/ new name
81
# and remove old run before starting.
84
if [[ -e status ]]; then
87
if [[ -e error ]]; then
91
echo "Cleaning directories" > status
92
$dirbin/gen_crossxhtml-pl $t
95
echo "Starting jobs" > status
96
$dirbin/gen_crossxhtml-pl $t
97
$dirbin/survey $p $n $t
98
if [[ -e error ]]; then
104
$dirbin/gen_crossxhtml-pl $t
105
$dirbin/gen_cardhtml-pl
109
# Now collect the events - just to get the banner in fact
111
echo "Combining Events" >& status
112
echo "Combining Events"
113
$dirbin/gen_crossxhtml-pl $t
114
pushd ./Source > /dev/null
115
make ../bin/combine_events
117
pushd SubProcesses > /dev/null
118
$dirbin/run_combine $p
119
mv events.lhe ../Events/
120
mv unweighted_events.lhe ../Events/
126
echo "putting the banner"
127
$dirbin/put_banner events.lhe
128
$dirbin/put_banner unweighted_events.lhe
133
echo "Storing Events" >& status
134
$dirbin/gen_crossxhtml-pl $t
138
$dirbin/gen_crossxhtml-pl $t
139
$dirbin/gen_cardhtml-pl