Merge lp:~maddevelopers/mg5amcnlo/1.4.3 into lp:mg5amcnlo/lts

Proposed by Olivier Mattelaer
Status: Merged
Merged at revision: 181
Proposed branch: lp:~maddevelopers/mg5amcnlo/1.4.3
Merge into: lp:mg5amcnlo/lts
Diff against target: 6927 lines (+2048/-1954)
74 files modified
Template/Source/banner.f (+0/-120)
Template/Source/gen_ximprove.f (+28/-31)
Template/Source/make_opts (+1/-1)
Template/Source/maxconfigs.inc (+0/-2)
Template/Source/maxparticles.inc (+0/-2)
Template/Source/sum.f (+0/-55)
Template/Source/sum_html.f (+0/-775)
Template/SubProcesses/setcuts.f (+11/-5)
Template/bin/generate_events (+17/-15)
Template/bin/internal/compile_Source (+1/-1)
Template/bin/internal/gen_jpeg-pl (+1/-1)
Template/bin/internal/sumall (+0/-29)
UpdateNotes.txt (+83/-45)
aloha/aloha_object.py (+1/-1)
aloha/aloha_writers.py (+123/-44)
aloha/create_aloha.py (+22/-14)
aloha/template_files/aloha_functions.f (+2/-2)
aloha/template_files/oxxxxx.cc (+4/-4)
aloha/template_files/wavefunctions.py (+2/-2)
bin/create_aloha_release.py (+1/-1)
bin/create_release.py (+5/-5)
madgraph/VERSION (+2/-2)
madgraph/core/base_objects.py (+28/-5)
madgraph/core/diagram_generation.py (+21/-3)
madgraph/interface/Loop_interface.py (+0/-49)
madgraph/interface/coloring_logging.py (+2/-2)
madgraph/interface/extended_cmd.py (+196/-67)
madgraph/interface/launch_ext_program.py (+4/-1)
madgraph/interface/madevent_interface.py (+176/-142)
madgraph/interface/madgraph_interface.py (+126/-133)
madgraph/interface/master_interface.py (+13/-9)
madgraph/iolibs/export_cpp.py (+2/-1)
madgraph/iolibs/export_python.py (+2/-1)
madgraph/iolibs/export_v4.py (+8/-30)
madgraph/iolibs/group_subprocs.py (+2/-1)
madgraph/iolibs/import_v4.py (+2/-4)
madgraph/iolibs/template_files/madevent_combine_events.f (+1/-3)
madgraph/iolibs/template_files/madevent_makefile_source (+1/-5)
madgraph/iolibs/template_files/madevent_symmetry.f (+8/-5)
madgraph/iolibs/template_files/madevent_write_banner.f (+0/-116)
madgraph/various/banner.py (+11/-2)
madgraph/various/cluster.py (+204/-9)
madgraph/various/diagram_symmetry.py (+1/-1)
madgraph/various/gen_crossxhtml.py (+10/-1)
madgraph/various/misc.py (+7/-6)
madgraph/various/process_checks.py (+2/-1)
madgraph/various/sum_html.py (+65/-45)
models/check_param_card.py (+5/-0)
models/heft/restrict_ckm.dat (+2/-0)
models/heft/restrict_default.dat (+2/-0)
models/heft/restrict_no_b_mass.dat (+2/-0)
models/heft/restrict_no_masses.dat (+2/-0)
models/heft/restrict_no_tau_mass.dat (+2/-0)
models/heft/restrict_zeromass_ckm.dat (+2/-0)
models/import_ufo.py (+11/-5)
models/model_reader.py (+24/-64)
tests/acceptance_tests/test_cmd.py (+48/-22)
tests/acceptance_tests/test_cmd_madevent.py (+73/-1)
tests/parallel_tests/compare_with_old_mg5_version.py (+38/-2)
tests/parallel_tests/madevent_comparator.py (+6/-5)
tests/parallel_tests/me_comparator.py (+5/-3)
tests/unit_tests/core/test_base_objects.py (+4/-0)
tests/unit_tests/core/test_diagram_generation.py (+77/-6)
tests/unit_tests/core/test_helas_objects.py (+4/-4)
tests/unit_tests/interface/test_madevent.py (+1/-1)
tests/unit_tests/iolibs/test_export_cpp.py (+3/-1)
tests/unit_tests/iolibs/test_export_python.py (+3/-1)
tests/unit_tests/iolibs/test_export_v4.py (+17/-2)
tests/unit_tests/iolibs/test_group_subprocs.py (+1/-1)
tests/unit_tests/iolibs/test_helas_call_writers.py (+1/-1)
tests/unit_tests/iolibs/test_misc.py (+1/-1)
tests/unit_tests/various/test_4fermion_models.py (+7/-3)
tests/unit_tests/various/test_aloha.py (+509/-30)
tests/unit_tests/various/test_model_reader.py (+2/-2)
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/1.4.3
Reviewer Review Type Date Requested Status
marco zaro Approve
Valentin Hirschi Approve
Review via email: mp+96685@code.launchpad.net

Description of the change

important change on the structure point of view:
- misc.py pass to various directory
- the extendedCmd class splits in Help/Check/Complete subclass (require for the web)

Otherwise include function added in 1.4.3

To post a comment you must log in.
lp:~maddevelopers/mg5amcnlo/1.4.3 updated
211. By mattelaer-olivier

fix a unit test

Revision history for this message
Valentin Hirschi (valentin-hirschi) wrote :

All test pass, and the structural change Olivier mentioned should not be a big deal.
So I approve the merge.

review: Approve
Revision history for this message
marco zaro (marco-zaro) wrote :
Download full text (27.3 KiB)

Hi,
I tried to merge this review with our fks5 branch.
after solving in a trivial way the conflicts (in the interfaces i had to replace self.configuration and self._options by self.options), i still have some tests which fail / give errors
(apart for "FAIL: Check that no help category are introduced by mistake." which is something to be fixed on our side with the new interfaces
many of them are related to the helas call writing/copmilations, so presumably they are related with the loop...
Thanks
Cheers

======================================================================
ERROR: Test the StandAlone output for different processes.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/tests/unit_tests/loop/test_loop_exporters.py", line 214, in test_LoopProcessExporterFortranSA_ddx_ddx
    self.check_output_sanity(myloopME)
  File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/tests/unit_tests/loop/test_loop_exporters.py", line 109, in check_output_sanity
    False,False)
  File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/madgraph/iolibs/export_v4.py", line 942, in finalize_v4_directory
    self.make()
  File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/madgraph/iolibs/export_v4.py", line 930, in make
    misc.compile(arg=['../lib/libdhelas.a'], cwd=source_dir, mode='fortran')
  File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/madgraph/various/misc.py", line 194, in compile
    raise MadGraph5Error, error_text
MadGraph5Error: A compilation Error occurs when trying to compile /Users/marcozaro/PhD/mg5/MADGRAPH-my/tests/unit_tests/loop/test_proc/Source.
The compilation fails with the following output message:
    cd DHELAS; make
    gfortran -O -w -ffixed-line-length-132 -c -o aloha_functions.o aloha_functions.f
    gfortran -O -w -ffixed-line-length-132 -c -o FFV1_0.o FFV1_0.f
    gfortran -O -w -ffixed-line-length-132 -c -o FFV1_3.o FFV1_3.f
    gfortran -O -w -ffixed-line-length-132 -c -o FFV1L_0.o FFV1L_0.f
    gfortran -O -w -ffixed-line-length-132 -c -o FFV1L_1.o FFV1L_1.f
    FFV1L_1.f:19.6:

          P1(0) = 1 F1(5)
          1
    Error: Unclassifiable statement at (1)
    FFV1L_1.f:20.6:

          P1(1) = 1 F1(6)
          1
    Error: Unclassifiable statement at (1)
    FFV1L_1.f:21.6:

          P1(2) = 1 F1(7)
          1
    Error: Unclassifiable statement at (1)
    FFV1L_1.f:22.6:

          P1(3) = 1 F1(8)
          1
    Error: Unclassifiable statement at (1)
    make[1]: *** [FFV1L_1.o] Error 1
    make: *** [../lib/libdhelas.a] Error 2

Please try to fix this compilations issue and retry.
Help might be found at https://answers.launchpad.net/madgraph5.
If you think that this is a bug, you can report this at https://bugs.launchpad.net/madgraph5

======================================================================
ERROR: Test the StandAlone output for different processes.
--------------------------------...

review: Needs Fixing
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :
Download full text (27.6 KiB)

Hi Marco,

I suggested that
you commit the merge that you perform (either in FKS either in a
separate branch).
And I'll fix this problem in that branch.

Nothing that I can really do in this branch about that.

Cheers,

Olivier
On Mar 9, 2012, at 3:23 AM, marco zaro wrote:

> Review: Needs Fixing
>
> Hi,
> I tried to merge this review with our fks5 branch.
> after solving in a trivial way the conflicts (in the interfaces i
> had to replace self.configuration and self._options by
> self.options), i still have some tests which fail / give errors
> (apart for "FAIL: Check that no help category are introduced by
> mistake." which is something to be fixed on our side with the new
> interfaces
> many of them are related to the helas call writing/copmilations, so
> presumably they are related with the loop...
> Thanks
> Cheers
>
>
> ======================================================================
> ERROR: Test the StandAlone output for different processes.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/tests/unit_tests/loop/
> test_loop_exporters.py", line 214, in
> test_LoopProcessExporterFortranSA_ddx_ddx
> self.check_output_sanity(myloopME)
> File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/tests/unit_tests/loop/
> test_loop_exporters.py", line 109, in check_output_sanity
> False,False)
> File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/madgraph/iolibs/
> export_v4.py", line 942, in finalize_v4_directory
> self.make()
> File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/madgraph/iolibs/
> export_v4.py", line 930, in make
> misc.compile(arg=['../lib/libdhelas.a'], cwd=source_dir,
> mode='fortran')
> File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/madgraph/various/
> misc.py", line 194, in compile
> raise MadGraph5Error, error_text
> MadGraph5Error: A compilation Error occurs when trying to compile /
> Users/marcozaro/PhD/mg5/MADGRAPH-my/tests/unit_tests/loop/test_proc/
> Source.
> The compilation fails with the following output message:
> cd DHELAS; make
> gfortran -O -w -ffixed-line-length-132 -c -o aloha_functions.o
> aloha_functions.f
> gfortran -O -w -ffixed-line-length-132 -c -o FFV1_0.o FFV1_0.f
> gfortran -O -w -ffixed-line-length-132 -c -o FFV1_3.o FFV1_3.f
> gfortran -O -w -ffixed-line-length-132 -c -o FFV1L_0.o FFV1L_0.f
> gfortran -O -w -ffixed-line-length-132 -c -o FFV1L_1.o FFV1L_1.f
> FFV1L_1.f:19.6:
>
> P1(0) = 1 F1(5)
> 1
> Error: Unclassifiable statement at (1)
> FFV1L_1.f:20.6:
>
> P1(1) = 1 F1(6)
> 1
> Error: Unclassifiable statement at (1)
> FFV1L_1.f:21.6:
>
> P1(2) = 1 F1(7)
> 1
> Error: Unclassifiable statement at (1)
> FFV1L_1.f:22.6:
>
> P1(3) = 1 F1(8)
> 1
> Error: Unclassifiable statement at (1)
> make[1]: *** [FFV1L_1.o] Error 1
> make: *** [../lib/libdhelas.a] Error 2
>
> Please try to fix this compilations issue and retry.
> Help might be found at https://answers.launchpad.net/madgraph5.
> If you think that this is a bug, you can report this at https://bugs.launch...

Revision history for this message
marco zaro (marco-zaro) wrote :
Download full text (28.3 KiB)

Hi Olivier,
here is the branch
~maddevelopers/madgraph5/FKS5-1.4.3
thank you
Cheers
Marco

On 09 Mar 2012, at 16:43, Olivier Mattelaer wrote:

> Hi Marco,
>
> I suggested that
> you commit the merge that you perform (either in FKS either in a
> separate branch).
> And I'll fix this problem in that branch.
>
> Nothing that I can really do in this branch about that.
>
> Cheers,
>
> Olivier
> On Mar 9, 2012, at 3:23 AM, marco zaro wrote:
>
>> Review: Needs Fixing
>>
>> Hi,
>> I tried to merge this review with our fks5 branch.
>> after solving in a trivial way the conflicts (in the interfaces i
>> had to replace self.configuration and self._options by
>> self.options), i still have some tests which fail / give errors
>> (apart for "FAIL: Check that no help category are introduced by
>> mistake." which is something to be fixed on our side with the new
>> interfaces
>> many of them are related to the helas call writing/copmilations, so
>> presumably they are related with the loop...
>> Thanks
>> Cheers
>>
>>
>> ======================================================================
>> ERROR: Test the StandAlone output for different processes.
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>> File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/tests/unit_tests/loop/
>> test_loop_exporters.py", line 214, in
>> test_LoopProcessExporterFortranSA_ddx_ddx
>> self.check_output_sanity(myloopME)
>> File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/tests/unit_tests/loop/
>> test_loop_exporters.py", line 109, in check_output_sanity
>> False,False)
>> File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/madgraph/iolibs/
>> export_v4.py", line 942, in finalize_v4_directory
>> self.make()
>> File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/madgraph/iolibs/
>> export_v4.py", line 930, in make
>> misc.compile(arg=['../lib/libdhelas.a'], cwd=source_dir,
>> mode='fortran')
>> File "/Users/marcozaro/PhD/mg5/MADGRAPH-my/madgraph/various/
>> misc.py", line 194, in compile
>> raise MadGraph5Error, error_text
>> MadGraph5Error: A compilation Error occurs when trying to compile /
>> Users/marcozaro/PhD/mg5/MADGRAPH-my/tests/unit_tests/loop/test_proc/
>> Source.
>> The compilation fails with the following output message:
>> cd DHELAS; make
>> gfortran -O -w -ffixed-line-length-132 -c -o aloha_functions.o
>> aloha_functions.f
>> gfortran -O -w -ffixed-line-length-132 -c -o FFV1_0.o FFV1_0.f
>> gfortran -O -w -ffixed-line-length-132 -c -o FFV1_3.o FFV1_3.f
>> gfortran -O -w -ffixed-line-length-132 -c -o FFV1L_0.o FFV1L_0.f
>> gfortran -O -w -ffixed-line-length-132 -c -o FFV1L_1.o FFV1L_1.f
>> FFV1L_1.f:19.6:
>>
>> P1(0) = 1 F1(5)
>> 1
>> Error: Unclassifiable statement at (1)
>> FFV1L_1.f:20.6:
>>
>> P1(1) = 1 F1(6)
>> 1
>> Error: Unclassifiable statement at (1)
>> FFV1L_1.f:21.6:
>>
>> P1(2) = 1 F1(7)
>> 1
>> Error: Unclassifiable statement at (1)
>> FFV1L_1.f:22.6:
>>
>> P1(3) = 1 F1(8)
>> 1
>> Error: Unclassifiable statement at (1)
>> make[1]: *** [FFV1L_1.o] Error 1
>> make: *** [../lib/libdhe...

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :
Download full text (35.4 KiB)

Hi Marco,

Ok all the test linked to ALOHA are fixed.
Three tests are still failing:

FAIL: test_representation
(tests.unit_tests.core.test_base_objects.ProcessDefinitionTest)
Test process object string representation.
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/Users/omatt/Documents/Eclipse/merge_143_infks5/tests/
unit_tests/core/test_base_objects.py", line 1700, in test_representation
     self.assertEqual(goal, str(self.my_process_definition))
AssertionError: "{\n 'legs': [{\n 'ids': [3, 4, 5],\n
'state': False\n}, {\n 'ids': [3, 4, 5],\n 'state': False\n},
{\n 'ids': [3, 4, 5],\n 'state': True\n}, {\n 'ids': [3, 4,
5],\n 'state': True\n}, {\n 'ids': [3, 4, 5],\n 'state': True
\n}],\n 'orders': {'QED': 1, 'QCD': 5},\n 'overall_orders': {},
\n 'squared_orders': {},\n 'model': {\n 'name': '',\n
'particles': [{\n 'name': 'c',\n 'antiname': 'c~',\n 'spin':
1,\n 'color': 1,\n 'charge': 1.00,\n 'mass': 'zero',\n
'width': 'zero',\n 'pdg_code': 3,\n 'texname': 'none',\n
'antitexname': 'none',\n 'line': 'dashed',\n 'propagating': True,
\n 'is_part': True,\n 'self_antipart': False,\n
'counterterm': {}\n}],\n 'parameters': None,\n 'interactions':
[],\n 'couplings': None,\n 'lorentz': None\n},\n 'id':
3,\n 'required_s_channels': [],\n 'forbidden_onsh_s_channels':
[],\n 'forbidden_s_channels': [],\n 'forbidden_particles': [],
\n 'is_decay_chain': False,\n 'decay_chains': [],\n
'perturbation_couplings': [],\n 'has_born': True\n}" != "{\n
'legs': [{\n 'ids': [3, 4, 5],\n 'state': False\n}, {\n
'ids': [3, 4, 5],\n 'state': False\n}, {\n 'ids': [3, 4, 5],
\n 'state': True\n}, {\n 'ids': [3, 4, 5],\n 'state': True
\n}, {\n 'ids': [3, 4, 5],\n 'state': True\n}],\n 'orders':
{'QED': 1, 'QCD': 5},\n 'overall_orders': {},\n
'squared_orders': {},\n 'model': {\n 'name': '',\n
'particles': [{\n 'name': 'c',\n 'antiname': 'c~',\n 'spin':
1,\n 'color': 1,\n 'charge': 1.00,\n 'mass': 'zero',\n
'width': 'zero',\n 'pdg_code': 3,\n 'texname': 'none',\n
'antitexname': 'none',\n 'line': 'dashed',\n 'propagating': True,
\n 'is_part': True,\n 'self_antipart': False,\n
'counterterm': {}\n}],\n 'parameters': None,\n 'interactions':
[],\n 'couplings': None,\n 'lorentz': None\n},\n 'id':
3,\n 'required_s_channels': [],\n 'forbidden_s_channels': [],
\n 'forbidden_particles': [],\n 'is_decay_chain': False,\n
'decay_chains': [],\n 'perturbation_couplings': [],\n
'has_born': True\n}"

======================================================================
FAIL: test_representation
(tests.unit_tests.core.test_base_objects.ProcessTest)
Test process object string representation.
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/Users/omatt/Documents/Eclipse/merge_143_infks5/tests/
unit_tests/core/test_base_objects.py", line 1...

Revision history for this message
marco zaro (marco-zaro) wrote :

