3
# Stick a banner on top of the event file and update iseed
5
# Usage: put_banner event_file
7
# First we need to get into the main directory
9
if [[ ! -d ./bin ]]; then
11
if [[ ! -d ./bin ]]; then
12
echo "Error: put_banner be executed from the main, or bin directory"
16
if [[ "$1" == "" ]]; then
17
echo 'Enter file with events (in directory Events)'
23
if [[ "$2" == "" ]]; then
24
echo 'Enter random seed for the run'
31
if [[ -d Events ]]; then
33
# Put all the info in a long banner
35
# $B$ begin_banner $B$ !this is a tag for MadWeight. Don't edit this line
36
cat ../Source/banner_header.txt >& b.txt
37
# $E$ begin_banner $E$ !this is a tag for MadWeight. Don't edit this line
38
# Now the version information
40
mgme=`awk '/.*/{print $1}' ../MGMEVersion.txt`
41
# $B$version_info$E$ ! Tag for add info in MW_version. Don't edit this line
42
echo "<MGVersion>">& version.txt
43
echo "# MG version : $mgme" >>version.txt
44
if [[ -e ../Source/MODEL/ModelVersion.txt ]];then
45
model=`awk '/.*/{print $1}' ../Source/MODEL/ModelVersion.txt`
46
echo "# model version : $model" >>version.txt
48
# $B$ write_version $E$ ! Tag for add info in MW_version. Don't edit this line
49
echo "</MGVersion>" >> version.txt
50
cat version.txt >> b.txt
53
if [[ -e "../SubProcesses/procdef_mg5.dat" ]];then
54
echo "<MG5ProcCard>" >>b.txt
55
cat ../Cards/proc_card_mg5.dat >> b.txt
56
echo "</MG5ProcCard>" >>b.txt
57
echo "<MGProcCard>" >>b.txt
58
cat ../SubProcesses/procdef_mg5.dat >> b.txt
59
echo "</MGProcCard>" >>b.txt
61
echo "<MGProcCard>" >>b.txt
62
cat ../Cards/proc_card.dat >> b.txt
63
echo "</MGProcCard>" >>b.txt
65
# $B$ param_card $B$ ! Tag for add info in MW_version. Don't edit this line
68
cp ../Cards/param_card.dat param_card_temp.dat
69
# ../bin/qnumbers.pl ../Source/MODEL/particles.dat param_card_temp.dat
70
cat param_card_temp.dat >> b.txt
71
rm param_card_temp.dat
73
# $E$ param_card $E$ ! Tag for add info in MW_version. Don't edit this line
75
echo "<MGRunCard>">>b.txt
76
cat ../Cards/run_card.dat >> b.txt
77
echo "</MGRunCard>">>b.txt
79
b=`awk '/^[^#].*=.*gridpack/{print $1}' ../Cards/run_card.dat`
80
if [[ $b == ".true." ]]; then
81
echo "<MGGridCard>">>b.txt
82
cat ../Cards/grid_card.dat >> b.txt
83
echo "</MGGridCard>">>b.txt
85
# $B$ other_card $E$ ! Tag for add info in MW_version. Don't edit this line
86
# $B$ end_file $B$ ! Tag for add info in MW_version. Don't edit this line
88
# sed -e "s/^/#/g" b.txt > bb.txt
90
#now update the random seed
91
if [[ $r -eq 0 && -e ../SubProcesses/randinit ]]; then
92
source ../SubProcesses/randinit
96
# echo '<LesHouchesEvents version="1.0">' >& banner.txt
97
# echo '<!---' >> banner.txt
98
sed -e "s/[\t ]0.*iseed/ $r = iseed/g" b.txt >& banner.txt
100
#now copy things over
103
echo '</LesHouchesEvents>' >> banner.txt
104
sed -e '/^ *$/d' banner.txt > $c
109
echo 'Error Events directory not found'
112
# $E$ end_file $E$ ! Tag for add info in MW_version. Don't edit this line