~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to Template/LO/SubProcesses/refine.sh

  • Committer: olivier Mattelaer
  • Date: 2015-03-05 00:14:16 UTC
  • mfrom: (258.1.9 2.3)
  • mto: (258.8.1 2.3)
  • mto: This revision was merged to the branch mainline in revision 259.
  • Revision ID: olivier.mattelaer@uclouvain.be-20150305001416-y9mzeykfzwnl9t0j
partial merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
if [[ -e MadLoop5_resources.tar && ! -e MadLoop5_resources ]]; then
 
4
tar -xf MadLoop5_resources.tar
 
5
fi
 
6
k=%(name)s_app.log
 
7
script=%(script_name)s                         
 
8
 
 
9
grid_directory=%(base_directory)s
 
10
j=%(directory)s
 
11
     if [[ ! -e $j ]]; then
 
12
          mkdir $j
 
13
          if [[ -e $grid_directory/ftn26 ]];then
 
14
             cp $grid_directory/ftn26 $j/ftn25
 
15
          fi 
 
16
          if [[ ! -e ../../SubProcesses ]];then
 
17
                 if [[ -e ftn26 ]]; then
 
18
                        cp ./ftn26 $j/ftn25
 
19
                 fi
 
20
          fi    
 
21
     fi
 
22
     
 
23
     cd $j
 
24
     rm -f $k
 
25
     rm -f moffset.dat >& /dev/null
 
26
      echo   %(offset)s  > moffset.dat
 
27
     if  [[ -e ftn26 ]]; then
 
28
          cp ftn26 ftn25
 
29
     fi
 
30
     # create the input file
 
31
         echo "    %(nevents)s       %(maxiter)s       %(miniter)s" >& input_sg.txt
 
32
         echo "    %(precision)s" >> input_sg.txt
 
33
     if [[ ! -e ftn25 ]]; then
 
34
         echo "2" >> input_sg.txt   # grid refinement
 
35
         echo "1" >> input_sg.txt   # suppress amplitude
 
36
 
 
37
     else
 
38
         echo "%(grid_refinment)s" >> input_sg.txt
 
39
         echo "1" >> input_sg.txt
 
40
     fi
 
41
     echo "%(nhel)s" >> input_sg.txt
 
42
     echo "%(channel)s" >> input_sg.txt
 
43
 
 
44
     # run the executable. The loop is design to avoid
 
45
     # filesystem problem (executable not found)
 
46
     for((try=1;try<=16;try+=1)); 
 
47
     do
 
48
         ../madevent >> $k <input_sg.txt
 
49
         if [ -s $k ]
 
50
         then
 
51
             break
 
52
         else
 
53
             echo $try > fail.log 
 
54
         fi
 
55
     done
 
56
     echo "" >> $k; echo "ls status:" >> $k; ls >> $k
 
57
     cat $k >> log.txt
 
58
     
 
59
     if [[ -e ftn26 ]]; then
 
60
         cp ftn26 ftn25
 
61
     fi
 
62
     cd ../
 
63