3
echo '****************************************************'
4
echo 'This script runs a amcatnlo process'
5
echo '****************************************************'
7
# find the correct directory
8
if [[ ! -d ./SubProcesses ]]; then
10
if [[ ! -d ./SubProcesses ]]; then
11
echo "Error: run_amcatnlo.sh must be executed from the main, or bin directory"
22
if [[ $run_mode == "" ]] ; then
23
echo 'Enter run mode (F, V or B)'
26
if [[ -e! madinMMC_$run_mode.2 ]] ; then
27
echo 'Cannot read the inputs. File not found: madinMMC_'$run_mode'.2'
31
if [[ $use_preset == "" ]] ; then
32
echo "Enter presets used for integration grids (none, F, B or V)"
33
echo " [Default is 'none']"
36
if [[ $use_preset == "none" ]] ; then
40
echo "Using preset:" $use_preset
43
if [[ $run_cluster == "" ]] ; then
44
echo "Local run (0), cluster running (1) or ganga (2)?"
45
# echo "Cluster running needs a configured condor batching system"
48
if [[ $run_cluster == 0 ]] ; then
49
echo "Running locally"
50
elif [[ $run_cluster == 1 ]] ; then
51
echo "submitting jobs to cluster"
52
elif [[ $run_cluster == 2 ]] ; then
53
echo "using ganga to submit jobs"
55
echo "ERROR" $run_cluster
60
#---------------------------
61
# Update random number seed
62
cd $Maindir/SubProcesses/
64
if [[ -e randinit ]]; then
70
echo "r=$r" >& randinit
81
if [[ -e madevent_mintMC ]]; then
83
if [[ $run_cluster == 1 ]] ; then
84
for job in mg*.cmd ; do
85
sed -i "7s/.*/Arguments = $vegas_mint $run_mode $use_preset/" $job
88
elif [[ $run_cluster == 0 ]] ; then
89
echo "Doing "$run_mode"-events in this dir"
91
./$job $vegas_mint $run_mode $use_preset
95
echo 'madevent_mintMC does not exist. Skipping directory'
106
echo "Execute ./SubProcesses/combine_results.sh to collect results and"
107
echo "compute how many events are needed per channel."
109
echo "./SubProcesses/combine_results.sh i n G"$run_mode"*"
111
echo "where 'i' is 0 after grid setting and '1' after integration and"
112
echo "'n' is the total number of unweigted events you want."
113
echo "Update madinMMC_"$run_mode".2 before before"
114
echo "executing the next integration or event generation step."