3
if [[ ! -d ./bin ]]; then
5
if [[ ! -d ./bin ]]; then
6
echo "Error: it must be executed from the main, or bin directory"
15
ERAdir=$main/../ExRootAnalysis
16
MAdir=$main/../MadAnalysis
25
if [[ "$4" == "" ]]; then
26
echo 'Enter 1 for parallel 0 for serial run'
28
if [[ $p -gt 0 ]]; then
29
echo 'Enter name for jobs on pbs queue'
34
echo 'Enter number of wanted runs'
39
if [[ $p == 0 ]]; then
44
if [[ $# -gt 5 ]]; then
46
ERAdir="$MADGRAPH_BASE/MG_ME/ExRootAnalysis"
47
MAdir="$MADGRAPH_BASE/MG_ME/MadAnalysis"
48
td="$MADGRAPH_BASE/MG_ME/td"
52
#$dirbin/generate_events $p $n $t\_1 $add
53
#cp -p $main/Events/$t\_1\_unweighted_events\.lhe\.gz $main/Events/$t\_unweighted_events\.lhe\.gz
54
#cp -p $main/Events/$t\_1\_banner.txt $main/Events/$t\_banner.txt
57
while [[ $i -le $nrun ]]; do
58
echo "Running generate_events for run ${t}_$i (see ${t}_$i.log)"
59
$dirbin/generate_events $p $n $t\_$i $add >& $t\_$i.log
60
# $dirbin/merge.pl $main/Events/$t\_unweighted_events\.lhe\.gz $main/Events/$t\_$i\_unweighted_events\.lhe\.gz $main/Events/$t\_unweighted_events\.lhe\.gz $main/Events/$t\_banner.txt
64
#set allfiles = `ls $main/Events/$t\_\*\_unweighted_events\.lhe\.gz`
67
echo "Merging LHE files"
68
echo "Merging LHE files" >& ../status
69
$dirbin/merge.pl $main/Events/$t\_*\_unweighted_events\.lhe\.gz $main/Events/$t\_unweighted_events\.lhe\.gz $main/Events/$t\_banner.txt
71
$dirbin/gen_crossxhtml-pl $t
74
# Create root file and plots
79
if [[ (-e $t\_unweighted_events.lhe.gz) ]]; then
80
gunzip $t\_unweighted_events.lhe.gz
83
if [[ (-x $ERAdir/ExRootLHEFConverter) && (-e $t\_unweighted_events.lhe) ]]; then
84
echo "Creating Root File"
85
echo "Creating Root File" >& ../status
86
$dirbin/gen_crossxhtml-pl $t
87
$ERAdir/ExRootLHEFConverter $t\_unweighted_events.lhe $t\_unweighted_events.root
90
#if [[ (-x $ERAdir/ExRootMain) && (-e $t\_unweighted_events.root) && (-e ../Cards/plot_card.dat) ]]; then
91
# echo "Creating Root Plots" >& ../status
92
# $dirbin/gen_crossxhtml-pl
95
# echo "../$t""_unweighted_events.root" > events.list
96
# $dirbin/plot $ERAdir > plot.log
98
# $dirbin/plot_page-pl $t
99
# mv plots.html $t\_plots.html
100
# $dirbin/gen_crossxhtml-pl
103
if [[ (-x $MAdir/plot_events) && (-e $t\_unweighted_events.lhe) && (-e ../Cards/plot_card.dat) ]]; then
104
echo "Creating Plots"
105
echo "Creating Plots" >& ../status
106
$dirbin/gen_crossxhtml-pl $t
109
echo "../${t}_unweighted_events.lhe" > events.list
110
$dirbin/plot $MAdir $td > plot.log
112
$dirbin/plot_page-pl $t
113
mv plots.html ${t}_plots.html
116
if [[ -e $t\_unweighted_events.lhe ]]; then
117
gzip $t\_unweighted_events.lhe
124
$dirbin/gen_crossxhtml-pl