fixed now

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed file 'Template/Cards/delphes_trigger.dat' => 'Template/Cards/delphes_trigger_default.dat'
2=== removed file 'Template/Source/banner.f'
3--- Template/Source/banner.f 2010-10-30 03:26:37 +0000
4+++ Template/Source/banner.f 1970-01-01 00:00:00 +0000
5@@ -1,120 +0,0 @@
6- subroutine create_banner(lunw, swgt, nw)
7- implicit none
8-c include 'nexternal.inc'
9-c
10-c parameters
11-c
12- integer MaxParticles
13- parameter (MaxParticles=15)
14-c
15-c Arguments
16-c
17- integer lunw, nw
18- double precision swgt(99999)
19-c
20-c Local
21-c
22- integer ic(7,MaxParticles),next, luni
23- double precision P(0:3,MaxParticles),wgt
24- real*8 sum,mxwgt
25- logical done
26- integer i,imax,j, nevent, nfound
27- character*35 infile,outfile
28- integer iseed
29- data iseed/9999/
30- character*30 process,QED,QCD
31-c--cuts
32-c double precision etmin(3:nexternal),etamax(3:nexternal)
33-c double precision r2min(3:nexternal,3:nexternal)
34-c double precision s_min(nexternal,nexternal)
35-c common/to_cuts/ etmin ,etamax , r2min, s_min
36-c
37-c open the Process/input.dat
38-c
39- luni = 67
40- infile='Process/input.dat'
41- i=0
42- done=.false.
43- do while (.not. done .and. i .lt. 5)
44-c write(*,*) 'Attempting to open file ',infile
45- open(unit=luni,file=infile,status='old',err=101)
46- done = .true.
47- 101 i = i+1
48- infile='../' // infile
49- enddo
50- if (done) then
51- read(luni,'(a30)') process
52- read(luni,'(a30)') QCD
53- read(luni,'(a30)') QED
54- close(luni)
55- else
56- process = '???? Process'
57- QCD = '???? QCD'
58- QED = '???? QED'
59- endif
60-
61-c call get_seed(iseed)
62-c
63-c All the info is gathered. Now start writing it out.
64-c
65-
66- call write_para(lunw)
67- write(lunw,'(a70)') '## '
68- write(lunw,'(a70)') '##=================== '
69- write(lunw,'(a70)') '## Run-time options '
70- write(lunw,'(a70)') '##=================== '
71- write(lunw,'(a70)') '## '
72- write(lunw,'(a70)') '##********************************************************************'
73- write(lunw,'(a70)') '## Random Number seed *'
74- write(lunw,'(a70)') '##********************************************************************'
75- write(lunw,'(a3,i8,a)') '## ',iseed,' = iseed'
76-c write(lunw,'(a70)') '##********************************************************************'
77-c write(lunw,'(a70)') '## Standard Cuts *'
78-c write(lunw,'(a70)') '##********************************************************************'
79-c write(lunw,'(a13,8i8)') '## Particle ',(i,i=3,nexternal)
80-c write(lunw,'(a13,8f8.1)') '## Et >',(etmin(i),i=3,nexternal)
81-c write(lunw,'(a13,8f8.1)') '## Eta <',(etamax(i),i=3,nexternal)
82-c do j=3,nexternal-1
83-c write(lunw,'(a,i2,a,8f8.1)') '## d R #',j,' >',(-0.0,i=3,j),
84-c & (r2min(i,j),i=j+1,nexternal)
85-c do i=j+1,nexternal
86-c r2min(i,j)=r2min(i,j)**2 !Since r2 returns distance squared
87-c enddo
88-c enddo
89-c do j=1,nexternal-1
90-c write(lunw,'(a,i2,a,8f8.1)') '## s min #',j,'>',
91-c & (s_min(i,j),i=3,nexternal)
92-c enddo
93-c write(lunw,'(a70)') '##********************************************************************'
94-c
95-c Now write out specific information on the event set
96-c
97- done=.false.
98- nevent=0
99- nfound=0
100- sum=0d0
101- mxwgt=-1d0
102- do i=1,nw
103- sum=sum+swgt(i)
104- mxwgt = max(swgt(i),mxwgt)
105- enddo
106- nevent = nw
107- write(lunw,'(a70)') '## '
108- write(lunw,'(a70)') '##=================== '
109- write(lunw,'(a70)') '## Event information '
110- write(lunw,'(a70)') '##=================== '
111- write(lunw,'(a70)') '## '
112- write(lunw,'(a70)') '##********************************************************************'
113- write(lunw,'(a12,a30)') '## Process: ',process
114- write(lunw,'(a12,a30)') '## Max QCD: ',QCD
115- write(lunw,'(a12,a30)') '## Max QED: ',QED
116- write(lunw,'(a70)') '##********************************************************************'
117- write(lunw,'(a30,i10)') '## Number of Events : ',nevent
118- write(lunw,'(a30,e10.5)') '## Integrated weight (pb) : ',sum
119- write(lunw,'(a30,e10.5)') '## Max wgt : ',mxwgt
120- write(lunw,'(a30,e10.5)') '## Average wgt : ',sum/nevent
121- write(lunw,'(a70)') '##********************************************************************'
122-
123-c close(lunw)
124-
125- end
126
127=== modified file 'Template/Source/gen_ximprove.f'
128--- Template/Source/gen_ximprove.f 2012-01-30 12:00:54 +0000
129+++ Template/Source/gen_ximprove.f 2012-03-09 00:04:18 +0000
130@@ -11,11 +11,10 @@
131 parameter (rfile='results.dat')
132 character*(*) symfile
133 parameter (symfile='symfact.dat')
134- integer max_amps
135- parameter (max_amps=9999)
136
137 include 'run_config.inc'
138 include 'maxparticles.inc'
139+ include 'maxconfigs.inc'
140 c
141 c global
142 c
143@@ -25,19 +24,19 @@
144 c
145 c local
146 c
147- double precision xsec(max_amps), xerr(max_amps)
148- double precision xerru(max_amps),xerrc(max_amps)
149- double precision xmax(max_amps), eff(max_amps)
150- double precision xlum(max_amps)
151+ double precision xsec(lmaxconfigs), xerr(lmaxconfigs)
152+ double precision xerru(lmaxconfigs),xerrc(lmaxconfigs)
153+ double precision xmax(lmaxconfigs), eff(lmaxconfigs)
154+ double precision xlum(lmaxconfigs)
155 double precision ysec, yerr, yeff, ymax
156 double precision tsec, terr, teff, tmax, xi
157- integer nw(max_amps), nevents(max_amps), maxit
158- integer nunwgt(max_amps)
159- character*80 fname, gname(max_amps)
160+ integer nw(lmaxconfigs), nevents(lmaxconfigs), maxit
161+ integer nunwgt(lmaxconfigs)
162+ character*80 fname, gname(lmaxconfigs)
163 integer i,j,k,l,n,ipp
164 double precision xtot,errtot,err_goal
165 double precision errtotu,errtotc
166- integer mfact(max_amps)
167+ integer mfact(lmaxconfigs)
168 logical parallel, gen_events
169 character*20 param(maxpara),value(maxpara)
170 integer npara, nreq, ngran, nhel_refine
171@@ -225,8 +224,8 @@
172 c Constants
173 c
174 include 'run_config.inc'
175- integer max_amps
176- parameter (max_amps=9999)
177+ include 'maxconfigs.inc'
178+
179 c integer max_np
180 c parameter (max_np = 30)
181 c
182@@ -237,16 +236,16 @@
183 c
184 c Arguments
185 c
186- double precision xsec(max_amps), xerru(max_amps),xerrc(max_amps)
187+ double precision xsec(lmaxconfigs), xerru(lmaxconfigs),xerrc(lmaxconfigs)
188 double precision err_goal,xtot
189- integer mfact(max_amps),jpoints(max_amps),nhel_refine
190+ integer mfact(lmaxconfigs),jpoints(lmaxconfigs),nhel_refine
191 integer ng
192- character*(80) gn(max_amps)
193+ character*(80) gn(lmaxconfigs)
194 c
195 c Local
196 c
197- integer i,j,k, io(max_amps), npoints, ip, np
198- double precision xt(max_amps),elimit
199+ integer i,j,k, io(lmaxconfigs), npoints, ip, np
200+ double precision xt(lmaxconfigs),elimit
201 double precision yerr,ysec,rerr
202 logical fopened
203 c-----
204@@ -474,8 +473,7 @@
205 c Constants
206 c
207 include 'run_config.inc'
208- integer max_amps
209- parameter (max_amps=9999)
210+ include 'maxconfigs.inc'
211 c
212 c global
213 c
214@@ -487,16 +485,16 @@
215 c
216 c Arguments
217 c
218- double precision goal_lum, xlum(max_amps), xsec(max_amps),xtot
219- double precision xerr(max_amps)
220- integer jpoints(max_amps), mfact(max_amps)
221+ double precision goal_lum, xlum(lmaxconfigs), xsec(lmaxconfigs),xtot
222+ double precision xerr(lmaxconfigs)
223+ integer jpoints(lmaxconfigs), mfact(lmaxconfigs)
224 integer ng, np, nhel_refine
225- character*(80) gn(max_amps)
226+ character*(80) gn(lmaxconfigs)
227 c
228 c Local
229 c
230- integer i,j,k,kk, io(max_amps), npoints, ip, nfiles,ifile,npfile
231- double precision xt(max_amps),elimit
232+ integer i,j,k,kk, io(lmaxconfigs), npoints, ip, nfiles,ifile,npfile
233+ double precision xt(lmaxconfigs+1),elimit
234 double precision yerr,ysec,rerr
235 logical fopened
236 character*26 cjobs
237@@ -738,8 +736,7 @@
238 c Constants
239 c
240 include 'run_config.inc'
241- integer max_amps
242- parameter (max_amps=9999)
243+ include 'maxconfigs.inc'
244 c
245 c global
246 c
247@@ -748,16 +745,16 @@
248 c
249 c Arguments
250 c
251- double precision goal_lum, xlum(max_amps), xsec(max_amps),xtot
252+ double precision goal_lum, xlum(lmaxconfigs), xsec(lmaxconfigs),xtot
253 double precision ngran !Granularity.... min # points from channel
254- integer jpoints(max_amps), mfact(max_amps)
255+ integer jpoints(lmaxconfigs), mfact(lmaxconfigs)
256 integer ng, np, nhel_refine
257- character*(80) gn(max_amps)
258+ character*(80) gn(lmaxconfigs)
259 c
260 c Local
261 c
262 integer i,j,k, npoints, ip
263- double precision xt(max_amps),elimit
264+ double precision xt(lmaxconfigs),elimit
265 double precision yerr,ysec,rerr
266 character*72 fname
267 logical fopened
268
269=== modified file 'Template/Source/make_opts'
270--- Template/Source/make_opts 2012-02-15 23:55:51 +0000
271+++ Template/Source/make_opts 2012-03-09 00:04:18 +0000
272@@ -8,7 +8,7 @@
273
274 # Set FC unless it's defined by an environment variable
275 ifeq ($(origin FC),default)
276- FC=g77
277+ FC=gfortran
278 endif
279
280 # Options: dynamic, lhapdf
281
282=== removed file 'Template/Source/maxconfigs.inc'
283--- Template/Source/maxconfigs.inc 2011-04-03 22:11:58 +0000
284+++ Template/Source/maxconfigs.inc 1970-01-01 00:00:00 +0000
285@@ -1,2 +0,0 @@
286- integer lmaxconfigs
287- parameter (lmaxconfigs=4000) !Used for iforest
288
289=== removed file 'Template/Source/maxparticles.inc'
290--- Template/Source/maxparticles.inc 2011-04-16 05:25:14 +0000
291+++ Template/Source/maxparticles.inc 1970-01-01 00:00:00 +0000
292@@ -1,2 +0,0 @@
293- integer max_particles
294- parameter (max_particles=10)
295
296=== removed file 'Template/Source/sum.f'
297--- Template/Source/sum.f 2010-10-30 03:26:37 +0000
298+++ Template/Source/sum.f 1970-01-01 00:00:00 +0000
299@@ -1,55 +0,0 @@
300- program sum
301-c********************************************************************************
302-c Program to combine results from all of the different sub amplitudes
303-c and given total
304-c cross section and error.
305-c*****************************************************************************
306- implicit none
307-c
308-c Constants
309-c
310- character*(*) rfile
311- parameter (rfile='result')
312- character*(*) symfile
313- parameter (symfile='symfact.dat')
314- integer max_amps
315- parameter (max_amps=999)
316-c
317-c local
318-c
319- double precision xsec(max_amps), xerr(max_amps)
320- character*80 fname
321- integer i,j
322- double precision xtot,errtot
323-c-----
324-c Begin Code
325-c-----
326- xtot=0d0
327- errtot=0d0
328- open(unit=15,file=symfile,status='old',err=999)
329- do while (.true.)
330- read(15,*,err=99) i,j
331- if (j .gt. 0) then
332- if (i .lt. 10) then
333- write(fname,'(a,i1,a,a)') 'G',i,'/',rfile
334-c write(*,*) fname
335- else if (i .lt. 100) then
336- write(fname,'(a,i2,a,a)') 'G',i,'/',rfile
337-c write(*,*) fname
338- else if (i .lt. 1000) then
339- write(fname,'(a,i3,a,a)') 'G',i,'/',rfile
340-c write(*,*) fname
341- endif
342- open(unit=25,file=fname,status='old',err=95)
343- read(25,*) xsec(i), xerr(i)
344- xtot = xtot+xsec(i)*j
345- errtot=errtot+j*xerr(i)**2
346- write(*,'(2i4,2e12.4)') i,j, xsec(i),xerr(i)
347- 95 close(25)
348- endif
349- enddo
350- 99 write(*,*) 'done',xtot,sqrt(errtot)
351- close(15)
352- stop
353- 999 write(*,*) 'error'
354- end
355
356=== removed file 'Template/Source/sum_html.f'
357--- Template/Source/sum_html.f 2011-05-29 07:23:58 +0000
358+++ Template/Source/sum_html.f 1970-01-01 00:00:00 +0000
359@@ -1,775 +0,0 @@
360- program sum_html
361-c*****************************************************************************
362-c Program to combine results from all of the different sub amplitudes
363-c and given total cross section and error.
364-c*****************************************************************************
365- implicit none
366-c
367-c Constants
368-c
369- include 'maxparticles.inc'
370- character*(*) subfile
371- parameter (subfile='subproc.mg')
372- character*(*) symfile
373- parameter (symfile='symfact.dat')
374- character*(*) rfile
375- parameter (rfile='results.dat')
376- integer max_amps , max_iter
377- parameter (max_amps=9999, max_iter=50)
378-c
379-c local
380-c
381- double precision xsec(max_amps), xerr(max_amps)
382- double precision xerru(max_amps),xerrc(max_amps)
383- double precision xmax(max_amps), eff(max_amps)
384- double precision xlum(max_amps), xlum_min
385- double precision ysec_iter(0:max_iter)
386- double precision yerr_iter(0:max_iter)
387- double precision tsec_iter(0:max_iter)
388- double precision terr_iter(0:max_iter)
389- double precision f(0:max_iter)
390- double precision ysec, yerr, yeff, ymax
391- double precision tsec, terr, teff, tmax
392- double precision tmean, tsig, chi2
393- integer nw(max_amps), nevents(max_amps), maxit
394- integer icor(max_amps)
395- integer nunwgt(max_amps)
396- integer minit
397- character*300 fname, pname
398- character*320 linkname(max_amps)
399- integer i,j,k,l
400- double precision xtot,errtot,err_goal, xi
401- double precision errtotc, errtotu
402- logical correlated
403- integer mfact(max_amps)
404- integer ntevents, ntw
405- integer ilen
406- logical errex
407- integer ncode,npos
408- character*20 formstr
409-
410- logical sumproc
411- common/to_sumproc/sumproc
412-c-----
413-c Begin Code
414-c-----
415- correlated = .true.
416- minit = max_iter
417- do i=0,max_iter
418- tsec_iter(i)=0d0
419- terr_iter(i)=0d0
420- enddo
421- sumproc = .true.
422- open(unit=15,file=symfile,status='old',err=10)
423- sumproc=.false.
424- 10 if (sumproc) then
425- open(unit=15,file=subfile,status='old',err=999)
426- endif
427- errtot=0d0
428- errtotu=0d0 !uncorrelated errors
429- errtotc=0d0 !correlated errors
430- xtot = 0d0
431- xlum_min = 1d99
432- ntevents = 0
433- ntw = 0
434- i = 0
435-c ncode is number of digits needed for the bw coding
436- ncode=int(dlog10(3d0)*(max_particles-3))+1
437- do while (.true.)
438- if (sumproc) then
439- j = 1
440- read(15,*,err=99,end=99) pname
441- i=i+1
442- ilen = index(pname,' ')-1
443-c write(*,*) 'found ilen',ilen,pname
444- write(fname,'(a,a,a)') pname(1:ilen),'/',rfile
445- write(linkname(i),'(a,a,a)')pname(1:ilen),'/','results.html'
446-c write(*,*) i,'found ilen',ilen,fname(1:ilen+10)
447- else
448- read(15,*,err=99,end=99) xi,j
449- if (j .gt. 0) then
450- i=i+1
451- k = int(xi*(1+10**(-ncode)))
452- npos=int(dlog10(dble(k)))+1
453- if ( (xi-k) .eq. 0) then
454-c Write with correct number of digits
455- write(formstr,'(a,i1,a)') '(a,i',npos,',a,a)'
456- write(fname, formstr) 'G',k,'/',rfile
457- write(linkname(i),formstr) 'G',k,'/','log.txt'
458- else !Handle B.W.
459-c Write with correct number of digits
460- write(formstr,'(a,i1,a,i1,a)') '(a,f',npos+ncode+1,
461- $ '.',ncode,',a,a)'
462- write(fname, formstr) 'G',xi,'/',rfile
463- write(linkname(i),formstr) 'G',xi,'/','log.txt'
464- endif
465-c write(*,*) 'log name ',fname
466- endif
467- endif
468-
469-
470- if (j .gt. 0) then
471- nevents(i)=0d0
472- xsec(i)=0d0
473- xerr(i)=0d0
474- xerru(i)=0d0
475- xerrc(i)=0d0
476- nw(i) =0d0
477- mfact(i)=j
478-c
479-c Read in integration data from run
480-c
481- open(unit=25,file=fname,status='old',err=95)
482- read(25,*) xsec(i),xerru(i),xerrc(i),nevents(i),nw(i)
483- $ ,maxit,nunwgt(i),xlum(i)
484- 11 xerr(i) = sqrt(xerru(i)**2+xerrc(i)**2)
485- xlum(i)=xlum(i)/mfact(i)
486- ntevents=ntevents+nevents(i)
487- ntw=ntw+nw(i)
488-c maxit = min(maxit,2)
489- if (sumproc) then
490- write(*,'(a,e15.5)') pname(2:ilen), xsec(i)
491- else
492- write(*,*) fname,i,xsec(i),mfact(i)
493- endif
494- tmax = -1d0
495- terr = 0d0
496- teff = 0d0
497- tsec = 0d0
498- if (.true.) then
499- k = 0
500- ysec_iter(0) = xsec(i)
501- do while ( k .le. maxit .and. ysec_iter(k) .gt. 0)
502- k=k+1
503- read(25,*,err=92,end=92) l,ysec_iter(k),yerr_iter(k)
504-c write(*,*) k,ysec_iter(k),yerr_iter(k)
505- enddo
506- 92 maxit = k-1 !In case of error reading file
507- if (maxit .gt. 0) then
508-c
509-c Check to see if we need to reduce the number of iterations
510-c
511- if (maxit .lt. minit) then !need to reset minit
512- do k=1,minit-maxit !and combine first iterations
513- tsec_iter(1)=tsec_iter(1)+tsec_iter(k+1)
514- terr_iter(1)=terr_iter(1)+terr_iter(k+1)
515- enddo
516- tsec_iter(1)=tsec_iter(1)/(minit-maxit+1)
517- terr_iter(1)=terr_iter(1)/(minit-maxit+1)
518- do k=2,maxit
519- tsec_iter(k) = tsec_iter(k+maxit-1)
520- terr_iter(k) = terr_iter(k+maxit-1)
521- tsec_iter(k+maxit-1) = 0d0
522- terr_iter(k+maxit-1) = 0d0
523-c write(*,*) k+1,k+maxit
524- enddo
525- minit = maxit
526- endif
527-c
528-c If this channel has more iterations, combine first few
529-c together into 1
530-c
531- if (maxit .gt. minit) then
532- do k=1,maxit-minit
533- ysec_iter(1)=ysec_iter(1)+ysec_iter(k+1)
534- yerr_iter(1)=sqrt(yerr_iter(1)**2+yerr_iter(k+1)**2)
535- enddo
536- ysec_iter(1)=ysec_iter(1)/(maxit-minit+1)
537- yerr_iter(1)=yerr_iter(1)/(maxit-minit+1)
538- do k=2,minit
539- ysec_iter(k) = ysec_iter(k+minit-1)
540- yerr_iter(k) = yerr_iter(k+minit-1)
541- ysec_iter(k+minit-1) = 0d0
542- yerr_iter(k+minit-1) = 0d0
543- enddo
544- endif
545-c
546-c Now add these statistics to our totals for each iteration
547-c
548- do k=1,minit
549- tsec_iter(k)=tsec_iter(k)+ysec_iter(k)*mfact(i)
550- terr_iter(k)=terr_iter(k)+(yerr_iter(k)*mfact(i))**2
551-c write(*,*) k,ysec_iter(k),yerr_iter(k)
552- enddo
553- endif
554-c if (maxit .gt. 0) then
555-c xsec(i)=tsec/maxit
556-c xerr(i)=sqrt(terr)/maxit
557-c else
558-c xsec(i)=0d0
559-c xerr(i)=0d0
560-c endif
561- endif
562- if (xsec(i) .gt. 0d0) then
563- xlum_min = min(xlum(i),xlum_min)
564- xmax(i)=tmax/xsec(i)
565- eff(i)= xerr(i)*sqrt(real(nevents(i)))/xsec(i)
566- else
567- eff(i) = 0d0
568- endif
569- xtot = xtot+ xsec(i)*mfact(i)
570- errtot = errtot+(mfact(i)*xerr(i))**2
571-c
572-c Combine error linearly if correlated, or in quadrature if not.
573-c
574- errtotc = errtotc+xerrc(i)*mfact(i)
575- errtotu = errtotu + (mfact(i)*xerru(i))**2
576- write(*,*) i, sqrt(errtotu), errtotc
577-
578- if (xsec(i) .eq. 0d0) xsec(i)=1d-99
579- 95 close(25)
580-c do k=1,minit
581-c write(*,*) i,k,tsec_iter(k),sqrt(terr_iter(k))
582-c enddo
583-c write(*,*) i,maxit,xsec(i), eff(i)
584- endif
585- enddo
586- 99 close(15)
587- errtot=sqrt(errtotu+errtotc**2)
588-c if (sumproc) then
589- open(unit=26,file=rfile,status='unknown')
590- write(26,'(3e12.5,2i9,i5,i9,e10.3)') xtot,sqrt(errtotu),
591- $ errtotc, ntw, minit,0,0,xlum_min
592- if (xtot .gt. 0) then
593- teff = sqrt(errtotc**2+errtotu**2)*sqrt(real(ntevents))/xtot
594- else
595- teff = 0d0
596- endif
597-c write(26,*) minit, xtot,errtot, ntevents, teff
598-c write(*,*) minit
599- tmean = 0d0
600- tsig = 0d0
601- f(0) = 0d0
602- do j=1,minit
603- f(j) = tsec_iter(j)**2/(terr_iter(j)+1d-99)
604-c f(j)=1
605- tmean = tmean + tsec_iter(j)*f(j)
606- tsig = tsig + terr_iter(j)*f(j)
607- f(0)=f(0)+f(j)
608-c write(*,*) 'Iteration',j,tmean/f(0),sqrt(tsig)/f(0)
609- enddo
610- if (f(0).gt.0d0) then
611- tmean=tmean/f(0)
612- tsig = sqrt(tsig/f(0)/minit)
613- endif
614- chi2 = 0d0
615- do j=1,minit
616- chi2 = chi2+f(j)*minit*
617- & (tsec_iter(j)-tmean)**2/(terr_iter(j)+1d-99)/(f(0)+1d-99)
618- write(26,*)j,tsec_iter(j),sqrt(terr_iter(j)),chi2/max(1,j-1)
619-c write(*,*) j,tsec_iter(j),sqrt(terr_iter(j)),chi2/max(1,j-1)
620- enddo
621- write(26,*) tmean,tsig,chi2/max((minit-1),1),
622- & tsig*sqrt(real(ntevents))/(tmean+1d-99)
623- write(*,*) 'Results', xtot,errtot, ntevents, teff
624- close(26)
625-c endif
626- call write_html(xsec,xerr,eff,xmax,xtot,errtot,mfact,i,nevents,
627- $ nunwgt,linkname,xlum)
628- if(sumproc.and.xtot.eq.0d0)then
629- open(unit=26,file='../error',status='unknown',err=999)
630- write(*,'(a)') 'Cross section is 0, try loosening cuts'
631- write(26,'(a)') 'Cross section is 0, try loosening cuts'
632- close(26)
633- stop
634- else
635- inquire(file="../error",exist=errex)
636- if(errex) then
637- call system ('rm -f ../error')
638- endif
639- endif
640- stop
641- 999 write(*,*) 'error'
642- end
643-
644-
645- subroutine write_html(xsec,xerr,eff,xmax,xtot,errtot,mfact,ng
646- $ ,nevents,nw,linkname,xlum)
647-c*****************************************************************************
648-c Writes out HTML table of results for process
649-c*****************************************************************************
650- implicit none
651-c
652-c Constants
653-c
654- character*(*) eventfile
655- parameter (eventfile='events.txt>')
656- character*(*) logfile
657- parameter (logfile='log.txt>')
658- character*(*) htmfile
659- parameter (htmfile='results.html')
660- integer max_amps
661- parameter (max_amps=9999)
662-c
663-c Arguments
664-c
665- double precision xsec(max_amps), xerr(max_amps)
666- double precision xmax(max_amps), eff(max_amps),xlum(max_amps)
667- integer ng, nevents(max_amps),nw(max_amps)
668- double precision xtot,errtot
669- integer mfact(max_amps)
670- integer nsubproc !Number of specific processes requested
671- logical found
672- integer ig
673- character*320 linkname(max_amps)
674- integer sname(256)
675- integer gname
676-c
677-c Local
678-c
679- integer i,j,k, io(max_amps), ik
680- integer ntot, ip,jp
681- character*300 procname
682- character*4 cpref
683- character*20 fnamel, fnamee
684- double precision scale,xt(max_amps), teff
685- double precision subtotal
686-
687- logical sumproc
688- common/to_sumproc/sumproc
689-
690-c-----
691-c Begin Code
692-c-----
693-c
694-c Here we determine the appropriate units. Assuming the results
695-c were written in picobarns
696-c
697- if (xtot .ge. 1e4) then !Use nano barns
698- scale=1e-3
699- cpref='(nb)'
700- elseif (xtot .ge. 1e1) then !Use pico barns
701- scale=1e0
702- cpref='(pb)'
703- elseif (xtot .ge. 1e-2) then !Use fempto
704- scale=1e+3
705- cpref='(fb)'
706- else !Use Attobarns
707- scale=1e+6
708- cpref='(ab)'
709- endif
710- ntot = 0
711- do j=1,ng
712- io(j) = j
713- ntot = ntot+nevents(j)
714- xt(j)=xsec(j)*mfact(j) !sort by xsec
715-c xt(j)= xerr(j)*mfact(j) !sort by error
716-c xt(j)=ng-j !sort by graph
717-c write(*,*) j,xt(j),xsec(j)
718- enddo
719-c write(*,*) 'Number of channels',ng
720- call sort2(xt,io,ng)
721-
722- do i=1,ng
723- write(*,*) i,io(i),xsec(io(i)), nevents(j)
724- enddo
725-
726- if (xtot .gt. 0d0) then
727- teff = errtot*sqrt(real(ntot))/xtot
728- else
729- teff = 0d0
730- endif
731-cfax 12.04.2006
732-c procname='Set caption in file input.dat'
733- procname='Process results'
734- ip = 1
735- jp = 30
736- open(unit=15, file='input.dat', status='old',err=11)
737- read(15,'(a)',err=11,end=11) procname
738- 11 close(15)
739- open(unit=15, file='dname.mg', status='old',err=12)
740- read(15,'(a)',err=12,end=12) procname
741-cxx tjs 3-20-2006
742-c ip = index(procname,'P')+1 !Strip off first P
743- ip = index(procname,'P')+1 !Strip off P
744- ip = ip+index(procname(ip:),'_') !Strip off process number
745- jp = ip+index(procname(ip:),' ') !Strip off blanks
746- 12 close(15)
747- open(unit=16,file=htmfile,status='unknown',err=999)
748- write(16,50) '<head><title>'//procname(ip:jp)//'</title></head>'
749- write(16,50) '<body>'
750- if (.not. sumproc) then
751-c write(16,50) '<h2>Results for <a href=diagrams.html>'
752-c write(16,50) procname(ip:jp)//'</a></h2>'
753- write(16,*) '<h2><a href=diagrams.html>'//
754- & procname(ip:jp)// '</a> <BR>'
755- write(16,*) '<font face=symbol>s</font>='
756- write(16,'(f8.3,a,f8.3,a)')xtot*scale,
757- & '<font face=symbol>&#177</font> ', errtot*scale,cpref
758- write(16,*) '</center></h2>'
759- else
760- write(16,*) '<h2>', procname(ip:jp)// " <BR>"
761- write(16,*) '<font face=symbol>s</font>='
762- write(16,'(f8.3,a,f8.3,a)') xtot*scale,
763- & '<font face=symbol>&#177</font> ', errtot*scale,cpref
764- write(16,*) '</center></h2>'
765- endif
766-c
767-c Now I want to write out information for each iteration
768-c of the run
769-c
770-cfax 12-04-2006
771-c write(16,*) '<a href=results.dat> Iteration details </a>'
772-c if (sumproc) write(16,*) '<p> <a href=../Events/plots.html> Plots </a>'
773-
774-c call gen_run_html(16)
775-c
776-c Next we'll get information on the cuts. This requires linking to
777-c cuts.o and also coupsm.o
778-c
779-c call gen_cut_html(16)
780-
781-
782- write(16,50) '<table border>'
783-c write(16,50) '<Caption> Caption Results'
784- write(16,49) '<tr><th>Graph</th>'
785- write(16,48) '<th>Cross Sect',cpref,'</th><th>Error',cpref,'</th>'
786- write(16,49) '<th>Events (K)</th><th>Eff</th>'
787- write(16,50) '<th>Unwgt</th><th>Luminosity</th></tr>'
788-
789- write(16,60) '<tr><th>Sum</th><th>',xtot*scale
790- $ ,'</th><th>',errtot*scale,'</th><th align=right>',
791- $ ntot/1000,'</th><th align=right>',teff,'</th></tr>'
792-c
793-c Check number of requested processes
794-c
795- if (sumproc) then
796- nsubproc=0
797- do i=1,ng
798- procname = linkname(io(i))(:300)
799- gname=0
800- read(procname(2:index(procname,'_')-1),*,err=20) gname
801- 20 found = .false.
802- j = 0
803- do while(j < nsubproc .and. .not. found)
804- j=j+1
805- found = (gname .eq. sname(j))
806- enddo
807- if (.not. found) then
808- nsubproc=nsubproc+1
809- sname(nsubproc) = gname
810-c write(*,*) i,nsubproc, " " , sname(nsubproc)
811- endif
812- enddo
813-cfax 12.05.2006
814-c nsubproc=nsubproc-1
815- else
816- nsubproc = 1
817- endif
818-c
819-c Now loop through all the subprocesses
820-c
821- subtotal=0d0
822-
823- do ig = 1, nsubproc
824- if (nsubproc .gt. 1) then
825-cfax If added 12.05.2006
826-c if(sname(ig).ne.0) then
827- write(16,*) '<tr> <td colspan="7" align="center"> Sub Group ',sname(ig), '</td></tr>'
828-c endif
829- endif
830- do i=1,ng
831-c write(*,*) i,io(i),xsec(io(i))
832- if(sumproc)
833- $ read(linkname(io(i))(2:index(linkname(io(i)),'_')-1),*,err=30) gname
834- 30 if ((.not. sumproc .and. xsec(io(i)) .ne. 0d0) .or.
835- $ (sumproc .and. gname .eq. sname(ig))) then
836-c write(*,*) ig," ",i," ",linkname(io(i))(:30)," ", sname(ig)
837-c
838-c Create directory names using the linkname
839-c
840-c
841- ik = index(linkname(io(i)),'log.txt')-1
842- fnamel = linkname(io(i))(1:ik) // logfile
843- fnamee = linkname(io(i))(1:ik) // eventfile
844-c write(*,*) i,fnamel,fnamee
845- if (.not. sumproc) then
846-
847-c write(16,65) '<tr><td align=right>',io(i),
848- write(16,65) '<tr><td align=right>',linkname(io(i))(1:ik-1),
849- $ ' </td><td align=right><a href='//linkname(io(i))//'>',
850- $ xsec(io(i))*mfact(io(i))*scale
851- $ ,'</a> </td><td align=right>',
852- $ xerr(io(i))*
853- $ mfact(io(i))*scale,'</td><td align=right>',
854- $ nevents(io(i))/1000,'</td><td align=right>',
855- $ eff(io(i)),'</td><td align=right>',
856- $ nw(io(i)),'</td><td align=right>',
857- $ xlum(io(i))/scale,'</td></tr>'
858-c write(*,*) io(i),xmax(io(i))
859- else
860- procname = linkname(io(i))(:300)
861-cxx tjs 3-20-2006 + cfax 12.05.2006
862-c ip = index(procname,'P')+2 !Strip off first P_
863- ip = index(procname,'P')+1 !Strip off first P
864- jp = ip+index(procname(ip:),'/')-2 !Strip off blanks
865-c write(*,*) 'Writing out ',sname(ig)," ",procname(ip:jp)
866-
867- if (xsec(io(i)) .ne. 0) then
868- subtotal = subtotal+xsec(io(i))*mfact(io(i))*scale
869- write(16,66) '<tr><td align=right> <a href=P'
870- $ //procname(ip:jp)//'/diagrams.html >'
871- $ //'P'//procname(ip:jp),
872- $ ' </a></td><td align=right><a href='
873- $ //linkname(io(i))//'>',
874- $ xsec(io(i))*mfact(io(i))*scale
875- $ ,'</a> </td><td align=right>',
876- $ xerr(io(i))*
877- $ mfact(io(i))*scale,'</td><td align=right>',
878- $ nevents(io(i))/1000,'</td><td align=right>',
879- $ eff(io(i)),'</td><td align=right>',
880- $ nw(io(i)),'</td><td align=right>',
881- $ xlum(io(i))/scale,'</td></tr>'
882-
883-c else
884-c write(16,66) '<tr><td align=right> <a href=P_'
885-c $ //procname(ip:jp)//'/diagrams.html >'
886-c $ //procname(ip:jp),
887-c $ ' </a></td><td align=right><a href='
888-c $ //linkname(io(i))//'> </td></tr>'
889- endif
890- endif
891- else
892-c write(*,*) 'Skipping process',i
893- endif
894- enddo !Loop over different groups
895-
896- if (nsubproc .gt. 1) then
897-c if(sname(ig).ne.0) then
898- if(subtotal .ne. 0e0) then
899- write(16,*) '<tr> <td colspan="7" align="center"> Sub Group total = ',subtotal, '</td></tr>'
900- subtotal=0d0
901- endif
902-c endif
903- endif
904-
905- enddo
906- write(16,50) '</table></body>'
907- 48 format(a,a,a,a)
908- 49 format(a)
909- 50 format( a)
910- 60 format( a,f10.3,a,f10.3,a,i10,a,f8.1,a)
911-c 65 format( a,i4,a,f10.3,a,f10.3,a,i10,a,f8.1,a,i10.0,a,f10.0,a)
912- 65 format( a,a,a,f10.3,a,f10.3,a,i10,a,f8.1,a,i10.0,a,f10.2,a)
913- 66 format( a,a,f10.3,a,f10.3,a,i10,a,f8.1,a,i10.0,a,f10.2,a)
914- write(*,*) 'Updated results in file ',htmfile
915- 999 close(16)
916- end
917-
918- subroutine sort2(array,aux1,n)
919- implicit none
920-! Arguments
921- integer n
922- integer aux1(n)
923- double precision array(n)
924-! Local Variables
925- integer i,k
926- double precision temp
927- logical done
928-
929-!-----------
930-! Begin Code
931-!-----------
932- do i=n-1,1,-1
933- done = .true.
934- do k=1,i
935- if (array(k) .lt. array(k+1)) then
936- temp = array(k)
937- array(k) = array(k+1)
938- array(k+1) = temp
939- temp = aux1(k)
940- aux1(k) = aux1(k+1)
941- aux1(k+1) = temp
942- done = .false.
943- end if
944- end do
945- if (done) return
946- end do
947- end
948-
949-
950-
951- subroutine gen_run_html(lun)
952-c***************************************************************************
953-c Writes out run information in html format
954-c
955-c***************************************************************************
956- implicit none
957-c
958-c Arguments
959-c
960- integer lun
961-c
962-c local
963-c
964-c
965-c Global
966-c
967-c-----
968-c Begin Code
969-c-----
970- write(lun,*)
971- end
972-
973- subroutine gen_cut_html(lun)
974-c***************************************************************************
975-c Writes out run information in html format
976-c
977-c***************************************************************************
978- implicit none
979-c
980-c Parameters
981-c
982-c include 'genps.inc'
983-c
984-c Arguments
985-c
986- integer lun
987-c
988-c Local
989-c
990- integer i,j
991- real stot
992-c
993-c Global
994-c
995-
996-c-----
997-c Begin Code
998-c-----
999-
1000-c call read_cuts()
1001-c call write_cuts() !Writes cuts.dat in parent directory
1002-
1003-c
1004-c Write out collider information table
1005-c
1006-c stot = 2d0*sqrt(ebeam(1)*ebeam(2))
1007-c write(lun,*) '<p> <TABLE> <table border=1>'
1008-c write(lun,*) '<TD> <B> sqrt(s) </B> </TD>'
1009-c write(lun,*) '<TD> <B> Beam 1 </B> </TD>'
1010-c write(lun,*) '<TD> <B> Beam 2 </B> </TD>'
1011-
1012-c write(lun,*) '</TR><TR><TD><B>',stot,' GeV </B></TD>'
1013-c write(lun,*) '<TD> <B>',Ebeam(1),' GeV </B></TD>'
1014-c write(lun,*) '<TD> <B>',Ebeam(2),' GeV </B></TD>'
1015-c write(lun,*) '</TR> <TR>'
1016-c write(lun,*) '<TD> </TD>'
1017-c do i=1,2
1018-c write(lun,*) '<TD> <center> <B>'
1019-c if (lpp(i) .eq. 1) then
1020-c write(lun,*) 'Proton'
1021-c elseif(lpp(i) .eq. -1) then
1022-c write(lun,*) 'Antiproton'
1023-c else
1024-c write(lun,*) 'No pdf'
1025-c endif
1026-c write(lun,*) '</B></center></TD>'
1027-c enddo
1028-c write(lun,*) '</TR></table>'
1029-
1030-
1031-
1032-c
1033-c Now write out the cuts information table
1034-c
1035-c if (.false.) then
1036-c write(lun,*) '<p> <TABLE> <table border=1>'
1037-c
1038-c Header
1039-c
1040-c write(lun,*) '<TR> <TD><B> Cuts </B> </TD>'
1041-c do i=3,nexternal
1042-c write(lun,*) '<TD> <B> <center>',i
1043-c write(lun,*) '</center> </B> </TD>'
1044-c enddo
1045-c
1046-c PT
1047-c
1048-c write(lun,*) '<TR> <TD><B> Et > </B> </TD>'
1049-c do i=3,nexternal
1050-c write(lun,'(a,f6.0)') '<TD> <B> <right>',etmin(i)
1051-c write(lun,*) '</right> </B> </TD>'
1052-c enddo
1053-c
1054-c Rapidity
1055-c
1056-c write(lun,*) '<TR> <TD><B> eta < </B> </TD>'
1057-c do i=3,nexternal
1058-c write(lun,'(a,f6.0)') '<TD> <B> <right>',etamax(i)
1059-c write(lun,*) '</right> </B> </TD>'
1060-c enddo
1061-c
1062-c Delta R
1063-c
1064-c do j=4,nexternal
1065-c write(lun,*) '<TR> <TD><B> Delta R',j, ' </B> </TD>'
1066-c do i=3,nexternal
1067-c if ( i .lt. j) then
1068-c write(lun,'(a,f6.1)') '<TD> <B> <right>',r2min(j,i)
1069-c else
1070-c write(lun,'(a)') '<TD> <B> <right>'
1071-c endif
1072-c write(lun,*) '</right> </B> </TD>'
1073-c enddo
1074-c write(lun,*) '</TR>'
1075-c enddo
1076-c write(lun,*) '</table>'
1077-c write(lun,*) '<p>'
1078-c endif
1079-
1080-c
1081-c Now write out the cuts information table
1082-c
1083-c write(lun,*) '<p> <TABLE> <table border=1>'
1084-c
1085-c Header
1086-c
1087-c write(lun,*) '<TD><B> Particle </B> </TD>'
1088-c write(lun,*) '<TD><B> Et > </B> </TD>'
1089-c write(lun,*) '<TD><B> eta < </B> </TD>'
1090-c do i=3,nexternal-1
1091-c write(lun,*) '<TD> <B> <center>Delta R',i
1092-c write(lun,*) '</center> </B> </TD>'
1093-c enddo
1094-c write(lun,*) '</TR>'
1095-c
1096-c PT
1097-c
1098-c write(lun,*) '<TR> <TD><B> Et > </B> </TD>'
1099-c do i=3,nexternal
1100-c write(lun,'(a,i3)') '<TR><TD> <B> <center>',i
1101-c write(lun,*) '</center> </B> </TD>'
1102-c write(lun,'(a,f6.0)') '<TD> <B> <right>',etmin(i)
1103-c write(lun,*) '</right> </B> </TD>'
1104-c write(lun,'(a,f6.1)') '<TD> <B> <right>',etamax(i)
1105-c write(lun,*) '</right> </B> </TD>'
1106-
1107-c do j=3,nexternal-1
1108-c if ( i .gt. j) then
1109-c write(lun,'(a,f6.1)') '<TD> <B> <right>',r2min(i,j)
1110-c else
1111-c write(lun,'(a)') '<TD> <B> <right>'
1112-c endif
1113-c write(lun,*) '</right> </B> </TD>'
1114-c enddo
1115-c write(lun,*) '</TR>'
1116-
1117-c enddo
1118-c
1119-c Rapidity
1120-c
1121-c write(lun,*) '<TR> <TD><B> eta < </B> </TD>'
1122-c do i=3,nexternal
1123-c enddo
1124-c
1125-c Delta R
1126-c
1127-
1128-c write(lun,*) '</table>'
1129-c write(lun,*) '<p>'
1130- end
1131-
1132-
1133-
1134-
1135
1136=== modified file 'Template/SubProcesses/setcuts.f'
1137--- Template/SubProcesses/setcuts.f 2011-10-02 12:06:10 +0000
1138+++ Template/SubProcesses/setcuts.f 2012-03-09 00:04:18 +0000
1139@@ -112,22 +112,28 @@
1140 c set ptj and s_min if xqcut and ktscheme = 1, to improve
1141 c integration speed, and set drjj and drjl to 0.
1142 c
1143- if(xqcut.gt.0.and.ktscheme.eq.1) then
1144- if(auto_ptj_mjj.and.ptj.ge.0d0.and.ptj.lt.xqcut)then
1145+ if(xqcut.gt.0) then
1146+ if(auto_ptj_mjj.and.ptj.ge.0d0.and.ktscheme.eq.1)then
1147 ptj=xqcut
1148 write(*,*) 'Warning! ptj set to xqcut=',xqcut,
1149 $ ' to improve integration efficiency'
1150 write(*,*) 'Note that this might affect non-radiated jets,'
1151 write(*,*) 'e.g. from decays. Use cut_decays=F in run_card.'
1152+ else if(ptj.gt.xqcut)then
1153+ ptj=0d0
1154+ write(*,*) 'Warning! ptj set to 0 since xqcut > 0 and'
1155+ write(*,*) ' auto_ptj_mjj = F or ktscheme > 1'
1156 endif
1157- endif
1158- if(xqcut.gt.0) then
1159- if(auto_ptj_mjj.and.mmjj.ge.0d0.and.mmjj.lt.xqcut)then
1160+ if(auto_ptj_mjj.and.mmjj.ge.0d0)then
1161 mmjj=xqcut
1162 write(*,*) 'Warning! mmjj set to xqcut=',xqcut,
1163 $ ' to improve integration efficiency'
1164 write(*,*) 'Note that this might affect non-radiated jets,'
1165 write(*,*) 'e.g. from decays. Use cut_decays=F in run_card.'
1166+ else if(mmjj.gt.xqcut)then
1167+ mmjj=0d0
1168+ write(*,*) 'Warning! mmjj set to 0 since xqcut > 0 and'
1169+ write(*,*) ' auto_ptj_mjj = F'
1170 endif
1171 if(drjj.gt.0d0) then
1172 write(*,*) 'Warning! drjj > 0 with xqcut > 0, set to 0'
1173
1174=== modified file 'Template/bin/generate_events'
1175--- Template/bin/generate_events 2011-12-14 21:52:20 +0000
1176+++ Template/bin/generate_events 2012-03-09 00:04:18 +0000
1177@@ -28,7 +28,7 @@
1178 sys.path.append(pjoin(root_path,'bin','internal'))
1179 import madevent_interface as ME
1180
1181-if not (sys.version_info[0] == 2 or sys.version_info[1] > 5):
1182+if not sys.version_info[0] == 2 or sys.version_info[1] < 6:
1183 sys.exit('MadEvent works with python 2.6 or higher (but not python 3.X).\n\
1184 Please upgrade your version of python.')
1185
1186@@ -67,20 +67,17 @@
1187 except:
1188 name = raw_input('enter run name\n')
1189
1190- launch = ME.MadEventCmd(me_dir=root_path)
1191+# launch = ME.MadEventCmd(me_dir=root_path)
1192
1193
1194 if mode == 1:
1195- launch.run_cmd('generate_events -f %s --cluster'
1196- %(name))
1197- elif mode ==2:
1198- launch.run_cmd('generate_events -f %s --multicore --nb_core=%s'
1199- %(name, opt))
1200+ argument = ['fake','-f', str(name), '--cluster']
1201+ elif mode == 2:
1202+ argument = ['fake','-f', '--multicore', str(name), '--nb_core=%s' % opt]
1203 else:
1204- launch.run_cmd('generate_events -f %s' % name)
1205-
1206- launch.run_cmd('quit')
1207+ argument = ['fake','-f', name]
1208
1209+ return argument
1210
1211
1212
1213@@ -100,13 +97,18 @@
1214 if '-h' in argument or '--help' in argument:
1215 launch = ME.MadEventCmd(me_dir=root_path)
1216 launch.exec_cmd('help generate_events')
1217+ sys.exit()
1218 elif len(argument) > 1 and argument[1] in ['0', '1', '2']:
1219- treat_old_argument(argument)
1220- else:
1221- open('/tmp/mg5tmp.cmd','w').write('generate_events %s' % ' '.join(argument[1:]))
1222- os.system('%s/madevent /tmp/mg5tmp.cmd' % pjoin(root_path, 'bin'))
1223+ argument = treat_old_argument(argument)
1224+
1225+ launch = ME.MadEventCmd(me_dir=root_path)
1226+ launch.run_cmd('generate_events %s' % ' '.join(argument[1:]))
1227+ launch.run_cmd('quit')
1228 except KeyboardInterrupt:
1229- pass
1230+ try:
1231+ launch.run_cmd('quit')
1232+ except:
1233+ pass
1234 except ME.MadEventAlreadyRunning, error:
1235 logging.error(str(error))
1236 sys.exit()
1237
1238=== modified file 'Template/bin/internal/compile_Source'
1239--- Template/bin/internal/compile_Source 2011-07-19 11:03:51 +0000
1240+++ Template/bin/internal/compile_Source 2012-03-09 00:04:18 +0000
1241@@ -14,7 +14,7 @@
1242
1243 if [[ -d Source ]]; then
1244 cd Source
1245- for i in ../bin/internal/sum_html ../bin/internal/gen_ximprove all ../bin/internal/combine_events ../bin/internal/combine_runs ../bin/internal/sumall; do
1246+ for i in ../bin/internal/gen_ximprove all ../bin/internal/combine_events ../bin/internal/combine_runs; do
1247 make $i > /dev/null
1248 if [[ $? -ne 0 ]];then
1249 # Make didn't exit successfully
1250
1251=== modified file 'Template/bin/internal/gen_jpeg-pl'
1252--- Template/bin/internal/gen_jpeg-pl 2011-06-29 14:15:21 +0000
1253+++ Template/bin/internal/gen_jpeg-pl 2012-03-09 00:04:18 +0000
1254@@ -72,7 +72,7 @@
1255
1256 system ("/bin/bash -c \"cat matrix$imatrix.ps | sed 1,352d >> junk.ps\" ");
1257
1258- system "/bin/bash -c \"nice gs \-sDEVICE\=jpeg \-sOutputFile\=card.jpg \-q \-dNOPAUSE \-dBATCH \-g180x150 junk.ps; rm -f junk.ps; cp -p card.jpg ../../card.jpg\" ";
1259+ system "/bin/bash -c \"nice gs \-sDEVICE\=jpeg \-sOutputFile\=card.jpg \-q \-dNOPAUSE \-dBATCH \-g180x150 ./junk.ps; rm -f junk.ps; cp -p card.jpg ../../card.jpg\" ";
1260 }
1261 if ($imatrix eq "") {$imatrix = 0;}
1262 $imatrix = $imatrix + 1;
1263
1264=== removed file 'Template/bin/internal/sumall'
1265--- Template/bin/internal/sumall 2011-07-12 16:33:50 +0000
1266+++ Template/bin/internal/sumall 1970-01-01 00:00:00 +0000
1267@@ -1,29 +0,0 @@
1268-#!/bin/bash
1269-#
1270-# First we need to get into the main directory
1271-#
1272-if [[ ! -d ./bin ]]; then
1273- cd ../
1274- if [[ ! -d ./bin ]]; then
1275- echo "Error: sumall must be executed from the main, or bin directory"
1276- exit
1277- fi
1278-fi
1279-if [[ ! -d Source ]]; then
1280- echo "Error: Source directory not found"
1281- exit
1282-fi
1283-cd ./Source
1284-make ../bin/internal/sum_html >& /dev/null
1285-cd ..
1286-if [[ ! -d SubProcesses ]]; then
1287- echo "Error: SubProcesses directory not found"
1288- exit
1289-fi
1290-cd SubProcesses
1291-for i in `cat subproc.mg` ; do
1292-cd $i
1293-../../bin/internal/sum_html >/dev/null
1294-cd ..
1295-done
1296-../bin/internal/sum_html
1297
1298=== modified file 'UpdateNotes.txt'
1299--- UpdateNotes.txt 2012-02-16 19:13:36 +0000
1300+++ UpdateNotes.txt 2012-03-09 00:04:18 +0000
1301@@ -1,44 +1,81 @@
1302 Update notes for MadGraph 5 (in reverse time order)
1303
1304-1.4.2 (16/02/12) JA: Ensure that matching works properly with > 9 final state
1305+1.4.3 (08/03/12) JA: Reintroduced the possibility to completely forbid
1306+ s-channel diagrams, using the $$ notation. Note that
1307+ this should be used with great care, since the result
1308+ is in general not gauge-invariant. It is in general
1309+ better to use the $ notation, forbidding only onshell
1310+ s-channel particles (the inverse of decay chains).
1311+ JA: Automatically ensure that ptj and mmjj are below xqcut
1312+ when xqcut > 0, since ptj or mmjj > xqcut ruins matching.
1313+ OM: Add LSF to the list of supported cluster (thanks to Alexis).
1314+ OM: change the param_card reader for the restrict file.
1315+ This allow to restrict model with 3 lha id (or more)
1316+ (thanks to Eduardo Ponton).
1317+ OM: forbids to run 'generate events' with python 2.4.
1318+ OM: Include the configuration file in the .tar.gz created on
1319+ the web (thanks to Simon) .
1320+ OM: Fix a Mac specific problem for edition of Delphes card.
1321+ (thanks to Sho Iwamoto).
1322+ OM: ALOHA modifications:
1323+ - Change sign convention for Epsilon (matching FR choices)
1324+ - For Fermion vertex forces that _1 always returns the
1325+ incoming fermion and _2 returns the outcoming fermion.
1326+ (This modifies conjugate routine output)
1327+ - Change the order of argument for conjugate routine
1328+ to expect IO order of fermion in all cases.
1329+ Note that the two last modifications matches MG5 conventions
1330+ and that those modifications correct bugs for interactions
1331+ a) subject to conjugate routine (i.e. if the model has
1332+ majorana)
1333+ b) containing fermion momentum dependencies in the Lorentz
1334+ structure
1335+ All model included by default in MG5 (in particular sm/mssm)
1336+ were not affected by those mismatch of conventions.
1337+ (Thanks to Benjamin fuks)
1338+ OM: make acceptance test more silent.
1339+ OM: return the correct error message when a compilation occur.
1340+ OM: some code re-factoring.
1341+
1342+1.4.2 (16/02/12) JA: Ensure that matching works properly with > 9 final state
1343 particles (by increasing a buffer size in event output)
1344- OM: add a command "import banner" in order to run a full run
1345- from a given banner.
1346- OM: Fix the Bug #921487, fixing a problem with home made model
1347+ OM: add a command "import banner" in order to run a full run
1348+ from a given banner.
1349+ OM: Fix the Bug #921487, fixing a problem with home made model
1350 In the definition of Particle/Anti-Particle. (Thanks Ben)
1351- OM: Fix a formatting problem in me5_configuration.txt
1352+ OM: Fix a formatting problem in me5_configuration.txt
1353 (Bug #930101) Thanks to Arian
1354- OM: allow to run ./bin/mg5 BANNER_PATH and
1355+ OM: allow to run ./bin/mg5 BANNER_PATH and
1356 ./bin/mg5 PROC_CARD_V4_PATH
1357- OM: Various small fixes concerning the stability of the html
1358- output.
1359- OM: Changes the server to download td since cp3wks05 has an
1360- harddisk failures.
1361+ OM: Various small fixes concerning the stability of the html
1362+ output.
1363+ OM: Changes the server to download td since cp3wks05 has an
1364+ harddisk failures.
1365
1366-1.4.1 (06/02/12) OM: Fix the fermion flow check which was wrongly failing on
1367+1.4.1 (06/02/12) OM: Fix the fermion flow check which was wrongly failing on
1368 some model (Thanks to Benjamin)
1369- OM: Improve run organization efficiency (which speeds up the
1370- code on cluster) (Thanks to Johan)
1371- OM: More secure html output (Thanks to Simon)
1372+ OM: Improve run organization efficiency (which speeds up the
1373+ code on cluster) (Thanks to Johan)
1374+ OM: More secure html output (Thanks to Simon)
1375
1376-1.4.0 (04/02/12): OM: New user interface for the madevent run. Type:
1377+1.4.0 (04/02/12) OM: New user interface for the madevent run. Type:
1378 1) (from madevent output) ./bin/madevent
1379 2) (from MG5 command line) launch [MADEVENT_PATH] -i
1380 This interface replaces various script like refine,
1381 survey, combine, run_..., rm_run, ...
1382 The script generate_events still exists but now calls
1383 ./bin/madevent.
1384- OM: For MSSM model, convert param_card to SLAH1. This card is
1385+ OM: For MSSM model, convert param_card to SLAH1. This card is
1386 converted to SLAH2 during the MadEvent run since the UFO
1387 model uses SLAH2. This allows to use Pythia 6,
1388 as well as having a coherent definition for the flavor.
1389- JA+OM: For decay width computations, the launch command in
1390+ JA+OM: For decay width computations, the launch command in
1391 addition to compute the width, creates a new param_card
1392 with the width set to the associated values, and with the
1393 Branching ratio associated (usefull for pythia).
1394- NOTE: This param_card makes sense for future run ONLY if all
1395+ NOTE: This param_card makes sense for future run ONLY if all
1396 relevant decay are generated.
1397- EXAMPLE: (after launch bin/mg5):
1398+ EXAMPLE: (after launch bin/mg5):
1399 import model sm-full
1400 generate t > b w+
1401 define all = p b b~ l+ l- ta+ ta- vl vl~
1402@@ -49,41 +86,42 @@
1403 add process h > v v, v > all all
1404 output
1405 launch
1406- OM: change output pythia8 syntax: If a path is specified this
1407+ OM: change output pythia8 syntax: If a path is specified this
1408 is considered as the output directory.
1409- OM: Change the path of the madevent output files. This allows
1410+ OM: Change the path of the madevent output files. This allows
1411 to run pythia/pgs/delphes mulitple times for the same set
1412 of events (with different pythia/... parameters).
1413- OM: Madevent output is now insensitive to the relative path
1414+ OM: Madevent output is now insensitive to the relative path
1415 to pythia-pgs, delphes, ... In consequence you don't need
1416- anymore to have your directory at the same level as Template directory.
1417- OM: MadEvent checks that the param_card is coherent with the
1418+ anymore to have your directory at the same level as
1419+ Template directory.
1420+ OM: MadEvent checks that the param_card is coherent with the
1421 restriction used during the model generation.
1422- OM: Model restrictions will now also force opposite number to
1423+ OM: Model restrictions will now also force opposite number to
1424 match (helpfull for constraining to rotation matrix).
1425- OM: Change the import command. It's now allowed to omit the
1426+ OM: Change the import command. It's now allowed to omit the
1427 type of import. The type is guessed automaticaly.
1428 This is NOT allowed on the web.
1429- OM: Add a check that the fermion flow is coherent with the
1430+ OM: Add a check that the fermion flow is coherent with the
1431 Lorentz structure associates to the vertex.
1432- OM: Add a check that the color representation is coherent.
1433+ OM: Add a check that the color representation is coherent.
1434 This allow to detect/fix various problem linked
1435 to some new models created by FR and SARAH.
1436- OM: Change the default fortran compiler to gfortran.
1437- OM: Add the possibility to force which fortran compiler will
1438+ OM: Change the default fortran compiler to gfortran.
1439+ OM: Add the possibility to force which fortran compiler will
1440 be used, either via the configuration file or via the set
1441 command.
1442- OM: Add the possibility to bypass the automatic opening of
1443+ OM: Add the possibility to bypass the automatic opening of
1444 the web browser (via the configuration file:
1445 ./input/mg5_configuration.txt )
1446- OM: add 'save options' command to save the current configuration
1447- in the configuration file.
1448- OM: Change the scheme of questions when running madevent and
1449+ OM: add 'save options' command to save the current configuration
1450+ in the configuration file.
1451+ OM: Change the scheme of questions when running madevent and
1452 allow to specify in the command interface if you
1453 want to run pythia/pgs/...
1454 Allow to put the answers to the questions in the
1455 proc_card.dat.
1456- OM: Add options for the display command:
1457+ OM: Add options for the display command:
1458 a) display options: return the current option value.
1459 i.e. those set via the set command and/or via the
1460 configuration file
1461@@ -94,29 +132,29 @@
1462 d) display couplings now returns the list of all couplings
1463 with the associated expression
1464 e) display interactions [PART1] [PART2] [PART3] ...
1465- display all interactions containing the particles set
1466+ display all interactions containing the particles set
1467 in arguments
1468- OM: New Python script for the creation of the various html pages.
1469+ OM: New Python script for the creation of the various html pages.
1470 This Requires less disk access for the generation of the files.
1471- OM: Modify error treatment, especially for Invalid commands
1472+ OM: Modify error treatment, especially for Invalid commands
1473 and Configuration problems.
1474- JA: Ensure that we get zero cross section if we have
1475+ JA: Ensure that we get zero cross section if we have
1476 non-parton initial states with proton/antiproton beams
1477- OM: Improve cluster support. MadEvent now supports PBS/Condor/SGE
1478+ OM: Improve cluster support. MadEvent now supports PBS/Condor/SGE
1479 Thanks to Arian Abrahantes for the SGE implementation.
1480- OM: Improve auto-completion (better output/dealing with multi line/...)
1481- OM: Improve the parallel suite and change the release script to run
1482+ OM: Improve auto-completion (better output/dealing with multi line/...)
1483+ OM: Improve the parallel suite and change the release script to run
1484 some of the parallel tests. This ensures even higher stability
1485 of the code for the future releases.
1486- JA: Changed the way gridpacks work: Set granularity to 1
1487+ JA: Changed the way gridpacks work: Set granularity to 1
1488 (so randomly select channels only if they should generate
1489 less than 1 event), but allowing channels to run down to a single
1490 iteration. This removes all old problems with increased
1491 variance for small channels in the gridpacks, while giving
1492 even faster event generation.
1493
1494- Thanks to Johan Alwall, Sho Iwamoto for all the important
1495- testing/bug reports.
1496+ Thanks to Johan Alwall, Sho Iwamoto for all the important
1497+ testing/bug reports.
1498
1499
1500 1.3.33 (01/01/12) JA: Revisited colors for propagators in addmothers.f
1501
1502=== modified file 'aloha/aloha_object.py'
1503--- aloha/aloha_object.py 2012-01-09 09:34:39 +0000
1504+++ aloha/aloha_object.py 2012-03-09 00:04:18 +0000
1505@@ -551,7 +551,7 @@
1506
1507 i1 , i2, i3, i4 = perm
1508 #formula found on wikipedia
1509- return ((i2-i1) * (i3-i1) *(i4-i1) * (i3-i2) * (i4-i2) *(i4-i3))/12
1510+ return -1 * ((i2-i1) * (i3-i1) *(i4-i1) * (i3-i2) * (i4-i2) *(i4-i3))/12
1511
1512 # DEFINE THE REPRESENTATION OF EPSILON
1513
1514
1515=== modified file 'aloha/aloha_writers.py'
1516--- aloha/aloha_writers.py 2012-01-31 16:28:22 +0000
1517+++ aloha/aloha_writers.py 2012-03-09 00:04:18 +0000
1518@@ -17,6 +17,7 @@
1519 type_to_variable = {2:'F',3:'V',5:'T',1:'S'}
1520 type_to_size = {'S':3, 'T':18, 'V':6, 'F':6}
1521
1522+
1523 def __init__(self, abstract_routine, dirpath):
1524
1525
1526@@ -34,10 +35,20 @@
1527 self.namestring = name
1528 self.abstractname = abstract_routine.name
1529 self.comment = abstract_routine.infostr
1530- self.offshell = abstract_routine.outgoing
1531+ self.offshell = abstract_routine.outgoing
1532+
1533 self.symmetries = abstract_routine.symmetries
1534 self.tag = abstract_routine.tag
1535
1536+ self.outgoing = self.offshell
1537+ if 'C%s' %((self.outgoing + 1) // 2) in self.tag:
1538+ #flip the outgoing tag if in conjugate
1539+ self.outgoing = self.outgoing + self.outgoing % 2 - (self.outgoing +1) % 2
1540+
1541+
1542+
1543+
1544+
1545 #prepare the necessary object
1546 self.collect_variables() # Look for the different variables
1547 self.make_all_lists() # Compute the expression for the call ordering
1548@@ -59,8 +70,8 @@
1549 elif len(indices) == 2:
1550 return 4 * indices[0] + indices[1] + start
1551 else:
1552- raise Exception, 'WRONG CONTRACTION OF LORENTZ OBJECT for routine %s' \
1553- % self.namestring
1554+ raise Exception, 'WRONG CONTRACTION OF LORENTZ OBJECT for routine %s: %s' \
1555+ % (self.namestring, indices)
1556
1557 def collect_variables(self):
1558 """Collects Momenta,Mass,Width into lists"""
1559@@ -100,7 +111,7 @@
1560
1561 def write_obj(self, obj):
1562 """Calls the appropriate writing routine"""
1563-
1564+
1565 try:
1566 vartype = obj.vartype
1567 except:
1568@@ -173,11 +184,22 @@
1569 outgoing = self.offshell
1570
1571 call_arg = [] #incoming argument of the routine
1572+
1573+ conjugate = [2*(int(c[1:])-1) for c in self.tag if c[0] == 'C']
1574
1575-
1576- call_arg = ['%s%d' % (spin, index +1)
1577- for index,spin in enumerate(self.particles)
1578- if outgoing != index +1]
1579+ for index,spin in enumerate(self.particles):
1580+ if self.offshell == index + 1:
1581+ continue
1582+
1583+ if index in conjugate:
1584+ index2, spin2 = index+1, self.particles[index+1]
1585+ call_arg.append('%s%d' % (spin2, index2 +1))
1586+ #call_arg.append('%s%d' % (spin, index +1))
1587+ elif index-1 in conjugate:
1588+ index2, spin2 = index-1, self.particles[index-1]
1589+ call_arg.append('%s%d' % (spin2, index2 +1))
1590+ else:
1591+ call_arg.append('%s%d' % (spin, index +1))
1592
1593 return call_arg
1594
1595@@ -213,6 +235,15 @@
1596 else:
1597 global_sign = -1
1598
1599+ flipped = [2*(int(c[1:])-1) for c in self.tag if c.startswith('C')]
1600+# if self.offshell % 2:
1601+# not_flip = self.offshell - 1
1602+# if not_flip in flipped:
1603+# flipped.remove(not_flip)
1604+# else:
1605+# not_flip = self.offshell - 2
1606+# if not_flip in flipped:
1607+# flipped.remove(not_flip)
1608
1609 for index, spin in enumerate(self.particles):
1610 assert(spin in ['S','F','V','T'])
1611@@ -223,12 +254,15 @@
1612 elif nb_fermion % 2 == 0:
1613 sign = global_sign
1614 nb_fermion += 1
1615+ if index in flipped:
1616+ sign *= -1
1617 else:
1618 sign = -1 * global_sign
1619 nb_fermion += 1
1620-
1621+ if index-1 in flipped:
1622+ sign *= -1
1623 # No need to include the outgoing particles in the definitions
1624- if index == self.offshell -1:
1625+ if index == self.outgoing -1:
1626 continue
1627
1628 # write the
1629@@ -245,6 +279,8 @@
1630 """ make the list of declaration nedded by the header """
1631
1632 declare_list = []
1633+
1634+
1635 for index, spin in enumerate(self.particles):
1636 # First define the size of the associate Object
1637 declare_list.append(self.declare_dict[spin] % (index + 1) )
1638@@ -294,11 +330,11 @@
1639 if not alredy_update:
1640 declare_list.append('double complex denom')
1641 declare_list.append('double precision M%(id)d, W%(id)d' %
1642- {'id': self.offshell})
1643+ {'id': self.outgoing})
1644 call_arg = '%(args)s, COUP, M%(id)d, W%(id)d, %(spin)s%(id)d' % \
1645 {'args': ', '.join(CallList),
1646 'spin': self.particles[self.offshell -1],
1647- 'id': self.offshell}
1648+ 'id': self.outgoing}
1649 str_out = ' subroutine %s(%s)\n' % (name, call_arg)
1650
1651 # Forcing implicit None
1652@@ -345,7 +381,7 @@
1653 offshell_size = self.type_to_size[offshelltype]
1654 #Implement the conservation of Energy Impulsion
1655 for i in range(-1,1):
1656- str_out += '%s%d(%d)= ' % (offshelltype, self.offshell, \
1657+ str_out += '%s%d(%d)= ' % (offshelltype, self.outgoing, \
1658 offshell_size + i)
1659
1660 pat=re.compile(r'^[-+]?(?P<spin>\w)')
1661@@ -360,9 +396,23 @@
1662 index = int(mom[1:])
1663 type = self.particles[index - 1]
1664 energy_pos = self.type_to_size[type] -1
1665- sign = ''
1666+ sign = 1
1667 if self.offshell == index and type in ['V','S']:
1668+ sign = -1
1669+ if 'C%s' % ((index +1) // 2) in self.tag:
1670+ if index == self.outgoing:
1671+ pass
1672+ elif index % 2 and index -1 != self.outgoing:
1673+ pass
1674+ elif index % 2 == 1 and index + 1 != self.outgoing:
1675+ pass
1676+ else:
1677+ sign *= -1
1678+
1679+ if sign == -1 :
1680 sign = '-'
1681+ else:
1682+ sign = ''
1683
1684 str_out += '%s(0) = %s dble(%s%d(%d))\n' % (mom, sign, type, index, energy_pos)
1685 str_out += '%s(1) = %s dble(%s%d(%d))\n' % (mom, sign, type, index, energy_pos + 1)
1686@@ -424,7 +474,7 @@
1687 OutString = OutString + string + '\n'
1688 else:
1689 OffShellParticle = '%s%d' % (self.particles[self.offshell-1],\
1690- self.offshell)
1691+ self.outgoing)
1692 numerator = self.obj.numerator
1693 denominator = self.obj.denominator
1694 for ind in denominator.listindices():
1695@@ -537,11 +587,11 @@
1696 else:
1697 main = '%(spin)s%(id)d' % \
1698 {'spin': self.particles[offshell -1],
1699- 'id': self.offshell}
1700+ 'id': self.outgoing}
1701 call_arg = '%(args)s, %(COUP)s, M%(id)d, W%(id)d, %(LAST)s' % \
1702 {'args': ', '.join(self.calllist['CallList']),
1703 'COUP':'COUP%d',
1704- 'id': self.offshell,
1705+ 'id': self.outgoing,
1706 'LAST': '%s'}
1707
1708 # make the first call
1709@@ -683,8 +733,8 @@
1710 str_out = 'void %(name)s(%(args)s, double M%(number)d, double W%(number)d, complex<double>%(out)s%(number)d[])' % \
1711 {'name': name,
1712 'args': ','.join(CallList+ ['complex<double> COUP']),
1713- 'out': self.particles[OffShellParticle],
1714- 'number': OffShellParticle + 1
1715+ 'out': self.particles[self.outgoing - 1],
1716+ 'number': self.outgoing
1717 }
1718
1719 h_string = str_out + ";\n\n"
1720@@ -715,7 +765,7 @@
1721 offshell_size = self.type_to_size[offshelltype]
1722 #Implement the conservation of Energy Impulsion
1723 for i in range(-2,0):
1724- str_out += '%s%d[%d]= ' % (offshelltype, self.offshell,
1725+ str_out += '%s%d[%d]= ' % (offshelltype, self.outgoing,
1726 offshell_size + i)
1727
1728 pat=re.compile(r'^[-+]?(?P<spin>\w)')
1729@@ -731,9 +781,23 @@
1730
1731 type = self.particles[index - 1]
1732 energy_pos = self.type_to_size[type] - 2
1733- sign = ''
1734+ sign = 1
1735 if self.offshell == index and type in ['V', 'S']:
1736+ sign = -1
1737+ if 'C%s' % ((index +1) // 2) in self.tag:
1738+ if index == self.outgoing:
1739+ pass
1740+ elif index % 2 and index -1 != self.outgoing:
1741+ pass
1742+ elif index %2 == 1 and index + 1 != self.outgoing:
1743+ pass
1744+ else:
1745+ sign *= -1
1746+
1747+ if sign == -1 :
1748 sign = '-'
1749+ else:
1750+ sign = ''
1751
1752 str_out += '%s[0] = %s%s%d[%d].real();\n' % (mom, sign, type, index, energy_pos)
1753 str_out += '%s[1] = %s%s%d[%d].real();\n' % (mom, sign, type, index, energy_pos + 1)
1754@@ -791,7 +855,7 @@
1755 string = string.replace('+-', '-')
1756 OutString = OutString + string + ';\n'
1757 else:
1758- OffShellParticle = self.particles[self.offshell-1]+'%s'%(self.offshell)
1759+ OffShellParticle = self.particles[self.offshell-1]+'%s'%(self.outgoing)
1760 numerator = self.obj.numerator
1761 denominator = self.obj.denominator
1762 for ind in denominator.listindices():
1763@@ -1061,9 +1125,19 @@
1764
1765 WriteALOHA.__init__(self, abstract_routine, dirpath)
1766 self.outname = '%s%s' % (self.particles[self.offshell -1], \
1767- self.offshell)
1768-
1769-
1770+ self.outgoing)
1771+
1772+ @staticmethod
1773+ def change_number_format(obj):
1774+ if obj.real == 0 and obj.imag:
1775+ if int(obj.imag) == obj.imag:
1776+ return '%ij' % obj.imag
1777+ else:
1778+ return '%sj' % str(obj.imag)
1779+ else:
1780+ return str(obj)
1781+
1782+
1783 def change_var_format(self, name):
1784 """Formatting the variable name to Python format
1785 start to count at zero"""
1786@@ -1138,7 +1212,7 @@
1787 str_out += 'def %(name)s(%(args)s, COUP, M%(id)d, W%(id)d):\n' % \
1788 {'name': name,
1789 'args': ', '.join(CallList),
1790- 'id': self.offshell}
1791+ 'id': self.outgoing}
1792 return str_out
1793
1794 def make_declaration_list(self):
1795@@ -1181,14 +1255,29 @@
1796 index = int(mom[1:])
1797 type = self.particles[index - 1]
1798 energy_pos = self.type_to_size[type] -2
1799- sign = ''
1800+ sign = 1
1801 if self.offshell == index and type in ['V','S']:
1802- sign = '-'
1803+ sign = -1
1804+
1805+ if 'C%s' % ((index +1) // 2) in self.tag:
1806+ if index == self.outgoing:
1807+ pass
1808+ elif index % 2 and index -1 != self.outgoing:
1809+ pass
1810+ elif index %2 == 1 and index + 1 != self.outgoing:
1811+ pass
1812+ else:
1813+ sign *= -1
1814+
1815+ if sign == -1 :
1816+ sign = '- '
1817+ else:
1818+ sign = ''
1819
1820 str_out += '%s = [%scomplex(%s%d[%d]).real, \\\n' % (mom, sign, type, index, energy_pos)
1821- str_out += ' %s complex(%s%d[%d]).real, \\\n' % ( sign, type, index, energy_pos + 1)
1822- str_out += ' %s complex(%s%d[%d]).imag, \\\n' % ( sign, type, index, energy_pos + 1)
1823- str_out += ' %s complex(%s%d[%d]).imag]\n' % ( sign, type, index, energy_pos)
1824+ str_out += ' %scomplex(%s%d[%d]).real, \\\n' % ( sign, type, index, energy_pos + 1)
1825+ str_out += ' %scomplex(%s%d[%d]).imag, \\\n' % ( sign, type, index, energy_pos + 1)
1826+ str_out += ' %scomplex(%s%d[%d]).imag]\n' % ( sign, type, index, energy_pos)
1827
1828 # Definition for the One Over Mass**2 terms
1829 for elem in overm:
1830@@ -1260,17 +1349,7 @@
1831 text += header
1832
1833 # Define which part of the routine should be called
1834- addon = ''
1835- if 'C' in self.namestring:
1836- short_name, addon = name.split('C',1)
1837- if addon.split('_')[0].isdigit():
1838- addon = 'C' +self.namestring.split('C',1)[1]
1839- elif all([n.isdigit() for n in addon.split('_')[0].split('C')]):
1840- addon = 'C' +self.namestring.split('C',1)[1]
1841- else:
1842- addon = '_%s' % self.offshell
1843- else:
1844- addon = '_%s' % self.offshell
1845+ addon = ''.join(self.tag) + '_%s' % self.offshell
1846
1847 # how to call the routine
1848 if not offshell:
1849@@ -1282,11 +1361,11 @@
1850 else:
1851 main = '%(spin)s%(id)d' % \
1852 {'spin': self.particles[self.offshell -1],
1853- 'id': self.offshell}
1854+ 'id': self.outgoing}
1855 call_arg = '%(args)s, %(COUP)s, M%(id)d, W%(id)d' % \
1856 {'args': ', '.join(self.calllist['CallList']),
1857 'COUP':'COUP%d',
1858- 'id': self.offshell}
1859+ 'id': self.outgoing}
1860
1861 # make the first call
1862 line = " %s = %s%s("+call_arg+")\n"
1863
1864=== modified file 'aloha/create_aloha.py'
1865--- aloha/create_aloha.py 2012-02-01 20:26:10 +0000
1866+++ aloha/create_aloha.py 2012-03-09 00:04:18 +0000
1867@@ -198,6 +198,11 @@
1868 aloha_lib.USE_TAG=set()
1869 #multiply by the wave functions
1870 nb_spinor = 0
1871+ outgoing = self.outgoing
1872+ if (outgoing + 1) // 2 in self.conjg:
1873+ #flip the outgoing tag if in conjugate
1874+ outgoing = outgoing + outgoing % 2 - (outgoing +1) % 2
1875+
1876 if not self.routine_kernel:
1877 AbstractRoutineBuilder.counter += 1
1878 logger.info('aloha creates %s routines' % self.name)
1879@@ -213,21 +218,25 @@
1880 else:
1881 lorentz = self.routine_kernel
1882 aloha_lib.USE_TAG = set(self.kernel_tag)
1883- for (i, spin ) in enumerate(self.spins):
1884+
1885+
1886+ for (i, spin ) in enumerate(self.spins):
1887 id = i + 1
1888+
1889 #Check if this is the outgoing particle
1890- if id == self.outgoing:
1891+ if id == outgoing:
1892 if spin == 1:
1893 lorentz *= complex(0,1)
1894 elif spin == 2:
1895- # shift the tag if we multiply by C matrices
1896- if (id+1) // 2 in self.conjg:
1897- id += _conjugate_gap
1898- nb_spinor += 1
1899- if nb_spinor %2:
1900- lorentz *= SpinorPropagator(id, 'I2', self.outgoing)
1901+ # shift and flip the tag if we multiply by C matrices
1902+ if (id + 1) // 2 in self.conjg:
1903+ id += _conjugate_gap + id % 2 - (id +1) % 2
1904+ if id % 2:
1905+ #propagator outcoming
1906+ lorentz *= SpinorPropagator(id, 'I2', outgoing)
1907 else:
1908- lorentz *= SpinorPropagator('I2', id, self.outgoing)
1909+ #propagator incoming
1910+ lorentz *= SpinorPropagator('I2', id, outgoing)
1911 elif spin == 3 :
1912 lorentz *= VectorPropagator(id, 'I2', id)
1913 elif spin == 5 :
1914@@ -248,10 +257,9 @@
1915 elif spin == 2:
1916 # shift the tag if we multiply by C matrices
1917 if (id+1) // 2 in self.conjg:
1918- spin_id = id + _conjugate_gap
1919+ spin_id = id + _conjugate_gap + id % 2 - (id +1) % 2
1920 else:
1921 spin_id = id
1922- nb_spinor += 1
1923 lorentz *= Spinor(spin_id, id)
1924 elif spin == 3:
1925 lorentz *= Vector(id, id)
1926@@ -262,8 +270,8 @@
1927 'The spin value %s is not supported yet' % spin)
1928
1929 # If no particle OffShell
1930- if self.outgoing:
1931- lorentz /= DenominatorPropagator(self.outgoing)
1932+ if outgoing:
1933+ lorentz /= DenominatorPropagator(outgoing)
1934 #lorentz.tag.add('OM%s' % self.outgoing )
1935 #lorentz.tag.add('P%s' % self.outgoing)
1936 else:
1937@@ -273,7 +281,7 @@
1938 lorentz = lorentz.simplify()
1939
1940 lorentz = lorentz.expand()
1941- if self.outgoing and self.spins[self.outgoing-1] == 5:
1942+ if outgoing and self.spins[outgoing-1] == 5:
1943 if not self.aloha_lib:
1944 AbstractRoutineBuilder.load_library()
1945 if self.spin2_massless:
1946
1947=== modified file 'aloha/template_files/aloha_functions.f'
1948--- aloha/template_files/aloha_functions.f 2010-09-28 10:05:41 +0000
1949+++ aloha/template_files/aloha_functions.f 2012-03-09 00:04:18 +0000
1950@@ -219,8 +219,8 @@
1951
1952 sqm(0) = dsqrt(abs(fmass)) ! possibility of negative fermion masses
1953 sqm(1) = sign(sqm(0),fmass) ! possibility of negative fermion masses
1954- ip = -((1+nh)/2)
1955- im = (1-nh)/2
1956+ ip = -((1-nh)/2) * nhel
1957+ im = (1+nh)/2* nhel
1958
1959 fo(1) = im * sqm(im)
1960 fo(2) = ip*nsf * sqm(im)
1961
1962=== modified file 'aloha/template_files/oxxxxx.cc'
1963--- aloha/template_files/oxxxxx.cc 2010-07-26 04:28:51 +0000
1964+++ aloha/template_files/oxxxxx.cc 2012-03-09 00:04:18 +0000
1965@@ -14,8 +14,8 @@
1966 if (pp == 0.000){
1967 sqm[0] = pow(abs(fmass),0.5);
1968 sqm[1] = Sgn(sqm[0],fmass);
1969- ip = -((1+nh)/2);
1970- im = (1-nh)/2;
1971+ ip = -((1-nh)/2) * nhel ;
1972+ im = (1+nh)/2 * nhel;
1973 fo[0] = im *sqm[im];
1974 fo[1] = ip*nsf*sqm[im];
1975 fo[2] = im*nsf*sqm[-ip];
1976@@ -27,8 +27,8 @@
1977 sf[1] = double(1+nsf-(1-nsf)*nh)*0.5;
1978 omega[0] = pow(p[0]+pp,0.5);
1979 omega[1] = fmass/omega[0];
1980- ip = (1+nh)/2;
1981- im = (1-nh)/2;
1982+ ip = (1+nh)/2 ;
1983+ im = (1-nh)/2 ;
1984 sfomeg[0] = sf[0]*omega[ip];
1985 sfomeg[1] = sf[1]*omega[im];
1986 pp3 = max(pp+p[3],0.00);
1987
1988=== modified file 'aloha/template_files/wavefunctions.py'
1989--- aloha/template_files/wavefunctions.py 2011-01-07 23:13:28 +0000
1990+++ aloha/template_files/wavefunctions.py 2012-03-09 00:04:18 +0000
1991@@ -94,8 +94,8 @@
1992 pp = min(p[0],sqrt(p[1]**2 + p[2]**2 + p[3]**2 ))
1993 if (pp == 0.):
1994 sqm = sqrt(abs(fmass))
1995- ip = -((1+nh)/2)
1996- im = (1-nh)/2
1997+ ip = -((1-nh)/2) * nhel
1998+ im = (1+nh)/2 * nhel
1999
2000 fo[0] = im*sqm
2001 fo[1] = ip*nsf*sqm
2002
2003=== modified file 'bin/create_aloha_release.py'
2004--- bin/create_aloha_release.py 2011-10-12 18:54:53 +0000
2005+++ bin/create_aloha_release.py 2012-03-09 00:04:18 +0000
2006@@ -56,7 +56,7 @@
2007 root_path = path.split(path.dirname(path.realpath( __file__ )))[0]
2008 sys.path.append(root_path)
2009
2010-import madgraph.iolibs.misc as misc
2011+import madgraph.various.misc as misc
2012 import madgraph.iolibs.files as files_routines
2013 from madgraph import MG5DIR
2014
2015
2016=== modified file 'bin/create_release.py'
2017--- bin/create_release.py 2011-11-10 18:36:25 +0000
2018+++ bin/create_release.py 2012-03-09 00:04:18 +0000
2019@@ -54,7 +54,7 @@
2020 root_path = path.split(path.dirname(path.realpath( __file__ )))[0]
2021 sys.path.append(root_path)
2022
2023-import madgraph.iolibs.misc as misc
2024+import madgraph.various.misc as misc
2025 from madgraph import MG5DIR
2026
2027 # Write out nice usage message if called with -h or --help
2028@@ -169,10 +169,10 @@
2029 #mixes the path for the tests
2030 import madgraph
2031 reload(madgraph)
2032-import madgraph.iolibs
2033-reload(madgraph.iolibs)
2034-import madgraph.iolibs.misc
2035-reload(madgraph.iolibs.misc)
2036+import madgraph.various
2037+reload(madgraph.various)
2038+import madgraph.various.misc
2039+reload(madgraph.various.misc)
2040
2041
2042 test_results = test_manager.run(package=os.path.join('tests',
2043
2044=== modified file 'madgraph/VERSION'
2045--- madgraph/VERSION 2012-02-16 17:58:28 +0000
2046+++ madgraph/VERSION 2012-03-09 00:04:18 +0000
2047@@ -1,3 +1,3 @@
2048-version = 1.4.2
2049-date = 2012-02-16
2050+version = 1.4.3
2051+date = 2012-03-08
2052
2053
2054=== modified file 'madgraph/core/base_objects.py'
2055--- madgraph/core/base_objects.py 2011-12-10 01:52:27 +0000
2056+++ madgraph/core/base_objects.py 2012-03-09 00:04:18 +0000
2057@@ -1519,6 +1519,7 @@
2058 # allowed. This enables generating e.g. Z/gamma as s-channel
2059 # propagators.
2060 self['required_s_channels'] = []
2061+ self['forbidden_onsh_s_channels'] = []
2062 self['forbidden_s_channels'] = []
2063 self['forbidden_particles'] = []
2064 self['is_decay_chain'] = False
2065@@ -1562,7 +1563,7 @@
2066 raise self.PhysicsObjectError, \
2067 "Not valid PDG code %d for s-channel particle" % i
2068
2069- if name == 'forbidden_s_channels':
2070+ if name in ['forbidden_onsh_s_channels', 'forbidden_s_channels']:
2071 if not isinstance(value, list):
2072 raise self.PhysicsObjectError, \
2073 "%s is not a valid list" % str(value)
2074@@ -1619,7 +1620,8 @@
2075 """Return process property names as a nicely sorted list."""
2076
2077 return ['legs', 'orders', 'overall_orders', 'model', 'id',
2078- 'required_s_channels', 'forbidden_s_channels',
2079+ 'required_s_channels', 'forbidden_onsh_s_channels',
2080+ 'forbidden_s_channels',
2081 'forbidden_particles', 'is_decay_chain', 'decay_chains']
2082
2083 def nice_string(self, indent=0):
2084@@ -1648,8 +1650,15 @@
2085 prevleg = leg
2086
2087 # Add forbidden s-channels
2088+ if self['forbidden_onsh_s_channels']:
2089+ mystr = mystr + '$ '
2090+ for forb_id in self['forbidden_onsh_s_channels']:
2091+ forbpart = self['model'].get('particle_dict')[forb_id]
2092+ mystr = mystr + forbpart.get_name() + ' '
2093+
2094+ # Add double forbidden s-channels
2095 if self['forbidden_s_channels']:
2096- mystr = mystr + '$ '
2097+ mystr = mystr + '$$ '
2098 for forb_id in self['forbidden_s_channels']:
2099 forbpart = self['model'].get('particle_dict')[forb_id]
2100 mystr = mystr + forbpart.get_name() + ' '
2101@@ -1710,8 +1719,15 @@
2102 prevleg = leg
2103
2104 # Add forbidden s-channels
2105+ if self['forbidden_onsh_s_channels']:
2106+ mystr = mystr + '$ '
2107+ for forb_id in self['forbidden_onsh_s_channels']:
2108+ forbpart = self['model'].get('particle_dict')[forb_id]
2109+ mystr = mystr + forbpart.get_name() + ' '
2110+
2111+ # Add double forbidden s-channels
2112 if self['forbidden_s_channels']:
2113- mystr = mystr + '$ '
2114+ mystr = mystr + '$$ '
2115 for forb_id in self['forbidden_s_channels']:
2116 forbpart = self['model'].get('particle_dict')[forb_id]
2117 mystr = mystr + forbpart.get_name() + ' '
2118@@ -2134,8 +2150,15 @@
2119 prevleg = leg
2120
2121 # Add forbidden s-channels
2122+ if self['forbidden_onsh_s_channels']:
2123+ mystr = mystr + '$ '
2124+ for forb_id in self['forbidden_onsh_s_channels']:
2125+ forbpart = self['model'].get('particle_dict')[forb_id]
2126+ mystr = mystr + forbpart.get_name() + ' '
2127+
2128+ # Add double forbidden s-channels
2129 if self['forbidden_s_channels']:
2130- mystr = mystr + '$ '
2131+ mystr = mystr + '$$ '
2132 for forb_id in self['forbidden_s_channels']:
2133 forbpart = self['model'].get('particle_dict')[forb_id]
2134 mystr = mystr + forbpart.get_name() + ' '
2135
2136=== modified file 'madgraph/core/diagram_generation.py'
2137--- madgraph/core/diagram_generation.py 2011-11-22 08:36:23 +0000
2138+++ madgraph/core/diagram_generation.py 2012-03-09 00:04:18 +0000
2139@@ -544,18 +544,31 @@
2140 # Add diagrams only if not already in res
2141 res.extend([diag for diag in res_diags if diag not in res])
2142
2143- # Select the diagrams where no forbidden s-channel propagators
2144- # are present.
2145+ # Remove all diagrams with a "double" forbidden s-channel propagator
2146+ # is present.
2147 # Note that we shouldn't look at the last vertex in each
2148 # diagram, since that is the n->0 vertex
2149 if process.get('forbidden_s_channels'):
2150 ninitial = len(filter(lambda leg: leg.get('state') == False,
2151+ process.get('legs')))
2152+ res = base_objects.DiagramList(\
2153+ filter(lambda diagram: \
2154+ not any([vertex.get_s_channel_id(\
2155+ process.get('model'), ninitial) \
2156+ in process.get('forbidden_s_channels')
2157+ for vertex in diagram.get('vertices')[:-1]]),
2158+ res))
2159+
2160+ # Mark forbidden (onshell) s-channel propagators, to forbid onshell
2161+ # generation.
2162+ if process.get('forbidden_onsh_s_channels'):
2163+ ninitial = len(filter(lambda leg: leg.get('state') == False,
2164 process.get('legs')))
2165 verts = base_objects.VertexList(sum([[vertex for vertex \
2166 in diagram.get('vertices')[:-1]
2167 if vertex.get_s_channel_id(\
2168 process.get('model'), ninitial) \
2169- in process.get('forbidden_s_channels')] \
2170+ in process.get('forbidden_onsh_s_channels')] \
2171 for diagram in res], []))
2172 for vert in verts:
2173 # Use onshell = False to indicate that this s-channel is forbidden
2174@@ -1306,6 +1319,8 @@
2175 'orders': process_definition.get('orders'),
2176 'required_s_channels': \
2177 process_definition.get('required_s_channels'),
2178+ 'forbidden_onsh_s_channels': \
2179+ process_definition.get('forbidden_onsh_s_channels'),
2180 'forbidden_s_channels': \
2181 process_definition.get('forbidden_s_channels'),
2182 'forbidden_particles': \
2183@@ -1339,6 +1354,7 @@
2184 # Check for successful crossings, unless we have specified
2185 # properties that break crossing symmetry
2186 if not process.get('required_s_channels') and \
2187+ not process.get('forbidden_onsh_s_channels') and \
2188 not process.get('forbidden_s_channels') and \
2189 not process.get('is_decay_chain'):
2190 try:
2191@@ -1517,6 +1533,8 @@
2192 'orders': coupling_orders_now,
2193 'required_s_channels': \
2194 process_definition.get('required_s_channels'),
2195+ 'forbidden_onsh_s_channels': \
2196+ process_definition.get('forbidden_onsh_s_channels'),
2197 'forbidden_s_channels': \
2198 process_definition.get('forbidden_s_channels'),
2199 'forbidden_particles': \
2200
2201=== added file 'madgraph/interface/Loop_interface.py'
2202--- madgraph/interface/Loop_interface.py 1970-01-01 00:00:00 +0000
2203+++ madgraph/interface/Loop_interface.py 2012-03-09 00:04:18 +0000
2204@@ -0,0 +1,49 @@
2205+################################################################################
2206+#
2207+# Copyright (c) 2009 The MadGraph Development team and Contributors
2208+#
2209+# This file is a part of the MadGraph 5 project, an application which
2210+# automatically generates Feynman diagrams and matrix elements for arbitrary
2211+# high-energy processes in the Standard Model and beyond.
2212+#
2213+# It is subject to the MadGraph license which should accompany this
2214+# distribution.
2215+#
2216+# For more information, please visit: http://madgraph.phys.ucl.ac.be
2217+#
2218+################################################################################
2219+"""A user friendly command line interface to access all MadGraph features.
2220+ Uses the cmd package for command interpretation and tab completion.
2221+"""
2222+
2223+import os
2224+
2225+import madgraph
2226+from madgraph import MG4DIR, MG5DIR, MadGraph5Error
2227+import madgraph.interface.madgraph_interface as mg_interface
2228+
2229+#usefull shortcut
2230+pjoin = os.path.join
2231+
2232+class CheckLoop(mg_interface.CheckValidForCmd):
2233+ pass
2234+
2235+class CheckLoopWeb(mg_interface.CheckValidForCmdWeb, CheckLoop):
2236+ pass
2237+
2238+class CompleteLoop(mg_interface.CompleteForCmd):
2239+ pass
2240+
2241+class HelpLoop(mg_interface.HelpToCmd):
2242+ pass
2243+
2244+class LoopInterface(CheckLoop, CompleteLoop, HelpLoop, mg_interface.MadGraphCmd):
2245+
2246+ def do_generate(self, *args,**opt):
2247+ 'hello'
2248+ print 'hello'
2249+ pass
2250+
2251+class LoopInterfaceWeb(mg_interface.CheckValidForCmdWeb, LoopInterface):
2252+ pass
2253+
2254
2255=== removed file 'madgraph/interface/Loop_interface.py'
2256--- madgraph/interface/Loop_interface.py 2012-02-15 23:55:51 +0000
2257+++ madgraph/interface/Loop_interface.py 1970-01-01 00:00:00 +0000
2258@@ -1,49 +0,0 @@
2259-################################################################################
2260-#
2261-# Copyright (c) 2009 The MadGraph Development team and Contributors
2262-#
2263-# This file is a part of the MadGraph 5 project, an application which
2264-# automatically generates Feynman diagrams and matrix elements for arbitrary
2265-# high-energy processes in the Standard Model and beyond.
2266-#
2267-# It is subject to the MadGraph license which should accompany this
2268-# distribution.
2269-#
2270-# For more information, please visit: http://madgraph.phys.ucl.ac.be
2271-#
2272-################################################################################
2273-"""A user friendly command line interface to access all MadGraph features.
2274- Uses the cmd package for command interpretation and tab completion.
2275-"""
2276-
2277-import os
2278-
2279-import madgraph
2280-from madgraph import MG4DIR, MG5DIR, MadGraph5Error
2281-import madgraph.interface.madgraph_interface as mg_interface
2282-
2283-#usefull shortcut
2284-pjoin = os.path.join
2285-
2286-class CheckLoop(mg_interface.CheckValidForCmd):
2287- pass
2288-
2289-class CheckLoopWeb(mg_interface.CheckValidForCmdWeb, CheckLoop):
2290- pass
2291-
2292-class CompleteLoop(mg_interface.CompleteForCmd):
2293- pass
2294-
2295-class HelpLoop(mg_interface.HelpToCmd):
2296- pass
2297-
2298-class LoopInterface(CheckLoop, CompleteLoop, HelpLoop, mg_interface.MadGraphCmd):
2299-
2300- def do_generate(self, *args,**opt):
2301- 'hello'
2302- print 'hello'
2303- pass
2304-
2305-class LoopInterfaceWeb(mg_interface.CheckValidForCmdWeb, LoopInterface):
2306- pass
2307-
2308
2309=== modified file 'madgraph/interface/coloring_logging.py'
2310--- madgraph/interface/coloring_logging.py 2011-12-14 22:12:33 +0000
2311+++ madgraph/interface/coloring_logging.py 2012-03-09 00:04:18 +0000
2312@@ -3,9 +3,9 @@
2313 BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
2314
2315 COLORS = {
2316- 'WARNING' : RED,
2317+ 'WARNING' : BLUE,
2318 'INFO' : BLACK,
2319- 'DEBUG' : BLUE,
2320+ 'DEBUG' : GREEN,
2321 'CRITICAL' : RED,
2322 'ERROR' : RED,
2323 'RED' : RED,
2324
2325=== modified file 'madgraph/interface/extended_cmd.py'
2326--- madgraph/interface/extended_cmd.py 2012-02-15 23:55:51 +0000
2327+++ madgraph/interface/extended_cmd.py 2012-03-09 00:04:18 +0000
2328@@ -35,10 +35,14 @@
2329 logger_stderr = logging.getLogger('fatalerror') # for stderr
2330
2331 try:
2332- import madgraph.iolibs.misc as misc
2333+ import madgraph.various.misc as misc
2334+ from madgraph import MG5DIR
2335+ MADEVENT = False
2336 except:
2337 import internal.misc as misc
2338+ MADEVENT = True
2339
2340+pjoin = os.path.join
2341
2342 class TimeOutError(Exception):
2343 """Class for run-time error"""
2344@@ -213,7 +217,116 @@
2345 # print '\n'
2346 return None
2347
2348-class Cmd(BasicCmd):
2349+class CheckCmd(object):
2350+ """Extension of the cmd object for only the check command"""
2351+
2352+ def check_history(self, args):
2353+ """check the validity of line"""
2354+
2355+ if len(args) > 1:
2356+ self.help_history()
2357+ raise self.InvalidCmd('\"history\" command takes at most one argument')
2358+
2359+ if not len(args):
2360+ return
2361+
2362+ if args[0] =='.':
2363+ if not self._export_dir:
2364+ raise self.InvalidCmd("No default directory is defined for \'.\' option")
2365+ elif args[0] != 'clean':
2366+ dirpath = os.path.dirname(args[0])
2367+ if dirpath and not os.path.exists(dirpath) or \
2368+ os.path.isdir(args[0]):
2369+ raise self.InvalidCmd("invalid path %s " % dirpath)
2370+
2371+ def check_save(self, args):
2372+ """check that the line is compatible with save options"""
2373+
2374+ if len(args) > 2:
2375+ self.help_save()
2376+ raise self.InvalidCmd, '\'%s\' is not recoginzed as first argument.'
2377+
2378+ if len(args) == 2:
2379+ if args[0] != 'options':
2380+ self.help_save()
2381+ raise self.InvalidCmd, '\'%s\' is not recoginzed as first argument.' % \
2382+ args[0]
2383+ else:
2384+ args.pop(0)
2385+
2386+class HelpCmd(object):
2387+ """Extension of the cmd object for only the help command"""
2388+
2389+ def help_quit(self):
2390+ logger.info("syntax: quit")
2391+ logger.info("-- terminates the application")
2392+
2393+ help_EOF = help_quit
2394+
2395+ def help_history(self):
2396+ logger.info("syntax: history [FILEPATH|clean|.] ")
2397+ logger.info(" If FILEPATH is \'.\' and \'output\' is done,")
2398+ logger.info(" Cards/proc_card_mg5.dat will be used.")
2399+ logger.info(" If FILEPATH is omitted, the history will be output to stdout.")
2400+ logger.info(" \"clean\" will remove all entries from the history.")
2401+
2402+ def help_help(self):
2403+ logger.info("syntax: help")
2404+ logger.info("-- access to the in-line help" )
2405+
2406+ def help_save(self):
2407+ """help text for save"""
2408+ logger.info("syntax: save [options] [FILEPATH]")
2409+ logger.info("-- save options configuration to filepath.")
2410+
2411+ def help_display(self):
2412+ """help for display command"""
2413+ logger.info("syntax: display " + "|".join(self._display_opts))
2414+ logger.info("-- display a the status of various internal state variables")
2415+
2416+class CompleteCmd(object):
2417+ """Extension of the cmd object for only the complete command"""
2418+
2419+ def complete_display(self,text, line, begidx, endidx):
2420+ args = self.split_arg(line[0:begidx])
2421+ # Format
2422+ if len(args) == 1:
2423+ return self.list_completion(text, self._display_opts)
2424+
2425+ def complete_history(self, text, line, begidx, endidx):
2426+ "Complete the history command"
2427+
2428+ args = self.split_arg(line[0:begidx])
2429+
2430+ # Directory continuation
2431+ if args[-1].endswith(os.path.sep):
2432+ return self.path_completion(text,
2433+ os.path.join('.',*[a for a in args \
2434+ if a.endswith(os.path.sep)]))
2435+
2436+ if len(args) == 1:
2437+ return self.path_completion(text)
2438+
2439+ def complete_save(self, text, line, begidx, endidx):
2440+ "Complete the save command"
2441+
2442+ args = self.split_arg(line[0:begidx])
2443+
2444+ # Format
2445+ if len(args) == 1:
2446+ return self.list_completion(text, ['options'])
2447+
2448+ # Directory continuation
2449+ if args[-1].endswith(os.path.sep):
2450+ return self.path_completion(text,
2451+ pjoin('.',*[a for a in args if a.endswith(os.path.sep)]),
2452+ only_dirs = True)
2453+
2454+ # Filename if directory is not given
2455+ if len(args) == 2:
2456+ return self.path_completion(text)
2457+
2458+class Cmd(CheckCmd, HelpCmd, CompleteCmd, BasicCmd):
2459 """Extension of the cmd.Cmd command line.
2460 This extensions supports line breaking, history, comments,
2461 internal call to cmdline, path completion,...
2462@@ -735,51 +848,6 @@
2463 else:
2464 return self.stored_line
2465
2466-
2467- def help_history(self):
2468- logger.info("syntax: history [FILEPATH|clean|.] ")
2469- logger.info(" If FILEPATH is \'.\' and \'output\' is done,")
2470- logger.info(" Cards/proc_card_mg5.dat will be used.")
2471- logger.info(" If FILEPATH is omitted, the history will be output to stdout.")
2472- logger.info(" \"clean\" will remove all entries from the history.")
2473-
2474-
2475-
2476-
2477- def complete_history(self, text, line, begidx, endidx):
2478- "Complete the history command"
2479-
2480- args = self.split_arg(line[0:begidx])
2481-
2482- # Directory continuation
2483- if args[-1].endswith(os.path.sep):
2484- return self.path_completion(text,
2485- os.path.join('.',*[a for a in args \
2486- if a.endswith(os.path.sep)]))
2487-
2488- if len(args) == 1:
2489- return self.path_completion(text)
2490-
2491- def check_history(self, args):
2492- """check the validity of line"""
2493-
2494- if len(args) > 1:
2495- self.help_history()
2496- raise self.InvalidCmd('\"history\" command takes at most one argument')
2497-
2498- if not len(args):
2499- return
2500-
2501- if args[0] =='.':
2502- if not self._export_dir:
2503- raise self.InvalidCmd("No default directory is defined for \'.\' option")
2504- elif args[0] != 'clean':
2505- dirpath = os.path.dirname(args[0])
2506- if dirpath and not os.path.exists(dirpath) or \
2507- os.path.isdir(args[0]):
2508- raise self.InvalidCmd("invalid path %s " % dirpath)
2509-
2510-
2511 # Quit
2512 def do_quit(self, line):
2513 """ exit the mainloop() """
2514@@ -802,11 +870,7 @@
2515 do_EOF = do_quit
2516 do_exit = do_quit
2517
2518- def help_quit(self):
2519- logger.info("syntax: quit")
2520- logger.info("-- terminates the application")
2521-
2522- help_EOF = help_quit
2523+
2524
2525
2526
2527@@ -905,7 +969,7 @@
2528
2529 if args[0] == "options":
2530 outstr = "Value of current Options:\n"
2531- for key, value in self.configuration.items() + self._options.items():
2532+ for key, value in self.options.items():
2533 outstr += '%25s \t:\t%s\n' %(key,value)
2534 output.write(outstr)
2535
2536@@ -929,20 +993,85 @@
2537
2538 pydoc.pager(outstr)
2539
2540- def help_display(self):
2541- """help for display command"""
2542- logger.info("syntax: display " + "|".join(self._display_opts))
2543- logger.info("-- display a the status of various internal state variables")
2544-
2545- def complete_display(self,text, line, begidx, endidx):
2546- args = self.split_arg(line[0:begidx])
2547- # Format
2548- if len(args) == 1:
2549- return self.list_completion(text, self._display_opts)
2550-
2551- def help_help(self):
2552- logger.info("syntax: help")
2553- logger.info("-- access to the in-line help" )
2554+
2555+ def do_save(self, line, check=True):
2556+ """Save the configuration file"""
2557+
2558+ args = self.split_arg(line)
2559+ # Check argument validity
2560+ if check:
2561+ Cmd.check_save(self, args)
2562+
2563+ # find base file for the configuration
2564+ if'HOME' in os.environ and os.environ['HOME'] and \
2565+ os.path.exists(pjoin(os.environ['HOME'], '.mg5', 'mg5_configuration.txt')):
2566+ base = pjoin(os.environ['HOME'], '.mg5', 'mg5_configuration.txt')
2567+ if hasattr(self, 'me_dir'):
2568+ basedir = self.me_dir
2569+ elif not MADEVENT:
2570+ basedir = MG5DIR
2571+ else:
2572+ basedir = os.getcwd()
2573+ elif MADEVENT:
2574+ # launch via ./bin/madevent
2575+ base = pjoin(self.me_dir, 'Cards', 'me5_configuration.txt')
2576+ basedir = self.me_dir
2577+ else:
2578+ if hasattr(self, 'me_dir'):
2579+ base = pjoin(self.me_dir, 'Cards', 'me5_configuration.txt')
2580+ if len(args) == 0 and os.path.exists(base):
2581+ self.write_configuration(base, base, self.me_dir)
2582+ base = pjoin(MG5DIR, 'input', 'mg5_configuration.txt')
2583+ basedir = MG5DIR
2584+
2585+ if len(args) == 0:
2586+ args.append(base)
2587+ self.write_configuration(args[0], base, basedir)
2588+
2589+ def write_configuration(self, filepath, basefile, basedir):
2590+ """Write the configuration file"""
2591+ # We use the default configuration file as a template.
2592+ # to ensure that all configuration information are written we
2593+ # keep track of all key that we need to write.
2594+
2595+ logger.info('save configuration file to %s' % filepath)
2596+ to_write = self.options.keys()[:]
2597+ text = ""
2598+ # Use local configuration => Need to update the path
2599+ for line in file(basefile):
2600+ if '#' in line:
2601+ data, comment = line.split('#',1)
2602+ else:
2603+ data, comment = line, ''
2604+ data = data.split('=')
2605+ if len(data) !=2:
2606+ text += line
2607+ continue
2608+ key = data[0].strip()
2609+ if key in self.options:
2610+ value = str(self.options[key])
2611+ else:
2612+ value = data[1].strip()
2613+ try:
2614+ to_write.remove(key)
2615+ except:
2616+ pass
2617+ if '_path' in key:
2618+ # special case need to update path
2619+ # check if absolute path
2620+ if value.startswith('./'):
2621+ value = os.path.realpath(os.path.join(basedir, value))
2622+ text += '%s = %s # %s \n' % (key, value, comment)
2623+ for key in to_write:
2624+ if key in self.options:
2625+ text += '%s = %s \n' % (key,self.options[key])
2626+ else:
2627+ text += '%s = %s \n' % (key,self.options[key])
2628+ writer = open(filepath,'w')
2629+ writer.write(text)
2630+ writer.close()
2631+
2632+
2633
2634
2635 @staticmethod
2636
2637=== modified file 'madgraph/interface/launch_ext_program.py'
2638--- madgraph/interface/launch_ext_program.py 2012-02-09 18:46:27 +0000
2639+++ madgraph/interface/launch_ext_program.py 2012-03-09 00:04:18 +0000
2640@@ -24,12 +24,15 @@
2641 import time
2642
2643 import madgraph.iolibs.files as files
2644-import madgraph.iolibs.misc as misc
2645 import madgraph.interface.extended_cmd as cmd
2646 import madgraph.interface.madevent_interface as me_cmd
2647+import madgraph.various.misc as misc
2648+
2649 from madgraph import MG4DIR, MG5DIR, MadGraph5Error
2650 from madgraph.iolibs.files import cp
2651
2652+
2653+
2654 logger = logging.getLogger('cmdprint.ext_program')
2655
2656 class ExtLauncher(object):
2657
2658=== modified file 'madgraph/interface/madevent_interface.py'
2659--- madgraph/interface/madevent_interface.py 2012-02-16 11:44:50 +0000
2660+++ madgraph/interface/madevent_interface.py 2012-03-09 00:04:18 +0000
2661@@ -50,13 +50,14 @@
2662 try:
2663 # import from madgraph directory
2664 import madgraph.interface.extended_cmd as cmd
2665- import madgraph.iolibs.misc as misc
2666 import madgraph.iolibs.files as files
2667 import madgraph.iolibs.save_load_object as save_load_object
2668+ import madgraph.various.banner as banner_mod
2669+ import madgraph.various.cluster as cluster
2670 import madgraph.various.gen_crossxhtml as gen_crossxhtml
2671- import madgraph.various.cluster as cluster
2672 import madgraph.various.sum_html as sum_html
2673- import madgraph.various.banner as banner_mod
2674+ import madgraph.various.misc as misc
2675+
2676 import models.check_param_card as check_param_card
2677 from madgraph import InvalidCmd, MadGraph5Error
2678 MADEVENT = False
2679@@ -300,7 +301,7 @@
2680
2681 logger.info("-- session options:")
2682 logger.info(" Note that those options will be kept for the current session")
2683- logger.info(" --cluster : Submit to the cluster. Current cluster: %s" % self.configuration['cluster_mode'])
2684+ logger.info(" --cluster : Submit to the cluster. Current cluster: %s" % self.options['cluster_mode'])
2685 logger.info(" --multicore : Run in multi-core configuration")
2686 logger.info(" --nb_core=X : limit the number of core to use to X.")
2687
2688@@ -429,7 +430,7 @@
2689 tag = [a[6:] for a in args if a.startswith('--tag=')]
2690
2691
2692- if os.path.exists(args[0]):
2693+ if os.path.isfile(args[0]):
2694 type ='banner'
2695 format = self.detect_card_type(args[0])
2696 if format != 'banner':
2697@@ -494,7 +495,7 @@
2698 self.help_set()
2699 raise self.InvalidCmd('set needs an option and an argument')
2700
2701- if args[0] not in self._set_options + self.configuration.keys():
2702+ if args[0] not in self._set_options + self.options.keys():
2703 self.help_set()
2704 raise self.InvalidCmd('Possible options for set are %s' % \
2705 self._set_options)
2706@@ -587,10 +588,10 @@
2707 if run not in ['auto','parton', 'pythia', 'pgs', 'delphes']:
2708 self.help_generate_events()
2709 raise self.InvalidCmd('invalid %s argument'% args[-1])
2710- if run != 'parton' and not self.configuration['pythia-pgs_path']:
2711+ if run != 'parton' and not self.options['pythia-pgs_path']:
2712 raise self.InvalidCmd('''pythia-pgs not install. Please install this package first.
2713 To do so type: \'install pythia-pgs\' in the mg5 interface''')
2714- if run == 'delphes' and not self.configuration['delphes_path']:
2715+ if run == 'delphes' and not self.options['delphes_path']:
2716 raise self.InvalidCmd('''delphes not install. Please install this package first.
2717 To do so type: \'install Delphes\' in the mg5 interface''')
2718 del args[-1]
2719@@ -645,10 +646,10 @@
2720 if run not in ['parton', 'pythia', 'pgs', 'delphes']:
2721 self.help_multi_run()
2722 raise self.InvalidCmd('invalid %s argument'% args[-1])
2723- if run != 'parton' and not self.configuration['pythia-pgs_path']:
2724+ if run != 'parton' and not self.options['pythia-pgs_path']:
2725 raise self.InvalidCmd('''pythia-pgs not install. Please install this package first.
2726 To do so type: \'install pythia-pgs\' in the mg5 interface''')
2727- if run == 'delphes' and not self.configuration['delphes_path']:
2728+ if run == 'delphes' and not self.options['delphes_path']:
2729 raise self.InvalidCmd('''delphes not install. Please install this package first.
2730 To do so type: \'install Delphes\' in the mg5 interface''')
2731 del args[-1]
2732@@ -759,12 +760,12 @@
2733
2734
2735 # If not pythia-pgs path
2736- if not self.configuration['pythia-pgs_path']:
2737+ if not self.options['pythia-pgs_path']:
2738 logger.info('Retry to read configuration file to find pythia-pgs path')
2739 self.set_configuration()
2740
2741- if not self.configuration['pythia-pgs_path'] or not \
2742- os.path.exists(pjoin(self.configuration['pythia-pgs_path'],'src')):
2743+ if not self.options['pythia-pgs_path'] or not \
2744+ os.path.exists(pjoin(self.options['pythia-pgs_path'],'src')):
2745 error_msg = 'No pythia-pgs path correctly set.'
2746 error_msg += 'Please use the set command to define the path and retry.'
2747 error_msg += 'You can also define it in the configuration file.'
2748@@ -808,15 +809,15 @@
2749 """Check the argument for the plot command
2750 plot run_name modes"""
2751
2752- madir = self.configuration['madanalysis_path']
2753- td = self.configuration['td_path']
2754+ madir = self.options['madanalysis_path']
2755+ td = self.options['td_path']
2756
2757 if not madir or not td:
2758 logger.info('Retry to read configuration file to find madanalysis/td')
2759 self.set_configuration()
2760
2761- madir = self.configuration['madanalysis_path']
2762- td = self.configuration['td_path']
2763+ madir = self.options['madanalysis_path']
2764+ td = self.options['td_path']
2765
2766 if not madir:
2767 error_msg = 'No Madanalysis path correctly set.'
2768@@ -830,7 +831,7 @@
2769 raise self.InvalidCmd(error_msg)
2770
2771 if len(args) == 0:
2772- if not hasattr(self, 'run_name'):
2773+ if not hasattr(self, 'run_name') or not self.run_name:
2774 self.help_plot()
2775 raise self.InvalidCmd('No run name currently define. Please add this information.')
2776 args.append('all')
2777@@ -842,7 +843,7 @@
2778 force = True
2779
2780 if args[0] not in self._plot_mode:
2781- self.set_run_name(args[0])
2782+ self.set_run_name(args[0], level='plot')
2783 del args[0]
2784 if len(args) == 0:
2785 args.append('all')
2786@@ -866,12 +867,12 @@
2787 """
2788
2789 # If not pythia-pgs path
2790- if not self.configuration['pythia-pgs_path']:
2791+ if not self.options['pythia-pgs_path']:
2792 logger.info('Retry to read configuration file to find pythia-pgs path')
2793 self.set_configuration()
2794
2795- if not self.configuration['pythia-pgs_path'] or not \
2796- os.path.exists(pjoin(self.configuration['pythia-pgs_path'],'src')):
2797+ if not self.options['pythia-pgs_path'] or not \
2798+ os.path.exists(pjoin(self.options['pythia-pgs_path'],'src')):
2799 error_msg = 'No pythia-pgs path correctly set.'
2800 error_msg += 'Please use the set command to define the path and retry.'
2801 error_msg += 'You can also define it in the configuration file.'
2802@@ -920,11 +921,11 @@
2803 """
2804
2805 # If not pythia-pgs path
2806- if not self.configuration['delphes_path']:
2807+ if not self.options['delphes_path']:
2808 logger.info('Retry to read configuration file to find delphes path')
2809 self.set_configuration()
2810
2811- if not self.configuration['delphes_path']:
2812+ if not self.options['delphes_path']:
2813 error_msg = 'No delphes path correctly set.'
2814 error_msg += 'Please use the set command to define the path and retry.'
2815 error_msg += 'You can also define it in the configuration file.'
2816@@ -938,7 +939,7 @@
2817
2818 if len(arg) == 0 and not self.run_name:
2819 if self.results.lastrun:
2820- args.insert(0, self.results.lastrun)
2821+ arg.insert(0, self.results.lastrun)
2822 else:
2823 raise self.InvalidCmd('No run name currently define. Please add this information.')
2824
2825@@ -1099,7 +1100,7 @@
2826
2827 # Format
2828 if len(args) == 1:
2829- return self.list_completion(text, self._set_options + self.configuration.keys() )
2830+ return self.list_completion(text, self._set_options + self.options.keys() )
2831
2832 if len(args) == 2:
2833 if args[1] == 'stdout_level':
2834@@ -1331,7 +1332,7 @@
2835 raise MadEventAlreadyRunning, message
2836 else:
2837 os.system('touch %s' % pjoin(me_dir,'RunWeb'))
2838- subprocess.call(['%s/gen_cardhtml-pl' % self.dirbin], cwd=me_dir)
2839+ subprocess.Popen([pjoin(self.dirbin, 'gen_cardhtml-pl')], cwd=me_dir)
2840
2841 self.to_store = []
2842 self.run_name = None
2843@@ -1339,10 +1340,15 @@
2844 self.banner = None
2845
2846 # Get number of initial states
2847- nexternal = open(pjoin(me_dir,'Source','nexternal.inc')).read()
2848- found = re.search("PARAMETER\s*\(NINCOMING=(\d)\)", nexternal)
2849- self.ninitial = int(found.group(1))
2850-
2851+ try:
2852+ nexternal = open(pjoin(me_dir,'Source','nexternal.inc')).read()
2853+ found = re.search("PARAMETER\s*\(NINCOMING=(\d)\)", nexternal)
2854+ self.ninitial = int(found.group(1))
2855+ except:
2856+ # in gridpack this file might be remove. In that case, let suppose
2857+ # that ninitial is 2
2858+ self.ninitial = 2
2859+
2860 # Load the configuration file
2861 self.set_configuration()
2862 self.timeout = 20
2863@@ -1407,8 +1413,8 @@
2864 self.nb_core = multiprocessing.cpu_count()
2865
2866 if self.cluster_mode == 1 and not hasattr(self, 'cluster'):
2867- cluster_name = self.configuration['cluster_type']
2868- self.cluster = cluster.from_name[cluster_name](self.configuration['cluster_queue'])
2869+ cluster_name = self.options['cluster_type']
2870+ self.cluster = cluster.from_name[cluster_name](self.options['cluster_queue'])
2871 return args
2872
2873 ############################################################################
2874@@ -1426,7 +1432,7 @@
2875 """ assign all configuration variable from file
2876 ./Cards/mg5_configuration.txt. assign to default if not define """
2877
2878- self.configuration = {'pythia8_path': './pythia8',
2879+ self.options = {'pythia8_path': './pythia8',
2880 'pythia-pgs_path': '../pythia-pgs',
2881 'delphes_path': '../Delphes',
2882 'madanalysis_path': '../MadAnalysis',
2883@@ -1476,43 +1482,43 @@
2884 else:
2885 name = name.strip()
2886 value = value.strip()
2887- self.configuration[name] = value
2888+ self.options[name] = value
2889 if value.lower() == "none":
2890- self.configuration[name] = None
2891+ self.options[name] = None
2892
2893 # Treat each expected input
2894 # delphes/pythia/... path
2895- for key in self.configuration:
2896+ for key in self.options:
2897 if key.endswith('path'):
2898- if self.configuration[key] in ['None', None]:
2899- self.configuration[key] = ''
2900+ if self.options[key] in ['None', None]:
2901+ self.options[key] = ''
2902 continue
2903- path = os.path.join(self.me_dir, self.configuration[key])
2904+ path = os.path.join(self.me_dir, self.options[key])
2905 if os.path.isdir(path):
2906- self.configuration[key] = os.path.realpath(path)
2907- continue
2908- if os.path.isdir(self.configuration[key]):
2909- self.configuration[key] = os.path.realpath(self.configuration[key])
2910- continue
2911- elif not os.path.isdir(self.configuration[key]):
2912- self.configuration[key] = ''
2913+ self.options[key] = os.path.realpath(path)
2914+ continue
2915+ if os.path.isdir(self.options[key]):
2916+ self.options[key] = os.path.realpath(self.options[key])
2917+ continue
2918+ elif not os.path.isdir(self.options[key]):
2919+ self.options[key] = ''
2920 elif key.startswith('cluster'):
2921 pass
2922 elif key == 'automatic_html_opening':
2923- if self.configuration[key] in ['False', 'True']:
2924- self.configuration[key] =eval(self.configuration[key])
2925+ if self.options[key] in ['False', 'True']:
2926+ self.options[key] =eval(self.options[key])
2927 elif key not in ['text_editor','eps_viewer','web_browser']:
2928 # Default: try to set parameter
2929 try:
2930- self.do_set("%s %s" % (key, self.configuration[key]))
2931+ self.do_set("%s %s" % (key, self.options[key]))
2932 except self.InvalidCmd:
2933 logger.warning("Option %s from config file not understood" \
2934 % key)
2935
2936 # Configure the way to open a file:
2937- misc.open_file.configure(self.configuration)
2938+ misc.open_file.configure(self.options)
2939
2940- return self.configuration
2941+ return self.options
2942
2943 ############################################################################
2944 def do_banner_run(self, line):
2945@@ -1619,37 +1625,37 @@
2946 logging.getLogger('madgraph').setLevel(eval('logging.' + args[1]))
2947 logger.info('set output information to level: %s' % args[1])
2948 elif args[0] == "fortran_compiler":
2949- self.configuration['fortran_compiler'] = args[1]
2950+ self.options['fortran_compiler'] = args[1]
2951 elif args[0] == "run_mode":
2952 if not args[1] in [0,1,2,'0','1','2']:
2953 raise self.InvalidCmd, 'run_mode should be 0, 1 or 2.'
2954 self.cluster_mode = int(args[1])
2955- self.configuration['cluster_mode'] = self.cluster_mode
2956+ self.options['cluster_mode'] = self.cluster_mode
2957 elif args[0] == 'cluster_type':
2958- self.configuration['cluster_mode'] = args[1]
2959- self.cluster = cluster.from_name[args[1]](self.configuration['cluster_queue'])
2960+ self.options['cluster_mode'] = args[1]
2961+ self.cluster = cluster.from_name[args[1]](self.options['cluster_queue'])
2962 elif args[0] == 'nb_core':
2963 if args[1] == 'None':
2964 import multiprocessing
2965 self.nb_core = multiprocessing.cpu_count()
2966- self.configuration['nb_core'] = self.nb_core
2967+ self.options['nb_core'] = self.nb_core
2968 return
2969 if not args[1].isdigit():
2970 raise self.InvalidCmd('nb_core should be a positive number')
2971 self.nb_core = int(args[1])
2972- self.configuration['nb_core'] = self.nb_core
2973- elif args[0] in self.configuration:
2974+ self.options['nb_core'] = self.nb_core
2975+ elif args[0] in self.options:
2976 if args[1] in ['None','True','False']:
2977- self.configuration[args[0]] = eval(args[1])
2978+ self.options[args[0]] = eval(args[1])
2979 elif args[0].endswith('path'):
2980 if os.path.exists(args[1]):
2981- self.configuration[args[0]] = args[1]
2982+ self.options[args[0]] = args[1]
2983 elif os.path.exists(pjoin(self.me_dir, args[1])):
2984- self.configuration[args[0]] = pjoin(self.me_dir, args[1])
2985+ self.options[args[0]] = pjoin(self.me_dir, args[1])
2986 else:
2987- raise self.InvalidCmd('Not a valid path: keep previous value: \'%s\'' % self.configuration[args[0]])
2988+ raise self.InvalidCmd('Not a valid path: keep previous value: \'%s\'' % self.options[args[0]])
2989 else:
2990- self.configuration[args[0]] = args[1]
2991+ self.options[args[0]] = args[1]
2992
2993
2994 ############################################################################
2995@@ -1728,7 +1734,8 @@
2996 self.exec_cmd('pythia --no_default', postcmd=False, printcmd=False)
2997 # pythia launches pgs/delphes if needed
2998 self.store_result()
2999- self.print_results_in_shell(self.results.current)
3000+
3001+ self.print_results_in_shell(self.results.current)
3002
3003
3004 def print_results_in_shell(self, data):
3005@@ -1931,7 +1938,7 @@
3006 % {'bin': self.dirbin, 'event': pjoin(self.me_dir,'Events'),
3007 'name': self.run_name})
3008
3009- eradir = self.configuration['exrootanalysis_path']
3010+ eradir = self.options['exrootanalysis_path']
3011 if eradir and misc.is_executable(pjoin(eradir,'ExRootLHEFConverter')):
3012 self.update_status("Create Root file", level='parton')
3013 os.system('gunzip %s/%s/unweighted_events.lhe.gz' %
3014@@ -2042,6 +2049,7 @@
3015 self.total_jobs = 0
3016 subproc = [l.strip() for l in open(pjoin(self.me_dir,'SubProcesses',
3017 'subproc.mg'))]
3018+ devnull = os.open(os.devnull, os.O_RDWR)
3019 for nb_proc,subdir in enumerate(subproc):
3020 subdir = subdir.strip()
3021 Pdir = pjoin(self.me_dir, 'SubProcesses',subdir)
3022@@ -2053,7 +2061,6 @@
3023 if os.path.basename(match)[:4] in ['ajob', 'wait', 'run.', 'done']:
3024 os.remove(pjoin(Pdir, match))
3025
3026- devnull = os.open(os.devnull, os.O_RDWR)
3027 proc = subprocess.Popen([pjoin(bindir, 'gen_ximprove')],
3028 stdout=devnull,
3029 stdin=subprocess.PIPE,
3030@@ -2118,6 +2125,7 @@
3031 # Define The Banner
3032 tag = self.run_card['run_tag']
3033 self.banner.load_basic(self.me_dir)
3034+ self.banner.change_seed(self.random)
3035 if not os.path.exists(pjoin(self.me_dir, 'Events', self.run_name)):
3036 os.mkdir(pjoin(self.me_dir, 'Events', self.run_name))
3037 self.banner.write(pjoin(self.me_dir, 'Events', self.run_name,
3038@@ -2136,9 +2144,9 @@
3039 # 'unweighted_events.lhe', 'banner.txt'],
3040 # cwd=pjoin(self.me_dir, 'Events'))
3041
3042- eradir = self.configuration['exrootanalysis_path']
3043- madir = self.configuration['madanalysis_path']
3044- td = self.configuration['td_path']
3045+ eradir = self.options['exrootanalysis_path']
3046+ madir = self.options['madanalysis_path']
3047+ td = self.options['td_path']
3048 if eradir and misc.is_executable(pjoin(eradir,'ExRootLHEFConverter')) and\
3049 os.path.exists(pjoin(self.me_dir, 'Events', 'unweighted_events.lhe')):
3050 if not os.path.exists(pjoin(self.me_dir, 'Events', self.run_name)):
3051@@ -2191,6 +2199,16 @@
3052 files.mv(input, output)
3053 subprocess.call(['gzip', output], stdout=devnull,
3054 stderr=devnull, cwd=G_path)
3055+
3056+ # 2) restore links in local this is require due to chrome over-security
3057+ if not self.web:
3058+ results = pjoin(self.me_dir, 'HTML', run, 'results.html')
3059+ text = open(results).read()
3060+ text = text.replace('''if ( ! UrlExists(alt)){
3061+ obj.href = alt;''','''if ( ! UrlExists(alt)){
3062+ obj.href = url;''')
3063+ open(results, 'w').write(text)
3064+
3065 # 3) Update the index.html
3066 subprocess.call(['%s/gen_cardhtml-pl' % self.dirbin],
3067 cwd=pjoin(self.me_dir))
3068@@ -2274,7 +2292,7 @@
3069
3070 #self.exec_cmd('remove %s pythia -f' % self.run_name)
3071
3072- pythia_src = pjoin(self.configuration['pythia-pgs_path'],'src')
3073+ pythia_src = pjoin(self.options['pythia-pgs_path'],'src')
3074
3075 self.update_status('Running Pythia', 'pythia')
3076 try:
3077@@ -2317,10 +2335,10 @@
3078 cs_info = cs_info.split(':')[1]
3079 self.results.add_detail('cross_pythia', cs_info)
3080
3081- pydir = pjoin(self.configuration['pythia-pgs_path'], 'src')
3082- eradir = self.configuration['exrootanalysis_path']
3083- madir = self.configuration['madanalysis_path']
3084- td = self.configuration['td_path']
3085+ pydir = pjoin(self.options['pythia-pgs_path'], 'src')
3086+ eradir = self.options['exrootanalysis_path']
3087+ madir = self.options['madanalysis_path']
3088+ td = self.options['td_path']
3089
3090
3091 self.banner.add(pjoin(self.me_dir, 'Cards','pythia_card.dat'))
3092@@ -2387,7 +2405,7 @@
3093
3094 self.update_status('finish', level='pythia', makehtml=False)
3095 self.exec_cmd('pgs --no_default', postcmd=False, printcmd=False)
3096- if self.configuration['delphes_path']:
3097+ if self.options['delphes_path']:
3098 self.exec_cmd('delphes --no_default', postcmd=False, printcmd=False)
3099
3100 def get_available_tag(self):
3101@@ -2557,16 +2575,16 @@
3102 self.check_plot(args)
3103 logger.info('plot for run %s' % self.run_name)
3104
3105- self.edit_one_card('plot_card.dat', args)
3106+ self.ask_edit_cards([], args)
3107
3108 if any([arg in ['all','parton'] for arg in args]):
3109- filename = pjoin(self.me_dir, 'Events','%s_unweighted_events.lhe' % self.run_name)
3110+ filename = pjoin(self.me_dir, 'Events', self.run_name, 'unweighted_events.lhe')
3111 if os.path.exists(filename+'.gz'):
3112 os.system('gunzip -f %s' % (filename+'.gz') )
3113 if os.path.exists(filename):
3114- shutil.move(filename, pjoin(self.me_dir, 'Events','unweighted_events.lhe'))
3115+ shutil.move(filename, pjoin(self.me_dir, 'Events', 'unweighted_events.lhe'))
3116 self.create_plot('parton')
3117- shutil.move(pjoin(self.me_dir, 'Events','unweighted_events.lhe'), filename)
3118+ shutil.move(pjoin(self.me_dir, 'Events', 'unweighted_events.lhe'), filename)
3119 os.system('gzip -f %s' % filename)
3120 else:
3121 logger.info('No valid files for partonic plot')
3122@@ -2678,10 +2696,10 @@
3123 if hasattr(self, 'control_thread') and self.control_thread[0]:
3124 self.monitor(mode=2,html=False)
3125
3126- pgsdir = pjoin(self.configuration['pythia-pgs_path'], 'src')
3127- eradir = self.configuration['exrootanalysis_path']
3128- madir = self.configuration['madanalysis_path']
3129- td = self.configuration['td_path']
3130+ pgsdir = pjoin(self.options['pythia-pgs_path'], 'src')
3131+ eradir = self.options['exrootanalysis_path']
3132+ madir = self.options['madanalysis_path']
3133+ td = self.options['td_path']
3134
3135 # Compile pgs if not there
3136 if not misc.is_executable(pjoin(pgsdir, 'pgs')):
3137@@ -2788,7 +2806,9 @@
3138 files.cp(pjoin(self.me_dir, 'Cards', 'delphes_card_default.dat'),
3139 pjoin(self.me_dir, 'Cards', 'delphes_card.dat'))
3140 logger.info('No delphes card found. Take the default one.')
3141-
3142+ if not os.path.exists(pjoin(self.me_dir, 'Cards', 'delphes_trigger.dat')):
3143+ files.cp(pjoin(self.me_dir, 'Cards', 'delphes_trigger_default.dat'),
3144+ pjoin(self.me_dir, 'Cards', 'delphes_trigger.dat'))
3145 if not (no_default or force):
3146 self.ask_edit_cards(['delphes', 'trigger'], args)
3147
3148@@ -2799,7 +2819,7 @@
3149
3150
3151
3152- delphes_dir = self.configuration['delphes_path']
3153+ delphes_dir = self.options['delphes_path']
3154 tag = self.run_tag
3155 self.banner.add(pjoin(self.me_dir, 'Cards','delphes_card.dat'))
3156 self.banner.add(pjoin(self.me_dir, 'Cards','delphes_trigger.dat'))
3157@@ -2830,9 +2850,9 @@
3158 target = pjoin(self.me_dir,'Events', self.run_name, "%s_delphes_events.root" % tag)
3159 files.mv(source, target)
3160
3161- #eradir = self.configuration['exrootanalysis_path']
3162- madir = self.configuration['madanalysis_path']
3163- td = self.configuration['td_path']
3164+ #eradir = self.options['exrootanalysis_path']
3165+ madir = self.options['madanalysis_path']
3166+ td = self.options['td_path']
3167
3168 # Creating plots
3169 self.create_plot('Delphes')
3170@@ -3008,9 +3028,9 @@
3171 else:
3172 self.configured = time.time()
3173 self.update_status('compile directory', level=None)
3174- if self.configuration['automatic_html_opening']:
3175+ if self.options['automatic_html_opening']:
3176 misc.open_file(os.path.join(self.me_dir, 'crossx.html'))
3177- self.configuration['automatic_html_opening'] = False
3178+ self.options['automatic_html_opening'] = False
3179 #open only once the web page
3180 # Change current working directory
3181 self.launching_dir = os.getcwd()
3182@@ -3039,16 +3059,18 @@
3183 raise MadEventError, 'Impossible to compile'
3184
3185 # set random number
3186- if os.path.exists(pjoin(self.me_dir,'SubProcesses','randinit')):
3187+ if self.run_card['iseed'] != '0':
3188+ self.random = int(self.run_card['iseed'])
3189+ elif os.path.exists(pjoin(self.me_dir,'SubProcesses','randinit')):
3190 for line in open(pjoin(self.me_dir,'SubProcesses','randinit')):
3191 data = line.split('=')
3192 assert len(data) ==2
3193 self.random = int(data[1])
3194 break
3195 else:
3196- self.random = random.randint(1, 30107)
3197-
3198- if self.run_card['ickkw'] == 2:
3199+ self.random = random.randint(1, 30107)
3200+
3201+ if self.run_card['ickkw'] == '2':
3202 logger.info('Running with CKKW matching')
3203 self.treat_CKKW_matching()
3204
3205@@ -3086,7 +3108,8 @@
3206 upgrade_tag = {'parton': ['parton','pythia','pgs','delphes'],
3207 'pythia': ['pythia','pgs','delphes'],
3208 'pgs': ['pgs'],
3209- 'delphes':['delphes']}
3210+ 'delphes':['delphes'],
3211+ 'plot':[]}
3212
3213
3214
3215@@ -3184,7 +3207,7 @@
3216 proc = []
3217 for line in open(os.path.join(self.me_dir,'Cards','proc_card_mg5.dat')):
3218 line = line.split('#')[0]
3219- line = line.split('=')[0]
3220+ #line = line.split('=')[0]
3221 if line.startswith('import') and 'model' in line:
3222 model = line.split()[2]
3223 proc = []
3224@@ -3319,7 +3342,7 @@
3225 """create the LHE root file """
3226 self.update_status('Creating root files', level='parton')
3227
3228- eradir = self.configuration['exrootanalysis_path']
3229+ eradir = self.options['exrootanalysis_path']
3230 subprocess.call(['%s/ExRootLHEFConverter' % eradir,
3231 input, output],
3232 cwd=pjoin(self.me_dir, 'Events'))
3233@@ -3328,8 +3351,8 @@
3234 def create_plot(self, mode='parton', event_path=None, output=None):
3235 """create the plot"""
3236
3237- madir = self.configuration['madanalysis_path']
3238- td = self.configuration['td_path']
3239+ madir = self.options['madanalysis_path']
3240+ td = self.options['td_path']
3241 if not madir or not td or \
3242 not os.path.exists(pjoin(self.me_dir, 'Cards', 'plot_card.dat')):
3243 return False
3244@@ -3395,17 +3418,32 @@
3245
3246 return True
3247
3248+
3249+ def clean_pointless_card(self, mode):
3250+ """ Clean the pointless card """
3251+ if mode == 'parton':
3252+ if os.path.exists(pjoin(self.me_dir,'Cards','pythia_card.dat')):
3253+ os.remove(pjoin(self.me_dir,'Cards','pythia_card.dat'))
3254+ elif mode in ['parton', 'pythia', 'delphes']:
3255+ if os.path.exists(pjoin(self.me_dir,'Cards','pgs_card.dat')):
3256+ os.remove(pjoin(self.me_dir,'Cards','pgs_card.dat'))
3257+ elif mode in ['pythia', 'pgs']:
3258+ if os.path.exists(pjoin(self.me_dir,'Cards','delphes_card.dat')):
3259+ os.remove(pjoin(self.me_dir,'Cards','delphes_card.dat'))
3260+ if os.path.exists(pjoin(self.me_dir,'Cards','delphes_trigger.dat')):
3261+ os.remove(pjoin(self.me_dir,'Cards','delphes_trigger.dat'))
3262+
3263
3264 ############################################################################
3265 def ask_run_configuration(self, mode=None, force=False):
3266 """Ask the question when launching generate_events/multi_run"""
3267
3268 available_mode = ['0', '1']
3269- if self.configuration['pythia-pgs_path']:
3270+ if self.options['pythia-pgs_path']:
3271 available_mode.append('2')
3272 available_mode.append('3')
3273
3274- if self.configuration['delphes_path']:
3275+ if self.options['delphes_path']:
3276 available_mode.append('4')
3277
3278 if len(available_mode) == 2:
3279@@ -3442,24 +3480,8 @@
3280 else:
3281 mode = 'pythia'
3282 logger.info('Will run in mode %s' % mode)
3283-
3284- def clean_pointless_card(mode):
3285- """ Clean the pointless card """
3286- if mode == 'parton':
3287- if os.path.exists(pjoin(self.me_dir,'Cards','pythia_card.dat')):
3288- os.remove(pjoin(self.me_dir,'Cards','pythia_card.dat'))
3289- if os.path.exists(pjoin(self.me_dir,'Cards','pgs_card.dat')):
3290- os.remove(pjoin(self.me_dir,'Cards','pgs_card.dat'))
3291- if os.path.exists(pjoin(self.me_dir,'Cards','delphes_card.dat')):
3292- os.remove(pjoin(self.me_dir,'Cards','delphes_card.dat'))
3293- elif mode == 'pgs':
3294- if os.path.exists(pjoin(self.me_dir,'Cards','delphes_card.dat')):
3295- os.remove(pjoin(self.me_dir,'Cards','delphes_card.dat'))
3296- elif mode == 'delphes':
3297- if os.path.exists(pjoin(self.me_dir,'Cards','pgs_card.dat')):
3298- os.remove(pjoin(self.me_dir,'Cards','pgs_card.dat'))
3299-
3300- clean_pointless_card(mode)
3301+
3302+ self.clean_pointless_card(mode)
3303 # Now that we know in which mode we are check that all the card
3304 #exists (copy default if needed)
3305
3306@@ -3472,6 +3494,7 @@
3307 cards.append('pgs_card.dat')
3308 elif mode == 'delphes':
3309 self.add_card_to_run('delphes')
3310+ self.add_card_to_run('trigger')
3311 cards.append('delphes_card.dat')
3312
3313 if force:
3314@@ -3499,7 +3522,7 @@
3315 possible_answer.append('delphes')
3316 possible_answer.append(6)
3317 possible_answer.append('trigger')
3318- if self.configuration['madanalysis_path']:
3319+ if self.options['madanalysis_path']:
3320 question += ' 9 / plot : plot_card.dat\n'
3321 possible_answer.append(9)
3322 possible_answer.append('plot')
3323@@ -3518,8 +3541,12 @@
3324 answer = card[int(answer)]
3325 if answer == 'done':
3326 return
3327- if not os.path.exists(answer):
3328- path = pjoin(self.me_dir,'Cards','%s_card.dat' % answer)
3329+ if not os.path.isfile(answer):
3330+ if answer != 'trigger':
3331+ path = pjoin(self.me_dir,'Cards','%s_card.dat' % answer)
3332+ else:
3333+ path = pjoin(self.me_dir,'Cards','delphes_trigger.dat')
3334+ print path
3335 self.exec_cmd('open %s' % path)
3336 else:
3337 # detect which card is provide
3338@@ -3550,7 +3577,7 @@
3339 """Ask the question when launching pythia"""
3340
3341 available_mode = ['0', '1', '2']
3342- if self.configuration['delphes_path']:
3343+ if self.options['delphes_path']:
3344 available_mode.append('3')
3345 name = {'0': 'auto', '1': 'pythia', '2':'pgs', '3':'delphes'}
3346 options = available_mode + [name[val] for val in available_mode]
3347@@ -3579,14 +3606,8 @@
3348 mode = 'pythia'
3349 logger.info('Will run in mode %s' % mode)
3350
3351- # Clean the pointless card
3352- if mode == 'pgs':
3353- if os.path.exists(pjoin(self.me_dir,'Cards','delphes_card.dat')):
3354- os.remove(pjoin(self.me_dir,'Cards','delphes_card.dat'))
3355- if mode == 'delphes':
3356- if os.path.exists(pjoin(self.me_dir,'Cards','pgs_card.dat')):
3357- os.remove(pjoin(self.me_dir,'Cards','pgs_card.dat'))
3358-
3359+ self.clean_pointless_card(mode)
3360+
3361 # Now that we know in which mode we are check that all the card
3362 #exists (copy default if needed)
3363
3364@@ -3597,6 +3618,7 @@
3365 cards.append('pgs_card.dat')
3366 if mode == 'delphes':
3367 self.add_card_to_run('delphes')
3368+ self.add_card_to_run('trigger')
3369 cards.append('delphes_card.dat')
3370
3371 if force:
3372@@ -3622,7 +3644,7 @@
3373 possible_answer.append('trigger')
3374 card[2] = 'delphes'
3375 card[3] = 'trigger'
3376- if self.configuration['madanalysis_path']:
3377+ if self.options['madanalysis_path']:
3378 question += ' 9 / plot : plot_card.dat\n'
3379 possible_answer.append(9)
3380 possible_answer.append('plot')
3381@@ -3638,7 +3660,7 @@
3382 answer = card[int(answer)]
3383 if answer == 'done':
3384 return
3385- if os.path.exists(answer):
3386+ if os.path.isfile(answer):
3387 # detect which card is provide
3388 card_name = self.detect_card_type(answer)
3389 if card_name == 'unknown':
3390@@ -3649,7 +3671,10 @@
3391 logger.info('copy %s as %s' % (answer, card_name))
3392 files.cp(answer, pjoin(self.me_dir, 'Cards', card_name))
3393 continue
3394- path = pjoin(self.me_dir,'Cards','%s_card.dat' % answer)
3395+ if answer != 'trigger':
3396+ path = pjoin(self.me_dir,'Cards','%s_card.dat' % answer)
3397+ else:
3398+ path = pjoin(self.me_dir,'Cards','delphes_trigger.dat')
3399 self.exec_cmd('open %s' % path)
3400
3401 return mode
3402@@ -3677,7 +3702,7 @@
3403 question += ' %s / %-9s : %s\n' % (i+1, mode, card_name[mode])
3404 card[i+1] = mode
3405
3406- if self.configuration['madanalysis_path']:
3407+ if self.options['madanalysis_path']:
3408 question += ' 9 / %-9s : plot_card.dat\n' % 'plot'
3409 possible_answer.append(9)
3410 possible_answer.append('plot')
3411@@ -3694,7 +3719,7 @@
3412 answer = card[int(answer)]
3413 if answer == 'done':
3414 return
3415- if os.path.exists(answer):
3416+ if os.path.isfile(answer):
3417 # detect which card is provide
3418 card_name = self.detect_card_type(answer)
3419 if card_name == 'unknown':
3420@@ -3704,7 +3729,10 @@
3421 logger.info('copy %s as %s' % (answer, card_name))
3422 files.cp(answer, pjoin(self.me_dir, 'Cards', card_name))
3423 continue
3424- path = pjoin(self.me_dir,'Cards','%s_card.dat' % answer)
3425+ if answer != 'trigger':
3426+ path = pjoin(self.me_dir,'Cards','%s_card.dat' % answer)
3427+ else:
3428+ path = pjoin(self.me_dir,'Cards','delphes_trigger.dat')
3429 self.exec_cmd('open %s' % path)
3430
3431 return mode
3432@@ -3728,9 +3756,14 @@
3433 """ensure that card name is define. If not use the default one"""
3434 dico = {'dir': self.me_dir, 'name': name }
3435
3436- if not os.path.exists('%(dir)s/Cards/%(name)s_card.dat' % dico):
3437- files.cp('%(dir)s/Cards/%(name)s_card_default.dat' % dico,
3438- '%(dir)s/Cards/%(name)s_card.dat' % dico)
3439+ if name != 'trigger':
3440+ if not os.path.isfile('%(dir)s/Cards/%(name)s_card.dat' % dico):
3441+ files.cp('%(dir)s/Cards/%(name)s_card_default.dat' % dico,
3442+ '%(dir)s/Cards/%(name)s_card.dat' % dico)
3443+ else:
3444+ if not os.path.isfile('%(dir)s/Cards/delphes_trigger.dat' % dico):
3445+ files.cp('%(dir)s/Cards/delphes_trigger_default.dat' % dico,
3446+ '%(dir)s/Cards/delphes_trigger.dat' % dico)
3447
3448 @staticmethod
3449 def detect_card_type(path):
3450@@ -3879,7 +3912,7 @@
3451 MadEventCmd.__init__(self, me_dir, *completekey, **stdin)
3452 self.run_mode = 0
3453 self.random = seed
3454- self.configuration['automatic_html_opening'] = False
3455+ self.options['automatic_html_opening'] = False
3456 # Now it's time to run!
3457 if me_dir and nb_event and seed:
3458 self.launch(nb_event, seed)
3459@@ -3910,6 +3943,7 @@
3460 self.exec_cmd('combine_events')
3461 self.exec_cmd('store_events')
3462 self.exec_cmd('pythia --no_default -f')
3463+ self.print_results_in_shell(self.results.current)
3464
3465 def refine4grid(self, nb_event):
3466 """Special refine for gridpack run."""
3467
3468=== modified file 'madgraph/interface/madgraph_interface.py'
3469--- madgraph/interface/madgraph_interface.py 2012-02-21 23:49:21 +0000
3470+++ madgraph/interface/madgraph_interface.py 2012-03-09 00:04:18 +0000
3471@@ -54,7 +54,6 @@
3472 import madgraph.iolibs.files as files
3473 import madgraph.iolibs.group_subprocs as group_subprocs
3474 import madgraph.iolibs.import_v4 as import_v4
3475-import madgraph.iolibs.misc as misc
3476 import madgraph.iolibs.save_load_object as save_load_object
3477
3478 import madgraph.interface.extended_cmd as cmd
3479@@ -64,6 +63,8 @@
3480
3481 import madgraph.various.process_checks as process_checks
3482 import madgraph.various.banner as banner_module
3483+import madgraph.various.misc as misc
3484+import madgraph.various.cluster as cluster
3485
3486 import models as ufomodels
3487 import models.import_ufo as import_ufo
3488@@ -220,7 +221,7 @@
3489 #===============================================================================
3490 # HelpToCmd
3491 #===============================================================================
3492-class HelpToCmd(object):
3493+class HelpToCmd(cmd.HelpCmd):
3494 """ The Series of help routine for the MadGraphCmd"""
3495
3496 def help_save(self):
3497@@ -402,13 +403,12 @@
3498 logger.info(" fortran_compiler NAME")
3499 logger.info(" (default None) Force a specific fortran compiler.")
3500 logger.info(" If None, it tries first g77 and if not present gfortran.")
3501-
3502
3503
3504 #===============================================================================
3505 # CheckValidForCmd
3506 #===============================================================================
3507-class CheckValidForCmd(object):
3508+class CheckValidForCmd(cmd.CheckCmd):
3509 """ The Series of help routine for the MadGraphCmd"""
3510
3511 class RWError(MadGraph5Error):
3512@@ -664,14 +664,12 @@
3513 return self.InvalidCmd, 'Invalid Syntax: Too many argument'
3514
3515 # search for a valid path
3516- if os.path.sep in args[0] and os.path.isdir(args[0]):
3517- path = args[0]
3518+ if os.path.isdir(args[0]):
3519+ path = os.path.realpath(args[0])
3520 elif os.path.isdir(pjoin(MG5DIR,args[0])):
3521 path = pjoin(MG5DIR,args[0])
3522 elif MG4DIR and os.path.isdir(pjoin(MG4DIR,args[0])):
3523 path = pjoin(MG4DIR,args[0])
3524- elif os.path.isdir(args[0]):
3525- path = os.path.realpath(args[0])
3526 else:
3527 raise self.InvalidCmd, '%s is not a valid directory' % args[0]
3528
3529@@ -753,6 +751,9 @@
3530
3531 def check_save(self, args):
3532 """ check the validity of the line"""
3533+ if len(args) == 0:
3534+ args.append('options')
3535+
3536 if args[0] not in self._save_opts:
3537 self.help_save()
3538 raise self.InvalidCmd('wrong \"save\" format')
3539@@ -778,7 +779,7 @@
3540 raise self.InvalidCmd('set needs an option and an argument')
3541
3542 if args[0] not in self._set_options:
3543- if not args[0] in self._options and not args[0] in self.configuration:
3544+ if not args[0] in self.options and not args[0] in self.options:
3545 self.help_set()
3546 raise self.InvalidCmd('Possible options for set are %s' % \
3547 self._set_options)
3548@@ -871,8 +872,8 @@
3549 elif path != 'auto':
3550 self._export_dir = path
3551 elif path == 'auto':
3552- if self.configuration['pythia8_path']:
3553- self._export_dir = self.configuration['pythia8_path']
3554+ if self.options['pythia8_path']:
3555+ self._export_dir = self.options['pythia8_path']
3556 else:
3557 self._export_dir = '.'
3558 else:
3559@@ -880,8 +881,8 @@
3560 # No valid path
3561 self.get_default_path()
3562 else:
3563- if self.configuration['pythia8_path']:
3564- self._export_dir = self.configuration['pythia8_path']
3565+ if self.options['pythia8_path']:
3566+ self._export_dir = self.options['pythia8_path']
3567 else:
3568 self._export_dir = '.'
3569
3570@@ -926,8 +927,8 @@
3571 auto_path = lambda i: pjoin(self.writing_dir,
3572 name_dir(i))
3573 elif self._export_format == 'pythia8':
3574- if self.configuration['pythia8_path']:
3575- self._export_dir = self.configuration['pythia8_path']
3576+ if self.options['pythia8_path']:
3577+ self._export_dir = self.options['pythia8_path']
3578 else:
3579 self._export_dir = '.'
3580 return
3581@@ -1043,7 +1044,7 @@
3582 #===============================================================================
3583 # CompleteForCmd
3584 #===============================================================================
3585-class CompleteForCmd(object):
3586+class CompleteForCmd(cmd.CompleteCmd):
3587 """ The Series of help routine for the MadGraphCmd"""
3588
3589
3590@@ -1336,7 +1337,7 @@
3591
3592 # Format
3593 if len(args) == 1:
3594- opts = self._set_options + self._options.keys() + self.configuration.keys()
3595+ opts = self.options.keys()
3596 return self.list_completion(text, opts)
3597
3598 if len(args) == 2:
3599@@ -1356,7 +1357,7 @@
3600 elif args[1] == 'run_mode':
3601 return self.list_completion(text, [str(i) for i in range(3)])
3602 elif args[1] == 'cluster_type':
3603- return self.list_completion(text, ['pbs', 'condor', 'sge'])
3604+ return self.list_completion(text, cluster.from_name.keys())
3605 elif args[1] == 'cluster_queue':
3606 return []
3607 elif args[1] == 'automatic_html_opening':
3608@@ -1548,7 +1549,7 @@
3609 #===============================================================================
3610 # MadGraphCmd
3611 #===============================================================================
3612-class MadGraphCmd(CmdExtended, HelpToCmd, CheckValidForCmd, CompleteForCmd):
3613+class MadGraphCmd(HelpToCmd, CheckValidForCmd, CompleteForCmd, CmdExtended):
3614 """The command line processor of MadGraph"""
3615
3616 writing_dir = '.'
3617@@ -1610,7 +1611,7 @@
3618
3619 # Variables to store state information
3620 self._multiparticles = {}
3621- self._options = {}
3622+ self.options = {}
3623 self._generate_info = "" # store the first generated process
3624 self._model_v4_path = None
3625 self._use_lower_part_names = False
3626@@ -1618,11 +1619,7 @@
3627 self._export_format = 'madevent'
3628 self._mgme_dir = MG4DIR
3629 self._comparisons = None
3630-
3631- # Set defaults for options
3632- self._options['group_subprocesses'] = 'Auto'
3633- self._options['ignore_six_quark_processes'] = False
3634-
3635+
3636 # Load the configuration file
3637 self.set_configuration()
3638
3639@@ -1678,13 +1675,13 @@
3640 cpu_time1 = time.time()
3641
3642 # Generate processes
3643- if self._options['group_subprocesses'] == 'Auto':
3644+ if self.options['group_subprocesses'] == 'Auto':
3645 collect_mirror_procs = True
3646 else:
3647- collect_mirror_procs = self._options['group_subprocesses']
3648+ collect_mirror_procs = self.options['group_subprocesses']
3649 ignore_six_quark_processes = \
3650- self._options['ignore_six_quark_processes'] if \
3651- "ignore_six_quark_processes" in self._options \
3652+ self.options['ignore_six_quark_processes'] if \
3653+ "ignore_six_quark_processes" in self.options \
3654 else []
3655
3656 myproc = diagram_generation.MultiProcess(myprocdef,
3657@@ -1901,15 +1898,31 @@
3658 print 'No couplings information available in V4 model'
3659 return
3660 text = ''
3661- try:
3662- ufomodel = ufomodels.load_model(self._curr_model.get('name'))
3663- except:
3664- raise self.InvalidCmd, 'no couplings %s in current model' % args[1]
3665- for coup in ufomodel.all_couplings:
3666- order = ', '.join(['%s=%s' %val for val in coup.order.items()])
3667- text += '%s = %s\t( %s)\n' % (coup.name, coup.value, order)
3668+ text = "Current model contains %i couplings\n" % \
3669+ sum([len(part) for part in
3670+ self._curr_model['couplings'].values()])
3671+ keys = self._curr_model['couplings'].keys()
3672+ def key_sort(x, y):
3673+ if ('external',) == x:
3674+ return -1
3675+ elif ('external',) == y:
3676+ return +1
3677+ elif len(x) < len(y):
3678+ return -1
3679+ else:
3680+ return 1
3681+ keys.sort(key_sort)
3682+ for key in keys:
3683+ item = self._curr_model['couplings'][key]
3684+ text += '\ncouplings type: %s\n' % str(key)
3685+ for value in item:
3686+ if value.value is not None:
3687+ text+= ' %s = %s = %s\n' % (value.name, value.expr ,value.value)
3688+ else:
3689+ text+= ' %s = %s\n' % (value.name, value.expr)
3690+
3691 pydoc.pager(text)
3692-
3693+
3694 elif args[0] == 'couplings':
3695 if self._model_v4_path:
3696 print 'No couplings information available in V4 model'
3697@@ -2196,13 +2209,20 @@
3698 if len(forbidden_particles_re.groups()) > 2:
3699 line = line + forbidden_particles_re.group(3)
3700
3701- # Now check for forbidden schannels, specified using "$"
3702- forbidden_schannels_re = re.match("^(.+)\s*\$\s*(.+)\s*$", line)
3703+ # Now check for forbidden schannels, specified using "$$"
3704+ forbidden_schannels_re = re.match("^(.+)\s*\$\s*\$\s*(.+)\s*$", line)
3705 forbidden_schannels = ""
3706 if forbidden_schannels_re:
3707 forbidden_schannels = forbidden_schannels_re.group(2)
3708 line = forbidden_schannels_re.group(1)
3709
3710+ # Now check for forbidden onshell schannels, specified using "$"
3711+ forbidden_onsh_schannels_re = re.match("^(.+)\s*\$\s*(.+)\s*$", line)
3712+ forbidden_onsh_schannels = ""
3713+ if forbidden_onsh_schannels_re:
3714+ forbidden_onsh_schannels = forbidden_onsh_schannels_re.group(2)
3715+ line = forbidden_onsh_schannels_re.group(1)
3716+
3717 # Now check for required schannels, specified using "> >"
3718 required_schannels_re = re.match("^(.+?)>(.+?)>(.+)$", line)
3719 required_schannels = ""
3720@@ -2254,8 +2274,15 @@
3721 raise self.InvalidCmd,\
3722 "Multiparticle %s is or-multiparticle" % part_name + \
3723 " which can be used only for required s-channels"
3724+ forbidden_onsh_schannel_ids = \
3725+ self.extract_particle_ids(forbidden_onsh_schannels)
3726 forbidden_schannel_ids = \
3727 self.extract_particle_ids(forbidden_schannels)
3728+ if forbidden_onsh_schannel_ids and \
3729+ isinstance(forbidden_onsh_schannel_ids[0], list):
3730+ raise self.InvalidCmd,\
3731+ "Multiparticle %s is or-multiparticle" % part_name + \
3732+ " which can be used only for required s-channels"
3733 if forbidden_schannel_ids and \
3734 isinstance(forbidden_schannel_ids[0], list):
3735 raise self.InvalidCmd,\
3736@@ -2274,7 +2301,9 @@
3737 'id': proc_number,
3738 'orders': orders,
3739 'forbidden_particles': forbidden_particle_ids,
3740- 'forbidden_s_channels': forbidden_schannel_ids,
3741+ 'forbidden_onsh_s_channels': forbidden_onsh_schannel_ids,
3742+ 'forbidden_s_channels': \
3743+ forbidden_schannel_ids,
3744 'required_s_channels': required_schannel_ids,
3745 'overall_orders': overall_orders
3746 })
3747@@ -2684,7 +2713,8 @@
3748 else:
3749 subprocess.call(['wget', path[args[0]], '--output-document=%s.tgz'% name], cwd=MG5DIR)
3750 # Untar the file
3751- returncode = subprocess.call(['tar', '-xzpvf', '%s.tgz' % name], cwd=MG5DIR)
3752+ returncode = subprocess.call(['tar', '-xzpvf', '%s.tgz' % name], cwd=MG5DIR,
3753+ stdout=open(os.devnull, 'w'))
3754 if returncode:
3755 raise MadGraph5Error, 'Fail to download correctly the File. Stop'
3756
3757@@ -2721,8 +2751,12 @@
3758 text = text.replace('FC=g77','FC=gfortran')
3759 open(path, 'w').writelines(text)
3760
3761- subprocess.call(['make', 'clean'], cwd = os.path.join(MG5DIR, name))
3762- status = subprocess.call(['make'], cwd = os.path.join(MG5DIR, name))
3763+ if logger.level <= logging.INFO:
3764+ subprocess.call(['make', 'clean'], )
3765+ status = subprocess.call(['make'], cwd = os.path.join(MG5DIR, name))
3766+ else:
3767+ misc.compile(['clean'], mode='', cwd = os.path.join(MG5DIR, name))
3768+ status = misc.compile(mode='', cwd = os.path.join(MG5DIR, name))
3769 if not status:
3770 logger.info('compilation succeeded')
3771
3772@@ -2759,13 +2793,15 @@
3773 """ assign all configuration variable from file
3774 ./input/mg5_configuration.txt. assign to default if not define """
3775
3776- self.configuration = {'pythia8_path': './pythia8',
3777+ self.options = {'pythia8_path': './pythia8',
3778 'web_browser':None,
3779 'eps_viewer':None,
3780 'text_editor':None,
3781 'fortran_compiler':None,
3782- 'automatic_html_opening':True}
3783-
3784+ 'automatic_html_opening':True,
3785+ 'group_subprocesses': 'Auto',
3786+ 'ignore_six_quark_processes': False}
3787+
3788 if not config_path:
3789 try:
3790 config_file = open(pjoin(os.environ['HOME'],'.mg5', 'mg5_configuration.txt'))
3791@@ -2788,25 +2824,25 @@
3792 else:
3793 name = name.strip()
3794 value = value.strip()
3795- self.configuration[name] = value
3796+ self.options[name] = value
3797 if value.lower() == "none":
3798- self.configuration[name] = None
3799+ self.options[name] = None
3800
3801 if test:
3802- return self.configuration
3803+ return self.options
3804
3805 # Treat each expected input
3806 # 1: Pythia8_path
3807 # try relative path
3808- for key in self.configuration:
3809+ for key in self.options:
3810 if key == 'pythia8_path':
3811- if self.configuration['pythia8_path'] in ['None', None]:
3812- self.configuration['pythia8_path'] = None
3813+ if self.options['pythia8_path'] in ['None', None]:
3814+ self.options['pythia8_path'] = None
3815 continue
3816- pythia8_dir = pjoin(MG5DIR, self.configuration['pythia8_path'])
3817+ pythia8_dir = pjoin(MG5DIR, self.options['pythia8_path'])
3818 if not os.path.isfile(pjoin(pythia8_dir, 'include', 'Pythia.h')):
3819- if not os.path.isfile(pjoin(self.configuration['pythia8_path'], 'include', 'Pythia.h')):
3820- self.configuration['pythia8_path'] = None
3821+ if not os.path.isfile(pjoin(self.options['pythia8_path'], 'include', 'Pythia.h')):
3822+ self.options['pythia8_path'] = None
3823 else:
3824 continue
3825
3826@@ -2817,16 +2853,16 @@
3827 elif key not in ['text_editor','eps_viewer','web_browser']:
3828 # Default: try to set parameter
3829 try:
3830- self.do_set("%s %s" % (key, self.configuration[key]), log=False)
3831+ self.do_set("%s %s" % (key, self.options[key]), log=False)
3832 except MadGraph5Error, error:
3833 print error
3834 logger.warning("Option %s from config file not understood" \
3835 % key)
3836
3837 # Configure the way to open a file:
3838- launch_ext.open_file.configure(self.configuration)
3839+ launch_ext.open_file.configure(self.options)
3840
3841- return self.configuration
3842+ return self.options
3843
3844 def check_for_export_dir(self, filepath):
3845 """Check if the files is in a valid export directory and assign it to
3846@@ -2886,16 +2922,16 @@
3847
3848 if len(generate_info.split('>')[0].strip().split())>1:
3849 ext_program = launch_ext.MELauncher(args[1], self.timeout, self,
3850- pythia=self.configuration['pythia-pgs_path'],
3851- delphes=self.configuration['delphes_path'],
3852+ pythia=self.options['pythia-pgs_path'],
3853+ delphes=self.options['delphes_path'],
3854 shell = hasattr(self, 'do_shell'),
3855 **options)
3856 else:
3857 # This is a width computation
3858 ext_program = launch_ext.MELauncher(args[1], self.timeout, self,
3859 unit='GeV',
3860- pythia=self.configuration['pythia-pgs_path'],
3861- delphes=self.configuration['delphes_path'],
3862+ pythia=self.options['pythia-pgs_path'],
3863+ delphes=self.options['delphes_path'],
3864 shell = hasattr(self, 'do_shell'),
3865 **options)
3866
3867@@ -3002,53 +3038,8 @@
3868 raise self.InvalidCmd('No processes to save!')
3869
3870 elif args[0] == 'options':
3871- self.write_configuration(args[1])
3872-
3873-
3874- def write_configuration(self, path):
3875- """Write the configuration file"""
3876- # We use the default configuration file as a template.
3877- # to ensure that all configuration information are written we
3878- # keep track of all key that we need to write.
3879+ CmdExtended.do_save(self, line)
3880
3881- to_write = self._options.keys()[:] + self.configuration.keys()[:]
3882- writer = open(path,'w')
3883- # Use local configuration => Need to update the path
3884- conf = os.path.join(MG5DIR, 'input', 'mg5_configuration.txt')
3885- for line in file(conf):
3886- if '#' in line:
3887- data, comment = line.split('#',1)
3888- else:
3889- data, comment = line, ''
3890- data = data.split('=')
3891- if len(data) !=2:
3892- writer.writelines(line)
3893- continue
3894- key = data[0].strip()
3895- if key in self._options:
3896- value = str(self._options[key])
3897- elif key in self.configuration:
3898- value = str(self.configuration[key])
3899- else:
3900- value = data[1].strip()
3901- try:
3902- to_write.remove(key)
3903- except:
3904- pass
3905- if '_path' in key:
3906- # special case need to update path
3907- # check if absolute path
3908- if value.startswith('./'):
3909- value = os.path.realpath(os.path.join(MG5DIR, value))
3910- writer.writelines('%s = %s # %s \n' % (key, value, comment))
3911- for key in to_write:
3912- if key in self._options:
3913- writer.writelines('%s = %s \n' % (key,self._options[key]))
3914- else:
3915- writer.writelines('%s = %s \n' % (key,self.configuration[key]))
3916-
3917- writer.close()
3918-
3919
3920 # Set an option
3921 def do_set(self, line, log=True):
3922@@ -3062,9 +3053,9 @@
3923
3924 if args[0] == 'ignore_six_quark_processes':
3925 if args[1] == 'False':
3926- self._options[args[0]] = False
3927+ self.options[args[0]] = False
3928 return
3929- self._options[args[0]] = list(set([abs(p) for p in \
3930+ self.options[args[0]] = list(set([abs(p) for p in \
3931 self._multiparticles[args[1]]\
3932 if self._curr_model.get_particle(p).\
3933 is_fermion() and \
3934@@ -3074,16 +3065,16 @@
3935 logger.info('Ignore processes with >= 6 quarks (%s)' % \
3936 ",".join([\
3937 self._curr_model.get_particle(q).get('name') \
3938- for q in self._options[args[0]]]))
3939+ for q in self.options[args[0]]]))
3940
3941 elif args[0] == 'group_subprocesses':
3942 if args[1] != 'Auto':
3943- self._options[args[0]] = eval(args[1])
3944+ self.options[args[0]] = eval(args[1])
3945 else:
3946- self._options[args[0]] = 'Auto'
3947+ self.options[args[0]] = 'Auto'
3948 if log:
3949 logger.info('Set group_subprocesses to %s' % \
3950- str(self._options[args[0]]))
3951+ str(self.options[args[0]]))
3952 logger.info('Note that you need to regenerate all processes')
3953 self._curr_amps = diagram_generation.AmplitudeList()
3954 self._curr_matrix_elements = helas_objects.HelasMultiProcess()
3955@@ -3098,19 +3089,19 @@
3956 if args[1] != 'None':
3957 if log:
3958 logger.info('set fortran compiler to %s' % args[1])
3959- self.configuration['fortran_compiler'] = args[1]
3960+ self.options['fortran_compiler'] = args[1]
3961 else:
3962- self.configuration['fortran_compiler'] = None
3963- elif args[0] in self._options:
3964+ self.options['fortran_compiler'] = None
3965+ elif args[0] in self.options:
3966 if args[1] in ['None','True', 'False']:
3967- self._options[args[0]] = eval(args[1])
3968+ self.options[args[0]] = eval(args[1])
3969 else:
3970- self._options[args[0]] = args[1]
3971- elif args[0] in self.configuration:
3972+ self.options[args[0]] = args[1]
3973+ elif args[0] in self.options:
3974 if args[1] in ['None','True','False']:
3975- self.configuration[args[0]] = eval(args[1])
3976+ self.options[args[0]] = eval(args[1])
3977 else:
3978- self.configuration[args[0]] = args[1]
3979+ self.options[args[0]] = args[1]
3980
3981
3982 def do_open(self, line):
3983@@ -3157,8 +3148,8 @@
3984 #check if we need to group processes
3985 group_subprocesses = False
3986 if self._export_format == 'madevent' and \
3987- self._options['group_subprocesses']:
3988- if self._options['group_subprocesses'] is True:
3989+ self.options['group_subprocesses']:
3990+ if self.options['group_subprocesses'] is True:
3991 group_subprocesses = True
3992 elif self._curr_amps[0].get_ninitial() == 2:
3993 group_subprocesses = True
3994@@ -3216,9 +3207,9 @@
3995
3996 # Check if we need to group the SubProcesses or not
3997 group = True
3998- if self._options['group_subprocesses'] is False:
3999+ if self.options['group_subprocesses'] is False:
4000 group = False
4001- elif self._options['group_subprocesses'] == 'Auto' and \
4002+ elif self.options['group_subprocesses'] == 'Auto' and \
4003 self._curr_amps[0].get_ninitial() == 1:
4004 group = False
4005
4006@@ -3440,6 +3431,11 @@
4007 wanted_couplings)
4008 export_cpp.make_model_cpp(self._export_dir)
4009
4010+ elif self._export_format == 'madevent':
4011+ # Create configuration file [path to executable] for madevent
4012+ filename = os.path.join(self._export_dir, 'Cards', 'me5_configuration.txt')
4013+ self.do_save('options %s' % filename, check=False)
4014+
4015 if self._export_format in ['madevent', 'standalone']:
4016
4017 self._curr_exporter.finalize_v4_directory( \
4018@@ -3448,15 +3444,12 @@
4019 self.history,
4020 not nojpeg,
4021 online,
4022- self.configuration['fortran_compiler'])
4023+ self.options['fortran_compiler'])
4024
4025 if self._export_format in ['madevent', 'standalone', 'standalone_cpp']:
4026 logger.info('Output to directory ' + self._export_dir + ' done.')
4027- if self._export_format == 'madevent':
4028- # Create configuration file [path to executable] for madevent
4029- filename = os.path.join(self._export_dir, 'Cards', 'me5_configuration.txt')
4030- self.do_save('options %s' % filename, check=False)
4031-
4032+
4033+ if self._export_format == 'madevent':
4034 logger.info('Type \"launch\" to generate events from this process, or see')
4035 logger.info(self._export_dir + '/README')
4036 logger.info('Run \"open index.html\" to see more information about this process.')
4037@@ -3479,7 +3472,7 @@
4038 last_action_2 = '%s %s' % (last_action, args[1])
4039 else:
4040 last_action_2 = 'none'
4041-
4042+
4043 #===============================================================================
4044 # Command Parser
4045 #===============================================================================
4046
4047=== modified file 'madgraph/interface/master_interface.py'
4048--- madgraph/interface/master_interface.py 2012-02-21 23:49:21 +0000
4049+++ madgraph/interface/master_interface.py 2012-03-09 00:04:18 +0000
4050@@ -47,6 +47,15 @@
4051
4052 class Switcher(object):
4053 """ Helping class containing all the switching routine """
4054+
4055+ def __init__(self, main='MadGraph', *args, **opt):
4056+
4057+ # define the interface
4058+ self.change_principal_cmd(main)
4059+ self.cmd.__init__(self, *args, **opt)
4060+
4061+
4062+
4063
4064 def debug_link_to_command(self):
4065 """redefine all the command to call directly the appropriate child"""
4066@@ -350,17 +359,12 @@
4067 def test_interface(self, *args, **opts):
4068 return self.cmd.test_interface(self, *args, **opts)
4069
4070+ def set_configuration(self, *args, **opts):
4071+ return self.cmd.set_configuration(self, *args, **opts)
4072
4073
4074 class MasterCmd(Switcher, LoopCmd.LoopInterface, cmd.CmdShell):
4075
4076- def __init__(self, main='MadGraph', *args, **opt):
4077-
4078- # define the interface
4079- self.change_principal_cmd(main)
4080- self.cmd.__init__(self, *args, **opt)
4081-
4082-
4083 def change_principal_cmd(self, name):
4084 if name == 'MadGraph':
4085 self.cmd = MGcmd.MadGraphCmd
4086@@ -387,7 +391,7 @@
4087
4088
4089 #standard initialization
4090- MasterCmd.__init__(self, mgme_dir = '', *arg, **opt)
4091+ Switcher.__init__(self, mgme_dir = '', *arg, **opt)
4092
4093 def change_principal_cmd(self, name):
4094 if name == 'MadGraph':
4095@@ -403,7 +407,7 @@
4096 def finalize(self, nojpeg):
4097 """Finalize web generation"""
4098
4099- Switcher.finalize(self, nojpeg, online = True)
4100+ self.cmd.finalize(self, nojpeg, online = True)
4101
4102 # Generate a new amplitude
4103 def do_generate(self, line):
4104
4105=== modified file 'madgraph/iolibs/export_cpp.py'
4106--- madgraph/iolibs/export_cpp.py 2011-11-10 06:06:00 +0000
4107+++ madgraph/iolibs/export_cpp.py 2012-03-09 00:04:18 +0000
4108@@ -32,13 +32,14 @@
4109 import madgraph.iolibs.drawing_eps as draw
4110 import madgraph.iolibs.files as files
4111 import madgraph.iolibs.helas_call_writers as helas_call_writers
4112-import madgraph.iolibs.misc as misc
4113 import madgraph.iolibs.file_writers as writers
4114 import madgraph.iolibs.template_files as template_files
4115 import madgraph.iolibs.ufo_expression_parsers as parsers
4116 from madgraph import MadGraph5Error, InvalidCmd, MG5DIR
4117 from madgraph.iolibs.files import cp, ln, mv
4118
4119+import madgraph.various.misc as misc
4120+
4121 import aloha.create_aloha as create_aloha
4122 import aloha.aloha_writers as aloha_writers
4123
4124
4125=== modified file 'madgraph/iolibs/export_python.py'
4126--- madgraph/iolibs/export_python.py 2011-10-29 12:42:14 +0000
4127+++ madgraph/iolibs/export_python.py 2012-03-09 00:04:18 +0000
4128@@ -29,13 +29,14 @@
4129 import madgraph.iolibs.drawing_eps as draw
4130 import madgraph.iolibs.files as files
4131 import madgraph.iolibs.helas_call_writers as helas_call_writers
4132-import madgraph.iolibs.misc as misc
4133 import madgraph.iolibs.file_writers as writers
4134 import madgraph.iolibs.template_files as Template
4135 import madgraph.iolibs.ufo_expression_parsers as parsers
4136 import madgraph.iolibs.group_subprocs as group_subprocs
4137 from madgraph import MadGraph5Error, MG5DIR
4138
4139+import madgraph.various.misc as misc
4140+
4141 import aloha.create_aloha as create_aloha
4142 import aloha.aloha_writers as aloha_writers
4143
4144
4145=== modified file 'madgraph/iolibs/export_v4.py'
4146--- madgraph/iolibs/export_v4.py 2012-02-03 21:44:27 +0000
4147+++ madgraph/iolibs/export_v4.py 2012-03-09 00:04:18 +0000
4148@@ -18,6 +18,7 @@
4149 import fractions
4150 import glob
4151 import logging
4152+import math
4153 import os
4154 import re
4155 import shutil
4156@@ -30,15 +31,16 @@
4157 import madgraph.iolibs.drawing_eps as draw
4158 import madgraph.iolibs.files as files
4159 import madgraph.iolibs.group_subprocs as group_subprocs
4160-import madgraph.iolibs.misc as misc
4161 import madgraph.iolibs.file_writers as writers
4162 import madgraph.iolibs.gen_infohtml as gen_infohtml
4163 import madgraph.iolibs.template_files as template_files
4164 import madgraph.iolibs.ufo_expression_parsers as parsers
4165 import madgraph.various.diagram_symmetry as diagram_symmetry
4166+import madgraph.various.misc as misc
4167 import madgraph.various.process_checks as process_checks
4168
4169
4170+
4171 import aloha.create_aloha as create_aloha
4172 import models.write_param_card as param_writer
4173 import models.check_param_card as check_param_card
4174@@ -1068,9 +1070,6 @@
4175 # Add the combine_events.f
4176 filename = os.path.join(self.dir_path,'Source','combine_events.f')
4177 self.write_combine_events(writers.FortranWriter(filename))
4178- # Add the write_banner.f
4179- filename = os.path.join(self.dir_path,'Source','write_banner.f')
4180- self.write_write_banner(writers.FortranWriter(filename))
4181 # Add the symmetry.f
4182 filename = os.path.join(self.dir_path,'SubProcesses','symmetry.f')
4183 self.write_symmetry(writers.FortranWriter(filename))
4184@@ -1093,7 +1092,7 @@
4185 self.dir_path+'/bin/internal/madevent_interface.py')
4186 cp(_file_path+'/interface/extended_cmd.py',
4187 self.dir_path+'/bin/internal/extended_cmd.py')
4188- cp(_file_path+'/iolibs/misc.py', self.dir_path+'/bin/internal/misc.py')
4189+ cp(_file_path+'/various/misc.py', self.dir_path+'/bin/internal/misc.py')
4190 cp(_file_path+'/iolibs/files.py', self.dir_path+'/bin/internal/files.py')
4191 cp(_file_path+'/iolibs/save_load_object.py',
4192 self.dir_path+'/bin/internal/save_load_object.py')
4193@@ -1316,7 +1315,7 @@
4194 for file in linkfiles:
4195 ln('../' + file , '.')
4196
4197- #import nexternal/leshouch in Source
4198+ #import nexternal/leshouche in Source
4199 ln('nexternal.inc', '../../Source', log=False)
4200 ln('leshouche.inc', '../../Source', log=False)
4201 ln('maxamps.inc', '../../Source', log=False)
4202@@ -1418,10 +1417,6 @@
4203 os.remove('madevent.tar.gz')
4204 misc.compile(mode='None')
4205
4206- if online:
4207- # Touch "Online" file
4208- os.system('touch %s/Online' % self.dir_path)
4209-
4210 subprocess.call([os.path.join(old_pos, self.dir_path, 'bin', 'internal', 'gen_cardhtml-pl')],
4211 stdout = devnull)
4212
4213@@ -1960,24 +1955,6 @@
4214 return True
4215
4216 #===========================================================================
4217- # write_write_banner
4218- #===========================================================================
4219- def write_write_banner(self, writer):
4220- """Write the SubProcess/driver.f file for MG4"""
4221-
4222- path = os.path.join(_file_path,'iolibs','template_files','madevent_write_banner.f')
4223-
4224- if self.model_name == 'mssm' or self.model_name.startswith('mssm-'):
4225- card = 'Source/MODEL/MG5_param.dat'
4226- else:
4227- card = 'param_card.dat'
4228- text = open(path).read() % {'param_card_name':card}
4229-
4230- writer.write(text)
4231-
4232- return True
4233-
4234- #===========================================================================
4235 # write_combine_events
4236 #===========================================================================
4237 def write_combine_events(self, writer):
4238@@ -2290,10 +2267,11 @@
4239 """Write the files symfact.dat for MG4 by comparing diagrams using
4240 the internal matrix element value functionality."""
4241
4242-
4243+ pos = max(2, int(math.ceil(math.log10(len(symmetry)))))
4244+ form = "%"+str(pos)+"r %"+str(pos+1)+"r"
4245 # Write out lines for symswap.inc file (used to permute the
4246 # external leg momenta
4247- lines = [ "%3r %3r" %(i+1, s) for i,s in enumerate(symmetry) if s != 0]
4248+ lines = [ form %(i+1, s) for i,s in enumerate(symmetry) if s != 0]
4249
4250 # Write the file
4251 writer.writelines(lines)
4252
4253=== modified file 'madgraph/iolibs/group_subprocs.py'
4254--- madgraph/iolibs/group_subprocs.py 2011-10-29 03:50:27 +0000
4255+++ madgraph/iolibs/group_subprocs.py 2012-03-09 00:04:18 +0000
4256@@ -31,11 +31,12 @@
4257 import madgraph.core.helas_objects as helas_objects
4258 import madgraph.iolibs.drawing_eps as draw
4259 import madgraph.iolibs.files as files
4260-import madgraph.iolibs.misc as misc
4261 import madgraph.iolibs.file_writers as writers
4262 import madgraph.iolibs.template_files as template_files
4263 import madgraph.iolibs.ufo_expression_parsers as parsers
4264
4265+import madgraph.various.misc as misc
4266+
4267 import aloha.create_aloha as create_aloha
4268
4269 import models.sm.write_param_card as write_param_card
4270
4271=== modified file 'madgraph/iolibs/import_v4.py'
4272--- madgraph/iolibs/import_v4.py 2011-10-20 02:47:51 +0000
4273+++ madgraph/iolibs/import_v4.py 2012-03-09 00:04:18 +0000
4274@@ -25,14 +25,12 @@
4275 import madgraph.core.color_algebra as color
4276 import madgraph.iolibs.files as files
4277 import madgraph.iolibs.save_load_object as save_load_object
4278-import madgraph.iolibs.misc as misc
4279+
4280+import madgraph.various.misc as misc
4281
4282 from madgraph.core.base_objects import Particle, ParticleList
4283 from madgraph.core.base_objects import Interaction, InteractionList
4284
4285-
4286-
4287-
4288 logger = logging.getLogger('madgraph.import_v4')
4289
4290 #===============================================================================
4291
4292=== modified file 'madgraph/iolibs/template_files/madevent_combine_events.f'
4293--- madgraph/iolibs/template_files/madevent_combine_events.f 2012-02-08 08:52:30 +0000
4294+++ madgraph/iolibs/template_files/madevent_combine_events.f 2012-03-09 00:04:18 +0000
4295@@ -651,12 +651,10 @@
4296 c
4297 character*(*) plist
4298 parameter (plist='subproc.mg')
4299- integer maxsubprocesses
4300- parameter (maxsubprocesses=999)
4301 c
4302 c Arguments
4303 c
4304- character*300 subname(maxsubprocesses)
4305+ character*300 subname(*)
4306 integer ns
4307 c-----
4308 c Begin Code
4309
4310=== modified file 'madgraph/iolibs/template_files/madevent_makefile_source'
4311--- madgraph/iolibs/template_files/madevent_makefile_source 2011-07-19 20:04:10 +0000
4312+++ madgraph/iolibs/template_files/madevent_makefile_source 2012-03-09 00:04:18 +0000
4313@@ -15,7 +15,6 @@
4314 rw_events.o rw_routines.o kin_functions.o open_file.o basecode.o setrun.o \
4315 run_printout.o dgauss.o readgrid.o getissud.o
4316 INCLUDEF= coupl.inc genps.inc hbook.inc DECAY/decay.inc psample.inc cluster.inc sudgrid.inc
4317-BANNER = write_banner.o rw_events.o ranmar.o kin_functions.o open_file.o rw_routines.o alfas_functions.o
4318 COMBINE = combine_events.o rw_events.o ranmar.o kin_functions.o open_file.o rw_routines.o alfas_functions.o setrun.o
4319 GENSUDGRID = gensudgrid.o is-sud.o setrun_gen.o rw_routines.o open_file.o
4320
4321@@ -25,7 +24,7 @@
4322
4323 # Binaries
4324
4325-BINARIES = $(BINDIR)sum_html $(BINDIR)gen_ximprove $(BINDIR)combine_events \
4326+BINARIES = $(BINDIR)gen_ximprove $(BINDIR)combine_events \
4327 $(BINDIR)gensudgrid $(BINDIR)combine_runs
4328
4329 # Compile commands
4330@@ -48,8 +47,6 @@
4331 $(LIBDIR)libmodel.$(libext): MODEL
4332 cd MODEL; make
4333
4334-$(BINDIR)sum_html: sum_html.o
4335- $(FC) $(FFLAGS) -o $@ $^
4336 $(BINDIR)gen_ximprove: gen_ximprove.o ranmar.o rw_routines.o open_file.o
4337 $(FC) $(FFLAGS) -o $@ $^
4338 $(BINDIR)combine_events: $(COMBINE) $(LIBDIR)libmodel.$(libext) $(LIBDIR)libpdf.$(libext)
4339@@ -64,7 +61,6 @@
4340 dsample.o: dsample.f genps.inc
4341 invarients.o: invarients.f genps.inc
4342 setrun.o: setrun.f nexternal.inc leshouche.inc genps.inc
4343-sum_html.o: sum_html.f genps.inc
4344 gen_ximprove.o: gen_ximprove.f run_config.inc
4345 combine_events.o: combine_events.f run_config.inc
4346 select_events.o: select_events.f run_config.inc
4347
4348=== modified file 'madgraph/iolibs/template_files/madevent_symmetry.f'
4349--- madgraph/iolibs/template_files/madevent_symmetry.f 2012-01-30 03:26:48 +0000
4350+++ madgraph/iolibs/template_files/madevent_symmetry.f 2012-03-09 00:04:18 +0000
4351@@ -217,7 +217,7 @@
4352 c local
4353 c
4354 integer i, j, nbw, ic, icode
4355- integer ncode, nconf
4356+ integer ncode, nconf, nsym
4357 double precision dconfig
4358 character*10 formstr
4359 integer iarray(imax)
4360@@ -294,6 +294,7 @@
4361 c Now write out the symmetry factors for each graph
4362 c
4363 open (unit=26, file = 'symfact.dat', status='unknown')
4364+ nsym=int(dlog10(dble(mapconfig(0))))+3
4365 do i=1,mapconfig(0)
4366 if (use_config(i) .gt. 0) then
4367 c
4368@@ -326,17 +327,19 @@
4369 call enCode(icode,iarray,ibase,imax)
4370 if (icode .gt. 0) then
4371 nconf=int(dlog10(dble(mapconfig(i))))+1
4372- write(formstr,'(a,i1,a,i1,a)') '(F',nconf+ncode+1,
4373- $ '.',ncode,',i6)'
4374+ write(formstr,'(a,i1,a,i1,a,i1,a)') '(F',nconf+ncode+1,
4375+ $ '.',ncode,',i',nsym,')'
4376 dconfig=mapconfig(i)+icode*1d0/10**ncode
4377 write(26,formstr) dconfig,use_config(i)
4378 else
4379- write(26,'(2i6)') mapconfig(i),use_config(i)
4380+ write(formstr,'(a,i1,a)') '(2i',nsym,')'
4381+ write(26,formstr) mapconfig(i),use_config(i)
4382 endif
4383 call bw_increment_array(iarray,imax,ibase,done)
4384 enddo
4385 else
4386- write(26,'(2i6)') mapconfig(i), use_config(i)
4387+ write(formstr,'(a,i1,a)') '(2i',nsym,')'
4388+ write(26,formstr) mapconfig(i),use_config(i)
4389 endif
4390 enddo
4391 end
4392
4393=== removed file 'madgraph/iolibs/template_files/madevent_write_banner.f'
4394--- madgraph/iolibs/template_files/madevent_write_banner.f 2011-07-14 16:19:56 +0000
4395+++ madgraph/iolibs/template_files/madevent_write_banner.f 1970-01-01 00:00:00 +0000
4396@@ -1,116 +0,0 @@
4397- program write_banner
4398- implicit none
4399-c
4400-c parameters
4401-c
4402- integer MaxParticles
4403- parameter (MaxParticles=15)
4404-c
4405-c Local
4406-c
4407- integer lunr, lunw,luni
4408- data luni,lunr,lunw/14,15,16/ ! unit numbers for reading and writing
4409- integer ic(7,MaxParticles),next
4410- double precision P(0:4,MaxParticles),wgt
4411- real*8 sum,mxwgt
4412- logical done
4413- integer i,imax,j
4414- integer nevent,nfound
4415- character*25 infile,outfile
4416- integer iseed
4417- data iseed/9999/
4418- character*30 process,QED,QCD
4419- double precision scale,aqcd,aqed
4420- integer ievent
4421-c--cuts
4422-c double precision etmin(3:nexternal),etamax(3:nexternal)
4423-c double precision r2min(3:nexternal,3:nexternal)
4424-c double precision s_min(nexternal,nexternal)
4425-c common/to_cuts/ etmin ,etamax , r2min, s_min
4426-c
4427-c open the event file
4428-c
4429- write(*,*) 'input the event file (e.g. Events/events.dat)'
4430- read(*,'(a)') infile
4431- open(unit=lunr,file=infile,status='old')
4432-c
4433-c open banner file
4434-c
4435- write(*,*) 'input the banner file name (e.g. banner-events.dat)'
4436- read(*,'(a)') outfile
4437- open(lunw,file=outfile,status='unknown')
4438-c
4439-c gather the info
4440-c
4441- call setpara('%(param_card_name)s')
4442-c call setcuts
4443-c call get_seed(iseed)
4444-c
4445-c All the info is gathered. Now start writing it out.
4446-c
4447- call write_para(lunw)
4448- write(lunw,'(a70)') '## '
4449- write(lunw,'(a70)') '##------------------- '
4450- write(lunw,'(a70)') '## Run-time options '
4451- write(lunw,'(a70)') '##------------------- '
4452- write(lunw,'(a70)') '## '
4453-c write(lunw,'(a70)') '##********************************************************************'
4454-c write(lunw,'(a70)') '## Standard Cuts *'
4455-c write(lunw,'(a70)') '##********************************************************************'
4456-c write(lunw,'(a13,8i8)') '## Particle ',(i,i=3,nexternal)
4457-c write(lunw,'(a13,8f8.1)') '## Et >',(etmin(i),i=3,nexternal)
4458-c write(lunw,'(a13,8f8.1)') '## Eta <',(etamax(i),i=3,nexternal)
4459-c do j=3,nexternal-1
4460-c write(lunw,'(a,i2,a,8f8.1)') '## d R #',j,' >',(-0.0,i=3,j),
4461-c & (r2min(i,j),i=j+1,nexternal)
4462-c do i=j+1,nexternal
4463-c r2min(i,j)=r2min(i,j)**2 !Since r2 returns distance squared
4464-c enddo
4465-c enddo
4466-c do j=3,nexternal-1
4467-c write(lunw,'(a,i2,a,8f8.1)') '## s min #',j,'>',
4468-c & (s_min(i,j),i=3,nexternal)
4469-c enddo
4470- write(lunw,'(a70)') '##********************************************************************'
4471-c
4472-c Now write out specific information on the event set
4473-c
4474- done=.false.
4475- nevent=0
4476- nfound=0
4477- sum=0d0
4478- mxwgt=-1d0
4479- do while (.not. done)
4480- call read_event(lunr,P,wgt,next,ic,ievent,scale,aqcd,aqed,done)
4481- sum=sum+wgt
4482- mxwgt = max(wgt,mxwgt)
4483- nevent=nevent+1
4484- enddo
4485-
4486- write(lunw,'(a70)') '## '
4487- write(lunw,'(a70)') '##------------------- '
4488- write(lunw,'(a70)') '## Event information '
4489- write(lunw,'(a70)') '##------------------- '
4490- write(lunw,'(a70)') '## '
4491- write(lunw,'(a70)') '##********************************************************************'
4492- write(lunw,'(a30,i10)') '## Number of Events : ',nevent
4493- write(lunw,'(a30,e10.5)') '## Integrated weight (pb) : ',sum
4494- write(lunw,'(a30,e10.5)') '## Max wgt : ',mxwgt
4495- write(lunw,'(a30,e10.5)') '## Average wgt : ',sum/nevent
4496- write(lunw,'(a70)') '##********************************************************************'
4497-
4498- rewind(lunr)
4499- done = .false.
4500- nevent=0
4501- do while (.not. done)
4502- call read_event(lunr,P,wgt,next,ic,ievent,scale,aqcd,aqed,done)
4503- nevent=nevent+1
4504- if (.not. done) then
4505- call write_event(lunw,p,wgt,next,ic,nevent,scale,aqcd,aqed)
4506- endif
4507- enddo
4508-
4509- close(lunw)
4510- close(lunr)
4511-
4512- end
4513
4514=== modified file 'madgraph/various/banner.py'
4515--- madgraph/various/banner.py 2012-02-15 08:20:08 +0000
4516+++ madgraph/various/banner.py 2012-03-09 00:04:18 +0000
4517@@ -21,7 +21,7 @@
4518 pjoin = os.path.join
4519
4520 try:
4521- import madgraph.iolibs.misc as misc
4522+ import madgraph.various.misc as misc
4523 from madgraph import MG5DIR
4524 MADEVENT = False
4525 except:
4526@@ -95,7 +95,16 @@
4527 self.add(pjoin(medir,'Cards', 'proc_card_mg5.dat'))
4528 else:
4529 self.add(pjoin(medir,'Cards', 'proc_card.dat'))
4530-
4531+
4532+
4533+ def change_seed(self, seed):
4534+ """Change the seed value in the banner"""
4535+ # 0 = iseed
4536+ p = re.compile(r'''^\s*\d+\s*=\s*iseed''', re.M)
4537+ new_seed_str = " %s = iseed" % seed
4538+ self['mgruncard'] = p.sub(new_seed_str, self['mgruncard'])
4539+
4540+
4541 ############################################################################
4542 # SPLIT BANNER
4543 ############################################################################
4544
4545=== modified file 'madgraph/various/cluster.py'
4546--- madgraph/various/cluster.py 2012-02-05 01:19:01 +0000
4547+++ madgraph/various/cluster.py 2012-03-09 00:04:18 +0000
4548@@ -29,6 +29,33 @@
4549 pass
4550
4551
4552+def multiple_try(nb_try=5, sleep=1):
4553+
4554+ def deco_retry(f):
4555+ def deco_f_retry(*args, **opt):
4556+ for i in range(nb_try):
4557+ try:
4558+ return f(*args, **opt)
4559+ except KeyboardInterrupt:
4560+ raise
4561+ except:
4562+ time.sleep(sleep)
4563+ raise
4564+ return deco_f_retry
4565+ return deco_retry
4566+
4567+def check_interupt(error=KeyboardInterrupt):
4568+
4569+ def deco_interupt(f):
4570+ def deco_f_interupt(self, *args, **opt):
4571+ try:
4572+ return f(self, *args, **opt)
4573+ except error:
4574+ self.remove(*args, **opt)
4575+ raise error
4576+ return deco_f_interupt
4577+ return deco_interupt
4578+
4579
4580 class Cluster(object):
4581 """Basic Class for all cluster type submission"""
4582@@ -40,7 +67,8 @@
4583 self.submitted_ids = []
4584 self.finish = 0
4585 self.cluster_queue = cluster_queue
4586-
4587+
4588+
4589 def submit(self, prog, argument=[], cwd=None, stdout=None, stderr=None, log=None):
4590 """How to make one submission. Return status id on the cluster."""
4591 raise NotImplemented, 'No implementation of how to submit a job to cluster \'%s\'' % self.name
4592@@ -68,6 +96,7 @@
4593 """ control the status of a single job with it's cluster id """
4594 raise NotImplemented, 'No implementation of how to control the job status to cluster \'%s\'' % self.name
4595
4596+ @check_interupt()
4597 def wait(self, me_dir, fct):
4598 """Wait that all job are finish"""
4599
4600@@ -83,6 +112,7 @@
4601 self.submitted = 0
4602 self.submitted_ids = []
4603
4604+ @check_interupt()
4605 def launch_and_wait(self, prog, argument=[], cwd=None, stdout=None,
4606 stderr=None, log=None):
4607 """launch one job on the cluster and wait for it"""
4608@@ -92,12 +122,18 @@
4609 if not status in ['R','I']:
4610 break
4611 time.sleep(30)
4612+
4613+ def remove(self, *args):
4614+ """ """
4615+ logger.warning("""This cluster didn't support job removal,
4616+ the jobs are still running on the cluster.""")
4617
4618 class CondorCluster(Cluster):
4619 """Basic class for dealing with cluster submission"""
4620
4621 name = 'condor'
4622
4623+ @multiple_try()
4624 def submit(self, prog, argument=[], cwd=None, stdout=None, stderr=None, log=None):
4625 """Submit the """
4626
4627@@ -110,6 +146,7 @@
4628 notification = Error
4629 Initialdir = %(cwd)s
4630 %(requirement)s
4631+ getenv=True
4632 queue 1
4633 """
4634
4635@@ -153,13 +190,16 @@
4636 self.submitted += 1
4637 self.submitted_ids.append(id)
4638 return id
4639-
4640+
4641+ @multiple_try()
4642 def control_one_job(self, id):
4643 """ control the status of a single job with it's cluster id """
4644 cmd = 'condor_q '+str(id)+" -format \'%-2s \\n\' \'ifThenElse(JobStatus==0,\"U\",ifThenElse(JobStatus==1,\"I\",ifThenElse(JobStatus==2,\"R\",ifThenElse(JobStatus==3,\"X\",ifThenElse(JobStatus==4,\"C\",ifThenElse(JobStatus==5,\"H\",ifThenElse(JobStatus==6,\"E\",string(JobStatus))))))))\'"
4645 status = subprocess.Popen([cmd], shell=True, stdout=subprocess.PIPE)
4646 return status.stdout.readline().strip()
4647-
4648+
4649+ @check_interupt()
4650+ @multiple_try()
4651 def control(self, me_dir):
4652 """ control the status of a single job with it's cluster id """
4653
4654@@ -180,7 +220,17 @@
4655 fail += 1
4656
4657 return idle, run, self.submitted - (idle+run+fail), fail
4658-
4659+
4660+ @multiple_try()
4661+ def remove(self, *args):
4662+ """Clean the jobson the cluster"""
4663+
4664+ if not self.submitted_ids:
4665+ return
4666+ cmd = "condor_rm %s" % ' '.join(self.submitted_ids)
4667+
4668+ status = subprocess.Popen([cmd], shell=True, stdout=open(os.devnull,'w'))
4669+
4670 class PBSCluster(Cluster):
4671 """Basic class for dealing with cluster submission"""
4672
4673@@ -188,7 +238,7 @@
4674 idle_tag = ['Q']
4675 running_tag = ['T','E','R']
4676
4677-
4678+ @multiple_try()
4679 def submit(self, prog, argument=[], cwd=None, stdout=None, stderr=None, log=None):
4680 """Submit the prog to the cluser"""
4681
4682@@ -229,8 +279,10 @@
4683 raise ClusterManagmentError, 'fail to submit to the cluster: \n%s' \
4684 % output
4685 self.submitted += 1
4686+ self.submitted_ids.append(id)
4687 return id
4688
4689+ @multiple_try()
4690 def control_one_job(self, id):
4691 """ control the status of a single job with it's cluster id """
4692 cmd = 'qstat '+str(id)
4693@@ -249,7 +301,7 @@
4694 return 'F'
4695
4696
4697-
4698+ @multiple_try()
4699 def control(self, me_dir):
4700 """ control the status of a single job with it's cluster id """
4701 cmd = "qstat"
4702@@ -275,6 +327,16 @@
4703
4704 return idle, run, self.submitted - (idle+run+fail), fail
4705
4706+ @multiple_try()
4707+ def remove(self, *args):
4708+ """Clean the jobs on the cluster"""
4709+
4710+ if not self.submitted_ids:
4711+ return
4712+ cmd = "qdel %s" % ' '.join(self.submitted_ids)
4713+ status = subprocess.Popen([cmd], shell=True, stdout=open(os.devnull,'w'))
4714+
4715+
4716 class SGECluster(Cluster):
4717 """Basic class for dealing with cluster submission"""
4718 # Class written by Arian Abrahantes.
4719@@ -291,6 +353,7 @@
4720 location = location.replace(homePath,'$HOME')
4721 return location
4722
4723+ @multiple_try()
4724 def submit(self, prog, argument=[], cwd=None, stdout=None, stderr=None, log=None):
4725 """Submit the prog to the cluser"""
4726
4727@@ -350,10 +413,12 @@
4728 raise ClusterManagmentError, 'fail to submit to the cluster: \n%s' \
4729 % output
4730 self.submitted += 1
4731+ self.submitted_ids.append(id)
4732 logger.debug(output)
4733
4734 return id
4735
4736+ @multiple_try()
4737 def control_one_job(self, id):
4738 """ control the status of a single job with it's cluster id """
4739 #cmd = 'qstat '+str(id)
4740@@ -375,6 +440,7 @@
4741 return 'R'
4742 return 'F'
4743
4744+ @multiple_try()
4745 def control(self, me_dir):
4746 """ control the status of a single job with it's cluster id """
4747 cmd = "qstat "
4748@@ -399,9 +465,138 @@
4749 fail += 1
4750
4751 return idle, run, self.submitted - (idle+run+fail), fail
4752-
4753-
4754-from_name = {'condor':CondorCluster, 'pbs': PBSCluster, 'sge': SGECluster}
4755+
4756+
4757+ @multiple_try()
4758+ def remove(self, *args):
4759+ """Clean the jobs on the cluster"""
4760+
4761+ if not self.submitted_ids:
4762+ return
4763+ cmd = "qdel %s" % ' '.join(self.submitted_ids)
4764+ status = subprocess.Popen([cmd], shell=True, stdout=open(os.devnull,'w'))
4765+
4766+class LSFCluster(Cluster):
4767+ """Basic class for dealing with cluster submission"""
4768+
4769+ name = 'lsf'
4770+
4771+ @multiple_try()
4772+ def submit(self, prog, argument=[], cwd=None, stdout=None, stderr=None, log=None):
4773+ """Submit the """
4774+
4775+ me_dir = os.path.realpath(os.path.join(cwd,prog)).rsplit('/SubProcesses',1)[0]
4776+ me_dir = hashlib.md5(me_dir).hexdigest()[-14:]
4777+ if not me_dir[0].isalpha():
4778+ me_dir = 'a' + me_dir[1:]
4779+
4780+ text = ""
4781+ if cwd is None:
4782+ cwd = os.getcwd()
4783+ else:
4784+ text = " cd %s;" % cwd
4785+ if stdout is None:
4786+ stdout = '/dev/null'
4787+ if stderr is None:
4788+ stderr = '/dev/null'
4789+ elif stderr == -2: # -2 is subprocess.STDOUT
4790+ stderr = stdout
4791+ if log is None:
4792+ log = '/dev/null'
4793+
4794+ text += prog
4795+ if argument:
4796+ text += ' ' + ' '.join(argument)
4797+
4798+ a = subprocess.Popen(['bsub','-o', stdout,
4799+ '-J', me_dir,
4800+ '-e', stderr,
4801+ '-q', self.cluster_queue],
4802+ stdout=subprocess.PIPE,
4803+ stderr=subprocess.STDOUT,
4804+ stdin=subprocess.PIPE, cwd=cwd)
4805+
4806+ output = a.communicate(text)[0]
4807+ #Job <nnnn> is submitted to default queue <normal>.
4808+ try:
4809+ id = output.split('>',1)[0].split('<')[1]
4810+ except:
4811+ raise ClusterManagmentError, 'fail to submit to the cluster: \n%s' \
4812+ % output
4813+ if not id.isdigit():
4814+ raise ClusterManagmentError, 'fail to submit to the cluster: \n%s' \
4815+ % output
4816+ self.submitted += 1
4817+ self.submitted_ids.append(id)
4818+ return id
4819+
4820+
4821+ @multiple_try()
4822+ def control_one_job(self, id):
4823+ """ control the status of a single job with it's cluster id """
4824+
4825+ cmd = 'bjobs '+str(id)
4826+ status = subprocess.Popen([cmd], shell=True, stdout=subprocess.PIPE)
4827+
4828+ for line in status.stdout:
4829+ line = line.strip().upper()
4830+ if 'JOBID' in line:
4831+ continue
4832+ elif str(id) not in line:
4833+ continue
4834+ status = line.split()[2]
4835+ if status == 'RUN':
4836+ return 'R'
4837+ elif status == 'PEND':
4838+ return 'I'
4839+ elif status == 'DONE':
4840+ return 'F'
4841+ else:
4842+ return 'H'
4843+ return 'F'
4844+
4845+ @multiple_try()
4846+ def control(self, me_dir):
4847+ """ control the status of a single job with it's cluster id """
4848+
4849+ if not self.submitted_ids:
4850+ return 0, 0, 0, 0
4851+
4852+ cmd = "bjobs " + ' '.join(self.submitted_ids)
4853+ status = subprocess.Popen([cmd], shell=True, stdout=subprocess.PIPE)
4854+
4855+ idle, run, fail = 0, 0, 0
4856+ for line in status.stdout:
4857+ line = line.strip()
4858+ if 'JOBID' in line:
4859+ continue
4860+ splitline = line.split()
4861+ id = splitline[0]
4862+ if id not in self.submitted_ids:
4863+ continue
4864+ status = splitline[2]
4865+ if status == 'RUN':
4866+ run += 1
4867+ elif status == 'PEND':
4868+ idle += 1
4869+ elif status == 'DONE':
4870+ pass
4871+ else:
4872+ fail += 1
4873+
4874+ return idle, run, self.submitted - (idle+run+fail), fail
4875+
4876+ @multiple_try()
4877+ def remove(self, *args):
4878+ """Clean the jobs on the cluster"""
4879+
4880+ if not self.submitted_ids:
4881+ return
4882+ cmd = "bdel %s" % ' '.join(self.submitted_ids)
4883+ status = subprocess.Popen([cmd], shell=True, stdout=open(os.devnull,'w'))
4884+
4885+from_name = {'condor':CondorCluster, 'pbs': PBSCluster, 'sge': SGECluster,
4886+ 'lsf': LSFCluster}
4887
4888
4889
4890
4891=== modified file 'madgraph/various/diagram_symmetry.py'
4892--- madgraph/various/diagram_symmetry.py 2011-11-29 23:31:51 +0000
4893+++ madgraph/various/diagram_symmetry.py 2012-03-09 00:04:18 +0000
4894@@ -35,7 +35,6 @@
4895 import madgraph.iolibs.group_subprocs as group_subprocs
4896 import madgraph.iolibs.helas_call_writers as helas_call_writer
4897 import models.import_ufo as import_ufo
4898-import madgraph.iolibs.misc as misc
4899 import madgraph.iolibs.save_load_object as save_load_object
4900
4901 import madgraph.core.base_objects as base_objects
4902@@ -45,6 +44,7 @@
4903 import madgraph.core.diagram_generation as diagram_generation
4904
4905 import madgraph.various.process_checks as process_checks
4906+import madgraph.various.misc as misc
4907
4908 from madgraph import MG5DIR
4909
4910
4911=== modified file 'madgraph/various/gen_crossxhtml.py'
4912--- madgraph/various/gen_crossxhtml.py 2012-02-15 04:45:27 +0000
4913+++ madgraph/various/gen_crossxhtml.py 2012-03-09 00:04:18 +0000
4914@@ -54,6 +54,10 @@
4915 function check_link(url,alt, id){
4916 var obj = document.getElementById(id);
4917 if ( ! UrlExists(url)){
4918+ if ( ! UrlExists(alt)){
4919+ obj.href = url;
4920+ return 1==1;
4921+ }
4922 obj.href = alt;
4923 return 1 == 2;
4924 }
4925@@ -110,7 +114,7 @@
4926 %(pgs_card)s
4927 %(delphes_card)s
4928 </TD>
4929- <TD nowrap ROWSPAN=2> <A HREF="./HTML/%(run_name)s/results.html">%(cross).4g <font face=symbol>&#177</font> %(error).4g (%(unit)s)</A> </TD>
4930+ <TD nowrap ROWSPAN=2> %(results)s </TD>
4931 %(status)s
4932 </TR>
4933 <tr></tr>
4934@@ -307,6 +311,11 @@
4935 'tag_name': self.current['tag'],
4936 'unit': self[self.current['run_name']].info['unit']}
4937
4938+ if exists(pjoin(self.path, 'HTML',self.current['run_name'],
4939+ 'results.html')):
4940+ status_dict['results'] = """<A HREF="./HTML/%(run_name)s/results.html">%(cross).4g <font face=symbol>&#177</font> %(error).4g (%(unit)s)</A>""" % status_dict
4941+ else:
4942+ status_dict['results'] = "No results yet"
4943 if exists(pjoin(self.path, 'Cards', 'plot_card.dat')):
4944 status_dict['plot_card'] = """ <a href="./Cards/plot_card.dat">plot_card</a><BR>"""
4945 else:
4946
4947=== renamed file 'madgraph/iolibs/misc.py' => 'madgraph/various/misc.py'
4948--- madgraph/iolibs/misc.py 2011-12-21 14:44:13 +0000
4949+++ madgraph/various/misc.py 2012-03-09 00:04:18 +0000
4950@@ -171,7 +171,7 @@
4951 if 'makefile' not in all_file:
4952 raise OSError, 'no makefile present in %s' % os.path.realpath(cwd)
4953
4954- if mode == 'fortran' and (not which('g77') or not which('gfortran')):
4955+ if mode == 'fortran' and not (which('g77') or which('gfortran')):
4956 error_msg = 'A fortran compilator (g77 or gfortran) is required to create this output.\n'
4957 error_msg += 'Please install g77 or gfortran on your computer and retry.'
4958 raise MadGraph5Error, error_msg
4959@@ -192,6 +192,7 @@
4960 error_text += 'If you think that this is a bug, you can report this at https://bugs.launchpad.net/madgraph5'
4961
4962 raise MadGraph5Error, error_text
4963+ return p.returncode
4964
4965
4966 ################################################################################
4967@@ -330,11 +331,11 @@
4968
4969 for p in possibility:
4970 if which(p):
4971- logger.warning('Using default %s \"%s\". ' % (program, p) + \
4972+ logger.info('Using default %s \"%s\". ' % (program, p) + \
4973 'Set another one in ./input/mg5_configuration.txt')
4974 return p
4975
4976- logger.warning('No valid %s found. ' % program + \
4977+ logger.info('No valid %s found. ' % program + \
4978 'Please set in ./input/mg5_configuration.txt')
4979 return None
4980
4981@@ -345,11 +346,11 @@
4982 if mac_check==True and sys.platform == 'darwin':
4983 return self.open_mac_program(program, file_path)
4984
4985- arguments = program.split() # allow argument in program definition
4986- arguments.append(file_path)
4987-
4988 # Shell program only
4989 if program:
4990+ arguments = program.split() # allow argument in program definition
4991+ arguments.append(file_path)
4992+
4993 if not background:
4994 subprocess.call(arguments)
4995 else:
4996
4997=== modified file 'madgraph/various/process_checks.py'
4998--- madgraph/various/process_checks.py 2011-11-13 10:33:10 +0000
4999+++ madgraph/various/process_checks.py 2012-03-09 00:04:18 +0000
5000@@ -34,7 +34,6 @@
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: