3
# After a survey has been run and created results.dat to determine
4
# which channels in each process are important, this routine can
5
# run to give an accurate integration of the cross section.
7
# Usage: integrate accuracy parallel [name]
10
# First we need to get into the main directory
12
if [[ ! -d ./bin ]]; then
14
if [[ ! -d ./bin ]]; then
15
echo "refine must be executed from the main, or bin directory"
20
# Now let shell know where to find important executables
23
dirbin=$main/bin/internal
24
# Begin Local versions
25
# set dirbin = /home/tstelzer/bin/MG_ME
29
if [[ "$1" == "" ]]; then
30
echo 'Desired accuracy (< 1), or number of unweighted events (>1)'
35
if [[ "$2" == "" ]]; then
36
echo 'Enter 1 for parallel 0 for serial run'
42
if [[ $p -gt 0 ]]; then
43
if [[ "$3" == "" ]]; then
44
echo 'Enter name for jobs on pbs queue'
49
if [[ $# -gt 3 ]]; then
53
#if [[ -d Source ]]; then
54
# echo "Compiling Libraries" >& status
56
# make ../bin/sum_html >& /dev/null
57
# make ../bin/gen_ximprove >&/dev/null
58
# make all >& /dev/null
61
# echo 'Error Source directory not found'
64
if [[ -d SubProcesses ]]; then
65
if [[ $p -gt 0 ]]; then
66
echo "Creating Jobs" >& status
72
if [[ -e randinit ]]; then
75
# echo "Using random number seed offset = " $r
76
for i in `cat subproc.mg` ; do
79
# rm -f ajob* >& /dev/null
80
# rm -f wait.ajob* >& /dev/null
81
# rm -f run.ajob* >& /dev/null
82
# rm -f done.ajob* >& /dev/null
83
echo $a $np F | ../../bin/internal/gen_ximprove >& gen_ximprove.log
85
if [[ -e ajob1 ]]; then
86
# make madevent > /dev/null
90
if [[ $p == 1 ]]; then
91
$qsub -N $n $j>> ../../running_jobs
94
../../bin/internal/sum_html >/dev/null
100
if [[ $p == 0 ]]; then
101
../bin/internal/sum_html
104
# echo "r=" $r >& randinit
106
echo "Error unable to find SubProcesses directory"
109
if [[ $p == 1 ]]; then
113
echo "Combining runs" >& ../status
114
../bin/internal/sumall
116
$dirbin/gen_crossxhtml-pl $5