Merge lp:~maddevelopers/mg5amcnlo/upgrade_pythia_compatibility into lp:~madteam/mg5amcnlo/trunk

Proposed by Olivier Mattelaer
Status: Merged
Merged at revision: 200
Proposed branch: lp:~maddevelopers/mg5amcnlo/upgrade_pythia_compatibility
Merge into: lp:~madteam/mg5amcnlo/trunk
Diff against target: 31670 lines (+16617/-10171)
173 files modified
Template/Cards/run_card.dat (+2/-2)
Template/HTML/mgstyle.css (+26/-0)
Template/HTML/sortable.js (+335/-0)
Template/Source/PDF/pdg2pdf.f (+6/-0)
Template/Source/PDF/pdg2pdf_lhapdf.f (+7/-0)
Template/Source/dsample.f (+51/-267)
Template/Source/gen_ximprove.f (+33/-35)
Template/Source/make_opts (+1/-1)
Template/Source/scale_events.f (+0/-150)
Template/Source/select_events.f (+0/-300)
Template/Source/setrun.f (+7/-2)
Template/SubProcesses/check_dip.f (+0/-537)
Template/SubProcesses/check_intdip.f (+0/-401)
Template/SubProcesses/cuts.f (+2/-2)
Template/SubProcesses/driver.f (+0/-289)
Template/SubProcesses/unwgt.f (+13/-13)
Template/bin/TheChopper-pl (+0/-118)
Template/bin/addmasses.py (+0/-320)
Template/bin/calculate_crossx (+0/-140)
Template/bin/clean4grid (+0/-95)
Template/bin/cleanall (+10/-21)
Template/bin/compile (+0/-89)
Template/bin/compile_Source (+0/-32)
Template/bin/cpall (+0/-4)
Template/bin/gen_crossxhtml-pl (+0/-399)
Template/bin/generate_events (+0/-419)
Template/bin/gridrun (+0/-246)
Template/bin/internal/Gridpack/TheChopper-pl (+118/-0)
Template/bin/internal/Gridpack/clean4grid (+95/-0)
Template/bin/internal/Gridpack/compile (+93/-0)
Template/bin/internal/Gridpack/gridrun (+96/-0)
Template/bin/internal/Gridpack/refine4grid (+116/-0)
Template/bin/internal/Gridpack/replace.pl (+187/-0)
Template/bin/internal/Gridpack/run.sh (+114/-0)
Template/bin/internal/addmasses.py (+320/-0)
Template/bin/internal/clean_template (+5/-5)
Template/bin/internal/compile_Source (+32/-0)
Template/bin/internal/create_matching_plots.C (+4/-4)
Template/bin/internal/create_matching_plots.sh (+12/-10)
Template/bin/internal/gen_cardhtml-pl (+10/-11)
Template/bin/internal/merge.pl (+277/-0)
Template/bin/internal/monitor (+1/-1)
Template/bin/internal/plot (+11/-9)
Template/bin/internal/plot_page-pl (+3/-3)
Template/bin/internal/plot_pypage-pl (+72/-0)
Template/bin/internal/put_banner (+3/-1)
Template/bin/internal/run_combine (+4/-0)
Template/bin/internal/run_delphes (+11/-64)
Template/bin/internal/run_genissud (+87/-0)
Template/bin/internal/run_hep2lhe (+3/-60)
Template/bin/internal/run_pgs (+6/-89)
Template/bin/internal/run_plot (+47/-0)
Template/bin/internal/run_plot_delphes (+46/-0)
Template/bin/internal/run_plot_pgs (+47/-0)
Template/bin/internal/run_plot_pythia (+50/-0)
Template/bin/internal/run_pythia (+4/-103)
Template/bin/internal/store4grid (+63/-0)
Template/bin/internal/sumall (+3/-3)
Template/bin/madevent (+164/-0)
Template/bin/makefile_gridpack (+0/-27)
Template/bin/merge.pl (+0/-277)
Template/bin/multi_run (+0/-124)
Template/bin/newprocess_mg5 (+3/-1)
Template/bin/plot_pypage-pl (+0/-72)
Template/bin/qdeljob (+0/-13)
Template/bin/qholdjob (+0/-25)
Template/bin/qrlsjob (+0/-25)
Template/bin/qsub (+0/-3)
Template/bin/refine (+0/-140)
Template/bin/refine4grid (+0/-116)
Template/bin/remove (+0/-60)
Template/bin/replace.pl (+0/-187)
Template/bin/rmrun (+0/-53)
Template/bin/run.sh (+0/-110)
Template/bin/run_combine (+0/-30)
Template/bin/run_genissud (+0/-87)
Template/bin/run_plot (+0/-47)
Template/bin/run_plot_delphes (+0/-46)
Template/bin/run_plot_pgs (+0/-47)
Template/bin/run_plot_pythia (+0/-50)
Template/bin/setup_model-pl (+0/-126)
Template/bin/split_banner.pl (+0/-166)
Template/bin/standalone (+0/-58)
Template/bin/store (+0/-155)
Template/bin/store4grid (+0/-145)
Template/bin/survey (+0/-144)
Template/makefile (+2/-2)
UpdateNotes.txt (+104/-4)
aloha/README (+45/-0)
aloha/aloha_fct.py (+76/-0)
aloha/aloha_lib.py (+6/-0)
aloha/aloha_object.py (+1/-1)
aloha/aloha_writers.py (+55/-32)
aloha/bin/aloha (+2/-1)
aloha/create_aloha.py (+20/-15)
bin/create_aloha_release.py (+2/-2)
bin/mg5 (+18/-9)
input/mg5_configuration.txt (+63/-2)
madgraph/VERSION (+3/-2)
madgraph/core/diagram_generation.py (+11/-3)
madgraph/core/helas_objects.py (+15/-11)
madgraph/interface/.mg5_logging.conf (+14/-3)
madgraph/interface/__init__.py (+1/-0)
madgraph/interface/cmd_interface.py (+774/-525)
madgraph/interface/coloring_logging.py (+52/-0)
madgraph/interface/extended_cmd.py (+839/-49)
madgraph/interface/launch_ext_program.py (+100/-271)
madgraph/interface/madevent_interface.py (+3903/-0)
madgraph/interface/tutorial_text.py (+1/-0)
madgraph/iolibs/export_cpp.py (+3/-3)
madgraph/iolibs/export_v4.py (+441/-107)
madgraph/iolibs/files.py (+10/-4)
madgraph/iolibs/group_subprocs.py (+1/-1)
madgraph/iolibs/helas_call_writers.py (+11/-14)
madgraph/iolibs/import_v4.py (+13/-9)
madgraph/iolibs/misc.py (+229/-39)
madgraph/iolibs/save_load_object.py (+39/-3)
madgraph/iolibs/template_files/auto_dsig_v4.inc (+2/-8)
madgraph/iolibs/template_files/check_sa.f (+1/-1)
madgraph/iolibs/template_files/madevent_combine_events.f (+9/-3)
madgraph/iolibs/template_files/madevent_driver.f (+304/-0)
madgraph/iolibs/template_files/madevent_makefile_source (+9/-5)
madgraph/iolibs/template_files/madevent_run_config.inc (+1/-16)
madgraph/iolibs/template_files/madevent_symmetry.f (+15/-26)
madgraph/iolibs/template_files/madevent_write_banner.f (+1/-1)
madgraph/iolibs/ufo_expression_parsers.py (+4/-2)
madgraph/various/banner.py (+203/-0)
madgraph/various/cluster.py (+404/-0)
madgraph/various/diagram_symmetry.py (+2/-2)
madgraph/various/gen_crossxhtml.py (+910/-0)
madgraph/various/process_checks.py (+6/-7)
madgraph/various/rambo.py (+0/-1)
madgraph/various/sum_html.py (+310/-0)
models/RS/coupling_orders.py (+0/-1)
models/check_param_card.py (+1036/-0)
models/import_ufo.py (+187/-30)
models/mssm/restrict_default.dat (+0/-1)
models/template_files/fortran/rw_para.f (+4/-6)
models/template_files/fortran/testprog.f (+1/-1)
models/uutt_tch_4fermion/__init__.py (+0/-22)
models/uutt_tch_4fermion/coupling_orders.py (+0/-19)
models/uutt_tch_4fermion/couplings.py (+0/-122)
models/uutt_tch_4fermion/function_library.py (+0/-54)
models/uutt_tch_4fermion/lorentz.py (+0/-79)
models/uutt_tch_4fermion/object_library.py (+0/-245)
models/uutt_tch_4fermion/parameters.py (+0/-237)
models/uutt_tch_4fermion/particles.py (+0/-384)
models/uutt_tch_4fermion/vertices.py (+0/-354)
models/uutt_tch_4fermion/write_param_card.py (+0/-65)
tests/acceptance_tests/test_cmd.py (+122/-66)
tests/acceptance_tests/test_cmd_madevent.py (+230/-0)
tests/input_files/param_card_rule_sm.dat (+15/-0)
tests/input_files/restrict_sm.dat (+12/-9)
tests/input_files/run_card_matching.dat (+223/-0)
tests/input_files/sps1a_param_card.dat (+818/-0)
tests/input_files/test_mssm_generation (+20/-0)
tests/parallel_tests/compare_with_old_mg5_version.py (+285/-43)
tests/parallel_tests/input_files/mg5_short_parraleltest_heft.pkl (+0/-162)
tests/parallel_tests/input_files/mg5_short_parraleltest_mssm.pkl (+0/-189)
tests/parallel_tests/input_files/mg5_short_parraleltest_sm.pkl (+0/-275)
tests/parallel_tests/madevent_comparator.py (+415/-0)
tests/parallel_tests/me_comparator.py (+10/-6)
tests/test_manager.py (+3/-0)
tests/unit_tests/__init__.py (+24/-2)
tests/unit_tests/interface/test_cmd.py (+71/-1)
tests/unit_tests/interface/test_madevent.py (+103/-0)
tests/unit_tests/iolibs/test_export_v4.py (+11/-14)
tests/unit_tests/iolibs/test_misc.py (+1/-0)
tests/unit_tests/various/test_4fermion_models.py (+14/-12)
tests/unit_tests/various/test_aloha.py (+2/-2)
tests/unit_tests/various/test_check_param_card.py (+1368/-0)
tests/unit_tests/various/test_import_ufo.py (+3/-3)
tests/unit_tests/various/test_write_param.py (+4/-4)
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/upgrade_pythia_compatibility
Reviewer Review Type Date Requested Status
Johan Alwall (community) Approve
Pierre Artoisenet Pending
Review via email: mp+75106@code.launchpad.net

Description of the change

1.4.0 (XX/XX/XX): OM: New structure for madevent script (./bin/madevent)
                      allowing to have an interface similar to MG5
                      for running madevent.
                      (accessible from MG5 via launch [DIR] -i)
                      This script replaces most of the script present before in
                      ./bin/ (such as survey/refine/combine/run_XXXX/multi_run)
                      The script generate_events still exists but call itself
                      ./bin/madevent.
                  OM: Madevent check that the param_card is coherent with the
                      restriction use during the model generation.
                  OM: FOR MSSM model, pass param_card in SLAH1. This card will
                      be converted to the SLAH2 during the run since the UFO
                      model use SLAH2. This allow to use the pythia6 matching,
                      as well as have a coherent definition for the flavor.
                  OM: Change the import command. It's now allow to ommit the
                      type of import. This one will be guess automaticaly.
                  OM: Add the possibility to force which fortran compiler will
                      be use. Either via the configuration file or via the set
                      command.
                  OM: Add two options for display command:
                      a) display options: return the current option value.
                        i.e. those set via the set command and/or via the
                        configuration file
                      b) display mg5_variables NAME: return the current string
                        representation of NAME and/or self.NAME.
                  OM: New Python script for the creation of the crossx.html page
                      Requiring less disk access for the generation of the file.

The point were I'm not 100% sure are the gridpack (I'll work on this next week with Rik/Alexis).
and icckw (I count on you to test that matching).

In fact For gridpack, since I never use, I don't have any good idea for the interface, so I'm waiting for this to be at Rome.

As we discussed before, I think that we should wait at least few weeks before merging this in the trunk. (and in fact propose this version in beta when you will accept the review)

cp3wks05 is currently working on this branch.
So the web is compatible with this branch.

To post a comment you must log in.
216. By Olivier Mattelaer

nicer text

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

Amazing job. I have just started my checks, but have some problems already:
1) When I run
mg5>launch -m
Do you want to run pythia? [auto, y, n]
y
Do you want to run PGS? [auto, y, n]

WARNING: If you edit this file don't forget to modify
            consistently the different parameters, especially
            the width of all particles.
Do you want to edit file: param_card.dat? [n, y, path of the new param_card.dat]

Do you want to edit file: run_card.dat? [n, y, path of the new run_card.dat]

Do you want to edit file: pythia_card.dat? [n, y, path of the new pythia_card.dat]

At this point, the launch stalls, and I have to press enter an extra time to start. I never get a question about how many cores to use.

2) I do
launch ./PR<tab>
and it crashes with the following error message:
python(30699) malloc: *** error for object 0xb: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap

This might be system specific, but it might point to some problem with the autocompletion.

More to come.

Cheers,
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Ok next round of problems:

1) I canceled a run by doing "ctrl-C" and then restarted. I get the following message:

Another instance of madevent is currently running.
            Please wait that all instance of madevent are closed. If this message
            is an error in itself, you can suppress the files /Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_mssm_2/RunWeb.

and the user interface exits, without saving the history. Shouldn't it stay inside the interface?

2) I started an mssm run, canceled by doing "ctrl-C" and then ran launch on the directory. The launch dies with the following message:

Working on SubProcesses
    P0_qq_gogo
 Full compression. Using symmetry and assuming B.W.
 Warning: parameter nhel_survey not found
          setting it to default value 0
 Warning: file Source/MODEL/MG5_param.dat not found in the parent directories!
Command "generate_events run_01" interrupted in sub-command:
"survey run_01" with error:
MadEventError : Error gensym run not successful
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'ME5_debug'.
Please attach this file to your report.
Command "launch PROC_mssm_2 -m" interrupted with error:
IOError : [Errno 2] No such file or directory: '/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_mssm_2/SubProcesses/run_01_results.dat'
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'MG5_debug'.
Please attach this file to your report.

Apparently, the problem is
 Warning: file Source/MODEL/MG5_param.dat not found in the parent directories!

Revision history for this message
Johan Alwall (johan-alwall) wrote :

In fact, it turns out that the problem didn't have to do with canceling and restarting a run. In a fresh directory, I did:

mg5>import mssm
mg5>generate p p > go go
mg5>output
mg5>launch -m
Do you want to run pythia? [auto, y, n]

Do you want to edit file: param_card.dat? [n, y, path of the new param_card.dat]

Do you want to edit file: run_card.dat? [n, y, path of the new run_card.dat]

generate_events run_01
survey run_01
compile directory
Working on SubProcesses
    P0_qq_gogo
 Full compression. Using symmetry and assuming B.W.
 Warning: parameter nhel_survey not found
          setting it to default value 0
 Warning: file Source/MODEL/MG5_param.dat not found in the parent directories!
Command "generate_events run_01" interrupted in sub-command:
"survey run_01" with error:
MadEventError : Error gensym run not successful
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'ME5_debug'.
Please attach this file to your report.
Command "launch -m" interrupted with error:
IOError : [Errno 2] No such file or directory: '/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_mssm_0/SubProcesses/run_01_results.dat'
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'MG5_debug'.
Please attach this file to your report.
mg5>

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

> Hello Olivier,
>
> Amazing job. I have just started my checks, but have some problems already:
> 1) When I run
> mg5>launch -m
>
> At this point, the launch stalls, and I have to press enter an extra time to
> start. I never get a question about how many cores to use.
>

The question is back.
But the launch never stalls on my computer.
Could you check if it's still stalls?

> 2) I do
> launch ./PR<tab>
> and it crashes with the following error message:
> python(30699) malloc: *** error for object 0xb: pointer being freed was not
> allocated
> *** set a breakpoint in malloc_error_break to debug
> Abort trap

This is indeed system specific, could you try to debug this yourself?
On my computer the autocompletion is perfectly fine.
(with both python 2.6 (with mac version of readline) and 2.7 (with gnu version of readline))

Concerning the mssm problem,
This is also solved.
A stupid mistake (forget to import the package which is suppose to create that file), but hidden by a wrong error message.

I also improve the treatment of the RunWeb in order to suppress it even when ME crash in an unexpeced way.

Thanks a lot,

Olivier

Thanks,

217. By Olivier Mattelaer

Ensure the suppresion of RunWeb when exiting
Fix launch -m
Fix problem with mssm (forget to include package)

218. By Olivier Mattelaer

new display for couplings/coupling_order

219. By Olivier Mattelaer

debug display options in madevent.
force to close madevent if open in a import cmd command

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Ok I still found some small bugs, and I have improve the display command.

Cheers,

Olivier

220. By Olivier Mattelaer

fix mssm standalone (use SLAH2 card)

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

Ok I'm back to the review, and immediately run into trouble:

Command "output" interrupted with error:
NameError : global name 'pjoin' is not defined
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'MG5_debug'.
Please attach this file to your report.

MG5_Debug:

import model sm
import model mssm
generate p p > go go
output
Traceback (most recent call last):
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/madgraph/interface/extended_cmd.py", line 167, in onecmd
    return cmd.Cmd.onecmd(self, line)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/cmd.py", line 219, in onecmd
    return func(arg)
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/madgraph/interface/cmd_interface.py", line 2743, in do_output
    self.finalize(nojpeg)
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/madgraph/interface/cmd_interface.py", line 2988, in finalize
    self.configuration['fortran_compiler'])
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/madgraph/iolibs/export_v4.py", line 1270, in finalize_v4_directory
    param_card = pjoin(self.dir_path, 'Cards','param_card.dat')
NameError: global name 'pjoin' is not defined

review: Needs Fixing
221. By Olivier Mattelaer

FIX: infinite loop in the cleaning of the history

222. By Olivier Mattelaer

fix the bug pointed by Johan, as well as few other minor one

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

This is fix now.

Thanks,

Olivier

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hi Olivier,

We're getting closer, and I'm starting to see the extent of your amazing job!
Tiny issues/questions:
1) When asking for multicore, I only get option of 2. Is this because you now assume that 1 is not relevant?
2) I don't think that the generation page is opened in my browser anymore. This was a really nice functionality (at least I liked it a lot).
3) The result of gensym is printed to screen. This is kinda long, and should only be printed if there is a problem. Same thing with combine_runs.
4) During run, it looks like:
G1a
real 0m4.617s
user 0m2.208s
sys 0m0.076s
./ajob1 run in 4.682720 s
Since we say "ajob1 run in xxx s, we don't need the "time" printout.
5) "pythia --no_default": What does "no_default" mean?
6) It gets stuck for the longest time at
"Creating Plots for Pythia level"
and top shows that Python is running at near-100% CPU. Is this normal? (does Python report CPU usage also of daughter processes?)
7) The new crossx.html file is very nice, except that there is an extra table cell at "Parton Events" in the crossx.html file. Also, it would be nicer to have multiple processes listed after each other in the header rather than on separate lines.
8) The pythia_card is not included in the banner.txt.
9) When I generated a new process (after already run a process) and then do output, it suggests to use the same directory as the previous output. This is not correct, and I changed this behaviour before.
10) When I run a second run with Pythia "auto", there's no question if I want to edit the pythia_card.
11) When I run twice with matching, the matching plots after the pythia run are not reproduced after the second run, but identical to those after the first run. Probably, the events.tree and xsecs.tree files are retained from the previous run, resulting in identical plots.

Additional suggestions:
1) Something that I've been thinking about for a while is that we need to pipe the output of the run not only to the screen but also to a file "run_name.log" when running launch. This should be easy to do in an automatic way with Python.
2) New index.html page, with all process definitions listed.

Now I'll start actually looking at the code :-)

Many thanks,
Johan

review: Needs Fixing
223. By Olivier Mattelaer

transform import model V4MODEL automaticaly in import model_v4 V4MODEL.
Change the guess order for the check of the model for import MODELNAME

224. By Olivier Mattelaer

merge with the last trunk version

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

> Hi Olivier,
>
> We're getting closer, and I'm starting to see the extent of your amazing job!

Thanks a lot for those amazing remarks.

> Tiny issues/questions:
> 1) When asking for multicore, I only get option of 2. Is this because you now
> assume that 1 is not relevant?

Exactly.

> 2) I don't think that the generation page is opened in my browser anymore.
> This was a really nice functionality (at least I liked it a lot).

In fact this creates trouble in some case in linux. Some times the program wait that
FF close before continuing to run.

I've restore the function with, I hope, a fix against that problem.

> 3) The result of gensym is printed to screen. This is kinda long, and should
> only be printed if there is a problem. Same thing with combine_runs.

Gensym Done.

For Combine_runs this even simplify the code, If i didn't have to put this on the screen.
Because this is printed both the stdout and to a file at current stage [except in cluster mode]
The question here is How we define that something goes wrong. (Just error or also low number of events?)

So I didn't touch to that part for the moment.

> 4) During run, it looks like:
> G1a
> real 0m4.617s
> user 0m2.208s
> sys 0m0.076s
> ./ajob1 run in 4.682720 s
> Since we say "ajob1 run in xxx s, we don't need the "time" printout.

I think that this is done (I will check it, but I have normally implemented it)

> 5) "pythia --no_default": What does "no_default" mean?

That's to avoid to use the default pythia_card if they are no pythia_card present.

> 6) It gets stuck for the longest time at
> "Creating Plots for Pythia level"
> and top shows that Python is running at near-100% CPU. Is this normal? (does
> Python report CPU usage also of daughter processes?)

I didn't notice that that was so long, but I didn't performed any matching stuff.
So this maybe the reason. For the CPU usage I don't know.

Otherwise the matching plot are done via a simple call to ./create_matching_plots.sh.
So this should be fine.

And the other plot are all done in the exact same way. (But maybe this is critical only for pythia...). In order to avoid to write a file on the disk, I'm using the piping of python to
communicate to the stdin. Maybe this slows down the things. What's your example were this was problematic?

> 7) The new crossx.html file is very nice, except that there is an extra table
> cell at "Parton Events" in the crossx.html file. Also, it would be nicer to
> have multiple processes listed after each other in the header rather than on
> separate lines.

I'll make that table to be invisible (I mean the border) this should be nicer then.
Concerning the point to have those on multiple line, that's because otherwise this might makes very long lines.

> 8) The pythia_card is not included in the banner.txt.

I'll need to investigate this point, I need to better understand the mess done with the banner.txt.
Since when running generate_events the pythia_card is added to banner.txt
But when run_pythia runs in standalone it's RUN_banner.txt which is updated.

The first case, seems a bit strange to me. So I'll investigate on this.

> 9) When I generated a new process (after already r...

Read more...

225. By mattelaer-olivier

fix the different point makes by Johan (thanks for those)
but the one concerning the pythia output

Revision history for this message
Johan Alwall (johan-alwall) wrote :
Download full text (3.3 KiB)

Hello Olivier,

Thanks so much for your thorough revision. I haven't tested everything yet, but just want to respond to the points where you had a question:

> For Combine_runs this even simplify the code, If i didn't have to put this on
> the screen.
> Because this is printed both the stdout and to a file at current stage [except
> in cluster mode]
> The question here is How we define that something goes wrong. (Just error or
> also low number of events?)
>
> So I didn't touch to that part for the moment.

I've never seen anything go wrong for combine_runs. For gensym, if there are no ajobs afterwards, something went wrong and it's a good idea to display the log.

> And the other plot are all done in the exact same way. (But maybe this is
> critical only for pythia...). In order to avoid to write a file on the disk,
> I'm using the piping of python to
> communicate to the stdin. Maybe this slows down the things. What's your
> example were this was problematic?

I think it's just that MadAnalysis is extremely slow when there are many jets, which is usually the case with Pythia.

> > 7) The new crossx.html file is very nice, except that there is an extra
> table
> > cell at "Parton Events" in the crossx.html file. Also, it would be nicer to
> > have multiple processes listed after each other in the header rather than on
> > separate lines.
>
> I'll make that table to be invisible (I mean the border) this should be nicer
> then.
> Concerning the point to have those on multiple line, that's because otherwise
> this might makes very long lines.

I think this can be done in a nicer way, perhaps simply have a length limit and indicate that there are more processes with "etc.". Multiple lines looks strange and not very nice.

> > 9) When I generated a new process (after already run a process) and then do
> > output, it suggests to use the same directory as the previous output. This
> is
> > not correct, and I changed this behaviour before.
>
> I probably don't understand your bug, since this doesn't happen on my computer
> (more probably I didn't understand the bug)
> so on my computer
> generate p p > e+ e-
> output #-> creates PROC_sm_0
> generate p p > mu+ mu-
> output #-> creates PROC_sm_1

It's if you run launch inbetween that it happens.

> > 10) When I run a second run with Pythia "auto", there's no question if I
> want
> > to edit the pythia_card.
>
> That's in some sense a feature.
> The idea is that the card should be configure before.
> So when they are no card -> I put a warning and start to ask what to do.
> When they are one, I just run.
>
> Off course, this might be changed.

I think we should assume that the user wants to modify all active cards, not just param_card and run_card.

> > Additional suggestions:
> > 1) Something that I've been thinking about for a while is that we need to
> pipe
> > the output of the run not only to the screen but also to a file
> "run_name.log"
> > when running launch. This should be easy to do in an automatic way with
> > Python.
> with python, not trully, but they are a linux program tee, which is very
> usefull for this type of things. (That's what I used to have ...

Read more...

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

Hi Johan,

Thanks for those answer.

> I've never seen anything go wrong for combine_runs. For gensym, if there are
> no ajobs afterwards, something went wrong and it's a good idea to display the
> log.

OK done.

> > And the other plot are all done in the exact same way. (But maybe this is
> > critical only for pythia...). In order to avoid to write a file on the disk,
> > I'm using the piping of python to
> > communicate to the stdin. Maybe this slows down the things. What's your
> > example were this was problematic?
>
> I think it's just that MadAnalysis is extremely slow when there are many jets,
> which is usually the case with Pythia.

ok so nothing that I can do...

>
> > > 7) The new crossx.html file is very nice, except that there is an extra
> > table
> > > cell at "Parton Events" in the crossx.html file. Also, it would be nicer
> to
> > > have multiple processes listed after each other in the header rather than
> on
> > > separate lines.
> >
> > I'll make that table to be invisible (I mean the border) this should be
> nicer
> > then.
> > Concerning the point to have those on multiple line, that's because
> otherwise
> > this might makes very long lines.
>
> I think this can be done in a nicer way, perhaps simply have a length limit
> and indicate that there are more processes with "etc.". Multiple lines looks
> strange and not very nice.
>

I'll play with it and come back to you with a new proposal.

> > > 9) When I generated a new process (after already run a process) and then
> do
> > > output, it suggests to use the same directory as the previous output. This
> > is
> > > not correct, and I changed this behaviour before.
> >
> > I probably don't understand your bug, since this doesn't happen on my
> computer
> > (more probably I didn't understand the bug)
> > so on my computer
> > generate p p > e+ e-
> > output #-> creates PROC_sm_0
> > generate p p > mu+ mu-
> > output #-> creates PROC_sm_1
>
> It's if you run launch inbetween that it happens.

ok now I understand. I'll fix this. (and add a test for it, if it's a resurgence, it's worth to add a acceptance test)

> > > 10) When I run a second run with Pythia "auto", there's no question if I
> > want
> > > to edit the pythia_card.
> >
> > That's in some sense a feature.
> > The idea is that the card should be configure before.
> > So when they are no card -> I put a warning and start to ask what to do.
> > When they are one, I just run.
> >
> > Off course, this might be changed.
>
> I think we should assume that the user wants to modify all active cards, not
> just param_card and run_card.

Ok I think that I didn't understand your previous question. I was thinking that you were in the madevent cmd shell and not in the mg5 one. Sorry my mistake.
In fact this behavior was already there before (I mean that this is the current way of working of the current mg5).
Ok you are right, I will add the question.
(maybe also add an option to bypass all question after a given one)

> > > Additional suggestions:
> > > 1) Something that I've been thinking about for a while is that we need to
> > pipe
> > > the output of the run not only to the scree...

Read more...

226. By Olivier Mattelaer

fix the problem with the banner for pythia (still need to do the same for PGS and Delphes)

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

Thanks for your fixes. However, there's another problem now:

import model mssm
generate p p > go go
output
launch

Output:
generate_events run_01 --nb_core=2
survey run_01 --nb_core=2
compile directory
Creating Jobs
Working on SubProcesses
    P0_qq_gogo

and nothing more happens... it seems completely frozen here. According to ps, it's in gensym. There must be some problem with the way you did the output piping, because when I run it by hand, it finishes in less than 1 s.

Cheers,
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

The problem is the following (quote from subprocess manual, http://docs.python.org/library/subprocess.html):

Popen.wait()
Wait for child process to terminate. Set and return returncode attribute.

Warning This will deadlock when using stdout=PIPE and/or stderr=PIPE and the child process generates enough output to a pipe such that it blocks waiting for the OS pipe buffer to accept more data. Use communicate() to avoid that.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Ok the following fixes this:
            # Launch gensym
            p = subprocess.Popen(['./gensym'], stdout=subprocess.PIPE,
                             stderr=subprocess.STDOUT, cwd=Pdir)
            (stdout, stderr) = p.communicate()
            if not os.path.exists(pjoin(Pdir, 'ajob1')) or p.returncode:
                logger.critical(stdout)
                raise MadEventError, 'Error gensym run not successful'
Next point: there are some warnings/errors when I run madevent directly from the directory:

223-138-38-64:PROC_mssm_1 alwall$ bin/madevent
Running MG5 in debug mode
No module named madgraph.interface.extended_cmd
/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_mssm_1/bin/internal/cluster.py:16: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import md5

I'm continuing my tests.

review: Needs Fixing
227. By Olivier Mattelaer

modification pointed by Johan.

Revision history for this message
Johan Alwall (johan-alwall) wrote :
Download full text (3.7 KiB)

Hello Olivier,

Thanks again for fixing my comments!

Here are some more comments (once you have removed all wait() statements in the madevent_interface.py and replaced them with communicate() statements, just to be safe).

When I run PGS I get this (but I think you're aware of this):
Command "generate_events run_01 --nb_core=2" interrupted in sub-command:
"pgs --no_default" with error:
TypeError : exceptions must be classes or instances, not NotImplementedType
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'ME5_debug'.
Please attach this file to your report.

> > > > 7) The new crossx.html file is very nice, except that there is an extra
> > > table
> > > > cell at "Parton Events" in the crossx.html file. Also, it would be nicer
> > to
> > > > have multiple processes listed after each other in the header rather
> than
> > on
> > > > separate lines.
> > >
> > > I'll make that table to be invisible (I mean the border) this should be
> > nicer
> > > then.

Not really, it's nice to have the table there. Just remove the extra empty table cell next to "Parton Events".

> > > Concerning the point to have those on multiple line, that's because
> > otherwise
> > > this might makes very long lines.
> >
> > I think this can be done in a nicer way, perhaps simply have a length limit
> > and indicate that there are more processes with "etc.". Multiple lines looks
> > strange and not very nice.
> >
>
> I'll play with it and come back to you with a new proposal.

Ok sounds good.

> ok now I understand. I'll fix this. (and add a test for it, if it's a
> resurgence, it's worth to add a acceptance test)

Good.

> > > > 10) When I run a second run with Pythia "auto", there's no question if I
> > > want
> > > > to edit the pythia_card.
> > >
> > > That's in some sense a feature.
> > > The idea is that the card should be configure before.
> > > So when they are no card -> I put a warning and start to ask what to do.
> > > When they are one, I just run.
> > >
> > > Off course, this might be changed.
> >
> > I think we should assume that the user wants to modify all active cards, not
> > just param_card and run_card.
>
> Ok I think that I didn't understand your previous question. I was thinking
> that you were in the madevent cmd shell and not in the mg5 one. Sorry my
> mistake.
> In fact this behavior was already there before (I mean that this is the
> current way of working of the current mg5).
> Ok you are right, I will add the question.
> (maybe also add an option to bypass all question after a given one)

Did you fix this? I still don't get any questions. I don't think it makes sense to add too complicated option - just a "-f" or something indicating that you don't want to edit any cards is good enough. So, either all or none, and you can always use <enter> to bypass each question.

> > > > Additional suggestions:
> > > > 1) Something that I've been thinking about for a while is that we need
> to
> > > pipe
> > > > the output of the run not only to the screen but also to a file
> > > "run_name.log"
> > > > when running launch. This should be easy to do in an automatic way with
> > > > Python.
> > > with python, n...

Read more...

review: Needs Fixing
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Thanks a lot for this,

I'll check all p.wait() statement to check if this is not present at
another part of the code.

Concerning of md5, I never seen that Depreciation warning (probably
just miss it)

Thanks,

Olivier

On 10-oct.-11, at 20:56, Johan Alwall wrote:

> # Launch gensym
> p = subprocess.Popen(['./gensym'], stdout=subprocess.PIPE,
> stderr=subprocess.STDOUT, cwd=Pdir)
> (stdout, stderr) = p.communicate()
> if not os.path.exists(pjoin(Pdir, 'ajob1')) or p.returncode:
> logger.critical(stdout)
> raise MadEventError, 'Error gensym run not successful'

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

> Hello Olivier,
>
> Thanks again for fixing my comments!

Thanks for all those usefull comments.

> When I run PGS I get this (but I think you're aware of this):
> Command "generate_events run_01 --nb_core=2" interrupted in sub-
> command:
> "pgs --no_default" with error:
> TypeError : exceptions must be classes or instances, not
> NotImplementedType
> Please report this bug on https://bugs.launchpad.net/madgraph5
> More information is found in 'ME5_debug'.
> Please attach this file to your report.

Yeah that's a critical error linked to the banner, that I have added
since I'm still working on this.
In fact, I've a version, but I first need to understand what's the
problem with pythia on the mac that Tim gives to me.

> Did you fix this? I still don't get any questions. I don't think it
> makes sense to add too complicated option - just a "-f" or something
> indicating that you don't want to edit any cards is good enough. So,
> either all or none, and you can always use <enter> to bypass each
> question.

I fix it, but on my other computer (with the fix for PGS/Delphes) but
since PGS/Delphes are not tested yet, I didn't push those modifications.

Cheers,

Olivier

On 10-oct.-11, at 23:00, Johan Alwall wrote:

> Review: Needs Fixing
>
> Hello Olivier,
>
> Thanks again for fixing my comments!
>
> Here are some more comments (once you have removed all wait()
> statements in the madevent_interface.py and replaced them with
> communicate() statements, just to be safe).
>
> When I run PGS I get this (but I think you're aware of this):
> Command "generate_events run_01 --nb_core=2" interrupted in sub-
> command:
> "pgs --no_default" with error:
> TypeError : exceptions must be classes or instances, not
> NotImplementedType
> Please report this bug on https://bugs.launchpad.net/madgraph5
> More information is found in 'ME5_debug'.
> Please attach this file to your report.
>
>>>>> 7) The new crossx.html file is very nice, except that there is
>>>>> an extra
>>>> table
>>>>> cell at "Parton Events" in the crossx.html file. Also, it would
>>>>> be nicer
>>> to
>>>>> have multiple processes listed after each other in the header
>>>>> rather
>> than
>>> on
>>>>> separate lines.
>>>>
>>>> I'll make that table to be invisible (I mean the border) this
>>>> should be
>>> nicer
>>>> then.
>
> Not really, it's nice to have the table there. Just remove the extra
> empty table cell next to "Parton Events".
>
>>>> Concerning the point to have those on multiple line, that's because
>>> otherwise
>>>> this might makes very long lines.
>>>
>>> I think this can be done in a nicer way, perhaps simply have a
>>> length limit
>>> and indicate that there are more processes with "etc.". Multiple
>>> lines looks
>>> strange and not very nice.
>>>
>>
>> I'll play with it and come back to you with a new proposal.
>
> Ok sounds good.
>
>> ok now I understand. I'll fix this. (and add a test for it, if it's a
>> resurgence, it's worth to add a acceptance test)
>
> Good.
>
>>>>> 10) When I run a second run with Pythia "auto", there's no
>>>>> question if I
>>>> want
>>>>> to edit the pythia_card.
>>>>
>>>> That's in some sense a feature.
...

Read more...

Revision history for this message
Johan Alwall (johan-alwall) wrote :
Download full text (3.5 KiB)

I am now testing the madevent interface, and it's really nice! However some glitches:

1) Major issue: When I run generate_events, refine is run twice:
MGME5>generate_events newrun --multicore
survey newrun --multicore
compile directory
Creating Jobs
Working on SubProcesses
    P0_qq_gogo
ajob1
ajob2
./ajob1 run in 1.711168 s
    P0_gg_gogo
./ajob2 run in 1.704527 s
ajob3
ajob1
./ajob3 run in 0.824768 s
./ajob1 run in 1.380094 s
finish survey
refine 1000
Creating Jobs
Refine results to 1000
Using random number seed offset = 143937585
    P0_qq_gogo
ajob1
ajob2
./ajob2 run in 1.684442 s
    P0_gg_gogo
ajob3
./ajob1 run in 1.852718 s
G2
./ajob3 run in 0.849758 s
./ajob1 run in 2.627231 s
Combining runs
finish refine
refine 1000
Creating Jobs
Refine results to 1000
Using random number seed offset = 143937585
    P0_qq_gogo
ajob1
ajob2
./ajob2 run in 1.702635 s
    P0_gg_gogo
ajob3
./ajob1 run in 1.925680 s
G2
./ajob3 run in 0.943863 s
./ajob1 run in 2.882174 s
Combining runs
finish refine

The second refine should definitely not have any ajobs. Are you sure you delete the ajobs at the beginning of each survey or refine call?

2) Major issue: There are no links to the Pythia and PGS logs in the crossx.html file. In fact these are crucial, esp. the Pythia log, since that's the only place where there is info about the final cross section after matching. It would be nice to also have a link to the log (from "Running PYTHIA"/"Running PGS") during the run.

3) After finished run, the crossx.html page should be updated (not say "Currently running").

4) The options for cluster and multicore are not the same as in the MG5 launch command - I can't use -m and -c. I'd suggest to include these also here. I also suggest to not allow run names starting with "-", since these are almost certainly failed attempts at options, and should be recognized as such.

5) When canceling a run, the crossx.html page should be updated and no longer show that the process is running.

6) When running pythia on an existing run with ickkw=1:
...
Saving plot as DJR4.eps
Info in <TCanvas::Print>: eps file DJR4.eps has been created
(bool)1
gzip: events.tree: No such file or directory
Command "pythia run_01" interrupted with error:
IOError : [Errno 2] No such file or directory: '/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_mssm_2/Events/events.tree.gz'
Same thing when I run multi_run.

7) When running pgs on an existing run, after a canceled pythia run:

prepare PGS run
Storing Pythia files of Previous run
Done
Running PGS

Since the Pythia run was not finished, I don't think it's appropriate to store the pythia-related files.

8) I tried "display" without arguments:

MGME5>display
Command "display" interrupted with error:
IndexError : list index out of range
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'ME5_debug'.

9) When I run multi_run, the crossx.html page keeps saying "compile directory"
- Also, a new browser page is opened for every run (instead of just once, which would be the correct behavior).
- Furthermore, when the multi_run is done, the crossx.html page keeps displaying "Currently running" (see point 3 ...

Read more...

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Ok I found the problem leading to the major bug 1) above:
You should have
                if os.path.basename(match)[:4] in ['ajob', 'wait', 'run.', 'done']:
and NOT
                if match[:4] in ['ajob', 'wait', 'run.', 'done']:

Cheers,
Johan

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Ok some more comments (this is too fun to stop...):

1) When the pythia_card is added to the banner, there's a missing line break. This is critical since the tag might not be recognized if it's not alone on a line.

<MGPythiaCard>!...Parton showering on or off
...

2) If I run a survey, exit the interface, then come back and run refine, it gives the following error. There shouldn't need to be any run_name associated with survey or refine.
MGME5>refine 1000
Command "refine 1000" interrupted with error:
InvalidCmd : No run_name currently define. Impossible to run refine
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'ME5_debug'.
Please attach this file to your report.

3) It would be nice to see the number of "unwgt" events on the SubProcesses/results.html page (as the sum of events for that subprocess directory).

4) When running with grid_pack = true, I think it doesn't make sense to allow Pythia and PGS runs. I would suggest to simply skip those steps in that case (and output an info statement about this).

5) This is quite confusing when I'm running generate_events directly from the command prompt (like I always do):
223-138-38-64:PROC_mssm_2 alwall$ bin/generate_events 2 2 test_gridpack
...
INFO:cmdprint:generate_events test_gridpack --cluster=2 --nb_core=2
INFO:madevent.stdout:syntax: survey [run_name] [--run_options])
INFO:madevent.stdout:-- evaluate the different channel associate to the process
INFO:madevent.stdout:-- session options:
INFO:madevent.stdout: Note that those options will be kept for the current session
INFO:madevent.stdout: --cluster : Submit to the cluster. Current cluster: pbs
INFO:madevent.stdout: --multicore : Run in multi-core configuration
INFO:madevent.stdout: --nb_core=X : limit the number of core to use to X.
CRITICAL:fatalerror:Command "generate_events test_gridpack --cluster=2 --nb_core=2" interrupted with error:
InvalidCmd : Too many argument for generate_events command
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'ME5_debug'.
Please attach this file to your report.
INFO:cmdprint:quit
INFO:madevent.stdout:

I think the problem is just that "--cluster=2" should be replaced with "--multicore" in the madevent interface call.

6) For the gridpacks, you need to modify bin/internal/gridrun. This is just a light-version of generate_events, and should be dealt with in the same way as generate_events. I thought you were supposed to do this is Rome? ;-)
It should be trivial. Just follow the README.gridpack description and make sure all steps work that are there.

Cheers!
Johan

review: Needs Fixing
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Thanks a lot for this,

I'm starting to implement your other remark.

Concerning this one, are you still sure to want to keep the control
file (wait/run/done)?
They are not use neither by the default cluster (pbs/condor ) neither
by the multi-cpu.
I agree that this complexify the inclusion of a new cluster, but that
shouldn't be so difficult and
this is much nicer for the cluster.

Thanks a lot for your review,

Olivier
On 11-oct.-11, at 01:00, Johan Alwall wrote:

> Ok I found the problem leading to the major bug 1) above:
> You should have
> if os.path.basename(match)[:4] in ['ajob', 'wait',
> 'run.', 'done']:
> and NOT
> if match[:4] in ['ajob', 'wait', 'run.', 'done']:
>
> Cheers,
> Johan
>
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

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

On 11-oct.-11, at 01:36, Johan Alwall wrote:

> Review: Needs Fixing
>
> Ok some more comments (this is too fun to stop...):
>
>
> 1) When the pythia_card is added to the banner, there's a missing
> line break. This is critical since the tag might not be recognized
> if it's not alone on a line.
>
> <MGPythiaCard>!...Parton showering on or off
> ...
>

Done

> 2) If I run a survey, exit the interface, then come back and run
> refine, it gives the following error. There shouldn't need to be any
> run_name associated with survey or refine.
> MGME5>refine 1000
> Command "refine 1000" interrupted with error:
> InvalidCmd : No run_name currently define. Impossible to run refine
> Please report this bug on https://bugs.launchpad.net/madgraph5
> More information is found in 'ME5_debug'.
> Please attach this file to your report.

This is rather tricky. The point to have a name is in fact only
important for the html output...
And leaving the cmd interface between refine/survey should not be
recommended since
they are risk to modifications of the card. So expect if you really
object, I will keep it like this.

> 3) It would be nice to see the number of "unwgt" events on the
> SubProcesses/results.html page (as the sum of events for that
> subprocess directory).

Since that page is still create via a perl script, let put this for
later. But I can convert the script to python and then add that
information.

> 4) When running with grid_pack = true, I think it doesn't make sense
> to allow Pythia and PGS runs. I would suggest to simply skip those
> steps in that case (and output an info statement about this).

I've skyped those lines, but didn't put any type of message on that
point. (It's quite pointless at the end no?)

> 5) This is quite confusing when I'm running generate_events directly
> from the command prompt (like I always do):
> 223-138-38-64:PROC_mssm_2 alwall$ bin/generate_events 2 2
> test_gridpack
> ...
> INFO:cmdprint:generate_events test_gridpack --cluster=2 --nb_core=2
> INFO:madevent.stdout:syntax: survey [run_name] [--run_options])
> INFO:madevent.stdout:-- evaluate the different channel associate to
> the process
> INFO:madevent.stdout:-- session options:
> INFO:madevent.stdout: Note that those options will be kept for
> the current session
> INFO:madevent.stdout: --cluster : Submit to the cluster.
> Current cluster: pbs
> INFO:madevent.stdout: --multicore : Run in multi-core
> configuration
> INFO:madevent.stdout: --nb_core=X : limit the number of core to
> use to X.
> CRITICAL:fatalerror:Command "generate_events test_gridpack --
> cluster=2 --nb_core=2" interrupted with error:
> InvalidCmd : Too many argument for generate_events command
> Please report this bug on https://bugs.launchpad.net/madgraph5
> More information is found in 'ME5_debug'.
> Please attach this file to your report.
> INFO:cmdprint:quit
> INFO:madevent.stdout:
>
> I think the problem is just that "--cluster=2" should be replaced
> with "--multicore" in the madevent interface call.

Ooops forget to change this on that file (pass to name tag was done
quite at the end)
I also include the link to the l...

Read more...

228. By mattelaer-olivier

correct treatment of the banner
improve aloha release script
merge with turnk version 1.3.21

229. By mattelaer-olivier

FIX a bug in the format of the random number.
This was slowing down ME by a factor up to 600.
and the results was wrong. this simply due to the random number...
AMAZING

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

> Hi Olivier,
>
> We're getting closer, and I'm starting to see the extent of your amazing job!
> Tiny issues/questions:
> 1) When asking for multicore, I only get option of 2. Is this because you now
> assume that 1 is not relevant?
> 2) I don't think that the generation page is opened in my browser anymore.
> This was a really nice functionality (at least I liked it a lot).
> 3) The result of gensym is printed to screen. This is kinda long, and should
> only be printed if there is a problem. Same thing with combine_runs.
> 4) During run, it looks like:
> G1a
> real 0m4.617s
> user 0m2.208s
> sys 0m0.076s
> ./ajob1 run in 4.682720 s
> Since we say "ajob1 run in xxx s, we don't need the "time" printout.
> 5) "pythia --no_default": What does "no_default" mean?
> 6) It gets stuck for the longest time at
> "Creating Plots for Pythia level"
> and top shows that Python is running at near-100% CPU. Is this normal? (does
> Python report CPU usage also of daughter processes?)
> 7) The new crossx.html file is very nice, except that there is an extra table
> cell at "Parton Events" in the crossx.html file. Also, it would be nicer to
> have multiple processes listed after each other in the header rather than on
> separate lines.
> 8) The pythia_card is not included in the banner.txt.
> 9) When I generated a new process (after already run a process) and then do
> output, it suggests to use the same directory as the previous output. This is
> not correct, and I changed this behaviour before.
> 10) When I run a second run with Pythia "auto", there's no question if I want
> to edit the pythia_card.
> 11) When I run twice with matching, the matching plots after the pythia run
> are not reproduced after the second run, but identical to those after the
> first run. Probably, the events.tree and xsecs.tree files are retained from
> the previous run, resulting in identical plots.

Ok Now those 11 points are cover.
Just note for the multicore things,
I have bypass the question if the computer has exactly two core.

I will continue with the next mail.

230. By mattelaer-olivier

1) fix the extra cell in the html output
2) fix the output command after a launch

231. By Olivier Mattelaer

add different fix proposed by Johan including the fix for the removal of ajob

232. By Olivier Mattelaer

combine events directly writte events at the correct place (Events/events.lhe)

233. By Olivier Mattelaer

Include modifications linked to the review by Johan

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

>
> I am now testing the madevent interface, and it's really nice! However some
> glitches:
>
> 1) Major issue: When I run generate_events, refine is run twice:
> MGME5>generate_events newrun --multicore
> survey newrun --multicore
...
>
> The second refine should definitely not have any ajobs. Are you sure you
> delete the ajobs at the beginning of each survey or refine call?

Thanks, this is fixed

> 2) Major issue: There are no links to the Pythia and PGS logs in the
> crossx.html file. In fact these are crucial, esp. the Pythia log, since that's
> the only place where there is info about the final cross section after
> matching. It would be nice to also have a link to the log (from "Running
> PYTHIA"/"Running PGS") during the run.

Would not make more sense for matched process to write in that page the result after pythia?
In fact the suppression of the log was done on purpose, but maybe that's too strong.
Do we need the log for another reason than the cross-section?
Except debugging (in that case, it's enough to have only the last log file, and not a link to it)

> 3) After finished run, the crossx.html page should be updated (not say
> "Currently running").

In fact, I like the way, it's done for the moment, since it's say the current active job.
and therefore, I know which run I will impact if I run a command in the interface.
Note that if I quit the interface, the currently running will be remove.
In fact, I consider a job as finished only when a new job start or when I quit the interface.

What do you think of replacing the END/finish status by 'waiting for instruction'.
It might be more clear for the user.

> 4) The options for cluster and multicore are not the same as in the MG5 launch
> command - I can't use -m and -c. I'd suggest to include these also here. I
> also suggest to not allow run names starting with "-", since these are almost
> certainly failed attempts at options, and should be recognized as such.

Excellent point.

> 5) When canceling a run, the crossx.html page should be updated and no longer
> show that the process is running.

That's in fact the same idea as point 3.
I have modify the behavior in order to have a new status: "Stop by the user".

> 6) When running pythia on an existing run with ickkw=1:
> ...
> Saving plot as DJR4.eps
> Info in <TCanvas::Print>: eps file DJR4.eps has been created
> (bool)1
> gzip: events.tree: No such file or directory
> Command "pythia run_01" interrupted with error:
> IOError : [Errno 2] No such file or directory: '/Users/alwall/MadGraph/upgrade
> _pythia_compatibility/PROC_mssm_2/Events/events.tree.gz'
> Same thing when I run multi_run.

OK I will investigate this.

> 7) When running pgs on an existing run, after a canceled pythia run:
>
> prepare PGS run
> Storing Pythia files of Previous run
> Done
> Running PGS
>
> Since the Pythia run was not finished, I don't think it's appropriate to store
> the pythia-related files.

Do you cancel it during real pythia or during the plot associate to pythia?
Because the trigger of this message is on only after a check that file
Events/pythia_events.hep is present.

I add a security, but I'm puzzled about this...

> 8) I tried "...

Read more...

Revision history for this message
Johan Alwall (johan-alwall) wrote :
Download full text (4.9 KiB)

> > 2) Major issue: There are no links to the Pythia and PGS logs in the
> > crossx.html file. In fact these are crucial, esp. the Pythia log, since
> that's
> > the only place where there is info about the final cross section after
> > matching. It would be nice to also have a link to the log (from "Running
> > PYTHIA"/"Running PGS") during the run.
>
> Would not make more sense for matched process to write in that page the result
> after pythia?
> In fact the suppression of the log was done on purpose, but maybe that's too
> strong.
> Do we need the log for another reason than the cross-section?
> Except debugging (in that case, it's enough to have only the last log file,
> and not a link to it)

Sure, adding (also!) the cross section after Pythia makes a lot of sense, i.e., include also the cross section in the divided table "Parton level", "Pythia", etc.

However, the Pythia log is extremely important, since that's where to check that everything went well in the Pythia run, plus check number of events for different subprocesses, plus check that decays, hadronization and multiple interactions are on/off as wanted, etc.
Similar for the PGS/Delphes log - this is crucial to check that the result is the expected.

> > 3) After finished run, the crossx.html page should be updated (not say
> > "Currently running").
>
> In fact, I like the way, it's done for the moment, since it's say the current
> active job.
> and therefore, I know which run I will impact if I run a command in the
> interface.
> Note that if I quit the interface, the currently running will be remove.
> In fact, I consider a job as finished only when a new job start or when I quit
> the interface.

Aha, that makes a lot of sense. So it's just that I'm not used to it I guess.

> What do you think of replacing the END/finish status by 'waiting for
> instruction'.
> It might be more clear for the user.

Or perhaps "Parton level generation done / Pythia run done / PGS run done /" etc to indicate which step was performed last?

> That's in fact the same idea as point 3.
> I have modify the behavior in order to have a new status: "Stop by the user".

I would suggest "Parton level run canceled by user" / "Pythia run canceled by user" etc.

> > 6) When running pythia on an existing run with ickkw=1:
> > ...
> > Saving plot as DJR4.eps
> > Info in <TCanvas::Print>: eps file DJR4.eps has been created
> > (bool)1
> > gzip: events.tree: No such file or directory
> > Command "pythia run_01" interrupted with error:
> > IOError : [Errno 2] No such file or directory:
> '/Users/alwall/MadGraph/upgrade
> > _pythia_compatibility/PROC_mssm_2/Events/events.tree.gz'
> > Same thing when I run multi_run.
>
> OK I will investigate this.
>
>
> > 7) When running pgs on an existing run, after a canceled pythia run:
> >
> > prepare PGS run
> > Storing Pythia files of Previous run
> > Done
> > Running PGS
> >
> > Since the Pythia run was not finished, I don't think it's appropriate to
> store
> > the pythia-related files.
>
> Do you cancel it during real pythia or during the plot associate to pythia?
> Because the trigger of this message is on only after a check that file
> Events/pythia_events.hep is...

Read more...

234. By mattelaer-olivier

merge with trunk 1.3.22

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

> > > 3) After finished run, the crossx.html page should be updated (not say
> > > "Currently running").
> >
> > In fact, I like the way, it's done for the moment, since it's say the
> current
> > active job.
> > and therefore, I know which run I will impact if I run a command in the
> > interface.
> > Note that if I quit the interface, the currently running will be remove.
> > In fact, I consider a job as finished only when a new job start or when I
> quit
> > the interface.
>
> Aha, that makes a lot of sense. So it's just that I'm not used to it I guess.
>
> > What do you think of replacing the END/finish status by 'waiting for
> > instruction'.
> > It might be more clear for the user.
>
> Or perhaps "Parton level generation done / Pythia run done / PGS run done /"
> etc to indicate which step was performed last?

Let's go for a combinaison
XXXX done. Waiting for instruction
I also use the opportunity to change this to improve (a bit) the way it's done.
(avoid creation of the html file at two very close moment such that the end of survey and the beginning of refine).

> > That's in fact the same idea as point 3.
> > I have modify the behavior in order to have a new status: "Stop by the
> user".
>
> I would suggest "Parton level run canceled by user" / "Pythia run canceled by
> user" etc.

I like to have CTRL-C as minimal as possible,(In term of code running after a ctrl-c)
So I would prefer to not have to look at the history to see what is the last command.

> The pythia_events.hep is present (started) immediately after the start of the
> Pythia run, but only finished after completed run. We certainly don't want
> uncompleted files to be saved.

Indeed, I will then use the return code then. But this will not work in cluster mode.
(Since having the return code is probably possible but certainly quite tricky)

> > > 9) When I run multi_run, the crossx.html page keeps saying "compile
> > directory"
> > > - Furthermore, when the multi_run is done, the crossx.html page keeps
> > > displaying "Currently running" (see point 3 above).
> >
> > See point 3 answer.
>
> Here I'm not sure I agree - what is there that can still be done with a
> multi_run? Pythia/PGS is supposed to be run during the individual runs (since
> the multirun might have too many events), and not on the summed run. Unless
> you mean that further actions will act on all individual runs in turn (except
> perhaps parton level plots, which can be done on the summed events).

Ok I was also hesitating on this one. I've remove it (i.e. no more currently running).

> > > 10) The "!" or "shell" commands are not there:
> > > MGME5>shell rm Cards/pythia_card.dat
> > > Command "shell" not recognized, please try again
> >
> > That's boring to implement (due to security issue associate to it)
> > But ok I'll do.
>
> Ok thanks! It's very nice to be able to look at/remove files directly from the
> interface I think, and also list files. Plus, it's stated in the help that
> shell is available.
>

Concerning other change that I add in this version.
I change when I called gencardhtml. To call it once when I launched the interface (Such that it writes Running) and when I close it (to rem...

Read more...

235. By mattelaer-olivier

improve called to update, so improve html call (less writting and more clear)
avoid a number of useless call to gencard-html
remove the currently working after multi-run

236. By mattelaer-olivier

- avoid the pritting of G2j during the refine
- allow for shell command in shell mode
- correct the CTRL-D problem
- correct process detection for crossxhtml

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

For my tracking of the things that I still need to do
 - It remains the point 6 to investigate.
 - gridpack.
 - log pythia-pgs.
 - write to output matched cross-section.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

Just one comment:

> Let's go for a combinaison
> XXXX done. Waiting for instruction

Ok sounds good.

> > I would suggest "Parton level run canceled by user" / "Pythia run canceled
> by
> > user" etc.
>
> I like to have CTRL-C as minimal as possible,(In term of code running after a
> ctrl-c)
> So I would prefer to not have to look at the history to see what is the last
> command.

You can look at which temporary files are present, right? But perhaps it's not that important. Most important is that it's clear if the parton level run was finished or not.

> > The pythia_events.hep is present (started) immediately after the start of
> the
> > Pythia run, but only finished after completed run. We certainly don't want
> > uncompleted files to be saved.
>
> Indeed, I will then use the return code then. But this will not work in
> cluster mode.
> (Since having the return code is probably possible but certainly quite tricky)

Oh, no please don't use the return code. Just write a file at the end, and check for that file (done.pythia e.g.). This is guaranteed to always work for any setting (as long as it's correctly removed when not needed).

> Ok I was also hesitating on this one. I've remove it (i.e. no more currently
> running).

Ok sounds good.

Cheers,
Johan

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

> > I like to have CTRL-C as minimal as possible,(In term of code running after
> a
> > ctrl-c)
> > So I would prefer to not have to look at the history to see what is the last
> > command.
>
> You can look at which temporary files are present, right? But perhaps it's not
> that important. Most important is that it's clear if the parton level run was
> finished or not.

I found a very simple and beautiful way, so this is done (in fact in the previous push)
But I forget to edit the message.

> > > The pythia_events.hep is present (started) immediately after the start of
> > the
> > > Pythia run, but only finished after completed run. We certainly don't want
> > > uncompleted files to be saved.
> >
> > Indeed, I will then use the return code then. But this will not work in
> > cluster mode.
> > (Since having the return code is probably possible but certainly quite
> tricky)
>
> Oh, no please don't use the return code. Just write a file at the end, and
> check for that file (done.pythia e.g.). This is guaranteed to always work for
> any setting (as long as it's correctly removed when not needed).

ok, but the file is probably also not secure enough.
If I add it in run_pythia, and pythia crash, the file done_pythia, will be created anyway.
So I think, is should be a mix between the return code and a file created
(i.e. the file is created id the returncode of pythia is zero).
Anyway this will be for sunday. (Tommorow is quite busy)

>
> > Ok I was also hesitating on this one. I've remove it (i.e. no more currently
> > running).
>
> Ok sounds good.
>
> Cheers,
> Johan

237. By mattelaer-olivier

fix the bug in the error message due to fail compilation

238. By mattelaer-olivier

include the log file in the HTML output for pythia/pgs/delphes

239. By Olivier Mattelaer

Use pythia.done/ pgs.done to ensure that run_pythia/run_pgs ends correctly

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

> > 6) When running pythia on an existing run with ickkw=1:
> > ...
> > Saving plot as DJR4.eps
> > Info in <TCanvas::Print>: eps file DJR4.eps has been created
> > (bool)1
> > gzip: events.tree: No such file or directory
> > Command "pythia run_01" interrupted with error:
> > IOError : [Errno 2] No such file or directory:
> '/Users/alwall/MadGraph/upgrade
> > _pythia_compatibility/PROC_mssm_2/Events/events.tree.gz'
> > Same thing when I run multi_run.

I didn't succeed to reproduce the problem, could you try it again?
Maybe this was related to another point that I solved (but I don't think so).
Or simply that I didn't follow the same pattern as you.
So if you still face the problem, could you give me the list of command that you use?
(Note that I didn't test with multi-run)

For my tracking of the things that I still need to do
 - It remains the point 6 to investigate. (?)
 - gridpack.

240. By Olivier Mattelaer

add matched cross-section to the crossxhtml page

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Thanks for your fixes!

Here is the sequence of commands that gave me problems with Pythia (question 6).
bin/madevent
generate_events
generate_events
pythia run_001
The result is the same as before:
"""Create matching plots for Pythia
Info in <TCanvas::Print>: eps file DJR1.eps has been created
Info in <TCanvas::Print>: eps file DJR2.eps has been created
Info in <TCanvas::Print>: eps file DJR3.eps has been created
Info in <TCanvas::Print>: eps file DJR4.eps has been created
gzip: events.tree: No such file or directory
Command "pythia run_001" interrupted with error:
IOError : [Errno 2] No such file or directory: '/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_1/Events/events.tree.gz'
Please report this bug on https://bugs.launchpad.net/madgraph5"""

Some other suggestions (mainly esthetic/practical):

1) When you run generate_events, output "Generating xxx events with run name xxx".
Esp. if you run without arguments, it's nice to know right away the run name that will be used.
2) Add command to remove a run (corresponding to the old bin/rmrun script)
3) Please keep the same default run names for launch (in MG5) and generate_events (in madevent). For some reason, when I run madevent, the run name is run_001 instead of run_01.
4) In the madevent history (that you get from typing "history"), now all subcommands are also included, i.e., when I ran generate_events, the history shows:
"""generate_events
survey
refine 1000
refine 1000
combine_events
pythia --no_default
pgs --no_default
delphes --no_default"""
So it can't be used to reproduce what I actually did.

But clearly, my suggestions are becoming "smaller", so we are definitely getting close (once the remaining actual bugs are fixed) :-)

Cheers,
Johan

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Oh sorry, missed a couple of things:
1) Awesome that you added the matched cross section! Could you format the string too? Right now it says
365.9 ± 2.796
matched: 213.31969999999816
which is a bit too detailed :-)
Please use the same format as the xsec string (in this case, 213.3).

2) Could you also add the number of events after matching? This is also important info.

3) How do I run generate_events so that I get prompted for editing the cards?
I think we said this should be default, and you can add the flag "-f" or so to avoid the questions. If I want to do multiple runs with the same cards, in general I would use multi_run, so I think we should assume that the user wants to edit the cards every time.

Thanks!
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Next little bug:

MGME5>plot all
Command "plot all" interrupted with error:
NameError : global name 'args' is not defined
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'ME5_debug'.
Please attach this file to your report.

Same thing with "plot parton" etc.

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Sorry one more bug with "plot":

MGME5>generate_events (including Pythia run)
MGME5>plot
Creating Plots for parton level
End Plots for parton level
Command "plot" interrupted with error:
TypeError : coercing to Unicode: need string or buffer, NoneType found
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'ME5_debug'.
Please attach this file to your report.

Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

We DEFINITELY need a test suite corresponding to the acceptance_tests for madevent...
There are way too many commands to keep testing by hand.

Johan

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

> Here is the sequence of commands that gave me problems with Pythia
> (question 6).
> bin/madevent
> generate_events
> generate_events
> pythia run_001

Thanks, Now I can move forward on this :D

On 18-oct.-11, at 01:22, Johan Alwall wrote:

> Review: Needs Fixing
>
> Oh sorry, missed a couple of things:
> 1) Awesome that you added the matched cross section! Could you
> format the string too? Right now it says
> 365.9 ± 2.796
> matched: 213.31969999999816
> which is a bit too detailed :-)
> Please use the same format as the xsec string (in this case, 213.3).

Done

> 2) Could you also add the number of events after matching? This is
> also important info.

So in this case, this is 7789 right?

> 3) How do I run generate_events so that I get prompted for editing
> the cards?
> I think we said this should be default, and you can add the flag "-
> f" or so to avoid the questions. If I want to do multiple runs with
> the same cards, in general I would use multi_run, so I think we
> should assume that the user wants to edit the cards every time.

I'm not sure about this, since the question are quickly annoying.
If the user want to edit it, he can either do ! open
or (in most of the case) ! cp
This start to be very advance user, so I think question are more
annoying that anything else at that stage. (Most of the advance user
that I know use launch -f for production in fact)

So I probably prefer to keep this like it.
or if you want add a function configure_run which ask all the question
of the current launch.
(and we can add an option to generate_events to call it internally)
and/or a function edit (allow to shorcut the path) and with the
possibility of
edit delphes_card.dat --clean #equivalent to ! rm Cards/delphes_card.dat
But I'm not sure that this is worth the time.

In fact, one thing that it might be easy to do, (and its important for
MW5) is the possibility to scan over one (multiple) parameter.
I open a blueprint with some thought about it
https://blueprints.launchpad.net/madgraph5/+spec/scan-in-mass
If we implement this

> 1) When you run generate_events, output "Generating xxx events with
> run name xxx".
> Esp. if you run without arguments, it's nice to know right away the
> run name that will be used.
Done
> 2) Add command to remove a run (corresponding to the old bin/rmrun
> script)
Good idea.
> 3) Please keep the same default run names for launch (in MG5) and
> generate_events (in madevent). For some reason, when I run madevent,
> the run name is run_001 instead of run_01.
Ok fix, and made some refactorisation to avoid to have two different
functions doing the same thing.

> 4) In the madevent history (that you get from typing "history"), now
> all subcommands are also included, i.e., when I ran generate_events,
> the history shows:

ok I will look how to fix this

> Thanks!
> Johan
>
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Sorry, one more bug:

When I removed a couple of runs (using bin/internal/rmrun, so the banner file is left but no other files), the crossx.html page still shows the full set of links for these runs (although the page has been updated afterwards due to other runs). So it seems that the new crossx.html generation script doesn't actually look at which files are present.

Cheers,
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :
Download full text (3.2 KiB)

> > 2) Could you also add the number of events after matching? This is
> > also important info.
>
> So in this case, this is 7789 right?

Ah, you mean to get it from (nevents*xsec ratio)? Sure, that should be fine. The other possibility is to read it from the Pythia log. For the cross section, I'd suggest to grep for the line instead of taking the last line (there are some clusters e.g. that add info about the run at the end of the log file).

> > 3) How do I run generate_events so that I get prompted for editing
> > the cards?
> > I think we said this should be default, and you can add the flag "-
> > f" or so to avoid the questions. If I want to do multiple runs with
> > the same cards, in general I would use multi_run, so I think we
> > should assume that the user wants to edit the cards every time.
>
> I'm not sure about this, since the question are quickly annoying.
> If the user want to edit it, he can either do ! open
> or (in most of the case) ! cp
> This start to be very advance user, so I think question are more
> annoying that anything else at that stage. (Most of the advance user
> that I know use launch -f for production in fact)

I don't agree. If the user wants to run multiple times with the same cards, why start the interface? Easier to just run bin/generate_events directly. The interface will be used only when you actually want to do something more interesting, and by default this means having different parameters for each run. You can always use -f (which is very quick to write!) to bypass, much easier than having to run a separate command in advance. I don't agree that the questions get annoying - since you just press "enter" to do the default, it's quite nice I think. Most importantly, the user must be able to expect the same behavior from "generate_events" as from "launch" in MG5, otherwise I can guarantee that there will be a lot of confusion. Personally, I get a bit surprised every single time I run "generate_events" and it just starts running without any possibility of editing the cards.

> So I probably prefer to keep this like it.
> or if you want add a function configure_run which ask all the question
> of the current launch.
> (and we can add an option to generate_events to call it internally)
> and/or a function edit (allow to shorcut the path) and with the
> possibility of
> edit delphes_card.dat --clean #equivalent to ! rm Cards/delphes_card.dat

That's too cryptic/unexpected for sure.

> But I'm not sure that this is worth the time.
>
> In fact, one thing that it might be easy to do, (and its important for
> MW5) is the possibility to scan over one (multiple) parameter.
> I open a blueprint with some thought about it
> https://blueprints.launchpad.net/madgraph5/+spec/scan-in-mass
> If we implement this

Your post was cut off here, but yes indeed! This is very important. The only problem is how to get the widths right when you change model parameters such as masses.

> > 3) Please keep the same default run names for launch (in MG5) and
> > generate_events (in madevent). For some reason, when I run madevent,
> > the run name is run_001 instead of run_01.
> Ok fix, and made some refactorisation to avoid to have...

Read more...

241. By Olivier Mattelaer

Solve the problem with the plot drawing

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

> Sorry, one more bug:
>
> When I removed a couple of runs (using bin/internal/rmrun, so the banner file
> is left but no other files), the crossx.html page still shows the full set of
> links for these runs (although the page has been updated afterwards due to
> other runs). So it seems that the new crossx.html generation script doesn't
> actually look at which files are present.

I don't consider this as a bug but as a feature of the new crossx.html.
I'm using a database such that I can create/update that page with a minimal request to the
file system. So indeed if you remove by hand, they will be kept in the crossxhtml page.
That's why I like the idea to add a command to remove script, since this give the possibility to modify the database.

>Your post was cut off here, but yes indeed! This is very important. The only problem is how to >get the widths right when you change model parameters such as masses.

In fact, I started a discussion topic on that here:
https://blueprints.launchpad.net/madgraph5/+spec/scan-in-mass
So we might be discussing that at that place.

>I don't agree. If the user wants to run multiple times with the same cards, why start the >interface? Easier to just run bin/generate_events directly. The interface will be used only >when you actually want to do something more interesting, and by default this means having >different parameters for each run. You can always use -f (which is very quick to write!) to >bypass, much easier than having to run a separate command in advance. I don't agree that the >questions get annoying - since you just press "enter" to do the default, it's quite nice I >think. Most importantly, the user must be able to expect the same behavior from >"generate_events" as from "launch" in MG5, otherwise I can guarantee that there will be a lot >of confusion. Personally, I get a bit surprised every single time I run "generate_events" and >it just starts running without any possibility of editing the cards.

ok.

So the new todo list:

* gridpack
* crash on
bin/madevent
generate_events
generate_events
pythia run_001
* add command to remove run (see bin/rmrun)
* Number of event after matching
* Acceptance suite (?)
* refactorize the question code to pass from MG to ME.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

> > Sorry, one more bug:
> >
> > When I removed a couple of runs (using bin/internal/rmrun, so the banner
> file
> > is left but no other files), the crossx.html page still shows the full set
> of
> > links for these runs (although the page has been updated afterwards due to
> > other runs). So it seems that the new crossx.html generation script doesn't
> > actually look at which files are present.
>
>
> I don't consider this as a bug but as a feature of the new crossx.html.
> I'm using a database such that I can create/update that page with a minimal
> request to the
> file system. So indeed if you remove by hand, they will be kept in the
> crossxhtml page.
> That's why I like the idea to add a command to remove script, since this give
> the possibility to modify the database.

Ok cool. I think it would be good to renew the database sometimes, e.g. every time you launch a new run or after removing a run (with the new command), to ensure that everything is consistant.

> >Your post was cut off here, but yes indeed! This is very important. The only
> problem is how to >get the widths right when you change model parameters such
> as masses.
>
> In fact, I started a discussion topic on that here:
> https://blueprints.launchpad.net/madgraph5/+spec/scan-in-mass
> So we might be discussing that at that place.

Ok. How do I make a commment/post? It looks like I can only click "edit whiteboard", is that what I'm supposed to do?

> So the new todo list:
>
> * gridpack
> * crash on
> bin/madevent
> generate_events
> generate_events
> pythia run_001
> * add command to remove run (see bin/rmrun)
> * Number of event after matching
> * Acceptance suite (?)

What does this mean?

> * refactorize the question code to pass from MG to ME.

Ok cool, thanks!
Johan

242. By Olivier Mattelaer

fix Delphes events, not detected by web interface

243. By Olivier Mattelaer

Refactorize the managment of the Error.
Add a new class of error, which suggest to ask questions (and not submit bug report)

244. By Olivier Mattelaer

Fix the problem linked to the history. (By default now, a sub-command didn't appear in the history. This was the case, due to the translation of proc_v4, in that case, an option is added in order to continue to add the command in the history. Note that this is also bypass the multi-line parsing and the line splitting.

245. By Olivier Mattelaer

include the clean command. + some small debugging of the lasts commits

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

>
> Ok cool. I think it would be good to renew the database sometimes, e.g. every
> time you launch a new run or after removing a run (with the new command), to
> ensure that everything is consistant.

In fact doing that, means that we loose one of the big interest of the database.
In fact, they are two ways to be inconsistent:
1) The user use the shell to clean --then he expect that the html is not up-to-date (at least for some time, so I don't really care about that, especially since the clean will never be perfect).
2) The user unpack one file. This is more worrying me much more. (But happen already in the current version). I hope to found a little javascript for that, such that if the '.gz' is a dead, it will point on the '.lhe'.

Note that If I fixed that, then we can think to put a nice alert on the html page for the point 1.

The only way is that it might be in-consistant, is if you remove file by hand.
(Then I don't really care)

> What does this mean?
>
> > * refactorize the question code to pass from MG to ME.

That the question concerning editing the card should be re-factorize in order that they are now part of the ME interface file and not the MG files (currently in launch_external_program).
So what we discussed above.

Otherwise, I have implemented the command clean.
Do we need an option clean RUN banner.
Which will remove the banner and the full line in the html output?
(but allowing this only if the only thing remaining is the banner)

Shouldn't also remove/replace the script cleanall?

So the current todo list:
 * gridpack
 * crash on
     bin/madevent
     generate_events
     generate_events
     pythia run_001
 * Number of event after matching
 * Acceptance suite (?)
 * refactorize the question code to pass from MG to ME.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

> > Ok cool. I think it would be good to renew the database sometimes, e.g.
> every
> > time you launch a new run or after removing a run (with the new command), to
> > ensure that everything is consistant.
>
> In fact doing that, means that we loose one of the big interest of the
> database.

This I don't understand - I thought the problem that you are solving is that the crossx.html has to check runs every time it is updated, which is many times in a run. Doing a database update every time you start a run would take minimal time and not affect overall disk access. Or are you talking about some other benefit of the database?

> In fact, they are two ways to be inconsistent:
> 1) The user use the shell to clean --then he expect that the html is not up-
> to-date (at least for some time, so I don't really care about that, especially
> since the clean will never be perfect).

Why don't you "care about that"? It's quite useful for a user to remove selected files (such as the .hep.gz file which is huge), and the easiest way is to do it in the shell. As long as the user doesn't do something "wrong", I think we should try to help him/her as much as possible.

> 2) The user unpack one file. This is more worrying me much more. (But happen
> already in the current version). I hope to found a little javascript for that,
> such that if the '.gz' is a dead, it will point on the '.lhe'.
>
> Note that If I fixed that, then we can think to put a nice alert on the html
> page for the point 1.

Cool, I like that!

> The only way is that it might be in-consistant, is if you remove file by hand.
> (Then I don't really care)

See above.

> > What does this mean?
> >
> > > * refactorize the question code to pass from MG to ME.

No no, I was referring to what's above of course, "* Acceptance suite (?)"

> Otherwise, I have implemented the command clean.

It should be called "remove", "clean" refers to "make clean" which should remove the compiled files and has nothing to do with runs.

> Do we need an option clean RUN banner.
> Which will remove the banner and the full line in the html output?
> (but allowing this only if the only thing remaining is the banner)

Yes we do, that sounds fine (except "remove banner" instead).

> Shouldn't also remove/replace the script cleanall?

See above - clean and rmrun have completely different functionality.

> So the current todo list:
> * gridpack
> * crash on
> bin/madevent
> generate_events
> generate_events
> pythia run_001
> * Number of event after matching
> * Acceptance suite (?)
> * refactorize the question code to pass from MG to ME.

Cheers,
Johan

246. By Olivier Mattelaer

remove rmrun script

247. By Olivier Mattelaer

merge with the trunk (version 24)

248. By Olivier Mattelaer

correct the bug found by Johan+ add an acceptance test for this

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Ok the bug that you point, is now fixed, and I have add an acceptance test for it.
In order to fix the problem, I have change the name of the files .tree

RUN_events.tree -> RUN_pythia_events.tree
RUN_beforeveto.tree -> RUN_pythia_events.tree

This version also use now the remove command, and they are the command remove RUN banner.

I discussed with Benj for your decay script, and one thing that we could do is to make the evaluation for the 1 > 2 in python, this will reduce by a huge factor the time of the computation (since this is rule by compilation time).

So the current todo list:
  * gridpack
  * Number of event after matching
  * Acceptance suite (continue)
  * refactorize the question code to pass from MG to ME.
  * computation of the decays. (your script)

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

> Ok the bug that you point, is now fixed, and I have add an acceptance test for
> it.

Ah so "acceptance suite" was referring to test suite. Awesome!

> In order to fix the problem, I have change the name of the files .tree
>
> RUN_events.tree -> RUN_pythia_events.tree
> RUN_beforeveto.tree -> RUN_pythia_events.tree
>
> This version also use now the remove command, and they are the command remove
> RUN banner.

Great!

> I discussed with Benj for your decay script, and one thing that we could do is
> to make the evaluation for the 1 > 2 in python, this will reduce by a huge
> factor the time of the computation (since this is rule by compilation time).

Sure - I would consider this as a part of the decay calculator though. For now, let's just include the calculate_decay_widths command and collec_decay_widths.py script, to allow easy calculation of decay widths.

> So the current todo list:
> * gridpack
> * Number of event after matching
> * Acceptance suite (continue)
> * refactorize the question code to pass from MG to ME.
> * computation of the decays. (your script)
Plus the regeneration of the crossx.html data base when we start a new run :-)

Cheers,
Johan

249. By Olivier Mattelaer

adding the number of matched events

250. By Olivier Mattelaer

refactorize the questions in the madevent interface

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

> > I discussed with Benj for your decay script, and one thing that we could do
> is
> > to make the evaluation for the 1 > 2 in python, this will reduce by a huge
> > factor the time of the computation (since this is rule by compilation time).
>
> Sure - I would consider this as a part of the decay calculator though. For
> now, let's just include the calculate_decay_widths command and
> collec_decay_widths.py script, to allow easy calculation of decay widths.
>

Don't forget to send those script to me ;-)
(with possible instructions, on how they are working ;-) )

> > So the current todo list:
> > * gridpack
> > * Acceptance suite (continue)
> > * computation of the decays. (your script)
> > * add options -f and -mode options for generate_events command.
> > (the second options will be clear when you launch the generate_events)
> > * add options -mode for the launch command in mg5.
> Plus the regeneration of the crossx.html data base when we start a new run :-)

I would rather prefer to do that at the opening and closing of the madevent script.
This should be enough.

Note that I fully change the way the questions works for MadEvent.
Limiting the number of questions by default to 2.

Revision history for this message
Johan Alwall (johan-alwall) wrote :
Download full text (3.7 KiB)

> I would rather prefer to do that at the opening and closing of the madevent
> script.
> This should be enough.

Sure.

Hello Olivier,

> Note that I fully change the way the questions works for MadEvent.
> Limiting the number of questions by default to 2.

See below.

Here are my next round of bug reports/comments. Below, I am using the mg5 interface (not madevent):
1. I run "launch"
"""pythia-pgs not detected. If you want to run pythia-pgs.
            Please start to install it by the command 'install pythia-pgs'"""

This is clearly a bug, since pythia is there:
mg5>!ls pythia-pgs/src/pythia
root: running shell command: ls pythia-pgs/src/pythia
pythia-pgs/src/pythia

"""Which program do you want to run?
            Enter 0 or 'auto' in order to run the code associate to the current card.
            Enter 1 or 'parton' to launch only Madevent.
            Enter 2 of 'pythia' to launch MadEvent+pythia.
            Enter 3 or 'pgs' to launch MadEvent+pythia+pgs.
            Enter 4 or 'delphes' to launch MadEvent+pythia+delphes."""

Why do you include pythia in the questions when it's not installed? In that case, you should make it clear that choosing 2, 3 or 4 will install the necessary programs automatically! Otherwise, there should be an option to exit the launch so the user can install Pythia as you suggest.
Otherwise, I think it's ok. But see below for next question.

2. I tried waiting, and it crashes.
"""Which program do you want to run?
            Enter 0 or 'auto' in order to run the code associate to the current card.
            Enter 1 or 'parton' to launch only Madevent.
            Enter 2 of 'pythia' to launch MadEvent+pythia.
            Enter 3 or 'pgs' to launch MadEvent+pythia+pgs.
            Enter 4 or 'delphes' to launch MadEvent+pythia+delphes.
 [0, 1, 2, 3, auto, parton, pythia, pgs][20s to answer] (I wait 20 s)

use 0
Command "generate_events run_01" interrupted with error:
AttributeError : 'int' object has no attribute 'isdigit'
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'ME5_debug'.
Please attach this file to your report."""

3. Regarding this question:
"""Do you want to edit one of the card?
            Press enter or enter 'done' to use the current card.
            Enter 0 or 'param' to edit the param_card (be carefull about parameter consistency, especially the widths)
            Enter 1 or 'run' to edit the run_card.
 [done, 0, param, 1, run][20s to answer] """

I don't like it at all. It takes almost 20 s to read the whole thing so it's quite stressful, it's very complicated, and you don't even have the choice to edit all cards. I would like to see somthing like the following instead:

"""Note that you can set launch -f if you don't want to edit any cards.
Do you want to edit the param_card.dat (be careful about parameter consistency, especially the widths) (20 s to answer)
Do you want to edit the run_card.dat (20 s to answer)
Do you want to edit the plot_card.dat (20 s to answer)
Do you want to edit the pythia_card.dat (20 s to answer)"""
etc.

This is very clear, and much faster and easier for the user. Pressing "enter" is much less work than having to pre...

Read more...

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

I just ran with Pythia (ignoring the comment that Pythia was not detected) and ickkw=1, and there are now no matching plots. Furthermore, the events.tree and xsecs.tree files are not saved with the run name at all now. Also the matching cross section is gone.

Please always run with matching turned on when you test your modifications, so you see if you get the matching features or not.

Thanks,
Johan

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

 > Here are my next round of bug reports/comments. Below, I am using the mg5
> interface (not madevent):
> 1. I run "launch"
> """pythia-pgs not detected. If you want to run pythia-pgs.
> Please start to install it by the command 'install pythia-pgs'"""
> This is clearly a bug, since pythia is there:
> mg5>!ls pythia-pgs/src/pythia
> root: running shell command: ls pythia-pgs/src/pythia
> pythia-pgs/src/pythia
>
> """Which program do you want to run?
> Enter 0 or 'auto' in order to run the code associate to the
> current card.
> Enter 1 or 'parton' to launch only Madevent.
> Enter 2 of 'pythia' to launch MadEvent+pythia.
> Enter 3 or 'pgs' to launch MadEvent+pythia+pgs.
> Enter 4 or 'delphes' to launch MadEvent+pythia+delphes."""
>
> Why do you include pythia in the questions when it's not installed? In that
> case, you should make it clear that choosing 2, 3 or 4 will install the
> necessary programs automatically! Otherwise, there should be an option to exit
> the launch so the user can install Pythia as you suggest.
> Otherwise, I think it's ok. But see below for next question.

This is in fact a double bug.
The program not install in your case is delphes (A copy-paste that I forget to edit).
and the line which shouldn't be present is delphes.
Both bug are fixed.
The option to quit is Ctrl-C (this should be enough, I think)

> 2. I tried waiting, and it crashes.
> """Which program do you want to run?
> Enter 0 or 'auto' in order to run the code associate to the
> current card.
> Enter 1 or 'parton' to launch only Madevent.
> Enter 2 of 'pythia' to launch MadEvent+pythia.
> Enter 3 or 'pgs' to launch MadEvent+pythia+pgs.
> Enter 4 or 'delphes' to launch MadEvent+pythia+delphes.
> [0, 1, 2, 3, auto, parton, pythia, pgs][20s to answer] (I wait 20 s)
>
> use 0
> Command "generate_events run_01" interrupted with error:
> AttributeError : 'int' object has no attribute 'isdigit'
> Please report this bug on https://bugs.launchpad.net/madgraph5
> More information is found in 'ME5_debug'.
> Please attach this file to your report."""

Ok that's a fun bug. Fixed too.

> 3. Regarding this question:
> """Do you want to edit one of the card?
> Press enter or enter 'done' to use the current card.
> Enter 0 or 'param' to edit the param_card (be carefull about
> parameter consistency, especially the widths)
> Enter 1 or 'run' to edit the run_card.
> [done, 0, param, 1, run][20s to answer] """
>
> I don't like it at all. It takes almost 20 s to read the whole thing so it's
> quite stressful, it's very complicated, and you don't even have the choice to
> edit all cards. I would like to see somthing like the following instead:
>
> """Note that you can set launch -f if you don't want to edit any cards.
> Do you want to edit the param_card.dat (be careful about parameter
> consistency, especially the widths) (20 s to answer)
> Do you want to edit the run_card.dat (20 s to answer)
> Do you want to edit the plot_card.dat (20 s to answer)
> Do you want to edit the pythia_card.dat (20 s to...

Read more...

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Could you try to reproduce the bug with the history?
This is clearly not happening on my computer. (I try even by reproducing your history).
If you take that plus the fact that it runs only part of the shell command.
I'm really suspect that you launch those command by mistake and didn't realize it.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

> Could you try to reproduce the bug with the history?
> This is clearly not happening on my computer. (I try even by reproducing your
> history).
Indeed I can't reproduce it. Not sure what happened. Sorry about that.

Cheers,
Johan

Revision history for this message
Johan Alwall (johan-alwall) wrote :
Download full text (3.5 KiB)

> > 3. Regarding this question:
> > """Do you want to edit one of the card?
> > Press enter or enter 'done' to use the current card.
> > Enter 0 or 'param' to edit the param_card (be carefull about
> > parameter consistency, especially the widths)
> > Enter 1 or 'run' to edit the run_card.
> > [done, 0, param, 1, run][20s to answer] """
> >
> > I don't like it at all. It takes almost 20 s to read the whole thing so it's
> > quite stressful, it's very complicated, and you don't even have the choice
> to
> > edit all cards. I would like to see somthing like the following instead:
> >
> > """Note that you can set launch -f if you don't want to edit any cards.
> > Do you want to edit the param_card.dat (be careful about parameter
> > consistency, especially the widths) (20 s to answer)
> > Do you want to edit the run_card.dat (20 s to answer)
> > Do you want to edit the plot_card.dat (20 s to answer)
> > Do you want to edit the pythia_card.dat (20 s to answer)"""
> > etc.
> >
> > This is very clear, and much faster and easier for the user. Pressing
> "enter"
> > is much less work than having to press the right number among several
> choices.
> >
>
> In fact, I was not 100% happy by this system either (but I'm not 100% happy
> with the current system too)
>
> For the time limit, I agree that this is a bit stressful the first time, but
> then we can pass to 60s.

I like the first question (what to run), but I don't like the option to press a number for this question. Of course you can still press "enter" to run as usual (that's the "done" command), that's not the point. The point is that if you do want to modify some card, you need to spend more time (press the right number). I think it's easier to have the questions in a given order, which you always know is there. If you don't want any questions, you just run with -f, so that's not a problem. Remember that the first impression is most important (that's where you risk losing people) - after that people get used to how it works so it doesn't really matter, and with the -f possibility, you can bypass everything extremely easily (especially if this option is pointed out as I suggested above). A 60 s time limit is too long - better to have short questions and have 20 s. Is it possible to have it countdown (i.e., replace 20 with 19, 18, etc)? This would be cool and useful.

> I agree that this is more complex at the first point of view.
> But I'd like to see what is the efficiency of such method when we are used to
> it.

There is no efficiency difference once you are used to it - it takes 0 time for me to press "enter" for the questions I don't want. All that matters is the first impression, and that's where the present scheme (with one question per card) wins I think.

> I still found annoying the other way to launch it after months, so I'd like to
> see if this is better. The first impression is indeed not that good. But I
> would like to wait before going back to the previous scheme for the edition of
> the card. So let discuss this point again later.

Did you use -f? (is it even implemented?) Please start by doing that, and keep the card questions the old way...

Read more...

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Concerning the matching problem (plot + nb of event + matched cross-sec)

This is working perfectly on my computer. Are you sure that you set
icckw to something different than zero?
(could you check it?)

Cheers,

Olivier

On 28-oct.-11, at 23:32, Johan Alwall wrote:

>> Could you try to reproduce the bug with the history?
>> This is clearly not happening on my computer. (I try even by
>> reproducing your
>> history).
> Indeed I can't reproduce it. Not sure what happened. Sorry about that.
>
> Cheers,
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

251. By Olivier Mattelaer

add options -f and --run (not sure that the name of the options is clear, any suggestions?)

252. By Olivier Mattelaer

bypass questions for ./bin/generate_events

253. By Olivier Mattelaer

small bug fixing

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

I think "--run" sounds more like the run name. How about "--mode" or "--step"?

Johan

254. By Olivier Mattelaer

merge with the trunk (and resolve associate conflict)

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

I like step. or maybe --laststep
this is even more clear.

Thanks for the suggestion.

Olivier

On 29-oct.-11, at 12:44, Johan Alwall wrote:

> Hello Olivier,
>
> I think "--run" sounds more like the run name. How about "--mode" or
> "--step"?
>
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

255. By Olivier Mattelaer

change the path of crossx.html (now in the main)
This allow to have a check of the path. In order to treat correctly the unzip of the files by the user.

256. By Olivier Mattelaer

improve options --laststep.
Add the option in mg5_configuration.txt to bypass the opening of the web browser.
Fix a bug that the beam energy was read in the run_card before it's possible edition.

257. By Olivier Mattelaer

improve the questions scheme. Allow to put the answers to the questions in the
proc_card. Add the possibility to put path for the cards questions (find automaticaly which format it is).

258. By Olivier Mattelaer

fix small bug and include the cleaning of the crossx database.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi, after discussing with Benj,
we arrive at the conclusion that the real problem with the scheme for the questions is
that they are too much to read. So I made a more synthetic version, and indeed this is
much better, and now I'm really a fan of this method.

I also add the possibility to enter the path of a file. The format is automatically detected and put at the correct position.

I also add the possibilities to write the answer to the questions in the proc_card.dat.
This is valid for all questions off course.

Finally the last version also include the refresh of the database at each opening of the MadEvent interface (each launch command if made from mg5 interface).

So the only thing really important remaining is the gridpack that I have started to implement.
But in fact for this one, I'm worried to need python2.6 for the run. Maybe we should send an email to Alexis for this point.

So the minor point that remains (but those can wait a version 1.4.1 / improvment during the beta)
1) rethink the history system (not working for answer to question / launch -i not perfect for debugging due to cleaning performed for the proc_card)
2) The decay table computation.

259. By Olivier Mattelaer

forbids to load model whith lhablock containing spaces. (They create trouble with the parser)

Revision history for this message
Johan Alwall (johan-alwall) wrote :
Download full text (4.9 KiB)

Hello Olivier,

Sorry for the delay in getting back to this - I was struggling with the gridpack problems that Alexis pointed out most of last week, with the result that now gridpacks are faster and more reliable than ever :-)

I would say that the present status of this branch is very close to perfect (except for the gridpacks, that we might want to discuss more). I have a couple of comments left further down.

> Hi, after discussing with Benj,
> we arrive at the conclusion that the real problem with the scheme for the
> questions is
> that they are too much to read. So I made a more synthetic version, and indeed
> this is
> much better, and now I'm really a fan of this method.

Indeed, this does look much better.

> I also add the possibility to enter the path of a file. The format is
> automatically detected and put at the correct position.

Nice.

> I also add the possibilities to write the answer to the questions in the
> proc_card.dat.
> This is valid for all questions off course.

How does this work? It might get *very* confusing since the proc_card is supposed to be all-automatic and the editing of cards obviously is not. Furthermore, the proc_card is only for setting up the process, so I would not recommend to include anything related to launch in it.
If you mean the history, I would suggest to include only copying of files, since anything else might get (very) confusing. Perhaps you can explain more how you meant to do this.

> Finally the last version also include the refresh of the database at each
> opening of the MadEvent interface (each launch command if made from mg5
> interface).

Thanks!

> So the only thing really important remaining is the gridpack that I have
> started to implement.
> But in fact for this one, I'm worried to need python2.6 for the run. Maybe we
> should send an email to Alexis for this point.

I would suggest to keep the gridpack exactly the way it is now, i.e., not use Python for this. A grid_pack is only supposed to be run on a grid machine, so no user interface is needed, and the run mode is truly the simplest possible. So there is absolutely no need to use the full machinery of the python interface. We can still use some fundamental functionality (such as calling the different subscripts), but I would suggest to check if it's possible to do this in a Python 2.4-transparent way.

After fixing the gridpack problem with Alexis before, I think I might now be the person who best understands how the gridpacks work. I'd be happy to work with you on this.

Some further comments/bugs:

1. I launch
MGME5>multi_run
Command "multi_run" interrupted with error:
IndexError : list index out of range
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in 'ME5_debug'.
Please attach this file to your report.

2. I have a run since before, start the interface and do
MGME5>plot
No valid files for partonic plot
No valid files for pythia plot
No valid files for pgs plot
No valid files for delphes plot

It should ask for a run name (and give options). This functionality should be common for plot, Pythia, PGS, Delphes etc. Furthermore, it should allow editing of the plot_card.dat (of co...

Read more...

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Another bug:

MGME5>remove run_02
Done
MGME5>remove run_02 banner
Done
Traceback (most recent call last):
  File "bin/madevent", line 140, in <module>
    cmd_line.cmdloop()
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/cmd.py", line 143, in cmdloop
    stop = self.postcmd(stop, line)
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_5/bin/internal/madevent_interface.py", line 211, in postcmd
    self.update_status('Command \'%s\' done.<br> Waiting for instruction.' % arg[0], level=None)
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_5/bin/internal/madevent_interface.py", line 1149, in update_status
    self.results.update(status, level, makehtml=makehtml)
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_5/bin/internal/gen_crossxhtml.py", line 165, in update
    self.output()
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_5/bin/internal/gen_crossxhtml.py", line 270, in output
    old_run += self[key].info_html(self.path, submit_button)
KeyError: 'run_02'

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Ok I have now got to the tests. I would suggest to test all functionality that you add (as usual), to avoid problems like the one above when I tried to run "remove banner". This would be a natural end for the event generation test. I would strongly suggest to reduce the number of events to (maximum) 1000 per run (in fact, even 100 is enough), since the functionality we are testing here certainly doesn't require large statistics but just a non-zero number of events after matching. In particular since we need a number of runs - with/without multicore, with/without -f, with different end points, run plot/pythia/pgs/Delphes on existing runs, etc. We could have one run with slightly larger statistics where we check for the final cross section and number of events, before and after matching, to ensure that MadEvent is working ok. For this run, we don't run PGS and I suggest also not to run plots for that run, since plots take much longer than the MG/Pythia runs themselves.

I do get an error when I run the tests:
======================================================================
ERROR: test_generation_from_file (tests.acceptance_tests.test_cmd_madevent.TestMEfromfile)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/tests/acceptance_tests/test_cmd_madevent.py", line 99, in test_generation_from_file
    print open('/tmp/MGPROCESS/history').read()
IOError: [Errno 2] No such file or directory: '/tmp/MGPROCESS/history'

----------------------------------------------------------------------
Ran 2 tests in 297.210s

FAILED (errors=1)

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

Hi Johan,

> Sorry for the delay in getting back to this - I was struggling with
> the gridpack problems that Alexis pointed out most of last week,
> with the result that now gridpacks are faster and more reliable than
> ever :-)

No problem, I was busy by other things including the majorana bug of
Kentarou.

>> I also add the possibilities to write the answer to the questions
>> in the
>> proc_card.dat.
>> This is valid for all questions off course.
>
> How does this work? It might get *very* confusing since the
> proc_card is supposed to be all-automatic and the editing of cards
> obviously is not. Furthermore, the proc_card is only for setting up
> the process, so I would not recommend to include anything related to
> launch in it.
> If you mean the history, I would suggest to include only copying of
> files, since anything else might get (very) confusing. Perhaps you
> can explain more how you meant to do this.

So first this is not related only to the launch command but to all
possible question (current and in the future).
And second, those answer are NOT include in the history and in the
automatic proc_card.
In other words this options will be use only by expert user since she
is a bit hidden, and therefore will not confuse too much of people.

> the proc_card is supposed to be all-automatic and the editing of
> cards obviously is not

Off course, the real interest is for the copying of the files.
If they ask to edit one card... the they will edit it. Not doing it
will be even more confusing as well as forbidding it.

> I would not recommend to include anything related to launch in it.

I use the opposite spirit in fact, with launch -i you can even set the
command of the madevent run in the proc_card:

For example the following scenario will work

generate p p > e+ e-
output
launch -i
multi_run 10
pgs # answer to the question which run to launch
# specify path for the run
/home/Cards/param_card.dat
/home/Cards/pgs_card.dat
/home/Cards/pythia_card.dat
/home/Cards/run_card.dat
quit # quit MGME interface -> MG5 interfqce
#restart something new
generate p p > e+ e- j
output
launch
pythia
/home/Cards/param_card.dat
/home/Cards/pgs_card.dat
/home/Cards/pythia_card.dat
/home/Cards/run_card.dat
0

> If you mean the history, I would suggest to include only copying of
> files, since anything else might get (very) confusing.

This is not include in the history. Including it will make it
confusing for a lot of user I think.
This is clearly a functionality for advance user who need to fully
automate things.

> I would suggest to keep the gridpack exactly the way it is now,
> i.e., not use Python for this. A grid_pack is only supposed to be
> run on a grid machine, so no user interface is needed, and the run
> mode is truly the simplest possible. So there is absolutely no need
> to use the full machinery of the python interface. We can still use
> some fundamental functionality (such as calling the different
> subscripts), but I would suggest to check if it's possible to do
> this in a Python 2.4-transparent way.
>
> After fixing the gridpack problem with Alexis before, I think I
> might now be...

260. By mattelaer-olivier

Include modifications linked to Johan comments
+ refactorize the help of MadEvent (split in two + contextual help)
+ suppress load/save of the list of command of mg5 (they still exists but not displayed in help)

Revision history for this message
Johan Alwall (johan-alwall) wrote :
Download full text (13.6 KiB)

Hello Olivier,

> Off course, the real interest is for the copying of the files.
> If they ask to edit one card... the they will edit it. Not doing it
> will be even more confusing as well as forbidding it.
>
> I use the opposite spirit in fact, with launch -i you can even set the
> command of the madevent run in the proc_card:
>
> For example the following scenario will work
>
> generate p p > e+ e-
> output
> launch -i
> multi_run 10
> pgs # answer to the question which run to launch
> # specify path for the run
> /home/Cards/param_card.dat
> /home/Cards/pgs_card.dat
> /home/Cards/pythia_card.dat
> /home/Cards/run_card.dat
> quit # quit MGME interface -> MG5 interfqce
Ah you mean quit ME interface
> #restart something new
> generate p p > e+ e- j
> output
> launch
> pythia
> /home/Cards/param_card.dat
> /home/Cards/pgs_card.dat
> /home/Cards/pythia_card.dat
> /home/Cards/run_card.dat
> 0
What does the "0" mean here (you didn't have that in the multi_run example above)?

Anyway, this is really, really cool. As you say, it's not that easy to navigate, but with a couple of good examples in a README file or the wiki page, I think it will be quite useful for powerusers :-)

> > I would suggest to keep the gridpack exactly the way it is now,
> > i.e., not use Python for this. A grid_pack is only supposed to be
> > run on a grid machine, so no user interface is needed, and the run
> > mode is truly the simplest possible. So there is absolutely no need
> > to use the full machinery of the python interface. We can still use
> > some fundamental functionality (such as calling the different
> > subscripts), but I would suggest to check if it's possible to do
> > this in a Python 2.4-transparent way.
> >
> > After fixing the gridpack problem with Alexis before, I think I
> > might now be the person who best understands how the gridpacks work.
> > I'd be happy to work with you on this.
>
> I agree, I will make a first version on this, and after that we can
> iterate.

Ok, sure. Please make sure that all commands related to the gridpack are identical to the present ones (as described in the README.gridpack). One detail: In the present gridpacks, it seems that not all files are properly removed. This should be changed (in particular, it's ridiculous to use make files for creating gridpack.tar.gz, just as it is for madevent.tar.gz).

> > 2. I have a run since before, start the interface and do
> > MGME5>plot
> > No valid files for partonic plot
> > No valid files for pythia plot
> > No valid files for pgs plot
> > No valid files for delphes plot
> >
> Concerning the run name, I don't agree. The syntax is
> plot [Run_NAME] [MODE]
> If you don't specify the run_name it's used the current one.

Of course, I meant if there is no current run.

> if they are no current one, it should report an error. (I added the
> error just now)

Sure, that's fine.

> > Furthermore, it should allow editing of the plot_card.dat (of
> > course - why else would I want to rerun plot?).
>
>
> Ok Done. I also include this (question for editing the card) for
> pythia/pgs/delphes.
> This is more coherent.

Great! The plot_card should be an option also in the regular MadEvent ru...

261. By Johan Alwall

Merged up to the latest trunk (1.3.27). This is necessary for me to start working on survey/refine and the gridpack functionality.

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

> Hello Olivier,
>
> >
> > generate p p > e+ e-
> > output
> > launch -i
> > multi_run 10
> > pgs # answer to the question which run to launch
> > # specify path for the run
> > /home/Cards/param_card.dat
> > /home/Cards/pgs_card.dat
> > /home/Cards/pythia_card.dat
> > /home/Cards/run_card.dat
> > quit # quit MGME interface -> MG5 interfqce
> Ah you mean quit ME interface
> > #restart something new
> > generate p p > e+ e- j
> > output
> > launch
> > pythia
> > /home/Cards/param_card.dat
> > /home/Cards/pgs_card.dat
> > /home/Cards/pythia_card.dat
> > /home/Cards/run_card.dat
> > 0
> What does the "0" mean here (you didn't have that in the multi_run example
> above)?

In fact I can have put it in the multi-run, since this answer the question for one additional
edition of the card. This will avoid to ask a question and potentially wait that the time limit is reached. (or that the user answer the question.) This shows that you are not force to answer to all question in fact.

> > > You could in fact fully reuse the functionality of generate_events -
> > > ask how far you want to go (pythia/pgs/delphes), since this is what
> > > is done online and also by the run_pythia script.
> >
> > I will not go that far.
>
> Why not? It would be expected by the user after seeing generate_events, and
> it's quite annoying to have to wait for the pythia run to finish before
> getting to run PGS/Delphes (esp. since this is the typical kind of things one
> might want to start before going to lunch). This is also the way the web
> interface works.

Ok, This will force some refactoring but it's ok.

> > > 4. For survey, it should be possible to give a precision (needed for
> > > decay width calculation as well as gridpack generation).
> >
> > What do you mean, the current survey doesn't have any precision
> > information at current stage.
> > If you want to run gen_ximprove then this is a call to refine (at
> > least for decay width computation).
> > I never really use those commands survey/refine/... So sorry to not
> > understand your question here.
>
> Running gen_ximprove is very different, since it counts towards the total
> cross section/events, while specifying the precision directly in the madevent
> run ensures a given precision per channel. This is what we need in grid packs
> and in decay width calculations. Right now, these things are specified in
> run_configs.inc in the Source directory, but I would like to take out all
> these options
> and put them as run options. That would give better flexibility and more
> consistent launch code now that we have such a nice interface. I'll be happy
> to work on this once the interface is ready.

Sure go ahead:D

>
> > > 5. refine should only be possible if there was a prior survey. There
> > > should be the possibility to specify whether or not we allow
> > > splitting of channels (for gridpacks, this is not allowed).
> >
> > gridpack is not suppose to run refine, is it?
> > Oh is this the equivalent of refine4grid script.
> > This script is not even mention in the README.
> > When this is helpfull to call it? What is the real effect of it?
>
> Actually, I would suggest that you let me take care of every...

Read more...

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

> Another bug:
>
> MGME5>remove run_02
> Done
> MGME5>remove run_02 banner
> Done
> Traceback (most recent call last):
> File "bin/madevent", line 140, in <module>
> cmd_line.cmdloop()
> File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
> /cmd.py", line 143, in cmdloop
> stop = self.postcmd(stop, line)
> File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_5/bin/inte
> rnal/madevent_interface.py", line 211, in postcmd
> self.update_status('Command \'%s\' done.<br> Waiting for instruction.' %
> arg[0], level=None)
> File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_5/bin/inte
> rnal/madevent_interface.py", line 1149, in update_status
> self.results.update(status, level, makehtml=makehtml)
> File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_5/bin/inte
> rnal/gen_crossxhtml.py", line 165, in update
> self.output()
> File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_5/bin/inte
> rnal/gen_crossxhtml.py", line 270, in output
> old_run += self[key].info_html(self.path, submit_button)
> KeyError: 'run_02'

This is now fixed.
I also fix the problem that even if you remove the banner the information was kept in the html output.

In the next version that I will push, I've also
1) debug the auto-completion for pythia/pgs/delphes
2) debug the quit all command (which was quitting only ME interface before)
3) I implement the unit test ensuring that the help is always beautifull
4) Implement the display run_name
5) Adding the options for editting the plot card
6) Some very minor modifications.

Now I'll implement
a) pythia launch automaticaly pgs and delphes (if card present) + interface to edit/remove/modify those cards
b) possibility to run with a banner in input

Concerning that point, I think it will be more clear to have a specific command for that.
(This will makes the options more clear in generate_events/multi_run)
What do you think?

262. By mattelaer-olivier

various bug fixing/ add small functionalities

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

I still get the following error when I launch the ME acceptance test:

.Running MG5 in debug mode
Traceback (most recent call last):
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/tests/../bin/mg5", line 114, in <module>
    import madgraph.interface.cmd_interface as cmd_interface
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/madgraph/interface/cmd_interface.py", line 47, in <module>
    import madgraph.iolibs.export_cpp as export_cpp
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/madgraph/iolibs/export_cpp.py", line 127, in <module>
    path = os.getcwd()):
OSError: [Errno 2] No such file or directory
E
======================================================================
ERROR: test_generation_from_file (tests.acceptance_tests.test_cmd_madevent.TestMEfromfile)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/tests/acceptance_tests/test_cmd_madevent.py", line 99, in test_generation_from_file
    print open('/tmp/MGPROCESS/history').read()
IOError: [Errno 2] No such file or directory: '/tmp/MGPROCESS/history'

----------------------------------------------------------------------
Ran 2 tests in 353.776s

FAILED (errors=1)

The test also seems very rudimentary. Are you planning to extend it to actually check for everything that's relevant (including the cross section and number of events before/after matching, creation of all relevant files, etc.)?

Cheers,
Johan

review: Needs Fixing
263. By Olivier Mattelaer

Change the questions associated to pythia

264. By mattelaer-olivier

starting point for adding banner_run command.
This commit push is mainly to be able to transfer to my laptop.
The function is not complete. (do nothing for the moment)

265. By Olivier Mattelaer

finish implementation of banner_run command

266. By Olivier Mattelaer

Fix all the acceptance tests (huge problem present with _v4 model)
The full suite is still bugged, but each test passes separately

267. By Olivier Mattelaer

improve acceptance tests
remove the chdir of madevent (more clean and makes all tests passes)

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

I Johan,

I've improve a bit those tests. (They are less trivial now)
I've also fix all the other acceptance test.
(I found problem with all output linked a model_v4 import)

So now I'm ready to make a release. I'm waiting for your approval before doing it.

Cheers,

Olivier

268. By Johan Alwall

Set parameters for gensym (symmetry.f) as input parameters provided by the madevent_interface.py. This allows more flexibility in creating different run modes, such as calculate_decays, calculate_crossx, etc.

269. By mattelaer-olivier

merge with the last version of the trunk (1.3.28)

270. By mattelaer-olivier

change starting point for parralel comparison (put the value before the splitting with 1.3.xx)

271. By mattelaer-olivier

Improve parralel tests (use less memory and faster as well)

272. By mattelaer-olivier

fix acceptance test (add the argument for the gensym)

273. By mattelaer-olivier

make more clear that this is a beta version

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

Now there is something really weird with the crossx.html page: There is no way to get to the subprocess and channel cross section results anymore. Also, the link to the gridpack when I run with .true. = gridpack is placed very funny with ugly formatting. Did you make some changes recently? This must be fixed before we can pass this into beta.

Another comment: I moved the create_plots from inside combine_events to a separate call in generate_events. It would be nice to move also create_root_file from combine_events (since it has nothing to do with combine_events), and move the checks for file existence into the create_root_file routine. I started, but stopped since I think you might want to do it your way.

You might want to take a look at how I do the options/parameters for survey: I use a dictionary from parameter name to type, default value and help text. This allows for quite compact use. You might be interested in using a similar approach for other options, if you like the system.

Please note that I have pushed some changes, so do a pull before you fix this.

Thanks,
Johan

review: Needs Fixing
274. By Olivier Mattelaer

correct the bug which hidden the results link.
Improve the html output for the gridpack output

275. By Johan Alwall

Updated version number to beta_2, fixed grammar in UpdateNotes

276. By omatt

fix the acceptance tests (missing \n in communicate)

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

Something is strange again - when I run
bin/mg5
generate p p > l+ vl
output
launch

it started the run without asking any questions at all! Did you somehow make "-f" default for launch in the mg5 interface?

Johan

review: Needs Fixing
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

I still have the questions.
Do you have pythia-pgs install?
If not the first question is bypass.
If this is bugged, this may bypass the second questions as well
(that's my first guess at least).

Cheers,

Olivier

On 15-nov.-11, at 22:06, Johan Alwall wrote:

> Review: Needs Fixing
>
> Hello Olivier,
>
> Something is strange again - when I run
> bin/mg5
> generate p p > l+ vl
> output
> launch
>
> it started the run without asking any questions at all! Did you
> somehow make "-f" default for launch in the mg5 interface?
>
> Johan
>
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

277. By Olivier Mattelaer

fix the bypass of all questions when pythia is not detected (wrong identation)

278. By Olivier Mattelaer

fix a bug in the web interface

279. By Olivier Mattelaer

correct small problem related to the web interface

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

I am now actively using this branch for some projects, and I really like it! It really works very well. One more detail about the new crossx.html page: I don't find any link to the run log, although I have a run log with the name run_name.log in the process directory. Did this functionality also disappear? I guess it would be most natural to have it as the Parton: LOG link, in analogy with the Pythia: LOG link.

Cheers,
Johan

review: Needs Fixing
280. By Olivier Mattelaer

Fix html interface problem for multi-run.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

> I am now actively using this branch for some projects, and I really
> like it! It really works very well. One more detail about the new
> crossx.html page: I don't find any link to the run log, although I
> have a run log with the name run_name.log in the process directory.
> Did this functionality also disappear? I guess it would be most
> natural to have it as the Parton: LOG link, in analogy with the
> Pythia: LOG link.

On a local computer, I don't have any log for the parton run (I have a
combine.log but no run_name.log). On cp3wks05 (The only web source
where 1.4.0 is running presently),
they are indeed a log in the main directory, but this is not linked to
parton level at all. This afternoon, I add a link to this log for the
crossxhtml (for the online case only).
Is this solve your problem?

Cheers,

Olivier

On 16-nov.-11, at 20:30, Johan Alwall wrote:

> Review: Needs Fixing
>
> Hello Olivier,
>
> I am now actively using this branch for some projects, and I really
> like it! It really works very well. One more detail about the new
> crossx.html page: I don't find any link to the run log, although I
> have a run log with the name run_name.log in the process directory.
> Did this functionality also disappear? I guess it would be most
> natural to have it as the Parton: LOG link, in analogy with the
> Pythia: LOG link.
>
> Cheers,
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

281. By Olivier Mattelaer

fix a bug in the PBS submission (still calling md5 and not haslib)

282. By Olivier Mattelaer

Oops type. Sorry

Revision history for this message
Johan Alwall (johan-alwall) wrote :

> Hi Johan,
>
> > I am now actively using this branch for some projects, and I really
> > like it! It really works very well. One more detail about the new
> > crossx.html page: I don't find any link to the run log, although I
> > have a run log with the name run_name.log in the process directory.
> > Did this functionality also disappear? I guess it would be most
> > natural to have it as the Parton: LOG link, in analogy with the
> > Pythia: LOG link.
>
> On a local computer, I don't have any log for the parton run (I have a
> combine.log but no run_name.log). On cp3wks05 (The only web source
> where 1.4.0 is running presently),
> they are indeed a log in the main directory, but this is not linked to
> parton level at all. This afternoon, I add a link to this log for the
> crossxhtml (for the online case only).
> Is this solve your problem?

For now, I'm just talking about automatically including a link to the log if it exists (just like it was before). I always run generate_events piping to a log called runname.log, and in this case the crossx.html page is supposed to link to the log.

The next step, which is also quite important, is to display the log both to the screen and to a file when you use the madevent interface. You already solved how to do this, so it should be a minimal thing to add. When people have problems, the first thing we ask for is always the log, so it should be there by default.

Cheers,
Johan

283. By Olivier Mattelaer

Fix qsub one job submission problem

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

> For now, I'm just talking about automatically including a link to
> the log if it exists (just like it was before). I always run
> generate_events piping to a log called runname.log, and in this case
> the crossx.html page is supposed to link to the log.

You are probably the only one knowing such functionality. But I see
the point. (But see below)

> The next step, which is also quite important, is to display the log
> both to the screen and to a file when you use the madevent
> interface. You already solved how to do this, so it should be a
> minimal thing to add. When people have problems, the first thing we
> ask for is always the log, so it should be there by default.

In fact that was working since the stdin was not used, I'm not sure at
all that this was working for interactive program.

In fact, this output is very pointless. Since the only information is
more a timer information (which is completely pointless to keep).
The only interest is
1) if an python error occur (but then a ME5_debug is created)
2) a subprogram writes an error, but
a) either this error trigger a python error (all compilation/missing
file/...) --so go back to point 1
b) either the error is in fact to another logfile (pythia.log/
combine.log + all the log file for each invidual log)
c) the error is in fact directly send in the /dev/null (for whatever
reason)

I'm pretty sure that those three cases cover 99% of the case (in
1.4.0, clearly not in previous version).
So the utility of this file is VERY minimal at the end.

On the opposite, the real information for the debugging is now in the
ME5_debug file.
Which is probably a file to link if he exists (potentially rename it
with the run_name).

So I'm thinking to redirect the output of madevent script to /dev/null
for the madevent script
and to add a link to crossxhtml, just after the writting of the
MG5_debug.

Cheers,

Olivier

> Cheers,
> Johan
>
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

284. By mattelaer-olivier

For MG/ME on the web use the configuration file defined in MADGRAPH_BASE (This will allow to run pythia/plots/... on the web)

285. By mattelaer-olivier

stupid typo (I' testing the cluster so I need to push before any possible tests)

286. By mattelaer-olivier

another typo...

287. By mattelaer-olivier

- Add a (RED) link to the debug file if a problem occur during the run
- Fix a problem forbidding to run pythia on the web (still need to be validated)
- fix the three bug reported by arian

288. By mattelaer-olivier

fix a bug with crossxhtml in web version

289. By mattelaer-olivier

another small bug lined to the web

290. By mattelaer-olivier

another small bug lined to the web

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan, Pierre,

Sorry for the large number of commit this was due to various temptative to make all those things running perfectly on cp3wks05.

So the first news, is that this is now wroking fine on cp3wks05.
And the second is that I have add a link to the debug file when ME crashes (for whatever reason)
Like this it's quite clear that smtg wrong happenned.

I also modify the banner of cp3wks05:
with the following modif:
1) Suppresion of Rome cluster
2) Put a link to launchpad instead
3) Changing the link of the wiki to the new one. (most of the link refer to the old one but ok)
4) Add link to bugs/questions
5) Move the admin link to the bottom side of the generate-process page.

Cheers,

Olivier

291. By mattelaer-olivier

put gfortran has the default compiler (in case of both g77 and gfortran defined use gfortran)

292. By mattelaer-olivier

merge with the trunk

293. By mattelaer-olivier

introduce sge cluster
remove #PBS tag in ajob

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hey Olivier,

Question: Would it be possible to display the number for waiting/running/done jobs also in local mode (serial and multicore)? That way, I could possibly accept to suppress the output (or replace it with an info output showing a progress meter for each stage, e.g.).

What do you think?
Johan

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

Good idea.
This shouldn't be a big problem in fact.
The only point that I will need to play (a bit) is how to know the
number of job that will be submitted.
But this shouldn't be a big problem to have. (and the rest is quite
trivial)

Cheers,

Olivier

On 19-nov.-11, at 01:41, Johan Alwall wrote:

> Hey Olivier,
>
> Question: Would it be possible to display the number for waiting/
> running/done jobs also in local mode (serial and multicore)? That
> way, I could possibly accept to suppress the output (or replace it
> with an info output showing a progress meter for each stage, e.g.).
>
> What do you think?
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

I've made the implementation that you ask (not yet for single machine).
Having the total number of jobs require a re-factorization of the code.
So I give the status Sub-directory by Sub-directory.
I can do the re-factorization of the code if you prefer.

Cheers,

Olivier

Revision history for this message
Johan Alwall (johan-alwall) wrote :

The new counter is very cool! Is it possible to have it update continuously (i.e., every time a job is started/finished)? When I ran p p > 3j, it only updated twice during the whole survey, so it doesn't really give the feeling that it's making progress... Esp. if we want to replace the output with just the html and a progress meter, we need update for every job that's started/finished. Or is this too heavy for some reason?

Another point: The html page is not launched until the jobs start running - it should be started as soon as the cards are done, so also the compilation step is seen (as before).

Cheers,
Johan

Revision history for this message
Johan Alwall (johan-alwall) wrote :

A bug: When trying to use path completion for the cards question, I get the following error:
completenames() takes at least 3 arguments (2 given)

Cheers,
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Another bug:
I used launch to generate parton level events, and then did
launch -i
pythia run_01
and it fails saying

MGME5>pythia run_01
compile directory
remove run_01 pythia -f

Running Pythia
Fail to produce pythia output

It turns out that the reason is that there is no pythia_card.dat.
Same thing happens if I exit the mg5 interface and try using bin/madevent. No question about PGS, no question about pythia_card.

Cheers,
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Would it be possible to stop the card timer as soon as any key is pressed, not just tab? I was just done writing in the path to my run_card, when it suddenly started running in mode "0"...

review: Needs Fixing
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

If that was possible, I would be able to have a countdown for the timer.
I'm pretty sure that this should be possible...
But not that trivial since in the meantime, we don't want to disturb
the readline module.

I have found a link:
http://bytes.com/topic/python/answers/545507-linux-detect-key-press
which maybe interesting, the problem might be for readline (and as you
know
readline is a nightmare under mac)

I maybe be able to have a running version on my computer, but if it
doesn't works on yours....

Cheers,

Olivier

On 20-nov.-11, at 22:53, Johan Alwall wrote:

> Review: Needs Fixing
>
> Would it be possible to stop the card timer as soon as any key is
> pressed, not just tab? I was just done writing in the path to my
> run_card, when it suddenly started running in mode "0"...
>
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

> The new counter is very cool! Is it possible to have it update
> continuously (i.e., every time a job is started/finished)? When I
> ran p p > 3j, it only updated twice during the whole survey, so it
> doesn't really give the feeling that it's making progress... Esp. if
> we want to replace the output with just the html and a progress
> meter, we need update for every job that's started/finished. Or is
> this too heavy for some reason?

Depends on how you define continously...
-The web page displayed can be refreshed on a time basis. So this is
done automatically every 30s. This time can be reduce, but I found it
as a good compromise.
- The web page on disk can be changed as soon as a new job change
status. But in my implementation, I checked that two update of the
page on disk are not done in less 30s interval.
(the choice was to match the above limit). I can reduce this limit to
3s (below that it start to be pointless and for 24 node machine, such
limit probably makes a lot of sense) this should give the feeling of
perpetual update.

That means that if the user reload the page automatically, he will
have it updated. Otherwise the update will be done automatically after
30s.

For the shell output, If I pass that limit to 3s, it will be quite a
mess (i.e. not beautiful output). But this should be easy to fix.
Note that a progressbar is not a real option, since the number of run
in idle varies each times a new process is added.

Cheers,

Olivier

On 20-nov.-11, at 22:25, Johan Alwall wrote:

> The new counter is very cool! Is it possible to have it update
> continuously (i.e., every time a job is started/finished)? When I
> ran p p > 3j, it only updated twice during the whole survey, so it
> doesn't really give the feeling that it's making progress... Esp. if
> we want to replace the output with just the html and a progress
> meter, we need update for every job that's started/finished. Or is
> this too heavy for some reason?
>
> Another point: The html page is not launched until the jobs start
> running - it should be started as soon as the cards are done, so
> also the compilation step is seen (as before).
>
> Cheers,
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

I can't reproduce the bug...

I did this:
generate p p > e+ e-
output
launch
launch -i
pythia run_01
-> propose me question so I kill it

cd PROC_sm_7
./bin/madweight.py
pythia run_01
-> propose me question so I kill it

cd ..
./bin/mg5
launch PROC_sm_7 -i
pythia run_01
-> propose me question so I kill it.

So could you be more specific on how you create that bug?

Cheers,

Olivier

On 20-nov.-11, at 22:39, Johan Alwall wrote:

> Review: Needs Fixing
>
> Another bug:
> I used launch to generate parton level events, and then did
> launch -i
> pythia run_01
> and it fails saying
>
> MGME5>pythia run_01
> compile directory
> remove run_01 pythia -f
>
> Running Pythia
> Fail to produce pythia output
>
> It turns out that the reason is that there is no pythia_card.dat.
> Same thing happens if I exit the mg5 interface and try using bin/
> madevent. No question about PGS, no question about pythia_card.
>
> Cheers,
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

> I can't reproduce the bug...

In fact, I never get a question when I run pythia. So it must be system specific. Very strange, since there is no problem with the questions when I run "generate_events". Do you use exactly the same way to do this for generate_events and pythia?

Next bug: The absence of the pythia card the first time it tried to run pythia gave an "ERROR DETECTED" flag on that run. This should disappear when I redo the pythia run without error.

Functionality request: When dealing with matching, one of the most common things we need to do is rerun Pythia many times for a given run, with different parameters. What I always do is copy the banner and make a link of the unweighted_events file from the run in question, with a new name, e.g.
cp run_01_banner.txt run_01-qcut30_banner.txt
ln -s run_01_unweithted_events.lhe.gz run_01-qcut30_unweighted_events.lhe.gz
and then use "run_pythia run_01-qcut30". When I do it in the new framework, for some reason it crashes (in fact in the gen_crossxhtml step):
Traceback (most recent call last):
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_1/bin/internal/extended_cmd.py", line 204, in onecmd
    return cmd.Cmd.onecmd(self, line)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/cmd.py", line 219, in onecmd
    return func(arg)
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_1/bin/internal/madevent_interface.py", line 1825, in do_pythia
    self.results.add_detail('cross_pythia', cs_info)
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_1/bin/internal/gen_crossxhtml.py", line 235, in add_detail
    run['nb_event_text'] = '%s <br> matched: %d' % (self.current['nb_event'],
TypeError: int() argument must be a string or a number, not 'NoneType'

It's not surprising of course, since I guess you didn't anticipate this. However, it is a very common and very useful functionality, so it would be great if this could be done directly from the madevent interface. I would suggest the following syntax:
pythia [run_name] [new_run_name] options
If new_run_name is given (and different from run_name), then the copy of the relevant files is automatically done, and Pythia is run on the new files.

Many thanks, all the best,
Johan

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

Hi Johan,

>> I can't reproduce the bug...
>
> In fact, I never get a question when I run pythia. So it must be
> system specific. Very strange, since there is no problem with the
> questions when I run "generate_events". Do you use exactly the same
> way to do this for generate_events and pythia?

Yeah that's the same spirit.
I maybe have an idea concerning this. Could you check if this works?
Otherwise, it will be hard to debug... (maybe skype?)
So could you
1) make display options
(This will give the information if pythia-pgs is detected)
2) Tell me if he is proposing you pythia-pgs option in the pythiq-pgs
options

> Next bug: The absence of the pythia card the first time it tried to
> run pythia gave an "ERROR DETECTED" flag on that run. This should
> disappear when I redo the pythia run without error.

Will look at that.

> It's not surprising of course, since I guess you didn't anticipate
> this. However, it is a very common and very useful functionality, so
> it would be great if this could be done directly from the madevent
> interface. I would suggest the following syntax:
> pythia [run_name] [new_run_name] options
> If new_run_name is given (and different from run_name), then the
> copy of the relevant files is automatically done, and Pythia is run
> on the new files.

I'm not sure to like the syntax and clearly if we propose this as a
feature we need to take care properly of the banner.
I clearly see the interest, so let me think of smtg in order to do
that in a very nice (and simple) way.

Cheers,

Olivier

On Nov 21, 2011, at 8:19 AM, Johan Alwall wrote:

> Review: Needs Fixing
>
>> I can't reproduce the bug...
>
> In fact, I never get a question when I run pythia. So it must be
> system specific. Very strange, since there is no problem with the
> questions when I run "generate_events". Do you use exactly the same
> way to do this for generate_events and pythia?
>
> Next bug: The absence of the pythia card the first time it tried to
> run pythia gave an "ERROR DETECTED" flag on that run. This should
> disappear when I redo the pythia run without error.
>
> Functionality request: When dealing with matching, one of the most
> common things we need to do is rerun Pythia many times for a given
> run, with different parameters. What I always do is copy the banner
> and make a link of the unweighted_events file from the run in
> question, with a new name, e.g.
> cp run_01_banner.txt run_01-qcut30_banner.txt
> ln -s run_01_unweithted_events.lhe.gz run_01-
> qcut30_unweighted_events.lhe.gz
> and then use "run_pythia run_01-qcut30". When I do it in the new
> framework, for some reason it crashes (in fact in the gen_crossxhtml
> step):
> Traceback (most recent call last):
> File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_1/
> bin/internal/extended_cmd.py", line 204, in onecmd
> return cmd.Cmd.onecmd(self, line)
> File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/cmd.py", line 219, in onecmd
> return func(arg)
> File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_1/
> bin/internal/madevent_interface.py", line 1825, i...

Read more...

294. By mattelaer-olivier

make the default choice of single machine/cluster/multi processor
as an option in the configuration file.
also add the cluster_queue and the number of core as an option in
that file.

295. By mattelaer-olivier

merge with version 1.3.30

296. By mattelaer-olivier

coreect two bug pointed by Johqn

297. By mattelaer-olivier

fix for sge cluster + merge with Johan

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

Hi Johan,

This is my proposal concerning your pythia request:

1) The proposed syntax is
pythia [run_name] --tag[=TAG]

Note:
1) The same would be valid for pgs/delphes
2) Note that the run_name IS optional (if one is define off course).
3) Tag name is also optional (but this is less interesting but tests)

2) I propose to re-shufle the crossxhtml output in the following way:
(see attachment)

Like that we will nicely treat all multiple pythia/pgs run.

Cheers,

Olivier

On Nov 21, 2011, at 10:26 AM, Olivier Mattelaer wrote:

> Hi Johan,
>
>>> I can't reproduce the bug...
>>
>> In fact, I never get a question when I run pythia. So it must be
>> system specific. Very strange, since there is no problem with the
>> questions when I run "generate_events". Do you use exactly the same
>> way to do this for generate_events and pythia?
>
>
> Yeah that's the same spirit.
> I maybe have an idea concerning this. Could you check if this works?
> Otherwise, it will be hard to debug... (maybe skype?)
> So could you
> 1) make display options
> (This will give the information if pythia-pgs is detected)
> 2) Tell me if he is proposing you pythia-pgs option in the pythiq-pgs
> options
>
>> Next bug: The absence of the pythia card the first time it tried to
>> run pythia gave an "ERROR DETECTED" flag on that run. This should
>> disappear when I redo the pythia run without error.
>
> Will look at that.
>
>> It's not surprising of course, since I guess you didn't anticipate
>> this. However, it is a very common and very useful functionality, so
>> it would be great if this could be done directly from the madevent
>> interface. I would suggest the following syntax:
>> pythia [run_name] [new_run_name] options
>> If new_run_name is given (and different from run_name), then the
>> copy of the relevant files is automatically done, and Pythia is run
>> on the new files.
>
> I'm not sure to like the syntax and clearly if we propose this as a
> feature we need to take care properly of the banner.
> I clearly see the interest, so let me think of smtg in order to do
> that in a very nice (and simple) way.
>
> Cheers,
>
> Olivier
>
>
> On Nov 21, 2011, at 8:19 AM, Johan Alwall wrote:
>
>> Review: Needs Fixing
>>
>>> I can't reproduce the bug...
>>
>> In fact, I never get a question when I run pythia. So it must be
>> system specific. Very strange, since there is no problem with the
>> questions when I run "generate_events". Do you use exactly the same
>> way to do this for generate_events and pythia?
>>
>> Next bug: The absence of the pythia card the first time it tried to
>> run pythia gave an "ERROR DETECTED" flag on that run. This should
>> disappear when I redo the pythia run without error.
>>
>> Functionality request: When dealing with matching, one of the most
>> common things we need to do is rerun Pythia many times for a given
>> run, with different parameters. What I always do is copy the banner
>> and make a link of the unweighted_events file from the run in
>> question, with a new name, e.g.
>> cp run_01_banner.txt run_01-qcut30_banner.txt
>> ln -s run_01_unweithted_events.lhe.gz run_01-
>> qcut30_unweighted_events.lhe.gz
>> and then use "run_pythia r...

Read more...

298. By mattelaer-olivier

fix problem with check_sa

Revision history for this message
Johan Alwall (johan-alwall) wrote :

> I maybe have an idea concerning this. Could you check if this works?
> Otherwise, it will be hard to debug... (maybe skype?)
> So could you
> 1) make display options
> (This will give the information if pythia-pgs is detected)
mg5>display options
Value of current MG5 Options:
              web_browser : None
              text_editor : None
          pythia-pgs_path : ./pythia-pgs
                  td_path : ./td
             delphes_path : ./Delphes
             cluster_type : pbs
         madanalysis_path : ./MadAnalysis
         fortran_compiler : None
      exrootanalysis_path : ./ExRootAnalysis
               eps_viewer : None
   automatic_html_opening : True
             pythia8_path : ./pythia8
       group_subprocesses : True
ignore_six_quark_processes : False

> 2) Tell me if he is proposing you pythia-pgs option in the pythiq-pgs
> options

You mean when I run "launch"?
Which programs do you want to run?
  0 / auto : running existing card
  1 / parton : Madevent
  2 / pythia : MadEvent + Pythia.
  3 / pgs : MadEvent + Pythia + PGS.
 [0, 1, 2, 3, auto, parton, pythia, pgs][20s to answer]

So no problem there. Or perhaps I misunderstand your question.
I'm available to Skype if that helps.

Thanks,
Johan

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

> This is my proposal concerning your pythia request:
>
> 1) The proposed syntax is
> pythia [run_name] --tag[=TAG]
>
> Note:
> 1) The same would be valid for pgs/delphes
> 2) Note that the run_name IS optional (if one is define off course).
> 3) Tag name is also optional (but this is less interesting but tests)

Excellent! By default (if no tag is given) the files should be replaced of course.

> 2) I propose to re-shufle the crossxhtml output in the following way:
> (see attachment)

I like your reshuffling, as long as you include a link to the log for each run.

Thanks!
Johan

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

Thanks a lot for your improvements to this, we are close to perfect.

> Depends on how you define continously...
> -The web page displayed can be refreshed on a time basis. So this is
> done automatically every 30s. This time can be reduce, but I found it
> as a good compromise.

Right. When I run a short job, I always click "reload" to see the actual present status.

> - The web page on disk can be changed as soon as a new job change
> status. But in my implementation, I checked that two update of the
> page on disk are not done in less 30s interval.
> (the choice was to match the above limit). I can reduce this limit to
> 3s (below that it start to be pointless and for 24 node machine, such
> limit probably makes a lot of sense) this should give the feeling of
> perpetual update.

3s is perfect.

> That means that if the user reload the page automatically, he will
> have it updated. Otherwise the update will be done automatically after
> 30s.

Right.

> For the shell output, If I pass that limit to 3s, it will be quite a
> mess (i.e. not beautiful output). But this should be easy to fix.
> Note that a progressbar is not a real option, since the number of run
> in idle varies each times a new process is added.

I clearly didn't mean to have an output everytime you update the counter. It's enough to update the status. If we want a progress bar, perhaps the bar can take into account the number of unstarted subprocesses? We can then continuously adjust as new subprocesses are added. Note that we don't want any numbers for "remaining time", since this is impossible to calculate. Just a bar would be nice, it's sufficiently "fuzzy" not to make the user too confused.

One detail: The total number of jobs should not be written until all subprocesses have been included. It's very confusing now that it says that there are a total of (e.g.) 6 jobs, and then next time I look, there's a total of 12 jobs. Just waiting, started, and finished jobs is good, until we have included all subprocesses. At that point, also the total number of jobs is written.
In fact, it would be nice to have the same thing for cluster run, to avoid the (sometimes very long) wait before the user sees any jobs ticking down. Another possibility is to replace "Total" with "Remaining subprocess directories" until the last subproc is included, and then replace it with the total number of jobs. This might be the most clear way.

Cheers,
Johan

299. By Johan Alwall

Implementation of the new command calculate_decay_widths, which produces a file run_name_param_card.dat. Added check in cmd_interface.py to ensure that user does not mix processes with different number of initial state particles.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

I have just pushed a new version which includes the calculate_decay_widths command. Please take a look and see how you like it. In fact, I would propose to make this the default command to be run when you do "launch" for a directory with decay processes, instead of "generate_events" which usually doesn't make a lot of sense for decay processes.

I also inserted a check that the user doesn't try to mix decay and collider processes in a single process directory, and included a link to the resulting param_card in the gen_crossxhtml.py script.

Cheers,
Johan

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

> I have just pushed a new version which includes the
> calculate_decay_widths command. Please take a look and see how you
> like it.

Didn't look to it in detail (yet) but I have quick (for me but will
require some longer work for you) comments.

1) I don't like the fact that you script is in ./bin/internal and
therefore call as an external program.
This program should be put in various and copy paste to bin/internal.
(like all the other code)
This program should be a function that is call internally (not as
external program).

> In fact, I would propose to make this the default command to be run
> when you do "launch" for a directory with decay processes, instead
> of "generate_events" which usually doesn't make a lot of sense for
> decay processes.

2) If we change this by default (fine with me) then we could (or in
should) pass in set group_subprocess False automatically when we
detect a decay in generate_events.
3) What happen if group_subprocess is on True? is the results make
sense (I mean the BR especially)?
4) One acceptance test on this would be necessary I think.

> I also inserted a check that the user doesn't try to mix decay and
> collider processes in a single process directory, and included a
> link to the resulting param_card in the gen_crossxhtml.py script.

Very cool.

Cheers,

Olivier

On 22-nov.-11, at 02:41, Johan Alwall wrote:

> Hello Olivier,
>
> I have just pushed a new version which includes the
> calculate_decay_widths command. Please take a look and see how you
> like it. In fact, I would propose to make this the default command
> to be run when you do "launch" for a directory with decay processes,
> instead of "generate_events" which usually doesn't make a lot of
> sense for decay processes.
>
> I also inserted a check that the user doesn't try to mix decay and
> collider processes in a single process directory, and included a
> link to the resulting param_card in the gen_crossxhtml.py script.
>
> Cheers,
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello again Olivier,

I have a proposal:
Let's use multicore as default run mode. This is the most useful mode anyway, and if there is only one core, it's identical to serial running. The only question is how many cores to use by default, and I would suggest that if -f is set, to use maximum cores by default, and otherwise ask just like it's done now. However, also "1" must be included as a choice, in case the user intended serial running.
That way, we can remove serial running mode.

If the user directly uses the "generate_events" script with mode 0, this can simply be a shortcut for multicore with nb_cores=1. That way we simplify the code with one less run mode.

What do you think?

Johan

300. By Johan Alwall

Ensure that decay processes are completely separated into subprocesses if group_subprocesses=False

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

It seems that for some reason, it doesn't stop the generation if the survey returns 0 for all channels, but continues all the way to creating LHE files etc...

Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Now this is really weird... the second run, where I get non-zero result, fails:

Generating 10000 events with run name run_02
survey run_02
compile directory
Running Survey
Working on SubProcesses
    P0_gt_tz
 Idle: 0 Running: 1 Finish: 0
./ajob1 run in 0.678328 s
Error detected in survey
Command "generate_events run_02" interrupted with error:
MadEventError : Error detected Stop running
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in '/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_2/run_02_debug.log'.
Please attach this file to your report.

But there is no problem in any of the jobs, and I have non-zero cross section...
Furthermore, the link in the cross section goes to run_02_results.html, although there is no such file (the file is results.html).

Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

You can try to reproduce the bug with my new version (which, by the way, it would be great if you could review since this is a pretty deep change):

generate g t > t Z
output
launch -f
launch
(change lpp1,2 to 0)

Cheers,
Johan

301. By Johan Alwall

Ensure that we get 0 cross section if we use non-parton initial states with PDFs

302. By Johan Alwall

Sorry clarified the code a bit. Updated UpdateNotes.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

> if there is only one core, it's identical to serial running.
> If the user directly uses the "generate_events" script with mode 0,
> this can simply be a shortcut for multicore with nb_cores=1. That
> way we simplify the code with one less run mode.

That's not really true. A multicore with one node will still use the
multi-threading method, which is not nice for a single run.
So we are force to have two mode internally to the code anyway.

> Let's use multicore as default

In fact, I would rather say that this the typical things that should
be treated by the mg5_configuration.txt file
at current stage we have this in this file all the requested
information.
The number of requested nodes are also on this files, so we can/should
always use this number and not use that question anymore.

One thing that we should add, it's to indicate this file in the
tutorial, and indicate in the tutorial all
the parameters that they can change in this files. Like that this
files will be more known and therefore more often
modified by the user.

> The only question is how many cores to use by default, and I would
> suggest that if -f is set, to use maximum cores by default, and
> otherwise ask just like it's done now.

That's the curent behavior in fact.

> However, also "1" must be included as a choice, in case the user
> intended serial running.

In fact, I don't like that question, in 99% of the case, the user will
always run the same configuration (I mean run_type/number of core/job
queue/...).
So those parameter should be read from mg5_configuration.txt and may
be modifiable from the command line. (either by the set command or via
command options)
I found a waste of time, the question on the number of core. (In fact
I don't have it on my computer since I have excatly two cores,
including the '1' options will force the question to appear again)

The other question is do we want/need to keep the generate_events
identical to the old version or not?

Cheers,

Olivier

On 22-nov.-11, at 03:26, Johan Alwall wrote:

> Hello again Olivier,
>
> I have a proposal:
> Let's use multicore as default run mode. This is the most useful
> mode anyway, and if there is only one core, it's identical to serial
> running. The only question is how many cores to use by default, and
> I would suggest that if -f is set, to use maximum cores by default,
> and otherwise ask just like it's done now. However, also "1" must be
> included as a choice, in case the user intended serial running.
> That way, we can remove serial running mode.
>
> If the user directly uses the "generate_events" script with mode 0,
> this can simply be a shortcut for multicore with nb_cores=1. That
> way we simplify the code with one less run mode.
>
> What do you think?
>
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

303. By Olivier Mattelaer

Fix the two small bug pointed by Johan.
Include the SGE cluster (made by Arian Abrahantes)

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

>> 1) The proposed syntax is
>> pythia [run_name] --tag[=TAG]
>>
>> Note:
>> 1) The same would be valid for pgs/delphes
>> 2) Note that the run_name IS optional (if one is define off course).
>> 3) Tag name is also optional (but this is less interesting but
>> tests)
>
> Excellent! By default (if no tag is given) the files should be
> replaced of course.

I was thinking to reply to you 'yes off course'
But after thinking to this again. I'm not sure that this is the
expected behavior.
On the contrary, I expect that the people will prefer to preserve the
previous run (in order to compare --especially for the matching case--)
So I would say now that in all cases, we need to preserve it. (except
it it overlap the tag off course)

>> 2) I propose to re-shufle the crossxhtml output in the following way:
>> (see attachment)
>
> I like your reshuffling, as long as you include a link to the log
> for each run.

The log for pythia/pgs no problem, the log of the cross-section
computation are under the other page, so no problem.
In addition, they will have a banner will be fully coherent.
The real log of the run is available only on the web (and on the web I
would prefer to not keep it in fact).

Cheers,

Olivier

On 21-nov.-11, at 21:37, Johan Alwall wrote:

> Hello Olivier,
>
>> This is my proposal concerning your pythia request:
>>
>> 1) The proposed syntax is
>> pythia [run_name] --tag[=TAG]
>>
>> Note:
>> 1) The same would be valid for pgs/delphes
>> 2) Note that the run_name IS optional (if one is define off course).
>> 3) Tag name is also optional (but this is less interesting but
>> tests)
>
> Excellent! By default (if no tag is given) the files should be
> replaced of course.
>
>> 2) I propose to re-shufle the crossxhtml output in the following way:
>> (see attachment)
>
> I like your reshuffling, as long as you include a link to the log
> for each run.
>
> Thanks!
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

304. By Olivier Mattelaer

            add paralel test for various computation of the cross-section. (only srvey/refine performed)
            correct a small bug pointed by Chiu-tien-yu

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

Ooops it seems that this email was never send:
So this is my review of your changes:

1) I'll change this

             # Set conversion from PDG code to number used in PDF calls
             pdgtopdf = {21: 0, 22: 7}

             # Fill in missing entries of pdgtopdf
             for pdg in sum(initial_states,[]):
                 if not pdg in pdgtopdf and not pdg in
pdgtopdf.values():
                     pdgtopdf[pdg] = pdg
                 elif pdg not in pdgtopdf and pdg in pdgtopdf.values():
                     # If any particle has pdg code 7, we need to use
something else
                     pdgtopdf[pdg] = 6000000 + pdg
by
             # Set conversion from PDG code to number used in PDF calls
             pdgtopdf = {21: 0, 22: 7}

             # Fill in missing entries of pdgtopdf
             for pdg in sum(initial_states,[]):
   if pdg in pdgtopdf:
   pass #already done
   elif pdg==7
   # this is a special tag so use a higher number
   pdgtopdf[7] = 6000007
                 else:
    pdgtopdf[pdg] = pdg

(But this is only a weak suggestion).

2) Am I correct with the following statement:
a) If we put electron, muon,... the code will return 0 -> since
pdgtopdf is higher than 7
b) for bottom/top... (I have no idea)
c) for light jet, no problem since pdgtopdf is lower than 7
d) for photon/gluon, it takes care of it correctly. no problem since
one is set to 0 and the second one to 7.

In fact I'm trouble for the top/bottom.
Since the code on this case is lower than 7.
So I don't see how you treat those two cases.

Cheers,

Olivier

On 22-nov.-11, at 07:43, Johan Alwall wrote:

> You can try to reproduce the bug with my new version (which, by the
> way, it would be great if you could review since this is a pretty
> deep change):
>
> generate g t > t Z
> output
> launch -f
> launch
> (change lpp1,2 to 0)
>
> Cheers,
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hey Olivier,

You must have forgotten to include the file tests/parallel_tests/input_files/mg5_short_parraleltest_sm.pkl. The parallel test fails due to this.

Also please correct the spelling of all files. It's "parallel", NOT "parralel".

Cheers,
Johan

review: Needs Fixing
305. By Johan Alwall

Updated VERSION to beta_5, 2011-11-26

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

Thanks for this, It seems that my last push didn't pass then since I
bypass completely the use of this pickle, since those last days I was
in holliday (for thanksgiving)
and the day before the internet connection was quite unstable, the
push was possibly not passing through. I'll check that as soon as
possible.

In fact I'm still not 100% sure that the non-"short" part of those
tests are fully working at the present time.

Cheers,

Olivier

On 25-nov.-11, at 22:39, Johan Alwall wrote:

> Review: Needs Fixing
>
> Hey Olivier,
>
> You must have forgotten to include the file tests/parallel_tests/
> input_files/mg5_short_parraleltest_sm.pkl. The parallel test fails
> due to this.
>
> Also please correct the spelling of all files. It's "parallel", NOT
> "parralel".
>
> Cheers,
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

306. By mattelaer-olivier

change the name of the pickle add teh sm one (thanks Johan)

307. By mattelaer-olivier

Correct the bug reported by Sho

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

your fix for the group subprocesses is not working.
In fact your modif with are after the 'if' checking group subprocess is used.
This is very important since this is the key to make this usefull.
on this point, why you need to have group subprocess on False?
if they are merge, that means that they have the same contribution right?

Secondly what is the meaning of this question:
Do you want to edit one cards (press enter to bypass editing)?
  1 / param : param_card.dat (be carefull about parameter consistency, especially widths)
  2 / run : run_card.dat
  9 / plot : plot_card.dat
  Path to a valid card.
 [0, done, 1, param, 2, run, 9, plot, enter path][30s to answer]

The comment on the width doesn't makes sense (off course we are computing the width why should it be correct?)
Concerning the run_card shouldn't we put a run_card without cut by default?

Finally, the param_card is not created at the correct place (at least the gencrossxhtml script didn't find it).

Concerning this script, I' worried about the fact that it can produce param_card without any meaning. Maybe one solution is to ask if the user want to write the param_card.
This question can be joined to a warning to the fact that the param_card doesn't makes sens if all the relevant disintegration channel were not included.

What do you think?

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

just to update,

it seems that the path is ok but that you didn't ask for an update of the gencrossxhtml
at a correct time for creating the link.
This one is created only if I launch another run.

Cheers,

Olivier

308. By mattelaer-olivier

improve crossxhtml for decqy
run automaticaly calculate_width in case of 1>X process

309. By mattelaer-olivier

correct sho problem (recurence)

310. By Olivier Mattelaer

use the tag for the pythia/pgs/delphes in the links and reorganize the output dir

311. By Olivier Mattelaer

improve auto-completion
pass sum_html in python
new organisation for the HTML/Event directory
Use the tag name for the event file for pythia/pgs/delphes

312. By mattelaer-olivier

Modify gencrossxhtml in order to prepare the possibiity of multi-tag for a run.

313. By Olivier Mattelaer

add css files

314. By Olivier Mattelaer

correct small bug + prepare the multi-pythia/pgs/delphes

315. By Olivier Mattelaer

new module for the banner
multi-pythia working
reintroduce the link for error log in the html

316. By Olivier Mattelaer

multi pythia/pgs/delphes is now fully working.

317. By Olivier Mattelaer

make the specification of the tag works + auto-completion + help

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

I've finish the implementation of the possibility
to have multiple pythia/pgs/delphes run for a single event run.

I still have to fix
a) the remove command (I change the position for some of the output and I need to add a way to remove a single tag.
b) the banner run (The banner treatment is also modified).
c) include the html button for the web mode (in order to allow this option on the web).

What is the status
a) of the gridpack?
b) my previous comment concerning the param_card creation?

Do you still want other things before the official release?
We probably want to release a last beta and then pass it to the official version.

Cheers,

Olivier

318. By Olivier Mattelaer

Have a remove command supporting the --tag argument.
Have a correct computation of the pythia error.

319. By Olivier Mattelaer

make banner_run compatible with tag (and fix some bug associate to the previous version)
improve customize auto-completion (avoid redondancy + fix wrong column spliting)

320. By mattelaer-olivier

have a nice history even when using ; trick
if set command is used in mg5 command pass it to Madevent command
update/fix/improve the acceptance tests

321. By Olivier Mattelaer

fix launch command (for SA and pythia8)

322. By Olivier Mattelaer

merge with rambo_bug branch
fix Johan's bugs
  - problem with autolinking of ME5_debug
  - problem with the MGMEVersion file

323. By Olivier Mattelaer

Add the fermion flow check when loading a new model.

324. By Olivier Mattelaer

merge with modif on the other computer
fix case sensitive path in acceptance tests
remove 4fermion model (tch)

325. By Olivier Mattelaer

change date

326. By Olivier Mattelaer

forget to add aloha_fct file

327. By Olivier Mattelaer

add results.dat for P directory

328. By Olivier Mattelaer

modify collect_result in order
1) to have it running event in groupsubprocess
2) to have it called automatically with the launch command

329. By Olivier Mattelaer

change launch scheme for 1>X

330. By Olivier Mattelaer

allow arguments in program definitions bug #905053

331. By Olivier Mattelaer

allow groupsubprocess with auto value
create numbdiag for the web interface

332. By Olivier Mattelaer

merge with 1.3.32

333. By Olivier Mattelaer

Fixed problem with acceptance tests (problem with grouping)

334. By Olivier Mattelaer

Add the display options output to the MG5_debug/ME5_debug.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

Very cool with the tags! I really like it. However, it's not obvious that you reach the banner by clicking on "tag_1". Perhaps change the column header to "Banner" (instead of "Tag") would do the trick.

Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :
Download full text (3.2 KiB)

I got the following strange error after interrupting a run with Ctrl-C and then starting a new run:

Command "generate_events run_01" interrupted with error:
IOError : [Errno 2] No such file or directory: '/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_pp_ttbarj/Events/run_01/run_01_tag_1_banner.txt'
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in '/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_pp_ttbarj/run_01_tag_1_debug.log'.
Please attach this file to your report.

#************************************************************
#* MadGraph/MadEvent 5 *
#* *
#* * * *
#* * * * * *
#* * * * * 5 * * * * *
#* * * * * *
#* * * *
#* *
#* *
#* VERSION 1.4.0.beta_9 2011-12-21 *
#* *
#* The MadGraph Development Team - Please visit us at *
#* https://server06.fynu.ucl.ac.be/projects/madgraph *
#* *
#************************************************************
#* *
#* Command File for MadEvent *#* *
#* run as ./bin/madevent.py filename *
#* *
#************************************************************
generate_events run_01
Traceback (most recent call last):
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/madgraph/interface/extended_cmd.py", line 342, in onecmd
    return cmd.Cmd.onecmd(self, line)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/cmd.py", line 219, in onecmd
    return func(arg)
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/madgraph/interface/madevent_interface.py", line 1656, in do_generate_events
    self.set_run_name(args[0], None, 'parton', True)
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/madgraph/interface/madevent_interface.py", line 3031, in set_run_name
    self.banner = banner_mod.recover_banner(self.results, level)
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/madgraph/various/banner.py", line 184, in recover_banner
    banner = Banner(pjoin(path,'Events',run,'%s_%s_banner.txt' % (run, tag)))
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/madgraph/various/banner.py", line 50, in __init__
    self.read_banner(banner_path)
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/madgraph/various/banner.py", line 73, in read_banner
    for line in open(input_path):
IOError: [Errno 2] No such file or directory: '/Users/alwall/MadGraph/upgrade_py...

Read more...

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Update on problem: It still doesn't work even if I do
MGME5>generate_events min_200
Which programs do you want to run?
  0 / auto : running existing card
  1 / parton : Madevent
  2 / pythia : MadEvent + Pythia.
  3 / pgs : MadEvent + Pythia + PGS.
 [0, 1, 2, 3, auto, parton, pythia, pgs][20s to answer]

Will run in mode parton
Do you want to edit one cards (press enter to bypass editing)?
  1 / param : param_card.dat (be carefull about parameter consistency, especially widths)
  2 / run : run_card.dat
  9 / plot : plot_card.dat
  Path to a valid card.
 [0, done, 1, param, 2, run, 9, plot, enter path][30s to answer]

Command "generate_events min_200" interrupted with error:
IOError : [Errno 2] No such file or directory: '/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_pp_ttbarj/Events/run_01/run_01_tag_1_banner.txt'
Please report this bug on https://bugs.launchpad.net/madgraph5
More information is found in '/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm_pp_ttbarj/run_01_tag_1_debug.log'.
Please attach this file to your report.

There is of course no such file run_01_... since there is no such run. I have no idea why it's looking for it. Now there seems to be no way for me to do any run in this directory.

Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello again Olivier,

1. It seems that the issue is that the results.pkl file is not updated if a run is canceled, which creates a lot of trouble. I would suggest to not save a run in this file until it is finished. I don't see that it would have any use until then anyway.

2. Are there some images missing in results.html? There is supposed to be some images http://www.joostdevalk.nl/code/sortable-table/arrownone.gif
which are not shown. I would suggest to use only local images, included in the bzr.
It's very cool that you allow sorting on the different tables. However, I would suggest to have falling direction as default (usually you're interested in the largest cross section/error/etc). See also 3 below.

3. Where is the group summation for the different subprocess group labels in the results.html page? All subprocesses with a given label are supposed to be displayed in one group with the summed cross section, to make it easy to see e.g. the contribution of a given jet multiplicity to the total cross section.

Cheers,
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Next issue: I tried running Pythia on an existing (SM) run, with the following result:
MGME5>pythia run_01
compile directory
Running Pythia
Fail to produce pythia output
MGME5>

It would be nice to get a bit more information about what happened....

Cheers,
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Aha - it seems that there is no pythia_card. So the actual problem is that it didn't ask me about a pythia_card when I ran "pythia".

Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Next minor comment on the crossx.html page: It would be nice if it shows both which run and which tag it is running on at present.

Besides these minor details, the page is really nice, it really looks awesome! Great job on the tags and everything!

335. By Olivier Mattelaer

include Johan's comments

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

Thanks a lot for your updates.

> Very cool with the tags! I really like it. However, it's not obvious
> that you reach the banner by clicking on "tag_1". Perhaps change the
> column header to "Banner" (instead of "Tag") would do the trick.

Ok Done

> 1. It seems that the issue is that the results.pkl file is not
> updated if a run is canceled, which creates a lot of trouble. I
> would suggest to not save a run in this file until it is finished. I
> don't see that it would have any use until then anyway.

I have add a security that if the banner is not present, it re-create
it which is more safe.

> 2. Are there some images missing in results.html? There is supposed
> to be some images http://www.joostdevalk.nl/code/sortable-table/arrownone.gif
> which are not shown. I would suggest to use only local images,
> included in the bzr.
> It's very cool that you allow sorting on the different tables.
> However, I would suggest to have falling direction as default
> (usually you're interested in the largest cross section/error/etc).
> See also 3 below.

Ok I modify the script to always use the html symbol.
and launch the sorting script in order to have it ordered as you like
by default.
Thanks to have force me to do that.

> 3. Where is the group summation for the different subprocess group
> labels in the results.html page? All subprocesses with a given label
> are supposed to be displayed in one group with the summed cross
> section, to make it easy to see e.g. the contribution of a given jet
> multiplicity to the total cross section.

Indeed I forget about this possibility.
This is done

> Next issue: I tried running Pythia on an existing (SM) run, with the
> following result:
> MGME5>pythia run_01
> compile directory
> Running Pythia
> Fail to produce pythia output
> MGME5>
>
> It would be nice to get a bit more information about what happened....

I add the path to the pythia_log file in order to provide more
information

> Aha - it seems that there is no pythia_card. So the actual problem
> is that it didn't ask me about a pythia_card when I ran "pythia".
>
> Johan

Ok solve, thanks this was due to a wrong identation, that was
problematic only if Delphes was not installed.
On my computer the question was present correctly (as we discussed).

> Next minor comment on the crossx.html page: It would be nice if it
> shows both which run and which tag it is running on at present.

Sure off course.

> Besides these minor details, the page is really nice, it really
> looks awesome! Great job on the tags and everything!

Thanks.

Cheers,

Olivier

On 05-janv.-12, at 08:35, Johan Alwall wrote:

> Review: Needs Fixing
>
> Aha - it seems that there is no pythia_card. So the actual problem
> is that it didn't ask me about a pythia_card when I ran "pythia".
>
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Thanks a lot for your prompt fixes! Here is the next little problem:

MGME5>plot delphes
plot for run run_01
Do you want to edit the plot_card.dat? [n, y, enter path][20s to answer]
y
open /Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm4ybm_pp_omega8_lv_wg/Cards/plot_card.dat
No valid files for delphes plot

It's strange, since the delphes plots were created without problems in the actual delphes run.

Also, the questions when I run "delphes" are the old ones ("do you want to edit the delphes_card.dat"/"do you want to edit the delphes_trigger.dat"). Did you mean it that way, or just forgot delphes when changing to the new question format?

Cheers!
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

It seems that at every step there is something...

When I rerun Delphes on an existing Pythia run, all the plots are empty. The reason is that in the new delphes_events.lhco file, the cross section is wrongly given:
gunzip -c Events/run_01/tag_2_delphes_events.lhco.gz |grep "Integrated"
## Integrated weight (pb) : 0
This should have the cross section from the Pythia run - in the previous run, which was done together with Pythia, the number is correct:
> gunzip -c Events/run_01/tag_1_delphes_events.lhco.gz |grep "Integrated"
## Integrated weight (pb) : 0.062633
I would guess this has to do with the tags. Please check that this works also for PGS, which should have the same issue.

Cheers,
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hi again Olivier,

Just one minor point: I still think it's a bit confusing to state a "total" number of jobs when we are not yet at the last subprocess, since this "total" keeps increasing for every new subprocess. I would suggest to instead say "Subproc n/N" in this table cell until we reach the last subproc, when we can use the total number. It's nice that it says which subproc it's on below, but I don't think the connection is quite strong enough.

Thanks,
Johan

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Next slight issue:
When you are running a process, if you click on the cross section number and then again on the cross section number for a subprocess and again for a channel, you reach

"This webpage is not found
No webpage was found for the web address: file://localhost/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm4ybm_pp_omega8j_lv_wg/SubProcesses/P0_qq_omega8_omega8_lvlpi8m_pi8m_wmg/G1/run_01_log.txt"

The run_01_ prefix should not be added until the run is done.

Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Just an esthetical comment: If I open the MadEvent interface and run
> pythia
(without run info), then there is an "error" file created, linked to run_01:

pythia
Traceback (most recent call last):
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm4ybm_pp_omega8j_lv_wg/bin/internal/extended_cmd.py", line 342, in onecmd
    return cmd.Cmd.onecmd(self, line)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/cmd.py", line 219, in onecmd
    return func(arg)
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm4ybm_pp_omega8j_lv_wg/bin/internal/madevent_interface.py", line 2201, in do_pythia
    self.check_pythia(args)
  File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm4ybm_pp_omega8j_lv_wg/bin/internal/madevent_interface.py", line 722, in check_pythia
    raise self.InvalidCmd('No run name currently define. Please add this information.')
InvalidCmd: No run name currently define. Please add this information.

It's a bit funny to link this file to run_01, since there is no problem with run_01. It will now always say "Error" on the crossx.html page related to run_01. The easiest way to solve this is
1. not to connect this error file to run_01,
2. assume that you want to rerun the latest run, so not require a run name
3. simply not generate an error file based on InvalidCommand errors.

I would suggest to do both 2. and 3.

Cheers,
Johan

336. By Olivier Mattelaer

fix plot for pgs in multiple pgs run
fix Gamma5 problem(thanks to Peter Manning)

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

Hi Johan,

> When I rerun Delphes on an existing Pythia run, all the plots are
> empty.

Solved. I knew that problem before but foget to fix it. Thanks.

> MGME5>plot delphes
> plot for run run_01
> Do you want to edit the plot_card.dat? [n, y, enter path][20s to
> answer]
> y
> open /Users/alwall/MadGraph/upgrade_pythia_compatibility/
> PROC_sm4ybm_pp_omega8_lv_wg/Cards/plot_card.dat
> No valid files for delphes plot

Ok solve, I will also add a --tag to this functions.

> Also, the questions when I run "delphes" are the old ones ("do you
> want to edit the delphes_card.dat"/"do you want to edit the
> delphes_trigger.dat"). Did you mean it that way, or just forgot
> delphes when changing to the new question format?

Ok, I was just too lazy to modify it. This is done now (also for PGS,
since this add the possibility to have the edition of the plot_card)

> I still think it's a bit confusing to state a "total" number of jobs
> when we are not yet at the last subprocess, since this "total" keeps
> increasing for every new subprocess. I would suggest to instead say
> "Subproc n/N" in this table cell until we reach the last subproc,
> when we can use the total number. It's nice that it says which
> subproc it's on below, but I don't think the connection is quite
> strong enough.

This will be quite boring to do and very pointless.
If you prefer, we can completely remove the "total" information.
(This didn't provide any information in fact)

> Next slight issue:
> When you are running a process, if you click on the cross section
> number and then again on the cross section number for a subprocess
> and again for a channel, you reach
>
> "This webpage is not found
> No webpage was found for the web address:file://localhost/Users/alwall/MadGraph/upgrade_pythia_compatibility/PROC_sm4ybm_pp_omega8j_lv_wg/SubProcesses/P0_qq_omega8_omega8_lvlpi8m_pi8m_wmg/G1/run_01_log.txt
> "

Ok, a double link solve this in a easy way ;-) (so no need to re-
generate the page)

> It's a bit funny to link this file to run_01, since there is no
> problem with run_01. It will now always say "Error" on the
> crossx.html page related to run_01. The easiest way to solve this is
> 1. not to connect this error file to run_01,
> 2. assume that you want to rerun the latest run, so not require a
> run name
> 3. simply not generate an error file based on InvalidCommand errors.
>
> I would suggest to do both 2. and 3.

The 2 is a good idea.
Not sure that this is possible for refine/.../...
but even if not this should not be a big trouble.

For the point 3. This might be due to the fact that you run in debug
mode where all error write a debug file.
For user this shouldn't happen (I will check it to be sure).

Thanks a lot for those comments,

Olivier

On 09-janv.-12, at 04:19, Johan Alwall wrote:

> Just an esthetical comment: If I open the MadEvent interface and run
>> pythia
> (without run info), then there is an "error" file created, linked to
> run_01:
>
> pythia
> Traceback (most recent call last):
> File "/Users/alwall/MadGraph/upgrade_pythia_compatibility/
> PROC_sm4ybm_pp_omega8j_lv_wg/bin/internal/extended_cmd.py", line
>...

Read more...

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

Are you sure you fixed the Delphes plots? I still get the same questions when I try with the updated madevent_interface.py. Or perhaps I just made some mistake...

Important bug: For some reason, after your modifications to the param_card generation in decay width calculation, the width in the param_card is a factor 2 larger than the actual width calculated by MadGraph. Could you check this? I would guess it should have something to do with the way you are extracting multiple processes. It happens when there is only one process per subprocess directory, I haven't tried with multiple processes.

Thanks,
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hi again,

Now this is really strange: When I run generate_events all the way through Delphes, it suddenly stops after the Pythia run and asks:

Create matching plots for Pythia
Creating Plots for Pythia level
End Plots for Pythia level
finish
No pgs_card detected, so not run pgs
prepare delphes run
Do you want to edit the delphes_card.dat? [n, y, enter path][20s to answer]

use n
Do you want to edit the trigger_card.dat? [n, y, enter path][20s to answer]

So it seems that something is not working right with your latest modification.

Johan

review: Needs Fixing
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

> Are you sure you fixed the Delphes plots? I still get the same
> questions when I try with the updated madevent_interface.py. Or
> perhaps I just made some mistake...

I didn't push it, so it's normal that you don't have the new question
yet.
But the other problem with the question, is in fact independent of the
last modif. Thanks to have point it.

> Important bug: For some reason, after your modifications to the
> param_card generation in decay width calculation, the width in the
> param_card is a factor 2 larger than the actual width calculated by
> MadGraph. Could you check this? I would guess it should have
> something to do with the way you are extracting multiple processes.
> It happens when there is only one process per subprocess directory,
> I haven't tried with multiple processes.

Good point, we will need to add a test on this...
Will do it.

Cheers,

Olivier

On 10-janv.-12, at 04:50, Johan Alwall wrote:

> Review: Needs Fixing
>
> Hello Olivier,
>
> Are you sure you fixed the Delphes plots? I still get the same
> questions when I try with the updated madevent_interface.py. Or
> perhaps I just made some mistake...
>
> Important bug: For some reason, after your modifications to the
> param_card generation in decay width calculation, the width in the
> param_card is a factor 2 larger than the actual width calculated by
> MadGraph. Could you check this? I would guess it should have
> something to do with the way you are extracting multiple processes.
> It happens when there is only one process per subprocess directory,
> I haven't tried with multiple processes.
>
> Thanks,
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

337. By Olivier Mattelaer

fix the widths problem.
change the syntax to remove the run_name in advanced case and to allow to not put it for pythia/pgs/delphes
change delphes+pgs question
...

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

According to your previous suggestions
I performed the following modifications

1) For command pythia/pgs/delphes the run_name are not required and
take the last run
On exception: if the lastrun is removed...
2) the optional argument run_name for refine/combine_events/
store_events/create_gridpack
is not allowed anymore.
3) the pgs/delphes question don't re-appear in a generate_events/
pythia run.
4) for the pgs/delphes command, the unzipping of the pythia files
occur in the same time (so in another thread)
that the asking of the question for the edition (and also the edition).
5) correct a problem in the command
launch PROC_XXX
(before it crashes since he didn't have the information if it was a
cross-section or a width computation)
6) remove the TOTAL information.
7) correct the problem for the width.
8) add a acceptance test for the width computations.

Cheers,

Olivier

On 10-janv.-12, at 10:37, Olivier Mattelaer wrote:

> Hi Johan,
>
>> Are you sure you fixed the Delphes plots? I still get the same
>> questions when I try with the updated madevent_interface.py. Or
>> perhaps I just made some mistake...
>
> I didn't push it, so it's normal that you don't have the new question
> yet.
> But the other problem with the question, is in fact independent of the
> last modif. Thanks to have point it.
>
>> Important bug: For some reason, after your modifications to the
>> param_card generation in decay width calculation, the width in the
>> param_card is a factor 2 larger than the actual width calculated by
>> MadGraph. Could you check this? I would guess it should have
>> something to do with the way you are extracting multiple processes.
>> It happens when there is only one process per subprocess directory,
>> I haven't tried with multiple processes.
>
> Good point, we will need to add a test on this...
> Will do it.
>
> Cheers,
>
> Olivier
>
> On 10-janv.-12, at 04:50, Johan Alwall wrote:
>
>> Review: Needs Fixing
>>
>> Hello Olivier,
>>
>> Are you sure you fixed the Delphes plots? I still get the same
>> questions when I try with the updated madevent_interface.py. Or
>> perhaps I just made some mistake...
>>
>> Important bug: For some reason, after your modifications to the
>> param_card generation in decay width calculation, the width in the
>> param_card is a factor 2 larger than the actual width calculated by
>> MadGraph. Could you check this? I would guess it should have
>> something to do with the way you are extracting multiple processes.
>> It happens when there is only one process per subprocess directory,
>> I haven't tried with multiple processes.
>>
>> Thanks,
>> Johan
>> --
>> https://code.launchpad.net/~maddevelopers/madgraph5/
>> upgrade_pythia_compatibility/+merge/75106
>> You proposed lp:~maddevelopers/madgraph5/
>> upgrade_pythia_compatibility for merging.
>
>
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

338. By Olivier Mattelaer

Check the 3/3bar coherence at the import model stage
use that information to fix the Identity -> T object
improve display interactions with particle filter
fix problem in the ordering of the cross-section
improve display style of html page.

339. By Olivier Mattelaer

improve autocompletion (especially the - problem)
improve SGE cluster

340. By Olivier Mattelaer

put correct version number/Update note

341. By Olivier Mattelaer

allow both -modelname and --modelname for the import command

342. By Olivier Mattelaer

improve the creation of the gridpack (change store routine)

343. By Olivier Mattelaer

tentive try to have a gridpack version working
improve autocompletion, by activating the correct autocompletion after the ';'

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

Did you test the gridpacks at all? I generated a gridpack, and when I try running it (with ./run.sh), I immediately got the following error:

Johan-Alwalls-MacBook-Air:gridpack_test alwall$ ./run.sh 10000 1 1000
Updating grid_card.dat...
Now generating 10000 events with random seed 1 and granularity 1000
Traceback (most recent call last):
  File "./bin/gridrun", line 51, in <module>
    (not os.path.exists(os.path.join(root_path,'../..', 'bin','create_release.py')) or options.web):
AttributeError: Values instance has no attribute 'web'

After removing the options.web part, it still doesn't work at all. In fact, I don't even see the necessary files (in particular the results.dat files and the grid files in the G* directories). So I think it's not just the gridrun that doesn't work, but even the gridpack generation doesn't seem to work properly.

review: Needs Fixing
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Seems that a push was not done with the working version.

Sorry for that.

Cheers,

Olivier

On 29-janv.-12, at 03:37, Johan Alwall wrote:

> Review: Needs Fixing
>
> Hello Olivier,
>
> Did you test the gridpacks at all? I generated a gridpack, and when
> I try running it (with ./run.sh), I immediately got the following
> error:
>
> Johan-Alwalls-MacBook-Air:gridpack_test alwall$ ./run.sh 10000 1 1000
> Updating grid_card.dat...
> Now generating 10000 events with random seed 1 and granularity 1000
> Traceback (most recent call last):
> File "./bin/gridrun", line 51, in <module>
> (not os.path.exists(os.path.join(root_path,'../..',
> 'bin','create_release.py')) or options.web):
> AttributeError: Values instance has no attribute 'web'
>
> After removing the options.web part, it still doesn't work at all.
> In fact, I don't even see the necessary files (in particular the
> results.dat files and the grid files in the G* directories). So I
> think it's not just the gridrun that doesn't work, but even the
> gridpack generation doesn't seem to work properly.
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

So you have a fully working version, where you tested both gridpack generation and running the gridpack? Please push asap, since I've already started fixing it based on this version...

Thanks,
Johan

344. By Olivier Mattelaer

improve auto-completion (adding spaces if this is the only solutions)

345. By Olivier Mattelaer

some progress on gridpack (not fully working yet)
improve auto-completion

346. By Olivier Mattelaer

gridpack working

347. By Olivier Mattelaer

merge with the web (don't ask me why)

348. By Olivier Mattelaer

small improvment for display + for false import

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Ok I pushed it (I didn't do it this morning since It was needed to
remove some modifictions).

But by testing it, it seems that they are problem when I launch
multiple times, the gridpack.
So this version needs to be deeply cross-checked.

Cheers,

Olivier
On 29-janv.-12, at 09:59, Johan Alwall wrote:

> So you have a fully working version, where you tested both gridpack
> generation and running the gridpack? Please push asap, since I've
> already started fixing it based on this version...
>
> Thanks,
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Does cluster running work? I'm trying to run in ingrid and it seems that the jobs are never run on the cluster:

generate_events -f warmup-new --clusterESC[0m
Will run in mode partonESC[0m
Generating gridpack with run name warmup-newESC[0m
survey warmup-new --accuracy=0.01 --points=2000 --iterations=8 --gridpack=.true.ESC[0m
compile directoryESC[0m
Running SurveyESC[0m
Creating JobsESC[0m
Working on SubProcessesESC[0m
    P1_gq_lvlq ESC[0m
    P2_qq_lvlgg ESC[0m
    P2_gg_lvlqq ESC[0m
    P2_gq_lvlgq ESC[0m
    P0_qq_lvl ESC[0m
    P3_gq_lvlqqq ESC[0m
    P3_gq_lvlggq ESC[0m
    P3_qq_lvlggg ESC[0m
    P1_qq_lvlg ESC[0m
    P2_qq_lvlqq ESC[0m
    P3_qq_lvlgqq ESC[0m
    P3_gg_lvlgqq ESC[0m
INFO: All jobs finished ESC[0m
quitESC[0m
ESC[0m

with the error log
generate_events -f warmup-new --cluster
Traceback (most recent call last):
  File "/nfs/scratch/fynu/alwall/fix_new_gridpack/PROC_gridpack/bin/internal/extended_cmd.py", line 405, in onecmd
    return cmd.Cmd.onecmd(self, line)
  File "/nfs/soft/python/python2.7-slc5_amd64_gcc34/lib/python2.7/cmd.py", line 219, in onecmd
    return func(arg)
  File "/nfs/scratch/fynu/alwall/fix_new_gridpack/PROC_gridpack/bin/internal/madevent_interface.py", line 1694, in do_generate_events
    postcmd=False)
  File "/nfs/scratch/fynu/alwall/fix_new_gridpack/PROC_gridpack/bin/internal/extended_cmd.py", line 443, in exec_cmd
    stop = cmd.Cmd.onecmd(current_interface, line)
  File "/nfs/soft/python/python2.7-slc5_amd64_gcc34/lib/python2.7/cmd.py", line 219, in onecmd
    return func(arg)
  File "/nfs/scratch/fynu/alwall/fix_new_gridpack/PROC_gridpack/bin/internal/madevent_interface.py", line 1974, in do_survey
    self.monitor(run_type='All jobs submitted for survey')
  File "/nfs/scratch/fynu/alwall/fix_new_gridpack/PROC_gridpack/bin/internal/madevent_interface.py", line 2924, in monitor
    cross, error = sum_html.make_all_html_results(self)
  File "/nfs/scratch/fynu/alwall/fix_new_gridpack/PROC_gridpack/bin/internal/sum_html.py", line 301, in make_all_html_results
    P_comb.add_results(name, pjoin(P_path,name,'results.dat'), mfactor)
  File "/nfs/scratch/fynu/alwall/fix_new_gridpack/PROC_gridpack/bin/internal/sum_html.py", line 107, in add_results
    oneresult.read_results(filepath)
  File "/nfs/scratch/fynu/alwall/fix_new_gridpack/PROC_gridpack/bin/internal/sum_html.py", line 48, in read_results
    for line in open(filepath):
IOError: [Errno 2] No such file or directory: '/nfs/scratch/fynu/alwall/fix_new_gridpack/PROC_gridpack/SubProcesses/P3_gg_lvlgqq/G1/results.dat'

Clearly, no jobs are being run. It's also weird that the order of the subprocesses seem completely random. I had consciously sorted the subprocesses in the subproc.mg file so that the heaviest subprocesses are run first, so if some jobs take a very long time to finish, they are the first to be started, so they have more time while the other jobs are finishing. But here, the order is completely scrambled.

Any ideas?
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

(Just to clarify: The example above was for gridpack, but the same thing happens in regular run mode: The cluster run finishes immediately claiming that all jobs have been run. With v. 1.3.xx, it works fine on the same computer, so it's not because it can't access the cluster or anything like that.)

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hi again Olivier,

I have fixed the gridpacks so they work perfectly now. The only things that remain are relating to the cross section web page. In the store4grid script, I already copy the results.html pages, but I don't know how to get the default run into the database and make sure the right crossx.html is available in the gridpack? This is quite useful to cross check the cross sections for the different subprocesses.

Many thanks,
Johan

review: Needs Fixing
349. By Olivier Mattelaer

- ensure that RunWeb is removed in case of gridpack run.
- correct a bug in the tag name automatic assignment in case
  of long chain with multiple call to pythia/pgs.
- remove a bug in the removal of events.lhe.gz when already present.

350. By Olivier Mattelaer

adding crossxhtml to gridrun

351. By Olivier Mattelaer

add action both for online and standard mode.
(use an alert in standard mode)

352. By Olivier Mattelaer

simplify treatment of tag in aloha

353. By Olivier Mattelaer

merge with trunk

354. By Olivier Mattelaer

merge with Johan modifications

355. By Olivier Mattelaer

fix a stupid bug

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

I just merge your modification (tanks for those)
with the modification that I code yesterday.
This include the creation of crossx.html for the gridpack.
This include command web, improvment in aloha, ...

Diogo points to me a problem to multi_run that I also fixed.

I will push this version on cp3wks05 in order to see if everything is working.
I propose to put this version as the official public one at the end of the week.
Do you aggree with that?

Cheers,

Olivier

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

Excellent. Did you also fix the cluster run, or did I do something wrong when I used it on ingrid?

Thanks,
Johan

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

No didn't fix this yet.

I'm currently checking/fixing the web interface on cp3wks05,
and the next step is to check the cluster run with condor.
a priori, this should be a small (but critical) problem.

Cheers,

Olivier

On Feb 1, 2012, at 4:45 PM, Johan Alwall wrote:

> Hello Olivier,
>
> Excellent. Did you also fix the cluster run, or did I do something
> wrong when I used it on ingrid?
>
> Thanks,
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

356. By Olivier Mattelaer

modification for cp3wks05 and for condor cluster

357. By Olivier Mattelaer

working version both on cp3wks05 (pbs) and ingrid-ui1 (condor)

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Ok this is fixed now.
I've just run w+ JJJ on the cluster.
and now testing W+ j j j j to check that everything is ok.

Note that you need to specify in the files input/mg5_configuration.txt
which cluster to use.
This means that for ingrid-ui1, you need to specify condor.
I've put pbs as the default one (for legacy reason) but I'm fine to
put condor if you prefer.

So now I'm waiting your approval before putting this version as the
official one.

Cheers,

Olivier

On 01-févr.-12, at 16:58, Olivier Mattelaer wrote:

> No didn't fix this yet.
>
> I'm currently checking/fixing the web interface on cp3wks05,
> and the next step is to check the cluster run with condor.
> a priori, this should be a small (but critical) problem.
>
> Cheers,
>
> Olivier
>
>
>
>
> On Feb 1, 2012, at 4:45 PM, Johan Alwall wrote:
>
>> Hello Olivier,
>>
>> Excellent. Did you also fix the cluster run, or did I do something
>> wrong when I used it on ingrid?
>>
>> Thanks,
>> Johan
>> --
>> https://code.launchpad.net/~maddevelopers/madgraph5/
>> upgrade_pythia_compatibility/+merge/75106
>> You proposed lp:~maddevelopers/madgraph5/
>> upgrade_pythia_compatibility for merging.
>
>
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

> Ok this is fixed now.

Excellent. If it works for one process, it should work for all.

> Note that you need to specify in the files input/mg5_configuration.txt
> which cluster to use.
> This means that for ingrid-ui1, you need to specify condor.
> I've put pbs as the default one (for legacy reason) but I'm fine to
> put condor if you prefer.

I thought the condor was modified to understand PBS submits? Anyway, the best is of course if we have a default that works on both the UIUC and UCL clusters. No reason to keep backward compatibility for legacy reasons.

> So now I'm waiting your approval before putting this version as the
> official one.

I'm merging the fix_new_gridpack branch now, and I'll test on both UIUC and ingrid clusters.

358. By Johan Alwall

Merged with fix_new_gridpack branch: Reworked the gridpacks so that 1) the granularity is set to 1, 2) channels can run down to a single iteration during the gridrun. This removes the problem with huge variance for granularity channels while actually further reducing the gridpack run time.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

As usual when I do something I immediately have some questions:
1) When I do set cluster_type <tab> it should show the available cluster types, right? Now it shows the files in the present directory.
2) I set the cluster type in the mg5 interface before doing "output", and I would expect the options in my run directory to be those of the mg5 interface when I do output, but it is not.
3) Is there a way to save the present options to the configuration file (e.g., "save options")? That would be very nice and intuitive, so the user doesn't need to look for the config file.
4) If the wrong cluster type is set, shouldn't there be an appropriate error, instead of "IOError : [Errno 2] No such file or directory: '/nfs/scratch/fynu/alwall/upgrade_pythia_compatibility/PROC_sm_0/SubProcesses/P0_qq_wp/G1/results.dat'"?
5) I would have expected that there should be an "input" directory with the configuration file in a process directory just as there is for MadGraph, but it's not there. Instead the configuration file is in bin/internal, which is not particularly intuitive.
6) After changing the cluster type to condor, I run and get the next error:

Working on SubProcesses
    P0_qq_wp
Command "generate_events -f test --cluster" interrupted with error:
IOError : [Errno 13] Permission denied: '/tmp/submit_condor'

Checking why, I do
<email address hidden>:~/scratch/upgrade_pythia_compatibility/PROC_sm_0> ls -l /tmp/submit_condor
-rw-r--r-- 1 omatt grpfynu 531 Feb 2 23:57 /tmp/submit_condor

So this doesn't seem like such a great solution, and I also see no point to use /tmp/ for such a small file. Why not use a "submit_condor" file in the run directory, where you are sure to have permission? You can remove it again immediately after submit, if you like.

7) At the end of the run log, the following lines appear:
Combining Events
cat: events.lhe: No such file or directory
cat: unweighted_events.lhe: No such file or directory
store_events
Storing parton level results
End Parton
quit
Where do the "cat" failures come from? Should I worry?

8) Just to check - if I launch a run from the mg5 interface (without setting any options earlier in the open session), the madevent configuration is read from the process, not from the MG5 configuration, right? The behavior when I do "launch" should obviously be identical to the behavior if I run the madevent interface inside the process directory.

Apart from these details, everything seems to work marvelously! :-)

Cheers,
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Sorry, one more error when I tried running on UIUC:

import model sm
generate p p > w+
output
set cluster_type condor
launch
Traceback (most recent call last):
  File "/home/madgraph/upgrade_pythia_compatibility/madgraph/interface/extended_cmd.py", line 405, in onecmd
    return cmd.Cmd.onecmd(self, line)
  File "/usr/local/lib/python2.6/cmd.py", line 219, in onecmd
    return func(arg)
  File "/home/madgraph/upgrade_pythia_compatibility/madgraph/interface/cmd_interface.py", line 2835, in do_launch
    ext_program.run()
  File "/home/madgraph/upgrade_pythia_compatibility/madgraph/interface/launch_ext_program.py", line 64, in run
    self.launch_program()
  File "/home/madgraph/upgrade_pythia_compatibility/madgraph/interface/launch_ext_program.py", line 206, in launch_program
    usecmd = ME.MadEventCmdShell(me_dir=self.running_dir)
  File "/home/madgraph/upgrade_pythia_compatibility/madgraph/interface/madevent_interface.py", line 1347, in __init__
    self.set_configuration()
  File "/home/madgraph/upgrade_pythia_compatibility/madgraph/interface/madevent_interface.py", line 1446, in set_configuration
    config_file = open(os.path.join(os.environ['MADGRAPH_BASE'],'mg5_configuration.txt'))
IOError: [Errno 2] No such file or directory: '/home/madgraph/mg5_configuration.txt'
Value of current Options:
              web_browser : None
              text_editor : None
          pythia-pgs_path : ./pythia-pgs
                  td_path : ./td
            cluster_queue : madgraph
             cluster_type : condor
         madanalysis_path : ./MadAnalysis
             delphes_path : ./Delphes
         fortran_compiler : None
                  nb_core : None
      exrootanalysis_path : ./ExRootAnalysis
               eps_viewer : None
   automatic_html_opening : True
             pythia8_path : None
                 run_mode : 0

You need to add "and os.path.exists(...)" to the line.

Cheers,
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Finally - indeed it is condor on both clusters. So this should clearly be the default cluster_type.

Thanks!
Johan

review: Needs Fixing
Revision history for this message
Johan Alwall (johan-alwall) wrote :

Just one more comment - how about having a question to the user when you quit the interface, if you want to save the present options (listing the options that changed)? Somehow, I feel that it would be natural to assume that if an option is changed, the user probably always wants it that way, but just saving without a question might be too rough. What do you think?

Johan

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

Hi Johan,

> 1) When I do set cluster_type <tab> it should show the available
> cluster types, right? Now it shows the files in the present directory.

I was looking at this possibility to use set for the info in the
mg5_configuration more like a way for us to test things more than a
true production options.
But ok let put this at full power.

> 2) I set the cluster type in the mg5 interface before doing
> "output", and I would expect the options in my run directory to be
> those of the mg5 interface when I do output, but it is not.

same comment.

> 3) Is there a way to save the present options to the configuration
> file (e.g., "save options")? That would be very nice and intuitive,
> so the user doesn't need to look for the config file.

ok fixing the point 2, is mainly doing this anyway.
But concerning your point to ask user at the end of the run, I would
rather suggest it to use this commands after a set command.
What do you think?

> 4) If the wrong cluster type is set, shouldn't there be an
> appropriate error, instead of "IOError : [Errno 2] No such file or
> directory: '/nfs/scratch/fynu/alwall/upgrade_pythia_compatibility/
> PROC_sm_0/SubProcesses/P0_qq_wp/G1/results.dat'"?

not trivial since qsub is define on both cluster...
I'm not even sure that the job are not submitted, and that the problem
is in the qstat command.
Clearly here, our cluster are a bit special.

> 5) I would have expected that there should be an "input" directory
> with the configuration file in a process directory just as there is
> for MadGraph, but it's not there. Instead the configuration file is
> in bin/internal, which is not particularly intuitive.

Shouldn't be better to put it in the main directory or under Cards?

> 6) After changing the cluster type to condor, I run and get the next
> error:
>
> Working on SubProcesses
> P0_qq_wp
> Command "generate_events -f test --cluster" interrupted with error:
> IOError : [Errno 13] Permission denied: '/tmp/submit_condor'
>
> Checking why, I do
> <email address hidden>:~/scratch/
> upgrade_pythia_compatibility/PROC_sm_0> ls -l /tmp/submit_condor
> -rw-r--r-- 1 omatt grpfynu 531 Feb 2 23:57 /tmp/submit_condor
>
> So this doesn't seem like such a great solution, and I also see no
> point to use /tmp/ for such a small file. Why not use a
> "submit_condor" file in the run directory, where you are sure to
> have permission? You can remove it again immediately after submit,
> if you like.

yes sure.

> 7) At the end of the run log, the following lines appear:
> Combining Events
> cat: events.lhe: No such file or directory
> cat: unweighted_events.lhe: No such file or directory
> store_events
> Storing parton level results
> End Parton
> quit
> Where do the "cat" failures come from? Should I worry?

will check

> 8) Just to check - if I launch a run from the mg5 interface (without
> setting any options earlier in the open session), the madevent
> configuration is read from the process, not from the MG5
> configuration, right? The behavior when I do "launch" should
> obviously be identical to the behavior if I run the madevent
> interface inside the process ...

Read more...

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello again Olivier,

It seems that the cluster run doesn't work on UIUC, the jobs are put in queue but never executed. This problem is not there for the regular version (1.3.xx). Could you take a look? I have installed it in the upgrade_pythia_compatibility directory.

Thanks,
Johan

review: Needs Fixing
359. By mattelaer-olivier

improve configuration file treatment (autocompletion for set / save options/ ...)

360. By mattelaer-olivier

return a better error if the cluster is wrongly define

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

I've mainly fix all your point.

Two annoying point are remaining:

1) the error with the cat,
This one is Extremelly annoying since this is due to the fact that
they are no events in
G directory.
This happens only on condor cluster...
so this is very weird.
to be precise this happens only if the run_combine is done on one
node and not on the main computer...

2) the problem of UIUC cluster. (Don't have look to it yet...)

Cheers,

Olivier

On Feb 3, 2012, at 7:40 AM, Johan Alwall wrote:

> Review: Needs Fixing
>
> Hello again Olivier,
>
> It seems that the cluster run doesn't work on UIUC, the jobs are put
> in queue but never executed. This problem is not there for the
> regular version (1.3.xx). Could you take a look? I have installed it
> in the upgrade_pythia_compatibility directory.
>
> Thanks,
> Johan
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

361. By mattelaer-olivier

fix to solve UIUC and ingrid trouble.

362. By mattelaer-olivier

fix the cluster (try #2)

363. By mattelaer-olivier

final fix for the UIUC problem.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Johan,

both problem are fixed.

on UIUC the problem was that they don't have a specific queue define
for the madgrqph job on the opposite
of the UCL one.

Cheers,

Olivier

On Feb 3, 2012, at 5:22 PM, Olivier Mattelaer wrote:

> Hi Johan,
>
> I've mainly fix all your point.
>
> Two annoying point are remaining:
>
> 1) the error with the cat,
> This one is Extremelly annoying since this is due to the fact that
> they are no events in
> G directory.
> This happens only on condor cluster...
> so this is very weird.
> to be precise this happens only if the run_combine is done on one
> node and not on the main computer...
>
> 2) the problem of UIUC cluster. (Don't have look to it yet...)
>
> Cheers,
>
> Olivier
>
>
>
> On Feb 3, 2012, at 7:40 AM, Johan Alwall wrote:
>
>> Review: Needs Fixing
>>
>> Hello again Olivier,
>>
>> It seems that the cluster run doesn't work on UIUC, the jobs are put
>> in queue but never executed. This problem is not there for the
>> regular version (1.3.xx). Could you take a look? I have installed it
>> in the upgrade_pythia_compatibility directory.
>>
>> Thanks,
>> Johan
>> --
>> https://code.launchpad.net/~maddevelopers/madgraph5/
>> upgrade_pythia_compatibility/+merge/75106
>> You proposed lp:~maddevelopers/madgraph5/
>> upgrade_pythia_compatibility for merging.
>
>
> --
> https://code.launchpad.net/~maddevelopers/madgraph5/
> upgrade_pythia_compatibility/+merge/75106
> You proposed lp:~maddevelopers/madgraph5/
> upgrade_pythia_compatibility for merging.

Revision history for this message
Johan Alwall (johan-alwall) wrote :

Hello Olivier,

Since you have fixed the remaining problems, I approve. Many thanks for this incredible work. It is a really great user experience while very powerful at the same time. Awesome!

Johan

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed symlink 'AUTHORS'
2=== target was 'madgraph/AUTHORS'
3=== modified file 'Template/Cards/run_card.dat'
4--- Template/Cards/run_card.dat 2011-11-05 03:47:52 +0000
5+++ Template/Cards/run_card.dat 2012-02-04 00:00:36 +0000
6@@ -20,7 +20,7 @@
7 #*********************************************************************
8 # Tag name for the run (one word) *
9 #*********************************************************************
10- 'fermi' = run_tag ! name of the run
11+ tag_1 = run_tag ! name of the run
12 #*********************************************************************
13 # Run to generate the grid pack *
14 #*********************************************************************
15@@ -29,7 +29,7 @@
16 # Number of events and rnd seed *
17 # Warning: Do not generate more than 100K event in a single run *
18 #*********************************************************************
19- 10000 = nevents ! Number of unweighted events requested
20+ 10000 = nevents ! Number of unweighted events requested
21 0 = iseed ! rnd seed (0=assigned automatically=default))
22 #*********************************************************************
23 # Collider type and energy *
24
25=== added file 'Template/HTML/crossx.html'
26=== added file 'Template/HTML/mgstyle.css'
27--- Template/HTML/mgstyle.css 1970-01-01 00:00:00 +0000
28+++ Template/HTML/mgstyle.css 2012-02-04 00:00:36 +0000
29@@ -0,0 +1,26 @@
30+th a:link{
31+ color:black;
32+}
33+
34+table {
35+ border-width: 1px;
36+ border-spacing: 0px;
37+ border-style: outset;
38+ border-color: black;
39+ border-collapse: collapse;
40+ background-color: white;
41+}
42+table th {
43+ border-width: 2px;
44+ padding: 1px;
45+ border-style: solid;
46+ border-color: black;
47+ background-color: white;
48+}
49+
50+table td {
51+ border-width: 2px;
52+ padding: 1px;
53+ border-style: solid;
54+ border-color: black;
55+}
56
57=== added file 'Template/HTML/sortable.js'
58--- Template/HTML/sortable.js 1970-01-01 00:00:00 +0000
59+++ Template/HTML/sortable.js 2012-02-04 00:00:36 +0000
60@@ -0,0 +1,335 @@
61+/*
62+Table sorting script by Joost de Valk, check it out at http://www.joostdevalk.nl/code/sortable-table/.
63+Based on a script from http://www.kryogenix.org/code/browser/sorttable/.
64+Distributed under the MIT license: http://www.kryogenix.org/code/browser/licence.html .
65+Modify by the MG team for compatibility issue
66+
67+Copyright (c) 1997-2007 Stuart Langridge, Joost de Valk.
68+
69+Version 1.5.7
70+*/
71+
72+/* You can change these values */
73+var europeandate = true;
74+var alternate_row_colors = true;
75+
76+/* Don't change anything below this unless you know what you're doing */
77+addEvent(window, "load", sortables_init);
78+
79+var SORT_COLUMN_INDEX;
80+var thead = false;
81+
82+function sortables_init() {
83+ // Find all tables with class sortable and make them sortable
84+ if (!document.getElementsByTagName) return;
85+ tbls = document.getElementsByTagName("table");
86+ for (ti=0;ti<tbls.length;ti++) {
87+ thisTbl = tbls[ti];
88+ if (((' '+thisTbl.className+' ').indexOf("sortable") != -1) && (thisTbl.id)) {
89+ ts_makeSortable(thisTbl);
90+ // make it sortable according to the second column
91+ if (thisTbl.tHead && thisTbl.tHead.rows.length > 0) {
92+ var firstRow = thisTbl.tHead.rows[thisTbl.tHead.rows.length-1];
93+ } else {
94+ var firstRow = thisTbl.rows[0];
95+ }
96+
97+ for (var ci=0;ci<firstRow.cells[1].childNodes.length;ci++) {
98+ if (firstRow.cells[1].childNodes[ci].tagName && firstRow.cells[1].childNodes[ci].tagName.toLowerCase() == 'a') var lnk = firstRow.cells[1].childNodes[ci];
99+ }
100+ ts_resortTable(lnk, 1); //order by cross-section
101+ ts_resortTable(lnk, 1); //order by cross-section
102+ }
103+ }
104+}
105+
106+function ts_makeSortable(t) {
107+ if (t.rows && t.rows.length > 0) {
108+ if (t.tHead && t.tHead.rows.length > 0) {
109+ var firstRow = t.tHead.rows[t.tHead.rows.length-1];
110+ thead = true;
111+ } else {
112+ var firstRow = t.rows[0];
113+ }
114+ }
115+ if (!firstRow) return;
116+
117+ // We have a first row: assume it's the header, and make its contents clickable links
118+ for (var i=0;i<firstRow.cells.length;i++) {
119+ var cell = firstRow.cells[i];
120+ var txt = ts_getInnerText(cell);
121+ if (cell.className != "unsortable" && cell.className.indexOf("unsortable") == -1) {
122+ cell.innerHTML = '<a href="#" class="sortheader" onclick="ts_resortTable(this, '+i+');return false;">'+txt+'<span class="sortarrow"></span></a>';
123+ }
124+ }
125+ if (alternate_row_colors) {
126+ alternate(t);
127+ }
128+}
129+
130+function ts_getInnerText(el) {
131+ if (typeof el == "string") return el;
132+ if (typeof el == "undefined") { return el };
133+ if (el.innerText) return el.innerText; //Not needed but it is faster
134+ var str = "";
135+
136+ var cs = el.childNodes;
137+ var l = cs.length;
138+ for (var i = 0; i < l; i++) {
139+ switch (cs[i].nodeType) {
140+ case 1: //ELEMENT_NODE
141+ str += ts_getInnerText(cs[i]);
142+ break;
143+ case 3: //TEXT_NODE
144+ str += cs[i].nodeValue;
145+ break;
146+ }
147+ }
148+ return str;
149+}
150+
151+function ts_resortTable(lnk, clid) {
152+ var span;
153+ for (var ci=0;ci<lnk.childNodes.length;ci++) {
154+ if (lnk.childNodes[ci].tagName && lnk.childNodes[ci].tagName.toLowerCase() == 'span') span = lnk.childNodes[ci];
155+ }
156+ var spantext = ts_getInnerText(span);
157+ var td = lnk.parentNode;
158+ var column = clid || td.cellIndex;
159+ var t = getParent(td,'TABLE');
160+ // Work out a type for the column
161+ if (t.rows.length <= 1) return;
162+ var itm = "";
163+ var i = 1;
164+ while (itm == "" && i < t.tBodies[0].rows.length) {
165+ var itm = ts_getInnerText(t.tBodies[0].rows[i].cells[column]);
166+ itm = trim(itm);
167+ if (itm.substr(0,4) == "<!--" || itm.length == 0) {
168+ itm = "";
169+ }
170+ i++;
171+ }
172+ if (itm == "") return;
173+ sortfn = ts_sort_caseinsensitive;
174+ if (itm.match(/^\d\d[\/\.-][a-zA-z][a-zA-Z][a-zA-Z][\/\.-]\d\d\d\d$/)) sortfn = ts_sort_date;
175+ if (itm.match(/^\d\d[\/\.-]\d\d[\/\.-]\d\d\d{2}?$/)) sortfn = ts_sort_date;
176+ if (itm.match(/^-?[£$€Û¢´]\d/)) sortfn = ts_sort_numeric;
177+ if (itm.match(/^-?(\d+[,\.]?)+(E[-+][\d]+)?%?$/)) sortfn = ts_sort_numeric;
178+ if (itm.match(/^-?(\d+[,\.]?\d+e[-+][\d]+)?%?$/)) sortfn = ts_sort_numeric;
179+ if (itm.match(/^-?(\d+[,\.]?)+([\d]+)?%?$/)) sortfn = ts_sort_numeric;
180+ SORT_COLUMN_INDEX = column;
181+ var firstRow = new Array();
182+ var newRows = new Array();
183+ for (k=0;k<t.tBodies.length;k++) {
184+ for (i=0;i<t.tBodies[k].rows[0].length;i++) {
185+ firstRow[i] = t.tBodies[k].rows[0][i];
186+ }
187+ }
188+ for (k=0;k<t.tBodies.length;k++) {
189+ if (!thead) {
190+ // Skip the first row
191+ for (j=1;j<t.tBodies[k].rows.length;j++) {
192+ newRows[j-1] = t.tBodies[k].rows[j];
193+ }
194+ } else {
195+ // Do NOT skip the first row
196+ for (j=0;j<t.tBodies[k].rows.length;j++) {
197+ newRows[j] = t.tBodies[k].rows[j];
198+ }
199+ }
200+ }
201+ newRows.sort(sortfn);
202+ if (span.getAttribute("sortdir") == 'down') {
203+ ARROW = '&nbsp;&nbsp;&darr;';
204+ newRows.reverse();
205+ span.setAttribute('sortdir','up');
206+ } else {
207+ ARROW = '&nbsp;&nbsp;&uarr;';
208+ span.setAttribute('sortdir','down');
209+ }
210+ // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones
211+ // don't do sortbottom rows
212+ for (i=0; i<newRows.length; i++) {
213+ if (!newRows[i].className || (newRows[i].className && (newRows[i].className.indexOf('sortbottom') == -1))) {
214+ t.tBodies[0].appendChild(newRows[i]);
215+ }
216+ }
217+ // do sortbottom rows only
218+ for (i=0; i<newRows.length; i++) {
219+ if (newRows[i].className && (newRows[i].className.indexOf('sortbottom') != -1))
220+ t.tBodies[0].appendChild(newRows[i]);
221+ }
222+ // Delete any other arrows there may be showing
223+ var allspans = document.getElementsByTagName("span");
224+ for (var ci=0;ci<allspans.length;ci++) {
225+ if (allspans[ci].className == 'sortarrow') {
226+ if (getParent(allspans[ci],"table") == getParent(lnk,"table")) { // in the same table as us?
227+ allspans[ci].innerHTML = '';
228+ }
229+ }
230+ }
231+ span.innerHTML = ARROW;
232+ alternate(t);
233+}
234+
235+function getParent(el, pTagName) {
236+ if (el == null) {
237+ return null;
238+ } else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) {
239+ return el;
240+ } else {
241+ return getParent(el.parentNode, pTagName);
242+ }
243+}
244+
245+function sort_date(date) {
246+ // y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX
247+ dt = "00000000";
248+ if (date.length == 11) {
249+ mtstr = date.substr(3,3);
250+ mtstr = mtstr.toLowerCase();
251+ switch(mtstr) {
252+ case "jan": var mt = "01"; break;
253+ case "feb": var mt = "02"; break;
254+ case "mar": var mt = "03"; break;
255+ case "apr": var mt = "04"; break;
256+ case "may": var mt = "05"; break;
257+ case "jun": var mt = "06"; break;
258+ case "jul": var mt = "07"; break;
259+ case "aug": var mt = "08"; break;
260+ case "sep": var mt = "09"; break;
261+ case "oct": var mt = "10"; break;
262+ case "nov": var mt = "11"; break;
263+ case "dec": var mt = "12"; break;
264+ // default: var mt = "00";
265+ }
266+ dt = date.substr(7,4)+mt+date.substr(0,2);
267+ return dt;
268+ } else if (date.length == 10) {
269+ if (europeandate == false) {
270+ dt = date.substr(6,4)+date.substr(0,2)+date.substr(3,2);
271+ return dt;
272+ } else {
273+ dt = date.substr(6,4)+date.substr(3,2)+date.substr(0,2);
274+ return dt;
275+ }
276+ } else if (date.length == 8) {
277+ yr = date.substr(6,2);
278+ if (parseInt(yr) < 50) {
279+ yr = '20'+yr;
280+ } else {
281+ yr = '19'+yr;
282+ }
283+ if (europeandate == true) {
284+ dt = yr+date.substr(3,2)+date.substr(0,2);
285+ return dt;
286+ } else {
287+ dt = yr+date.substr(0,2)+date.substr(3,2);
288+ return dt;
289+ }
290+ }
291+ return dt;
292+}
293+
294+function ts_sort_date(a,b) {
295+ dt1 = sort_date(ts_getInnerText(a.cells[SORT_COLUMN_INDEX]));
296+ dt2 = sort_date(ts_getInnerText(b.cells[SORT_COLUMN_INDEX]));
297+
298+ if (dt1==dt2) {
299+ return 0;
300+ }
301+ if (dt1<dt2) {
302+ return -1;
303+ }
304+ return 1;
305+}
306+function ts_sort_numeric(a,b) {
307+ var aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);
308+ aa = clean_num(aa);
309+ var bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);
310+ bb = clean_num(bb);
311+ return compare_numeric(aa,bb);
312+}
313+function compare_numeric(a,b) {
314+ var a = parseFloat(a);
315+ a = (isNaN(a) ? 0 : a);
316+ var b = parseFloat(b);
317+ b = (isNaN(b) ? 0 : b);
318+ return a - b;
319+}
320+function ts_sort_caseinsensitive(a,b) {
321+ aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).toLowerCase();
322+ bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).toLowerCase();
323+ if (aa==bb) {
324+ return 0;
325+ }
326+ if (aa<bb) {
327+ return -1;
328+ }
329+ return 1;
330+}
331+function ts_sort_default(a,b) {
332+ aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);
333+ bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);
334+ if (aa==bb) {
335+ return 0;
336+ }
337+ if (aa<bb) {
338+ return -1;
339+ }
340+ return 1;
341+}
342+
343+function addEvent(elm, evType, fn, useCapture)
344+// addEvent and removeEvent
345+// cross-browser event handling for IE5+, NS6 and Mozilla
346+// By Scott Andrew
347+{
348+ if (elm.addEventListener){
349+ elm.addEventListener(evType, fn, useCapture);
350+ return true;
351+ } else if (elm.attachEvent){
352+ var r = elm.attachEvent("on"+evType, fn);
353+ return r;
354+ } else {
355+ alert("Handler could not be removed");
356+ }
357+}
358+function clean_num(str) {
359+ str = str.replace(new RegExp(/[^-?0-9.eE]/g),"");
360+ return str;
361+}
362+function trim(s) {
363+ return s.replace(/^\s+|\s+$/g, "");
364+}
365+function alternate(table) {
366+ // Take object table and get all it's tbodies.
367+ var tableBodies = table.getElementsByTagName("tbody");
368+ // Loop through these tbodies
369+ for (var i = 0; i < tableBodies.length; i++) {
370+ // Take the tbody, and get all it's rows
371+ var tableRows = tableBodies[i].getElementsByTagName("tr");
372+ // Loop through these rows
373+ // Start at 1 because we want to leave the heading row untouched
374+ for (var j = 0; j < tableRows.length; j++) {
375+ // Check if j is even, and apply classes for both possible results
376+ if ( (j % 2) == 0 ) {
377+ if ( !(tableRows[j].className.indexOf('odd') == -1) ) {
378+ tableRows[j].className = tableRows[j].className.replace('odd', 'even');
379+ } else {
380+ if ( tableRows[j].className.indexOf('even') == -1 ) {
381+ tableRows[j].className += " even";
382+ }
383+ }
384+ } else {
385+ if ( !(tableRows[j].className.indexOf('even') == -1) ) {
386+ tableRows[j].className = tableRows[j].className.replace('even', 'odd');
387+ } else {
388+ if ( tableRows[j].className.indexOf('odd') == -1 ) {
389+ tableRows[j].className += " odd";
390+ }
391+ }
392+ }
393+ }
394+ }
395+}
396
397=== modified file 'Template/Source/PDF/pdg2pdf.f'
398--- Template/Source/PDF/pdg2pdf.f 2011-03-02 20:10:29 +0000
399+++ Template/Source/PDF/pdg2pdf.f 2012-02-04 00:00:36 +0000
400@@ -27,6 +27,12 @@
401 if(iabs(ipart).eq.22) ipart=7
402 iporg=ipart
403
404+c This will be called for any PDG code, but we only support up to 7
405+ if(iabs(ipart).gt.7)then
406+ pdg2pdf=0d0
407+ return
408+ endif
409+
410 ireuse = 0
411 do i=1,2
412 c Check if result can be reused since any of last two calls
413
414=== modified file 'Template/Source/PDF/pdg2pdf_lhapdf.f'
415--- Template/Source/PDF/pdg2pdf_lhapdf.f 2010-10-30 03:26:37 +0000
416+++ Template/Source/PDF/pdg2pdf_lhapdf.f 2012-02-04 00:00:36 +0000
417@@ -20,6 +20,13 @@
418
419 ipart=ipdg
420 if(ipart.eq.21) ipart=0
421+ if(iabs(ipart).eq.22) ipart=7
422+
423+c This will be called for any PDG code, but we only support up to 7
424+ if(iabs(ipart).gt.7)then
425+ pdg2pdf=0d0
426+ return
427+ endif
428
429 if(ih.eq.ihlast.and.x.eq.xlast.and.xmu.eq.xmulast)then
430 pdg2pdf=pdflast(ipart);
431
432=== renamed file 'Template/Events/banner_header.txt' => 'Template/Source/banner_header.txt'
433=== modified file 'Template/Source/dsample.f'
434--- Template/Source/dsample.f 2011-08-19 00:06:00 +0000
435+++ Template/Source/dsample.f 2012-02-04 00:00:36 +0000
436@@ -1,4 +1,4 @@
437- subroutine sample_full(ndim,ncall,itmax,dsig,ninvar,nconfigs)
438+ subroutine sample_full(ndim,ncall,itmax,itmin,dsig,ninvar,nconfigs)
439 c**************************************************************************
440 c Driver for sample which does complete integration
441 c This is done in double precision, and should be told the
442@@ -6,7 +6,8 @@
443 c Arguments:
444 c ndim Number of dimensions for integral(number or random #'s/point)
445 c ncall Number of times to evaluate the function/iteration
446-c itmax Number of iterations
447+c itmax Max number of iterations
448+c itmin Min number of iterations
449 c ninvar Number of invarients to keep grids on (s,t,u, s',t' etc)
450 c nconfigs Number of different pole configurations
451 c dsig Function to be integrated
452@@ -16,7 +17,7 @@
453 c
454 c Arguments
455 c
456- integer ndim,ncall,itmax,ninvar,nconfigs
457+ integer ndim,ncall,itmax,itmin,ninvar,nconfigs
458 external dsig
459 double precision dsig
460 c
461@@ -24,7 +25,7 @@
462 c
463 double precision x(maxinvar),wgt,p(4*maxdim/3+14)
464 double precision tdem, chi2, dum
465- integer ievent,kevent,nwrite,iter,nun,luntmp
466+ integer ievent,kevent,nwrite,iter,nun,luntmp,itsum
467 integer jmax,i,j,ipole
468 integer itmax_adjust
469 c
470@@ -51,8 +52,8 @@
471 common /to_accuracy/accur
472
473 double precision twgt, maxwgt,swgt(maxevents)
474- integer lun, nw
475- common/to_unwgt/twgt, maxwgt, swgt, lun, nw
476+ integer lun, nw, itminx
477+ common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itminx
478
479 integer nzoom
480 double precision tx(1:3,maxinvar)
481@@ -100,6 +101,7 @@
482 kevent = 0
483 nzoom = 0
484 xzoomfact = 1d0
485+ itminx = itmin
486 if (nsteps .lt. 1) nsteps=1
487 nwrite = itmax*ncall/nsteps
488 c open(unit=66,file='.sample_warn',status='unknown')
489@@ -140,7 +142,7 @@
490 wgt=0d0
491 endif
492 if (nzoom .le. 0) then
493- call sample_put_point(wgt,x(1),iter,ipole) !Store result
494+ call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result
495 else
496 nzoom = nzoom -1
497 ievent=ievent-1
498@@ -165,7 +167,9 @@
499 i=i+1
500 enddo
501 cur_it = i
502- i = cur_it - 3
503+c Use the last 3 iterations or cur_it-1 if cur_it-1 >= itmin but < 3
504+ itsum = min(max(itmin,cur_it-1),3)
505+ i = cur_it - itsum
506 if (i .gt. 0) then
507 tmean = 0d0
508 tsigma = 0d0
509@@ -183,13 +187,14 @@
510 nun = neventswritten
511
512 chi2 = 0d0
513- do i = cur_it-3,cur_it-1
514+ do i = cur_it-itsum,cur_it-1
515 chi2 = chi2+(xmean(i)-tmean)**2/xsigma(i)**2
516 enddo
517 chi2 = chi2/2d0 !Since using only last 3, n-1=2
518 write(*,'(a)') '-----------------------------------------------------'
519 write(*,'(a)') '---------------------------'
520- write(*,'(a,e12.4)') ' Results Last 3 iters: Integral = ',tmean
521+ write(*,'(a,i3,a,e12.4)') ' Results Last ',itsum,
522+ $ ' iters: Integral = ',tmean
523 write(*,'(25x,a,e12.4)') 'Std dev = ',tsigma
524 write(*,'(17x,a,f12.4)') 'Chi**2 per DoF. =',chi2
525 write(*,'(a)') '-----------------------------------------------------'
526@@ -197,15 +202,17 @@
527
528 if (nun .lt. 0) nun=-nun !Case when wrote maximun number allowed
529 if (chi2 .gt. 1) tsigma=tsigma*sqrt(chi2)
530+c JA 02/2011 Added twgt to results.dat to allow event generation in
531+c first iteration for gridpack runs
532 if (icor .eq. 0) then
533- write(66,'(3e12.5,2i9,i5,i9,e10.3)')tmean,tsigma,0.0,kevent,nw,
534- & cur_it-1,nun, nun/max(tmean,1d-99)
535+ write(66,'(3e12.5,2i9,i5,i9,e10.3,e12.5)')tmean,tsigma,0.0,
536+ & kevent, nw, cur_it-1, nun, nun/max(tmean,1d-99), twgt
537 else
538- write(66,'(3e12.5,2i9,i5,i9,e10.3)')tmean,0.0,tsigma,kevent,nw,
539- & cur_it-1,nun, nun/max(tmean,1d-99)
540+ write(66,'(3e12.5,2i9,i5,i9,e10.3,e12.5)')tmean,0.0,tsigma,
541+ & kevent, nw, cur_it-1, nun, nun/max(tmean,1d-99), twgt
542 endif
543 c do i=1,cur_it-1
544- do i=cur_it-3,cur_it-1
545+ do i=cur_it-itsum,cur_it-1
546 write(66,'(i4,4e15.5)') i,xmean(i),xsigma(i),xeff(i),xwmax(i)
547 enddo
548 close(66)
549@@ -297,7 +304,7 @@
550 wgt=0d0
551 endif
552 if (nzoom .le. 0) then
553- call sample_put_point(wgt,x(1),iter,ipole) !Store result
554+ call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result
555 else
556 nzoom = nzoom -1
557 ievent=ievent-1
558@@ -314,7 +321,9 @@
559 i=i+1
560 enddo
561 cur_it = i
562- i = cur_it - 3
563+c Use the last 3 iterations or cur_it-1 if cur_it-1 >= itmin
564+ itsum = min(max(itmin,cur_it-1),3)
565+ i = cur_it - itsum
566 if (i .gt. 0) then
567 tmean = 0d0
568 tsigma = 0d0
569@@ -334,13 +343,13 @@
570 nun = neventswritten
571
572 chi2 = 0d0
573- do i = cur_it-3,cur_it-1
574+ do i = cur_it-itsum,cur_it-1
575 chi2 = chi2+(xmean(i)-tmean)**2/xsigma(i)**2
576 enddo
577 chi2 = chi2/2d0 !Since using only last 3, n-1=2
578 write(*,'(a)') '-----------------------------------------------------'
579 write(*,'(a)') '---------------------------'
580- write(*,'(a,e12.4)') ' Results Last 3 iters: Integral = ',tmean
581+ write(*,'(a,i3,a,e12.4)') ' Results Last ',itsum,' iters: Integral = ',tmean
582 write(*,'(25x,a,e12.4)') 'Std dev = ',tsigma
583 write(*,'(17x,a,f12.4)') 'Chi**2 per DoF. =',chi2
584 write(*,'(a)') '-----------------------------------------------------'
585@@ -348,15 +357,17 @@
586
587 if (nun .lt. 0) nun=-nun !Case when wrote maximun number allowed
588 if (chi2 .gt. 1) tsigma=tsigma*sqrt(chi2)
589+c JA 02/2011 Added twgt to results.dat to allow event generation in
590+c first iteration for gridpack runs
591 if (icor .eq. 0) then
592- write(66,'(3e12.5,2i9,i5,i9,e10.3)')tmean,tsigma,0.0,kevent,nw,
593- & cur_it-1,nun, nun/max(tmean,1d-99)
594+ write(66,'(3e12.5,2i9,i5,i9,e10.3,e12.5)')tmean,tsigma,0.0,
595+ & kevent, nw, cur_it-1, nun, nun/max(tmean,1d-99), twgt
596 else
597- write(66,'(3e12.5,2i9,i5,i9,e10.3)')tmean,0.0,tsigma,kevent,nw,
598- & cur_it-1,nun, nun/max(tmean,1d-99)
599+ write(66,'(3e12.5,2i9,i5,i9,e10.3,e12.5)')tmean,0.0,tsigma,
600+ & kevent, nw, cur_it-1, nun, nun/max(tmean,1d-99), twgt
601 endif
602 c do i=1,cur_it-1
603- do i=cur_it-3,cur_it-1
604+ do i=cur_it-itsum,cur_it-1
605 write(66,'(i4,4e15.5)') i,xmean(i),xsigma(i),xeff(i),xwmax(i)
606 enddo
607 close(66)
608@@ -371,237 +382,6 @@
609
610 end
611
612- subroutine sample_fullx(ndim,ncall,itmax,dsig,ninvar,nconfigs)
613-c**************************************************************************
614-c Driver for sample which does complete integration
615-c This is done in double precision, and should be told the
616-c number of possible phasespace choices.
617-c Arguments:
618-c ndim Number of dimensions for integral(number or random #'s/point)
619-c ncall Number of times to evaluate the function/iteration
620-c itmax Number of iterations
621-c ninvar Number of invarients to keep grids on (s,t,u, s',t' etc)
622-c nconfigs Number of different pole configurations
623-c dsig Function to be integrated
624-c**************************************************************************
625- implicit none
626- include 'genps.inc'
627-c
628-c Arguments
629-c
630- integer ndim,ncall,itmax,ninvar,nconfigs
631- external dsig
632- double precision dsig
633-c
634-c Local
635-c
636- double precision x(maxinvar),wgt,p(4*maxdim/3+14)
637- double precision tdem, chi2
638- integer ievent,kevent,nwrite,iter,nun
639- integer jmax,i,j,ipole
640-c
641-c External
642-c
643- integer n_unwgted
644- external n_unwgted
645-c
646-c Global
647-c
648- integer nsteps
649- character*40 result_file,where_file
650- common /sample_status/result_file,where_file,nsteps
651- double precision fx
652- common /to_fx/ fx
653-
654- integer mincfig, maxcfig
655- common/to_configs/mincfig, maxcfig
656-
657- double precision xmean(99),xsigma(99),xwmax(99),xeff(99)
658- common/to_iterations/xmean, xsigma, xwmax, xeff
659-
660- double precision accur
661- common /to_accuracy/accur
662-
663- double precision twgt, maxwgt,swgt(maxevents)
664- integer lun, nw
665- common/to_unwgt/twgt, maxwgt, swgt, lun, nw
666-
667- integer nzoom
668- double precision tx(1:3,maxinvar)
669- common/to_xpoints/tx, nzoom
670-
671- double precision xzoomfact
672- common/to_zoom/ xzoomfact
673-
674- double precision tmean, tsigma
675- integer dim, events, itm, kn, cur_it, invar, configs
676- common /sample_common/
677- . tmean, tsigma, dim, events, itm, kn, cur_it, invar, configs
678-
679- integer icor
680- common/to_correlated/icor
681-c
682-c External
683-c
684- logical pass_point
685-c
686-c Data
687-c
688-c data result_file,where_file,nsteps/'SAMPLE','WHERE.AMI',100/
689-c data accur/-1d0/
690-c data mincfig /1/
691-c data maxcfig /1/
692-c data twgt/-1d0/ !Dont write out events
693-c data lun/27/ !Unit number for events
694-c data maxwgt/0d0/
695-c data nw/0/ !Number of events written
696-
697-
698-c-----
699-c Begin Code
700-c-----
701- ievent = 0
702- kevent = 0
703- nzoom = 0
704- xzoomfact = 1d0
705- if (nsteps .lt. 1) nsteps=1
706- nwrite = itmax*ncall/nsteps
707-c open(unit=66,file='.sample_warn',status='unknown')
708-c write(66,*) 'Warnings from sample run.',itmax,ncall
709-c close(66)
710- call sample_init(ndim,ncall,itmax,ninvar,nconfigs)
711- call graph_init
712- do i=1,itmax
713- xmean(i)=0d0
714- xsigma(i)=0d0
715- enddo
716-c mincfig=1
717-c maxcfig=nconfigs
718- wgt = 0d0
719-c
720-c Main Integration Loop
721-c
722- iter = 1
723- do while(iter .le. itmax)
724-c
725-c Get integration point
726-c
727- call sample_get_config(wgt,iter,ipole)
728- if (iter .le. itmax) then
729- ievent=ievent+1
730- call x_to_f_arg(ndim,ipole,mincfig,maxcfig,ninvar,wgt,x,p)
731- if (pass_point(p)) then
732- xzoomfact = 1d0
733- fx = dsig(p,wgt,0) !Evaluate function
734- if (xzoomfact .gt. 0d0) then
735- wgt = wgt*fx*xzoomfact
736- else
737- wgt = -xzoomfact
738- endif
739- if (wgt .gt. 0d0) call graph_point(p,wgt) !Update graphs
740- else
741- fx =0d0
742- wgt=0d0
743- endif
744- if (nzoom .le. 0) then
745- call sample_put_point(wgt,x(1),iter,ipole) !Store result
746- else
747- nzoom = nzoom -1
748- ievent=ievent-1
749- endif
750- endif
751- if (wgt .gt. 0d0) kevent=kevent+1
752-c
753-c Write out progress/histograms
754-c
755- if (kevent .ge. nwrite) then
756- nwrite = nwrite+ncall*itmax/nsteps
757- nwrite = min(nwrite,ncall*itmax)
758-c open(unit=22,file=where_file,status='old',
759-c & access='append',err=99)
760-c write(22,'(2i15)') ievent,kevent
761-c close(22)
762- call graph_store
763- endif
764- 99 enddo
765-c
766-c All done
767-c
768-c open(unit=66,file='.sample_warn',status='old',access='append')
769-c write(66,*) 'Finished sample',ievent,kevent,wgt
770-c if (wgt .ne. -1) then
771-c do j=1,5
772-c jmax = min(ndim,4*j)
773-c write(66,'(4e19.12)') (x(i),i=(j-1)*4+1,jmax)
774-c enddo
775-c endif
776-c close(66)
777-
778- open(unit=66,file='results.dat',status='unknown')
779- i=1
780- do while(xmean(i) .ne. 0 .and. i .lt. cur_it)
781- i=i+1
782- enddo
783- cur_it = i
784- i = cur_it - 3
785- if (i .gt. 0) then
786- tmean = 0d0
787- tsigma = 0d0
788- tdem = 0d0
789- do while (xmean(i) .ne. 0 .and. i .lt. cur_it)
790- tmean = tmean+xmean(i)*xmean(i)**2/xsigma(i)**2
791- tdem = tdem+xmean(i)**2/xsigma(i)**2
792- tsigma = tsigma + xmean(i)**2/ xsigma(i)**2
793- i=i+1
794- enddo
795-c tmean = tmean/dble(i-1)
796-c tsigma= sqrt(tsigma)/dble(i-1)
797- tmean = tmean/tsigma
798-c tsigma= sqrt(tsigma)/dble(3)
799- tsigma= tmean/sqrt(tsigma)
800- nun = n_unwgted()
801-
802- chi2 = 0d0
803- do i = cur_it-3,cur_it-1
804- chi2 = chi2+(xmean(i)-tmean)**2/xsigma(i)**2
805- enddo
806- chi2 = chi2/2d0 !Since using only last 3, n-1=2
807-c tsigma = tsigma*sqrt(chi2)
808-c write(*,*) "chi2 / dof=", chi2
809- write(*,'(a)') '-----------------------------------------------------'
810- write(*,'(a)') '---------------------------'
811- write(*,'(a,e12.4)') ' Results Last 3 iters: Integral = ',tmean
812- write(*,'(25x,a,e12.4)') 'Std dev = ',tsigma
813- write(*,'(17x,a,f12.4)') 'Chi**2 per DoF. =',chi2
814- write(*,'(a)') '-----------------------------------------------------'
815- write(*,'(a)') '---------------------------'
816-
817- if (nun .lt. 0) nun=-nun !Case when wrote maximun number allowed
818- if (chi2 .gt. 1) tsigma=tsigma*sqrt(chi2)
819- if (icor .eq. 0) then
820- write(66,'(3e12.5,2i9,i5,i9,e10.3)')tmean,tsigma,0.0,kevent,nw,
821- & cur_it-1,nun, nun/max(tmean,1d-99)
822- else
823- write(66,'(3e12.5,2i9,i5,i9,e10.3)')tmean,0.0,tsigma,kevent,nw,
824- & cur_it-1,nun, nun/max(tmean,1d-99)
825- endif
826-c do i=1,cur_it-1
827- do i=cur_it-3,cur_it-1
828- write(66,'(i4,4e15.5)') i,xmean(i),xsigma(i),xeff(i),xwmax(i)
829- enddo
830- close(66)
831- else
832- open(unit=66,file='results.dat',status='unknown')
833- write(66,'(3e12.5,2i9,i5,i9,e10.3)')0,0,0.0,kevent,nw,
834- & 1,0, 0
835- write(66,'(i4,4e15.5)') 1,0,0,0,0
836- close(66)
837-
838- endif
839-
840- end
841-
842-
843 subroutine sample_writehtm()
844 c***********************************************************************
845 c Writes out results of run in html format
846@@ -1336,10 +1116,10 @@
847 endif
848 end
849
850- subroutine sample_result(mean, sigma)
851+ subroutine sample_result(mean, sigma, itmin)
852 implicit none
853 double precision mean, sigma
854- integer i,cur_it
855+ integer i,cur_it,itmin,itsum
856 double precision tsigma,tmean,tsig,tdem
857
858 double precision xmean(99),xsigma(99),xwmax(99),xeff(99)
859@@ -1351,7 +1131,9 @@
860 i=i+1
861 enddo
862 cur_it = i
863- i = cur_it - 3
864+c Use the last 3 iterations or cur_it-1 if cur_it-1 >= itmin
865+ itsum = min(max(itmin,cur_it-1),3)
866+ i = cur_it - itsum
867 tmean = 0d0
868 tsigma = 0d0
869 if (i .gt. 0) then
870@@ -1393,7 +1175,7 @@
871 c
872 c Local
873 c
874- integer i, j, k, knt, non_zero, nun
875+ integer i, j, k, knt, non_zero, nun,itsum
876 double precision vol,xnmin,xnmax,tot,xdum,tmp1,chi2tmp
877 double precision rc, dr, xo, xn, x(maxinvar), dum(ng-1)
878 save vol,knt
879@@ -1447,8 +1229,8 @@
880 common /to_error/reliable
881
882 double precision twgt, maxwgt,swgt(maxevents)
883- integer lun, nw
884- common/to_unwgt/twgt, maxwgt, swgt, lun, nw
885+ integer lun, nw, itmin
886+ common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin
887
888
889 real*8 wmax !This is redundant
890@@ -1889,9 +1671,9 @@
891 xdum=dsig(0,0,2)
892 c
893 c Add test to see if we have achieved desired accuracy
894-c JA 8/17/2011 allow minimum 3 iterations instead of 5
895+c Allow minimum itmin iterations
896 c
897- if (tsigma .gt. 0d0 .and. cur_it .gt. 3 .and. accur .gt. 0d0) then
898+ if (tsigma .gt. 0d0 .and. cur_it .gt. itmin .and. accur .gt. 0d0) then
899
900 xmean = tmean/tsigma
901 xchi2 = (chi2/xmean/xmean-tsigma)/dble(cur_it-2)
902@@ -1930,7 +1712,7 @@
903 c
904 c New check to see if we need to keep integrating this one or not.
905 c
906- if (cur_it .gt. 3 .and. accur .lt. 0d0) then !Check luminocity
907+ if (cur_it .gt. itmin .and. accur .lt. 0d0) then !Check luminocity
908 c
909 c Lets get the actual number instead
910 c tjs 5/22/2007
911@@ -1941,16 +1723,18 @@
912 nun = neventswritten
913 c tmp1 = tmean / tsigma
914 c chi2tmp = (chi2/tmp1/tmp1-tsigma)/dble(cur_it-2)
915-c Calculate chi2 for last three events (ja 03/11)
916+c Calculate chi2 for last few iterations (ja 03/11)
917 tmeant = 0d0
918 tsigmat = 0d0
919- do i=cur_it-3,cur_it-1
920+c Use the last 3 iterations or cur_it-1 if cur_it-1 >= itmin but < 3
921+ itsum = min(max(itmin,cur_it-1),3)
922+ do i=cur_it-itsum,cur_it-1
923 tmeant = tmeant+ymean(i)*ymean(i)**2/ysigma(i)**2
924 tsigmat = tsigmat + ymean(i)**2/ ysigma(i)**2
925 enddo
926 tmeant = tmeant/tsigmat
927 chi2tmp = 0d0
928- do i = cur_it-3,cur_it-1
929+ do i = cur_it-itsum,cur_it-1
930 chi2tmp = chi2tmp+(ymean(i)-tmeant)**2/ysigma(i)**2
931 enddo
932 chi2tmp = chi2tmp/2d0 !Since using only last 3, n-1=2
933
934=== modified file 'Template/Source/gen_ximprove.f'
935--- Template/Source/gen_ximprove.f 2011-11-13 05:53:47 +0000
936+++ Template/Source/gen_ximprove.f 2012-02-04 00:00:36 +0000
937@@ -19,8 +19,8 @@
938 c
939 c global
940 c
941- integer max_np
942- common/max_np/max_np
943+ integer max_np,min_iter
944+ common/max_np/max_np,min_iter
945
946 c
947 c local
948@@ -62,6 +62,7 @@
949 & ', or number events (>1), max processes per job',
950 & ', and whether to split channels (T/F)'
951 read(*,*) err_goal, max_np, split_channels
952+ min_iter=3
953 parallel = .false.
954 if (err_goal .lt. 1) then
955 write(*,'(a,f8.2,a)') 'Running for accuracy of ',
956@@ -79,11 +80,13 @@
957 else
958 gen_events=.true.
959 split_channels=.false.
960+c Allow all the way down to a single iteration for gridruns
961+ min_iter=1
962 call get_integer(npara,param,value," gevents " ,nreq ,2000 )
963- err_goal = 1.5*nreq ! extra factor to ensure works
964+ err_goal = 1.2*nreq ! extra factor to ensure works
965 call get_integer(npara,param,value," gseed " ,iseed ,4321 )
966 call get_integer(npara,param,value," ngran " ,ngran , -1)
967- if (ngran.eq.-1) ngran = int(sqrt(real(nreq)))
968+ if (ngran.eq.-1) ngran = 1
969 write(*,*) "Running on Grid to generate ",nreq," additional events"
970 write(*,*) " with granularity equal to ",ngran
971 c
972@@ -196,9 +199,8 @@
973 $ i,nevents,gname,nhel_refine)
974 else
975 open(unit=25,file='../results.dat',status='old',err=199)
976+ read(25,*) xtot
977 write(*,'(a,e12.3)') 'Reading total xsection ',xtot
978- read(25,*) xtot
979- write(*,'(e12.3)') xtot
980 199 close(25)
981 if (gridpack) then
982 call write_gen_grid(err_goal,dble(ngran),i,nevents,gname,
983@@ -230,8 +232,8 @@
984 c
985 c global
986 c
987- integer max_np
988- common/max_np/max_np
989+ integer max_np,min_iter
990+ common/max_np/max_np,min_iter
991 c
992 c Arguments
993 c
994@@ -323,7 +325,6 @@
995 c
996 c Now write the commands
997 c
998- write(26,20) 'echo $j'
999 write(26,20) 'if [[ ! -e $j ]]; then'
1000 write(26,25) 'mkdir $j'
1001 write(26,20) 'fi'
1002@@ -331,7 +332,7 @@
1003 write(26,20) 'rm -f $k'
1004 c write(26,20) 'rm -f moffset.dat'
1005
1006- write(26,'(5x,a,2i8,a)') 'echo "',npoints,max_iter,
1007+ write(26,'(5x,a,3i8,a)') 'echo "',npoints,max_iter,min_iter,
1008 $ '" >& input_sg.txt'
1009 write(26,'(5x,a,f8.3,a)') 'echo "',max(elimit/ysec,0.001d0),
1010 $ '" >> input_sg.txt'
1011@@ -341,7 +342,7 @@
1012 & '" >> input_sg.txt' !Helicity
1013 write(26,'(5x,3a)')'echo "',gn(io(i))(2:ip-1),
1014 $ '" >>input_sg.txt'
1015- write(26,20) 'time ../madevent >> $k <input_sg.txt'
1016+ write(26,20) '../madevent >> $k <input_sg.txt'
1017 write(26,20) 'mv ftn26 ftn25'
1018 c write(26,20) 'rm ftn26'
1019 write(26,20) 'cat $k >> log.txt'
1020@@ -394,16 +395,16 @@
1021 write(*,*) 'Opening file ',fname
1022 open (unit=26, file = fname, status='unknown')
1023 write(26,15) '#!/bin/bash'
1024- write(26,15) '#PBS -q ' // PBS_QUE
1025- write(26,15) '#PBS -o /dev/null'
1026- write(26,15) '#PBS -e /dev/null'
1027+c write(26,15) '#PBS -q ' // PBS_QUE
1028+c write(26,15) '#PBS -o /dev/null'
1029+c write(26,15) '#PBS -e /dev/null'
1030 write(26,15) 'if [[ "$PBS_O_WORKDIR" != "" ]]; then'
1031 write(26,15) ' cd $PBS_O_WORKDIR'
1032 write(26,15) 'fi'
1033 write(26,15) 'k=run1_app.log'
1034 write(lun,15) 'script=' // fname
1035- write(lun,15) 'rm -f wait.$script >& /dev/null'
1036- write(lun,15) 'touch run.$script'
1037+c write(lun,15) 'rm -f wait.$script >& /dev/null'
1038+c write(lun,15) 'touch run.$script'
1039 15 format(a)
1040 end
1041
1042@@ -434,7 +435,6 @@
1043 c
1044 c Now write the commands
1045 c
1046-c write(lun,20) 'echo $i'
1047 c write(lun,20) 'j=G$i'
1048 c write(lun,20) 'if (! -e $j) then'
1049 c write(lun,25) 'mkdir $j'
1050@@ -448,7 +448,7 @@
1051 c write(lun,20) 'cp ../../public.sh .'
1052 c write(lun,20) 'qsub -N $1$i public.sh >> ../../running_jobs'
1053 c else
1054-c write(lun,20) 'time ../madevent > $k <input_app.txt'
1055+c write(lun,20) '../madevent > $k <input_app.txt'
1056 c write(lun,20) 'rm -f ftn25 ftn99'
1057 c write(lun,20) 'cp $k log.txt'
1058 c endif
1059@@ -479,8 +479,8 @@
1060 c
1061 c global
1062 c
1063- integer max_np
1064- common/max_np/max_np
1065+ integer max_np,min_iter
1066+ common/max_np/max_np,min_iter
1067 c integer max_np !now set in run_config.inc
1068 c parameter (max_np = 5) !number of channels/job
1069
1070@@ -635,7 +635,6 @@
1071 c
1072 c Now write the commands
1073 c
1074- write(26,20) 'echo $j'
1075 write(26,20) 'if [[ ! -e $j ]]; then'
1076 write(26,25) 'mkdir $j'
1077 write(26,20) 'fi'
1078@@ -658,7 +657,7 @@
1079 write(26,20) 'if [[ ! -e ftn25 ]]; then'
1080
1081
1082- write(26,'(9x,a,2i8,a)') 'echo "',npoints,max_iter,
1083+ write(26,'(9x,a,3i8,a)') 'echo "',npoints,max_iter,min_iter,
1084 $ '" >& input_sg.txt'
1085 c
1086 c tjs 8/7/2007-JA 8/17/11 Allow stop when have enough luminocity
1087@@ -672,7 +671,7 @@
1088 & ' " >> input_sg.txt' !Helicity 0=exact
1089 write(26,'(9x,3a)')'echo "',gn(io(np))(2:ip-1),
1090 $ '" >>input_sg.txt'
1091- write(26,25) 'time ../madevent >> $k <input_sg.txt'
1092+ write(26,25) '../madevent >> $k <input_sg.txt'
1093 write(26,25) 'cat $k >> log.txt'
1094 write(26,25) 'if [[ -e ftn26 ]]; then'
1095 write(26,25) ' cp ftn26 ftn25'
1096@@ -681,7 +680,7 @@
1097
1098 write(26,25) 'rm -f $k'
1099
1100- write(26,'(9x,a,2i8,a)') 'echo "',npoints,max_iter,
1101+ write(26,'(9x,a,3i8,a)') 'echo "',npoints,max_iter,min_iter,
1102 $ '" >& input_sg.txt'
1103 c
1104 c tjs 8/7/2007-JA 8/17/11 Change to request luminocity not accuracy
1105@@ -709,7 +708,7 @@
1106 write(26,25) 'if [[ -e ftn26 ]]; then'
1107 write(26,25) ' cp ftn26 ftn25'
1108 write(26,25) 'fi'
1109- write(26,25) 'time ../madevent >> $k <input_sg.txt'
1110+ write(26,25) '../madevent >> $k <input_sg.txt'
1111 write(26,25) 'cat $k >> log.txt'
1112 write(26,20) 'fi'
1113 write(26,20) 'cd ../'
1114@@ -744,8 +743,8 @@
1115 c
1116 c global
1117 c
1118- integer max_np
1119- common/max_np/max_np
1120+ integer max_np,min_iter
1121+ common/max_np/max_np,min_iter
1122 c
1123 c Arguments
1124 c
1125@@ -791,7 +790,7 @@
1126 write(27,*) xtot*ngran/xsec(i)/goal_lum
1127 endif
1128 npoints = goal_lum * xsec(i) / xtot
1129- if (npoints .lt. min_gevents_wu) npoints = min_gevents_wu
1130+ if (npoints .lt. ngran) npoints = ngran
1131 np = np+1
1132 if (np .gt. max_np) then
1133 if (fopened) then
1134@@ -810,7 +809,6 @@
1135 c
1136 c Now write the commands
1137 c
1138- write(26,20) 'echo $j'
1139 write(26,20) 'if [[ ! -e $j ]]; then'
1140 write(26,25) 'mkdir $j'
1141 write(26,20) 'fi'
1142@@ -827,8 +825,8 @@
1143 write(26,20) 'if [[ ! -e ftn25 ]]; then'
1144
1145
1146- write(26,'(9x,a,2i8,a)') 'echo "',max(npoints,min_events),
1147- $ max_iter,'" >& input_sg.txt'
1148+ write(26,'(9x,a,3i8,a)') 'echo "',max(npoints,min_events),
1149+ $ max_iter,min_iter,'" >& input_sg.txt'
1150 c
1151 c tjs 8/7/2007 Allow stop when have enough events
1152 c
1153@@ -841,7 +839,7 @@
1154 & ' " >> input_sg.txt' !Helicity 0=exact
1155 write(26,'(9x,3a)')'echo "',gn(i)(2:ip-1),
1156 $ '" >>input_sg.txt'
1157- write(26,25) 'time ../madevent >> $k <input_sg.txt'
1158+ write(26,25) '../madevent >> $k <input_sg.txt'
1159 write(26,25) 'cat $k >> log.txt'
1160 write(26,25) 'if [[ -e ftn26 ]]; then'
1161 write(26,25) ' cp ftn26 ftn25'
1162@@ -850,8 +848,8 @@
1163
1164 write(26,25) 'rm -f $k'
1165
1166- write(26,'(9x,a,2i8,a)') 'echo "',max(npoints,min_events),
1167- $ max_iter,'" >& input_sg.txt'
1168+ write(26,'(9x,a,3i8,a)') 'echo "',max(npoints,min_events),
1169+ $ max_iter,min_iter,'" >& input_sg.txt'
1170 c
1171 c tjs 8/7/2007 Change to request events not accuracy
1172 c
1173@@ -869,7 +867,7 @@
1174 write(26,25) 'if [[ -e ftn26 ]]; then'
1175 write(26,25) ' cp ftn26 ftn25'
1176 write(26,25) 'fi'
1177- write(26,25) 'time ../madevent >> $k <input_sg.txt'
1178+ write(26,25) '../madevent >> $k <input_sg.txt'
1179 write(26,25) 'cat $k >> log.txt'
1180 write(26,20) 'fi'
1181 write(26,20) 'cd ../'
1182
1183=== modified file 'Template/Source/make_opts'
1184--- Template/Source/make_opts 2011-07-12 03:57:50 +0000
1185+++ Template/Source/make_opts 2012-02-04 00:00:36 +0000
1186@@ -8,7 +8,7 @@
1187
1188 # Set FC unless it's defined by an environment variable
1189 ifeq ($(origin FC),default)
1190- FC=g77
1191+ FC=gfortran
1192 endif
1193
1194 # Options: dynamic, lhapdf
1195
1196=== removed file 'Template/Source/scale_events.f'
1197--- Template/Source/scale_events.f 2010-10-30 03:26:37 +0000
1198+++ Template/Source/scale_events.f 1970-01-01 00:00:00 +0000
1199@@ -1,150 +0,0 @@
1200- program scale_events
1201-c********************************************************************
1202-c Takes events from events.dat and scales them according to
1203-c the correct cross section for each diagram
1204-c********************************************************************
1205- implicit none
1206-c
1207-c Constants
1208-c
1209- character*(*) symfile
1210- parameter (symfile='symfact.dat')
1211- character*(*) scaled_file
1212- parameter (scaled_file='scaled.dat')
1213-c
1214-c local
1215-c
1216- character*30 dirname
1217- double precision xi
1218- integer j,k,ip
1219-c-----
1220-c Begin Code
1221-c-----
1222- open(unit=16,file=scaled_file,status='unknown',err=999)
1223- open(unit=35,file=symfile,status='old',err=59)
1224- do while (.true.)
1225- read(35,*,err=99,end=99) xi,j
1226- if (j .gt. 0) then
1227- if ( (xi-int(xi+.01)) .lt. 1d-5) then
1228- k = int(xi+.01)
1229- if (k .lt. 10) then
1230- write(dirname,'(a,i1,a)') 'G',k,'/'
1231- else if (k .lt. 100) then
1232- write(dirname,'(a,i2,a)') 'G',k,'/'
1233- else if (k .lt. 1000) then
1234- write(dirname,'(a,i3,a)') 'G',k,'/'
1235- else if (k .lt. 10000) then
1236- write(dirname,'(a,i4,a)') 'G',k,'/'
1237- endif
1238- else !Handle B.W.
1239- if (xi .lt. 10) then
1240- write(dirname,'(a,f5.3,a,a)') 'G',xi,'/'
1241- else if (xi .lt. 100) then
1242- write(dirname,'(a,f6.3,a,a)') 'G',xi,'/'
1243- else if (xi .lt. 1000) then
1244- write(dirname,'(a,f7.3,a,a)') 'G',xi,'/'
1245- else if (xi .lt. 10000) then
1246- write(dirname,'(a,3f8.3,a,a)') 'G',xi,'/'
1247- endif
1248- endif
1249- ip = index(dirname,'/')
1250- write(*,*) 'Scaling ',dirname(1:ip)
1251- call scale_dir(dirname,j,ip)
1252- endif
1253- enddo
1254- 99 close(35)
1255- close(16)
1256- stop
1257-c
1258-c Come here if there isn't a symfact file. Means we will work on
1259-c this file alone
1260-c
1261- 59 dirname="./"
1262- j = 1
1263- ip = 2
1264- write(*,*) 'Scaling ',dirname(1:ip)
1265- call scale_dir(dirname,j,ip)
1266- close(16)
1267- stop
1268- 999 write(*,*) 'Error opening file ',scaled_file
1269- close(16)
1270- end
1271-
1272- subroutine scale_dir(dirname,mfact, ip)
1273-c********************************************************************
1274-c Takes events from events.dat and scales them according to
1275-c the correct cross section.
1276-c********************************************************************
1277- implicit none
1278-c
1279-c parameters
1280-c
1281- include 'nexternal.inc'
1282- character*(*) event_file, xsec_file
1283- parameter (event_file='events.lhe', xsec_file='results.dat')
1284- integer maxexternal
1285- parameter (maxexternal=15)
1286-
1287-c
1288-c Arguments
1289-c
1290- integer mfact, ip
1291- character*(30) dirname
1292-c
1293-c Local
1294-c
1295- double precision xsec, sum, wgt, mxwgt
1296- double precision x1,x2,p(0:4,nexternal)
1297- integer i,j,k, kevent,m, ic(7,maxexternal),n
1298- double precision scale,aqed,aqcd
1299- integer ievent
1300- character*79 buff
1301- logical done
1302-c-----
1303-c Begin Code
1304-c-----
1305- open(unit=15,file=dirname(1:ip) // xsec_file,status='old',err=998)
1306- read(15,*) xsec
1307- xsec = xsec * mfact
1308- close(15)
1309- sum=0d0
1310- mxwgt=-1d0
1311- kevent = 0
1312- open(unit=15,file=dirname(1:ip)//event_file,status='old',err=999)
1313- done = .false.
1314- do while (.not. done)
1315- call read_event(15,p,wgt,n,ic,ievent,scale,aqcd,aqed,done)
1316- if (.not. done) then
1317- sum=sum+wgt
1318- mxwgt = max(wgt,mxwgt)
1319- kevent = kevent+1
1320- endif
1321- enddo
1322- 99 close(15)
1323- write(*,*) 'Found ',kevent,' events'
1324- write(*,*) 'total weight',sum
1325- write(*,*) 'Integrated weight',xsec
1326-c stop
1327-c
1328-c Now write out scaled events
1329-c
1330- call write_comments(16)
1331- open(unit=15,file=dirname(1:ip) //event_file,status='old',err=999)
1332- done=.false.
1333- m = 0
1334- do while (.not. done)
1335- m=m+1
1336- call read_event(15,p,wgt,n,ic,ievent,scale,aqcd,aqed,done)
1337-c call read_event(15,p,wgt,n,ic,done)
1338- if (.not. done) then
1339- call write_event(16,p,wgt*xsec/sum,n,ic,m,scale,aqcd,aqed)
1340- endif
1341- enddo
1342- 900 close(15)
1343- return
1344- 55 format(i3,4e19.12)
1345- 998 write(*,*) 'Error opening file ',dirname(1:ip) // xsec_file
1346- return
1347- 999 write(*,*) 'Error opening file ',dirname(1:ip) //event_file
1348- return
1349- end
1350
1351=== removed file 'Template/Source/select_events.f'
1352--- Template/Source/select_events.f 2010-10-30 03:26:37 +0000
1353+++ Template/Source/select_events.f 1970-01-01 00:00:00 +0000
1354@@ -1,300 +0,0 @@
1355- program pick_events
1356-c********************************************************************
1357-c Takes events from scaled.dat and plots distributions
1358-c********************************************************************
1359- implicit none
1360- integer nevents
1361- double precision mxwgt,mxwgt1, wgt_goal, eff,xsec
1362- integer gevents
1363-c-----
1364-c Begin Code
1365-c-----
1366- call read_all_events(nevents,mxwgt,mxwgt1,eff,xsec)
1367- write(*,*) 'Number of events',nevents,mxwgt,mxwgt1
1368- write(*,'($a,i7,a)') 'Enter number of events desired ( <',
1369- & int(nevents*eff),') '
1370- read(*,*) gevents
1371- wgt_goal = mxwgt1*Max((nevents*eff)/gevents,1d0)
1372-c wgt_goal = mxwgt1
1373- call write_events(wgt_goal,xsec,gevents)
1374- end
1375-
1376- subroutine write_events(wgt_goal,xsec,gevents)
1377-c********************************************************************
1378-c
1379-c********************************************************************
1380- implicit none
1381-c
1382-c parameters
1383-c
1384- character*(*) scaled_file
1385- parameter (scaled_file='events.lhe')
1386- character*(*) unwgt_file
1387- parameter (unwgt_file='unweighted_events.lhe')
1388- integer max_write
1389- parameter (max_write=100000)
1390- integer maxexternal
1391- parameter (maxexternal=15)
1392-c
1393-c Arguments
1394-c
1395- double precision wgt_goal,xsec
1396- integer gevents
1397-c
1398-c Local
1399-c
1400- double precision sum, wgt, s_over
1401- double precision p(0:4,maxexternal),r
1402- integer i,j,k,m, kevent, ic(7,maxexternal)
1403- integer iseed, n_over, n
1404- integer i4,r8,record_length,irc,ng,iol
1405- real xran1
1406- character*79 buff
1407- logical lwrite
1408- logical*1 l_store(max_write)
1409- logical done
1410- double precision scale, aqcd, aqed
1411- integer ievent
1412-
1413- external xran1
1414-c-----
1415-c Begin Code
1416-c-----
1417- sum=0d0
1418- s_over = 0d0
1419- n_over = 0
1420- iseed = 0
1421-c mxwgt=-1d0
1422- kevent = 0
1423- rewind(37) !This is comment block
1424- open(unit=15,file=scaled_file, status='old',err=999)
1425- I4 = 4
1426- R8 = 8
1427- record_length = 3*I4+maxexternal*I4*7+maxexternal*4*R8+3*R8
1428- open(unit=16,access='direct',status='scratch',err=999,
1429- & recl=record_length)
1430- done=.false.
1431- do while (.not. done)
1432-c write(*,*) 'Reading Event'
1433- call read_event(15,P,wgt,n,ic,ievent,scale,aqcd,aqed,done)
1434-c write(*,*) 'read event',n,wgt,wgt_goal
1435- if (.not. done) then
1436- r = xran1(iseed)
1437- lwrite = (wgt / r .gt. wgt_goal)
1438-c write(*,*) 'lwrite',lwrite,r
1439- if (lwrite) then
1440- sum=sum+wgt_goal
1441- kevent = kevent+1
1442- l_store(kevent)=.false.
1443-c write(*,*) 'writing event',kevent
1444- write(16,rec=kevent) wgt_goal,n,
1445- & ((ic(i,j),j=1,maxexternal),i=1,7),
1446- & ((p(i,j),i=0,3),j=1,maxexternal),scale,aqcd,aqed
1447- if (wgt .gt. wgt_goal) then
1448- s_over = s_over-wgt_goal+wgt
1449- n_over = n_over + 1
1450- endif
1451- endif
1452- endif
1453- enddo
1454- 99 close(15)
1455-c rewind(16)
1456-c write(*,*) 'Done',kevent
1457- open(unit=26,file=unwgt_file, status='unknown',err=999)
1458- call write_comments(26)
1459- write(26,'(a2,75a1)') '##',('*', i=1,68)
1460- write(26,'(a)') '##'
1461- write(26,'(a)') '##-----------------------'
1462- write(26,'(a)') '## Unweighting Statistics'
1463- write(26,'(a)') '##-----------------------'
1464- write(26,'(a)') '##'
1465- write(26,'(a,i7)') '## Number of Events Written :' , kevent
1466- write(26,'(a,i7)') '## Number of Events Truncated :' , n_over
1467- write(26,'(a,f7.2,a)') '## Truncated Cross Section :' ,
1468- $ s_over*100./(xsec),"%"
1469-
1470- write(26,'(a2,75a1)') '##',('*', i=1,68)
1471-
1472- k=0
1473- do while(k .lt. kevent)
1474- r = xran1(iseed)
1475- ng=0
1476- i=0
1477-c write(*,*) r,kevent,k
1478- do while (r .gt. real(ng)/(kevent-k) .and. i .lt. kevent)
1479-c write(*,*) r,kevent,k
1480- i=i+1
1481- if (.not. l_store(i)) ng=ng+1
1482- enddo
1483- k=k+1
1484- l_store(i)=.true.
1485-c write(*,*) 'Writing event ',k,i
1486- read(16,rec=i) wgt_goal,n,
1487- & ((ic(i,j),j=1,maxexternal),i=1,7),
1488- & ((p(i,j),i=0,3),j=1,maxexternal),scale,aqcd,aqed
1489-
1490- wgt_goal = wgt_goal*xsec/sum
1491- call write_event(26,p,wgt_goal,n,ic,k,scale,aqcd,aqed)
1492- enddo
1493- 92 close(16,status='delete')
1494- close(26)
1495- 55 format(i3,4e19.11)
1496- write(*,*) 'Wrote ',kevent,' events'
1497- write(*,*) 'Integrated weight',xsec
1498- write(*,*) 'Truncated events ',n_over,
1499- & s_over, s_over/xsec*100,'%'
1500- return
1501- 999 write(*,*) 'Error opening file ',scaled_file
1502- end
1503-
1504- subroutine read_all_events(kevent, mxwgt,mxwgt1, eff, xsec)
1505-c********************************************************************
1506-c********************************************************************
1507- implicit none
1508-c
1509-c parameters
1510-c
1511- character*(*) scaled_file
1512- parameter (scaled_file='events.lhe')
1513- integer maxexternal
1514- parameter (maxexternal=15)
1515- include 'run_config.inc'
1516- integer max_read
1517- parameter (max_read = 2000000)
1518-c
1519-c Arguments
1520-c
1521- integer kevent
1522- double precision mxwgt,mxwgt1,eff,xsec
1523-c
1524-c Local
1525-c
1526- double precision sum, wgt
1527- double precision p(0:3,maxexternal)
1528- real xwgt(max_read),xtot
1529- integer i,j,k,m, ic(7,maxexternal),n
1530- double precision scale,aqcd,aqed
1531- integer ievent
1532- logical done
1533- character*79 buff
1534-c-----
1535-c Begin Code
1536-c-----
1537- sum=0d0
1538- mxwgt=-1d0
1539- kevent = 0
1540- open(unit=15,file=scaled_file, status='old',err=999)
1541- done=.false.
1542- do while (.not. done)
1543- call read_event(15,P,wgt,n,ic,ievent,scale,aqcd,aqed,done)
1544-c call read_event(15,p,wgt,n,ic,done)
1545- if (.not. done) then
1546- sum=sum+wgt
1547- kevent = kevent+1
1548- xwgt(kevent) = wgt
1549- mxwgt = max(wgt,mxwgt)
1550- endif
1551- if (kevent .ge. max_read) then
1552- write(*,*) 'Error too many events to read in select_events'
1553- $ , kevent
1554- write(*,*) 'Reset max_read in Source/select_events.f'
1555- stop
1556- endif
1557- enddo
1558- 99 close(15)
1559- 55 format(i3,4e19.11)
1560- write(*,*) 'Sorting',kevent
1561- call sort(kevent,xwgt)
1562- xtot = 0d0
1563- i = kevent
1564- do while (xtot-xwgt(i)*(kevent-i) .lt. sum*trunc_max
1565- $ .and. i .gt. 2) !Find out minimum target
1566- xtot = xtot + xwgt(i)
1567- i=i-1
1568- enddo
1569- eff = sum/kevent/xwgt(i)
1570- write(*,*) 'Found ',kevent,' events'
1571- write(*,*) 'Integrated weight',sum
1572- write(*,*) 'Maximum wgt',mxwgt, xwgt(i)
1573- write(*,*) 'Average wgt', sum/kevent
1574- write(*,*) 'Unweight Efficiency', eff
1575- mxwgt1=xwgt(i)
1576- xsec = sum
1577- return
1578- 999 write(*,*) 'Error opening file ',scaled_file
1579-
1580- end
1581-
1582-
1583-
1584- subroutine sort(n,ra)
1585- real ra(n)
1586- l=n/2+1
1587- ir=n
1588-10 continue
1589- if(l.gt.1)then
1590- l=l-1
1591- rra=ra(l)
1592- else
1593- rra=ra(ir)
1594- ra(ir)=ra(1)
1595- ir=ir-1
1596- if(ir.eq.1)then
1597- ra(1)=rra
1598- return
1599- endif
1600- endif
1601- i=l
1602- j=l+l
1603-20 if(j.le.ir)then
1604- if(j.lt.ir)then
1605- if(ra(j).lt.ra(j+1))j=j+1
1606- endif
1607- if(rra.lt.ra(j))then
1608- ra(i)=ra(j)
1609- i=j
1610- j=j+j
1611- else
1612- j=ir+1
1613- endif
1614- go to 20
1615- endif
1616- ra(i)=rra
1617- go to 10
1618- end
1619-
1620- function xran1(idum)
1621- dimension r(97)
1622- parameter (m1=259200,ia1=7141,ic1=54773,rm1=3.8580247e-6)
1623- parameter (m2=134456,ia2=8121,ic2=28411,rm2=7.4373773e-6)
1624- parameter (m3=243000,ia3=4561,ic3=51349)
1625- data iff /0/
1626- save r, ix1,ix2,ix3
1627- if (idum.lt.0.or.iff.eq.0) then
1628- iff=1
1629- ix1=mod(ic1-idum,m1)
1630- ix1=mod(ia1*ix1+ic1,m1)
1631- ix2=mod(ix1,m2)
1632- ix1=mod(ia1*ix1+ic1,m1)
1633- ix3=mod(ix1,m3)
1634- do 11 j=1,97
1635- ix1=mod(ia1*ix1+ic1,m1)
1636- ix2=mod(ia2*ix2+ic2,m2)
1637- r(j)=(float(ix1)+float(ix2)*rm2)*rm1
1638-11 continue
1639- idum=1
1640- endif
1641- ix1=mod(ia1*ix1+ic1,m1)
1642- ix2=mod(ia2*ix2+ic2,m2)
1643- ix3=mod(ia3*ix3+ic3,m3)
1644- j=1+(97*ix3)/m3
1645- if(j.gt.97.or.j.lt.1)then
1646- write(*,*) 'j is bad in ran1.f',j, 97d0*ix3/m3
1647- pause
1648- endif
1649- xran1=r(j)
1650- r(j)=(float(ix1)+float(ix2)*rm2)*rm1
1651- return
1652- end
1653-
1654-
1655
1656=== modified file 'Template/Source/setrun.f'
1657--- Template/Source/setrun.f 2011-08-24 23:32:31 +0000
1658+++ Template/Source/setrun.f 2012-02-04 00:00:36 +0000
1659@@ -20,6 +20,11 @@
1660 double precision D
1661 common/to_dj/D
1662 c
1663+c PARAM_CARD
1664+c
1665+ character*30 param_card_name
1666+ common/to_param_card_name/param_card_name
1667+c
1668 c local
1669 c
1670 integer npara
1671@@ -372,13 +377,13 @@
1672
1673 if(lp1.ne.0.or.lp2.ne.0) then
1674 write(*,*) 'A PDF is used, so alpha_s(MZ) is going to be modified'
1675- call setpara('param_card.dat',.true.)
1676+ call setpara(param_card_name)
1677 asmz=G**2/(16d0*atan(1d0))
1678 write(*,*) 'Old value of alpha_s from param_card: ',asmz
1679 call pdfwrap
1680 write(*,*) 'New value of alpha_s from PDF ',pdlabel,':',asmz
1681 else
1682- call setpara('param_card.dat',.true.)
1683+ call setpara(param_card_name)
1684 asmz=G**2/(16d0*atan(1d0))
1685 nloop=2
1686 pdlabel='none'
1687
1688=== removed file 'Template/SubProcesses/check_dip.f'
1689--- Template/SubProcesses/check_dip.f 2010-10-30 03:26:37 +0000
1690+++ Template/SubProcesses/check_dip.f 1970-01-01 00:00:00 +0000
1691@@ -1,537 +0,0 @@
1692- PROGRAM DRIVER
1693-C**************************************************************************
1694-C THIS IS THE DRIVER FOR CHECKING THE STANDALONE MATRIX ELEMENT
1695-C INCLUDING SUBTRACTION TERMS IN THE SOFT/COLINEAR LIMITS.
1696-C IT USES A SIMPLE PHASE SPACE GENERATOR
1697-C Fabio Maltoni - 3rd Febraury 2007
1698-C Updated by Nicolas Greiner and Rikkert Frederix for the
1699-C dipole terms - July 2008
1700-C**************************************************************************
1701- IMPLICIT NONE
1702-C
1703-C CONSTANTS
1704-C
1705- REAL*8 ZERO
1706- PARAMETER (ZERO=0D0)
1707-C
1708-C INCLUDE FILES
1709-C
1710-C--- the include file with the values of the parameters and masses
1711- INCLUDE "coupl.inc"
1712-C--- integer nexternal ! number particles (incoming+outgoing) in the me
1713- INCLUDE "nexternal.inc"
1714-C--- particle masses
1715- REAL*8 PMASS(NEXTERNAL)
1716-C--- integer n_max_cg
1717- INCLUDE "ngraphs.inc" !how many diagrams (could be useful to know...)
1718- INCLUDE "dipole.inc"
1719-C
1720-C LOCAL
1721-C
1722- INTEGER I,J,K,l,m,l1,m1
1723- REAL*8 P(0:3,NEXTERNAL) ! four momenta. Energy is the zeroth component.
1724- REAL*8 SQRTS ! sqrt(s)= center of mass energy
1725- REAL*8 ME,SUBTRACT,SUBTRACT2 ! Matrix Element and subtraction terms
1726- real*8 s(nexternal,nexternal)! Final state invariants
1727- real*8 start,number ! Starting value for invariants and the number of phase space points
1728- logical cut ! Cut to prevent going into double limits
1729- real*8 sum,x(2)
1730-C
1731-C EXTERNAL
1732-C
1733- REAL*8 DOT
1734- EXTERNAL DOT
1735-
1736-C-----
1737-C BEGIN CODE
1738-C-----
1739-C
1740-C--- INITIALIZATION CALLS
1741-C
1742-c--- Call to initialize the values of the couplings, masses and widths
1743-c used in the evaluation of the matrix element. The primary parameters of the
1744-c models are read from Cards/param_card.dat. The secondary parameters are calculated
1745-c in Source/MODEL/couplings.f. The values are stored in common blocks that are listed
1746-c in coupl.inc .
1747-
1748- call setpara('param_card.dat',.true.) !first call to setup the paramaters
1749- mu = 91.188d0 !renormalization scale
1750- muf = 91.188d0 !factorization scale
1751- include "pmass.inc" !set up masses
1752-
1753- SQRTS=1000d0 !CMS energy in GEV
1754- x(1)=1d0 !Bjorken x's
1755- x(2)=1d0
1756- number=1000000 !Number of phase space points
1757-
1758-
1759-c********************************************************************************************
1760-C First do the collinear limits:
1761-c********************************************************************************************
1762- write (*,*) 'Check of all the collinear limits:'
1763-c Loop over all possible limits of final sate
1764- do l=1,nexternal-1
1765- do m=l+1,nexternal
1766-
1767- start=100d0
1768- write (*,*) ' '
1769- write (*,'(2A)')'-----------------------------------------',
1770- . '------------------------------------------------------'
1771- write (*,*) ' Limit: p(',l,').p(',m,') goes to zero'
1772- write (*,'(2A)')'-----------------------------------------',
1773- . '------------------------------------------------------'
1774- write (*,11) 'p(',l,').p(',m,')/s(1,2) ,',' sqrt(s(',l
1775- . ,',',m,')) ,','|M|^2 ,'
1776- . ,'|Sub.term|^2 ,','|M|^2/|Sub.term|^2'
1777- write (*,'(2A)')'-----------------------------------------',
1778- . '------------------------------------------------------'
1779-
1780-
1781-c Loop over phase space points
1782- do i=1,number
1783-
1784-c--- Now use a simple multipurpose PS generator (RAMBO) just to get a
1785-c RANDOM set of four momenta of given masses pmass(i) to be used to evaluate
1786-c the madgraph matrix-element and the subtraction terms.
1787-c
1788- CALL GET_MOMENTA(SQRTS,PMASS,P)
1789-
1790-c Calculate all the final state invariants
1791- do l1=1,nexternal-1
1792- do m1=l1+1,nexternal
1793- s(l1,m1)=dot(p(0,l1),p(0,m1))
1794- enddo
1795- enddo
1796-
1797- cut =.false.
1798-c Only continue if we are closer to the limit then the starting value.
1799-c If we pass the if statement, update 'start' with the new value.
1800- if(s(l,m)/s(1,2) .lt. start) then
1801-
1802-c Make sure that we are only looking in a single collinear limit. Double
1803-c logarithms are not cancelled by the dipoles. Do this by cutting
1804-c away the phase-space point if any of the other final state invariants
1805-c is smaller than 10% of the CMS energy.
1806- do j=1,nexternal-1
1807- do k=j+1,nexternal
1808- if((j.ne.l).or.(k.ne.m)) then
1809- if(s(j,k)/s(1,2).lt.0.01d0) then
1810- cut=.true.
1811- endif
1812- endif
1813- enddo
1814- enddo
1815-
1816-c If we found a point closer to the limit, update 'start' and
1817-c calculate the matrix element and subtraction terms.
1818- if(.not.cut) then
1819- start=s(l,m)/s(1,2)
1820- CALL SMATRIX(P,ME)
1821- Call DIPOLSUM(P,X,1d0,SUBTRACT)
1822-c Uncomment the following 2 lines to include the possible non-divergent dipoles,
1823-c i.e. dipoles for which the unresolved is massive (= in particles.dat the mass
1824-c is set to something different from 'ZERO').
1825-c Call DIPOLSUMFINITE(P,X,1d0,SUBTRACT2)
1826-c SUBTRACT=SUBTRACT+SUBTRACT2
1827-
1828-c Write out the results
1829- Write (*,10)s(l,m)/s(1,2),' ,',dsqrt(abs(
1830- & (p(0,l)+p(0,m))**2-(p(1,l)+p(1,m))**2
1831- & -(p(2,l)+p(2,m))**2-(p(3,l)+p(3,m))**2))
1832- & ,' ,',ME,' ,',SUBTRACT,' ,',ME/SUBTRACT
1833- endif
1834- endif
1835- enddo
1836- enddo
1837- enddo
1838-
1839-
1840-
1841-
1842-
1843-
1844-
1845-c********************************************************************************
1846-C Now check also the soft limits:
1847-c********************************************************************************
1848- do i=1,5
1849- write (*,*) ' '
1850- enddo
1851- write (*,*) 'Check off all the soft limits:'
1852-c loop over all final state particles:
1853- do l=3, nexternal
1854-
1855- start=100d0
1856- write (*,*) ' '
1857- write (*,'(2A)')'-----------------------------------------',
1858- . '------------------------------------------------------'
1859- write (*,*) ' Limit: p(',l,') goes soft'
1860- write (*,'(2A)')'-----------------------------------------',
1861- . '------------------------------------------------------'
1862- write (*,13) 'p(0,',l,')^2/s(1,2) ,','|M|^2 ,'
1863- . ,'|Sub.term|^2 ,','|M|^2/|Sub.term|^2'
1864- write (*,'(2A)')'-----------------------------------------',
1865- . '------------------------------------------------------'
1866-
1867-c Loop over phase space points
1868- do i=1,number
1869-
1870-c Get the random set of 4-momenta
1871- CALL GET_MOMENTA(SQRTS,PMASS,P)
1872-
1873-c Calculate all the final state invariants
1874- do l1=1,nexternal-1
1875- do m1=l1+1,nexternal
1876- s(l1,m1)=dot(p(0,l1),p(0,m1))
1877- enddo
1878- enddo
1879-
1880- cut =.false.
1881- sum = 0d0
1882-c Only continue if we are closer to the limit then the starting value.
1883-c If we pass the if statement, update 'start' with the new value.
1884- if(p(0,l)**2/s(1,2) .lt. start) then
1885-
1886-c Make sure that we are only looking at the soft limit. Do this by cutting
1887-c away the phase-space point if any of the other final state invariants
1888-c is smaller than 10% of the CMS energy.
1889- do j=1,nexternal-1
1890- do k=j+1,nexternal
1891- if((j.ne.l).and.(k.ne.l)) then
1892- if(s(j,k)/s(1,2).lt.0.01d0) then
1893- cut=.true.
1894- endif
1895- endif
1896- if((j.eq.l).or.(k.eq.l))then
1897- sum=sum+s(j,k)
1898- endif
1899- enddo
1900- enddo
1901-c cut away points that are collinear by forcing that all the invariants
1902-c with the soft particle contribute at least 2*nexternal'th to the sum. This
1903-c makes sure that all these invariants go to zero at the same time.
1904- do j=1,nexternal-1
1905- do k=j+1,nexternal
1906- if(((j.eq.l).or.(k.eq.l)).and.
1907- . (s(j,k).lt.sum/real(2*nexternal)))then
1908- cut=.true.
1909- endif
1910- enddo
1911- enddo
1912-
1913-c If we found a point closer to the limit, update 'start' and
1914-c calculate the matrix element and subtraction terms.
1915- if(.not.cut) then
1916- start=p(0,l)**2/s(1,2)
1917- CALL SMATRIX(P,ME)
1918- Call DIPOLSUM(P,X,1d0,SUBTRACT)
1919-c Uncomment the following 2 lines to include the possible non-divergent dipoles,
1920-c i.e. dipoles for which the unresolved is massive (= in particles.dat the mass
1921-c is set to something different from 'ZERO').
1922-c Call DIPOLSUMFINITE(P,X,1d0,SUBTRACT2)
1923-c SUBTRACT=SUBTRACT+SUBTRACT2
1924-
1925-c Write out the results
1926- Write (*,14) p(0,l)/s(1,2),
1927- . ' ,',ME,' ,',SUBTRACT,' ,',ME/SUBTRACT
1928- endif
1929- endif
1930- enddo
1931-
1932- enddo
1933-
1934-
1935- 10 format(1X,e18.6,A2,e16.6,A2,e16.6,A2,e16.6,A2,e16.6)
1936- 11 format(1X,A2,I2,A4,I2,A,1X,A,I2,A1,I2,A,A18,A18,A20)
1937- 14 format(1X,e18.6,A2,e16.6,A2,e16.6,A2,e16.6)
1938- 13 format(3X,A4,I2,A12,A18,A18,A20)
1939-
1940- end
1941-
1942-
1943-
1944-
1945- double precision function dot(p1,p2)
1946-C****************************************************************************
1947-C 4-Vector Dot product
1948-C****************************************************************************
1949- implicit none
1950- double precision p1(0:3),p2(0:3)
1951- dot=p1(0)*p2(0)-p1(1)*p2(1)-p1(2)*p2(2)-p1(3)*p2(3)
1952- end
1953-
1954-
1955- SUBROUTINE GET_MOMENTA(ENERGY,PMASS,P)
1956-C---- auxiliary function to change convention between madgraph and rambo
1957-c---- four momenta.
1958- IMPLICIT NONE
1959- INCLUDE "nexternal.inc"
1960-C ARGUMENTS
1961- REAL*8 ENERGY,PMASS(NEXTERNAL),P(0:3,NEXTERNAL),PRAMBO(4,10),WGT
1962-C LOCAL
1963- INTEGER I
1964-
1965- P(0,1)=energy/2
1966- P(1,1)=0d0
1967- P(2,1)=0d0
1968- P(3,1)=energy/2
1969-
1970- P(0,2)=energy/2
1971- P(1,2)=0d0
1972- P(2,2)=0d0
1973- P(3,2)=-energy/2
1974-
1975- call rambo(nexternal-2,energy,pmass(3),prambo,WGT)
1976- DO I=3, NEXTERNAL
1977- P(0,I)=PRAMBO(4,I-2)
1978- P(1,I)=PRAMBO(1,I-2)
1979- P(2,I)=PRAMBO(2,I-2)
1980- P(3,I)=PRAMBO(3,I-2)
1981- ENDDO
1982-
1983- RETURN
1984- END
1985-
1986-
1987- SUBROUTINE RAMBO(N,ET,XM,P,WT)
1988-***********************************************************************
1989-* RAMBO *
1990-* RA(NDOM) M(OMENTA) B(EAUTIFULLY) O(RGANIZED) *
1991-* *
1992-* A DEMOCRATIC MULTI-PARTICLE PHASE SPACE GENERATOR *
1993-* AUTHORS: S.D. ELLIS, R. KLEISS, W.J. STIRLING *
1994-* THIS IS VERSION 1.0 - WRITTEN BY R. KLEISS *
1995-* -- ADJUSTED BY HANS KUIJF, WEIGHTS ARE LOGARITHMIC (20-08-90) *
1996-* *
1997-* N = NUMBER OF PARTICLES *
1998-* ET = TOTAL CENTRE-OF-MASS ENERGY *
1999-* XM = PARTICLE MASSES ( DIM=NEXTERNAL-2 ) *
2000-* P = PARTICLE MOMENTA ( DIM=(4,NEXTERNAL-2) ) *
2001-* WT = WEIGHT OF THE EVENT *
2002-***********************************************************************
2003- IMPLICIT REAL*8(A-H,O-Z)
2004- INCLUDE "nexternal.inc"
2005- DIMENSION XM(NEXTERNAL-2),P(4,NEXTERNAL-2)
2006- DIMENSION Q(4,NEXTERNAL-2),Z(NEXTERNAL-2),R(4),
2007- . B(3),P2(NEXTERNAL-2),XM2(NEXTERNAL-2),
2008- . E(NEXTERNAL-2),V(NEXTERNAL-2),IWARN(5)
2009- SAVE ACC,ITMAX,IBEGIN,IWARN
2010- DATA ACC/1.D-14/,ITMAX/6/,IBEGIN/0/,IWARN/5*0/
2011-*
2012-* INITIALIZATION STEP: FACTORIALS FOR THE PHASE SPACE WEIGHT
2013- IF(IBEGIN.NE.0) GOTO 103
2014- IBEGIN=1
2015- TWOPI=8.*DATAN(1.D0)
2016- PO2LOG=LOG(TWOPI/4.)
2017- Z(2)=PO2LOG
2018- DO 101 K=3,10
2019- 101 Z(K)=Z(K-1)+PO2LOG-2.*LOG(DFLOAT(K-2))
2020- DO 102 K=3,10
2021- 102 Z(K)=(Z(K)-LOG(DFLOAT(K-1)))
2022-*
2023-* CHECK ON THE NUMBER OF PARTICLES
2024- 103 IF(N.GT.1.AND.N.LT.101) GOTO 104
2025- PRINT 1001,N
2026- STOP
2027-*
2028-* CHECK WHETHER TOTAL ENERGY IS SUFFICIENT; COUNT NONZERO MASSES
2029- 104 XMT=0.
2030- NM=0
2031- DO 105 I=1,N
2032- IF(XM(I).NE.0.D0) NM=NM+1
2033- 105 XMT=XMT+ABS(XM(I))
2034- IF(XMT.LE.ET) GOTO 201
2035- PRINT 1002,XMT,ET
2036- STOP
2037-*
2038-* THE PARAMETER VALUES ARE NOW ACCEPTED
2039-*
2040-* GENERATE N MASSLESS MOMENTA IN INFINITE PHASE SPACE
2041- 201 DO 202 I=1,N
2042- r1=rn(1)
2043- C=2.*r1-1.
2044- S=SQRT(1.-C*C)
2045- F=TWOPI*RN(2)
2046- r1=rn(3)
2047- r2=rn(4)
2048- Q(4,I)=-LOG(r1*r2)
2049- Q(3,I)=Q(4,I)*C
2050- Q(2,I)=Q(4,I)*S*COS(F)
2051- 202 Q(1,I)=Q(4,I)*S*SIN(F)
2052-*
2053-* CALCULATE THE PARAMETERS OF THE CONFORMAL TRANSFORMATION
2054- DO 203 I=1,4
2055- 203 R(I)=0.
2056- DO 204 I=1,N
2057- DO 204 K=1,4
2058- 204 R(K)=R(K)+Q(K,I)
2059- RMAS=SQRT(R(4)**2-R(3)**2-R(2)**2-R(1)**2)
2060- DO 205 K=1,3
2061- 205 B(K)=-R(K)/RMAS
2062- G=R(4)/RMAS
2063- A=1./(1.+G)
2064- X=ET/RMAS
2065-*
2066-* TRANSFORM THE Q'S CONFORMALLY INTO THE P'S
2067- DO 207 I=1,N
2068- BQ=B(1)*Q(1,I)+B(2)*Q(2,I)+B(3)*Q(3,I)
2069- DO 206 K=1,3
2070- 206 P(K,I)=X*(Q(K,I)+B(K)*(Q(4,I)+A*BQ))
2071- 207 P(4,I)=X*(G*Q(4,I)+BQ)
2072-*
2073-* CALCULATE WEIGHT AND POSSIBLE WARNINGS
2074- WT=PO2LOG
2075- IF(N.NE.2) WT=(2.*N-4.)*LOG(ET)+Z(N)
2076- IF(WT.GE.-180.D0) GOTO 208
2077- IF(IWARN(1).LE.5) PRINT 1004,WT
2078- IWARN(1)=IWARN(1)+1
2079- 208 IF(WT.LE. 174.D0) GOTO 209
2080- IF(IWARN(2).LE.5) PRINT 1005,WT
2081- IWARN(2)=IWARN(2)+1
2082-*
2083-* RETURN FOR WEIGHTED MASSLESS MOMENTA
2084- 209 IF(NM.NE.0) GOTO 210
2085-* RETURN LOG OF WEIGHT
2086- WT=WT
2087- RETURN
2088-*
2089-* MASSIVE PARTICLES: RESCALE THE MOMENTA BY A FACTOR X
2090- 210 XMAX=SQRT(1.-(XMT/ET)**2)
2091- DO 301 I=1,N
2092- XM2(I)=XM(I)**2
2093- 301 P2(I)=P(4,I)**2
2094- ITER=0
2095- X=XMAX
2096- ACCU=ET*ACC
2097- 302 F0=-ET
2098- G0=0.
2099- X2=X*X
2100- DO 303 I=1,N
2101- E(I)=SQRT(XM2(I)+X2*P2(I))
2102- F0=F0+E(I)
2103- 303 G0=G0+P2(I)/E(I)
2104- IF(ABS(F0).LE.ACCU) GOTO 305
2105- ITER=ITER+1
2106- IF(ITER.LE.ITMAX) GOTO 304
2107- PRINT 1006,ITMAX
2108- GOTO 305
2109- 304 X=X-F0/(X*G0)
2110- GOTO 302
2111- 305 DO 307 I=1,N
2112- V(I)=X*P(4,I)
2113- DO 306 K=1,3
2114- 306 P(K,I)=X*P(K,I)
2115- 307 P(4,I)=E(I)
2116-*
2117-* CALCULATE THE MASS-EFFECT WEIGHT FACTOR
2118- WT2=1.
2119- WT3=0.
2120- DO 308 I=1,N
2121- WT2=WT2*V(I)/E(I)
2122- 308 WT3=WT3+V(I)**2/E(I)
2123- WTM=(2.*N-3.)*LOG(X)+LOG(WT2/WT3*ET)
2124-*
2125-* RETURN FOR WEIGHTED MASSIVE MOMENTA
2126- WT=WT+WTM
2127- IF(WT.GE.-180.D0) GOTO 309
2128- IF(IWARN(3).LE.5) PRINT 1004,WT
2129- IWARN(3)=IWARN(3)+1
2130- 309 IF(WT.LE. 174.D0) GOTO 310
2131- IF(IWARN(4).LE.5) PRINT 1005,WT
2132- IWARN(4)=IWARN(4)+1
2133-* RETURN LOG OF WEIGHT
2134- 310 WT=WT
2135- RETURN
2136-*
2137- 1001 FORMAT(' RAMBO FAILS: # OF PARTICLES =',I5,' IS NOT ALLOWED')
2138- 1002 FORMAT(' RAMBO FAILS: TOTAL MASS =',D15.6,' IS NOT',
2139- . ' SMALLER THAN TOTAL ENERGY =',D15.6)
2140- 1004 FORMAT(' RAMBO WARNS: WEIGHT = EXP(',F20.9,') MAY UNDERFLOW')
2141- 1005 FORMAT(' RAMBO WARNS: WEIGHT = EXP(',F20.9,') MAY OVERFLOW')
2142- 1006 FORMAT(' RAMBO WARNS:',I3,' ITERATIONS DID NOT GIVE THE',
2143- . ' DESIRED ACCURACY =',D15.6)
2144- END
2145-
2146- FUNCTION RN(IDUMMY)
2147- REAL*8 RN,RAN
2148- SAVE INIT
2149- DATA INIT /1/
2150- IF (INIT.EQ.1) THEN
2151- INIT=0
2152- CALL RMARIN(1802,9373)
2153- END IF
2154-*
2155- 10 CALL RANMAR(RAN)
2156- IF (RAN.LT.1D-16) GOTO 10
2157- RN=RAN
2158-*
2159- END
2160-
2161-
2162-
2163- SUBROUTINE RANMAR(RVEC)
2164-* -----------------
2165-* Universal random number generator proposed by Marsaglia and Zaman
2166-* in report FSU-SCRI-87-50
2167-* In this version RVEC is a double precision variable.
2168- IMPLICIT REAL*8(A-H,O-Z)
2169- COMMON/ RASET1 / RANU(97),RANC,RANCD,RANCM
2170- COMMON/ RASET2 / IRANMR,JRANMR
2171- SAVE /RASET1/,/RASET2/
2172- UNI = RANU(IRANMR) - RANU(JRANMR)
2173- IF(UNI .LT. 0D0) UNI = UNI + 1D0
2174- RANU(IRANMR) = UNI
2175- IRANMR = IRANMR - 1
2176- JRANMR = JRANMR - 1
2177- IF(IRANMR .EQ. 0) IRANMR = 97
2178- IF(JRANMR .EQ. 0) JRANMR = 97
2179- RANC = RANC - RANCD
2180- IF(RANC .LT. 0D0) RANC = RANC + RANCM
2181- UNI = UNI - RANC
2182- IF(UNI .LT. 0D0) UNI = UNI + 1D0
2183- RVEC = UNI
2184- END
2185-
2186- SUBROUTINE RMARIN(IJ,KL)
2187-* -----------------
2188-* Initializing routine for RANMAR, must be called before generating
2189-* any pseudorandom numbers with RANMAR. The input values should be in
2190-* the ranges 0<=ij<=31328 ; 0<=kl<=30081
2191- IMPLICIT REAL*8(A-H,O-Z)
2192- COMMON/ RASET1 / RANU(97),RANC,RANCD,RANCM
2193- COMMON/ RASET2 / IRANMR,JRANMR
2194- SAVE /RASET1/,/RASET2/
2195-* This shows correspondence between the simplified input seeds IJ, KL
2196-* and the original Marsaglia-Zaman seeds I,J,K,L.
2197-* To get the standard values in the Marsaglia-Zaman paper (i=12,j=34
2198-* k=56,l=78) put ij=1802, kl=9373
2199- I = MOD( IJ/177 , 177 ) + 2
2200- J = MOD( IJ , 177 ) + 2
2201- K = MOD( KL/169 , 178 ) + 1
2202- L = MOD( KL , 169 )
2203- DO 300 II = 1 , 97
2204- S = 0D0
2205- T = .5D0
2206- DO 200 JJ = 1 , 24
2207- M = MOD( MOD(I*J,179)*K , 179 )
2208- I = J
2209- J = K
2210- K = M
2211- L = MOD( 53*L+1 , 169 )
2212- IF(MOD(L*M,64) .GE. 32) S = S + T
2213- T = .5D0*T
2214- 200 CONTINUE
2215- RANU(II) = S
2216- 300 CONTINUE
2217- RANC = 362436D0 / 16777216D0
2218- RANCD = 7654321D0 / 16777216D0
2219- RANCM = 16777213D0 / 16777216D0
2220- IRANMR = 97
2221- JRANMR = 33
2222- END
2223-
2224-
2225-
2226-
2227-
2228-
2229
2230=== removed file 'Template/SubProcesses/check_intdip.f'
2231--- Template/SubProcesses/check_intdip.f 2010-10-30 03:26:37 +0000
2232+++ Template/SubProcesses/check_intdip.f 1970-01-01 00:00:00 +0000
2233@@ -1,401 +0,0 @@
2234- PROGRAM checkintdip
2235-C**************************************************************************
2236-C This is a program for testing the integrated dipoles. For a couple of
2237-C phase space points, chosen by RAMBO, it prints the the singular and
2238-C finite terms for the given process.
2239-C R.Frederix and N.Greiner - February 2010
2240-C**************************************************************************
2241- IMPLICIT NONE
2242-C
2243-C CONSTANTS
2244-C
2245- REAL*8 ZERO
2246- PARAMETER (ZERO=0D0)
2247-C
2248-C INCLUDE FILES
2249-C
2250-C--- the include file with the values of the parameters and masses
2251- INCLUDE "coupl.inc"
2252-C--- integer nexternal ! number particles (incoming+outgoing) in the me
2253- INCLUDE "nexternal.inc"
2254-C--- particle masses
2255- REAL*8 PMASS(NEXTERNAL)
2256-C--- integer n_max_cg
2257- INCLUDE "ngraphs.inc" !how many diagrams (could be useful to know...)
2258- INCLUDE "dipole.inc"
2259-
2260-C
2261-C LOCAL
2262-C
2263- INTEGER I,J,K,l,m,l1,m1, number
2264- REAL*8 P(0:3,NEXTERNAL) ! four momenta. Energy is the zeroth component.
2265- REAL*8 SQRTS ! sqrt(s)= center of mass energy
2266- REAL*8 ME,SUBTRACT,SUBTRACT2 ! Matrix Element and subtraction terms
2267- real*8 start ! Starting value for invariants and the number of phase space points
2268- logical cut ! Cut to prevent going into double limits
2269- real*8 sum,x(2)
2270- real*8 Z, eps,epssq, finite
2271-C
2272-C EXTERNAL
2273-C
2274- REAL*8 DOT
2275- EXTERNAL DOT
2276-
2277-C-----
2278-C BEGIN CODE
2279-C-----
2280-C
2281-C--- INITIALIZATION CALLS
2282-C
2283-c--- Call to initialize the values of the couplings, masses and widths
2284-c used in the evaluation of the matrix element. The primary parameters of the
2285-c models are read from Cards/param_card.dat. The secondary parameters are calculated
2286-c in Source/MODEL/couplings.f. The values are stored in common blocks that are listed
2287-c in coupl.inc .
2288-
2289- call setpara('param_card.dat',.true.) !first call to setup the paramaters
2290- include "pmass.inc" !set up masses
2291- mu = 91.188d0 !renormalization scale
2292- muf = 91.188d0 !factorization scale
2293-
2294- SQRTS=1000d0 !CMS energy in GEV
2295- x(1)=1d0 !Bjorken x's
2296- x(2)=1d0
2297- number=3 !Number of phase space points
2298-
2299-c For this check routine to work properly,
2300-c the last parton should be a massless one
2301- if (pmass(nexternal).ne.0d0) then
2302- write (*,*) 'Error in process order:'
2303- write (*,*) 'Please, change the order of the particles in the'
2304- write (*,*)
2305- & 'process such that the last one is a massless particle'
2306- stop
2307- endif
2308-
2309-c Loop over phase space points
2310- do i=1,number
2311-
2312-c--- Now use a simple multipurpose PS generator (RAMBO) just to get a
2313-c RANDOM set of four momenta of given masses pmass(i) to be used to evaluate
2314-c the integrated dipoles.
2315-c
2316- CALL GET_INT_MOMENTA(SQRTS,PMASS,P,Z)
2317-
2318- CALL INTDIPOLES(P,X,Z,1d0,EPS,EPSSQ,FINITE)
2319-c Note that for the intdipolesfinite the phase space point from
2320-c Rambo is, in general not correct
2321-c CALL INTDIPOLESFINITE(P,X,Z,1d0,EPS,EPSSQ,FINITE)
2322- write (*,*) ' '
2323- write (*,*) 'PHASE SPACE POINT',i,':'
2324- do j=1, nexternal-1
2325- write (*,*)' ',j, P(0,j), P(1,j), P(2,j), P(3,j)
2326- enddo
2327- write (*,*) ' Z =', Z
2328- write (*,*) ' '
2329- write (*,*) ' 1/eps^2: ',epssq
2330- write (*,*) ' 1/eps: ',eps
2331- write (*,*) ' Finite: ',finite
2332- write (*,*) ' '
2333- write (*,*) ' '
2334- enddo
2335-
2336- end
2337-
2338-
2339-
2340- SUBROUTINE GET_INT_MOMENTA(ENERGY,PMASS,P,Z)
2341-C Provide four-momenta for integrated dipoles.
2342-
2343- IMPLICIT NONE
2344- INCLUDE "nexternal.inc"
2345-C ARGUMENTS
2346- REAL*8 ENERGY,PMASS(NEXTERNAL),P(0:3,NEXTERNAL),PRAMBO(4,10),WGT,Z
2347-C LOCAL
2348- INTEGER I
2349-
2350- P(0,1)=energy/2
2351- P(1,1)=0d0
2352- P(2,1)=0d0
2353- P(3,1)=energy/2
2354-
2355- P(0,2)=energy/2
2356- P(1,2)=0d0
2357- P(2,2)=0d0
2358- P(3,2)=-energy/2
2359-
2360- call rambo_int(nexternal-3,energy,pmass(3),prambo,Z)
2361- DO I=3, NEXTERNAL-1
2362- P(0,I)=PRAMBO(4,I-2)
2363- P(1,I)=PRAMBO(1,I-2)
2364- P(2,I)=PRAMBO(2,I-2)
2365- P(3,I)=PRAMBO(3,I-2)
2366- ENDDO
2367-
2368- P(0,nexternal)=0d0
2369- P(1,nexternal)=0d0
2370- P(2,nexternal)=0d0
2371- P(3,nexternal)=0d0
2372-
2373- RETURN
2374- END
2375-
2376-
2377-
2378-
2379- double precision function dot(p1,p2)
2380-C****************************************************************************
2381-C 4-Vector Dot product
2382-C****************************************************************************
2383- implicit none
2384- double precision p1(0:3),p2(0:3)
2385- dot=p1(0)*p2(0)-p1(1)*p2(1)-p1(2)*p2(2)-p1(3)*p2(3)
2386- end
2387-
2388-
2389- SUBROUTINE RAMBO_INT(N,ET,XM,P,Zvar)
2390-C Modified RAMBO suited for integrated dipoles
2391-C R.Frederix and N.Greiner - February 2010
2392-***********************************************************************
2393-* RAMBO *
2394-* RA(NDOM) M(OMENTA) B(EAUTIFULLY) O(RGANIZED) *
2395-* *
2396-* A DEMOCRATIC MULTI-PARTICLE PHASE SPACE GENERATOR *
2397-* AUTHORS: S.D. ELLIS, R. KLEISS, W.J. STIRLING *
2398-* THIS IS VERSION 1.0 - WRITTEN BY R. KLEISS *
2399-* -- ADJUSTED BY HANS KUIJF, WEIGHTS ARE LOGARITHMIC (20-08-90) *
2400-* *
2401-* N = NUMBER OF PARTICLES *
2402-* ET = TOTAL CENTRE-OF-MASS ENERGY *
2403-* XM = PARTICLE MASSES ( DIM=NEXTERNAL-2 ) *
2404-* P = PARTICLE MOMENTA ( DIM=(4,NEXTERNAL-2) ) *
2405-* WT = WEIGHT OF THE EVENT *
2406-***********************************************************************
2407- IMPLICIT REAL*8(A-H,O-Z)
2408- INCLUDE "nexternal.inc"
2409- DIMENSION XM(NEXTERNAL-2),P(4,NEXTERNAL-2)
2410- DIMENSION Q(4,NEXTERNAL-2),Z(NEXTERNAL-2),R(4),
2411- . B(3),P2(NEXTERNAL-2),XM2(NEXTERNAL-2),
2412- . E(NEXTERNAL-2),V(NEXTERNAL-2),IWARN(5)
2413- SAVE ACC,ITMAX,IBEGIN,IWARN
2414- DATA ACC/1.D-14/,ITMAX/6/,IBEGIN/0/,IWARN/5*0/
2415-*
2416-* INITIALIZATION STEP: FACTORIALS FOR THE PHASE SPACE WEIGHT
2417- IF(IBEGIN.NE.0) GOTO 103
2418- IBEGIN=1
2419- TWOPI=8.*DATAN(1.D0)
2420- PO2LOG=LOG(TWOPI/4.)
2421- Z(2)=PO2LOG
2422- DO 101 K=3,10
2423- 101 Z(K)=Z(K-1)+PO2LOG-2.*LOG(DFLOAT(K-2))
2424- DO 102 K=3,10
2425- 102 Z(K)=(Z(K)-LOG(DFLOAT(K-1)))
2426-*
2427-* CHECK ON THE NUMBER OF PARTICLES
2428- 103 IF(N.GT.1.AND.N.LT.101) GOTO 104
2429- PRINT 1001,N
2430- STOP
2431-*
2432-* CHECK WHETHER TOTAL ENERGY IS SUFFICIENT; COUNT NONZERO MASSES
2433- 104 XMT=0.
2434- NM=0
2435- DO 105 I=1,N
2436- IF(XM(I).NE.0.D0) NM=NM+1
2437- 105 XMT=XMT+ABS(XM(I))
2438- IF(XMT.LE.ET) GOTO 201
2439- PRINT 1002,XMT,ET
2440- STOP
2441-*
2442-* THE PARAMETER VALUES ARE NOW ACCEPTED
2443-*
2444-* GENERATE N MASSLESS MOMENTA IN INFINITE PHASE SPACE
2445- 201 DO 202 I=1,N
2446- r1=rn(1)
2447- C=2.*r1-1.
2448- S=SQRT(1.-C*C)
2449- F=TWOPI*RN(2)
2450- r1=rn(3)
2451- r2=rn(4)
2452- Q(4,I)=-LOG(r1*r2)
2453- Q(3,I)=Q(4,I)*C
2454- Q(2,I)=Q(4,I)*S*COS(F)
2455- 202 Q(1,I)=Q(4,I)*S*SIN(F)
2456-
2457- Zvar=rn(1)
2458-*
2459-* CALCULATE THE PARAMETERS OF THE CONFORMAL TRANSFORMATION
2460- DO 203 I=1,4
2461- 203 R(I)=0.
2462- DO 204 I=1,N
2463- DO 204 K=1,4
2464- 204 R(K)=R(K)+Q(K,I)
2465- RMAS=SQRT(R(4)**2-R(3)**2-R(2)**2-R(1)**2)
2466- DO 205 K=1,3
2467- 205 B(K)=-R(K)/RMAS
2468- G=R(4)/RMAS
2469- A=1./(1.+G)
2470- X=ET/RMAS
2471-*
2472-* TRANSFORM THE Q'S CONFORMALLY INTO THE P'S
2473- DO 207 I=1,N
2474- BQ=B(1)*Q(1,I)+B(2)*Q(2,I)+B(3)*Q(3,I)
2475- DO 206 K=1,3
2476- 206 P(K,I)=X*(Q(K,I)+B(K)*(Q(4,I)+A*BQ))
2477- 207 P(4,I)=X*(G*Q(4,I)+BQ)
2478-*
2479-* CALCULATE WEIGHT AND POSSIBLE WARNINGS
2480- WT=PO2LOG
2481- IF(N.NE.2) WT=(2.*N-4.)*LOG(ET)+Z(N)
2482- IF(WT.GE.-180.D0) GOTO 208
2483- IF(IWARN(1).LE.5) PRINT 1004,WT
2484- IWARN(1)=IWARN(1)+1
2485- 208 IF(WT.LE. 174.D0) GOTO 209
2486- IF(IWARN(2).LE.5) PRINT 1005,WT
2487- IWARN(2)=IWARN(2)+1
2488-*
2489-* RETURN FOR WEIGHTED MASSLESS MOMENTA
2490- 209 IF(NM.NE.0) GOTO 210
2491-* RETURN LOG OF WEIGHT
2492- WT=WT
2493- RETURN
2494-*
2495-* MASSIVE PARTICLES: RESCALE THE MOMENTA BY A FACTOR X
2496- 210 XMAX=SQRT(1.-(XMT/ET)**2)
2497- DO 301 I=1,N
2498- XM2(I)=XM(I)**2
2499- 301 P2(I)=P(4,I)**2
2500- ITER=0
2501- X=XMAX
2502- ACCU=ET*ACC
2503- 302 F0=-ET
2504- G0=0.
2505- X2=X*X
2506- DO 303 I=1,N
2507- E(I)=SQRT(XM2(I)+X2*P2(I))
2508- F0=F0+E(I)
2509- 303 G0=G0+P2(I)/E(I)
2510- IF(ABS(F0).LE.ACCU) GOTO 305
2511- ITER=ITER+1
2512- IF(ITER.LE.ITMAX) GOTO 304
2513- PRINT 1006,ITMAX
2514- GOTO 305
2515- 304 X=X-F0/(X*G0)
2516- GOTO 302
2517- 305 DO 307 I=1,N
2518- V(I)=X*P(4,I)
2519- DO 306 K=1,3
2520- 306 P(K,I)=X*P(K,I)
2521- 307 P(4,I)=E(I)
2522-*
2523-* CALCULATE THE MASS-EFFECT WEIGHT FACTOR
2524- WT2=1.
2525- WT3=0.
2526- DO 308 I=1,N
2527- WT2=WT2*V(I)/E(I)
2528- 308 WT3=WT3+V(I)**2/E(I)
2529- WTM=(2.*N-3.)*LOG(X)+LOG(WT2/WT3*ET)
2530-*
2531-* RETURN FOR WEIGHTED MASSIVE MOMENTA
2532- WT=WT+WTM
2533- IF(WT.GE.-180.D0) GOTO 309
2534- IF(IWARN(3).LE.5) PRINT 1004,WT
2535- IWARN(3)=IWARN(3)+1
2536- 309 IF(WT.LE. 174.D0) GOTO 310
2537- IF(IWARN(4).LE.5) PRINT 1005,WT
2538- IWARN(4)=IWARN(4)+1
2539-* RETURN LOG OF WEIGHT
2540- 310 WT=WT
2541- RETURN
2542-*
2543- 1001 FORMAT(' RAMBO FAILS: # OF PARTICLES =',I5,' IS NOT ALLOWED')
2544- 1002 FORMAT(' RAMBO FAILS: TOTAL MASS =',D15.6,' IS NOT',
2545- . ' SMALLER THAN TOTAL ENERGY =',D15.6)
2546- 1004 FORMAT(' RAMBO WARNS: WEIGHT = EXP(',F20.9,') MAY UNDERFLOW')
2547- 1005 FORMAT(' RAMBO WARNS: WEIGHT = EXP(',F20.9,') MAY OVERFLOW')
2548- 1006 FORMAT(' RAMBO WARNS:',I3,' ITERATIONS DID NOT GIVE THE',
2549- . ' DESIRED ACCURACY =',D15.6)
2550- END
2551-
2552- FUNCTION RN(IDUMMY)
2553- REAL*8 RN,RAN
2554- SAVE INIT
2555- DATA INIT /1/
2556- IF (INIT.EQ.1) THEN
2557- INIT=0
2558- CALL RMARIN(1802,9373)
2559- END IF
2560-*
2561- 10 CALL RANMAR(RAN)
2562- IF (RAN.LT.1D-16) GOTO 10
2563- RN=RAN
2564-*
2565- END
2566-
2567-
2568-
2569- SUBROUTINE RANMAR(RVEC)
2570-* -----------------
2571-* Universal random number generator proposed by Marsaglia and Zaman
2572-* in report FSU-SCRI-87-50
2573-* In this version RVEC is a double precision variable.
2574- IMPLICIT REAL*8(A-H,O-Z)
2575- COMMON/ RASET1 / RANU(97),RANC,RANCD,RANCM
2576- COMMON/ RASET2 / IRANMR,JRANMR
2577- SAVE /RASET1/,/RASET2/
2578- UNI = RANU(IRANMR) - RANU(JRANMR)
2579- IF(UNI .LT. 0D0) UNI = UNI + 1D0
2580- RANU(IRANMR) = UNI
2581- IRANMR = IRANMR - 1
2582- JRANMR = JRANMR - 1
2583- IF(IRANMR .EQ. 0) IRANMR = 97
2584- IF(JRANMR .EQ. 0) JRANMR = 97
2585- RANC = RANC - RANCD
2586- IF(RANC .LT. 0D0) RANC = RANC + RANCM
2587- UNI = UNI - RANC
2588- IF(UNI .LT. 0D0) UNI = UNI + 1D0
2589- RVEC = UNI
2590- END
2591-
2592- SUBROUTINE RMARIN(IJ,KL)
2593-* -----------------
2594-* Initializing routine for RANMAR, must be called before generating
2595-* any pseudorandom numbers with RANMAR. The input values should be in
2596-* the ranges 0<=ij<=31328 ; 0<=kl<=30081
2597- IMPLICIT REAL*8(A-H,O-Z)
2598- COMMON/ RASET1 / RANU(97),RANC,RANCD,RANCM
2599- COMMON/ RASET2 / IRANMR,JRANMR
2600- SAVE /RASET1/,/RASET2/
2601-* This shows correspondence between the simplified input seeds IJ, KL
2602-* and the original Marsaglia-Zaman seeds I,J,K,L.
2603-* To get the standard values in the Marsaglia-Zaman paper (i=12,j=34
2604-* k=56,l=78) put ij=1802, kl=9373
2605- I = MOD( IJ/177 , 177 ) + 2
2606- J = MOD( IJ , 177 ) + 2
2607- K = MOD( KL/169 , 178 ) + 1
2608- L = MOD( KL , 169 )
2609- DO 300 II = 1 , 97
2610- S = 0D0
2611- T = .5D0
2612- DO 200 JJ = 1 , 24
2613- M = MOD( MOD(I*J,179)*K , 179 )
2614- I = J
2615- J = K
2616- K = M
2617- L = MOD( 53*L+1 , 169 )
2618- IF(MOD(L*M,64) .GE. 32) S = S + T
2619- T = .5D0*T
2620- 200 CONTINUE
2621- RANU(II) = S
2622- 300 CONTINUE
2623- RANC = 362436D0 / 16777216D0
2624- RANCD = 7654321D0 / 16777216D0
2625- RANCM = 16777213D0 / 16777216D0
2626- IRANMR = 97
2627- JRANMR = 33
2628- END
2629-
2630-
2631-
2632-
2633-
2634-
2635
2636=== modified file 'Template/SubProcesses/cuts.f'
2637--- Template/SubProcesses/cuts.f 2011-12-10 01:52:27 +0000
2638+++ Template/SubProcesses/cuts.f 2012-02-04 00:00:36 +0000
2639@@ -207,7 +207,7 @@
2640
2641 if(fixed_ren_scale) then
2642 G = SQRT(4d0*PI*ALPHAS(scale))
2643- call setpara('param_card.dat',.false.)
2644+ call update_as_param()
2645 endif
2646
2647 c Put momenta in the common block to zero to start
2648@@ -696,7 +696,7 @@
2649 enddo
2650 enddo
2651 endif
2652- call setpara('param_card.dat',.false.)
2653+ call update_as_param()
2654 endif
2655
2656 IF (FIRSTTIME2) THEN
2657
2658=== removed file 'Template/SubProcesses/driver.f'
2659--- Template/SubProcesses/driver.f 2011-04-26 18:45:41 +0000
2660+++ Template/SubProcesses/driver.f 1970-01-01 00:00:00 +0000
2661@@ -1,289 +0,0 @@
2662- Program DRIVER
2663-c**************************************************************************
2664-c This is the driver for the whole calulation
2665-c**************************************************************************
2666- implicit none
2667-C
2668-C CONSTANTS
2669-C
2670- double precision zero
2671- parameter (ZERO = 0d0)
2672- include 'genps.inc'
2673- include 'maxconfigs.inc'
2674- include 'nexternal.inc'
2675- INTEGER ITMAX, NCALL
2676-C
2677-C LOCAL
2678-C
2679- integer i,ninvar,nconfigs,j,l,l1,l2,ndim
2680- double precision dsig,tot,mean,sigma
2681- integer npoints,lunsud
2682- double precision x,y,jac,s1,s2,xmin
2683- external dsig
2684- character*130 buf
2685- integer NextUnopen
2686- external NextUnopen
2687-c
2688-c Global
2689-c
2690- integer nsteps
2691- character*40 result_file,where_file
2692- common /sample_status/result_file,where_file,nsteps
2693- integer Minvar(maxdim,lmaxconfigs)
2694- common /to_invar/ Minvar
2695- integer ngroup
2696- common/to_group/ngroup
2697- data ngroup/0/
2698-cc
2699- include 'run.inc'
2700-
2701- integer mincfig, maxcfig
2702- common/to_configs/mincfig, maxcfig
2703-
2704-
2705- double precision twgt, maxwgt,swgt(maxevents)
2706- integer lun, nw
2707- common/to_unwgt/twgt, maxwgt, swgt, lun, nw
2708-
2709-c--masses
2710- double precision pmass(nexternal)
2711- common/to_mass/ pmass
2712- double precision qmass(2)
2713- common/to_qmass/ qmass
2714-
2715-c $B$ new_def $E$ this is a tag for MadWeigth, Don't edit this line
2716-
2717-c double precision xsec,xerr
2718-c integer ncols,ncolflow(maxamps),ncolalt(maxamps),ic
2719-c common/to_colstats/ncols,ncolflow,ncolalt,ic
2720-
2721- include 'coupl.inc'
2722-
2723-C-----
2724-C BEGIN CODE
2725-C-----
2726-c
2727-c Read process number
2728-c
2729- open (unit=lun+1,file='../dname.mg',status='unknown',err=11)
2730- read (lun+1,'(a130)',err=11,end=11) buf
2731- l1=index(buf,'P')
2732- l2=index(buf,'_')
2733- if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1)
2734- $ read(buf(l1+1:l2-1),*,err=11) ngroup
2735- 11 print *,'Process in group number ',ngroup
2736-
2737- lun = 27
2738- twgt = -2d0 !determine wgt after first iteration
2739- open(unit=lun,status='scratch')
2740- nsteps=2
2741- call setrun !Sets up run parameters
2742-c $B$ setpara $B$ ! this is a tag for MadWeight. Don't edit this line
2743- call setpara('param_card.dat',.true.) !Sets up couplings and masses
2744-c $E$ setpara $E$ ! this is a tag for MadWeight. Don't edit this line
2745- include 'pmass.inc' !Sets up particle masses
2746- include 'qmass.inc' !Sets up particle masses inside onium state
2747- call setcuts !Sets up cuts
2748- call printout !Prints out a summary of paramaters
2749- call run_printout !Prints out a summary of the run settings
2750- nconfigs = 1
2751-
2752-c If CKKW-type matching, read IS Sudakov grid
2753- if(ickkw.eq.2 .and. (lpp(1).ne.0.or.lpp(2).ne.0))then
2754- lunsud=NextUnopen()
2755- open(unit=lunsud,file=issgridfile,status='old',ERR=20)
2756- goto 40
2757- 20 issgridfile='lib/'//issgridfile
2758- do i=1,5
2759- open(unit=lunsud,file=issgridfile,status='old',ERR=30)
2760- exit
2761- 30 issgridfile='../'//issgridfile
2762- if(i.eq.5)then
2763- print *,'ERROR: No Sudakov grid file found in lib with ickkw=2'
2764- stop
2765- endif
2766- enddo
2767- print *,'Reading Sudakov grid file ',issgridfile
2768- 40 call readgrid(lunsud)
2769- print *,'Done reading IS Sudakovs'
2770- endif
2771-
2772- if(ickkw.eq.2)then
2773- hmult=.false.
2774- if(ngroup.ge.nhmult) hmult=.true.
2775- if(hmult)then
2776- print *,'Running CKKW as highest mult sample'
2777- else
2778- print *,'Running CKKW as lower mult sample'
2779- endif
2780- endif
2781-
2782-c
2783-c Get user input
2784-c
2785- write(*,*) "getting user params"
2786- call get_user_params(ncall,itmax,mincfig)
2787- maxcfig=mincfig
2788- minvar(1,1) = 0 !This tells it to map things invarients
2789- write(*,*) 'Attempting mappinvarients',nconfigs,nexternal
2790- call map_invarients(minvar,nconfigs,ninvar,mincfig,maxcfig,nexternal,nincoming)
2791- write(*,*) "Completed mapping",nexternal
2792- ndim = 3*(nexternal-2)-4
2793- if (abs(lpp(1)) .ge. 1) ndim=ndim+1
2794- if (abs(lpp(2)) .ge. 1) ndim=ndim+1
2795- ninvar = ndim
2796- do j=mincfig,maxcfig
2797- if (abs(lpp(1)) .ge. 1 .and. abs(lpp(1)) .ge. 1) then
2798- minvar(ndim-1,j)=ninvar-1
2799- minvar(ndim,j) = ninvar
2800- elseif (abs(lpp(1)) .ge. 1 .or. abs(lpp(1)) .ge. 1) then
2801- minvar(ndim,j) = ninvar
2802- endif
2803- enddo
2804- write(*,*) "about to integrate ", ndim,ncall,itmax,ninvar,nconfigs
2805- call sample_full(ndim,ncall,itmax,dsig,ninvar,nconfigs)
2806-c
2807-c Now write out events to permanent file
2808-c
2809- if (twgt .gt. 0d0) maxwgt=maxwgt/twgt
2810- write(lun,'(a,f20.5)') 'Summary', maxwgt
2811-
2812-c call store_events
2813-
2814-c write(*,'(a34,20I7)'),'Color flows originally chosen: ',
2815-c & (ncolflow(i),i=1,ncols)
2816-c write(*,'(a34,20I7)'),'Color flows according to diagram:',
2817-c & (ncolalt(i),i=1,ncols)
2818-c
2819-c call sample_result(xsec,xerr)
2820-c write(*,*) 'Final xsec: ',xsec
2821-
2822- rewind(lun)
2823-
2824- close(lun)
2825- end
2826-
2827-c $B$ get_user_params $B$ ! tag for MadWeight
2828-c change this routine to read the input in a file
2829-c
2830- subroutine get_user_params(ncall,itmax,iconfig)
2831-c**********************************************************************
2832-c Routine to get user specified parameters for run
2833-c**********************************************************************
2834- implicit none
2835-c
2836-c Constants
2837-c
2838- include 'nexternal.inc'
2839- include 'maxparticles.inc'
2840-c
2841-c Arguments
2842-c
2843- integer ncall,itmax,iconfig
2844-c
2845-c Local
2846-c
2847- integer i, j, jconfig, ncode
2848- double precision dconfig
2849-c
2850-c Global
2851-c
2852- integer isum_hel
2853- logical multi_channel
2854- common/to_matrix/isum_hel, multi_channel
2855- double precision accur
2856- common /to_accuracy/accur
2857- integer use_cut
2858- common /to_weight/use_cut
2859-
2860- integer lbw(0:nexternal) !Use of B.W.
2861- common /to_BW/ lbw
2862-
2863-c-----
2864-c Begin Code
2865-c-----
2866- write(*,'(a)') 'Enter number of events and iterations: '
2867- read(*,*) ncall,itmax
2868- write(*,*) 'Number of events and iterations ',ncall,itmax
2869- write(*,'(a)') 'Enter desired fractional accuracy: '
2870- read(*,*) accur
2871- write(*,*) 'Desired fractional accuracy: ',accur
2872-
2873- write(*,'(a)') 'Enter 0 for fixed, 2 for adjustable grid: '
2874- read(*,*) use_cut
2875- if (use_cut .lt. 0 .or. use_cut .gt. 2) then
2876- write(*,*) 'Bad choice, using 2',use_cut
2877- use_cut = 2
2878- endif
2879-
2880- write(*,10) 'Suppress amplitude (0 no, 1 yes)? '
2881- read(*,*) i
2882- if (i .eq. 1) then
2883- multi_channel = .true.
2884- write(*,*) 'Using suppressed amplitude.'
2885- else
2886- multi_channel = .false.
2887- write(*,*) 'Using full amplitude.'
2888- endif
2889-
2890- write(*,10) 'Exact helicity sum (0 yes, n = number/event)? '
2891- read(*,*) i
2892- if (i .eq. 0) then
2893- isum_hel = 0
2894- write(*,*) 'Explicitly summing over helicities'
2895- else
2896- isum_hel= i
2897- write(*,*) 'Summing over',i,' helicities/event'
2898- endif
2899-
2900- write(*,10) 'Enter Configuration Number: '
2901- read(*,*) dconfig
2902-c ncode is number of digits needed for the BW code
2903- ncode=int(dlog10(3d0)*(max_particles-3))+1
2904- iconfig = int(dconfig*(1+10**(-ncode)))
2905- write(*,12) 'Running Configuration Number: ',iconfig
2906-c
2907-c Here I want to set up with B.W. we map and which we don't
2908-c
2909- dconfig = dconfig-iconfig
2910- if (dconfig .eq. 0) then
2911- write(*,*) 'Not subdividing B.W.'
2912- lbw(0)=0
2913- else
2914- lbw(0)=1
2915- jconfig=dconfig*(10**ncode + 0.1)
2916- write(*,*) 'Using dconfig=',jconfig
2917- call DeCode(jconfig,lbw(1),3,nexternal)
2918- write(*,*) 'BW Setting ', (lbw(j),j=1,nexternal-2)
2919-c do i=nexternal-3,0,-1
2920-c if (jconfig .ge. 2**i) then
2921-c lbw(i+1)=1
2922-c jconfig=jconfig-2**i
2923-c else
2924-c lbw(i+1)=0
2925-c endif
2926-c write(*,*) i+1, lbw(i+1)
2927-c enddo
2928- endif
2929- 10 format( a)
2930- 12 format( a,i4)
2931- end
2932-c $E$ get_user_params $E$ ! tag for MadWeight
2933-c change this routine to read the input in a file
2934-c
2935-
2936-
2937-
2938-
2939-
2940-
2941-
2942-
2943-
2944-
2945-
2946-
2947-
2948-
2949-
2950-
2951
2952=== modified file 'Template/SubProcesses/unwgt.f'
2953--- Template/SubProcesses/unwgt.f 2011-10-03 08:39:00 +0000
2954+++ Template/SubProcesses/unwgt.f 2012-02-04 00:00:36 +0000
2955@@ -27,8 +27,8 @@
2956 C GLOBAL
2957 C
2958 double precision twgt, maxwgt,swgt(maxevents)
2959- integer lun, nw
2960- common/to_unwgt/twgt, maxwgt, swgt, lun, nw
2961+ integer lun, nw, itmin
2962+ common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin
2963 integer nzoom
2964 double precision tx(1:3,maxinvar)
2965 common/to_xpoints/tx, nzoom
2966@@ -126,8 +126,8 @@
2967 C GLOBAL
2968 C
2969 double precision twgt, maxwgt,swgt(maxevents)
2970- integer lun, nw
2971- common/to_unwgt/twgt, maxwgt, swgt, lun, nw
2972+ integer lun, nw, itmin
2973+ common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin
2974
2975 c-----
2976 c Begin Code
2977@@ -163,8 +163,8 @@
2978 C GLOBAL
2979 C
2980 double precision twgt, maxwgt,swgt(maxevents)
2981- integer lun, nw
2982- common/to_unwgt/twgt, maxwgt, swgt, lun, nw
2983+ integer lun, nw, itmin
2984+ common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin
2985
2986 double precision matrix
2987 common/to_maxmatrix/matrix
2988@@ -245,8 +245,8 @@
2989 C GLOBAL
2990 C
2991 double precision twgt, maxwgt,swgt(maxevents)
2992- integer lun, nw
2993- common/to_unwgt/twgt, maxwgt, swgt, lun, nw
2994+ integer lun, nw, itmin
2995+ common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin
2996
2997 integer neventswritten
2998 common /to_eventswritten/ neventswritten
2999@@ -269,7 +269,7 @@
3000 c First scale all of the events to the total cross section
3001 c
3002 if (nw .le. 0) return
3003- call sample_result(xsec,xerr)
3004+ call sample_result(xsec,xerr,itmin)
3005 if (xsec .le. 0) return !Fix by TS 12/3/2010
3006 xtot=0
3007 call dsort(nw, swgt)
3008@@ -403,8 +403,8 @@
3009 C GLOBAL
3010 C
3011 double precision twgt, maxwgt,swgt(maxevents)
3012- integer lun, nw
3013- common/to_unwgt/twgt, maxwgt, swgt, lun, nw
3014+ integer lun, nw, itmin
3015+ common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin
3016
3017 integer IPROC
3018 DOUBLE PRECISION PD(0:MAXPROC)
3019@@ -596,8 +596,8 @@
3020 C GLOBAL
3021 C
3022 double precision twgt, maxwgt,swgt(maxevents)
3023- integer lun, nw
3024- common/to_unwgt/twgt, maxwgt, swgt, lun, nw
3025+ integer lun, nw, itmin
3026+ common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin
3027 c-----
3028 c Begin Code
3029 c-----
3030
3031=== removed file 'Template/bin/TheChopper-pl'
3032--- Template/bin/TheChopper-pl 2010-10-30 03:26:37 +0000
3033+++ Template/bin/TheChopper-pl 1970-01-01 00:00:00 +0000
3034@@ -1,118 +0,0 @@
3035-#!/usr/bin/perl -w
3036-#------------------------------------------------------------
3037-# Simple script to chop out sub-processes which have a small
3038-# impact on the cross section, in the grid pack.
3039-# This is meant to be run after the gridpack warming up run
3040-# and before packing it up.
3041-#
3042-# The script should be run from the main directory of madevent
3043-# and sits in the bin directory.
3044-#
3045-# This is still version 0, where no classes can be defined.
3046-# However, the result is a script, chop_procs sitting in
3047-# SubProcesses, that can be edited by hand.
3048-#
3049-# Author: Fabio Maltoni
3050-# Date: 10/4/08
3051-# Version: 0.1
3052-#
3053-# HISTORY
3054-#
3055-# 0.2 Fix bug in writing subproc.mg
3056-#
3057-# 0.1 Added the possibility to list SubProc IDs
3058-#
3059-# 0.0 Original
3060-#
3061-#------------------------------------------------------------
3062-
3063-#------------------------------------------------------------
3064-# Auxiliary Ordering function
3065-#------------------------------------------------------------
3066-
3067- sub OrderInc {
3068- $all{$a} <=> $all{$b};
3069- };
3070-
3071-#------------------------------------------------------------
3072-# Input the chopping value. Example : 0.01 = 1%
3073-#------------------------------------------------------------
3074-
3075- print "input chopping off value (e.g., 0.01=1% ):\n";
3076- $cutoff_lim=<STDIN>;
3077-
3078-#------------------------------------------------------------
3079-# Input the SubProcesses ids on which the script should run
3080-#------------------------------------------------------------
3081-
3082- print "Input SubProcesses ids to process (space separated):\n";
3083- @id_list=split('\s+',<STDIN>);
3084-
3085-
3086-#------------------------------------------------------------
3087-# Parse the form, look for known variables
3088-#------------------------------------------------------------
3089-
3090-
3091-
3092- chdir("SubProcesses");
3093- open(SCRIPT,">chop_procs") or die "Could not write chop_procs \n";
3094-
3095- foreach $id (@id_list) {
3096-
3097- print "\n\nNow processing SubProcesses with ID = $id\n";
3098-
3099- my @all_Pdirs = <P$id*>;
3100- my $xsec = 0;
3101- my $perc = 0;
3102- %all = ();
3103- %below = ();
3104-
3105- foreach $arg (@all_Pdirs) {
3106- chdir("$arg");
3107- open(RES,"<default_results.dat") or die "Could not read default_results.dat\n";
3108- my $buff;
3109- my $number_read = read(RES,$buff,12);
3110- print "$arg has xsec $buff\n";
3111- $all{$arg} .= $buff;
3112- $xsec = $xsec + $buff;
3113- close(RES);
3114- chdir("..");
3115- };
3116-
3117- print " total xsec for ID = $id : $xsec\n";
3118- $cutoff=$cutoff_lim*$xsec;
3119- print " cutoff for ID = $id : $cutoff \n";
3120-
3121-
3122-# now I have to order them and find those procs with fall
3123-# below xsec*cutoff.
3124-
3125- $i=0;
3126- $integ[0]=0;
3127- print "Processes in order FOR ID = $id:\n";
3128- foreach $key (sort OrderInc (keys(%all))) {
3129- $integ[$i+1] = $integ[$i] + $all{$key};
3130- if($integ[$i+1] < $cutoff) {
3131- $below{$key} .= $all{$key};
3132- print "$integ[$i+1] : $all{$key} $key => below cutoff\n";}
3133- else {
3134- print "$integ[$i+1] : $all{$key} $key => above cutoff\n";}
3135- $i =$i + 1;
3136-};
3137-#
3138-# Now I move the corresponding procs out of the way
3139-#
3140- print "The following SubProcess will be tagged to be removed:\n";
3141- foreach $key (keys(%below)){
3142- print "$key ";
3143- print SCRIPT "mv $key XXX$key \# $below{$key}\n";
3144-# system("mv $key XXX$key ");
3145- };
3146-# print SCRIPT "ls -d P$id* >subproc.mg\n";
3147-# system("ls -d P* >subproc.mg");
3148- }
3149- print SCRIPT "ls -d P* >subproc.mg";
3150- close(SCRIPT);
3151- system("chmod +x chop_procs");
3152-
3153
3154=== removed file 'Template/bin/addmasses.py'
3155--- Template/bin/addmasses.py 2010-10-30 03:26:37 +0000
3156+++ Template/bin/addmasses.py 1970-01-01 00:00:00 +0000
3157@@ -1,320 +0,0 @@
3158-#!/usr/bin/python
3159-#
3160-# doubleswitch.py
3161-# Author: Stephen Mrenna
3162-# Add masses to charged leptons, fix kinematics
3163-# Insert W/Z when missing
3164-
3165-import math,sys,re
3166-from xml.dom import minidom
3167-
3168-#tolerance for energy momentum conservation
3169-toler = 1e-4
3170-#lepton masses from PDGLive
3171-massDict = {}
3172-massDict[11]=0.000510998910
3173-massDict[-11]=massDict[11]
3174-massDict[13]=105.6583668e-3
3175-massDict[-13]=massDict[13]
3176-massDict[15]=1.77684
3177-massDict[-15]=massDict[15]
3178-
3179-#print out messages if true
3180-verbose=0
3181-
3182-#default is NOT to insert missing mothers
3183-motherFlag=1
3184-
3185-#useful class to describe 4 momentum
3186-class Momentum:
3187- def __init__(self,px,py,pz,E,m):
3188- self.px=px
3189- self.py=py
3190- self.pz=pz
3191- self.E=E
3192- self.m=m
3193- def __add__(self,other):
3194- t=Momentum(self.px+other.px,self.py+other.py,self.pz+other.pz,self.E+other.E,0)
3195- t.m=t.calcMass()
3196- return t
3197- def __sub__(self,other):
3198- t=Momentum(self.px-other.px,self.py-other.py,self.pz-other.pz,self.E-other.E,0)
3199- t.m=t.calcMass()
3200- return t
3201- def calcMass(self):
3202- tempMass2=self.E**2-self.px**2-self.py**2-self.pz**2
3203- if tempMass2 > 0:
3204- t=math.sqrt(tempMass2)
3205- if t>toler:
3206- return t
3207- else:
3208- return 0
3209- else:
3210- return 0
3211- def boost(self,ref,rdir):
3212- pmag=ref.E
3213- DBX=ref.px*rdir/pmag
3214- DBY=ref.py*rdir/pmag
3215- DBZ=ref.pz*rdir/pmag
3216- DB=math.sqrt(DBX**2+DBY**2+DBZ**2)
3217- DGA=1.0/math.sqrt(1.0-DB**2)
3218- DBP=DBX*self.px+DBY*self.py+DBZ*self.pz
3219- DGABP=DGA*(DGA*DBP/(1.0+DGA)+self.E)
3220- self.px = self.px+DGABP*DBX
3221- self.py = self.py+DGABP*DBY
3222- self.pz = self.pz+DGABP*DBZ
3223- self.E = DGA*(self.E+DBP)
3224- def reScale(self,pi,po):
3225- self.px = self.px/pi*po
3226- self.py = self.py/pi*po
3227- self.pz = self.pz/pi*po
3228- def printMe(self):
3229- li = [self.px,self.py, self.pz, self.E, self.m]
3230- print "| %18.10E %18.10E %18.10E %18.10E %18.10E |" % tuple(li)
3231-
3232-#useful class to describe a particle
3233-class Particle:
3234- def __init__(self,i,l):
3235- self.no = i
3236- self.id = l[0]
3237- self.status = l[1]
3238- self.mo1 = l[2]
3239- self.mo2 = l[3]
3240- self.co1 = l[4]
3241- self.co2 = l[5]
3242- self.mom = Momentum(l[6],l[7],l[8],l[9],l[10])
3243- self.life = l[11]
3244- self.polar = l[12]
3245- def printMe(self):
3246- li = [self.no, self.id, self.status,self.mo1, self.mo2, self.co1, self.co2, self.mom.px,self.mom.py, self.mom.pz, self.mom.E, self.mom.m, self.life, self.polar]
3247- print "%2i | %9i | %4i | %4i %4i | %4i %4i | %18.10E %18.10E %18.10E %18.10E %18.10E | %1.0f. %2.0f" % tuple(li)
3248- def writeMe(self):
3249- li = [self.id, self.status,self.mo1, self.mo2, self.co1, self.co2, self.mom.px,self.mom.py, self.mom.pz, self.mom.E, self.mom.m, self.life, self.polar]
3250- return "%9i %4i %4i %4i %4i %4i %18.10E %18.10E %18.10E %18.10E %18.10E %1.0f. %2.0f\n" % tuple(li)
3251-
3252-#useful function for converting a string to variables
3253-def parseStringToVars(input):
3254- if input.find(".")>-1 :
3255- return float(input)
3256- else:
3257- return int(input)
3258-
3259-#main part of analysis
3260-if len(sys.argv)!=3:
3261- print "Usage: addmasses.py <infile> <outfile> "
3262- print " Last modified: Fri Nov 21 10:49:14 CST 2008 "
3263- sys.exit(0)
3264-else:
3265- print "Running addmasses.py to add masses and correct kinematics of fixed particles"
3266-
3267-#first print out leading information
3268-try:
3269- f=open(sys.argv[1],'r')
3270-except IOError:
3271- print "need a file for reading"
3272- sys.exit(0)
3273-
3274-try:
3275- g=open(sys.argv[2],'w')
3276-except IOError:
3277- print "need a file for writing"
3278- sys.exit(0)
3279-
3280-while 1:
3281- try:
3282- line=f.readline()
3283- except IOError:
3284- print "Problem reading from file ",sys.argv[1]
3285- sys.exit(0)
3286- if line.find("<event>")==-1:
3287- g.write(line)
3288- else:
3289- break
3290-
3291-f.close()
3292-
3293-#let xml find the event tags
3294-try:
3295- xmldoc = minidom.parse(sys.argv[1])
3296-except IOError:
3297- print " could not open file for xml parsing ",sys.argv[1]
3298- sys.exit(0)
3299-
3300-
3301-reflist = xmldoc.getElementsByTagName('event')
3302-
3303-for ref in reflist:
3304- lines = ref.toxml()
3305- slines = lines.split("\n")
3306- next = 0
3307- nup = 0
3308- nlines = len(slines)
3309- counter = 0
3310- event = []
3311- event_description=""
3312- event_poundSign=""
3313-
3314- while counter<nlines:
3315- s=slines[counter]
3316- if s.find("<event>")>-1:
3317- next=1
3318- elif s.find("</event>")>-1:
3319- pass
3320- elif s.find("#")>-1:
3321- event_poundSign=s
3322- elif next==1:
3323- event_description=s
3324- next=0
3325- elif not s:
3326- continue
3327- else:
3328- t=[]
3329- for l in s.split(): t.append(parseStringToVars(l))
3330- nup = nup+1
3331- event.append(Particle(nup,t))
3332- counter=counter+1
3333-
3334-
3335-#default is to skip this
3336- if motherFlag:
3337-
3338- noMotherList=[]
3339- for p in event:
3340- if p.status == -1: continue
3341- idabs = abs(p.id)
3342- idmo = p.mo1
3343- pmo = event[idmo-1]
3344- if idabs>=11 and idabs<=16:
3345- if p.mo1==1 or (pmo.co1 !=0 or pmo.co2 !=0):
3346- noMotherList.append(p.no)
3347- elif idabs<=5 and abs(pmo.id)==6:
3348- if not ( p.co1==pmo.co1 and p.co2==pmo.co2):
3349- noMotherList.append(p.no)
3350-
3351- nAdded=0
3352- if len(noMotherList)==0:
3353- pass
3354- elif len(noMotherList)%2 != 0:
3355- print "single orphan; do not know how to process"
3356- else:
3357- ki=0
3358- while ki<len(noMotherList)-1:
3359- l1=event[noMotherList[ki]-1]
3360- ki=ki+1
3361- l2=event[noMotherList[ki]-1]
3362- lq=l1.id + l2.id
3363- if lq==-1 or lq==1:
3364- idMom=24*lq
3365- elif lq==0:
3366- idMom=23
3367- else:
3368- break
3369- lMom=l1.mom+l2.mom
3370- lm=[idMom,2,l1.mo1,l1.mo2,0,0,lMom.px,lMom.py,lMom.pz,lMom.E,lMom.calcMass(),0,0]
3371- nup=nup+1
3372- nAdded=nAdded+1
3373- event.append(Particle(nup,lm))
3374- l1.mo1=l1.mo2=l2.mo1=l2.mo2=nup
3375- ki=ki+1
3376-
3377-# update number of partons if mothers added
3378- if nAdded>0:
3379- s1=event_description.split()[0]
3380- mySub = re.compile(s1)
3381- event_description = mySub.sub(str(nup),event_description)
3382-
3383-
3384- if nAdded>0:
3385- totalLength = len(event)+1
3386- newPosition = []
3387- iPos=0
3388- while iPos<totalLength:
3389- for p in event:
3390- if p.mo1==iPos:
3391- newPosition.append(p.no)
3392- iPos=iPos+1
3393-
3394- iUp=1
3395- event0=[]
3396- for ip in newPosition:
3397- event0.append(event[ip-1])
3398-
3399- iUp=0
3400- for p in event0:
3401- iUp=iUp+1
3402- if p.no != iUp:
3403- ip=iUp
3404- while ip<totalLength-1:
3405- pp=event0[ip]
3406- if pp.mo1==p.no and pp.mo1>pp.no:
3407- pp.mo1=pp.mo2=iUp
3408- ip=ip+1
3409- p.no=iUp
3410-
3411- iUp=0
3412- for p in event0:
3413- event[iUp]=event0[iUp]
3414- iUp=iUp+1
3415-
3416-
3417-
3418-
3419-# identify mothers
3420- particleDict={}
3421- for p in event:
3422- idabs = abs(p.id)
3423- if idabs>=11 and idabs<=16:
3424- if p.mo1==1:
3425- pass
3426- else:
3427- if p.mo1 in particleDict:
3428- l=[particleDict[p.mo1]]
3429- l.append(p.no)
3430- else:
3431- l=p.no
3432- particleDict[p.mo1]=l
3433-
3434-# repair kinematics
3435- for k in particleDict:
3436- t=particleDict[k]
3437- p1=event[t[0]-1]
3438- p1.mom.boost(event[k-1].mom,-1)
3439- p2=event[t[1]-1]
3440- p2.mom.boost(event[k-1].mom,-1)
3441- rsh=event[k-1].mom.m
3442- if p1.id in massDict: p1.mom.m=massDict[p1.id]
3443- if p2.id in massDict: p2.mom.m=massDict[p2.id]
3444- p1.mom.E = (rsh*rsh + p1.mom.m**2 - p2.mom.m**2)/(2.0*rsh)
3445- pmagOld=math.sqrt(p1.mom.px**2+p1.mom.py**2+p1.mom.pz**2)
3446- pmagNew=math.sqrt(p1.mom.E**2-p1.mom.m**2)
3447- p1.mom.reScale(pmagOld,pmagNew)
3448- p2.mom = Momentum(0,0,0,rsh,rsh) - p1.mom
3449- p1.mom.boost(event[k-1].mom,1)
3450- p2.mom.boost(event[k-1].mom,1)
3451-
3452- pSum = Momentum(0,0,0,0,0)
3453- for p in event:
3454- if p.status== 2 :
3455- pass
3456- elif p.status==-1:
3457- pSum = pSum - p.mom
3458- elif p.status==1:
3459- pSum = pSum + p.mom
3460-
3461- if abs(pSum.px)>toler or abs(pSum.py)>toler or abs(pSum.pz)>toler or abs(pSum.E)>toler:
3462- print "Event does not pass tolerance ",toler
3463- pSum.printMe()
3464-
3465- if 1:
3466- g.write("<event>\n")
3467- g.write(event_description+"\n")
3468- for p in event:
3469- g.write(p.writeMe())
3470- g.write(event_poundSign+"\n")
3471- g.write("</event>\n")
3472-#at the end
3473-g.write("</LesHouchesEvents>\n")
3474-g.close()
3475-
3476-
3477-
3478
3479=== removed file 'Template/bin/calculate_crossx'
3480--- Template/bin/calculate_crossx 2010-10-30 03:26:37 +0000
3481+++ Template/bin/calculate_crossx 1970-01-01 00:00:00 +0000
3482@@ -1,140 +0,0 @@
3483-#!/bin/bash
3484-#
3485-# This runs survey,refine,unweight_events, one after the other
3486-#
3487-# First we need to get into the main directory
3488-#
3489-#
3490-# Usage: generate_events compression events parallel [name]
3491-#
3492-
3493-if [[ ! -d ./bin ]]; then
3494- cd ../
3495- if [[ ! -d ./bin ]]; then
3496- echo "Error: it must be executed from the main, or bin directory"
3497- exit
3498- fi
3499-fi
3500-#
3501-# Now let shell know where to find important executables
3502-#
3503-main=`pwd`
3504-dirbin=$main/bin
3505-pydir=$main/../pythia-pgs/src
3506-pgsdir=$pydir
3507-ERAdir=$main/../ExRootAnalysis
3508-webbin=$dirbin
3509-td=$dirbin/td
3510-web=0
3511-
3512-echo $$ >> myprocid
3513-
3514-#if ( "$1" == "" ) then
3515-# echo 'Number of unweighted events. This is ingnored and read from run_card.dat '
3516-# set a = $<
3517-#else
3518-# set a = $1
3519-#endif
3520-if [[ "$1" == "" ]]; then
3521- echo 'Enter 1 for parallel 0 for serial run'
3522- read p
3523-else
3524- p=$1
3525-fi
3526-n=MadEvent
3527-if [[ $p -gt 0 ]]; then
3528- if [[ "$2" == "" ]]; then
3529- echo 'Enter name for jobs on pbs queue'
3530- read n
3531- else
3532- n=$2
3533- fi
3534- if [[ "$3" == "" ]]; then
3535- echo 'Enter run name'
3536- read t
3537- else
3538- t=$3
3539- fi
3540-else
3541- if [[ "$2" == "" ]]; then
3542- echo 'Enter run name'
3543- read t
3544- else
3545- t=$2
3546- fi
3547-fi
3548-#set t = TeV2
3549-if [[ ${#argv} -gt 3 ]]; then
3550- web=1
3551- webbin="$MADGRAPH_BASE/MG_ME/WebBin"
3552- pydir="$webbin/pythia-pgs"
3553- pgsdir=$pydir
3554- ERAdir="$MADGRAPH_BASE/MG_ME/ExRootAnalysis"
3555- td=$webbin/td
3556- touch Online
3557-fi
3558-date
3559-a=`awk '/^[^#].*=.*nevents/{print $1}' Cards/run_card.dat`
3560-echo Generating $a events
3561-#
3562-# Check if run already exists. If so, store run w/ new name
3563-# and remove old run before starting.
3564-#
3565-
3566-if [[ -e status ]]; then
3567- rm status
3568-fi
3569-if [[ -e error ]]; then
3570- rm error
3571-fi
3572-touch RunWeb
3573-echo "Cleaning directories" > status
3574-$dirbin/gen_crossxhtml-pl $t
3575-$dirbin/clean
3576-touch survey
3577-echo "Starting jobs" > status
3578-$dirbin/gen_crossxhtml-pl $t
3579-$dirbin/survey $p $n $t
3580-if [[ -e error ]]; then
3581- cat error
3582- date
3583- cp -f error status
3584- rm refine
3585- rm RunWeb
3586- $dirbin/gen_crossxhtml-pl $t
3587- $dirbin/gen_cardhtml-pl
3588- exit
3589-fi
3590-#
3591-# Now collect the events - just to get the banner in fact
3592-#
3593-echo "Combining Events" >& status
3594-echo "Combining Events"
3595-$dirbin/gen_crossxhtml-pl $t
3596-pushd ./Source > /dev/null
3597-make ../bin/combine_events
3598-popd > /dev/null
3599-pushd SubProcesses > /dev/null
3600-$dirbin/run_combine $p
3601-mv events.lhe ../Events/
3602-mv unweighted_events.lhe ../Events/
3603-popd > /dev/null
3604-#
3605-# do the banner
3606-#
3607-cd ./Events
3608-echo "putting the banner"
3609-$dirbin/put_banner events.lhe
3610-$dirbin/put_banner unweighted_events.lhe
3611-cd ../
3612-#
3613-# Store Events
3614-#
3615-echo "Storing Events" >& status
3616-$dirbin/gen_crossxhtml-pl $t
3617-$dirbin/store $t
3618-rm -f RunWeb
3619-echo " " >& status
3620-$dirbin/gen_crossxhtml-pl $t
3621-$dirbin/gen_cardhtml-pl
3622-date
3623
3624=== removed file 'Template/bin/clean4grid'
3625--- Template/bin/clean4grid 2010-10-30 03:26:37 +0000
3626+++ Template/bin/clean4grid 1970-01-01 00:00:00 +0000
3627@@ -1,95 +0,0 @@
3628-#!/bin/bash
3629-#
3630-################################################################################
3631-# ##
3632-# MadGraph/MadEvent ##
3633-# ##
3634-# FILE : clean4grid ##
3635-# VERSION : 1.0 ##
3636-# DATE : 29 Jan 2008 ##
3637-# AUTHORS : MH & RF - MadGraph team ##
3638-# ##
3639-# DESCRIPTION : script to clean package for the grid ##
3640-# USAGE : ./clean4grid ##
3641-################################################################################
3642-
3643-set nonomatch
3644-
3645-if [[ ! -d ./bin ]]; then
3646- cd ../
3647- if [[ ! -d ./bin ]]; then
3648- echo "Error: it must be executed from the main, or bin directory"
3649- exit
3650- fi
3651-fi
3652-
3653-if [[ -d SubProcesses ]]; then
3654- cd SubProcesses
3655- echo -n "Cleaning SubProcesses"
3656- rm -f *.f >& /dev/null
3657- for i in `cat subproc.mg` ; do
3658- cd $i
3659- echo -n "."
3660- rm -f *.o >& /dev/null
3661- rm -f *.f >& /dev/null
3662-# rm -f madevent >& /dev/null
3663-# rm -f *ajob* >& /dev/null
3664- rm -f gensym >& /dev/null
3665- rm -f matrix*.jpg >& /dev/null
3666- rm -f matrix.ps >& /dev/null
3667- rm -f G*/ftn25 >& /dev/null
3668- rm -f G*/ftn26 >& /dev/null
3669- rm -f G*/events.lhe >& /dev/null
3670- cd ..
3671- done
3672- echo " "
3673- cd ../
3674-else
3675- echo "Error could not find SubProcesses"
3676- exit
3677-fi
3678-if [[ -d Source ]]; then
3679- echo "Removing Source:"
3680- cd Source
3681- rm -f *.o >& /dev/null
3682- rm -f *.f >& /dev/null
3683- rm -f *.inc >& /dev/null
3684- rm -f DHELAS/*.F >& /dev/null
3685- rm -f DHELAS/*.f >& /dev/null
3686- rm -f DHELAS/*.o >& /dev/null
3687- rm -f DHELAS/*.inc >& /dev/null
3688- rm -rf DHELAS/Doc >& /dev/null
3689- rm -f MODEL/*.f >& /dev/null
3690- rm -f MODEL/*.o >& /dev/null
3691- rm -f MODEL/*.dat >& /dev/null
3692- rm -f MODEL/*.html >& /dev/null
3693- rm -f PDF/*.f >& /dev/null
3694- rm -f PDF/*.o >& /dev/null
3695- rm -f PDF/*.inc >& /dev/null
3696- cd ..
3697-fi
3698-if [[ -d HTML ]]; then
3699- echo "Removing HTML files:"
3700- rm -f HTML/* >& /dev/null
3701-fi
3702-#if [[ -d lib ]]; then
3703-# cd lib
3704-# echo "Cleaning lib:"
3705-# rm -f *.a >& /dev/null
3706-# cd ../
3707-#else
3708-# echo "Error could not find lib"
3709-# exit
3710-#fi
3711-#if [[ -d bin ]]; then
3712-# cd bin
3713-# echo "Cleaning bin:"
3714-# for i in gen_ximprove scale_events select_events sum_html combine_events; do
3715-# rm -f $i >& /dev/null
3716-# done
3717-# cd ../
3718-#else
3719-# echo "Error could not find bin"
3720-# exit
3721-#fi
3722-
3723
3724=== modified file 'Template/bin/cleanall'
3725--- Template/bin/cleanall 2011-07-06 17:23:07 +0000
3726+++ Template/bin/cleanall 2012-02-04 00:00:36 +0000
3727@@ -5,7 +5,7 @@
3728 # executable files
3729 # events.dat (Except in Events)
3730 #
3731-# Usage: clean
3732+# Usage: cleanall
3733 #
3734 #
3735 # First we need to get into the main directory
3736@@ -17,6 +17,15 @@
3737 exit
3738 fi
3739 fi
3740+if [[ -d Source ]]; then
3741+ cd Source
3742+ echo "Cleaning Source:"
3743+ make clean >& /dev/null
3744+ cd ../
3745+else
3746+ echo "Error could not find Source"
3747+ exit
3748+fi
3749 if [[ -d SubProcesses ]]; then
3750 cd SubProcesses
3751 echo -n "Cleaning SubProcesses"
3752@@ -35,23 +44,3 @@
3753 echo "Error could not find SubProcesses"
3754 exit
3755 fi
3756-if [[ -d Source ]]; then
3757- cd Source
3758- echo "Cleaning Source:"
3759- make clean >& /dev/null
3760- cd ../
3761-else
3762- echo "Error could not find Source"
3763- exit
3764-fi
3765-if [[ -d bin ]]; then
3766- cd bin
3767- echo "Cleaning bin:"
3768- for i in gen_ximprove scale_events select_events sum_html combine_runs combine_events; do
3769- rm -f $i >& /dev/null
3770- done
3771- cd ../
3772-else
3773- echo "Error could not find bin"
3774- exit
3775-fi
3776
3777=== removed file 'Template/bin/compile'
3778--- Template/bin/compile 2011-07-11 18:32:26 +0000
3779+++ Template/bin/compile 1970-01-01 00:00:00 +0000
3780@@ -1,89 +0,0 @@
3781-#!/bin/bash
3782-#
3783-################################################################################
3784-# ##
3785-# MadGraph/MadEvent ##
3786-# ##
3787-# FILE : compile ##
3788-# VERSION : 1.0 ##
3789-# DATE : 23 Septembre 2007 ##
3790-# AUTHOR : MH - MadGraph team ##
3791-# ##
3792-# DESCRIPTION : script to compile madevent ##
3793-# USAGE : ./make_package ##
3794-################################################################################
3795-
3796-# set nonomatch
3797-
3798-if [[ ! -d ./bin ]]; then
3799- cd ../
3800- if [[ ! -d ./bin ]]; then
3801- echo "Error: it must be executed from the main, or bin directory"
3802- exit
3803- fi
3804-fi
3805-
3806-
3807-#
3808-# If argument is equal to 'd' use dynamic libraries
3809-#
3810-echo $PWD
3811-if [[ "$1" == "dynamic" ]]; then
3812- echo "Using dynamic libraries (might not work under MacOsX)"
3813- export dynamic=true
3814-else
3815- echo "Using static libraries"
3816- unset dynamic
3817-fi
3818-
3819-# Check for LHAPDF
3820-c=`awk '/^[^#].*=.*pdlabel/{print $1}' Cards/run_card.dat`
3821-if [[ $c == "'lhapdf'" ]]; then
3822- echo Using LHAPDF interface!
3823- export lhapdf=true
3824-else
3825- unset lhapdf
3826-fi
3827-
3828-#
3829-# Now let shell know where to find important executables
3830-#
3831-
3832-bin/compile_Source
3833-
3834-if [[ -e error ]];then
3835- exit
3836-fi
3837-
3838-if [[ -d SubProcesses ]]; then
3839- cd SubProcesses
3840- for i in `cat subproc.mg` ; do
3841- cd $i
3842- echo $i
3843- rm -f ajob* >& /dev/null
3844- rm -f wait.ajob* >& /dev/null
3845- rm -f run.ajob* >& /dev/null
3846- rm -f done.ajob* >& /dev/null
3847- make madevent > /dev/null
3848- if [[ $? -ne 0 ]];then
3849- # Make didn't exit successfully
3850- echo Error make madevent not successful > error
3851- cat error
3852- exit
3853- fi
3854- cd ..
3855- done
3856- cd ..
3857-else
3858- echo "Error could not find SubProcesses"
3859- exit
3860-fi
3861-
3862-if [[ -d ../DECAY ]]; then
3863- echo "DECAY directory found, compiling..."
3864- cd ../DECAY
3865- make
3866-fi
3867-
3868-echo ""
3869-
3870
3871=== removed file 'Template/bin/compile_Source'
3872--- Template/bin/compile_Source 2011-07-06 22:40:17 +0000
3873+++ Template/bin/compile_Source 1970-01-01 00:00:00 +0000
3874@@ -1,32 +0,0 @@
3875-#!/bin/bash
3876-#
3877-################################################################################
3878-# ##
3879-# MadGraph/MadEvent ##
3880-# ##
3881-# FILE : compile_Source ##
3882-# VERSION : 1.0 ##
3883-# DATE : 6 July 2011 ##
3884-# AUTHOR : JA - MadGraph team ##
3885-# ##
3886-# DESCRIPTION : script to compile Source ##
3887-################################################################################
3888-
3889-if [[ -d Source ]]; then
3890- cd Source
3891- for i in ../bin/sum_html ../bin/gen_ximprove all ../bin/combine_events ../bin/combine_runs ../bin/sumall; do
3892- make $i > /dev/null
3893- if [[ $? -ne 0 ]];then
3894- # Make didn't exit successfully
3895- echo Error make $i in Source not successful > ../error
3896- cat ../error
3897- exit
3898- fi
3899- done
3900- cd ..
3901-else
3902- echo 'Error Source directory not found' > error
3903- cat error
3904- exit
3905-fi
3906-
3907
3908=== removed file 'Template/bin/cpall'
3909--- Template/bin/cpall 2010-10-30 03:26:37 +0000
3910+++ Template/bin/cpall 1970-01-01 00:00:00 +0000
3911@@ -1,4 +0,0 @@
3912-#!/bin/bash
3913-for i in `cat subproc.mg` ; do
3914- cp -p $1 $i/$1
3915-done
3916
3917=== removed file 'Template/bin/gen_crossxhtml-pl'
3918--- Template/bin/gen_crossxhtml-pl 2011-04-21 15:56:29 +0000
3919+++ Template/bin/gen_crossxhtml-pl 1970-01-01 00:00:00 +0000
3920@@ -1,399 +0,0 @@
3921-#!/usr/bin/perl -w
3922-
3923-$server = $ENV{'SERVER_NAME'};
3924-
3925-
3926-
3927-&writeHtmlProcessPage;
3928-
3929-
3930-sub writeHtmlProcessPage {
3931-
3932-#
3933-# Make sure we are in the main directory, not bin
3934-#
3935- if (-d "bin") {
3936-# print "We are in main directory \n";
3937-# print qx(pwd);
3938- }
3939- else{
3940-# print "Not in correct directory \n";
3941- chdir("../");
3942- if (-d "bin") {
3943-# print "We are in main directory \n";
3944- }
3945- else{
3946- print "Error gen_crossxhtml-pl must be run from main or bin directory \n";
3947- exit;
3948- }
3949- }
3950- $directory=qx(pwd);
3951-
3952-#
3953-# name of the output file
3954-#
3955- $htfile = "HTML/crossx" . "\.html";
3956- open(PAGE,"> $htfile");
3957-#
3958-# The name of the current run
3959-#
3960- if($#ARGV < 0) {
3961- $RunName="Web";
3962- } else {
3963- $RunName="$ARGV[0]";
3964- }
3965-
3966-#
3967-# Write out the current running situation
3968-#
3969-
3970-#--------
3971-# Getting info
3972-#--------
3973- if (-e "SubProcesses/procdef_mg5.dat"){
3974- open (INCARD,"SubProcesses/procdef_mg5.dat") || die "Error reading file proc_card.dat";
3975- @incard=<INCARD>;
3976- close (INCARD);
3977- } else {
3978- open (INCARD,"Cards/proc_card.dat") || exit;
3979- @incard=<INCARD>;
3980- close (INCARD);
3981- }
3982-
3983- # process
3984- $listpos = 0;
3985- until($listpos>$#incard){
3986- if($incard[$listpos] =~ /^#(\s+)Begin(\s+)PROCESS/) {$ini=$listpos};
3987- if($incard[$listpos] =~ /^#(\s+)End(\s+)PROCESS/) {$end=$listpos};
3988- $listpos = $listpos + 1;
3989- }
3990-#
3991- $listpos=$ini;
3992- while($listpos < $end){
3993- if($incard[$listpos] =~ /^#/) {$listpos = $listpos + 1;
3994- next;};
3995- if($incard[$listpos] =~ ">") {$interaction=$incard[$listpos]};
3996- if($incard[$listpos] =~ "end_coup"){$listpos = $end;}
3997- $listpos = $listpos + 1;
3998- }
3999- ($interaction, $junk)=split(/#/ , $interaction);
4000-#($interaction, $junk)=split(/\@/ , $interaction);
4001-
4002-#model
4003- $listpos = 0;
4004- until($listpos>$#incard){
4005- if($incard[$listpos] =~ /^#(\s+)Begin(\s+)MODEL/) {$ini=$listpos};
4006- if($incard[$listpos] =~ /^#(\s+)End(\s+)MODEL/) {$end=$listpos};
4007- $listpos = $listpos + 1;
4008- }
4009-#
4010- ($model, $junk) =split(/#/ , $incard[$ini+1]);
4011-
4012- chomp($interaction);
4013- chomp($model);
4014-
4015-#--------
4016-# end getting info
4017-#--------
4018- print PAGE "<HTML> <HEAD> \n";
4019-
4020- if (-e "RunWeb") {
4021- print PAGE "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"10\" > ";
4022- }
4023- print PAGE "<META HTTP-EQUIV=\"EXPIRES\" CONTENT=\"20\" > ";
4024- print PAGE "\n <TITLE>Online Event Generation</TITLE></HEAD> \n <BODY>";
4025- print PAGE "<H2 align=center> Results for $interaction in the $model</H2> <HR>";
4026-
4027- if (-e "RunWeb" || -e "error") {
4028-
4029- print PAGE "<H2 ALIGN=CENTER><P> Currently Running </H2>";
4030- print PAGE "<TABLE BORDER=2 ALIGN=CENTER>";
4031- print PAGE "\<TR ALIGN=CENTER>";
4032- print PAGE "\<TH nowrap ROWSPAN=2 font color=\"\#0000FF\"> Run Name \n";
4033- print PAGE "\<TH nowrap ROWSPAN=2 font color=\"\#0000FF\"> Cards\n";
4034- print PAGE "\<TH nowrap ROWSPAN=2 font color=\"\#0000FF\"> Status \n";
4035- print PAGE "\<TH nowrap ROWSPAN=2 font color=\"\#0000FF\"> Results \n";
4036- print PAGE "\<TH nowrap ROWSPAN=1 COLSPAN=4 font color=\"\#0000FF\"> Jobs on the cluster\n";
4037- print PAGE "\<TR> \<TH> Queued \<TH> Running \<TH> Done \<TH> Total";
4038-
4039- chdir("./SubProcesses");
4040-# if (!-e "$RunName"."_results.html") {
4041-# if (-e "../RunWeb" || -e "../error") {
4042- if (-e "../$RunName.log") {print PAGE "\<TR ALIGN=CENTER> \<TD nowrap> <a href=\"../$RunName.log\">$RunName</a> \</TD>";}
4043- else {print PAGE "\<TR ALIGN=CENTER> \<TD nowrap> $RunName \</TD>";}
4044- print PAGE "<TD nowrap> <a href=\"../Cards/param_card.dat\">param_card</a><BR><a href=\"../Cards/run_card.dat\">run_card</a><BR><a href=\"../Cards/plot_card.dat\">plot_card</a>";
4045- if (-e "../Cards/pythia_card.dat") {
4046- print PAGE "<BR><a href=\"../Cards/pythia_card.dat\">pythia_card</a>";
4047- if (-e "../Cards/pgs_card.dat") {print PAGE "<BR><a href=\"../Cards/pgs_card.dat\">pgs_card</a>";}
4048- elsif (-e "../Cards/delphes_card.dat") {print PAGE "<BR><a href=\"../Cards/delphes_card.dat\">delphes_card</a>";}
4049- }
4050- print PAGE " \</TD><TD nowrap> ";
4051- if (-e "../survey") {
4052- print PAGE "Running Survey\</TD> \<TD nowrap> No results yet \</TD> ";
4053- }
4054- else {
4055- if (-e "../refine"){
4056- print PAGE "Running 1<sup>st</sup> Refine\</TD> \<TD nowrap>";
4057- }
4058- elsif(-e "../refine2") {
4059- print PAGE "Running 2<sup>nd</sup> Refine\</TD> \<TD nowrap>";
4060- }
4061- elsif (-e "../error"){
4062- print PAGE "Error generating events\</TD> \<TD nowrap>";
4063- }
4064- else {
4065- print PAGE "Running\</TD> \<TD nowrap>";
4066- }
4067- if (open SIGFILE, "results.html") {
4068- $line = <SIGFILE>;
4069- $line = <SIGFILE>;
4070- $line = <SIGFILE>;
4071- $line = <SIGFILE>;
4072-
4073- print PAGE " \<A HREF\=\"../SubProcesses/results.html\"\> ";
4074- $line = <SIGFILE>;
4075- chomp $line;
4076- print PAGE "$line";
4077- print PAGE "</A> \</TD> \n";
4078- }
4079- else
4080- {print PAGE "</A> \</TD> \n";}
4081-
4082- close(SIGFILE);
4083-
4084- }
4085- my($Status,@jobs);
4086- if( -e "../status"){$Status = qx(cat ../status)}
4087- else{$Status="Unknown"};
4088-
4089- @jobs = split / /, $Status;
4090- if ( $jobs[0] =~ /^\d+$/){
4091- print PAGE " \<TD> $jobs[0] \<TD> $jobs[1] \<TD> $jobs[2] \<TD> $jobs[3] \</TR>";}
4092- else
4093- {print PAGE " \<TD COLSPAN=4 ALIGN=CENTER> $Status \</TR>" };
4094-# }
4095-#}
4096-# }
4097-
4098- print PAGE "</TABLE>\n";
4099- print PAGE "\<BR\> \n";
4100- chdir("../");
4101- if (-e "Online" && -e "RunWeb") {
4102- print PAGE "<H1 align=center> \n";
4103- print PAGE "<FORM ACTION=\"http://$server/cgi-bin/RunProcess/handle_jobs-pl\" METHOD=\"POST\">";
4104- print PAGE "<INPUT TYPE=HIDDEN NAME=dir_name VALUE=\"$directory\"> \n";
4105- print PAGE "<INPUT TYPE=HIDDEN NAME=whattodo VALUE=\"kill\"> \n";
4106- print PAGE "<INPUT TYPE=SUBMIT VALUE=\"Stop Job\"> \n";
4107- print PAGE "</FORM> \n";
4108- }
4109- }
4110-#
4111-# start writing the old runs information
4112-#
4113- @runs=();
4114- chdir("Events/");
4115- foreach $f (<*_banner.txt>) {
4116- if ($f =~ /(.+)_banner.txt/) {push(@runs,$1)}
4117- }
4118- chdir("../");
4119-# print "run labels : @runs \n";
4120-
4121- print PAGE "<BR>\n";
4122- print PAGE "\<HTML\> \n";
4123- print PAGE "\<HEAD\> \n";
4124- print PAGE "\<\/HEAD\> \n";
4125- print PAGE "\<BODY\> \n";
4126- print PAGE "<P> <H2 align=\"center\"> Available Results <\/H2>";
4127-
4128- if(-e "gridpack.tar.gz"){
4129- print PAGE "<center>Current Grid package for this run: <a href=\"../gridpack.tar.gz\">gridpack.tar.gz</a></center>";
4130- }
4131-
4132- print PAGE "<TABLE BORDER=2 align=\"center\" > \n";
4133- print PAGE "<TR align=\"center\">";
4134- print PAGE "<TH>Links</TH> <TH>Events</TH> <TH NOWRAP> Tag </TH><TH NOWRAP> Run </TH> \n";
4135- print PAGE "<TH>Collider</TH> <TH> Cross section (pb) </TH> <TH> Events </TH> </TR> \n";
4136- $collider="";
4137- $nevents=0;
4138- $cross=0;
4139-
4140- foreach $i (@runs) {
4141- $res="SubProcesses/".$i."_results.html";
4142- $eve="Events/".$i."_unweighted_events.lhe.gz";
4143- $roo="Events/".$i."_unweighted_events.root";
4144- $plo="Events/".$i."_plots.html";
4145- $plopythia="Events/".$i."_plots_pythia.html";
4146- $plopgs="Events/".$i."_plots_pgs.html";
4147- $plodelphes="Events/".$i."_plots_delphes.html";
4148- $ban="Events/".$i."_banner.txt";
4149- $pythia="Events/".$i."_pythia_events.hep.gz";
4150- $pythiaroot="Events/".$i."_pythia_events.root";
4151- $pythialog="Events/".$i."_pythia.log";
4152- $pythialhe="Events/".$i."_pythia_events.lhe.gz";
4153- $pythialheroot="Events/".$i."_pythia_lhe_events.root";
4154- $pgs="Events/".$i."_pgs_events.lhco.gz";
4155- $pgslog="Events/".$i."_pgs.log";
4156- $pgsroot="Events/".$i."_pgs_events.root";
4157- $delphes="Events/".$i."_delphes_events.lhco.gz";
4158- $delpheslog="Events/".$i."_delphes.log";
4159- $delphesroot="Events/".$i."_delphes_events.root";
4160-
4161-
4162- print PAGE "<TR align=\"center\"> ";
4163- print PAGE "<TD>";
4164- if(-e "Events/".$i."_1_unweighted_events.lhe.gz"){
4165- print PAGE "Multi Run $i TOTAL: <br>";
4166- } elsif (-e "$res"){
4167- print PAGE " <a href=\"../$res\">results</a>";
4168- }
4169- print PAGE " <a href=\"../$ban\">banner</a> ";
4170- print PAGE "<BR> </TD>\n<TD><TABLE BORDER=2 width=\"100%\" align=\"center\" >";
4171- if(-e "$eve") {
4172- print PAGE " <TR align=\"center\"> <td> Parton-level </td><td><a href=\"../$eve\">LHE</a> ";
4173- if(-e "$plo") {print PAGE " <a href=\"../$plo\">plots</a>";}
4174- }
4175- elsif ( -e "Online" ){
4176- print PAGE "<FORM ACTION=\"http://$server/cgi-bin/RunProcess/handle_runs-pl\" ENCTYPE=\"multipart/form-data\" METHOD=\"POST\">";
4177- print PAGE "<INPUT TYPE=HIDDEN NAME=directory VALUE=\"$directory\"> \n";
4178- print PAGE "<INPUT TYPE=HIDDEN NAME=whattodo VALUE=\"banner_run\"> \n";
4179- print PAGE "<INPUT TYPE=HIDDEN NAME=run VALUE=\"$i\"> \n";
4180- print PAGE "<INPUT TYPE=SUBMIT VALUE=\"Regenerate events\"> \n";
4181- print PAGE "</FORM> \n";
4182- }
4183- if(-e "$roo") {print PAGE " <a href=\"../$roo\">rootfile</a> </td> </tr>";} else {print PAGE "</td> </tr>";}
4184- if(-e "$pythia") {print PAGE " <TR align=\"center\"> <td>Hadron-level<br>(<a href=\"../$pythialog\">Pythia</a>)</td> <td><a href=\"../$pythia\">STDHEP</a> ";
4185- } elsif(-e "$eve" && -e "Online" ) {
4186- print PAGE " <TR align=\"center\"> <td>Hadron-level<br>(Pythia)</td> <td> ";
4187- print PAGE "<FORM ACTION=\"http://$server/cgi-bin/RunProcess/handle_runs-pl\" ENCTYPE=\"multipart/form-data\" METHOD=\"POST\">";
4188- print PAGE "<INPUT TYPE=HIDDEN NAME=directory VALUE=\"$directory\"> \n";
4189- print PAGE "<INPUT TYPE=HIDDEN NAME=whattodo VALUE=\"pythia\"> \n";
4190- print PAGE "<INPUT TYPE=HIDDEN NAME=run VALUE=\"$i\"> \n";
4191- print PAGE "<INPUT TYPE=SUBMIT VALUE=\"Run Pythia\"> \n";
4192- print PAGE "</FORM> \n";
4193- }
4194- if(-e "$pythiaroot") {print PAGE " <a href=\"../$pythiaroot\">rootfile</a>";}
4195- if(-e "$pythialhe") {print PAGE " <a href=\"../$pythialhe\">LHE</a>";}
4196- if(-e "$pythialheroot") {print PAGE " <a href=\"../$pythialheroot\">rootfile (LHE)</a>";}
4197- if(-e "$plopythia") {print PAGE " <a href=\"../$plopythia\">plots</a> </td></tr>";} else {print PAGE "</td> </tr>";}
4198- if(-e "$pgs") {
4199- print PAGE " <TR align=\"center\"> <td>Reco. Objects.<br> (<a href=\"../$pgslog\">PGS</a>)</td><td><a href=\"../$pgs\">LHCO</a>";
4200- if(-e "$pgsroot") {print PAGE " <a href=\"../$pgsroot\">rootfile</a>";}
4201- if (-e "$plopgs") {print PAGE " <a href=\"../$plopgs\">plots</a>";}
4202- print PAGE " </td></tr>\n";
4203- }
4204- elsif(-e "$delphes") {
4205- print PAGE " <TR align=\"center\"> <td>Reco. Objects.<br> (<a href=\"../$delpheslog\">Delphes</a>)</td><td><a href=\"../$delphes\">LHCO</a>";
4206- if(-e "$delphesroot") {print PAGE " <a href=\"../$delphesroot\">rootfile</a>";}
4207- if (-e "$plodelphes") {print PAGE " <a href=\"../$plodelphes\">plots</a>";}
4208- print PAGE " </td></tr>\n";
4209- }
4210- else {
4211- if (-e "Online" && -e "$pythia") {
4212- print PAGE " <TR align=\"center\"> <td>Reco. Objects.<br>(PGS/Delphes)</td> <td> ";
4213- print PAGE "<FORM ACTION=\"http://$server/cgi-bin/RunProcess/handle_runs-pl\" ENCTYPE=\"multipart/form-data\" METHOD=\"POST\">";
4214- print PAGE "<INPUT TYPE=HIDDEN NAME=directory VALUE=\"$directory\"> \n";
4215- print PAGE "<INPUT TYPE=HIDDEN NAME=whattodo VALUE=\"pgs\"> \n";
4216- print PAGE "<INPUT TYPE=HIDDEN NAME=run VALUE=\"$i\"> \n";
4217- print PAGE "<INPUT TYPE=SUBMIT VALUE=\"Run Det. Sim.\"> \n";
4218- print PAGE "</FORM> \n";
4219- }
4220- }
4221- print PAGE "</table></TD>";
4222-#extract the information from the banner:
4223- open(INPUT , "$ban") or die "Could not read from file $ban \n";
4224- @input=<INPUT>;
4225-#
4226-# start loop over stored results
4227-#
4228- foreach $j (@input) {
4229-#find the tag
4230- if($j =~ /^(.+)\=.*run_tag.*\!/){$tag=$1;$tag =~ s/'||"//g;}
4231-#find the collider
4232- if($j =~ /^(.+)\=.*lpp1.*\!/){$lpp1=$1}
4233- if($j =~ /^(.+)\=.*lpp2.*\!/){$lpp2=$1}
4234- if($j =~ /^(.+)\=.*ebeam1.*\!/){$ebeam1=$1}
4235- if($j =~ /^(.+)\=.*ebeam2.*\!/){$ebeam2=$1}
4236-#find the cross section
4237- if($j =~ /^#.*Integrated weight.*:(.+)/){$cross=$1}
4238-#find the number of events
4239- if($j =~ /^#.*Number of Events.*:(.+)/){$nevents=$1}
4240-
4241- }# end loop over banner
4242-
4243-
4244- $lpp1 =~ s/\s+//g;
4245- $lpp2 =~ s/\s+//g;
4246- if($lpp1 eq "0") {$lpp1="e"}
4247- if($lpp1 eq "1") {$lpp1="p"}
4248- if($lpp1 eq "-1") {$lpp1="pbar"}
4249- if($lpp2 eq "0") {$lpp2="e"}
4250- if($lpp2 eq "1") {$lpp2="p"}
4251- if($lpp2 eq "-1") {$lpp2="pbar"}
4252- $collider=$lpp1." ".$lpp2;
4253- $collider= $collider."<BR>".$ebeam1." x ".$ebeam2." GeV";
4254- if (-e "$i.log") {print PAGE "<TD> $tag </TD> <TD> <a href=\"../$i.log\">$i</a> </TD> <TD> $collider </TD> <TD> $cross </TD> <TD> $nevents";}
4255- else {print PAGE "<TD> $tag </TD> <TD> $i </TD> <TD> $collider </TD> <TD> $cross </TD> <TD> $nevents";}
4256- if (-e "Online") {
4257- print PAGE "</TD><TD><FORM ACTION=\"http://$server/cgi-bin/RunProcess/handle_runs-pl\" ENCTYPE=\"multipart/form-data\" METHOD=\"POST\">";
4258- print PAGE "<INPUT TYPE=HIDDEN NAME=directory VALUE=\"$directory\"> \n";
4259- print PAGE "<INPUT TYPE=HIDDEN NAME=run VALUE=\"$i\"> \n";
4260- if(-e "$eve"){
4261- print PAGE "<INPUT TYPE=HIDDEN NAME=whattodo VALUE=\"remove\"> \n";
4262- print PAGE "<INPUT TYPE=SUBMIT VALUE=\"Remove run\"> \n";
4263- } else {
4264- print PAGE "<INPUT TYPE=HIDDEN NAME=whattodo VALUE=\"removebanner\"> \n";
4265- print PAGE "<INPUT TYPE=SUBMIT VALUE=\"Remove banner\"> \n";
4266- }
4267- print PAGE "</FORM> \n";
4268- if(-e "$pythia") {
4269- print PAGE "<FORM ACTION=\"http://$server/cgi-bin/RunProcess/handle_runs-pl\" ENCTYPE=\"multipart/form-data\" METHOD=\"POST\">";
4270- print PAGE "<INPUT TYPE=HIDDEN NAME=directory VALUE=\"$directory\"> \n";
4271- print PAGE "<INPUT TYPE=HIDDEN NAME=run VALUE=\"$i\"> \n";
4272- print PAGE "<INPUT TYPE=HIDDEN NAME=whattodo VALUE=\"remove_pythia\"> \n";
4273- print PAGE "<INPUT TYPE=SUBMIT VALUE=\"Remove Pythia\"> \n";
4274- print PAGE "</FORM> \n";
4275- }
4276- if(-e "$pgs") {
4277- print PAGE "<FORM ACTION=\"http://$server/cgi-bin/RunProcess/handle_runs-pl\" ENCTYPE=\"multipart/form-data\" METHOD=\"POST\">";
4278- print PAGE "<INPUT TYPE=HIDDEN NAME=directory VALUE=\"$directory\"> \n";
4279- print PAGE "<INPUT TYPE=HIDDEN NAME=run VALUE=\"$i\"> \n";
4280- print PAGE "<INPUT TYPE=HIDDEN NAME=whattodo VALUE=\"remove_pgs\"> \n";
4281- print PAGE "<INPUT TYPE=SUBMIT VALUE=\"Remove PGS\"> \n";
4282- print PAGE "</FORM> \n";
4283- }elsif(-e "$delphes") {
4284- print PAGE "<FORM ACTION=\"http://$server/cgi-bin/RunProcess/handle_runs-pl\" ENCTYPE=\"multipart/form-data\" METHOD=\"POST\">";
4285- print PAGE "<INPUT TYPE=HIDDEN NAME=directory VALUE=\"$directory\"> \n";
4286- print PAGE "<INPUT TYPE=HIDDEN NAME=run VALUE=\"$i\"> \n";
4287- print PAGE "<INPUT TYPE=HIDDEN NAME=whattodo VALUE=\"remove_delphes\"> \n";
4288- print PAGE "<INPUT TYPE=SUBMIT VALUE=\"Remove Delphes\"> \n";
4289- print PAGE "</FORM> \n";
4290- }
4291-
4292-
4293- }
4294- print PAGE "</TD></TR>\n";
4295-} # end loop over stored results
4296- print PAGE "</table>";
4297-
4298-# if (-e "Online") {
4299-# print PAGE "<H1 align=center> \n";
4300-# print PAGE "<FORM ACTION=\"http://$server/cgi-bin/RunProcess/handle_runs-pl\" METHOD=\"POST\">";
4301-# print PAGE "<INPUT TYPE=HIDDEN NAME=directory VALUE=\"$directory\"> \n";
4302-# print PAGE "<INPUT TYPE=HIDDEN NAME=whattodo VALUE=\"rmgrid\"> \n";
4303-# print PAGE "<INPUT TYPE=SUBMIT VALUE=\"Reset VEGAS grid\"> \n";
4304-# print PAGE "</FORM> \n";
4305-# }
4306-
4307- print PAGE "\<P><H3 align=center>\<A HREF\=\"../index.html\"\> Main Page \<\/A\>";
4308-
4309- print PAGE "\<\/BODY\> \n";
4310- print PAGE "\<\/HTML\> \n";
4311- close(PAGE);
4312-
4313-} #end sub writeHtmlProcessPage
4314-
4315-
4316-
4317-
4318-
4319-
4320
4321=== added file 'Template/bin/generate_events'
4322--- Template/bin/generate_events 1970-01-01 00:00:00 +0000
4323+++ Template/bin/generate_events 2012-02-04 00:00:36 +0000
4324@@ -0,0 +1,131 @@
4325+#! /usr/bin/env python
4326+################################################################################
4327+#
4328+# Copyright (c) 2011 The MadGraph Development team and Contributors
4329+#
4330+# This file is a part of the MadGraph 5 project, an application which
4331+# automatically generates Feynman diagrams and matrix elements for arbitrary
4332+# high-energy processes in the Standard Model and beyond.
4333+#
4334+# It is subject to the MadGraph license which should accompany this
4335+# distribution.
4336+#
4337+# For more information, please visit: http://madgraph.phys.ucl.ac.be
4338+#
4339+################################################################################
4340+""" This is the main script in order to generate events in MadEvent """
4341+
4342+import logging
4343+import logging.config
4344+import os
4345+import re
4346+import shutil
4347+import subprocess
4348+import sys
4349+import time
4350+root_path = os.path.split(os.path.dirname(os.path.realpath( __file__ )))[0]
4351+pjoin = os.path.join
4352+sys.path.append(pjoin(root_path,'bin','internal'))
4353+import madevent_interface as ME
4354+
4355+if not (sys.version_info[0] == 2 or sys.version_info[1] > 5):
4356+ sys.exit('MadEvent works with python 2.6 or higher (but not python 3.X).\n\
4357+ Please upgrade your version of python.')
4358+
4359+
4360+def set_configuration():
4361+ import coloring_logging
4362+ logging.config.fileConfig(os.path.join(root_path, 'bin', 'internal', 'me5_logging.conf'))
4363+ logging.root.setLevel(logging.INFO)
4364+ logging.getLogger('madevent').setLevel(logging.INFO)
4365+ logging.getLogger('madgraph').setLevel(logging.INFO)
4366+
4367+
4368+def treat_old_argument(argument):
4369+ """Have the MG4 behavior for this script"""
4370+
4371+ try:
4372+ mode = int(argument[1])
4373+ except:
4374+ mode = int(raw_input('Enter 2 for multi-core, 1 for parallel, 0 for serial run\n'))
4375+ if mode == 0:
4376+ try:
4377+ name = argument[2]
4378+ except:
4379+ name = raw_input('Enter run name\n')
4380+ else:
4381+ try:
4382+ opt = argument[2]
4383+ except:
4384+ if mode == 1:
4385+ opt = raw_input('Enter name for jobs on pbs queue\n')
4386+ else:
4387+ opt = int(raw_input('Enter number of cores\n'))
4388+
4389+ try:
4390+ name = argument[3]
4391+ except:
4392+ name = raw_input('enter run name\n')
4393+
4394+ launch = ME.MadEventCmd(me_dir=root_path)
4395+
4396+
4397+ if mode == 1:
4398+ launch.run_cmd('generate_events -f %s --cluster'
4399+ %(name))
4400+ elif mode ==2:
4401+ launch.run_cmd('generate_events -f %s --multicore --nb_core=%s'
4402+ %(name, opt))
4403+ else:
4404+ launch.run_cmd('generate_events -f %s' % name)
4405+
4406+ launch.run_cmd('quit')
4407+
4408+
4409+
4410+
4411+
4412+
4413+
4414+
4415+################################################################################
4416+## EXECUTABLE
4417+################################################################################
4418+if '__main__' == __name__:
4419+ # Check that python version is valid
4420+
4421+ set_configuration()
4422+ argument = sys.argv
4423+ try:
4424+ if '-h' in argument or '--help' in argument:
4425+ launch = ME.MadEventCmd(me_dir=root_path)
4426+ launch.exec_cmd('help generate_events')
4427+ elif len(argument) > 1 and argument[1] in ['0', '1', '2']:
4428+ treat_old_argument(argument)
4429+ else:
4430+ open('/tmp/mg5tmp.cmd','w').write('generate_events %s' % ' '.join(argument[1:]))
4431+ os.system('%s/madevent /tmp/mg5tmp.cmd' % pjoin(root_path, 'bin'))
4432+ except KeyboardInterrupt:
4433+ pass
4434+ except ME.MadEventAlreadyRunning, error:
4435+ logging.error(str(error))
4436+ sys.exit()
4437+
4438+ if os.path.exists(pjoin(root_path, 'RunWeb')):
4439+ os.remove(pjoin(root_path, 'RunWeb'))
4440+
4441+ # reconfigure path for the web
4442+ #if len(argument) == 5:
4443+ # ME.pass_in_web_mode()
4444+
4445+
4446+
4447+
4448+
4449+
4450+
4451+
4452+
4453+
4454+
4455+
4456
4457=== removed file 'Template/bin/generate_events'
4458--- Template/bin/generate_events 2011-08-24 23:38:57 +0000
4459+++ Template/bin/generate_events 1970-01-01 00:00:00 +0000
4460@@ -1,419 +0,0 @@
4461-#!/bin/bash
4462-#
4463-# This runs survey,refine,unweight_events, one after the other
4464-#
4465-# First we need to get into the main directory
4466-#
4467-#
4468-# Usage: generate_events compression events parallel [name]
4469-#
4470-# parallel is 0 for serial, 1 for PBS, 2 for multicore
4471-# name is queue name for PBS or number of cores for multicore
4472-#
4473-
4474-function error_exit {
4475- if [[ -e error ]]; then
4476- date
4477- cp -f error status
4478- rm survey refine refine2 >& /dev/null
4479- rm RunWeb
4480- $dirbin/gen_crossxhtml-pl $t
4481- $dirbin/gen_cardhtml-pl
4482- exit
4483- fi
4484-}
4485-
4486-if [[ ! -d ./bin ]]; then
4487- cd ../
4488- if [[ ! -d ./bin ]]; then
4489- echo "Error: it must be executed from the main, or bin directory"
4490- exit
4491- fi
4492-fi
4493-#
4494-# Now let shell know where to find important executables
4495-#
4496-main=`pwd`
4497-# Strip off last directory
4498-mainpar=${main%/*}
4499-dirbin=$main/bin
4500-pydir=$mainpar/pythia-pgs/src
4501-pgsdir=$pydir
4502-delphesdir=$mainpar/Delphes
4503-ERAdir=$mainpar/ExRootAnalysis
4504-MAdir=$mainpar/MadAnalysis
4505-webbin=$dirbin
4506-td=$mainpar/td
4507-web=0
4508-
4509-echo $$ >> myprocid
4510-
4511-# For Linux
4512-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$main/lib
4513-# For Mac OS X
4514-export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$main/lib
4515-
4516-if [[ "$1" == "" ]]; then
4517- echo 'Enter 2 for multi-core, 1 for parallel, 0 for serial run'
4518- read mode
4519-else
4520- mode=$1
4521-fi
4522-n=MadEvent
4523-if [[ $mode -gt 0 ]]; then
4524- if [[ "$2" == "" ]]; then
4525- if [[ $mode -eq 1 ]]; then
4526- echo 'Enter name for jobs on pbs queue'
4527- elif [[ $mode -eq 2 ]]; then
4528- echo 'Enter number of cores'
4529- fi
4530- read n
4531- else
4532- n=$2
4533- fi
4534- if [[ "$3" == "" ]]; then
4535- echo 'Enter run name'
4536- read t
4537- else
4538- t=$3
4539- fi
4540-else
4541- if [[ "$2" == "" ]]; then
4542- echo 'Enter run name'
4543- read t
4544- else
4545- t=$2
4546- fi
4547-fi
4548-#set t = TeV2
4549-if [[ "$4" -ne "" ]]; then
4550- web=1
4551- webbin="$MADGRAPH_BASE/MG_ME/WebBin"
4552- pydir="$webbin/pythia-pgs"
4553- pgsdir=$pydir
4554- delphesdir="$webbin/Delphes"
4555- ERAdir="$MADGRAPH_BASE/MG_ME/ExRootAnalysis"
4556- MAdir="$MADGRAPH_BASE/MG_ME/MadAnalysis"
4557- td="$MADGRAPH_BASE/MG_ME/td"
4558- touch Online
4559-fi
4560-date
4561-a=`awk '/^[^#].*=.*nevents/{print $1}' Cards/run_card.dat`
4562-b=`awk '/^[^#].*=.*gridpack/{print $1}' Cards/run_card.dat`
4563-c=`awk '/^[^#].*=.*pdlabel/{print $1}' Cards/run_card.dat`
4564-ickkw=`awk '/^[^#].*=.*ickkw.*!/{print $1}' Cards/run_card.dat`
4565-if [[ $a -gt 100000 ]];then
4566- echo "Warning: Attempting to generate more than 100K events"
4567- echo "Limiting number to 100K. Use multi_run for larger statistics."
4568- perl -p -i.bak -e "s/\d+\s*=\s*nevents/100000 = nevents/" Cards/run_card.dat
4569- a=`awk '/^[^#].*=.*nevents/{print $1}' Cards/run_card.dat`
4570-fi
4571-echo Generating $a events
4572-if [[ $b == ".true." ]]; then
4573- echo Generating GridPack $b
4574-fi
4575-#
4576-# Check if run already exists. If so, store run w/ new name
4577-# and remove old run before starting.
4578-#
4579-
4580-if [[ -e status ]]; then
4581- rm status
4582-fi
4583-if [[ -e error ]]; then
4584- rm error
4585-fi
4586-touch RunWeb
4587-echo "Cleaning directories" > status
4588-cat status
4589-$dirbin/gen_crossxhtml-pl $t
4590-$dirbin/clean
4591-
4592-if [[ $c == "'lhapdf'" ]]; then
4593- echo Using LHAPDF interface!
4594- export lhapdf=true
4595-else
4596- unset lhapdf
4597-fi
4598-# Compile everything in Source
4599-echo "Compiling Source" > status
4600-cat status
4601-$dirbin/gen_crossxhtml-pl $t
4602-$dirbin/compile_Source
4603-# If any compilations failed
4604-error_exit
4605-
4606-if [ "$ickkw" = "2" ];then
4607- echo "Running with CKKW matching"
4608- lpp1=`awk '/^[^#].*=.*lpp1/{print $1}' Cards/run_card.dat`
4609- lpp2=`awk '/^[^#].*=.*lpp2/{print $1}' Cards/run_card.dat`
4610- e1=`awk '/^[^#].*=.*ebeam1/{print $1}' Cards/run_card.dat`
4611- e2=`awk '/^[^#].*=.*ebeam2/{print $1}' Cards/run_card.dat`
4612- pd=`awk '/^[^#].*=.*pdlabel/{print $1}' Cards/run_card.dat`
4613- lha=`awk '/^[^#].*=.*lhaid/{print $1}' Cards/run_card.dat`
4614- xq=`awk '/^[^#].*=.*xqcut/{print $1}' Cards/run_card.dat`
4615-
4616- if [[ $lpp1 -ne 0 || $lpp2 -ne 0 ]];then
4617-
4618- # Remove ':s from pd
4619- pd=${pd#\'*}
4620- pd=${pd%*\'}
4621-
4622- if [[ $xq -gt 2 || $xq -eq 0 ]];then
4623- xq=2
4624- fi
4625-
4626- if [ "$web" = "1" ];then
4627- issudfile=$webbin/lib/issudgrid-$e1-$e2-$pd-$xq.dat.gz
4628- if [ "$pd" = "lhapdf" ];then
4629- issudfile=$webbin/lib/issudgrid-$e1-$e2-$pd-$lha-$xq.dat.gz
4630- fi
4631- else
4632- issudfile=lib/issudgrid-$e1-$e2-$pd-$xq.dat.gz
4633- if [ "$pd" = "lhapdf" ];then
4634- issudfile=lib/issudgrid-$e1-$e2-$pd-$lha-$xq.dat.gz
4635- fi
4636- fi
4637- echo "Sudakov grid file: $issudfile"
4638-
4639- if [[ ! -e $issudfile ]];then
4640- echo "No sudakov grid file for parameter choice. Please generate a sudakov grid file and restart." > error
4641- error_exit
4642- else
4643- rm -f lib/issudgrid.dat
4644- gunzip -c $issudfile > lib/issudgrid.dat
4645- fi
4646- fi # if [[ $lpp1 -ne 0 || $lpp2 -ne 0 ]]
4647-fi
4648-
4649-touch survey
4650-echo "Starting jobs" > status
4651-cat status
4652-$dirbin/gen_crossxhtml-pl $t
4653-$dirbin/survey $mode $n $t
4654-error_exit
4655-if [[ $b != ".true." ]]; then
4656- mv survey refine
4657- $dirbin/gen_crossxhtml-pl $t
4658- $dirbin/refine $a $mode $n 1 $t
4659- error_exit
4660- mv refine refine2
4661- $dirbin/gen_crossxhtml-pl $t
4662- $dirbin/refine $a $mode $n 1 $t
4663- error_exit
4664- rm -f refine2
4665-else
4666- rm survey
4667-fi
4668-#
4669-# Now collect the events
4670-#
4671-echo "Combining Events" >& status
4672-cat status
4673-$dirbin/gen_crossxhtml-pl $t
4674-pushd SubProcesses > /dev/null
4675-$dirbin/run_combine $mode
4676-mv events.lhe ../Events/
4677-mv unweighted_events.lhe ../Events/
4678-popd > /dev/null
4679-#
4680-# do the banner
4681-#
4682-cd ./Events
4683-echo "putting the banner"
4684-$dirbin/put_banner events.lhe
4685-$dirbin/put_banner unweighted_events.lhe
4686-
4687-if [[ -e unweighted_events.lhe ]]; then
4688- $dirbin/extract_banner-pl unweighted_events.lhe banner.txt
4689-fi
4690-
4691-#if [[ -e ../Cards/replace_card.dat ]];then
4692-# $dirbin/replace.pl unweighted_events.lhe temp.lhe < ../Cards/replace_card.dat
4693-# if [[ -e temp.lhe ]];then
4694-# mv -f temp.lhe unweighted_events.lhe
4695-# fi
4696-#fi
4697-
4698-#
4699-# Create root file
4700-#
4701-
4702-
4703-if [[ (-x $ERAdir/ExRootLHEFConverter) && (-e unweighted_events.lhe) ]]; then
4704- echo "Creating Root File" >& ../status
4705- cat ../status
4706- $dirbin/gen_crossxhtml-pl $t
4707- $ERAdir/ExRootLHEFConverter unweighted_events.lhe unweighted_events.root
4708-fi
4709-
4710-#if ((-x $ERAdir/ExRootMain) && (-e unweighted_events.root) && (-e ../Cards/plot_card.dat)) then
4711-# echo "Creating Root Plots" >& ../status
4712-# $dirbin/gen_crossxhtml-pl $t
4713-# mkdir $t
4714-# cd $t
4715-# echo "../unweighted_events.root" > events.list
4716-# $dirbin/plot $ERAdir > plot.log
4717-# cd ..
4718-# $dirbin/plot_page-pl $t
4719-#endif
4720-if [[ (-x $MAdir/plot_events) && (-e unweighted_events.lhe) && (-e ../Cards/plot_card.dat) ]]; then
4721- echo "Creating Plots" >& ../status
4722- cat ../status
4723- $dirbin/gen_crossxhtml-pl $t
4724- mkdir $t
4725- cd $t
4726- echo "../unweighted_events.lhe" > events.list
4727- $dirbin/plot $MAdir $td > plot.log
4728- cd ..
4729- $dirbin/plot_page-pl $t parton
4730- mv -f plots.html ${t}_plots.html
4731-fi
4732-
4733-$dirbin/store $t
4734-$dirbin/gen_crossxhtml-pl $t
4735-
4736-# Restore the banner
4737-cp -f ${t}_banner.txt banner.txt
4738-
4739-if [[ $b == ".true." ]]; then
4740- cd ../
4741- sed -i.bak "s/\s*.false.*=.*GridRun/ .true. = GridRun/g" Cards/grid_card.dat
4742- $dirbin/restore_data $t
4743- $dirbin/store4grid default
4744- $dirbin/clean
4745- make gridpack.tar.gz
4746- cd Events
4747-fi
4748-
4749-#
4750-# Run Pythia and PGS on events
4751-#
4752-
4753-# Compile pythia if not there
4754-if [[ !(-x $pydir/pythia) && (-d $pydir) && (-e ../Cards/pythia_card.dat) ]]; then
4755- pushd $pydir > /dev/null
4756- echo "No pythia executable - running make"
4757- make
4758- popd > /dev/null
4759-fi
4760-
4761-if [[ (-x $pydir/pythia) && (-e ../Cards/pythia_card.dat) ]]; then
4762- gunzip -c ${t}_unweighted_events.lhe.gz > unweighted_events.lhe
4763- echo "Running Pythia" >& ../status
4764- cat ../status
4765- $dirbin/gen_crossxhtml-pl $t
4766-# shower and hadronize event through Pythia
4767- $dirbin/run_pythia $pydir $mode
4768-fi
4769-
4770-if [[ -e pythia_events.hep ]];then
4771-# pythia_card.dat
4772- echo "<MGPythiaCard>" >> banner.txt
4773- if [[ -e ../Cards/pythia_card.dat ]]; then cat ../Cards/pythia_card.dat >> banner.txt; fi
4774- echo "</MGPythiaCard>" >> banner.txt
4775-fi
4776-
4777-if [[ (-x $pydir/hep2lhe) && (-e ../Cards/pythia_card.dat) && (-e pythia_events.hep) ]]; then
4778- echo "Creating Pythia LHE File" >& ../status
4779- cat ../status
4780- $dirbin/gen_crossxhtml-pl $t
4781- $dirbin/run_hep2lhe $pydir $mode
4782-fi
4783-
4784-if [[ (-x $ERAdir/ExRootLHEFConverter) && (-e pythia_events.lhe) ]]; then
4785- echo "Creating Pythia LHE Root File" >& ../status
4786- cat ../status
4787- $dirbin/gen_crossxhtml-pl $t
4788- $ERAdir/ExRootLHEFConverter pythia_events.lhe pythia_lhe_events.root
4789-fi
4790-if [[ ickkw -ge 1 ]];then
4791- echo "Create matching plots for Pythia"
4792- $dirbin/create_matching_plots.sh $t
4793-fi
4794-if [[ (-x $MAdir/plot_events) && (-e pythia_events.lhe) && (-e ../Cards/plot_card.dat) ]]; then
4795- echo "Creating Plots for Pythia" >& ../status
4796- cat ../status
4797- $dirbin/gen_crossxhtml-pl $t
4798- mkdir ${t}_pythia
4799- cd ${t}_pythia
4800- echo "../pythia_events.lhe" > events.list
4801- $dirbin/plot $MAdir $td > plot.log
4802- cd ..
4803-fi
4804-
4805-if [[ -d ${t}_pythia ]];then
4806- $dirbin/plot_page-pl ${t}_pythia Pythia
4807- mv -f plots.html ${t}_plots_pythia.html
4808-fi
4809-
4810-# Compile pgs if not there
4811-if [[ !(-x $pgsdir/pgs) && (-d $pgsdir) && (-e ../Cards/pgs_card.dat) ]]; then
4812- pushd $pgsdir > /dev/null
4813- echo "No pgs executable - running make"
4814- make
4815- popd > /dev/null
4816-fi
4817-
4818-if [[ (-x $pgsdir/pgs) && (-e ../Cards/pgs_card.dat) ]]; then
4819- echo "Running PGS" >& ../status
4820- cat ../status
4821- $dirbin/gen_crossxhtml-pl $t
4822- # now pass the event to a detector simulator and reconstruct objects
4823-# qsub -v pgsdir=$pgsdir $dirbin/run_pgs >> ../running_jobs
4824- $dirbin/run_pgs $pgsdir $mode
4825-else
4826- if [[ (-x $delphesdir/Delphes) && (-e ../Cards/delphes_card.dat) ]]; then
4827- echo "Running Delphes" >& ../status
4828- cat ../status
4829- $dirbin/run_delphes $delphesdir $mode
4830- fi
4831-fi
4832-#
4833-
4834-if [[ (-x $ERAdir/ExRootLHCOlympicsConverter) && (-e pgs_events.lhco) ]]; then
4835- echo "Creating PGS Root File" >& ../status
4836- cat ../status
4837- $dirbin/gen_crossxhtml-pl $t
4838- $ERAdir/ExRootLHCOlympicsConverter pgs_events.lhco pgs_events.root
4839-fi
4840-
4841-if [[ (-x $MAdir/plot_events) && (-e pgs_events.lhco) && (-e ../Cards/plot_card.dat) ]]; then
4842- echo "Creating Plots for PGS" >& ../status
4843- cat ../status
4844- $dirbin/gen_crossxhtml-pl $t
4845- mkdir ${t}_pgs
4846- cd ${t}_pgs
4847- echo "../pgs_events.lhco" > events.list
4848- $dirbin/plot $MAdir $td > plot.log
4849- cd ..
4850- $dirbin/plot_page-pl ${t}_pgs PGS
4851- mv -f plots.html ${t}_plots_pgs.html
4852-fi
4853-
4854-if [[ (-x $MAdir/plot_events) && (-e delphes_events.lhco) && (-e ../Cards/plot_card.dat) ]]; then
4855- echo "Creating Plots for Delphes" >& ../status
4856- cat ../status
4857- $dirbin/gen_crossxhtml-pl $t
4858- mkdir ${t}_delphes
4859- cd ${t}_delphes
4860- echo "../delphes_events.lhco" > events.list
4861- $dirbin/plot $MAdir $td > plot.log
4862- cd ..
4863- $dirbin/plot_page-pl ${t}_delphes Delphes
4864- mv -f plots.html ${t}_plots_delphes.html
4865-fi
4866-
4867-cd ../
4868-#
4869-# Store Events
4870-#
4871-echo "Storing Events" >& status
4872-cat status
4873-$dirbin/gen_crossxhtml-pl $t
4874-$dirbin/store $t
4875-rm -f RunWeb
4876-echo " " >& status
4877-$dirbin/gen_crossxhtml-pl $t
4878-$dirbin/gen_cardhtml-pl
4879-date
4880
4881=== removed file 'Template/bin/gridrun'
4882--- Template/bin/gridrun 2010-10-30 03:26:37 +0000
4883+++ Template/bin/gridrun 1970-01-01 00:00:00 +0000
4884@@ -1,246 +0,0 @@
4885-#!/bin/bash
4886-#
4887-# This runs survey,refine,unweight_events, one after the other
4888-#
4889-# First we need to get into the main directory
4890-#
4891-#
4892-# Usage: grid_run
4893-#
4894-
4895-if [[ ! -d ./bin ]]; then
4896- cd ../
4897- if [[ ! -d ./bin ]]; then
4898- echo "Error: it must be executed from the main, or bin directory"
4899- exit
4900- fi
4901-fi
4902-#
4903-# Now let shell know where to find important executables
4904-#
4905-main=`pwd`
4906-dirbin=$main/bin
4907-pydir=$main/../pythia-pgs/src
4908-pgsdir=$pydir
4909-ERAdir=$main/../ExRootAnalysis
4910-MAdir=$main/../MadAnalysis
4911-webbin=$dirbin
4912-td=$main/../td
4913-web=0
4914-
4915-echo $$ >> myprocid
4916-
4917-#if ( "$1" == "" ) then
4918-# echo 'Number of unweighted events. This is ingnored and read from run_card.dat '
4919-# set a = $<
4920-#else
4921-# set a = $1
4922-#endif
4923-
4924-#if [[ "$1" == "" ]]; then
4925-# echo 'Enter 1 for parallel 0 for serial run'
4926-# read p
4927-#else
4928-# p=$1
4929-#fi
4930-p=0
4931-n=MadEvent
4932-#if [[ $p -gt 0 ]]; then
4933-# if [[ "$2" == "" ]]; then
4934-# echo 'Enter name for jobs on pbs queue'
4935-# read n
4936-# else
4937-# n=$2
4938-# fi
4939-# if [[ "$3" == "" ]]; then
4940-# echo 'Enter run name'
4941-# read t
4942-# else
4943-# t=$3
4944-# fi
4945-#else
4946-# if [[ "$2" == "" ]]; then
4947-# echo 'Enter run name'
4948-# read t
4949- t=GridRun
4950-# else
4951-# t=$2
4952-# fi
4953-#fi
4954-#set t = TeV2
4955-if [[ "$4" -ne "" ]]; then
4956- web=1
4957- webbin="$MADGRAPH_BASE/MG_ME/WebBin"
4958- pydir="$webbin/pythia-pgs"
4959- pgsdir=$pydir
4960- ERAdir="$MADGRAPH_BASE/MG_ME/ExRootAnalysis"
4961- MAdir="$MADGRAPH_BASE/MG_ME/MadAnalysis"
4962- td="$MADGRAPH_BASE/MG_ME/td"
4963- touch Online
4964-fi
4965-date
4966-a=`awk '/^[^#].*=.*gevents/{print $1}' Cards/grid_card.dat`
4967-echo Generating $a events
4968-
4969-echo 'restoring default data...'
4970-$dirbin/restore_data default
4971-echo '...default data restored.'
4972-#
4973-# Check if run already exists. If so, store run w/ new name
4974-# and remove old run before starting.
4975-#
4976-
4977-if [[ -e status ]]; then
4978- rm status
4979-fi
4980-if [[ -e error ]]; then
4981- rm error
4982-fi
4983-touch RunWeb
4984-#echo "Cleaning directories" > status
4985-#$dirbin/gen_crossxhtml-pl $t
4986-#$dirbin/clean
4987-touch survey
4988-#echo "Starting jobs" > status
4989-#$dirbin/gen_crossxhtml-pl $t
4990-#$dirbin/survey $p $n $t
4991-if [[ -e error ]]; then
4992- cat error
4993- date
4994- cp -f error status
4995- rm survey
4996- rm RunWeb
4997- $dirbin/gen_crossxhtml-pl $t
4998- $dirbin/gen_cardhtml-pl
4999- exit
5000-fi
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches