Merge lp:~maddevelopers/mg5amcnlo/upgrade_pythia_compatibility into lp:mg5amcnlo/lts
- upgrade_pythia_compatibility
- Merge into series2.0
Status: | Merged |
---|---|
Merge reported by: | Olivier Mattelaer |
Merged at revision: | not available |
Proposed branch: | lp:~maddevelopers/mg5amcnlo/upgrade_pythia_compatibility |
Merge into: | lp:mg5amcnlo/lts |
Diff against target: |
57402 lines (+24304/-25831) 197 files modified
Template/Cards/run_card.dat (+8/-8) 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 (+44/-43) 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/addmothers.f (+578/-141) Template/SubProcesses/check_dip.f (+0/-537) Template/SubProcesses/check_intdip.f (+0/-401) Template/SubProcesses/cuts.f (+22/-6) Template/SubProcesses/driver.f (+0/-289) Template/SubProcesses/reweight.f (+14/-16) 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 (+17/-12) 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 (+183/-7) 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 (+23/-16) bin/create_aloha_release.py (+2/-2) bin/create_release.py (+18/-0) bin/mg5 (+18/-9) input/mg5_configuration.txt (+63/-2) madgraph/VERSION (+3/-2) madgraph/core/base_objects.py (+7/-3) madgraph/core/diagram_generation.py (+19/-6) madgraph/core/drawing.py (+20/-8) madgraph/core/helas_objects.py (+177/-64) madgraph/interface/.mg5_logging.conf (+14/-3) madgraph/interface/__init__.py (+1/-0) madgraph/interface/cmd_interface.py (+794/-537) madgraph/interface/coloring_logging.py (+52/-0) madgraph/interface/extended_cmd.py (+839/-49) madgraph/interface/launch_ext_program.py (+104/-269) madgraph/interface/madevent_interface.py (+3903/-0) madgraph/interface/tutorial_text.py (+3/-0) madgraph/iolibs/drawing_eps.py (+1/-1) madgraph/iolibs/export_cpp.py (+13/-10) madgraph/iolibs/export_python.py (+8/-9) madgraph/iolibs/export_v4.py (+462/-115) madgraph/iolibs/files.py (+10/-4) madgraph/iolibs/group_subprocs.py (+2/-2) madgraph/iolibs/helas_call_writers.py (+11/-14) madgraph/iolibs/import_v4.py (+13/-9) madgraph/iolibs/misc.py (+231/-40) 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 (+3/-3) 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 (+3/-3) 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/RS_UFO.log (+9/-4) models/RS/__init__.py (+3/-3) models/RS/coupling_orders.py (+7/-7) models/RS/couplings.py (+2/-2) models/RS/lorentz.py (+4/-4) models/RS/parameters.py (+23/-7) models/RS/particles.py (+54/-53) models/RS/vertices.py (+2/-2) models/__init__.py (+2/-2) models/check_param_card.py (+1036/-0) models/import_ufo.py (+188/-31) 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_draw.obj (+4613/-2865) tests/input_files/test_mssm_generation (+20/-0) tests/parallel_tests/compare_with_old_mg5_version.py (+693/-0) tests/parallel_tests/input_files/mg4_heft_23.pkl (+0/-493) tests/parallel_tests/input_files/mg4_sm_22.pkl (+0/-12108) tests/parallel_tests/input_files/mg4_sm_minitest.pkl (+0/-93) tests/parallel_tests/madevent_comparator.py (+415/-0) tests/parallel_tests/me_comparator.py (+192/-42) tests/parallel_tests/sample_script.py (+0/-1) tests/parallel_tests/test_mg4_mg5_comparisons.py (+0/-209) tests/parallel_tests/test_stored_comparisons.py (+0/-91) tests/test_manager.py (+4/-1) tests/unit_tests/__init__.py (+24/-2) tests/unit_tests/core/test_base_objects.py (+3/-3) tests/unit_tests/core/test_diagram_generation.py (+65/-0) tests/unit_tests/core/test_drawing.py (+166/-4) tests/unit_tests/core/test_helas_objects.py (+583/-35) tests/unit_tests/interface/test_cmd.py (+71/-1) tests/unit_tests/interface/test_madevent.py (+103/-0) tests/unit_tests/iolibs/test_drawing_eps.py (+24/-7) tests/unit_tests/iolibs/test_export_v4.py (+475/-23) 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 (+70/-4) 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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Olivier Mattelaer | Approve | ||
marco zaro | Pending | ||
Valentin Hirschi | Pending | ||
Review via email: mp+83825@code.launchpad.net |
Commit message
Description of the change
Hi,
This is the first of the big changes in MG5.
This branch has quite a huge number of modifications into it.
This change quite deeply the cmd_interface by splitting/
One source of problem during merges is the function split_arg which is now inside the class
=> self.split_arg
For the Madevent Template all the binaries are now in ./bin/internal!
A couple of them are simply removed and replace by the madevent interface.
This introduces also the launch -i which might be nice to have also in your development.
Please don't wait too long before proposing your merges.
The sooner we all agree on a structure, the better it is for all our project.
This merge doesn't need to be the final one, neither have all functionalities.
The idea is to fix the structure and move together.
My advice for this merge is that you focus on your branch.
1) Make the merge with your branch and check that everything is still working.
(that's the time to add tests if you don't have enough)
2) If smtg goes wrong/if you notice a change of structure that you don't like, please discuss it here.
3) If you would like a modification to prepare your branch, that's also the time.
Please don't put this on too low priority. I'd say that this should be done in a matter of two weeks. I'm there to help you for the merge and to help you on every step.
Cheers,
Olivier
- 307. By mattelaer-olivier
-
Correct the bug reported by Sho
- 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
- 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. - 335. By Olivier Mattelaer
-
include Johan's comments
- 336. By Olivier Mattelaer
-
fix plot for pgs in multiple pgs run
fix Gamma5 problem(thanks to Peter Manning) - 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
... - 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 ';' - 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
- 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
- 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)
- 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.
- 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
- 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.
Preview Diff
1 | === removed symlink 'AUTHORS' |
2 | === target was 'madgraph/AUTHORS' |
3 | === modified file 'Template/Cards/run_card.dat' |
4 | --- Template/Cards/run_card.dat 2011-06-01 21:40:33 +0000 |
5 | +++ Template/Cards/run_card.dat 2012-02-04 00:00:25 +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 | @@ -69,25 +69,25 @@ |
25 | # Automatic ptj and mjj cuts if xqcut > 0 |
26 | # (turn off for VBF and single top processes) |
27 | #********************************************************** |
28 | - T = auto_ptj_mjj |
29 | + T = auto_ptj_mjj ! Automatic setting of ptj and mjj |
30 | #********************************************************** |
31 | # |
32 | #********************************** |
33 | # BW cutoff (M+/-bwcutoff*Gamma) |
34 | #********************************** |
35 | - 15 = bwcutoff |
36 | + 15 = bwcutoff ! (M+/-bwcutoff*Gamma) |
37 | #********************************************************** |
38 | # Apply pt/E/eta/dr/mij cuts on decay products or not |
39 | -# (note that etmiss/ptll/ptheavy/sorted cuts always apply) |
40 | +# (note that etmiss/ptll/ptheavy/ht/sorted cuts always apply) |
41 | #********************************************************** |
42 | - T = cut_decays |
43 | + T = cut_decays ! Cut decay products |
44 | #************************************************************* |
45 | # Number of helicities to sum per event (0 = all helicities) |
46 | # 0 gives more stable result, but longer run time (needed for |
47 | # long decay chains e.g.). |
48 | # Use >=2 if most helicities contribute, e.g. pure QCD. |
49 | #************************************************************* |
50 | - 0 = nhel |
51 | + 0 = nhel ! Number of helicities used per event |
52 | #******************* |
53 | # Standard Cuts |
54 | #******************* |
55 | @@ -215,7 +215,7 @@ |
56 | # maximal pdg code for quark to be considered as a light jet * |
57 | # (otherwise b cuts are applied) * |
58 | #********************************************************************* |
59 | - 4 = maxjetflavor |
60 | + 4 = maxjetflavor ! Maximum jet pdg code |
61 | #********************************************************************* |
62 | # Jet measure cuts * |
63 | #********************************************************************* |
64 | |
65 | === added file 'Template/HTML/crossx.html' |
66 | === added file 'Template/HTML/mgstyle.css' |
67 | --- Template/HTML/mgstyle.css 1970-01-01 00:00:00 +0000 |
68 | +++ Template/HTML/mgstyle.css 2012-02-04 00:00:25 +0000 |
69 | @@ -0,0 +1,26 @@ |
70 | +th a:link{ |
71 | + color:black; |
72 | +} |
73 | + |
74 | +table { |
75 | + border-width: 1px; |
76 | + border-spacing: 0px; |
77 | + border-style: outset; |
78 | + border-color: black; |
79 | + border-collapse: collapse; |
80 | + background-color: white; |
81 | +} |
82 | +table th { |
83 | + border-width: 2px; |
84 | + padding: 1px; |
85 | + border-style: solid; |
86 | + border-color: black; |
87 | + background-color: white; |
88 | +} |
89 | + |
90 | +table td { |
91 | + border-width: 2px; |
92 | + padding: 1px; |
93 | + border-style: solid; |
94 | + border-color: black; |
95 | +} |
96 | |
97 | === added file 'Template/HTML/sortable.js' |
98 | --- Template/HTML/sortable.js 1970-01-01 00:00:00 +0000 |
99 | +++ Template/HTML/sortable.js 2012-02-04 00:00:25 +0000 |
100 | @@ -0,0 +1,335 @@ |
101 | +/* |
102 | +Table sorting script by Joost de Valk, check it out at http://www.joostdevalk.nl/code/sortable-table/. |
103 | +Based on a script from http://www.kryogenix.org/code/browser/sorttable/. |
104 | +Distributed under the MIT license: http://www.kryogenix.org/code/browser/licence.html . |
105 | +Modify by the MG team for compatibility issue |
106 | + |
107 | +Copyright (c) 1997-2007 Stuart Langridge, Joost de Valk. |
108 | + |
109 | +Version 1.5.7 |
110 | +*/ |
111 | + |
112 | +/* You can change these values */ |
113 | +var europeandate = true; |
114 | +var alternate_row_colors = true; |
115 | + |
116 | +/* Don't change anything below this unless you know what you're doing */ |
117 | +addEvent(window, "load", sortables_init); |
118 | + |
119 | +var SORT_COLUMN_INDEX; |
120 | +var thead = false; |
121 | + |
122 | +function sortables_init() { |
123 | + // Find all tables with class sortable and make them sortable |
124 | + if (!document.getElementsByTagName) return; |
125 | + tbls = document.getElementsByTagName("table"); |
126 | + for (ti=0;ti<tbls.length;ti++) { |
127 | + thisTbl = tbls[ti]; |
128 | + if (((' '+thisTbl.className+' ').indexOf("sortable") != -1) && (thisTbl.id)) { |
129 | + ts_makeSortable(thisTbl); |
130 | + // make it sortable according to the second column |
131 | + if (thisTbl.tHead && thisTbl.tHead.rows.length > 0) { |
132 | + var firstRow = thisTbl.tHead.rows[thisTbl.tHead.rows.length-1]; |
133 | + } else { |
134 | + var firstRow = thisTbl.rows[0]; |
135 | + } |
136 | + |
137 | + for (var ci=0;ci<firstRow.cells[1].childNodes.length;ci++) { |
138 | + if (firstRow.cells[1].childNodes[ci].tagName && firstRow.cells[1].childNodes[ci].tagName.toLowerCase() == 'a') var lnk = firstRow.cells[1].childNodes[ci]; |
139 | + } |
140 | + ts_resortTable(lnk, 1); //order by cross-section |
141 | + ts_resortTable(lnk, 1); //order by cross-section |
142 | + } |
143 | + } |
144 | +} |
145 | + |
146 | +function ts_makeSortable(t) { |
147 | + if (t.rows && t.rows.length > 0) { |
148 | + if (t.tHead && t.tHead.rows.length > 0) { |
149 | + var firstRow = t.tHead.rows[t.tHead.rows.length-1]; |
150 | + thead = true; |
151 | + } else { |
152 | + var firstRow = t.rows[0]; |
153 | + } |
154 | + } |
155 | + if (!firstRow) return; |
156 | + |
157 | + // We have a first row: assume it's the header, and make its contents clickable links |
158 | + for (var i=0;i<firstRow.cells.length;i++) { |
159 | + var cell = firstRow.cells[i]; |
160 | + var txt = ts_getInnerText(cell); |
161 | + if (cell.className != "unsortable" && cell.className.indexOf("unsortable") == -1) { |
162 | + cell.innerHTML = '<a href="#" class="sortheader" onclick="ts_resortTable(this, '+i+');return false;">'+txt+'<span class="sortarrow"></span></a>'; |
163 | + } |
164 | + } |
165 | + if (alternate_row_colors) { |
166 | + alternate(t); |
167 | + } |
168 | +} |
169 | + |
170 | +function ts_getInnerText(el) { |
171 | + if (typeof el == "string") return el; |
172 | + if (typeof el == "undefined") { return el }; |
173 | + if (el.innerText) return el.innerText; //Not needed but it is faster |
174 | + var str = ""; |
175 | + |
176 | + var cs = el.childNodes; |
177 | + var l = cs.length; |
178 | + for (var i = 0; i < l; i++) { |
179 | + switch (cs[i].nodeType) { |
180 | + case 1: //ELEMENT_NODE |
181 | + str += ts_getInnerText(cs[i]); |
182 | + break; |
183 | + case 3: //TEXT_NODE |
184 | + str += cs[i].nodeValue; |
185 | + break; |
186 | + } |
187 | + } |
188 | + return str; |
189 | +} |
190 | + |
191 | +function ts_resortTable(lnk, clid) { |
192 | + var span; |
193 | + for (var ci=0;ci<lnk.childNodes.length;ci++) { |
194 | + if (lnk.childNodes[ci].tagName && lnk.childNodes[ci].tagName.toLowerCase() == 'span') span = lnk.childNodes[ci]; |
195 | + } |
196 | + var spantext = ts_getInnerText(span); |
197 | + var td = lnk.parentNode; |
198 | + var column = clid || td.cellIndex; |
199 | + var t = getParent(td,'TABLE'); |
200 | + // Work out a type for the column |
201 | + if (t.rows.length <= 1) return; |
202 | + var itm = ""; |
203 | + var i = 1; |
204 | + while (itm == "" && i < t.tBodies[0].rows.length) { |
205 | + var itm = ts_getInnerText(t.tBodies[0].rows[i].cells[column]); |
206 | + itm = trim(itm); |
207 | + if (itm.substr(0,4) == "<!--" || itm.length == 0) { |
208 | + itm = ""; |
209 | + } |
210 | + i++; |
211 | + } |
212 | + if (itm == "") return; |
213 | + sortfn = ts_sort_caseinsensitive; |
214 | + if (itm.match(/^\d\d[\/\.-][a-zA-z][a-zA-Z][a-zA-Z][\/\.-]\d\d\d\d$/)) sortfn = ts_sort_date; |
215 | + if (itm.match(/^\d\d[\/\.-]\d\d[\/\.-]\d\d\d{2}?$/)) sortfn = ts_sort_date; |
216 | + if (itm.match(/^-?[£$€Û¢´]\d/)) sortfn = ts_sort_numeric; |
217 | + if (itm.match(/^-?(\d+[,\.]?)+(E[-+][\d]+)?%?$/)) sortfn = ts_sort_numeric; |
218 | + if (itm.match(/^-?(\d+[,\.]?\d+e[-+][\d]+)?%?$/)) sortfn = ts_sort_numeric; |
219 | + if (itm.match(/^-?(\d+[,\.]?)+([\d]+)?%?$/)) sortfn = ts_sort_numeric; |
220 | + SORT_COLUMN_INDEX = column; |
221 | + var firstRow = new Array(); |
222 | + var newRows = new Array(); |
223 | + for (k=0;k<t.tBodies.length;k++) { |
224 | + for (i=0;i<t.tBodies[k].rows[0].length;i++) { |
225 | + firstRow[i] = t.tBodies[k].rows[0][i]; |
226 | + } |
227 | + } |
228 | + for (k=0;k<t.tBodies.length;k++) { |
229 | + if (!thead) { |
230 | + // Skip the first row |
231 | + for (j=1;j<t.tBodies[k].rows.length;j++) { |
232 | + newRows[j-1] = t.tBodies[k].rows[j]; |
233 | + } |
234 | + } else { |
235 | + // Do NOT skip the first row |
236 | + for (j=0;j<t.tBodies[k].rows.length;j++) { |
237 | + newRows[j] = t.tBodies[k].rows[j]; |
238 | + } |
239 | + } |
240 | + } |
241 | + newRows.sort(sortfn); |
242 | + if (span.getAttribute("sortdir") == 'down') { |
243 | + ARROW = ' ↓'; |
244 | + newRows.reverse(); |
245 | + span.setAttribute('sortdir','up'); |
246 | + } else { |
247 | + ARROW = ' ↑'; |
248 | + span.setAttribute('sortdir','down'); |
249 | + } |
250 | + // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones |
251 | + // don't do sortbottom rows |
252 | + for (i=0; i<newRows.length; i++) { |
253 | + if (!newRows[i].className || (newRows[i].className && (newRows[i].className.indexOf('sortbottom') == -1))) { |
254 | + t.tBodies[0].appendChild(newRows[i]); |
255 | + } |
256 | + } |
257 | + // do sortbottom rows only |
258 | + for (i=0; i<newRows.length; i++) { |
259 | + if (newRows[i].className && (newRows[i].className.indexOf('sortbottom') != -1)) |
260 | + t.tBodies[0].appendChild(newRows[i]); |
261 | + } |
262 | + // Delete any other arrows there may be showing |
263 | + var allspans = document.getElementsByTagName("span"); |
264 | + for (var ci=0;ci<allspans.length;ci++) { |
265 | + if (allspans[ci].className == 'sortarrow') { |
266 | + if (getParent(allspans[ci],"table") == getParent(lnk,"table")) { // in the same table as us? |
267 | + allspans[ci].innerHTML = ''; |
268 | + } |
269 | + } |
270 | + } |
271 | + span.innerHTML = ARROW; |
272 | + alternate(t); |
273 | +} |
274 | + |
275 | +function getParent(el, pTagName) { |
276 | + if (el == null) { |
277 | + return null; |
278 | + } else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) { |
279 | + return el; |
280 | + } else { |
281 | + return getParent(el.parentNode, pTagName); |
282 | + } |
283 | +} |
284 | + |
285 | +function sort_date(date) { |
286 | + // y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX |
287 | + dt = "00000000"; |
288 | + if (date.length == 11) { |
289 | + mtstr = date.substr(3,3); |
290 | + mtstr = mtstr.toLowerCase(); |
291 | + switch(mtstr) { |
292 | + case "jan": var mt = "01"; break; |
293 | + case "feb": var mt = "02"; break; |
294 | + case "mar": var mt = "03"; break; |
295 | + case "apr": var mt = "04"; break; |
296 | + case "may": var mt = "05"; break; |
297 | + case "jun": var mt = "06"; break; |
298 | + case "jul": var mt = "07"; break; |
299 | + case "aug": var mt = "08"; break; |
300 | + case "sep": var mt = "09"; break; |
301 | + case "oct": var mt = "10"; break; |
302 | + case "nov": var mt = "11"; break; |
303 | + case "dec": var mt = "12"; break; |
304 | + // default: var mt = "00"; |
305 | + } |
306 | + dt = date.substr(7,4)+mt+date.substr(0,2); |
307 | + return dt; |
308 | + } else if (date.length == 10) { |
309 | + if (europeandate == false) { |
310 | + dt = date.substr(6,4)+date.substr(0,2)+date.substr(3,2); |
311 | + return dt; |
312 | + } else { |
313 | + dt = date.substr(6,4)+date.substr(3,2)+date.substr(0,2); |
314 | + return dt; |
315 | + } |
316 | + } else if (date.length == 8) { |
317 | + yr = date.substr(6,2); |
318 | + if (parseInt(yr) < 50) { |
319 | + yr = '20'+yr; |
320 | + } else { |
321 | + yr = '19'+yr; |
322 | + } |
323 | + if (europeandate == true) { |
324 | + dt = yr+date.substr(3,2)+date.substr(0,2); |
325 | + return dt; |
326 | + } else { |
327 | + dt = yr+date.substr(0,2)+date.substr(3,2); |
328 | + return dt; |
329 | + } |
330 | + } |
331 | + return dt; |
332 | +} |
333 | + |
334 | +function ts_sort_date(a,b) { |
335 | + dt1 = sort_date(ts_getInnerText(a.cells[SORT_COLUMN_INDEX])); |
336 | + dt2 = sort_date(ts_getInnerText(b.cells[SORT_COLUMN_INDEX])); |
337 | + |
338 | + if (dt1==dt2) { |
339 | + return 0; |
340 | + } |
341 | + if (dt1<dt2) { |
342 | + return -1; |
343 | + } |
344 | + return 1; |
345 | +} |
346 | +function ts_sort_numeric(a,b) { |
347 | + var aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]); |
348 | + aa = clean_num(aa); |
349 | + var bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]); |
350 | + bb = clean_num(bb); |
351 | + return compare_numeric(aa,bb); |
352 | +} |
353 | +function compare_numeric(a,b) { |
354 | + var a = parseFloat(a); |
355 | + a = (isNaN(a) ? 0 : a); |
356 | + var b = parseFloat(b); |
357 | + b = (isNaN(b) ? 0 : b); |
358 | + return a - b; |
359 | +} |
360 | +function ts_sort_caseinsensitive(a,b) { |
361 | + aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).toLowerCase(); |
362 | + bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).toLowerCase(); |
363 | + if (aa==bb) { |
364 | + return 0; |
365 | + } |
366 | + if (aa<bb) { |
367 | + return -1; |
368 | + } |
369 | + return 1; |
370 | +} |
371 | +function ts_sort_default(a,b) { |
372 | + aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]); |
373 | + bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]); |
374 | + if (aa==bb) { |
375 | + return 0; |
376 | + } |
377 | + if (aa<bb) { |
378 | + return -1; |
379 | + } |
380 | + return 1; |
381 | +} |
382 | + |
383 | +function addEvent(elm, evType, fn, useCapture) |
384 | +// addEvent and removeEvent |
385 | +// cross-browser event handling for IE5+, NS6 and Mozilla |
386 | +// By Scott Andrew |
387 | +{ |
388 | + if (elm.addEventListener){ |
389 | + elm.addEventListener(evType, fn, useCapture); |
390 | + return true; |
391 | + } else if (elm.attachEvent){ |
392 | + var r = elm.attachEvent("on"+evType, fn); |
393 | + return r; |
394 | + } else { |
395 | + alert("Handler could not be removed"); |
396 | + } |
397 | +} |
398 | +function clean_num(str) { |
399 | + str = str.replace(new RegExp(/[^-?0-9.eE]/g),""); |
400 | + return str; |
401 | +} |
402 | +function trim(s) { |
403 | + return s.replace(/^\s+|\s+$/g, ""); |
404 | +} |
405 | +function alternate(table) { |
406 | + // Take object table and get all it's tbodies. |
407 | + var tableBodies = table.getElementsByTagName("tbody"); |
408 | + // Loop through these tbodies |
409 | + for (var i = 0; i < tableBodies.length; i++) { |
410 | + // Take the tbody, and get all it's rows |
411 | + var tableRows = tableBodies[i].getElementsByTagName("tr"); |
412 | + // Loop through these rows |
413 | + // Start at 1 because we want to leave the heading row untouched |
414 | + for (var j = 0; j < tableRows.length; j++) { |
415 | + // Check if j is even, and apply classes for both possible results |
416 | + if ( (j % 2) == 0 ) { |
417 | + if ( !(tableRows[j].className.indexOf('odd') == -1) ) { |
418 | + tableRows[j].className = tableRows[j].className.replace('odd', 'even'); |
419 | + } else { |
420 | + if ( tableRows[j].className.indexOf('even') == -1 ) { |
421 | + tableRows[j].className += " even"; |
422 | + } |
423 | + } |
424 | + } else { |
425 | + if ( !(tableRows[j].className.indexOf('even') == -1) ) { |
426 | + tableRows[j].className = tableRows[j].className.replace('even', 'odd'); |
427 | + } else { |
428 | + if ( tableRows[j].className.indexOf('odd') == -1 ) { |
429 | + tableRows[j].className += " odd"; |
430 | + } |
431 | + } |
432 | + } |
433 | + } |
434 | + } |
435 | +} |
436 | |
437 | === modified file 'Template/Source/PDF/pdg2pdf.f' |
438 | --- Template/Source/PDF/pdg2pdf.f 2011-03-02 20:10:29 +0000 |
439 | +++ Template/Source/PDF/pdg2pdf.f 2012-02-04 00:00:25 +0000 |
440 | @@ -27,6 +27,12 @@ |
441 | if(iabs(ipart).eq.22) ipart=7 |
442 | iporg=ipart |
443 | |
444 | +c This will be called for any PDG code, but we only support up to 7 |
445 | + if(iabs(ipart).gt.7)then |
446 | + pdg2pdf=0d0 |
447 | + return |
448 | + endif |
449 | + |
450 | ireuse = 0 |
451 | do i=1,2 |
452 | c Check if result can be reused since any of last two calls |
453 | |
454 | === modified file 'Template/Source/PDF/pdg2pdf_lhapdf.f' |
455 | --- Template/Source/PDF/pdg2pdf_lhapdf.f 2010-10-30 03:26:37 +0000 |
456 | +++ Template/Source/PDF/pdg2pdf_lhapdf.f 2012-02-04 00:00:25 +0000 |
457 | @@ -20,6 +20,13 @@ |
458 | |
459 | ipart=ipdg |
460 | if(ipart.eq.21) ipart=0 |
461 | + if(iabs(ipart).eq.22) ipart=7 |
462 | + |
463 | +c This will be called for any PDG code, but we only support up to 7 |
464 | + if(iabs(ipart).gt.7)then |
465 | + pdg2pdf=0d0 |
466 | + return |
467 | + endif |
468 | |
469 | if(ih.eq.ihlast.and.x.eq.xlast.and.xmu.eq.xmulast)then |
470 | pdg2pdf=pdflast(ipart); |
471 | |
472 | === renamed file 'Template/Events/banner_header.txt' => 'Template/Source/banner_header.txt' |
473 | === modified file 'Template/Source/dsample.f' |
474 | --- Template/Source/dsample.f 2011-08-19 00:06:00 +0000 |
475 | +++ Template/Source/dsample.f 2012-02-04 00:00:25 +0000 |
476 | @@ -1,4 +1,4 @@ |
477 | - subroutine sample_full(ndim,ncall,itmax,dsig,ninvar,nconfigs) |
478 | + subroutine sample_full(ndim,ncall,itmax,itmin,dsig,ninvar,nconfigs) |
479 | c************************************************************************** |
480 | c Driver for sample which does complete integration |
481 | c This is done in double precision, and should be told the |
482 | @@ -6,7 +6,8 @@ |
483 | c Arguments: |
484 | c ndim Number of dimensions for integral(number or random #'s/point) |
485 | c ncall Number of times to evaluate the function/iteration |
486 | -c itmax Number of iterations |
487 | +c itmax Max number of iterations |
488 | +c itmin Min number of iterations |
489 | c ninvar Number of invarients to keep grids on (s,t,u, s',t' etc) |
490 | c nconfigs Number of different pole configurations |
491 | c dsig Function to be integrated |
492 | @@ -16,7 +17,7 @@ |
493 | c |
494 | c Arguments |
495 | c |
496 | - integer ndim,ncall,itmax,ninvar,nconfigs |
497 | + integer ndim,ncall,itmax,itmin,ninvar,nconfigs |
498 | external dsig |
499 | double precision dsig |
500 | c |
501 | @@ -24,7 +25,7 @@ |
502 | c |
503 | double precision x(maxinvar),wgt,p(4*maxdim/3+14) |
504 | double precision tdem, chi2, dum |
505 | - integer ievent,kevent,nwrite,iter,nun,luntmp |
506 | + integer ievent,kevent,nwrite,iter,nun,luntmp,itsum |
507 | integer jmax,i,j,ipole |
508 | integer itmax_adjust |
509 | c |
510 | @@ -51,8 +52,8 @@ |
511 | common /to_accuracy/accur |
512 | |
513 | double precision twgt, maxwgt,swgt(maxevents) |
514 | - integer lun, nw |
515 | - common/to_unwgt/twgt, maxwgt, swgt, lun, nw |
516 | + integer lun, nw, itminx |
517 | + common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itminx |
518 | |
519 | integer nzoom |
520 | double precision tx(1:3,maxinvar) |
521 | @@ -100,6 +101,7 @@ |
522 | kevent = 0 |
523 | nzoom = 0 |
524 | xzoomfact = 1d0 |
525 | + itminx = itmin |
526 | if (nsteps .lt. 1) nsteps=1 |
527 | nwrite = itmax*ncall/nsteps |
528 | c open(unit=66,file='.sample_warn',status='unknown') |
529 | @@ -140,7 +142,7 @@ |
530 | wgt=0d0 |
531 | endif |
532 | if (nzoom .le. 0) then |
533 | - call sample_put_point(wgt,x(1),iter,ipole) !Store result |
534 | + call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result |
535 | else |
536 | nzoom = nzoom -1 |
537 | ievent=ievent-1 |
538 | @@ -165,7 +167,9 @@ |
539 | i=i+1 |
540 | enddo |
541 | cur_it = i |
542 | - i = cur_it - 3 |
543 | +c Use the last 3 iterations or cur_it-1 if cur_it-1 >= itmin but < 3 |
544 | + itsum = min(max(itmin,cur_it-1),3) |
545 | + i = cur_it - itsum |
546 | if (i .gt. 0) then |
547 | tmean = 0d0 |
548 | tsigma = 0d0 |
549 | @@ -183,13 +187,14 @@ |
550 | nun = neventswritten |
551 | |
552 | chi2 = 0d0 |
553 | - do i = cur_it-3,cur_it-1 |
554 | + do i = cur_it-itsum,cur_it-1 |
555 | chi2 = chi2+(xmean(i)-tmean)**2/xsigma(i)**2 |
556 | enddo |
557 | chi2 = chi2/2d0 !Since using only last 3, n-1=2 |
558 | write(*,'(a)') '-----------------------------------------------------' |
559 | write(*,'(a)') '---------------------------' |
560 | - write(*,'(a,e12.4)') ' Results Last 3 iters: Integral = ',tmean |
561 | + write(*,'(a,i3,a,e12.4)') ' Results Last ',itsum, |
562 | + $ ' iters: Integral = ',tmean |
563 | write(*,'(25x,a,e12.4)') 'Std dev = ',tsigma |
564 | write(*,'(17x,a,f12.4)') 'Chi**2 per DoF. =',chi2 |
565 | write(*,'(a)') '-----------------------------------------------------' |
566 | @@ -197,15 +202,17 @@ |
567 | |
568 | if (nun .lt. 0) nun=-nun !Case when wrote maximun number allowed |
569 | if (chi2 .gt. 1) tsigma=tsigma*sqrt(chi2) |
570 | +c JA 02/2011 Added twgt to results.dat to allow event generation in |
571 | +c first iteration for gridpack runs |
572 | if (icor .eq. 0) then |
573 | - write(66,'(3e12.5,2i9,i5,i9,e10.3)')tmean,tsigma,0.0,kevent,nw, |
574 | - & cur_it-1,nun, nun/max(tmean,1d-99) |
575 | + write(66,'(3e12.5,2i9,i5,i9,e10.3,e12.5)')tmean,tsigma,0.0, |
576 | + & kevent, nw, cur_it-1, nun, nun/max(tmean,1d-99), twgt |
577 | else |
578 | - write(66,'(3e12.5,2i9,i5,i9,e10.3)')tmean,0.0,tsigma,kevent,nw, |
579 | - & cur_it-1,nun, nun/max(tmean,1d-99) |
580 | + write(66,'(3e12.5,2i9,i5,i9,e10.3,e12.5)')tmean,0.0,tsigma, |
581 | + & kevent, nw, cur_it-1, nun, nun/max(tmean,1d-99), twgt |
582 | endif |
583 | c do i=1,cur_it-1 |
584 | - do i=cur_it-3,cur_it-1 |
585 | + do i=cur_it-itsum,cur_it-1 |
586 | write(66,'(i4,4e15.5)') i,xmean(i),xsigma(i),xeff(i),xwmax(i) |
587 | enddo |
588 | close(66) |
589 | @@ -297,7 +304,7 @@ |
590 | wgt=0d0 |
591 | endif |
592 | if (nzoom .le. 0) then |
593 | - call sample_put_point(wgt,x(1),iter,ipole) !Store result |
594 | + call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result |
595 | else |
596 | nzoom = nzoom -1 |
597 | ievent=ievent-1 |
598 | @@ -314,7 +321,9 @@ |
599 | i=i+1 |
600 | enddo |
601 | cur_it = i |
602 | - i = cur_it - 3 |
603 | +c Use the last 3 iterations or cur_it-1 if cur_it-1 >= itmin |
604 | + itsum = min(max(itmin,cur_it-1),3) |
605 | + i = cur_it - itsum |
606 | if (i .gt. 0) then |
607 | tmean = 0d0 |
608 | tsigma = 0d0 |
609 | @@ -334,13 +343,13 @@ |
610 | nun = neventswritten |
611 | |
612 | chi2 = 0d0 |
613 | - do i = cur_it-3,cur_it-1 |
614 | + do i = cur_it-itsum,cur_it-1 |
615 | chi2 = chi2+(xmean(i)-tmean)**2/xsigma(i)**2 |
616 | enddo |
617 | chi2 = chi2/2d0 !Since using only last 3, n-1=2 |
618 | write(*,'(a)') '-----------------------------------------------------' |
619 | write(*,'(a)') '---------------------------' |
620 | - write(*,'(a,e12.4)') ' Results Last 3 iters: Integral = ',tmean |
621 | + write(*,'(a,i3,a,e12.4)') ' Results Last ',itsum,' iters: Integral = ',tmean |
622 | write(*,'(25x,a,e12.4)') 'Std dev = ',tsigma |
623 | write(*,'(17x,a,f12.4)') 'Chi**2 per DoF. =',chi2 |
624 | write(*,'(a)') '-----------------------------------------------------' |
625 | @@ -348,15 +357,17 @@ |
626 | |
627 | if (nun .lt. 0) nun=-nun !Case when wrote maximun number allowed |
628 | if (chi2 .gt. 1) tsigma=tsigma*sqrt(chi2) |
629 | +c JA 02/2011 Added twgt to results.dat to allow event generation in |
630 | +c first iteration for gridpack runs |
631 | if (icor .eq. 0) then |
632 | - write(66,'(3e12.5,2i9,i5,i9,e10.3)')tmean,tsigma,0.0,kevent,nw, |
633 | - & cur_it-1,nun, nun/max(tmean,1d-99) |
634 | + write(66,'(3e12.5,2i9,i5,i9,e10.3,e12.5)')tmean,tsigma,0.0, |
635 | + & kevent, nw, cur_it-1, nun, nun/max(tmean,1d-99), twgt |
636 | else |
637 | - write(66,'(3e12.5,2i9,i5,i9,e10.3)')tmean,0.0,tsigma,kevent,nw, |
638 | - & cur_it-1,nun, nun/max(tmean,1d-99) |
639 | + write(66,'(3e12.5,2i9,i5,i9,e10.3,e12.5)')tmean,0.0,tsigma, |
640 | + & kevent, nw, cur_it-1, nun, nun/max(tmean,1d-99), twgt |
641 | endif |
642 | c do i=1,cur_it-1 |
643 | - do i=cur_it-3,cur_it-1 |
644 | + do i=cur_it-itsum,cur_it-1 |
645 | write(66,'(i4,4e15.5)') i,xmean(i),xsigma(i),xeff(i),xwmax(i) |
646 | enddo |
647 | close(66) |
648 | @@ -371,237 +382,6 @@ |
649 | |
650 | end |
651 | |
652 | - subroutine sample_fullx(ndim,ncall,itmax,dsig,ninvar,nconfigs) |
653 | -c************************************************************************** |
654 | -c Driver for sample which does complete integration |
655 | -c This is done in double precision, and should be told the |
656 | -c number of possible phasespace choices. |
657 | -c Arguments: |
658 | -c ndim Number of dimensions for integral(number or random #'s/point) |
659 | -c ncall Number of times to evaluate the function/iteration |
660 | -c itmax Number of iterations |
661 | -c ninvar Number of invarients to keep grids on (s,t,u, s',t' etc) |
662 | -c nconfigs Number of different pole configurations |
663 | -c dsig Function to be integrated |
664 | -c************************************************************************** |
665 | - implicit none |
666 | - include 'genps.inc' |
667 | -c |
668 | -c Arguments |
669 | -c |
670 | - integer ndim,ncall,itmax,ninvar,nconfigs |
671 | - external dsig |
672 | - double precision dsig |
673 | -c |
674 | -c Local |
675 | -c |
676 | - double precision x(maxinvar),wgt,p(4*maxdim/3+14) |
677 | - double precision tdem, chi2 |
678 | - integer ievent,kevent,nwrite,iter,nun |
679 | - integer jmax,i,j,ipole |
680 | -c |
681 | -c External |
682 | -c |
683 | - integer n_unwgted |
684 | - external n_unwgted |
685 | -c |
686 | -c Global |
687 | -c |
688 | - integer nsteps |
689 | - character*40 result_file,where_file |
690 | - common /sample_status/result_file,where_file,nsteps |
691 | - double precision fx |
692 | - common /to_fx/ fx |
693 | - |
694 | - integer mincfig, maxcfig |
695 | - common/to_configs/mincfig, maxcfig |
696 | - |
697 | - double precision xmean(99),xsigma(99),xwmax(99),xeff(99) |
698 | - common/to_iterations/xmean, xsigma, xwmax, xeff |
699 | - |
700 | - double precision accur |
701 | - common /to_accuracy/accur |
702 | - |
703 | - double precision twgt, maxwgt,swgt(maxevents) |
704 | - integer lun, nw |
705 | - common/to_unwgt/twgt, maxwgt, swgt, lun, nw |
706 | - |
707 | - integer nzoom |
708 | - double precision tx(1:3,maxinvar) |
709 | - common/to_xpoints/tx, nzoom |
710 | - |
711 | - double precision xzoomfact |
712 | - common/to_zoom/ xzoomfact |
713 | - |
714 | - double precision tmean, tsigma |
715 | - integer dim, events, itm, kn, cur_it, invar, configs |
716 | - common /sample_common/ |
717 | - . tmean, tsigma, dim, events, itm, kn, cur_it, invar, configs |
718 | - |
719 | - integer icor |
720 | - common/to_correlated/icor |
721 | -c |
722 | -c External |
723 | -c |
724 | - logical pass_point |
725 | -c |
726 | -c Data |
727 | -c |
728 | -c data result_file,where_file,nsteps/'SAMPLE','WHERE.AMI',100/ |
729 | -c data accur/-1d0/ |
730 | -c data mincfig /1/ |
731 | -c data maxcfig /1/ |
732 | -c data twgt/-1d0/ !Dont write out events |
733 | -c data lun/27/ !Unit number for events |
734 | -c data maxwgt/0d0/ |
735 | -c data nw/0/ !Number of events written |
736 | - |
737 | - |
738 | -c----- |
739 | -c Begin Code |
740 | -c----- |
741 | - ievent = 0 |
742 | - kevent = 0 |
743 | - nzoom = 0 |
744 | - xzoomfact = 1d0 |
745 | - if (nsteps .lt. 1) nsteps=1 |
746 | - nwrite = itmax*ncall/nsteps |
747 | -c open(unit=66,file='.sample_warn',status='unknown') |
748 | -c write(66,*) 'Warnings from sample run.',itmax,ncall |
749 | -c close(66) |
750 | - call sample_init(ndim,ncall,itmax,ninvar,nconfigs) |
751 | - call graph_init |
752 | - do i=1,itmax |
753 | - xmean(i)=0d0 |
754 | - xsigma(i)=0d0 |
755 | - enddo |
756 | -c mincfig=1 |
757 | -c maxcfig=nconfigs |
758 | - wgt = 0d0 |
759 | -c |
760 | -c Main Integration Loop |
761 | -c |
762 | - iter = 1 |
763 | - do while(iter .le. itmax) |
764 | -c |
765 | -c Get integration point |
766 | -c |
767 | - call sample_get_config(wgt,iter,ipole) |
768 | - if (iter .le. itmax) then |
769 | - ievent=ievent+1 |
770 | - call x_to_f_arg(ndim,ipole,mincfig,maxcfig,ninvar,wgt,x,p) |
771 | - if (pass_point(p)) then |
772 | - xzoomfact = 1d0 |
773 | - fx = dsig(p,wgt,0) !Evaluate function |
774 | - if (xzoomfact .gt. 0d0) then |
775 | - wgt = wgt*fx*xzoomfact |
776 | - else |
777 | - wgt = -xzoomfact |
778 | - endif |
779 | - if (wgt .gt. 0d0) call graph_point(p,wgt) !Update graphs |
780 | - else |
781 | - fx =0d0 |
782 | - wgt=0d0 |
783 | - endif |
784 | - if (nzoom .le. 0) then |
785 | - call sample_put_point(wgt,x(1),iter,ipole) !Store result |
786 | - else |
787 | - nzoom = nzoom -1 |
788 | - ievent=ievent-1 |
789 | - endif |
790 | - endif |
791 | - if (wgt .gt. 0d0) kevent=kevent+1 |
792 | -c |
793 | -c Write out progress/histograms |
794 | -c |
795 | - if (kevent .ge. nwrite) then |
796 | - nwrite = nwrite+ncall*itmax/nsteps |
797 | - nwrite = min(nwrite,ncall*itmax) |
798 | -c open(unit=22,file=where_file,status='old', |
799 | -c & access='append',err=99) |
800 | -c write(22,'(2i15)') ievent,kevent |
801 | -c close(22) |
802 | - call graph_store |
803 | - endif |
804 | - 99 enddo |
805 | -c |
806 | -c All done |
807 | -c |
808 | -c open(unit=66,file='.sample_warn',status='old',access='append') |
809 | -c write(66,*) 'Finished sample',ievent,kevent,wgt |
810 | -c if (wgt .ne. -1) then |
811 | -c do j=1,5 |
812 | -c jmax = min(ndim,4*j) |
813 | -c write(66,'(4e19.12)') (x(i),i=(j-1)*4+1,jmax) |
814 | -c enddo |
815 | -c endif |
816 | -c close(66) |
817 | - |
818 | - open(unit=66,file='results.dat',status='unknown') |
819 | - i=1 |
820 | - do while(xmean(i) .ne. 0 .and. i .lt. cur_it) |
821 | - i=i+1 |
822 | - enddo |
823 | - cur_it = i |
824 | - i = cur_it - 3 |
825 | - if (i .gt. 0) then |
826 | - tmean = 0d0 |
827 | - tsigma = 0d0 |
828 | - tdem = 0d0 |
829 | - do while (xmean(i) .ne. 0 .and. i .lt. cur_it) |
830 | - tmean = tmean+xmean(i)*xmean(i)**2/xsigma(i)**2 |
831 | - tdem = tdem+xmean(i)**2/xsigma(i)**2 |
832 | - tsigma = tsigma + xmean(i)**2/ xsigma(i)**2 |
833 | - i=i+1 |
834 | - enddo |
835 | -c tmean = tmean/dble(i-1) |
836 | -c tsigma= sqrt(tsigma)/dble(i-1) |
837 | - tmean = tmean/tsigma |
838 | -c tsigma= sqrt(tsigma)/dble(3) |
839 | - tsigma= tmean/sqrt(tsigma) |
840 | - nun = n_unwgted() |
841 | - |
842 | - chi2 = 0d0 |
843 | - do i = cur_it-3,cur_it-1 |
844 | - chi2 = chi2+(xmean(i)-tmean)**2/xsigma(i)**2 |
845 | - enddo |
846 | - chi2 = chi2/2d0 !Since using only last 3, n-1=2 |
847 | -c tsigma = tsigma*sqrt(chi2) |
848 | -c write(*,*) "chi2 / dof=", chi2 |
849 | - write(*,'(a)') '-----------------------------------------------------' |
850 | - write(*,'(a)') '---------------------------' |
851 | - write(*,'(a,e12.4)') ' Results Last 3 iters: Integral = ',tmean |
852 | - write(*,'(25x,a,e12.4)') 'Std dev = ',tsigma |
853 | - write(*,'(17x,a,f12.4)') 'Chi**2 per DoF. =',chi2 |
854 | - write(*,'(a)') '-----------------------------------------------------' |
855 | - write(*,'(a)') '---------------------------' |
856 | - |
857 | - if (nun .lt. 0) nun=-nun !Case when wrote maximun number allowed |
858 | - if (chi2 .gt. 1) tsigma=tsigma*sqrt(chi2) |
859 | - if (icor .eq. 0) then |
860 | - write(66,'(3e12.5,2i9,i5,i9,e10.3)')tmean,tsigma,0.0,kevent,nw, |
861 | - & cur_it-1,nun, nun/max(tmean,1d-99) |
862 | - else |
863 | - write(66,'(3e12.5,2i9,i5,i9,e10.3)')tmean,0.0,tsigma,kevent,nw, |
864 | - & cur_it-1,nun, nun/max(tmean,1d-99) |
865 | - endif |
866 | -c do i=1,cur_it-1 |
867 | - do i=cur_it-3,cur_it-1 |
868 | - write(66,'(i4,4e15.5)') i,xmean(i),xsigma(i),xeff(i),xwmax(i) |
869 | - enddo |
870 | - close(66) |
871 | - else |
872 | - open(unit=66,file='results.dat',status='unknown') |
873 | - write(66,'(3e12.5,2i9,i5,i9,e10.3)')0,0,0.0,kevent,nw, |
874 | - & 1,0, 0 |
875 | - write(66,'(i4,4e15.5)') 1,0,0,0,0 |
876 | - close(66) |
877 | - |
878 | - endif |
879 | - |
880 | - end |
881 | - |
882 | - |
883 | subroutine sample_writehtm() |
884 | c*********************************************************************** |
885 | c Writes out results of run in html format |
886 | @@ -1336,10 +1116,10 @@ |
887 | endif |
888 | end |
889 | |
890 | - subroutine sample_result(mean, sigma) |
891 | + subroutine sample_result(mean, sigma, itmin) |
892 | implicit none |
893 | double precision mean, sigma |
894 | - integer i,cur_it |
895 | + integer i,cur_it,itmin,itsum |
896 | double precision tsigma,tmean,tsig,tdem |
897 | |
898 | double precision xmean(99),xsigma(99),xwmax(99),xeff(99) |
899 | @@ -1351,7 +1131,9 @@ |
900 | i=i+1 |
901 | enddo |
902 | cur_it = i |
903 | - i = cur_it - 3 |
904 | +c Use the last 3 iterations or cur_it-1 if cur_it-1 >= itmin |
905 | + itsum = min(max(itmin,cur_it-1),3) |
906 | + i = cur_it - itsum |
907 | tmean = 0d0 |
908 | tsigma = 0d0 |
909 | if (i .gt. 0) then |
910 | @@ -1393,7 +1175,7 @@ |
911 | c |
912 | c Local |
913 | c |
914 | - integer i, j, k, knt, non_zero, nun |
915 | + integer i, j, k, knt, non_zero, nun,itsum |
916 | double precision vol,xnmin,xnmax,tot,xdum,tmp1,chi2tmp |
917 | double precision rc, dr, xo, xn, x(maxinvar), dum(ng-1) |
918 | save vol,knt |
919 | @@ -1447,8 +1229,8 @@ |
920 | common /to_error/reliable |
921 | |
922 | double precision twgt, maxwgt,swgt(maxevents) |
923 | - integer lun, nw |
924 | - common/to_unwgt/twgt, maxwgt, swgt, lun, nw |
925 | + integer lun, nw, itmin |
926 | + common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin |
927 | |
928 | |
929 | real*8 wmax !This is redundant |
930 | @@ -1889,9 +1671,9 @@ |
931 | xdum=dsig(0,0,2) |
932 | c |
933 | c Add test to see if we have achieved desired accuracy |
934 | -c JA 8/17/2011 allow minimum 3 iterations instead of 5 |
935 | +c Allow minimum itmin iterations |
936 | c |
937 | - if (tsigma .gt. 0d0 .and. cur_it .gt. 3 .and. accur .gt. 0d0) then |
938 | + if (tsigma .gt. 0d0 .and. cur_it .gt. itmin .and. accur .gt. 0d0) then |
939 | |
940 | xmean = tmean/tsigma |
941 | xchi2 = (chi2/xmean/xmean-tsigma)/dble(cur_it-2) |
942 | @@ -1930,7 +1712,7 @@ |
943 | c |
944 | c New check to see if we need to keep integrating this one or not. |
945 | c |
946 | - if (cur_it .gt. 3 .and. accur .lt. 0d0) then !Check luminocity |
947 | + if (cur_it .gt. itmin .and. accur .lt. 0d0) then !Check luminocity |
948 | c |
949 | c Lets get the actual number instead |
950 | c tjs 5/22/2007 |
951 | @@ -1941,16 +1723,18 @@ |
952 | nun = neventswritten |
953 | c tmp1 = tmean / tsigma |
954 | c chi2tmp = (chi2/tmp1/tmp1-tsigma)/dble(cur_it-2) |
955 | -c Calculate chi2 for last three events (ja 03/11) |
956 | +c Calculate chi2 for last few iterations (ja 03/11) |
957 | tmeant = 0d0 |
958 | tsigmat = 0d0 |
959 | - do i=cur_it-3,cur_it-1 |
960 | +c Use the last 3 iterations or cur_it-1 if cur_it-1 >= itmin but < 3 |
961 | + itsum = min(max(itmin,cur_it-1),3) |
962 | + do i=cur_it-itsum,cur_it-1 |
963 | tmeant = tmeant+ymean(i)*ymean(i)**2/ysigma(i)**2 |
964 | tsigmat = tsigmat + ymean(i)**2/ ysigma(i)**2 |
965 | enddo |
966 | tmeant = tmeant/tsigmat |
967 | chi2tmp = 0d0 |
968 | - do i = cur_it-3,cur_it-1 |
969 | + do i = cur_it-itsum,cur_it-1 |
970 | chi2tmp = chi2tmp+(ymean(i)-tmeant)**2/ysigma(i)**2 |
971 | enddo |
972 | chi2tmp = chi2tmp/2d0 !Since using only last 3, n-1=2 |
973 | |
974 | === modified file 'Template/Source/gen_ximprove.f' |
975 | --- Template/Source/gen_ximprove.f 2011-08-19 00:06:00 +0000 |
976 | +++ Template/Source/gen_ximprove.f 2012-02-04 00:00:25 +0000 |
977 | @@ -19,8 +19,8 @@ |
978 | c |
979 | c global |
980 | c |
981 | - integer max_np |
982 | - common/max_np/max_np |
983 | + integer max_np,min_iter |
984 | + common/max_np/max_np,min_iter |
985 | |
986 | c |
987 | c local |
988 | @@ -41,7 +41,7 @@ |
989 | logical parallel, gen_events |
990 | character*20 param(maxpara),value(maxpara) |
991 | integer npara, nreq, ngran, nhel_refine |
992 | - integer ij, kl, iseed |
993 | + integer ij, kl, iseed, ioffset |
994 | logical Gridpack,gridrun |
995 | logical split_channels |
996 | common /to_split/split_channels |
997 | @@ -62,6 +62,7 @@ |
998 | & ', or number events (>1), max processes per job', |
999 | & ', and whether to split channels (T/F)' |
1000 | read(*,*) err_goal, max_np, split_channels |
1001 | + min_iter=3 |
1002 | parallel = .false. |
1003 | if (err_goal .lt. 1) then |
1004 | write(*,'(a,f8.2,a)') 'Running for accuracy of ', |
1005 | @@ -79,11 +80,13 @@ |
1006 | else |
1007 | gen_events=.true. |
1008 | split_channels=.false. |
1009 | +c Allow all the way down to a single iteration for gridruns |
1010 | + min_iter=1 |
1011 | call get_integer(npara,param,value," gevents " ,nreq ,2000 ) |
1012 | - err_goal = 1.2*nreq |
1013 | + err_goal = 1.2*nreq ! extra factor to ensure works |
1014 | call get_integer(npara,param,value," gseed " ,iseed ,4321 ) |
1015 | call get_integer(npara,param,value," ngran " ,ngran , -1) |
1016 | - if (ngran.eq.-1) ngran = int(sqrt(real(nreq))) |
1017 | + if (ngran.eq.-1) ngran = 1 |
1018 | write(*,*) "Running on Grid to generate ",nreq," additional events" |
1019 | write(*,*) " with granularity equal to ",ngran |
1020 | c |
1021 | @@ -91,9 +94,12 @@ |
1022 | c Modified to allow for more sequences |
1023 | c iseed can be between 0 and 31328*30081 |
1024 | c before patern repeats |
1025 | +c JA 11/2/2011: Check for ioffset, as in ntuple (ranmar.f) |
1026 | c |
1027 | + call get_offset(ioffset) |
1028 | + iseed = iseed * 31300 |
1029 | ij=1802 + mod(iseed,30081) |
1030 | - kl=9373 + (iseed/31328) |
1031 | + kl=9373 + (iseed/31328) + ioffset |
1032 | c write(*,'($a,i6,a3,i6)') 'Using random seed offsets',jconfig," : ",ioffset |
1033 | c write(*,*) ' with seed', iseed |
1034 | do while (ij .gt. 31328) |
1035 | @@ -193,9 +199,8 @@ |
1036 | $ i,nevents,gname,nhel_refine) |
1037 | else |
1038 | open(unit=25,file='../results.dat',status='old',err=199) |
1039 | + read(25,*) xtot |
1040 | write(*,'(a,e12.3)') 'Reading total xsection ',xtot |
1041 | - read(25,*) xtot |
1042 | - write(*,'(e12.3)') xtot |
1043 | 199 close(25) |
1044 | if (gridpack) then |
1045 | call write_gen_grid(err_goal,dble(ngran),i,nevents,gname, |
1046 | @@ -227,8 +232,8 @@ |
1047 | c |
1048 | c global |
1049 | c |
1050 | - integer max_np |
1051 | - common/max_np/max_np |
1052 | + integer max_np,min_iter |
1053 | + common/max_np/max_np,min_iter |
1054 | c |
1055 | c Arguments |
1056 | c |
1057 | @@ -320,7 +325,6 @@ |
1058 | c |
1059 | c Now write the commands |
1060 | c |
1061 | - write(26,20) 'echo $j' |
1062 | write(26,20) 'if [[ ! -e $j ]]; then' |
1063 | write(26,25) 'mkdir $j' |
1064 | write(26,20) 'fi' |
1065 | @@ -328,7 +332,7 @@ |
1066 | write(26,20) 'rm -f $k' |
1067 | c write(26,20) 'rm -f moffset.dat' |
1068 | |
1069 | - write(26,'(5x,a,2i8,a)') 'echo "',npoints,max_iter, |
1070 | + write(26,'(5x,a,3i8,a)') 'echo "',npoints,max_iter,min_iter, |
1071 | $ '" >& input_sg.txt' |
1072 | write(26,'(5x,a,f8.3,a)') 'echo "',max(elimit/ysec,0.001d0), |
1073 | $ '" >> input_sg.txt' |
1074 | @@ -338,7 +342,7 @@ |
1075 | & '" >> input_sg.txt' !Helicity |
1076 | write(26,'(5x,3a)')'echo "',gn(io(i))(2:ip-1), |
1077 | $ '" >>input_sg.txt' |
1078 | - write(26,20) 'time ../madevent >> $k <input_sg.txt' |
1079 | + write(26,20) '../madevent >> $k <input_sg.txt' |
1080 | write(26,20) 'mv ftn26 ftn25' |
1081 | c write(26,20) 'rm ftn26' |
1082 | write(26,20) 'cat $k >> log.txt' |
1083 | @@ -391,16 +395,16 @@ |
1084 | write(*,*) 'Opening file ',fname |
1085 | open (unit=26, file = fname, status='unknown') |
1086 | write(26,15) '#!/bin/bash' |
1087 | - write(26,15) '#PBS -q ' // PBS_QUE |
1088 | - write(26,15) '#PBS -o /dev/null' |
1089 | - write(26,15) '#PBS -e /dev/null' |
1090 | +c write(26,15) '#PBS -q ' // PBS_QUE |
1091 | +c write(26,15) '#PBS -o /dev/null' |
1092 | +c write(26,15) '#PBS -e /dev/null' |
1093 | write(26,15) 'if [[ "$PBS_O_WORKDIR" != "" ]]; then' |
1094 | write(26,15) ' cd $PBS_O_WORKDIR' |
1095 | write(26,15) 'fi' |
1096 | write(26,15) 'k=run1_app.log' |
1097 | write(lun,15) 'script=' // fname |
1098 | - write(lun,15) 'rm -f wait.$script >& /dev/null' |
1099 | - write(lun,15) 'touch run.$script' |
1100 | +c write(lun,15) 'rm -f wait.$script >& /dev/null' |
1101 | +c write(lun,15) 'touch run.$script' |
1102 | 15 format(a) |
1103 | end |
1104 | |
1105 | @@ -431,7 +435,6 @@ |
1106 | c |
1107 | c Now write the commands |
1108 | c |
1109 | -c write(lun,20) 'echo $i' |
1110 | c write(lun,20) 'j=G$i' |
1111 | c write(lun,20) 'if (! -e $j) then' |
1112 | c write(lun,25) 'mkdir $j' |
1113 | @@ -445,7 +448,7 @@ |
1114 | c write(lun,20) 'cp ../../public.sh .' |
1115 | c write(lun,20) 'qsub -N $1$i public.sh >> ../../running_jobs' |
1116 | c else |
1117 | -c write(lun,20) 'time ../madevent > $k <input_app.txt' |
1118 | +c write(lun,20) '../madevent > $k <input_app.txt' |
1119 | c write(lun,20) 'rm -f ftn25 ftn99' |
1120 | c write(lun,20) 'cp $k log.txt' |
1121 | c endif |
1122 | @@ -476,8 +479,8 @@ |
1123 | c |
1124 | c global |
1125 | c |
1126 | - integer max_np |
1127 | - common/max_np/max_np |
1128 | + integer max_np,min_iter |
1129 | + common/max_np/max_np,min_iter |
1130 | c integer max_np !now set in run_config.inc |
1131 | c parameter (max_np = 5) !number of channels/job |
1132 | |
1133 | @@ -632,7 +635,6 @@ |
1134 | c |
1135 | c Now write the commands |
1136 | c |
1137 | - write(26,20) 'echo $j' |
1138 | write(26,20) 'if [[ ! -e $j ]]; then' |
1139 | write(26,25) 'mkdir $j' |
1140 | write(26,20) 'fi' |
1141 | @@ -655,7 +657,7 @@ |
1142 | write(26,20) 'if [[ ! -e ftn25 ]]; then' |
1143 | |
1144 | |
1145 | - write(26,'(9x,a,2i8,a)') 'echo "',npoints,max_iter, |
1146 | + write(26,'(9x,a,3i8,a)') 'echo "',npoints,max_iter,min_iter, |
1147 | $ '" >& input_sg.txt' |
1148 | c |
1149 | c tjs 8/7/2007-JA 8/17/11 Allow stop when have enough luminocity |
1150 | @@ -669,7 +671,7 @@ |
1151 | & ' " >> input_sg.txt' !Helicity 0=exact |
1152 | write(26,'(9x,3a)')'echo "',gn(io(np))(2:ip-1), |
1153 | $ '" >>input_sg.txt' |
1154 | - write(26,25) 'time ../madevent >> $k <input_sg.txt' |
1155 | + write(26,25) '../madevent >> $k <input_sg.txt' |
1156 | write(26,25) 'cat $k >> log.txt' |
1157 | write(26,25) 'if [[ -e ftn26 ]]; then' |
1158 | write(26,25) ' cp ftn26 ftn25' |
1159 | @@ -678,7 +680,7 @@ |
1160 | |
1161 | write(26,25) 'rm -f $k' |
1162 | |
1163 | - write(26,'(9x,a,2i8,a)') 'echo "',npoints,max_iter, |
1164 | + write(26,'(9x,a,3i8,a)') 'echo "',npoints,max_iter,min_iter, |
1165 | $ '" >& input_sg.txt' |
1166 | c |
1167 | c tjs 8/7/2007-JA 8/17/11 Change to request luminocity not accuracy |
1168 | @@ -706,7 +708,7 @@ |
1169 | write(26,25) 'if [[ -e ftn26 ]]; then' |
1170 | write(26,25) ' cp ftn26 ftn25' |
1171 | write(26,25) 'fi' |
1172 | - write(26,25) 'time ../madevent >> $k <input_sg.txt' |
1173 | + write(26,25) '../madevent >> $k <input_sg.txt' |
1174 | write(26,25) 'cat $k >> log.txt' |
1175 | write(26,20) 'fi' |
1176 | write(26,20) 'cd ../' |
1177 | @@ -741,8 +743,8 @@ |
1178 | c |
1179 | c global |
1180 | c |
1181 | - integer max_np |
1182 | - common/max_np/max_np |
1183 | + integer max_np,min_iter |
1184 | + common/max_np/max_np,min_iter |
1185 | c |
1186 | c Arguments |
1187 | c |
1188 | @@ -788,7 +790,7 @@ |
1189 | write(27,*) xtot*ngran/xsec(i)/goal_lum |
1190 | endif |
1191 | npoints = goal_lum * xsec(i) / xtot |
1192 | - if (npoints .lt. min_gevents_wu) npoints = min_gevents_wu |
1193 | + if (npoints .lt. ngran) npoints = ngran |
1194 | np = np+1 |
1195 | if (np .gt. max_np) then |
1196 | if (fopened) then |
1197 | @@ -799,15 +801,14 @@ |
1198 | np = 1 |
1199 | endif |
1200 | ip = index(gn(i),'/') |
1201 | - write(*,*) 'Channel ',gn(i)(2:ip-1), |
1202 | - $ yerr, jpoints(i),npoints |
1203 | + write(*,*) 'Channel ',gn(i)(2:ip-1), goal_lum * xsec(i) / xtot, |
1204 | + $ npoints |
1205 | |
1206 | ip = index(gn(i),'/') |
1207 | write(26,'(2a)') 'j=',gn(i)(1:ip-1) |
1208 | c |
1209 | c Now write the commands |
1210 | c |
1211 | - write(26,20) 'echo $j' |
1212 | write(26,20) 'if [[ ! -e $j ]]; then' |
1213 | write(26,25) 'mkdir $j' |
1214 | write(26,20) 'fi' |
1215 | @@ -824,21 +825,21 @@ |
1216 | write(26,20) 'if [[ ! -e ftn25 ]]; then' |
1217 | |
1218 | |
1219 | - write(26,'(9x,a,2i8,a)') 'echo "',npoints,max_iter, |
1220 | - $ '" >& input_sg.txt' |
1221 | + write(26,'(9x,a,3i8,a)') 'echo "',max(npoints,min_events), |
1222 | + $ max_iter,min_iter,'" >& input_sg.txt' |
1223 | c |
1224 | c tjs 8/7/2007 Allow stop when have enough events |
1225 | c |
1226 | write(*,*) "Cross section",i,xsec(i),mfact(i) |
1227 | - write(26,'(9x,a,f11.3,a)') 'echo "',-npoints*1.2, |
1228 | - $ '" >> input_sg.txt' !Accuracy |
1229 | + write(26,'(9x,a,e13.5,a)') 'echo "',-npoints/xsec(i), |
1230 | + $ '" >> input_sg.txt' !Luminocity |
1231 | write(26,'(9x,a)') 'echo "2" >> input_sg.txt' !Grid Adjustment |
1232 | write(26,'(9x,a)') 'echo "1" >> input_sg.txt' !Suppression |
1233 | write(26,'(9x,a,i4,a)') 'echo "',nhel_refine, |
1234 | & ' " >> input_sg.txt' !Helicity 0=exact |
1235 | write(26,'(9x,3a)')'echo "',gn(i)(2:ip-1), |
1236 | $ '" >>input_sg.txt' |
1237 | - write(26,25) 'time ../madevent >> $k <input_sg.txt' |
1238 | + write(26,25) '../madevent >> $k <input_sg.txt' |
1239 | write(26,25) 'cat $k >> log.txt' |
1240 | write(26,25) 'if [[ -e ftn26 ]]; then' |
1241 | write(26,25) ' cp ftn26 ftn25' |
1242 | @@ -847,13 +848,13 @@ |
1243 | |
1244 | write(26,25) 'rm -f $k' |
1245 | |
1246 | - write(26,'(9x,a,2i8,a)') 'echo "',npoints,max_iter, |
1247 | - $ '" >& input_sg.txt' |
1248 | + write(26,'(9x,a,3i8,a)') 'echo "',max(npoints,min_events), |
1249 | + $ max_iter,min_iter,'" >& input_sg.txt' |
1250 | c |
1251 | c tjs 8/7/2007 Change to request events not accuracy |
1252 | c |
1253 | - write(26,'(9x,a,f11.3,a)') 'echo "',-npoints*1.2, |
1254 | - $ '" >> input_sg.txt' !Accuracy |
1255 | + write(26,'(9x,a,e13.5,a)') 'echo "',-npoints / xsec(i), |
1256 | + $ '" >> input_sg.txt' ! Luminocity |
1257 | write(26,'(9x,a)') 'echo "0" >> input_sg.txt' |
1258 | write(26,'(9x,a)') 'echo "1" >> input_sg.txt' |
1259 | |
1260 | @@ -866,7 +867,7 @@ |
1261 | write(26,25) 'if [[ -e ftn26 ]]; then' |
1262 | write(26,25) ' cp ftn26 ftn25' |
1263 | write(26,25) 'fi' |
1264 | - write(26,25) 'time ../madevent >> $k <input_sg.txt' |
1265 | + write(26,25) '../madevent >> $k <input_sg.txt' |
1266 | write(26,25) 'cat $k >> log.txt' |
1267 | write(26,20) 'fi' |
1268 | write(26,20) 'cd ../' |
1269 | |
1270 | === modified file 'Template/Source/make_opts' |
1271 | --- Template/Source/make_opts 2011-07-12 03:57:50 +0000 |
1272 | +++ Template/Source/make_opts 2012-02-04 00:00:25 +0000 |
1273 | @@ -8,7 +8,7 @@ |
1274 | |
1275 | # Set FC unless it's defined by an environment variable |
1276 | ifeq ($(origin FC),default) |
1277 | - FC=g77 |
1278 | + FC=gfortran |
1279 | endif |
1280 | |
1281 | # Options: dynamic, lhapdf |
1282 | |
1283 | === removed file 'Template/Source/scale_events.f' |
1284 | --- Template/Source/scale_events.f 2010-10-30 03:26:37 +0000 |
1285 | +++ Template/Source/scale_events.f 1970-01-01 00:00:00 +0000 |
1286 | @@ -1,150 +0,0 @@ |
1287 | - program scale_events |
1288 | -c******************************************************************** |
1289 | -c Takes events from events.dat and scales them according to |
1290 | -c the correct cross section for each diagram |
1291 | -c******************************************************************** |
1292 | - implicit none |
1293 | -c |
1294 | -c Constants |
1295 | -c |
1296 | - character*(*) symfile |
1297 | - parameter (symfile='symfact.dat') |
1298 | - character*(*) scaled_file |
1299 | - parameter (scaled_file='scaled.dat') |
1300 | -c |
1301 | -c local |
1302 | -c |
1303 | - character*30 dirname |
1304 | - double precision xi |
1305 | - integer j,k,ip |
1306 | -c----- |
1307 | -c Begin Code |
1308 | -c----- |
1309 | - open(unit=16,file=scaled_file,status='unknown',err=999) |
1310 | - open(unit=35,file=symfile,status='old',err=59) |
1311 | - do while (.true.) |
1312 | - read(35,*,err=99,end=99) xi,j |
1313 | - if (j .gt. 0) then |
1314 | - if ( (xi-int(xi+.01)) .lt. 1d-5) then |
1315 | - k = int(xi+.01) |
1316 | - if (k .lt. 10) then |
1317 | - write(dirname,'(a,i1,a)') 'G',k,'/' |
1318 | - else if (k .lt. 100) then |
1319 | - write(dirname,'(a,i2,a)') 'G',k,'/' |
1320 | - else if (k .lt. 1000) then |
1321 | - write(dirname,'(a,i3,a)') 'G',k,'/' |
1322 | - else if (k .lt. 10000) then |
1323 | - write(dirname,'(a,i4,a)') 'G',k,'/' |
1324 | - endif |
1325 | - else !Handle B.W. |
1326 | - if (xi .lt. 10) then |
1327 | - write(dirname,'(a,f5.3,a,a)') 'G',xi,'/' |
1328 | - else if (xi .lt. 100) then |
1329 | - write(dirname,'(a,f6.3,a,a)') 'G',xi,'/' |
1330 | - else if (xi .lt. 1000) then |
1331 | - write(dirname,'(a,f7.3,a,a)') 'G',xi,'/' |
1332 | - else if (xi .lt. 10000) then |
1333 | - write(dirname,'(a,3f8.3,a,a)') 'G',xi,'/' |
1334 | - endif |
1335 | - endif |
1336 | - ip = index(dirname,'/') |
1337 | - write(*,*) 'Scaling ',dirname(1:ip) |
1338 | - call scale_dir(dirname,j,ip) |
1339 | - endif |
1340 | - enddo |
1341 | - 99 close(35) |
1342 | - close(16) |
1343 | - stop |
1344 | -c |
1345 | -c Come here if there isn't a symfact file. Means we will work on |
1346 | -c this file alone |
1347 | -c |
1348 | - 59 dirname="./" |
1349 | - j = 1 |
1350 | - ip = 2 |
1351 | - write(*,*) 'Scaling ',dirname(1:ip) |
1352 | - call scale_dir(dirname,j,ip) |
1353 | - close(16) |
1354 | - stop |
1355 | - 999 write(*,*) 'Error opening file ',scaled_file |
1356 | - close(16) |
1357 | - end |
1358 | - |
1359 | - subroutine scale_dir(dirname,mfact, ip) |
1360 | -c******************************************************************** |
1361 | -c Takes events from events.dat and scales them according to |
1362 | -c the correct cross section. |
1363 | -c******************************************************************** |
1364 | - implicit none |
1365 | -c |
1366 | -c parameters |
1367 | -c |
1368 | - include 'nexternal.inc' |
1369 | - character*(*) event_file, xsec_file |
1370 | - parameter (event_file='events.lhe', xsec_file='results.dat') |
1371 | - integer maxexternal |
1372 | - parameter (maxexternal=15) |
1373 | - |
1374 | -c |
1375 | -c Arguments |
1376 | -c |
1377 | - integer mfact, ip |
1378 | - character*(30) dirname |
1379 | -c |
1380 | -c Local |
1381 | -c |
1382 | - double precision xsec, sum, wgt, mxwgt |
1383 | - double precision x1,x2,p(0:4,nexternal) |
1384 | - integer i,j,k, kevent,m, ic(7,maxexternal),n |
1385 | - double precision scale,aqed,aqcd |
1386 | - integer ievent |
1387 | - character*79 buff |
1388 | - logical done |
1389 | -c----- |
1390 | -c Begin Code |
1391 | -c----- |
1392 | - open(unit=15,file=dirname(1:ip) // xsec_file,status='old',err=998) |
1393 | - read(15,*) xsec |
1394 | - xsec = xsec * mfact |
1395 | - close(15) |
1396 | - sum=0d0 |
1397 | - mxwgt=-1d0 |
1398 | - kevent = 0 |
1399 | - open(unit=15,file=dirname(1:ip)//event_file,status='old',err=999) |
1400 | - done = .false. |
1401 | - do while (.not. done) |
1402 | - call read_event(15,p,wgt,n,ic,ievent,scale,aqcd,aqed,done) |
1403 | - if (.not. done) then |
1404 | - sum=sum+wgt |
1405 | - mxwgt = max(wgt,mxwgt) |
1406 | - kevent = kevent+1 |
1407 | - endif |
1408 | - enddo |
1409 | - 99 close(15) |
1410 | - write(*,*) 'Found ',kevent,' events' |
1411 | - write(*,*) 'total weight',sum |
1412 | - write(*,*) 'Integrated weight',xsec |
1413 | -c stop |
1414 | -c |
1415 | -c Now write out scaled events |
1416 | -c |
1417 | - call write_comments(16) |
1418 | - open(unit=15,file=dirname(1:ip) //event_file,status='old',err=999) |
1419 | - done=.false. |
1420 | - m = 0 |
1421 | - do while (.not. done) |
1422 | - m=m+1 |
1423 | - call read_event(15,p,wgt,n,ic,ievent,scale,aqcd,aqed,done) |
1424 | -c call read_event(15,p,wgt,n,ic,done) |
1425 | - if (.not. done) then |
1426 | - call write_event(16,p,wgt*xsec/sum,n,ic,m,scale,aqcd,aqed) |
1427 | - endif |
1428 | - enddo |
1429 | - 900 close(15) |
1430 | - return |
1431 | - 55 format(i3,4e19.12) |
1432 | - 998 write(*,*) 'Error opening file ',dirname(1:ip) // xsec_file |
1433 | - return |
1434 | - 999 write(*,*) 'Error opening file ',dirname(1:ip) //event_file |
1435 | - return |
1436 | - end |
1437 | |
1438 | === removed file 'Template/Source/select_events.f' |
1439 | --- Template/Source/select_events.f 2010-10-30 03:26:37 +0000 |
1440 | +++ Template/Source/select_events.f 1970-01-01 00:00:00 +0000 |
1441 | @@ -1,300 +0,0 @@ |
1442 | - program pick_events |
1443 | -c******************************************************************** |
1444 | -c Takes events from scaled.dat and plots distributions |
1445 | -c******************************************************************** |
1446 | - implicit none |
1447 | - integer nevents |
1448 | - double precision mxwgt,mxwgt1, wgt_goal, eff,xsec |
1449 | - integer gevents |
1450 | -c----- |
1451 | -c Begin Code |
1452 | -c----- |
1453 | - call read_all_events(nevents,mxwgt,mxwgt1,eff,xsec) |
1454 | - write(*,*) 'Number of events',nevents,mxwgt,mxwgt1 |
1455 | - write(*,'($a,i7,a)') 'Enter number of events desired ( <', |
1456 | - & int(nevents*eff),') ' |
1457 | - read(*,*) gevents |
1458 | - wgt_goal = mxwgt1*Max((nevents*eff)/gevents,1d0) |
1459 | -c wgt_goal = mxwgt1 |
1460 | - call write_events(wgt_goal,xsec,gevents) |
1461 | - end |
1462 | - |
1463 | - subroutine write_events(wgt_goal,xsec,gevents) |
1464 | -c******************************************************************** |
1465 | -c |
1466 | -c******************************************************************** |
1467 | - implicit none |
1468 | -c |
1469 | -c parameters |
1470 | -c |
1471 | - character*(*) scaled_file |
1472 | - parameter (scaled_file='events.lhe') |
1473 | - character*(*) unwgt_file |
1474 | - parameter (unwgt_file='unweighted_events.lhe') |
1475 | - integer max_write |
1476 | - parameter (max_write=100000) |
1477 | - integer maxexternal |
1478 | - parameter (maxexternal=15) |
1479 | -c |
1480 | -c Arguments |
1481 | -c |
1482 | - double precision wgt_goal,xsec |
1483 | - integer gevents |
1484 | -c |
1485 | -c Local |
1486 | -c |
1487 | - double precision sum, wgt, s_over |
1488 | - double precision p(0:4,maxexternal),r |
1489 | - integer i,j,k,m, kevent, ic(7,maxexternal) |
1490 | - integer iseed, n_over, n |
1491 | - integer i4,r8,record_length,irc,ng,iol |
1492 | - real xran1 |
1493 | - character*79 buff |
1494 | - logical lwrite |
1495 | - logical*1 l_store(max_write) |
1496 | - logical done |
1497 | - double precision scale, aqcd, aqed |
1498 | - integer ievent |
1499 | - |
1500 | - external xran1 |
1501 | -c----- |
1502 | -c Begin Code |
1503 | -c----- |
1504 | - sum=0d0 |
1505 | - s_over = 0d0 |
1506 | - n_over = 0 |
1507 | - iseed = 0 |
1508 | -c mxwgt=-1d0 |
1509 | - kevent = 0 |
1510 | - rewind(37) !This is comment block |
1511 | - open(unit=15,file=scaled_file, status='old',err=999) |
1512 | - I4 = 4 |
1513 | - R8 = 8 |
1514 | - record_length = 3*I4+maxexternal*I4*7+maxexternal*4*R8+3*R8 |
1515 | - open(unit=16,access='direct',status='scratch',err=999, |
1516 | - & recl=record_length) |
1517 | - done=.false. |
1518 | - do while (.not. done) |
1519 | -c write(*,*) 'Reading Event' |
1520 | - call read_event(15,P,wgt,n,ic,ievent,scale,aqcd,aqed,done) |
1521 | -c write(*,*) 'read event',n,wgt,wgt_goal |
1522 | - if (.not. done) then |
1523 | - r = xran1(iseed) |
1524 | - lwrite = (wgt / r .gt. wgt_goal) |
1525 | -c write(*,*) 'lwrite',lwrite,r |
1526 | - if (lwrite) then |
1527 | - sum=sum+wgt_goal |
1528 | - kevent = kevent+1 |
1529 | - l_store(kevent)=.false. |
1530 | -c write(*,*) 'writing event',kevent |
1531 | - write(16,rec=kevent) wgt_goal,n, |
1532 | - & ((ic(i,j),j=1,maxexternal),i=1,7), |
1533 | - & ((p(i,j),i=0,3),j=1,maxexternal),scale,aqcd,aqed |
1534 | - if (wgt .gt. wgt_goal) then |
1535 | - s_over = s_over-wgt_goal+wgt |
1536 | - n_over = n_over + 1 |
1537 | - endif |
1538 | - endif |
1539 | - endif |
1540 | - enddo |
1541 | - 99 close(15) |
1542 | -c rewind(16) |
1543 | -c write(*,*) 'Done',kevent |
1544 | - open(unit=26,file=unwgt_file, status='unknown',err=999) |
1545 | - call write_comments(26) |
1546 | - write(26,'(a2,75a1)') '##',('*', i=1,68) |
1547 | - write(26,'(a)') '##' |
1548 | - write(26,'(a)') '##-----------------------' |
1549 | - write(26,'(a)') '## Unweighting Statistics' |
1550 | - write(26,'(a)') '##-----------------------' |
1551 | - write(26,'(a)') '##' |
1552 | - write(26,'(a,i7)') '## Number of Events Written :' , kevent |
1553 | - write(26,'(a,i7)') '## Number of Events Truncated :' , n_over |
1554 | - write(26,'(a,f7.2,a)') '## Truncated Cross Section :' , |
1555 | - $ s_over*100./(xsec),"%" |
1556 | - |
1557 | - write(26,'(a2,75a1)') '##',('*', i=1,68) |
1558 | - |
1559 | - k=0 |
1560 | - do while(k .lt. kevent) |
1561 | - r = xran1(iseed) |
1562 | - ng=0 |
1563 | - i=0 |
1564 | -c write(*,*) r,kevent,k |
1565 | - do while (r .gt. real(ng)/(kevent-k) .and. i .lt. kevent) |
1566 | -c write(*,*) r,kevent,k |
1567 | - i=i+1 |
1568 | - if (.not. l_store(i)) ng=ng+1 |
1569 | - enddo |
1570 | - k=k+1 |
1571 | - l_store(i)=.true. |
1572 | -c write(*,*) 'Writing event ',k,i |
1573 | - read(16,rec=i) wgt_goal,n, |
1574 | - & ((ic(i,j),j=1,maxexternal),i=1,7), |
1575 | - & ((p(i,j),i=0,3),j=1,maxexternal),scale,aqcd,aqed |
1576 | - |
1577 | - wgt_goal = wgt_goal*xsec/sum |
1578 | - call write_event(26,p,wgt_goal,n,ic,k,scale,aqcd,aqed) |
1579 | - enddo |
1580 | - 92 close(16,status='delete') |
1581 | - close(26) |
1582 | - 55 format(i3,4e19.11) |
1583 | - write(*,*) 'Wrote ',kevent,' events' |
1584 | - write(*,*) 'Integrated weight',xsec |
1585 | - write(*,*) 'Truncated events ',n_over, |
1586 | - & s_over, s_over/xsec*100,'%' |
1587 | - return |
1588 | - 999 write(*,*) 'Error opening file ',scaled_file |
1589 | - end |
1590 | - |
1591 | - subroutine read_all_events(kevent, mxwgt,mxwgt1, eff, xsec) |
1592 | -c******************************************************************** |
1593 | -c******************************************************************** |
1594 | - implicit none |
1595 | -c |
1596 | -c parameters |
1597 | -c |
1598 | - character*(*) scaled_file |
1599 | - parameter (scaled_file='events.lhe') |
1600 | - integer maxexternal |
1601 | - parameter (maxexternal=15) |
1602 | - include 'run_config.inc' |
1603 | - integer max_read |
1604 | - parameter (max_read = 2000000) |
1605 | -c |
1606 | -c Arguments |
1607 | -c |
1608 | - integer kevent |
1609 | - double precision mxwgt,mxwgt1,eff,xsec |
1610 | -c |
1611 | -c Local |
1612 | -c |
1613 | - double precision sum, wgt |
1614 | - double precision p(0:3,maxexternal) |
1615 | - real xwgt(max_read),xtot |
1616 | - integer i,j,k,m, ic(7,maxexternal),n |
1617 | - double precision scale,aqcd,aqed |
1618 | - integer ievent |
1619 | - logical done |
1620 | - character*79 buff |
1621 | -c----- |
1622 | -c Begin Code |
1623 | -c----- |
1624 | - sum=0d0 |
1625 | - mxwgt=-1d0 |
1626 | - kevent = 0 |
1627 | - open(unit=15,file=scaled_file, status='old',err=999) |
1628 | - done=.false. |
1629 | - do while (.not. done) |
1630 | - call read_event(15,P,wgt,n,ic,ievent,scale,aqcd,aqed,done) |
1631 | -c call read_event(15,p,wgt,n,ic,done) |
1632 | - if (.not. done) then |
1633 | - sum=sum+wgt |
1634 | - kevent = kevent+1 |
1635 | - xwgt(kevent) = wgt |
1636 | - mxwgt = max(wgt,mxwgt) |
1637 | - endif |
1638 | - if (kevent .ge. max_read) then |
1639 | - write(*,*) 'Error too many events to read in select_events' |
1640 | - $ , kevent |
1641 | - write(*,*) 'Reset max_read in Source/select_events.f' |
1642 | - stop |
1643 | - endif |
1644 | - enddo |
1645 | - 99 close(15) |
1646 | - 55 format(i3,4e19.11) |
1647 | - write(*,*) 'Sorting',kevent |
1648 | - call sort(kevent,xwgt) |
1649 | - xtot = 0d0 |
1650 | - i = kevent |
1651 | - do while (xtot-xwgt(i)*(kevent-i) .lt. sum*trunc_max |
1652 | - $ .and. i .gt. 2) !Find out minimum target |
1653 | - xtot = xtot + xwgt(i) |
1654 | - i=i-1 |
1655 | - enddo |
1656 | - eff = sum/kevent/xwgt(i) |
1657 | - write(*,*) 'Found ',kevent,' events' |
1658 | - write(*,*) 'Integrated weight',sum |
1659 | - write(*,*) 'Maximum wgt',mxwgt, xwgt(i) |
1660 | - write(*,*) 'Average wgt', sum/kevent |
1661 | - write(*,*) 'Unweight Efficiency', eff |
1662 | - mxwgt1=xwgt(i) |
1663 | - xsec = sum |
1664 | - return |
1665 | - 999 write(*,*) 'Error opening file ',scaled_file |
1666 | - |
1667 | - end |
1668 | - |
1669 | - |
1670 | - |
1671 | - subroutine sort(n,ra) |
1672 | - real ra(n) |
1673 | - l=n/2+1 |
1674 | - ir=n |
1675 | -10 continue |
1676 | - if(l.gt.1)then |
1677 | - l=l-1 |
1678 | - rra=ra(l) |
1679 | - else |
1680 | - rra=ra(ir) |
1681 | - ra(ir)=ra(1) |
1682 | - ir=ir-1 |
1683 | - if(ir.eq.1)then |
1684 | - ra(1)=rra |
1685 | - return |
1686 | - endif |
1687 | - endif |
1688 | - i=l |
1689 | - j=l+l |
1690 | -20 if(j.le.ir)then |
1691 | - if(j.lt.ir)then |
1692 | - if(ra(j).lt.ra(j+1))j=j+1 |
1693 | - endif |
1694 | - if(rra.lt.ra(j))then |
1695 | - ra(i)=ra(j) |
1696 | - i=j |
1697 | - j=j+j |
1698 | - else |
1699 | - j=ir+1 |
1700 | - endif |
1701 | - go to 20 |
1702 | - endif |
1703 | - ra(i)=rra |
1704 | - go to 10 |
1705 | - end |
1706 | - |
1707 | - function xran1(idum) |
1708 | - dimension r(97) |
1709 | - parameter (m1=259200,ia1=7141,ic1=54773,rm1=3.8580247e-6) |
1710 | - parameter (m2=134456,ia2=8121,ic2=28411,rm2=7.4373773e-6) |
1711 | - parameter (m3=243000,ia3=4561,ic3=51349) |
1712 | - data iff /0/ |
1713 | - save r, ix1,ix2,ix3 |
1714 | - if (idum.lt.0.or.iff.eq.0) then |
1715 | - iff=1 |
1716 | - ix1=mod(ic1-idum,m1) |
1717 | - ix1=mod(ia1*ix1+ic1,m1) |
1718 | - ix2=mod(ix1,m2) |
1719 | - ix1=mod(ia1*ix1+ic1,m1) |
1720 | - ix3=mod(ix1,m3) |
1721 | - do 11 j=1,97 |
1722 | - ix1=mod(ia1*ix1+ic1,m1) |
1723 | - ix2=mod(ia2*ix2+ic2,m2) |
1724 | - r(j)=(float(ix1)+float(ix2)*rm2)*rm1 |
1725 | -11 continue |
1726 | - idum=1 |
1727 | - endif |
1728 | - ix1=mod(ia1*ix1+ic1,m1) |
1729 | - ix2=mod(ia2*ix2+ic2,m2) |
1730 | - ix3=mod(ia3*ix3+ic3,m3) |
1731 | - j=1+(97*ix3)/m3 |
1732 | - if(j.gt.97.or.j.lt.1)then |
1733 | - write(*,*) 'j is bad in ran1.f',j, 97d0*ix3/m3 |
1734 | - pause |
1735 | - endif |
1736 | - xran1=r(j) |
1737 | - r(j)=(float(ix1)+float(ix2)*rm2)*rm1 |
1738 | - return |
1739 | - end |
1740 | - |
1741 | - |
1742 | |
1743 | === modified file 'Template/Source/setrun.f' |
1744 | --- Template/Source/setrun.f 2011-08-24 23:32:31 +0000 |
1745 | +++ Template/Source/setrun.f 2012-02-04 00:00:25 +0000 |
1746 | @@ -20,6 +20,11 @@ |
1747 | double precision D |
1748 | common/to_dj/D |
1749 | c |
1750 | +c PARAM_CARD |
1751 | +c |
1752 | + character*30 param_card_name |
1753 | + common/to_param_card_name/param_card_name |
1754 | +c |
1755 | c local |
1756 | c |
1757 | integer npara |
1758 | @@ -372,13 +377,13 @@ |
1759 | |
1760 | if(lp1.ne.0.or.lp2.ne.0) then |
1761 | write(*,*) 'A PDF is used, so alpha_s(MZ) is going to be modified' |
1762 | - call setpara('param_card.dat',.true.) |
1763 | + call setpara(param_card_name) |
1764 | asmz=G**2/(16d0*atan(1d0)) |
1765 | write(*,*) 'Old value of alpha_s from param_card: ',asmz |
1766 | call pdfwrap |
1767 | write(*,*) 'New value of alpha_s from PDF ',pdlabel,':',asmz |
1768 | else |
1769 | - call setpara('param_card.dat',.true.) |
1770 | + call setpara(param_card_name) |
1771 | asmz=G**2/(16d0*atan(1d0)) |
1772 | nloop=2 |
1773 | pdlabel='none' |
1774 | |
1775 | === modified file 'Template/SubProcesses/addmothers.f' |
1776 | --- Template/SubProcesses/addmothers.f 2011-09-30 04:08:40 +0000 |
1777 | +++ Template/SubProcesses/addmothers.f 2012-02-04 00:00:25 +0000 |
1778 | @@ -19,18 +19,23 @@ |
1779 | integer isym(nexternal,99), jsym |
1780 | integer i,j,k,ida(2),ns,nres,ires,icl,ito2,idenpart,nc,ic |
1781 | integer mo_color,da_color(2),itmp |
1782 | - integer ito(-nexternal+3:nexternal),iseed,maxcolor |
1783 | - integer icolalt(2,-nexternal+3:2*nexternal-3) |
1784 | + integer ito(-nexternal+3:nexternal),iseed,maxcolor,maxorg |
1785 | + integer icolalt(2,-nexternal+2:2*nexternal-3) |
1786 | double precision qicl(-nexternal+3:2*nexternal-3), factpm |
1787 | double precision xtarget |
1788 | data iseed/0/ |
1789 | |
1790 | +c Variables for combination of color indices (including multipart. vert) |
1791 | + integer maxcolmp |
1792 | + parameter(maxcolmp=20) |
1793 | + integer ncolmp,icolmp(2,maxcolmp) |
1794 | + |
1795 | double precision ZERO |
1796 | parameter (ZERO=0d0) |
1797 | double precision pmass(-nexternal:0,lmaxconfigs) |
1798 | double precision pwidth(-nexternal:0,lmaxconfigs) |
1799 | integer pow(-nexternal:0,lmaxconfigs) |
1800 | - logical first_time |
1801 | + logical first_time,tchannel |
1802 | save pmass,pwidth,pow |
1803 | data first_time /.true./ |
1804 | |
1805 | @@ -67,9 +72,9 @@ |
1806 | c common/to_colstats/ncols,ncolflow,ncolalt,icorg |
1807 | |
1808 | double precision pt |
1809 | - integer get_color |
1810 | + integer get_color,elim_indices,set_colmp,fix_tchannel_color |
1811 | real ran1 |
1812 | - external pt,ran1,get_color |
1813 | + external pt,ran1,get_color,elim_indices,set_colmp,fix_tchannel_color |
1814 | |
1815 | if (first_time) then |
1816 | include 'props.inc' |
1817 | @@ -137,6 +142,9 @@ |
1818 | |
1819 | endif ! nc.gt.0 |
1820 | |
1821 | +c Store original maxcolor to know if we have epsilon vertices |
1822 | + maxorg=maxcolor |
1823 | + |
1824 | c |
1825 | c Get mother information from chosen graph |
1826 | c |
1827 | @@ -144,22 +152,70 @@ |
1828 | c First check number of resonant s-channel propagators |
1829 | ns=0 |
1830 | nres=0 |
1831 | - |
1832 | + tchannel=.false. |
1833 | c Loop over propagators to find mother-daughter information |
1834 | - do i=-1,-nexternal+3,-1 |
1835 | + do i=-1,-nexternal+2,-1 |
1836 | c Daughters |
1837 | - ida(1)=iforest(1,i,iconfig) |
1838 | - ida(2)=iforest(2,i,iconfig) |
1839 | - do j=1,2 |
1840 | - if(ida(j).gt.0) ida(j)=isym(ida(j),jsym) |
1841 | - enddo |
1842 | + if(i.gt.-nexternal+2)then |
1843 | + ida(1)=iforest(1,i,iconfig) |
1844 | + ida(2)=iforest(2,i,iconfig) |
1845 | + do j=1,2 |
1846 | + if(ida(j).gt.0) ida(j)=isym(ida(j),jsym) |
1847 | + enddo |
1848 | + endif |
1849 | c Decide s- or t-channel |
1850 | - if(iabs(sprop(numproc,i,iconfig)).gt.0) then ! s-channel propagator |
1851 | + if(i.gt.-nexternal+2.and. |
1852 | + $ iabs(sprop(numproc,i,iconfig)).gt.0) then ! s-channel propagator |
1853 | jpart(1,i)=sprop(numproc,i,iconfig) |
1854 | ns=ns+1 |
1855 | + else if(nres.gt.0.and.maxcolor.gt.maxorg) then |
1856 | +c For t-channel propagators, just check that the colors are ok |
1857 | + if(i.eq.-nexternal+2) then |
1858 | +c This is the final t-channel, combining with leg 2 |
1859 | + mo_color=0 |
1860 | + if(.not.tchannel)then |
1861 | +c There are no previous t-channels, so this is a combination of |
1862 | +c 2, 1 and the last s-channel |
1863 | + ida(1)=1 |
1864 | + ida(2)=i+1 |
1865 | + else |
1866 | +c The daughter info is in iforest |
1867 | + ida(1)=iforest(1,i,iconfig) |
1868 | + ida(2)=iforest(2,i,iconfig) |
1869 | + endif |
1870 | +c Reverse colors of t-channels to get right color ordering |
1871 | + ncolmp=0 |
1872 | + ncolmp=set_colmp(ncolmp,icolmp,2,jpart, |
1873 | + $ iforest(1,-max_branch,iconfig),icolalt, |
1874 | + $ icolalt(2,2),icolalt(1,2)) |
1875 | + else |
1876 | + jpart(1,i)=tprid(i,iconfig) |
1877 | + mo_color=get_color(jpart(1,i)) |
1878 | + ncolmp=0 |
1879 | + endif |
1880 | + if(mo_color.gt.1.and. |
1881 | + $ mo_color.ne.3.and.mo_color.ne.8)then |
1882 | + da_color(1)=get_color(jpart(1,ida(1))) |
1883 | + da_color(2)=get_color(jpart(1,ida(2))) |
1884 | + call write_error(da_color(1), da_color(2), mo_color) |
1885 | + endif |
1886 | +c Set icolmp for daughters |
1887 | + ncolmp=set_colmp(ncolmp,icolmp,ida(2),jpart, |
1888 | + $ iforest(1,-max_branch,iconfig),icolalt, |
1889 | + $ icolalt(1,ida(2)),icolalt(2,ida(2))) |
1890 | +c Reverse colors of t-channels to get right color ordering |
1891 | + ncolmp=set_colmp(ncolmp,icolmp,ida(1),jpart, |
1892 | + $ iforest(1,-max_branch,iconfig),icolalt, |
1893 | + $ icolalt(2,ida(1)),icolalt(1,ida(1))) |
1894 | +c Fix t-channel color |
1895 | +c print *,'t-channel: ',i,ida(1),ida(2),mo_color |
1896 | +c print *,'colors: ',((icolmp(j,k),j=1,2),k=1,ncolmp) |
1897 | + maxcolor=fix_tchannel_color(mo_color,maxcolor, |
1898 | + $ ncolmp,icolmp,i,icolalt) |
1899 | + tchannel=.true. |
1900 | + cycle |
1901 | else |
1902 | -c Don't care about t-channel propagators |
1903 | - goto 100 |
1904 | + goto 100 |
1905 | endif |
1906 | c Set status codes for propagator |
1907 | c if((igscl(0).ne.0.and. |
1908 | @@ -186,140 +242,43 @@ |
1909 | c endif |
1910 | c Set color info for all s-channels |
1911 | mo_color = get_color(jpart(1,i)) |
1912 | - da_color(1) = get_color(jpart(1,ida(1))) |
1913 | - da_color(2) = get_color(jpart(1,ida(2))) |
1914 | - if(da_color(2).lt.da_color(1))then |
1915 | -c Order daughters according to color |
1916 | - itmp=ida(1) |
1917 | - ida(1)=ida(2) |
1918 | - ida(2)=itmp |
1919 | - itmp=da_color(1) |
1920 | - da_color(1)=da_color(2) |
1921 | - da_color(2)=itmp |
1922 | - endif |
1923 | -c print *,'graph: ',iconfig |
1924 | -c print *,'Resonance: ',i,' daughters ',ida(1),ida(2), |
1925 | -c $ ' ids ',jpart(1,i),jpart(1,ida(1)),jpart(1,ida(2)), |
1926 | -c $ ' colors ',mo_color,da_color(1),da_color(2) |
1927 | - |
1928 | +c If inside multipart. vertex (indicated by color 2) cycle |
1929 | +c Set tentative mothers |
1930 | + jpart(2,i) = 1 |
1931 | + jpart(3,i) = 2 |
1932 | +c Set mother info for daughters |
1933 | + do j=1,2 |
1934 | + jpart(2,ida(j)) = i |
1935 | + jpart(3,ida(j)) = i |
1936 | + enddo |
1937 | + if(mo_color.eq.2) cycle |
1938 | +c Reset list of color indices |
1939 | + ncolmp=0 |
1940 | +c Add new color indices to list of color indices |
1941 | + do j=1,2 |
1942 | + ncolmp=set_colmp(ncolmp,icolmp,ida(j),jpart, |
1943 | + $ iforest(1,-max_branch,iconfig),icolalt, |
1944 | + $ icolalt(1,ida(j)),icolalt(2,ida(j))) |
1945 | + enddo |
1946 | +c print *,'s-channel: ',i,mo_color,ida(1),ida(2) |
1947 | +c print *,'colors: ',((icolmp(j,k),j=1,2),k=1,ncolmp) |
1948 | if(mo_color.eq.1) then ! color singlet |
1949 | - icolalt(1,i) = 0 |
1950 | - icolalt(2,i) = 0 |
1951 | + maxcolor=elim_indices(0,0,ncolmp,icolmp,i,icolalt,maxcolor) |
1952 | elseif(mo_color.eq.-3) then ! color anti-triplet |
1953 | - icolalt(1,i) = 0 |
1954 | - if(da_color(1).eq.-3.and.da_color(2).eq.1)then |
1955 | - icolalt(2,i) = icolalt(2,ida(1)) |
1956 | - elseif(da_color(1).eq.-3.and.da_color(2).eq.8)then |
1957 | - icolalt(2,i) = icolalt(2,ida(2)) |
1958 | - elseif(da_color(1).eq.-6.and.da_color(2).eq.3)then |
1959 | - if(-icolalt(1,ida(1)).eq.icolalt(1,ida(2)))then |
1960 | - icolalt(2,i) = icolalt(2,ida(1)) |
1961 | - else |
1962 | - icolalt(2,i) = -icolalt(1,ida(1)) |
1963 | - endif |
1964 | - elseif(da_color(1).eq.3.and.da_color(2).eq.3)then |
1965 | - maxcolor=maxcolor+1 |
1966 | - icolalt(2,i) = maxcolor |
1967 | - else |
1968 | - call write_error(da_color(1), da_color(2), mo_color) |
1969 | - endif |
1970 | + maxcolor=elim_indices(0,1,ncolmp,icolmp,i,icolalt,maxcolor) |
1971 | elseif(mo_color.eq.3) then ! color triplet |
1972 | - icolalt(2,i) = 0 |
1973 | - if(da_color(1).eq.1.and.da_color(2).eq.3)then |
1974 | - icolalt(1,i) = icolalt(1,ida(2)) |
1975 | - elseif(da_color(1).eq.3.and.da_color(2).eq.8)then |
1976 | - icolalt(1,i) = icolalt(1,ida(2)) |
1977 | - elseif(da_color(1).eq.-3.and.da_color(2).eq.6)then |
1978 | - if(icolalt(2,ida(1)).eq.icolalt(1,ida(2)))then |
1979 | - icolalt(1,i) = -icolalt(2,ida(2)) |
1980 | - else |
1981 | - icolalt(1,i) = icolalt(1,ida(2)) |
1982 | - endif |
1983 | - elseif(da_color(1).eq.-3.and.da_color(2).eq.-3)then |
1984 | - maxcolor=maxcolor+1 |
1985 | - icolalt(1,i) = maxcolor |
1986 | - else |
1987 | - call write_error(da_color(1), da_color(2), mo_color) |
1988 | - endif |
1989 | + maxcolor=elim_indices(1,0,ncolmp,icolmp,i,icolalt,maxcolor) |
1990 | elseif(mo_color.eq.-6) then ! color anti-sextet |
1991 | - if(da_color(1).eq.-6.and.da_color(2).eq.1)then |
1992 | - icolalt(1,i) = icolalt(1,ida(1)) |
1993 | - icolalt(2,i) = icolalt(2,ida(1)) |
1994 | - elseif(da_color(1).eq.-6.and.da_color(2).eq.8)then |
1995 | - if(icolalt(2,ida(1)).eq.icolalt(1,ida(2)))then |
1996 | - icolalt(1,i) = icolalt(1,ida(1)) |
1997 | - icolalt(2,i) = icolalt(2,ida(2)) |
1998 | - else |
1999 | - icolalt(1,i) = -icolalt(2,ida(2)) |
2000 | - icolalt(2,i) = icolalt(2,ida(1)) |
2001 | - endif |
2002 | - elseif(da_color(1).eq.-3.and.da_color(2).eq.-3)then |
2003 | - icolalt(1,i) = -icolalt(2,ida(1)) |
2004 | - icolalt(2,i) = icolalt(2,ida(2)) |
2005 | - else |
2006 | - call write_error(da_color(1), da_color(2), mo_color) |
2007 | - endif |
2008 | + maxcolor=elim_indices(0,2,ncolmp,icolmp,i,icolalt,maxcolor) |
2009 | elseif(mo_color.eq.6) then ! color sextet |
2010 | - if(da_color(1).eq.1.and.da_color(2).eq.6)then |
2011 | - icolalt(1,i) = icolalt(1,ida(2)) |
2012 | - icolalt(2,i) = icolalt(2,ida(2)) |
2013 | - elseif(da_color(1).eq.6.and.da_color(2).eq.8)then |
2014 | - if(icolalt(1,ida(1)).eq.icolalt(2,ida(2)))then |
2015 | - icolalt(1,i) = icolalt(1,ida(2)) |
2016 | - icolalt(2,i) = icolalt(2,ida(1)) |
2017 | - else |
2018 | - icolalt(1,i) = icolalt(1,ida(1)) |
2019 | - icolalt(2,i) = -icolalt(1,ida(2)) |
2020 | - endif |
2021 | - elseif(da_color(1).eq.3.and.da_color(2).eq.3)then |
2022 | - icolalt(1,i) = icolalt(1,ida(1)) |
2023 | - icolalt(2,i) = -icolalt(1,ida(2)) |
2024 | - else |
2025 | - call write_error(da_color(1), da_color(2), mo_color) |
2026 | - endif |
2027 | + maxcolor=elim_indices(2,0,ncolmp,icolmp,i,icolalt,maxcolor) |
2028 | elseif(mo_color.eq.8) then ! color octet |
2029 | - if(da_color(1).eq.-3.and.da_color(2).eq.3)then |
2030 | - icolalt(1,i) = icolalt(1,ida(2)) |
2031 | - icolalt(2,i) = icolalt(2,ida(1)) |
2032 | - elseif(da_color(1).eq.1.and.da_color(2).eq.8)then |
2033 | - icolalt(1,i) = icolalt(1,ida(2)) |
2034 | - icolalt(2,i) = icolalt(2,ida(2)) |
2035 | - elseif(da_color(1).eq.8.and.da_color(2).eq.8)then |
2036 | - if(icolalt(1,ida(1)).eq.icolalt(2,ida(2)))then |
2037 | - icolalt(1,i) = icolalt(1,ida(2)) |
2038 | - icolalt(2,i) = icolalt(2,ida(1)) |
2039 | - else |
2040 | - icolalt(1,i) = icolalt(1,ida(1)) |
2041 | - icolalt(2,i) = icolalt(2,ida(2)) |
2042 | - endif |
2043 | - elseif(da_color(1).eq.-6.and.da_color(2).eq.6)then |
2044 | - if(-icolalt(1,ida(1)).eq.icolalt(1,ida(2)))then |
2045 | - icolalt(1,i) = -icolalt(1,ida(2)) |
2046 | - icolalt(2,i) = icolalt(2,ida(1)) |
2047 | - elseif(icolalt(1,ida(1)).eq.icolalt(2,ida(2)))then |
2048 | - icolalt(1,i) = icolalt(1,ida(2)) |
2049 | - icolalt(2,i) = icolalt(2,ida(1)) |
2050 | - elseif(icolalt(2,ida(1)).eq.icolalt(1,ida(2)))then |
2051 | - icolalt(1,i) = -icolalt(2,ida(2)) |
2052 | - icolalt(2,i) = -icolalt(1,ida(1)) |
2053 | - else |
2054 | - icolalt(1,i) = icolalt(1,ida(2)) |
2055 | - icolalt(2,i) = -icolalt(1,ida(1)) |
2056 | - endif |
2057 | - else |
2058 | - call write_error(da_color(1), da_color(2), mo_color) |
2059 | - endif |
2060 | - else |
2061 | + maxcolor=elim_indices(1,1,ncolmp,icolmp,i,icolalt,maxcolor) |
2062 | + else ! 2 indicates multipart. vertex |
2063 | + da_color(1) = get_color(jpart(1,ida(1))) |
2064 | + da_color(2) = get_color(jpart(1,ida(2))) |
2065 | call write_error(da_color(1), da_color(2), mo_color) |
2066 | endif |
2067 | -c Set tentative mothers |
2068 | - jpart(2,i) = 1 |
2069 | - jpart(3,i) = 2 |
2070 | -c Set mother info for daughters |
2071 | - do j=1,2 |
2072 | - jpart(2,ida(j)) = i |
2073 | - jpart(3,ida(j)) = i |
2074 | - enddo |
2075 | c Just zero helicity info for intermediate states |
2076 | jpart(7,i) = 0 |
2077 | enddo ! do i |
2078 | @@ -371,11 +330,25 @@ |
2079 | return |
2080 | end |
2081 | |
2082 | +c ************************************* |
2083 | subroutine write_error(ida1,ida2,imo) |
2084 | +c ************************************* |
2085 | implicit none |
2086 | integer ida1,ida2,imo |
2087 | |
2088 | open(unit=26,file='../../../error',status='unknown',err=999) |
2089 | + if (ida1.eq.1000)then |
2090 | + write(26,*) 'Error: too many particles in multipart. vertex,', |
2091 | + $ ' please increase maxcolmp in addmothers.f' |
2092 | + write(*,*) 'Error: too many particles in multipart. vertex,', |
2093 | + $ ' please increase maxcolmp in addmothers.f' |
2094 | + stop |
2095 | + endif |
2096 | + if (ida1.eq.1001)then |
2097 | + write(26,*) 'Error: failed to reduce to color indices: ',ida2,imo |
2098 | + write(*,*) 'Error: failed to reduce to color indices: ',ida2,imo |
2099 | + stop |
2100 | + endif |
2101 | write(26,*) 'Error: Color combination ',ida1,ida2, |
2102 | $ '->',imo,' not implemented in addmothers.f' |
2103 | write(*,*) 'Error: Color combination ',ida1,ida2, |
2104 | @@ -384,3 +357,467 @@ |
2105 | |
2106 | 999 write(*,*) 'error' |
2107 | end |
2108 | + |
2109 | +c ********************************************************************* |
2110 | + function set_colmp(ncolmp,icolmp,npart,jpart,forest,icol,icol1,icol2) |
2111 | +c ********************************************************************* |
2112 | + implicit none |
2113 | + integer maxcolmp |
2114 | + parameter(maxcolmp=20) |
2115 | + include 'nexternal.inc' |
2116 | + include 'genps.inc' |
2117 | +c Arguments |
2118 | + integer set_colmp |
2119 | + integer ncolmp,icolmp(2,*),npart,icol1,icol2 |
2120 | + integer icol(2,-nexternal+2:2*nexternal-3) |
2121 | + integer jpart(7,-nexternal+3:2*nexternal-3) |
2122 | + integer forest(2,-max_branch:-1) |
2123 | +c Local |
2124 | + integer da_color(2),itmp,ida(2),icolor,ipart,i,j |
2125 | + integer get_color,set1colmp |
2126 | + |
2127 | + set_colmp=ncolmp |
2128 | + icolor=get_color(jpart(1,npart)) |
2129 | + if(icolor.eq.1) return |
2130 | + if(icolor.eq.2) then |
2131 | +c Multiparticle vertex - need to go through daughters and collect all colors |
2132 | + ipart=npart |
2133 | + do while(icolor.eq.2) |
2134 | + ida(1)=forest(1,ipart) |
2135 | + ida(2)=forest(2,ipart) |
2136 | + da_color(1)=get_color(jpart(1,ida(1))) |
2137 | + da_color(2)=get_color(jpart(1,ida(2))) |
2138 | +c print *,'iforest: ',ipart,ida(1),ida(2),da_color(1),da_color(2) |
2139 | + if(da_color(1).ne.2.and.da_color(2).lt.da_color(1).or. |
2140 | + $ da_color(2).eq.2)then |
2141 | +c Order daughters according to color, but always color 2 first |
2142 | + itmp=ida(1) |
2143 | + ida(1)=ida(2) |
2144 | + ida(2)=itmp |
2145 | + itmp=da_color(1) |
2146 | + da_color(1)=da_color(2) |
2147 | + da_color(2)=itmp |
2148 | + endif |
2149 | + do i=1,2 |
2150 | + if(da_color(i).ne.1.and.da_color(i).ne.2)then |
2151 | + ncolmp=set1colmp(ncolmp,icolmp,icol(1,ida(i)), |
2152 | + $ icol(2,ida(i))) |
2153 | + endif |
2154 | + enddo |
2155 | + icolor=da_color(1) |
2156 | + ipart=ida(1) |
2157 | + enddo |
2158 | + else |
2159 | + ncolmp=set1colmp(ncolmp,icolmp,icol1,icol2) |
2160 | + endif |
2161 | + set_colmp=ncolmp |
2162 | + return |
2163 | + end |
2164 | + |
2165 | +c ****************************************************** |
2166 | + function set1colmp(ncolmp,icolmp,icol1,icol2) |
2167 | +c ****************************************************** |
2168 | + implicit none |
2169 | +c Arguments |
2170 | + integer maxcolmp |
2171 | + parameter(maxcolmp=20) |
2172 | + integer set1colmp |
2173 | + integer ncolmp,icolmp(2,*),icol1,icol2 |
2174 | + |
2175 | + ncolmp=ncolmp+1 |
2176 | + icolmp(1,ncolmp)=icol1 |
2177 | + icolmp(2,ncolmp)=icol2 |
2178 | +c Avoid color sextet-type negative indices |
2179 | + if(icolmp(1,ncolmp).lt.0)then |
2180 | + ncolmp=ncolmp+1 |
2181 | + icolmp(2,ncolmp)=-icolmp(1,ncolmp-1) |
2182 | + icolmp(1,ncolmp-1)=0 |
2183 | + icolmp(1,ncolmp)=0 |
2184 | + elseif(icolmp(2,ncolmp).lt.0)then |
2185 | + ncolmp=ncolmp+1 |
2186 | + icolmp(1,ncolmp)=-icolmp(2,ncolmp-1) |
2187 | + icolmp(2,ncolmp-1)=0 |
2188 | + icolmp(2,ncolmp)=0 |
2189 | + endif |
2190 | + if(ncolmp.gt.maxcolmp) |
2191 | + $ call write_error(1000,ncolmp,maxcolmp) |
2192 | + set1colmp=ncolmp |
2193 | + return |
2194 | + end |
2195 | + |
2196 | +c******************************************************************** |
2197 | + function fix_tchannel_color(mo_color,maxcolor,ncolmp,icolmp,ires, |
2198 | + $ icol) |
2199 | +c******************************************************************** |
2200 | +c Successively eliminate identical pairwise color indices from the |
2201 | +c icolmp list, until only (max) one triplet and one antitriplet remains |
2202 | +c |
2203 | + |
2204 | + implicit none |
2205 | + include 'nexternal.inc' |
2206 | + integer fix_tchannel_color |
2207 | + integer mo_color,maxcolor,ncolmp,icolmp(2,*) |
2208 | + integer ires,icol(2,-nexternal+2:2*nexternal-3) |
2209 | + integer i,j,i3,i3bar,max3,max3bar,min3,min3bar,maxcol,mincol |
2210 | + |
2211 | +c Successively eliminate color indices in pairs until only the wanted |
2212 | +c indices remain |
2213 | + do i=1,ncolmp |
2214 | + do j=1,ncolmp |
2215 | + if(icolmp(1,i).ne.0.and.icolmp(1,i).eq.icolmp(2,j)) then |
2216 | + icolmp(1,i)=0 |
2217 | + icolmp(2,j)=0 |
2218 | + endif |
2219 | + enddo |
2220 | + enddo |
2221 | + |
2222 | + i3=0 |
2223 | + i3bar=0 |
2224 | + icol(1,ires)=0 |
2225 | + icol(2,ires)=0 |
2226 | + min3=1000 |
2227 | + max3=0 |
2228 | + min3bar=1000 |
2229 | + max3bar=0 |
2230 | + do i=1,ncolmp |
2231 | + if(icolmp(1,i).gt.0)then |
2232 | + i3=i3+1 |
2233 | +c color for t-channels needs to be reversed |
2234 | + if(i3.eq.1) icol(2,ires)=icolmp(1,i) |
2235 | + if(i3.eq.2) icol(1,ires)=-icolmp(1,i) |
2236 | + if(icolmp(1,i).gt.max3) max3=icolmp(1,i) |
2237 | + if(icolmp(1,i).lt.min3) min3=icolmp(1,i) |
2238 | + endif |
2239 | + if(icolmp(2,i).gt.0)then |
2240 | + i3bar=i3bar+1 |
2241 | +c color for t-channels needs to be reversed |
2242 | + if(i3bar.eq.1) icol(1,ires)=icolmp(2,i) |
2243 | + if(i3bar.eq.2) icol(2,ires)=-icolmp(2,i) |
2244 | + if(icolmp(2,i).gt.max3bar) max3bar=icolmp(2,i) |
2245 | + if(icolmp(2,i).lt.min3bar) min3bar=icolmp(2,i) |
2246 | + endif |
2247 | + enddo |
2248 | + |
2249 | + if(mo_color.eq.0)then |
2250 | + icol(1,ires)=0 |
2251 | + icol(2,ires)=0 |
2252 | + endif |
2253 | + |
2254 | + fix_tchannel_color=maxcolor |
2255 | + if(mo_color.le.1.and.i3.eq.0.and.i3bar.eq.0) return |
2256 | + if(mo_color.eq.3.and.(i3.eq.1.and.i3bar.eq.0 |
2257 | + $ .or.i3bar.eq.1.and.i3.eq.0)) return |
2258 | + if(mo_color.eq.8.and.i3.eq.1.and.i3bar.eq.1) return |
2259 | + |
2260 | +c Make sure that max and min don't come from the same octet |
2261 | + call clean_max_min(icolmp,ncolmp,max3,min3,max3bar,min3bar,i3,i3bar) |
2262 | + |
2263 | + if(mo_color.le.1.and.i3-i3bar.eq.2.or. |
2264 | + $ mo_color.le.1.and.i3bar-i3.eq.2.or. |
2265 | + $ mo_color.le.1.and.i3.eq.1.and.i3bar.eq.1) then |
2266 | +c Replace the maximum index with the minimum one everywhere |
2267 | + maxcol=max(max3,max3bar) |
2268 | + if(maxcol.eq.max3) then |
2269 | + mincol=min3bar |
2270 | + else |
2271 | + mincol=min3 |
2272 | + endif |
2273 | + do i=ires+1,-1 |
2274 | + do j=1,2 |
2275 | + if(icol(j,i).eq.maxcol) |
2276 | + $ icol(j,i)=mincol |
2277 | + enddo |
2278 | + enddo |
2279 | +c print *,'Replaced ',maxcol,' by ',mincol |
2280 | + elseif(mo_color.le.1.and.i3.eq.2.and.i3bar.eq.2) then |
2281 | +c Replace the maximum indices with the minimum ones everywhere |
2282 | + do i=ires+1,-1 |
2283 | + do j=1,2 |
2284 | + if(icol(j,i).eq.max3bar) |
2285 | + $ icol(j,i)=min3 |
2286 | + if(icol(j,i).eq.max3) |
2287 | + $ icol(j,i)=min3bar |
2288 | + enddo |
2289 | + enddo |
2290 | +c print *,'Replaced ',max3bar,' by ',min3,' and ',max3,' by ',min3bar |
2291 | + elseif(mo_color.le.1.and.mod(i3,3).eq.0.and.mod(i3bar,3).eq.0)then |
2292 | +c This is epsilon index - do nothing |
2293 | + continue |
2294 | + else if(mo_color.eq.3.and.mod(i3-i3bar,3).eq.2) then |
2295 | +c This is an epsilon index |
2296 | + maxcolor=maxcolor+1 |
2297 | + icol(1,ires)=maxcolor |
2298 | + icol(2,ires)=0 |
2299 | +c print *,'Set mother color for ',ires,' to ',(icol(j,ires),j=1,2) |
2300 | + else if(mo_color.eq.3.and.mod(i3bar-i3,3).eq.2) then |
2301 | +c This is an epsilon index |
2302 | + maxcolor=maxcolor+1 |
2303 | + icol(1,ires)=0 |
2304 | + icol(2,ires)=maxcolor |
2305 | +c print *,'Set mother color for ',ires,' to ',(icol(j,ires),j=1,2) |
2306 | + else if(mo_color.eq.3.and.(i3-i3bar.eq.1.or.i3bar-i3.eq.1).or. |
2307 | + $ mo_color.eq.8.and.i3.eq.2.and.i3bar.eq.2) then |
2308 | +c Replace the maximum index with the minimum one everywhere |
2309 | +c (we don't know if we should replace i3 with i3bar or vice versa) |
2310 | + maxcol=max(max3,max3bar) |
2311 | + if(maxcol.eq.max3) then |
2312 | + mincol=min3bar |
2313 | + else |
2314 | + mincol=min3 |
2315 | + endif |
2316 | + do i=ires+1,-1 |
2317 | + do j=1,2 |
2318 | + if(icol(j,i).eq.maxcol) |
2319 | + $ icol(j,i)=mincol |
2320 | + enddo |
2321 | + enddo |
2322 | +c Fix the color for ires (remember 3<->3bar for t-channels) |
2323 | + icol(1,ires)=0 |
2324 | + icol(2,ires)=0 |
2325 | +c print *,'Replaced ',maxcol,' by ',mincol |
2326 | + if(max3.eq.maxcol)then |
2327 | + if(i3-i3bar.ge.0) icol(2,ires)=min3 |
2328 | + if(i3bar-i3.ge.0) icol(1,ires)=max3bar |
2329 | + else |
2330 | + if(i3-i3bar.ge.0) icol(2,ires)=max3 |
2331 | + if(i3bar-i3.ge.0) icol(1,ires)=min3bar |
2332 | + endif |
2333 | +c print *,'Set mother color for ',ires,' to ',(icol(j,ires),j=1,2) |
2334 | + else |
2335 | +c Don't know how to deal with this |
2336 | + call write_error(i3,i3bar,mo_color) |
2337 | + endif |
2338 | + |
2339 | + fix_tchannel_color=maxcolor |
2340 | + |
2341 | + return |
2342 | + end |
2343 | + |
2344 | +c******************************************************************* |
2345 | + function elim_indices(n3,n3bar,ncolmp,icolmp,ires,icol,maxcolor) |
2346 | +c******************************************************************* |
2347 | +c Successively eliminate identical pairwise color indices from the |
2348 | +c icolmp list, until only the wanted indices remain |
2349 | +c n3 gives the number of triplet indices, n3bar number of antitriplets |
2350 | +c n3=1 for triplet, n3bar=1 for antitriplet, |
2351 | +c (n3,n3bar)=(1,1) for octet, |
2352 | +c n3=2 for sextet, n3bar=2 for antisextet |
2353 | +c If there are epsilon^{ijk} or epsilonbar color couplings, we |
2354 | +c need to introduce new index based on maxcolor. |
2355 | +c |
2356 | + |
2357 | + implicit none |
2358 | + include 'nexternal.inc' |
2359 | + integer elim_indices |
2360 | + integer n3,n3bar,ncolmp,icolmp(2,*),maxcolor |
2361 | + integer ires,icol(2,-nexternal+2:2*nexternal-3) |
2362 | + integer i,j,i3,i3bar |
2363 | + |
2364 | +c Successively eliminate color indices in pairs until only the wanted |
2365 | +c indices remain |
2366 | + do i=1,ncolmp |
2367 | + do j=1,ncolmp |
2368 | + if(icolmp(1,i).ne.0.and.icolmp(1,i).eq.icolmp(2,j)) then |
2369 | + icolmp(1,i)=0 |
2370 | + icolmp(2,j)=0 |
2371 | + endif |
2372 | + enddo |
2373 | + enddo |
2374 | + |
2375 | + i3=0 |
2376 | + i3bar=0 |
2377 | + icol(1,ires)=0 |
2378 | + icol(2,ires)=0 |
2379 | + do i=1,ncolmp |
2380 | + if(icolmp(1,i).gt.0)then |
2381 | + i3=i3+1 |
2382 | + if(i3.eq.1) icol(1,ires)=icolmp(1,i) |
2383 | + if(i3.eq.2) icol(2,ires)=-icolmp(1,i) |
2384 | + endif |
2385 | + if(icolmp(2,i).gt.0)then |
2386 | + i3bar=i3bar+1 |
2387 | + if(i3bar.eq.1) icol(2,ires)=icolmp(2,i) |
2388 | + if(i3bar.eq.2) icol(1,ires)=-icolmp(2,i) |
2389 | + endif |
2390 | + enddo |
2391 | + |
2392 | + if(n3.eq.0) icol(1,ires)=0 |
2393 | + if(n3bar.eq.0) icol(2,ires)=0 |
2394 | + |
2395 | + if(i3.ne.n3.or.i3bar.ne.n3bar) then |
2396 | + if(n3.gt.0.and.n3bar.eq.0.and.mod(i3bar+n3,3).eq.0)then |
2397 | +c This is an epsilon index interaction |
2398 | + maxcolor=maxcolor+1 |
2399 | + icol(1,ires)=maxcolor |
2400 | + if(n3.eq.2)then |
2401 | + maxcolor=maxcolor+1 |
2402 | + icol(2,ires)=-maxcolor |
2403 | + endif |
2404 | + elseif(n3bar.gt.0.and.n3.eq.0.and.mod(i3+n3bar,3).eq.0)then |
2405 | +c This is an epsilonbar index interaction |
2406 | + maxcolor=maxcolor+1 |
2407 | + icol(2,ires)=maxcolor |
2408 | + if(n3.eq.2)then |
2409 | + maxcolor=maxcolor+1 |
2410 | + icol(1,ires)=-maxcolor |
2411 | + endif |
2412 | + elseif(n3.gt.0.and.n3bar.eq.0.and.i3-i3bar.eq.n3.or. |
2413 | + $ n3bar.gt.0.and.n3.eq.0.and.i3bar-i3.eq.n3bar.or. |
2414 | + $ n3.eq.1.and.n3bar.eq.1.and.i3-i3bar.eq.0.or. |
2415 | + $ n3.eq.0.and.n3bar.eq.0.and.i3-i3bar.eq.0)then |
2416 | +c We have a previous epsilon which gives the wrong pop-up index |
2417 | + call fix_s_color_indices(n3,n3bar,i3,i3bar,ncolmp,icolmp,ires,icol) |
2418 | + else |
2419 | +c Don't know how to deal with this |
2420 | + call write_error(1001,n3,n3bar) |
2421 | + endif |
2422 | + endif |
2423 | + |
2424 | + elim_indices=maxcolor |
2425 | + |
2426 | + return |
2427 | + end |
2428 | + |
2429 | +c******************************************************************* |
2430 | + subroutine fix_s_color_indices(n3,n3bar,i3,i3bar,ncolmp,icolmp, |
2431 | + $ ires,icol) |
2432 | +c******************************************************************* |
2433 | +c |
2434 | +c Fix color flow if some particle has got the wrong pop-up color |
2435 | +c due to epsilon-ijk vertices |
2436 | +c |
2437 | + |
2438 | + implicit none |
2439 | + include 'nexternal.inc' |
2440 | + integer n3,n3bar,ncolmp,icolmp(2,*),maxcolor |
2441 | + integer ires,icol(2,-nexternal+2:2*nexternal-3) |
2442 | + integer i,j,i3,i3bar |
2443 | + integer max_n3,max_n3bar,min_n3,min_n3bar,maxcol,mincol |
2444 | + |
2445 | + max_n3=0 |
2446 | + max_n3bar=0 |
2447 | + min_n3=1000 |
2448 | + min_n3bar=1000 |
2449 | + do i=1,ncolmp |
2450 | + if(icolmp(1,i).gt.max_n3) |
2451 | + $ max_n3=icolmp(1,i) |
2452 | + if(icolmp(2,i).gt.max_n3bar) |
2453 | + $ max_n3bar=icolmp(2,i) |
2454 | + if(icolmp(1,i).gt.0.and.icolmp(1,i).lt.min_n3) |
2455 | + $ min_n3=icolmp(1,i) |
2456 | + if(icolmp(2,i).gt.0.and.icolmp(2,i).lt.min_n3bar) |
2457 | + $ min_n3bar=icolmp(2,i) |
2458 | + enddo |
2459 | + |
2460 | + icol(1,ires)=0 |
2461 | + icol(2,ires)=0 |
2462 | + |
2463 | +c Make sure that max and min don't come from the same octet |
2464 | + call clean_max_min(icolmp,ncolmp,max_n3,min_n3, |
2465 | + $ max_n3bar,min_n3bar,i3,i3bar) |
2466 | + |
2467 | + if(n3.eq.1.and.n3bar.eq.0.and.i3-i3bar.eq.n3.or. |
2468 | + $ n3bar.eq.1.and.n3.eq.0.and.i3bar-i3.eq.n3bar.or. |
2469 | + $ n3bar.eq.1.and.n3.eq.1.and.i3bar-i3.eq.0.or. |
2470 | + $ n3bar.eq.0.and.n3.eq.0.and.i3bar-i3.eq.0)then |
2471 | +c Replace the highest 3bar-index with the lowest 3-index, |
2472 | +c and vice versa |
2473 | + maxcol=max(max_n3,max_n3bar) |
2474 | + if(maxcol.eq.max_n3) then |
2475 | + mincol=min_n3bar |
2476 | + else |
2477 | + mincol=min_n3 |
2478 | + endif |
2479 | + do i=ires,-1 |
2480 | + do j=1,2 |
2481 | + if(icol(j,i).eq.maxcol) |
2482 | + $ icol(j,i)=mincol |
2483 | + enddo |
2484 | + enddo |
2485 | +c print *,'Replaced ',maxcol,' with ',mincol |
2486 | + if(max_n3.eq.maxcol)then |
2487 | + if(n3.eq.1) icol(1,ires)=min_n3 |
2488 | + if(n3bar.eq.1) icol(2,ires)=max_n3bar |
2489 | + else |
2490 | + if(n3.eq.1) icol(1,ires)=max_n3 |
2491 | + if(n3bar.eq.1) icol(2,ires)=min_n3bar |
2492 | + endif |
2493 | +c print *,'Set mother color for ',ires,' to ',(icol(j,ires),j=1,2) |
2494 | + else |
2495 | +c Don't know how to deal with this |
2496 | + call write_error(1001,n3,n3bar) |
2497 | + endif |
2498 | + return |
2499 | + end |
2500 | + |
2501 | +c******************************************************************************* |
2502 | + subroutine clean_max_min(icolmp,ncolmp,max3,min3,max3bar,min3bar,i3,i3bar) |
2503 | +c******************************************************************************* |
2504 | + implicit none |
2505 | + integer ncolmp,icolmp(2,*) |
2506 | + integer i,j,max3,max3bar,min3,min3bar,i3,i3bar |
2507 | + |
2508 | +c Make sure that max and min don't come from the same octet |
2509 | + do i=1,ncolmp |
2510 | + if(icolmp(1,i).eq.max3.and.icolmp(2,i).eq.min3bar)then |
2511 | + min3bar=1000 |
2512 | + do j=1,ncolmp |
2513 | + if(j.eq.i) cycle |
2514 | + if(icolmp(2,j).lt.min3bar) min3bar=icolmp(2,j) |
2515 | + enddo |
2516 | + endif |
2517 | + if(icolmp(2,i).eq.max3bar.and.icolmp(1,i).eq.min3)then |
2518 | + min3=1000 |
2519 | + do j=1,ncolmp |
2520 | + if(j.eq.i) cycle |
2521 | + if(icolmp(1,j).lt.min3) min3=icolmp(1,j) |
2522 | + enddo |
2523 | + endif |
2524 | + enddo |
2525 | + |
2526 | +c ...and that max and min are different |
2527 | + if(i3.gt.1.and.max3.eq.min3.or.i3bar.gt.1.and.max3bar.eq.min3bar)then |
2528 | + if(max3.gt.max3bar)then |
2529 | +c Need to change min3, while still ensuring that max3bar is ok |
2530 | + max3bar=0 |
2531 | + min3=1000 |
2532 | + do i=1,ncolmp |
2533 | + if(icolmp(2,i).gt.max3bar.and.icolmp(2,i).ne.min3bar) |
2534 | + $ max3bar=icolmp(2,i) |
2535 | + if(icolmp(1,i).lt.min3.and.icolmp(1,i).ne.max3) |
2536 | + $ min3=icolmp(1,i) |
2537 | + enddo |
2538 | +c Make sure that max3bar and min3 don't come from the same octet |
2539 | + do i=1,ncolmp |
2540 | + if(icolmp(2,i).eq.max3bar.and.icolmp(1,i).eq.min3)then |
2541 | + min3=1000 |
2542 | + do j=1,ncolmp |
2543 | + if(j.eq.i.or.icolmp(1,j).eq.max3) cycle |
2544 | + if(icolmp(1,j).lt.min3) min3=icolmp(1,j) |
2545 | + enddo |
2546 | + endif |
2547 | + enddo |
2548 | + else |
2549 | +c Need to change min3bar, while still ensuring that max3 is ok |
2550 | + max3=0 |
2551 | + min3bar=1000 |
2552 | + do i=1,ncolmp |
2553 | + if(icolmp(1,i).gt.max3.and.icolmp(1,i).ne.min3) |
2554 | + $ max3=icolmp(1,i) |
2555 | + if(icolmp(2,i).lt.min3bar.and.icolmp(2,i).ne.max3bar) |
2556 | + $ min3bar=icolmp(2,i) |
2557 | + enddo |
2558 | +c Make sure that max3 and min3bar don't come from the same octet |
2559 | + do i=1,ncolmp |
2560 | + if(icolmp(1,i).eq.max3.and.icolmp(2,i).eq.min3bar)then |
2561 | + min3bar=1000 |
2562 | + do j=1,ncolmp |
2563 | + if(j.eq.i.or.icolmp(2,j).eq.max3bar) cycle |
2564 | + if(icolmp(2,j).lt.min3bar) min3bar=icolmp(2,j) |
2565 | + enddo |
2566 | + endif |
2567 | + enddo |
2568 | + endif |
2569 | + endif |
2570 | + |
2571 | + end |
2572 | |
2573 | === removed file 'Template/SubProcesses/check_dip.f' |
2574 | --- Template/SubProcesses/check_dip.f 2010-10-30 03:26:37 +0000 |
2575 | +++ Template/SubProcesses/check_dip.f 1970-01-01 00:00:00 +0000 |
2576 | @@ -1,537 +0,0 @@ |
2577 | - PROGRAM DRIVER |
2578 | -C************************************************************************** |
2579 | -C THIS IS THE DRIVER FOR CHECKING THE STANDALONE MATRIX ELEMENT |
2580 | -C INCLUDING SUBTRACTION TERMS IN THE SOFT/COLINEAR LIMITS. |
2581 | -C IT USES A SIMPLE PHASE SPACE GENERATOR |
2582 | -C Fabio Maltoni - 3rd Febraury 2007 |
2583 | -C Updated by Nicolas Greiner and Rikkert Frederix for the |
2584 | -C dipole terms - July 2008 |
2585 | -C************************************************************************** |
2586 | - IMPLICIT NONE |
2587 | -C |
2588 | -C CONSTANTS |
2589 | -C |
2590 | - REAL*8 ZERO |
2591 | - PARAMETER (ZERO=0D0) |
2592 | -C |
2593 | -C INCLUDE FILES |
2594 | -C |
2595 | -C--- the include file with the values of the parameters and masses |
2596 | - INCLUDE "coupl.inc" |
2597 | -C--- integer nexternal ! number particles (incoming+outgoing) in the me |
2598 | - INCLUDE "nexternal.inc" |
2599 | -C--- particle masses |
2600 | - REAL*8 PMASS(NEXTERNAL) |
2601 | -C--- integer n_max_cg |
2602 | - INCLUDE "ngraphs.inc" !how many diagrams (could be useful to know...) |
2603 | - INCLUDE "dipole.inc" |
2604 | -C |
2605 | -C LOCAL |
2606 | -C |
2607 | - INTEGER I,J,K,l,m,l1,m1 |
2608 | - REAL*8 P(0:3,NEXTERNAL) ! four momenta. Energy is the zeroth component. |
2609 | - REAL*8 SQRTS ! sqrt(s)= center of mass energy |
2610 | - REAL*8 ME,SUBTRACT,SUBTRACT2 ! Matrix Element and subtraction terms |
2611 | - real*8 s(nexternal,nexternal)! Final state invariants |
2612 | - real*8 start,number ! Starting value for invariants and the number of phase space points |
2613 | - logical cut ! Cut to prevent going into double limits |
2614 | - real*8 sum,x(2) |
2615 | -C |
2616 | -C EXTERNAL |
2617 | -C |
2618 | - REAL*8 DOT |
2619 | - EXTERNAL DOT |
2620 | - |
2621 | -C----- |
2622 | -C BEGIN CODE |
2623 | -C----- |
2624 | -C |
2625 | -C--- INITIALIZATION CALLS |
2626 | -C |
2627 | -c--- Call to initialize the values of the couplings, masses and widths |
2628 | -c used in the evaluation of the matrix element. The primary parameters of the |
2629 | -c models are read from Cards/param_card.dat. The secondary parameters are calculated |
2630 | -c in Source/MODEL/couplings.f. The values are stored in common blocks that are listed |
2631 | -c in coupl.inc . |
2632 | - |
2633 | - call setpara('param_card.dat',.true.) !first call to setup the paramaters |
2634 | - mu = 91.188d0 !renormalization scale |
2635 | - muf = 91.188d0 !factorization scale |
2636 | - include "pmass.inc" !set up masses |
2637 | - |
2638 | - SQRTS=1000d0 !CMS energy in GEV |
2639 | - x(1)=1d0 !Bjorken x's |
2640 | - x(2)=1d0 |
2641 | - number=1000000 !Number of phase space points |
2642 | - |
2643 | - |
2644 | -c******************************************************************************************** |
2645 | -C First do the collinear limits: |
2646 | -c******************************************************************************************** |
2647 | - write (*,*) 'Check of all the collinear limits:' |
2648 | -c Loop over all possible limits of final sate |
2649 | - do l=1,nexternal-1 |
2650 | - do m=l+1,nexternal |
2651 | - |
2652 | - start=100d0 |
2653 | - write (*,*) ' ' |
2654 | - write (*,'(2A)')'-----------------------------------------', |
2655 | - . '------------------------------------------------------' |
2656 | - write (*,*) ' Limit: p(',l,').p(',m,') goes to zero' |
2657 | - write (*,'(2A)')'-----------------------------------------', |
2658 | - . '------------------------------------------------------' |
2659 | - write (*,11) 'p(',l,').p(',m,')/s(1,2) ,',' sqrt(s(',l |
2660 | - . ,',',m,')) ,','|M|^2 ,' |
2661 | - . ,'|Sub.term|^2 ,','|M|^2/|Sub.term|^2' |
2662 | - write (*,'(2A)')'-----------------------------------------', |
2663 | - . '------------------------------------------------------' |
2664 | - |
2665 | - |
2666 | -c Loop over phase space points |
2667 | - do i=1,number |
2668 | - |
2669 | -c--- Now use a simple multipurpose PS generator (RAMBO) just to get a |
2670 | -c RANDOM set of four momenta of given masses pmass(i) to be used to evaluate |
2671 | -c the madgraph matrix-element and the subtraction terms. |
2672 | -c |
2673 | - CALL GET_MOMENTA(SQRTS,PMASS,P) |
2674 | - |
2675 | -c Calculate all the final state invariants |
2676 | - do l1=1,nexternal-1 |
2677 | - do m1=l1+1,nexternal |
2678 | - s(l1,m1)=dot(p(0,l1),p(0,m1)) |
2679 | - enddo |
2680 | - enddo |
2681 | - |
2682 | - cut =.false. |
2683 | -c Only continue if we are closer to the limit then the starting value. |
2684 | -c If we pass the if statement, update 'start' with the new value. |
2685 | - if(s(l,m)/s(1,2) .lt. start) then |
2686 | - |
2687 | -c Make sure that we are only looking in a single collinear limit. Double |
2688 | -c logarithms are not cancelled by the dipoles. Do this by cutting |
2689 | -c away the phase-space point if any of the other final state invariants |
2690 | -c is smaller than 10% of the CMS energy. |
2691 | - do j=1,nexternal-1 |
2692 | - do k=j+1,nexternal |
2693 | - if((j.ne.l).or.(k.ne.m)) then |
2694 | - if(s(j,k)/s(1,2).lt.0.01d0) then |
2695 | - cut=.true. |
2696 | - endif |
2697 | - endif |
2698 | - enddo |
2699 | - enddo |
2700 | - |
2701 | -c If we found a point closer to the limit, update 'start' and |
2702 | -c calculate the matrix element and subtraction terms. |
2703 | - if(.not.cut) then |
2704 | - start=s(l,m)/s(1,2) |
2705 | - CALL SMATRIX(P,ME) |
2706 | - Call DIPOLSUM(P,X,1d0,SUBTRACT) |
2707 | -c Uncomment the following 2 lines to include the possible non-divergent dipoles, |
2708 | -c i.e. dipoles for which the unresolved is massive (= in particles.dat the mass |
2709 | -c is set to something different from 'ZERO'). |
2710 | -c Call DIPOLSUMFINITE(P,X,1d0,SUBTRACT2) |
2711 | -c SUBTRACT=SUBTRACT+SUBTRACT2 |
2712 | - |
2713 | -c Write out the results |
2714 | - Write (*,10)s(l,m)/s(1,2),' ,',dsqrt(abs( |
2715 | - & (p(0,l)+p(0,m))**2-(p(1,l)+p(1,m))**2 |
2716 | - & -(p(2,l)+p(2,m))**2-(p(3,l)+p(3,m))**2)) |
2717 | - & ,' ,',ME,' ,',SUBTRACT,' ,',ME/SUBTRACT |
2718 | - endif |
2719 | - endif |
2720 | - enddo |
2721 | - enddo |
2722 | - enddo |
2723 | - |
2724 | - |
2725 | - |
2726 | - |
2727 | - |
2728 | - |
2729 | - |
2730 | -c******************************************************************************** |
2731 | -C Now check also the soft limits: |
2732 | -c******************************************************************************** |
2733 | - do i=1,5 |
2734 | - write (*,*) ' ' |
2735 | - enddo |
2736 | - write (*,*) 'Check off all the soft limits:' |
2737 | -c loop over all final state particles: |
2738 | - do l=3, nexternal |
2739 | - |
2740 | - start=100d0 |
2741 | - write (*,*) ' ' |
2742 | - write (*,'(2A)')'-----------------------------------------', |
2743 | - . '------------------------------------------------------' |
2744 | - write (*,*) ' Limit: p(',l,') goes soft' |
2745 | - write (*,'(2A)')'-----------------------------------------', |
2746 | - . '------------------------------------------------------' |
2747 | - write (*,13) 'p(0,',l,')^2/s(1,2) ,','|M|^2 ,' |
2748 | - . ,'|Sub.term|^2 ,','|M|^2/|Sub.term|^2' |
2749 | - write (*,'(2A)')'-----------------------------------------', |
2750 | - . '------------------------------------------------------' |
2751 | - |
2752 | -c Loop over phase space points |
2753 | - do i=1,number |
2754 | - |
2755 | -c Get the random set of 4-momenta |
2756 | - CALL GET_MOMENTA(SQRTS,PMASS,P) |
2757 | - |
2758 | -c Calculate all the final state invariants |
2759 | - do l1=1,nexternal-1 |
2760 | - do m1=l1+1,nexternal |
2761 | - s(l1,m1)=dot(p(0,l1),p(0,m1)) |
2762 | - enddo |
2763 | - enddo |
2764 | - |
2765 | - cut =.false. |
2766 | - sum = 0d0 |
2767 | -c Only continue if we are closer to the limit then the starting value. |
2768 | -c If we pass the if statement, update 'start' with the new value. |
2769 | - if(p(0,l)**2/s(1,2) .lt. start) then |
2770 | - |
2771 | -c Make sure that we are only looking at the soft limit. Do this by cutting |
2772 | -c away the phase-space point if any of the other final state invariants |
2773 | -c is smaller than 10% of the CMS energy. |
2774 | - do j=1,nexternal-1 |
2775 | - do k=j+1,nexternal |
2776 | - if((j.ne.l).and.(k.ne.l)) then |
2777 | - if(s(j,k)/s(1,2).lt.0.01d0) then |
2778 | - cut=.true. |
2779 | - endif |
2780 | - endif |
2781 | - if((j.eq.l).or.(k.eq.l))then |
2782 | - sum=sum+s(j,k) |
2783 | - endif |
2784 | - enddo |
2785 | - enddo |
2786 | -c cut away points that are collinear by forcing that all the invariants |
2787 | -c with the soft particle contribute at least 2*nexternal'th to the sum. This |
2788 | -c makes sure that all these invariants go to zero at the same time. |
2789 | - do j=1,nexternal-1 |
2790 | - do k=j+1,nexternal |
2791 | - if(((j.eq.l).or.(k.eq.l)).and. |
2792 | - . (s(j,k).lt.sum/real(2*nexternal)))then |
2793 | - cut=.true. |
2794 | - endif |
2795 | - enddo |
2796 | - enddo |
2797 | - |
2798 | -c If we found a point closer to the limit, update 'start' and |
2799 | -c calculate the matrix element and subtraction terms. |
2800 | - if(.not.cut) then |
2801 | - start=p(0,l)**2/s(1,2) |
2802 | - CALL SMATRIX(P,ME) |
2803 | - Call DIPOLSUM(P,X,1d0,SUBTRACT) |
2804 | -c Uncomment the following 2 lines to include the possible non-divergent dipoles, |
2805 | -c i.e. dipoles for which the unresolved is massive (= in particles.dat the mass |
2806 | -c is set to something different from 'ZERO'). |
2807 | -c Call DIPOLSUMFINITE(P,X,1d0,SUBTRACT2) |
2808 | -c SUBTRACT=SUBTRACT+SUBTRACT2 |
2809 | - |
2810 | -c Write out the results |
2811 | - Write (*,14) p(0,l)/s(1,2), |
2812 | - . ' ,',ME,' ,',SUBTRACT,' ,',ME/SUBTRACT |
2813 | - endif |
2814 | - endif |
2815 | - enddo |
2816 | - |
2817 | - enddo |
2818 | - |
2819 | - |
2820 | - 10 format(1X,e18.6,A2,e16.6,A2,e16.6,A2,e16.6,A2,e16.6) |
2821 | - 11 format(1X,A2,I2,A4,I2,A,1X,A,I2,A1,I2,A,A18,A18,A20) |
2822 | - 14 format(1X,e18.6,A2,e16.6,A2,e16.6,A2,e16.6) |
2823 | - 13 format(3X,A4,I2,A12,A18,A18,A20) |
2824 | - |
2825 | - end |
2826 | - |
2827 | - |
2828 | - |
2829 | - |
2830 | - double precision function dot(p1,p2) |
2831 | -C**************************************************************************** |
2832 | -C 4-Vector Dot product |
2833 | -C**************************************************************************** |
2834 | - implicit none |
2835 | - double precision p1(0:3),p2(0:3) |
2836 | - dot=p1(0)*p2(0)-p1(1)*p2(1)-p1(2)*p2(2)-p1(3)*p2(3) |
2837 | - end |
2838 | - |
2839 | - |
2840 | - SUBROUTINE GET_MOMENTA(ENERGY,PMASS,P) |
2841 | -C---- auxiliary function to change convention between madgraph and rambo |
2842 | -c---- four momenta. |
2843 | - IMPLICIT NONE |
2844 | - INCLUDE "nexternal.inc" |
2845 | -C ARGUMENTS |
2846 | - REAL*8 ENERGY,PMASS(NEXTERNAL),P(0:3,NEXTERNAL),PRAMBO(4,10),WGT |
2847 | -C LOCAL |
2848 | - INTEGER I |
2849 | - |
2850 | - P(0,1)=energy/2 |
2851 | - P(1,1)=0d0 |
2852 | - P(2,1)=0d0 |
2853 | - P(3,1)=energy/2 |
2854 | - |
2855 | - P(0,2)=energy/2 |
2856 | - P(1,2)=0d0 |
2857 | - P(2,2)=0d0 |
2858 | - P(3,2)=-energy/2 |
2859 | - |
2860 | - call rambo(nexternal-2,energy,pmass(3),prambo,WGT) |
2861 | - DO I=3, NEXTERNAL |
2862 | - P(0,I)=PRAMBO(4,I-2) |
2863 | - P(1,I)=PRAMBO(1,I-2) |
2864 | - P(2,I)=PRAMBO(2,I-2) |
2865 | - P(3,I)=PRAMBO(3,I-2) |
2866 | - ENDDO |
2867 | - |
2868 | - RETURN |
2869 | - END |
2870 | - |
2871 | - |
2872 | - SUBROUTINE RAMBO(N,ET,XM,P,WT) |
2873 | -*********************************************************************** |
2874 | -* RAMBO * |
2875 | -* RA(NDOM) M(OMENTA) B(EAUTIFULLY) O(RGANIZED) * |
2876 | -* * |
2877 | -* A DEMOCRATIC MULTI-PARTICLE PHASE SPACE GENERATOR * |
2878 | -* AUTHORS: S.D. ELLIS, R. KLEISS, W.J. STIRLING * |
2879 | -* THIS IS VERSION 1.0 - WRITTEN BY R. KLEISS * |
2880 | -* -- ADJUSTED BY HANS KUIJF, WEIGHTS ARE LOGARITHMIC (20-08-90) * |
2881 | -* * |
2882 | -* N = NUMBER OF PARTICLES * |
2883 | -* ET = TOTAL CENTRE-OF-MASS ENERGY * |
2884 | -* XM = PARTICLE MASSES ( DIM=NEXTERNAL-2 ) * |
2885 | -* P = PARTICLE MOMENTA ( DIM=(4,NEXTERNAL-2) ) * |
2886 | -* WT = WEIGHT OF THE EVENT * |
2887 | -*********************************************************************** |
2888 | - IMPLICIT REAL*8(A-H,O-Z) |
2889 | - INCLUDE "nexternal.inc" |
2890 | - DIMENSION XM(NEXTERNAL-2),P(4,NEXTERNAL-2) |
2891 | - DIMENSION Q(4,NEXTERNAL-2),Z(NEXTERNAL-2),R(4), |
2892 | - . B(3),P2(NEXTERNAL-2),XM2(NEXTERNAL-2), |
2893 | - . E(NEXTERNAL-2),V(NEXTERNAL-2),IWARN(5) |
2894 | - SAVE ACC,ITMAX,IBEGIN,IWARN |
2895 | - DATA ACC/1.D-14/,ITMAX/6/,IBEGIN/0/,IWARN/5*0/ |
2896 | -* |
2897 | -* INITIALIZATION STEP: FACTORIALS FOR THE PHASE SPACE WEIGHT |
2898 | - IF(IBEGIN.NE.0) GOTO 103 |
2899 | - IBEGIN=1 |
2900 | - TWOPI=8.*DATAN(1.D0) |
2901 | - PO2LOG=LOG(TWOPI/4.) |
2902 | - Z(2)=PO2LOG |
2903 | - DO 101 K=3,10 |
2904 | - 101 Z(K)=Z(K-1)+PO2LOG-2.*LOG(DFLOAT(K-2)) |
2905 | - DO 102 K=3,10 |
2906 | - 102 Z(K)=(Z(K)-LOG(DFLOAT(K-1))) |
2907 | -* |
2908 | -* CHECK ON THE NUMBER OF PARTICLES |
2909 | - 103 IF(N.GT.1.AND.N.LT.101) GOTO 104 |
2910 | - PRINT 1001,N |
2911 | - STOP |
2912 | -* |
2913 | -* CHECK WHETHER TOTAL ENERGY IS SUFFICIENT; COUNT NONZERO MASSES |
2914 | - 104 XMT=0. |
2915 | - NM=0 |
2916 | - DO 105 I=1,N |
2917 | - IF(XM(I).NE.0.D0) NM=NM+1 |
2918 | - 105 XMT=XMT+ABS(XM(I)) |
2919 | - IF(XMT.LE.ET) GOTO 201 |
2920 | - PRINT 1002,XMT,ET |
2921 | - STOP |
2922 | -* |
2923 | -* THE PARAMETER VALUES ARE NOW ACCEPTED |
2924 | -* |
2925 | -* GENERATE N MASSLESS MOMENTA IN INFINITE PHASE SPACE |
2926 | - 201 DO 202 I=1,N |
2927 | - r1=rn(1) |
2928 | - C=2.*r1-1. |
2929 | - S=SQRT(1.-C*C) |
2930 | - F=TWOPI*RN(2) |
2931 | - r1=rn(3) |
2932 | - r2=rn(4) |
2933 | - Q(4,I)=-LOG(r1*r2) |
2934 | - Q(3,I)=Q(4,I)*C |
2935 | - Q(2,I)=Q(4,I)*S*COS(F) |
2936 | - 202 Q(1,I)=Q(4,I)*S*SIN(F) |
2937 | -* |
2938 | -* CALCULATE THE PARAMETERS OF THE CONFORMAL TRANSFORMATION |
2939 | - DO 203 I=1,4 |
2940 | - 203 R(I)=0. |
2941 | - DO 204 I=1,N |
2942 | - DO 204 K=1,4 |
2943 | - 204 R(K)=R(K)+Q(K,I) |
2944 | - RMAS=SQRT(R(4)**2-R(3)**2-R(2)**2-R(1)**2) |
2945 | - DO 205 K=1,3 |
2946 | - 205 B(K)=-R(K)/RMAS |
2947 | - G=R(4)/RMAS |
2948 | - A=1./(1.+G) |
2949 | - X=ET/RMAS |
2950 | -* |
2951 | -* TRANSFORM THE Q'S CONFORMALLY INTO THE P'S |
2952 | - DO 207 I=1,N |
2953 | - BQ=B(1)*Q(1,I)+B(2)*Q(2,I)+B(3)*Q(3,I) |
2954 | - DO 206 K=1,3 |
2955 | - 206 P(K,I)=X*(Q(K,I)+B(K)*(Q(4,I)+A*BQ)) |
2956 | - 207 P(4,I)=X*(G*Q(4,I)+BQ) |
2957 | -* |
2958 | -* CALCULATE WEIGHT AND POSSIBLE WARNINGS |
2959 | - WT=PO2LOG |
2960 | - IF(N.NE.2) WT=(2.*N-4.)*LOG(ET)+Z(N) |
2961 | - IF(WT.GE.-180.D0) GOTO 208 |
2962 | - IF(IWARN(1).LE.5) PRINT 1004,WT |
2963 | - IWARN(1)=IWARN(1)+1 |
2964 | - 208 IF(WT.LE. 174.D0) GOTO 209 |
2965 | - IF(IWARN(2).LE.5) PRINT 1005,WT |
2966 | - IWARN(2)=IWARN(2)+1 |
2967 | -* |
2968 | -* RETURN FOR WEIGHTED MASSLESS MOMENTA |
2969 | - 209 IF(NM.NE.0) GOTO 210 |
2970 | -* RETURN LOG OF WEIGHT |
2971 | - WT=WT |
2972 | - RETURN |
2973 | -* |
2974 | -* MASSIVE PARTICLES: RESCALE THE MOMENTA BY A FACTOR X |
2975 | - 210 XMAX=SQRT(1.-(XMT/ET)**2) |
2976 | - DO 301 I=1,N |
2977 | - XM2(I)=XM(I)**2 |
2978 | - 301 P2(I)=P(4,I)**2 |
2979 | - ITER=0 |
2980 | - X=XMAX |
2981 | - ACCU=ET*ACC |
2982 | - 302 F0=-ET |
2983 | - G0=0. |
2984 | - X2=X*X |
2985 | - DO 303 I=1,N |
2986 | - E(I)=SQRT(XM2(I)+X2*P2(I)) |
2987 | - F0=F0+E(I) |
2988 | - 303 G0=G0+P2(I)/E(I) |
2989 | - IF(ABS(F0).LE.ACCU) GOTO 305 |
2990 | - ITER=ITER+1 |
2991 | - IF(ITER.LE.ITMAX) GOTO 304 |
2992 | - PRINT 1006,ITMAX |
2993 | - GOTO 305 |
2994 | - 304 X=X-F0/(X*G0) |
2995 | - GOTO 302 |
2996 | - 305 DO 307 I=1,N |
2997 | - V(I)=X*P(4,I) |
2998 | - DO 306 K=1,3 |
2999 | - 306 P(K,I)=X*P(K,I) |
3000 | - 307 P(4,I)=E(I) |
3001 | -* |
3002 | -* CALCULATE THE MASS-EFFECT WEIGHT FACTOR |
3003 | - WT2=1. |
3004 | - WT3=0. |
3005 | - DO 308 I=1,N |
3006 | - WT2=WT2*V(I)/E(I) |
3007 | - 308 WT3=WT3+V(I)**2/E(I) |
3008 | - WTM=(2.*N-3.)*LOG(X)+LOG(WT2/WT3*ET) |
3009 | -* |
3010 | -* RETURN FOR WEIGHTED MASSIVE MOMENTA |
3011 | - WT=WT+WTM |
3012 | - IF(WT.GE.-180.D0) GOTO 309 |
3013 | - IF(IWARN(3).LE.5) PRINT 1004,WT |
3014 | - IWARN(3)=IWARN(3)+1 |
3015 | - 309 IF(WT.LE. 174.D0) GOTO 310 |
3016 | - IF(IWARN(4).LE.5) PRINT 1005,WT |
3017 | - IWARN(4)=IWARN(4)+1 |
3018 | -* RETURN LOG OF WEIGHT |
3019 | - 310 WT=WT |
3020 | - RETURN |
3021 | -* |
3022 | - 1001 FORMAT(' RAMBO FAILS: # OF PARTICLES =',I5,' IS NOT ALLOWED') |
3023 | - 1002 FORMAT(' RAMBO FAILS: TOTAL MASS =',D15.6,' IS NOT', |
3024 | - . ' SMALLER THAN TOTAL ENERGY =',D15.6) |
3025 | - 1004 FORMAT(' RAMBO WARNS: WEIGHT = EXP(',F20.9,') MAY UNDERFLOW') |
3026 | - 1005 FORMAT(' RAMBO WARNS: WEIGHT = EXP(',F20.9,') MAY OVERFLOW') |
3027 | - 1006 FORMAT(' RAMBO WARNS:',I3,' ITERATIONS DID NOT GIVE THE', |
3028 | - . ' DESIRED ACCURACY =',D15.6) |
3029 | - END |
3030 | - |
3031 | - FUNCTION RN(IDUMMY) |
3032 | - REAL*8 RN,RAN |
3033 | - SAVE INIT |
3034 | - DATA INIT /1/ |
3035 | - IF (INIT.EQ.1) THEN |
3036 | - INIT=0 |
3037 | - CALL RMARIN(1802,9373) |
3038 | - END IF |
3039 | -* |
3040 | - 10 CALL RANMAR(RAN) |
3041 | - IF (RAN.LT.1D-16) GOTO 10 |
3042 | - RN=RAN |
3043 | -* |
3044 | - END |
3045 | - |
3046 | - |
3047 | - |
3048 | - SUBROUTINE RANMAR(RVEC) |
3049 | -* ----------------- |
3050 | -* Universal random number generator proposed by Marsaglia and Zaman |
3051 | -* in report FSU-SCRI-87-50 |
3052 | -* In this version RVEC is a double precision variable. |
3053 | - IMPLICIT REAL*8(A-H,O-Z) |
3054 | - COMMON/ RASET1 / RANU(97),RANC,RANCD,RANCM |
3055 | - COMMON/ RASET2 / IRANMR,JRANMR |
3056 | - SAVE /RASET1/,/RASET2/ |
3057 | - UNI = RANU(IRANMR) - RANU(JRANMR) |
3058 | - IF(UNI .LT. 0D0) UNI = UNI + 1D0 |
3059 | - RANU(IRANMR) = UNI |
3060 | - IRANMR = IRANMR - 1 |
3061 | - JRANMR = JRANMR - 1 |
3062 | - IF(IRANMR .EQ. 0) IRANMR = 97 |
3063 | - IF(JRANMR .EQ. 0) JRANMR = 97 |
3064 | - RANC = RANC - RANCD |
3065 | - IF(RANC .LT. 0D0) RANC = RANC + RANCM |
3066 | - UNI = UNI - RANC |
3067 | - IF(UNI .LT. 0D0) UNI = UNI + 1D0 |
3068 | - RVEC = UNI |
3069 | - END |
3070 | - |
3071 | - SUBROUTINE RMARIN(IJ,KL) |
3072 | -* ----------------- |
3073 | -* Initializing routine for RANMAR, must be called before generating |
3074 | -* any pseudorandom numbers with RANMAR. The input values should be in |
3075 | -* the ranges 0<=ij<=31328 ; 0<=kl<=30081 |
3076 | - IMPLICIT REAL*8(A-H,O-Z) |
3077 | - COMMON/ RASET1 / RANU(97),RANC,RANCD,RANCM |
3078 | - COMMON/ RASET2 / IRANMR,JRANMR |
3079 | - SAVE /RASET1/,/RASET2/ |
3080 | -* This shows correspondence between the simplified input seeds IJ, KL |
3081 | -* and the original Marsaglia-Zaman seeds I,J,K,L. |
3082 | -* To get the standard values in the Marsaglia-Zaman paper (i=12,j=34 |
3083 | -* k=56,l=78) put ij=1802, kl=9373 |
3084 | - I = MOD( IJ/177 , 177 ) + 2 |
3085 | - J = MOD( IJ , 177 ) + 2 |
3086 | - K = MOD( KL/169 , 178 ) + 1 |
3087 | - L = MOD( KL , 169 ) |
3088 | - DO 300 II = 1 , 97 |
3089 | - S = 0D0 |
3090 | - T = .5D0 |
3091 | - DO 200 JJ = 1 , 24 |
3092 | - M = MOD( MOD(I*J,179)*K , 179 ) |
3093 | - I = J |
3094 | - J = K |
3095 | - K = M |
3096 | - L = MOD( 53*L+1 , 169 ) |
3097 | - IF(MOD(L*M,64) .GE. 32) S = S + T |
3098 | - T = .5D0*T |
3099 | - 200 CONTINUE |
3100 | - RANU(II) = S |
3101 | - 300 CONTINUE |
3102 | - RANC = 362436D0 / 16777216D0 |
3103 | - RANCD = 7654321D0 / 16777216D0 |
3104 | - RANCM = 16777213D0 / 16777216D0 |
3105 | - IRANMR = 97 |
3106 | - JRANMR = 33 |
3107 | - END |
3108 | - |
3109 | - |
3110 | - |
3111 | - |
3112 | - |
3113 | - |
3114 | |
3115 | === removed file 'Template/SubProcesses/check_intdip.f' |
3116 | --- Template/SubProcesses/check_intdip.f 2010-10-30 03:26:37 +0000 |
3117 | +++ Template/SubProcesses/check_intdip.f 1970-01-01 00:00:00 +0000 |
3118 | @@ -1,401 +0,0 @@ |
3119 | - PROGRAM checkintdip |
3120 | -C************************************************************************** |
3121 | -C This is a program for testing the integrated dipoles. For a couple of |
3122 | -C phase space points, chosen by RAMBO, it prints the the singular and |
3123 | -C finite terms for the given process. |
3124 | -C R.Frederix and N.Greiner - February 2010 |
3125 | -C************************************************************************** |
3126 | - IMPLICIT NONE |
3127 | -C |
3128 | -C CONSTANTS |
3129 | -C |
3130 | - REAL*8 ZERO |
3131 | - PARAMETER (ZERO=0D0) |
3132 | -C |
3133 | -C INCLUDE FILES |
3134 | -C |
3135 | -C--- the include file with the values of the parameters and masses |
3136 | - INCLUDE "coupl.inc" |
3137 | -C--- integer nexternal ! number particles (incoming+outgoing) in the me |
3138 | - INCLUDE "nexternal.inc" |
3139 | -C--- particle masses |
3140 | - REAL*8 PMASS(NEXTERNAL) |
3141 | -C--- integer n_max_cg |
3142 | - INCLUDE "ngraphs.inc" !how many diagrams (could be useful to know...) |
3143 | - INCLUDE "dipole.inc" |
3144 | - |
3145 | -C |
3146 | -C LOCAL |
3147 | -C |
3148 | - INTEGER I,J,K,l,m,l1,m1, number |
3149 | - REAL*8 P(0:3,NEXTERNAL) ! four momenta. Energy is the zeroth component. |
3150 | - REAL*8 SQRTS ! sqrt(s)= center of mass energy |
3151 | - REAL*8 ME,SUBTRACT,SUBTRACT2 ! Matrix Element and subtraction terms |
3152 | - real*8 start ! Starting value for invariants and the number of phase space points |
3153 | - logical cut ! Cut to prevent going into double limits |
3154 | - real*8 sum,x(2) |
3155 | - real*8 Z, eps,epssq, finite |
3156 | -C |
3157 | -C EXTERNAL |
3158 | -C |
3159 | - REAL*8 DOT |
3160 | - EXTERNAL DOT |
3161 | - |
3162 | -C----- |
3163 | -C BEGIN CODE |
3164 | -C----- |
3165 | -C |
3166 | -C--- INITIALIZATION CALLS |
3167 | -C |
3168 | -c--- Call to initialize the values of the couplings, masses and widths |
3169 | -c used in the evaluation of the matrix element. The primary parameters of the |
3170 | -c models are read from Cards/param_card.dat. The secondary parameters are calculated |
3171 | -c in Source/MODEL/couplings.f. The values are stored in common blocks that are listed |
3172 | -c in coupl.inc . |
3173 | - |
3174 | - call setpara('param_card.dat',.true.) !first call to setup the paramaters |
3175 | - include "pmass.inc" !set up masses |
3176 | - mu = 91.188d0 !renormalization scale |
3177 | - muf = 91.188d0 !factorization scale |
3178 | - |
3179 | - SQRTS=1000d0 !CMS energy in GEV |
3180 | - x(1)=1d0 !Bjorken x's |
3181 | - x(2)=1d0 |
3182 | - number=3 !Number of phase space points |
3183 | - |
3184 | -c For this check routine to work properly, |
3185 | -c the last parton should be a massless one |
3186 | - if (pmass(nexternal).ne.0d0) then |
3187 | - write (*,*) 'Error in process order:' |
3188 | - write (*,*) 'Please, change the order of the particles in the' |
3189 | - write (*,*) |
3190 | - & 'process such that the last one is a massless particle' |
3191 | - stop |
3192 | - endif |
3193 | - |
3194 | -c Loop over phase space points |
3195 | - do i=1,number |
3196 | - |
3197 | -c--- Now use a simple multipurpose PS generator (RAMBO) just to get a |
3198 | -c RANDOM set of four momenta of given masses pmass(i) to be used to evaluate |
3199 | -c the integrated dipoles. |
3200 | -c |
3201 | - CALL GET_INT_MOMENTA(SQRTS,PMASS,P,Z) |
3202 | - |
3203 | - CALL INTDIPOLES(P,X,Z,1d0,EPS,EPSSQ,FINITE) |
3204 | -c Note that for the intdipolesfinite the phase space point from |
3205 | -c Rambo is, in general not correct |
3206 | -c CALL INTDIPOLESFINITE(P,X,Z,1d0,EPS,EPSSQ,FINITE) |
3207 | - write (*,*) ' ' |
3208 | - write (*,*) 'PHASE SPACE POINT',i,':' |
3209 | - do j=1, nexternal-1 |
3210 | - write (*,*)' ',j, P(0,j), P(1,j), P(2,j), P(3,j) |
3211 | - enddo |
3212 | - write (*,*) ' Z =', Z |
3213 | - write (*,*) ' ' |
3214 | - write (*,*) ' 1/eps^2: ',epssq |
3215 | - write (*,*) ' 1/eps: ',eps |
3216 | - write (*,*) ' Finite: ',finite |
3217 | - write (*,*) ' ' |
3218 | - write (*,*) ' ' |
3219 | - enddo |
3220 | - |
3221 | - end |
3222 | - |
3223 | - |
3224 | - |
3225 | - SUBROUTINE GET_INT_MOMENTA(ENERGY,PMASS,P,Z) |
3226 | -C Provide four-momenta for integrated dipoles. |
3227 | - |
3228 | - IMPLICIT NONE |
3229 | - INCLUDE "nexternal.inc" |
3230 | -C ARGUMENTS |
3231 | - REAL*8 ENERGY,PMASS(NEXTERNAL),P(0:3,NEXTERNAL),PRAMBO(4,10),WGT,Z |
3232 | -C LOCAL |
3233 | - INTEGER I |
3234 | - |
3235 | - P(0,1)=energy/2 |
3236 | - P(1,1)=0d0 |
3237 | - P(2,1)=0d0 |
3238 | - P(3,1)=energy/2 |
3239 | - |
3240 | - P(0,2)=energy/2 |
3241 | - P(1,2)=0d0 |
3242 | - P(2,2)=0d0 |
3243 | - P(3,2)=-energy/2 |
3244 | - |
3245 | - call rambo_int(nexternal-3,energy,pmass(3),prambo,Z) |
3246 | - DO I=3, NEXTERNAL-1 |
3247 | - P(0,I)=PRAMBO(4,I-2) |
3248 | - P(1,I)=PRAMBO(1,I-2) |
3249 | - P(2,I)=PRAMBO(2,I-2) |
3250 | - P(3,I)=PRAMBO(3,I-2) |
3251 | - ENDDO |
3252 | - |
3253 | - P(0,nexternal)=0d0 |
3254 | - P(1,nexternal)=0d0 |
3255 | - P(2,nexternal)=0d0 |
3256 | - P(3,nexternal)=0d0 |
3257 | - |
3258 | - RETURN |
3259 | - END |
3260 | - |
3261 | - |
3262 | - |
3263 | - |
3264 | - double precision function dot(p1,p2) |
3265 | -C**************************************************************************** |
3266 | -C 4-Vector Dot product |
3267 | -C**************************************************************************** |
3268 | - implicit none |
3269 | - double precision p1(0:3),p2(0:3) |
3270 | - dot=p1(0)*p2(0)-p1(1)*p2(1)-p1(2)*p2(2)-p1(3)*p2(3) |
3271 | - end |
3272 | - |
3273 | - |
3274 | - SUBROUTINE RAMBO_INT(N,ET,XM,P,Zvar) |
3275 | -C Modified RAMBO suited for integrated dipoles |
3276 | -C R.Frederix and N.Greiner - February 2010 |
3277 | -*********************************************************************** |
3278 | -* RAMBO * |
3279 | -* RA(NDOM) M(OMENTA) B(EAUTIFULLY) O(RGANIZED) * |
3280 | -* * |
3281 | -* A DEMOCRATIC MULTI-PARTICLE PHASE SPACE GENERATOR * |
3282 | -* AUTHORS: S.D. ELLIS, R. KLEISS, W.J. STIRLING * |
3283 | -* THIS IS VERSION 1.0 - WRITTEN BY R. KLEISS * |
3284 | -* -- ADJUSTED BY HANS KUIJF, WEIGHTS ARE LOGARITHMIC (20-08-90) * |
3285 | -* * |
3286 | -* N = NUMBER OF PARTICLES * |
3287 | -* ET = TOTAL CENTRE-OF-MASS ENERGY * |
3288 | -* XM = PARTICLE MASSES ( DIM=NEXTERNAL-2 ) * |
3289 | -* P = PARTICLE MOMENTA ( DIM=(4,NEXTERNAL-2) ) * |
3290 | -* WT = WEIGHT OF THE EVENT * |
3291 | -*********************************************************************** |
3292 | - IMPLICIT REAL*8(A-H,O-Z) |
3293 | - INCLUDE "nexternal.inc" |
3294 | - DIMENSION XM(NEXTERNAL-2),P(4,NEXTERNAL-2) |
3295 | - DIMENSION Q(4,NEXTERNAL-2),Z(NEXTERNAL-2),R(4), |
3296 | - . B(3),P2(NEXTERNAL-2),XM2(NEXTERNAL-2), |
3297 | - . E(NEXTERNAL-2),V(NEXTERNAL-2),IWARN(5) |
3298 | - SAVE ACC,ITMAX,IBEGIN,IWARN |
3299 | - DATA ACC/1.D-14/,ITMAX/6/,IBEGIN/0/,IWARN/5*0/ |
3300 | -* |
3301 | -* INITIALIZATION STEP: FACTORIALS FOR THE PHASE SPACE WEIGHT |
3302 | - IF(IBEGIN.NE.0) GOTO 103 |
3303 | - IBEGIN=1 |
3304 | - TWOPI=8.*DATAN(1.D0) |
3305 | - PO2LOG=LOG(TWOPI/4.) |
3306 | - Z(2)=PO2LOG |
3307 | - DO 101 K=3,10 |
3308 | - 101 Z(K)=Z(K-1)+PO2LOG-2.*LOG(DFLOAT(K-2)) |
3309 | - DO 102 K=3,10 |
3310 | - 102 Z(K)=(Z(K)-LOG(DFLOAT(K-1))) |
3311 | -* |
3312 | -* CHECK ON THE NUMBER OF PARTICLES |
3313 | - 103 IF(N.GT.1.AND.N.LT.101) GOTO 104 |
3314 | - PRINT 1001,N |
3315 | - STOP |
3316 | -* |
3317 | -* CHECK WHETHER TOTAL ENERGY IS SUFFICIENT; COUNT NONZERO MASSES |
3318 | - 104 XMT=0. |
3319 | - NM=0 |
3320 | - DO 105 I=1,N |
3321 | - IF(XM(I).NE.0.D0) NM=NM+1 |
3322 | - 105 XMT=XMT+ABS(XM(I)) |
3323 | - IF(XMT.LE.ET) GOTO 201 |
3324 | - PRINT 1002,XMT,ET |
3325 | - STOP |
3326 | -* |
3327 | -* THE PARAMETER VALUES ARE NOW ACCEPTED |
3328 | -* |
3329 | -* GENERATE N MASSLESS MOMENTA IN INFINITE PHASE SPACE |
3330 | - 201 DO 202 I=1,N |
3331 | - r1=rn(1) |
3332 | - C=2.*r1-1. |
3333 | - S=SQRT(1.-C*C) |
3334 | - F=TWOPI*RN(2) |
3335 | - r1=rn(3) |
3336 | - r2=rn(4) |
3337 | - Q(4,I)=-LOG(r1*r2) |
3338 | - Q(3,I)=Q(4,I)*C |
3339 | - Q(2,I)=Q(4,I)*S*COS(F) |
3340 | - 202 Q(1,I)=Q(4,I)*S*SIN(F) |
3341 | - |
3342 | - Zvar=rn(1) |
3343 | -* |
3344 | -* CALCULATE THE PARAMETERS OF THE CONFORMAL TRANSFORMATION |
3345 | - DO 203 I=1,4 |
3346 | - 203 R(I)=0. |
3347 | - DO 204 I=1,N |
3348 | - DO 204 K=1,4 |
3349 | - 204 R(K)=R(K)+Q(K,I) |
3350 | - RMAS=SQRT(R(4)**2-R(3)**2-R(2)**2-R(1)**2) |
3351 | - DO 205 K=1,3 |
3352 | - 205 B(K)=-R(K)/RMAS |
3353 | - G=R(4)/RMAS |
3354 | - A=1./(1.+G) |
3355 | - X=ET/RMAS |
3356 | -* |
3357 | -* TRANSFORM THE Q'S CONFORMALLY INTO THE P'S |
3358 | - DO 207 I=1,N |
3359 | - BQ=B(1)*Q(1,I)+B(2)*Q(2,I)+B(3)*Q(3,I) |
3360 | - DO 206 K=1,3 |
3361 | - 206 P(K,I)=X*(Q(K,I)+B(K)*(Q(4,I)+A*BQ)) |
3362 | - 207 P(4,I)=X*(G*Q(4,I)+BQ) |
3363 | -* |
3364 | -* CALCULATE WEIGHT AND POSSIBLE WARNINGS |
3365 | - WT=PO2LOG |
3366 | - IF(N.NE.2) WT=(2.*N-4.)*LOG(ET)+Z(N) |
3367 | - IF(WT.GE.-180.D0) GOTO 208 |
3368 | - IF(IWARN(1).LE.5) PRINT 1004,WT |
3369 | - IWARN(1)=IWARN(1)+1 |
3370 | - 208 IF(WT.LE. 174.D0) GOTO 209 |
3371 | - IF(IWARN(2).LE.5) PRINT 1005,WT |
3372 | - IWARN(2)=IWARN(2)+1 |
3373 | -* |
3374 | -* RETURN FOR WEIGHTED MASSLESS MOMENTA |
3375 | - 209 IF(NM.NE.0) GOTO 210 |
3376 | -* RETURN LOG OF WEIGHT |
3377 | - WT=WT |
3378 | - RETURN |
3379 | -* |
3380 | -* MASSIVE PARTICLES: RESCALE THE MOMENTA BY A FACTOR X |
3381 | - 210 XMAX=SQRT(1.-(XMT/ET)**2) |
3382 | - DO 301 I=1,N |
3383 | - XM2(I)=XM(I)**2 |
3384 | - 301 P2(I)=P(4,I)**2 |
3385 | - ITER=0 |
3386 | - X=XMAX |
3387 | - ACCU=ET*ACC |
3388 | - 302 F0=-ET |
3389 | - G0=0. |
3390 | - X2=X*X |
3391 | - DO 303 I=1,N |
3392 | - E(I)=SQRT(XM2(I)+X2*P2(I)) |
3393 | - F0=F0+E(I) |
3394 | - 303 G0=G0+P2(I)/E(I) |
3395 | - IF(ABS(F0).LE.ACCU) GOTO 305 |
3396 | - ITER=ITER+1 |
3397 | - IF(ITER.LE.ITMAX) GOTO 304 |
3398 | - PRINT 1006,ITMAX |
3399 | - GOTO 305 |
3400 | - 304 X=X-F0/(X*G0) |
3401 | - GOTO 302 |
3402 | - 305 DO 307 I=1,N |
3403 | - V(I)=X*P(4,I) |
3404 | - DO 306 K=1,3 |
3405 | - 306 P(K,I)=X*P(K,I) |
3406 | - 307 P(4,I)=E(I) |
3407 | -* |
3408 | -* CALCULATE THE MASS-EFFECT WEIGHT FACTOR |
3409 | - WT2=1. |
3410 | - WT3=0. |
3411 | - DO 308 I=1,N |
3412 | - WT2=WT2*V(I)/E(I) |
3413 | - 308 WT3=WT3+V(I)**2/E(I) |
3414 | - WTM=(2.*N-3.)*LOG(X)+LOG(WT2/WT3*ET) |
3415 | -* |
3416 | -* RETURN FOR WEIGHTED MASSIVE MOMENTA |
3417 | - WT=WT+WTM |
3418 | - IF(WT.GE.-180.D0) GOTO 309 |
3419 | - IF(IWARN(3).LE.5) PRINT 1004,WT |
3420 | - IWARN(3)=IWARN(3)+1 |
3421 | - 309 IF(WT.LE. 174.D0) GOTO 310 |
3422 | - IF(IWARN(4).LE.5) PRINT 1005,WT |
3423 | - IWARN(4)=IWARN(4)+1 |
3424 | -* RETURN LOG OF WEIGHT |
3425 | - 310 WT=WT |
3426 | - RETURN |
3427 | -* |
3428 | - 1001 FORMAT(' RAMBO FAILS: # OF PARTICLES =',I5,' IS NOT ALLOWED') |
3429 | - 1002 FORMAT(' RAMBO FAILS: TOTAL MASS =',D15.6,' IS NOT', |
3430 | - . ' SMALLER THAN TOTAL ENERGY =',D15.6) |
3431 | - 1004 FORMAT(' RAMBO WARNS: WEIGHT = EXP(',F20.9,') MAY UNDERFLOW') |
3432 | - 1005 FORMAT(' RAMBO WARNS: WEIGHT = EXP(',F20.9,') MAY OVERFLOW') |
3433 | - 1006 FORMAT(' RAMBO WARNS:',I3,' ITERATIONS DID NOT GIVE THE', |
3434 | - . ' DESIRED ACCURACY =',D15.6) |
3435 | - END |
3436 | - |
3437 | - FUNCTION RN(IDUMMY) |
3438 | - REAL*8 RN,RAN |
3439 | - SAVE INIT |
3440 | - DATA INIT /1/ |
3441 | - IF (INIT.EQ.1) THEN |
3442 | - INIT=0 |
3443 | - CALL RMARIN(1802,9373) |
3444 | - END IF |
3445 | -* |
3446 | - 10 CALL RANMAR(RAN) |
3447 | - IF (RAN.LT.1D-16) GOTO 10 |
3448 | - RN=RAN |
3449 | -* |
3450 | - END |
3451 | - |
3452 | - |
3453 | - |
3454 | - SUBROUTINE RANMAR(RVEC) |
3455 | -* ----------------- |
3456 | -* Universal random number generator proposed by Marsaglia and Zaman |
3457 | -* in report FSU-SCRI-87-50 |
3458 | -* In this version RVEC is a double precision variable. |
3459 | - IMPLICIT REAL*8(A-H,O-Z) |
3460 | - COMMON/ RASET1 / RANU(97),RANC,RANCD,RANCM |
3461 | - COMMON/ RASET2 / IRANMR,JRANMR |
3462 | - SAVE /RASET1/,/RASET2/ |
3463 | - UNI = RANU(IRANMR) - RANU(JRANMR) |
3464 | - IF(UNI .LT. 0D0) UNI = UNI + 1D0 |
3465 | - RANU(IRANMR) = UNI |
3466 | - IRANMR = IRANMR - 1 |
3467 | - JRANMR = JRANMR - 1 |
3468 | - IF(IRANMR .EQ. 0) IRANMR = 97 |
3469 | - IF(JRANMR .EQ. 0) JRANMR = 97 |
3470 | - RANC = RANC - RANCD |
3471 | - IF(RANC .LT. 0D0) RANC = RANC + RANCM |
3472 | - UNI = UNI - RANC |
3473 | - IF(UNI .LT. 0D0) UNI = UNI + 1D0 |
3474 | - RVEC = UNI |
3475 | - END |
3476 | - |
3477 | - SUBROUTINE RMARIN(IJ,KL) |
3478 | -* ----------------- |
3479 | -* Initializing routine for RANMAR, must be called before generating |
3480 | -* any pseudorandom numbers with RANMAR. The input values should be in |
3481 | -* the ranges 0<=ij<=31328 ; 0<=kl<=30081 |
3482 | - IMPLICIT REAL*8(A-H,O-Z) |
3483 | - COMMON/ RASET1 / RANU(97),RANC,RANCD,RANCM |
3484 | - COMMON/ RASET2 / IRANMR,JRANMR |
3485 | - SAVE /RASET1/,/RASET2/ |
3486 | -* This shows correspondence between the simplified input seeds IJ, KL |
3487 | -* and the original Marsaglia-Zaman seeds I,J,K,L. |
3488 | -* To get the standard values in the Marsaglia-Zaman paper (i=12,j=34 |
3489 | -* k=56,l=78) put ij=1802, kl=9373 |
3490 | - I = MOD( IJ/177 , 177 ) + 2 |
3491 | - J = MOD( IJ , 177 ) + 2 |
3492 | - K = MOD( KL/169 , 178 ) + 1 |
3493 | - L = MOD( KL , 169 ) |
3494 | - DO 300 II = 1 , 97 |
3495 | - S = 0D0 |
3496 | - T = .5D0 |
3497 | - DO 200 JJ = 1 , 24 |
3498 | - M = MOD( MOD(I*J,179)*K , 179 ) |
3499 | - I = J |
3500 | - J = K |
3501 | - K = M |
3502 | - L = MOD( 53*L+1 , 169 ) |
3503 | - IF(MOD(L*M,64) .GE. 32) S = S + T |
3504 | - T = .5D0*T |
3505 | - 200 CONTINUE |
3506 | - RANU(II) = S |
3507 | - 300 CONTINUE |
3508 | - RANC = 362436D0 / 16777216D0 |
3509 | - RANCD = 7654321D0 / 16777216D0 |
3510 | - RANCM = 16777213D0 / 16777216D0 |
3511 | - IRANMR = 97 |
3512 | - JRANMR = 33 |
3513 | - END |
3514 | - |
3515 | - |
3516 | - |
3517 | - |
3518 | - |
3519 | - |
3520 | |
3521 | === modified file 'Template/SubProcesses/cuts.f' |
3522 | --- Template/SubProcesses/cuts.f 2011-09-16 05:33:32 +0000 |
3523 | +++ Template/SubProcesses/cuts.f 2012-02-04 00:00:25 +0000 |
3524 | @@ -53,7 +53,7 @@ |
3525 | LOGICAL DEBUG |
3526 | integer i,j,njets,nheavyjets,hardj1,hardj2 |
3527 | REAL*8 XVAR,ptmax1,ptmax2,htj,tmp,inclht |
3528 | - real*8 ptemp(0:3) |
3529 | + real*8 ptemp(0:3), ptemp2(0:3) |
3530 | character*20 formstr |
3531 | C |
3532 | C PARAMETERS |
3533 | @@ -207,7 +207,7 @@ |
3534 | |
3535 | if(fixed_ren_scale) then |
3536 | G = SQRT(4d0*PI*ALPHAS(scale)) |
3537 | - call setpara('param_card.dat',.false.) |
3538 | + call update_as_param() |
3539 | endif |
3540 | |
3541 | c Put momenta in the common block to zero to start |
3542 | @@ -262,12 +262,13 @@ |
3543 | endif |
3544 | enddo |
3545 | c |
3546 | -c missing ET min & max cut |
3547 | -c nb: missing et simply defined as the sum over the neutrino's 4 momenta |
3548 | +c missing ET min & max cut + Invariant mass of leptons and neutrino |
3549 | +c nb: missing Et defined as the vector sum over the neutrino's pt |
3550 | c |
3551 | c-- reset ptemp(0:3) |
3552 | do j=0,3 |
3553 | - ptemp(j)=0 |
3554 | + ptemp(j)=0 ! for the neutrino |
3555 | + ptemp2(j)=0 ! for the leptons |
3556 | enddo |
3557 | c- sum over the momenta |
3558 | do i=nincoming+1,nexternal |
3559 | @@ -276,11 +277,19 @@ |
3560 | do j=0,3 |
3561 | ptemp(j)=ptemp(j)+p(j,i) |
3562 | enddo |
3563 | + elseif(is_a_l(i)) then |
3564 | + if(debug) write (*,*) i,' -> lepton ' |
3565 | + do j=0,3 |
3566 | + ptemp2(j)=ptemp2(j)+p(j,i) |
3567 | + enddo |
3568 | endif |
3569 | + |
3570 | enddo |
3571 | c- check the et |
3572 | if(debug.and.ptemp(0).eq.0d0) write (*,*) 'No et miss in event' |
3573 | if(debug.and.ptemp(0).gt.0d0) write (*,*) 'Et miss =',pt(ptemp(0)),' ',misset,':',missetmax |
3574 | + if(debug.and.ptemp2(0).eq.0d0) write (*,*) 'No leptons in event' |
3575 | + if(debug.and.ptemp(0).gt.0d0) write (*,*) 'Energy of leptons =',pt(ptemp2(0)) |
3576 | if(ptemp(0).gt.0d0) then |
3577 | notgood=(pt(ptemp(0)) .lt. misset).or. |
3578 | & (pt(ptemp(0)) .gt. missetmax) |
3579 | @@ -290,6 +299,13 @@ |
3580 | return |
3581 | endif |
3582 | endif |
3583 | + if (mmnl.gt.0d0.or.mmnlmax.lt.1d5)then |
3584 | + if(dsqrt(SumDot(ptemp,ptemp2,1d0)).lt.mmnl.or.dsqrt(SumDot(ptemp, ptemp2,1d0)).gt.mmnlmax) then |
3585 | + if(debug) write (*,*) 'lepton invariant mass -> fails' |
3586 | + passcuts=.false. |
3587 | + return |
3588 | + endif |
3589 | + endif |
3590 | c |
3591 | c pt cut on heavy particles |
3592 | c gives min(pt) for (at least) one heavy particle |
3593 | @@ -680,7 +696,7 @@ |
3594 | enddo |
3595 | enddo |
3596 | endif |
3597 | - call setpara('param_card.dat',.false.) |
3598 | + call update_as_param() |
3599 | endif |
3600 | |
3601 | IF (FIRSTTIME2) THEN |
3602 | |
3603 | === removed file 'Template/SubProcesses/driver.f' |
3604 | --- Template/SubProcesses/driver.f 2011-04-26 18:45:41 +0000 |
3605 | +++ Template/SubProcesses/driver.f 1970-01-01 00:00:00 +0000 |
3606 | @@ -1,289 +0,0 @@ |
3607 | - Program DRIVER |
3608 | -c************************************************************************** |
3609 | -c This is the driver for the whole calulation |
3610 | -c************************************************************************** |
3611 | - implicit none |
3612 | -C |
3613 | -C CONSTANTS |
3614 | -C |
3615 | - double precision zero |
3616 | - parameter (ZERO = 0d0) |
3617 | - include 'genps.inc' |
3618 | - include 'maxconfigs.inc' |
3619 | - include 'nexternal.inc' |
3620 | - INTEGER ITMAX, NCALL |
3621 | -C |
3622 | -C LOCAL |
3623 | -C |
3624 | - integer i,ninvar,nconfigs,j,l,l1,l2,ndim |
3625 | - double precision dsig,tot,mean,sigma |
3626 | - integer npoints,lunsud |
3627 | - double precision x,y,jac,s1,s2,xmin |
3628 | - external dsig |
3629 | - character*130 buf |
3630 | - integer NextUnopen |
3631 | - external NextUnopen |
3632 | -c |
3633 | -c Global |
3634 | -c |
3635 | - integer nsteps |
3636 | - character*40 result_file,where_file |
3637 | - common /sample_status/result_file,where_file,nsteps |
3638 | - integer Minvar(maxdim,lmaxconfigs) |
3639 | - common /to_invar/ Minvar |
3640 | - integer ngroup |
3641 | - common/to_group/ngroup |
3642 | - data ngroup/0/ |
3643 | -cc |
3644 | - include 'run.inc' |
3645 | - |
3646 | - integer mincfig, maxcfig |
3647 | - common/to_configs/mincfig, maxcfig |
3648 | - |
3649 | - |
3650 | - double precision twgt, maxwgt,swgt(maxevents) |
3651 | - integer lun, nw |
3652 | - common/to_unwgt/twgt, maxwgt, swgt, lun, nw |
3653 | - |
3654 | -c--masses |
3655 | - double precision pmass(nexternal) |
3656 | - common/to_mass/ pmass |
3657 | - double precision qmass(2) |
3658 | - common/to_qmass/ qmass |
3659 | - |
3660 | -c $B$ new_def $E$ this is a tag for MadWeigth, Don't edit this line |
3661 | - |
3662 | -c double precision xsec,xerr |
3663 | -c integer ncols,ncolflow(maxamps),ncolalt(maxamps),ic |
3664 | -c common/to_colstats/ncols,ncolflow,ncolalt,ic |
3665 | - |
3666 | - include 'coupl.inc' |
3667 | - |
3668 | -C----- |
3669 | -C BEGIN CODE |
3670 | -C----- |
3671 | -c |
3672 | -c Read process number |
3673 | -c |
3674 | - open (unit=lun+1,file='../dname.mg',status='unknown',err=11) |
3675 | - read (lun+1,'(a130)',err=11,end=11) buf |
3676 | - l1=index(buf,'P') |
3677 | - l2=index(buf,'_') |
3678 | - if(l1.ne.0.and.l2.ne.0.and.l1.lt.l2-1) |
3679 | - $ read(buf(l1+1:l2-1),*,err=11) ngroup |
3680 | - 11 print *,'Process in group number ',ngroup |
3681 | - |
3682 | - lun = 27 |
3683 | - twgt = -2d0 !determine wgt after first iteration |
3684 | - open(unit=lun,status='scratch') |
3685 | - nsteps=2 |
3686 | - call setrun !Sets up run parameters |
3687 | -c $B$ setpara $B$ ! this is a tag for MadWeight. Don't edit this line |
3688 | - call setpara('param_card.dat',.true.) !Sets up couplings and masses |
3689 | -c $E$ setpara $E$ ! this is a tag for MadWeight. Don't edit this line |
3690 | - include 'pmass.inc' !Sets up particle masses |
3691 | - include 'qmass.inc' !Sets up particle masses inside onium state |
3692 | - call setcuts !Sets up cuts |
3693 | - call printout !Prints out a summary of paramaters |
3694 | - call run_printout !Prints out a summary of the run settings |
3695 | - nconfigs = 1 |
3696 | - |
3697 | -c If CKKW-type matching, read IS Sudakov grid |
3698 | - if(ickkw.eq.2 .and. (lpp(1).ne.0.or.lpp(2).ne.0))then |
3699 | - lunsud=NextUnopen() |
3700 | - open(unit=lunsud,file=issgridfile,status='old',ERR=20) |
3701 | - goto 40 |
3702 | - 20 issgridfile='lib/'//issgridfile |
3703 | - do i=1,5 |
3704 | - open(unit=lunsud,file=issgridfile,status='old',ERR=30) |
3705 | - exit |
3706 | - 30 issgridfile='../'//issgridfile |
3707 | - if(i.eq.5)then |
3708 | - print *,'ERROR: No Sudakov grid file found in lib with ickkw=2' |
3709 | - stop |
3710 | - endif |
3711 | - enddo |
3712 | - print *,'Reading Sudakov grid file ',issgridfile |
3713 | - 40 call readgrid(lunsud) |
3714 | - print *,'Done reading IS Sudakovs' |
3715 | - endif |
3716 | - |
3717 | - if(ickkw.eq.2)then |
3718 | - hmult=.false. |
3719 | - if(ngroup.ge.nhmult) hmult=.true. |
3720 | - if(hmult)then |
3721 | - print *,'Running CKKW as highest mult sample' |
3722 | - else |
3723 | - print *,'Running CKKW as lower mult sample' |
3724 | - endif |
3725 | - endif |
3726 | - |
3727 | -c |
3728 | -c Get user input |
3729 | -c |
3730 | - write(*,*) "getting user params" |
3731 | - call get_user_params(ncall,itmax,mincfig) |
3732 | - maxcfig=mincfig |
3733 | - minvar(1,1) = 0 !This tells it to map things invarients |
3734 | - write(*,*) 'Attempting mappinvarients',nconfigs,nexternal |
3735 | - call map_invarients(minvar,nconfigs,ninvar,mincfig,maxcfig,nexternal,nincoming) |
3736 | - write(*,*) "Completed mapping",nexternal |
3737 | - ndim = 3*(nexternal-2)-4 |
3738 | - if (abs(lpp(1)) .ge. 1) ndim=ndim+1 |
3739 | - if (abs(lpp(2)) .ge. 1) ndim=ndim+1 |
3740 | - ninvar = ndim |
3741 | - do j=mincfig,maxcfig |
3742 | - if (abs(lpp(1)) .ge. 1 .and. abs(lpp(1)) .ge. 1) then |
3743 | - minvar(ndim-1,j)=ninvar-1 |
3744 | - minvar(ndim,j) = ninvar |
3745 | - elseif (abs(lpp(1)) .ge. 1 .or. abs(lpp(1)) .ge. 1) then |
3746 | - minvar(ndim,j) = ninvar |
3747 | - endif |
3748 | - enddo |
3749 | - write(*,*) "about to integrate ", ndim,ncall,itmax,ninvar,nconfigs |
3750 | - call sample_full(ndim,ncall,itmax,dsig,ninvar,nconfigs) |
3751 | -c |
3752 | -c Now write out events to permanent file |
3753 | -c |
3754 | - if (twgt .gt. 0d0) maxwgt=maxwgt/twgt |
3755 | - write(lun,'(a,f20.5)') 'Summary', maxwgt |
3756 | - |
3757 | -c call store_events |
3758 | - |
3759 | -c write(*,'(a34,20I7)'),'Color flows originally chosen: ', |
3760 | -c & (ncolflow(i),i=1,ncols) |
3761 | -c write(*,'(a34,20I7)'),'Color flows according to diagram:', |
3762 | -c & (ncolalt(i),i=1,ncols) |
3763 | -c |
3764 | -c call sample_result(xsec,xerr) |
3765 | -c write(*,*) 'Final xsec: ',xsec |
3766 | - |
3767 | - rewind(lun) |
3768 | - |
3769 | - close(lun) |
3770 | - end |
3771 | - |
3772 | -c $B$ get_user_params $B$ ! tag for MadWeight |
3773 | -c change this routine to read the input in a file |
3774 | -c |
3775 | - subroutine get_user_params(ncall,itmax,iconfig) |
3776 | -c********************************************************************** |
3777 | -c Routine to get user specified parameters for run |
3778 | -c********************************************************************** |
3779 | - implicit none |
3780 | -c |
3781 | -c Constants |
3782 | -c |
3783 | - include 'nexternal.inc' |
3784 | - include 'maxparticles.inc' |
3785 | -c |
3786 | -c Arguments |
3787 | -c |
3788 | - integer ncall,itmax,iconfig |
3789 | -c |
3790 | -c Local |
3791 | -c |
3792 | - integer i, j, jconfig, ncode |
3793 | - double precision dconfig |
3794 | -c |
3795 | -c Global |
3796 | -c |
3797 | - integer isum_hel |
3798 | - logical multi_channel |
3799 | - common/to_matrix/isum_hel, multi_channel |
3800 | - double precision accur |
3801 | - common /to_accuracy/accur |
3802 | - integer use_cut |
3803 | - common /to_weight/use_cut |
3804 | - |
3805 | - integer lbw(0:nexternal) !Use of B.W. |
3806 | - common /to_BW/ lbw |
3807 | - |
3808 | -c----- |
3809 | -c Begin Code |
3810 | -c----- |
3811 | - write(*,'(a)') 'Enter number of events and iterations: ' |
3812 | - read(*,*) ncall,itmax |
3813 | - write(*,*) 'Number of events and iterations ',ncall,itmax |
3814 | - write(*,'(a)') 'Enter desired fractional accuracy: ' |
3815 | - read(*,*) accur |
3816 | - write(*,*) 'Desired fractional accuracy: ',accur |
3817 | - |
3818 | - write(*,'(a)') 'Enter 0 for fixed, 2 for adjustable grid: ' |
3819 | - read(*,*) use_cut |
3820 | - if (use_cut .lt. 0 .or. use_cut .gt. 2) then |
3821 | - write(*,*) 'Bad choice, using 2',use_cut |
3822 | - use_cut = 2 |
3823 | - endif |
3824 | - |
3825 | - write(*,10) 'Suppress amplitude (0 no, 1 yes)? ' |
3826 | - read(*,*) i |
3827 | - if (i .eq. 1) then |
3828 | - multi_channel = .true. |
3829 | - write(*,*) 'Using suppressed amplitude.' |
3830 | - else |
3831 | - multi_channel = .false. |
3832 | - write(*,*) 'Using full amplitude.' |
3833 | - endif |
3834 | - |
3835 | - write(*,10) 'Exact helicity sum (0 yes, n = number/event)? ' |
3836 | - read(*,*) i |
3837 | - if (i .eq. 0) then |
3838 | - isum_hel = 0 |
3839 | - write(*,*) 'Explicitly summing over helicities' |
3840 | - else |
3841 | - isum_hel= i |
3842 | - write(*,*) 'Summing over',i,' helicities/event' |
3843 | - endif |
3844 | - |
3845 | - write(*,10) 'Enter Configuration Number: ' |
3846 | - read(*,*) dconfig |
3847 | -c ncode is number of digits needed for the BW code |
3848 | - ncode=int(dlog10(3d0)*(max_particles-3))+1 |
3849 | - iconfig = int(dconfig*(1+10**(-ncode))) |
3850 | - write(*,12) 'Running Configuration Number: ',iconfig |
3851 | -c |
3852 | -c Here I want to set up with B.W. we map and which we don't |
3853 | -c |
3854 | - dconfig = dconfig-iconfig |
3855 | - if (dconfig .eq. 0) then |
3856 | - write(*,*) 'Not subdividing B.W.' |
3857 | - lbw(0)=0 |
3858 | - else |
3859 | - lbw(0)=1 |
3860 | - jconfig=dconfig*(10**ncode + 0.1) |
3861 | - write(*,*) 'Using dconfig=',jconfig |
3862 | - call DeCode(jconfig,lbw(1),3,nexternal) |
3863 | - write(*,*) 'BW Setting ', (lbw(j),j=1,nexternal-2) |
3864 | -c do i=nexternal-3,0,-1 |
3865 | -c if (jconfig .ge. 2**i) then |
3866 | -c lbw(i+1)=1 |
3867 | -c jconfig=jconfig-2**i |
3868 | -c else |
3869 | -c lbw(i+1)=0 |
3870 | -c endif |
3871 | -c write(*,*) i+1, lbw(i+1) |
3872 | -c enddo |
3873 | - endif |
3874 | - 10 format( a) |
3875 | - 12 format( a,i4) |
3876 | - end |
3877 | -c $E$ get_user_params $E$ ! tag for MadWeight |
3878 | -c change this routine to read the input in a file |
3879 | -c |
3880 | - |
3881 | - |
3882 | - |
3883 | - |
3884 | - |
3885 | - |
3886 | - |
3887 | - |
3888 | - |
3889 | - |
3890 | - |
3891 | - |
3892 | - |
3893 | - |
3894 | - |
3895 | - |
3896 | |
3897 | === modified file 'Template/SubProcesses/reweight.f' |
3898 | --- Template/SubProcesses/reweight.f 2011-10-05 03:10:17 +0000 |
3899 | +++ Template/SubProcesses/reweight.f 2012-02-04 00:00:25 +0000 |
3900 | @@ -723,6 +723,9 @@ |
3901 | integer ISPROC |
3902 | DOUBLE PRECISION PD(0:MAXPROC) |
3903 | COMMON /SubProc/ PD, ISPROC |
3904 | + INTEGER SUBDIAG(MAXSPROC),IB(2) |
3905 | + COMMON/TO_SUB_DIAG/SUBDIAG,IB |
3906 | + data IB/1,2/ |
3907 | c q2bck holds the central q2fact scales |
3908 | real*8 q2bck(2) |
3909 | common /to_q2bck/q2bck |
3910 | @@ -758,12 +761,6 @@ |
3911 | external alphas, isjetvx, getissud, pdg2pdf, xran1, sudwgt |
3912 | |
3913 | rewgt=1.0d0 |
3914 | - |
3915 | - if((ickkw.gt.0.or..not.fixed_fac_scale.or..not.fixed_ren_scale) |
3916 | - $ .and..not.clustered)then |
3917 | - write(*,*)'Error: No clustering done when calling rewgt!' |
3918 | - stop |
3919 | - endif |
3920 | clustered=.false. |
3921 | |
3922 | if(ickkw.le.0) return |
3923 | @@ -831,7 +828,7 @@ |
3924 | endif |
3925 | c Set x values for the two sides, for IS Sudakovs |
3926 | do i=1,2 |
3927 | - xnow(i)=xbk(i) |
3928 | + xnow(i)=xbk(ib(i)) |
3929 | enddo |
3930 | if(btest(mlevel,3))then |
3931 | write(*,*) 'Set x values to ',xnow(1),xnow(2) |
3932 | @@ -1005,11 +1002,12 @@ |
3933 | $ ' to: ',sqrt(pt2pdf(imocl(n))) |
3934 | else if(pt2pdf(idacl(n,i)).lt.q2now |
3935 | $ .and.isjet(ipdgcl(idacl(n,i),igraphs(1),iproc))) then |
3936 | - pdfj1=pdg2pdf(abs(ibeam(j)),ipdgcl(idacl(n,i), |
3937 | - $ igraphs(1),iproc)*sign(1,ibeam(j)),xnow(j),sqrt(q2now)) |
3938 | - pdfj2=pdg2pdf(abs(ibeam(j)),ipdgcl(idacl(n,i), |
3939 | - $ igraphs(1),iproc)*sign(1,ibeam(j)),xnow(j), |
3940 | - $ sqrt(pt2pdf(idacl(n,i)))) |
3941 | + pdfj1=pdg2pdf(abs(lpp(IB(j))),ipdgcl(idacl(n,i), |
3942 | + $ igraphs(1),iproc)*sign(1,lpp(IB(j))), |
3943 | + $ xnow(j),sqrt(q2now)) |
3944 | + pdfj2=pdg2pdf(abs(lpp(IB(j))),ipdgcl(idacl(n,i), |
3945 | + $ igraphs(1),iproc)*sign(1,lpp(IB(j))), |
3946 | + $ xnow(j),sqrt(pt2pdf(idacl(n,i)))) |
3947 | if(pdfj2.lt.1d-10)then |
3948 | c Scale too low for heavy quark |
3949 | rewgt=0d0 |
3950 | @@ -1026,12 +1024,12 @@ |
3951 | write(*,*)' PDF: ',pdfj1,' / ',pdfj2 |
3952 | write(*,*)' -> rewgt: ',rewgt |
3953 | c write(*,*)' (compare for glue: ', |
3954 | -c $ pdg2pdf(ibeam(j),21,xbk(j),sqrt(pt2pdf(idacl(n,i)))),' / ', |
3955 | -c $ pdg2pdf(ibeam(j),21,xbk(j),sqrt(pt2ijcl(n))) |
3956 | +c $ pdg2pdf(lpp(j),21,xbk(j),sqrt(pt2pdf(idacl(n,i)))),' / ', |
3957 | +c $ pdg2pdf(lpp(j),21,xbk(j),sqrt(pt2ijcl(n))) |
3958 | c write(*,*)' = ',pdg2pdf(ibeam(j),21,xbk(j),sqrt(pt2pdf(idacl(n,i))))/ |
3959 | -c $ pdg2pdf(ibeam(j),21,xbk(j),sqrt(pt2ijcl(n))) |
3960 | +c $ pdg2pdf(lpp(j),21,xbk(j),sqrt(pt2ijcl(n))) |
3961 | c write(*,*)' -> ',pdg2pdf(ibeam(j),21,xbk(j),sqrt(pt2pdf(idacl(n,i))))/ |
3962 | -c $ pdg2pdf(ibeam(j),21,xbk(j),sqrt(pt2ijcl(n)))*rewgt,' )' |
3963 | +c $ pdg2pdf(lpp(j),21,xbk(j),sqrt(pt2ijcl(n)))*rewgt,' )' |
3964 | endif |
3965 | c Set scale for mother as this scale |
3966 | pt2pdf(imocl(n))=q2now |
3967 | |
3968 | === modified file 'Template/SubProcesses/unwgt.f' |
3969 | --- Template/SubProcesses/unwgt.f 2011-10-03 08:39:00 +0000 |
3970 | +++ Template/SubProcesses/unwgt.f 2012-02-04 00:00:25 +0000 |
3971 | @@ -27,8 +27,8 @@ |
3972 | C GLOBAL |
3973 | C |
3974 | double precision twgt, maxwgt,swgt(maxevents) |
3975 | - integer lun, nw |
3976 | - common/to_unwgt/twgt, maxwgt, swgt, lun, nw |
3977 | + integer lun, nw, itmin |
3978 | + common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin |
3979 | integer nzoom |
3980 | double precision tx(1:3,maxinvar) |
3981 | common/to_xpoints/tx, nzoom |
3982 | @@ -126,8 +126,8 @@ |
3983 | C GLOBAL |
3984 | C |
3985 | double precision twgt, maxwgt,swgt(maxevents) |
3986 | - integer lun, nw |
3987 | - common/to_unwgt/twgt, maxwgt, swgt, lun, nw |
3988 | + integer lun, nw, itmin |
3989 | + common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin |
3990 | |
3991 | c----- |
3992 | c Begin Code |
3993 | @@ -163,8 +163,8 @@ |
3994 | C GLOBAL |
3995 | C |
3996 | double precision twgt, maxwgt,swgt(maxevents) |
3997 | - integer lun, nw |
3998 | - common/to_unwgt/twgt, maxwgt, swgt, lun, nw |
3999 | + integer lun, nw, itmin |
4000 | + common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin |
4001 | |
4002 | double precision matrix |
4003 | common/to_maxmatrix/matrix |
4004 | @@ -245,8 +245,8 @@ |
4005 | C GLOBAL |
4006 | C |
4007 | double precision twgt, maxwgt,swgt(maxevents) |
4008 | - integer lun, nw |
4009 | - common/to_unwgt/twgt, maxwgt, swgt, lun, nw |
4010 | + integer lun, nw, itmin |
4011 | + common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin |
4012 | |
4013 | integer neventswritten |
4014 | common /to_eventswritten/ neventswritten |
4015 | @@ -269,7 +269,7 @@ |
4016 | c First scale all of the events to the total cross section |
4017 | c |
4018 | if (nw .le. 0) return |
4019 | - call sample_result(xsec,xerr) |
4020 | + call sample_result(xsec,xerr,itmin) |
4021 | if (xsec .le. 0) return !Fix by TS 12/3/2010 |
4022 | xtot=0 |
4023 | call dsort(nw, swgt) |
4024 | @@ -403,8 +403,8 @@ |
4025 | C GLOBAL |
4026 | C |
4027 | double precision twgt, maxwgt,swgt(maxevents) |
4028 | - integer lun, nw |
4029 | - common/to_unwgt/twgt, maxwgt, swgt, lun, nw |
4030 | + integer lun, nw, itmin |
4031 | + common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin |
4032 | |
4033 | integer IPROC |
4034 | DOUBLE PRECISION PD(0:MAXPROC) |
4035 | @@ -596,8 +596,8 @@ |
4036 | C GLOBAL |
4037 | C |
4038 | double precision twgt, maxwgt,swgt(maxevents) |
4039 | - integer lun, nw |
4040 | - common/to_unwgt/twgt, maxwgt, swgt, lun, nw |
4041 | + integer lun, nw, itmin |
4042 | + common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin |
4043 | c----- |
4044 | c Begin Code |
4045 | c----- |
4046 | |
4047 | === removed file 'Template/bin/TheChopper-pl' |
4048 | --- Template/bin/TheChopper-pl 2010-10-30 03:26:37 +0000 |
4049 | +++ Template/bin/TheChopper-pl 1970-01-01 00:00:00 +0000 |
4050 | @@ -1,118 +0,0 @@ |
4051 | -#!/usr/bin/perl -w |
4052 | -#------------------------------------------------------------ |
4053 | -# Simple script to chop out sub-processes which have a small |
4054 | -# impact on the cross section, in the grid pack. |
4055 | -# This is meant to be run after the gridpack warming up run |
4056 | -# and before packing it up. |
4057 | -# |
4058 | -# The script should be run from the main directory of madevent |
4059 | -# and sits in the bin directory. |
4060 | -# |
4061 | -# This is still version 0, where no classes can be defined. |
4062 | -# However, the result is a script, chop_procs sitting in |
4063 | -# SubProcesses, that can be edited by hand. |
4064 | -# |
4065 | -# Author: Fabio Maltoni |
4066 | -# Date: 10/4/08 |
4067 | -# Version: 0.1 |
4068 | -# |
4069 | -# HISTORY |
4070 | -# |
4071 | -# 0.2 Fix bug in writing subproc.mg |
4072 | -# |
4073 | -# 0.1 Added the possibility to list SubProc IDs |
4074 | -# |
4075 | -# 0.0 Original |
4076 | -# |
4077 | -#------------------------------------------------------------ |
4078 | - |
4079 | -#------------------------------------------------------------ |
4080 | -# Auxiliary Ordering function |
4081 | -#------------------------------------------------------------ |
4082 | - |
4083 | - sub OrderInc { |
4084 | - $all{$a} <=> $all{$b}; |
4085 | - }; |
4086 | - |
4087 | -#------------------------------------------------------------ |
4088 | -# Input the chopping value. Example : 0.01 = 1% |
4089 | -#------------------------------------------------------------ |
4090 | - |
4091 | - print "input chopping off value (e.g., 0.01=1% ):\n"; |
4092 | - $cutoff_lim=<STDIN>; |
4093 | - |
4094 | -#------------------------------------------------------------ |
4095 | -# Input the SubProcesses ids on which the script should run |
4096 | -#------------------------------------------------------------ |
4097 | - |
4098 | - print "Input SubProcesses ids to process (space separated):\n"; |
4099 | - @id_list=split('\s+',<STDIN>); |
4100 | - |
4101 | - |
4102 | -#------------------------------------------------------------ |
4103 | -# Parse the form, look for known variables |
4104 | -#------------------------------------------------------------ |
4105 | - |
4106 | - |
4107 | - |
4108 | - chdir("SubProcesses"); |
4109 | - open(SCRIPT,">chop_procs") or die "Could not write chop_procs \n"; |
4110 | - |
4111 | - foreach $id (@id_list) { |
4112 | - |
4113 | - print "\n\nNow processing SubProcesses with ID = $id\n"; |
4114 | - |
4115 | - my @all_Pdirs = <P$id*>; |
4116 | - my $xsec = 0; |
4117 | - my $perc = 0; |
4118 | - %all = (); |
4119 | - %below = (); |
4120 | - |
4121 | - foreach $arg (@all_Pdirs) { |
4122 | - chdir("$arg"); |
4123 | - open(RES,"<default_results.dat") or die "Could not read default_results.dat\n"; |
4124 | - my $buff; |
4125 | - my $number_read = read(RES,$buff,12); |
4126 | - print "$arg has xsec $buff\n"; |
4127 | - $all{$arg} .= $buff; |
4128 | - $xsec = $xsec + $buff; |
4129 | - close(RES); |
4130 | - chdir(".."); |
4131 | - }; |
4132 | - |
4133 | - print " total xsec for ID = $id : $xsec\n"; |
4134 | - $cutoff=$cutoff_lim*$xsec; |
4135 | - print " cutoff for ID = $id : $cutoff \n"; |
4136 | - |
4137 | - |
4138 | -# now I have to order them and find those procs with fall |
4139 | -# below xsec*cutoff. |
4140 | - |
4141 | - $i=0; |
4142 | - $integ[0]=0; |
4143 | - print "Processes in order FOR ID = $id:\n"; |
4144 | - foreach $key (sort OrderInc (keys(%all))) { |
4145 | - $integ[$i+1] = $integ[$i] + $all{$key}; |
4146 | - if($integ[$i+1] < $cutoff) { |
4147 | - $below{$key} .= $all{$key}; |
4148 | - print "$integ[$i+1] : $all{$key} $key => below cutoff\n";} |
4149 | - else { |
4150 | - print "$integ[$i+1] : $all{$key} $key => above cutoff\n";} |
4151 | - $i =$i + 1; |
4152 | -}; |
4153 | -# |
4154 | -# Now I move the corresponding procs out of the way |
4155 | -# |
4156 | - print "The following SubProcess will be tagged to be removed:\n"; |
4157 | - foreach $key (keys(%below)){ |
4158 | - print "$key "; |
4159 | - print SCRIPT "mv $key XXX$key \# $below{$key}\n"; |
4160 | -# system("mv $key XXX$key "); |
4161 | - }; |
4162 | -# print SCRIPT "ls -d P$id* >subproc.mg\n"; |
4163 | -# system("ls -d P* >subproc.mg"); |
4164 | - } |
4165 | - print SCRIPT "ls -d P* >subproc.mg"; |
4166 | - close(SCRIPT); |
4167 | - system("chmod +x chop_procs"); |
4168 | - |
4169 | |
4170 | === removed file 'Template/bin/addmasses.py' |
4171 | --- Template/bin/addmasses.py 2010-10-30 03:26:37 +0000 |
4172 | +++ Template/bin/addmasses.py 1970-01-01 00:00:00 +0000 |
4173 | @@ -1,320 +0,0 @@ |
4174 | -#!/usr/bin/python |
4175 | -# |
4176 | -# doubleswitch.py |
4177 | -# Author: Stephen Mrenna |
4178 | -# Add masses to charged leptons, fix kinematics |
4179 | -# Insert W/Z when missing |
4180 | - |
4181 | -import math,sys,re |
4182 | -from xml.dom import minidom |
4183 | - |
4184 | -#tolerance for energy momentum conservation |
4185 | -toler = 1e-4 |
4186 | -#lepton masses from PDGLive |
4187 | -massDict = {} |
4188 | -massDict[11]=0.000510998910 |
4189 | -massDict[-11]=massDict[11] |
4190 | -massDict[13]=105.6583668e-3 |
4191 | -massDict[-13]=massDict[13] |
4192 | -massDict[15]=1.77684 |
4193 | -massDict[-15]=massDict[15] |
4194 | - |
4195 | -#print out messages if true |
4196 | -verbose=0 |
4197 | - |
4198 | -#default is NOT to insert missing mothers |
4199 | -motherFlag=1 |
4200 | - |
4201 | -#useful class to describe 4 momentum |
4202 | -class Momentum: |
4203 | - def __init__(self,px,py,pz,E,m): |
4204 | - self.px=px |
4205 | - self.py=py |
4206 | - self.pz=pz |
4207 | - self.E=E |
4208 | - self.m=m |
4209 | - def __add__(self,other): |
4210 | - t=Momentum(self.px+other.px,self.py+other.py,self.pz+other.pz,self.E+other.E,0) |
4211 | - t.m=t.calcMass() |
4212 | - return t |
4213 | - def __sub__(self,other): |
4214 | - t=Momentum(self.px-other.px,self.py-other.py,self.pz-other.pz,self.E-other.E,0) |
4215 | - t.m=t.calcMass() |
4216 | - return t |
4217 | - def calcMass(self): |
4218 | - tempMass2=self.E**2-self.px**2-self.py**2-self.pz**2 |
4219 | - if tempMass2 > 0: |
4220 | - t=math.sqrt(tempMass2) |
4221 | - if t>toler: |
4222 | - return t |
4223 | - else: |
4224 | - return 0 |
4225 | - else: |
4226 | - return 0 |
4227 | - def boost(self,ref,rdir): |
4228 | - pmag=ref.E |
4229 | - DBX=ref.px*rdir/pmag |
4230 | - DBY=ref.py*rdir/pmag |
4231 | - DBZ=ref.pz*rdir/pmag |
4232 | - DB=math.sqrt(DBX**2+DBY**2+DBZ**2) |
4233 | - DGA=1.0/math.sqrt(1.0-DB**2) |
4234 | - DBP=DBX*self.px+DBY*self.py+DBZ*self.pz |
4235 | - DGABP=DGA*(DGA*DBP/(1.0+DGA)+self.E) |
4236 | - self.px = self.px+DGABP*DBX |
4237 | - self.py = self.py+DGABP*DBY |
4238 | - self.pz = self.pz+DGABP*DBZ |
4239 | - self.E = DGA*(self.E+DBP) |
4240 | - def reScale(self,pi,po): |
4241 | - self.px = self.px/pi*po |
4242 | - self.py = self.py/pi*po |
4243 | - self.pz = self.pz/pi*po |
4244 | - def printMe(self): |
4245 | - li = [self.px,self.py, self.pz, self.E, self.m] |
4246 | - print "| %18.10E %18.10E %18.10E %18.10E %18.10E |" % tuple(li) |
4247 | - |
4248 | -#useful class to describe a particle |
4249 | -class Particle: |
4250 | - def __init__(self,i,l): |
4251 | - self.no = i |
4252 | - self.id = l[0] |
4253 | - self.status = l[1] |
4254 | - self.mo1 = l[2] |
4255 | - self.mo2 = l[3] |
4256 | - self.co1 = l[4] |
4257 | - self.co2 = l[5] |
4258 | - self.mom = Momentum(l[6],l[7],l[8],l[9],l[10]) |
4259 | - self.life = l[11] |
4260 | - self.polar = l[12] |
4261 | - def printMe(self): |
4262 | - 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] |
4263 | - print "%2i | %9i | %4i | %4i %4i | %4i %4i | %18.10E %18.10E %18.10E %18.10E %18.10E | %1.0f. %2.0f" % tuple(li) |
4264 | - def writeMe(self): |
4265 | - 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] |
4266 | - return "%9i %4i %4i %4i %4i %4i %18.10E %18.10E %18.10E %18.10E %18.10E %1.0f. %2.0f\n" % tuple(li) |
4267 | - |
4268 | -#useful function for converting a string to variables |
4269 | -def parseStringToVars(input): |
4270 | - if input.find(".")>-1 : |
4271 | - return float(input) |
4272 | - else: |
4273 | - return int(input) |
4274 | - |
4275 | -#main part of analysis |
4276 | -if len(sys.argv)!=3: |
4277 | - print "Usage: addmasses.py <infile> <outfile> " |
4278 | - print " Last modified: Fri Nov 21 10:49:14 CST 2008 " |
4279 | - sys.exit(0) |
4280 | -else: |
4281 | - print "Running addmasses.py to add masses and correct kinematics of fixed particles" |
4282 | - |
4283 | -#first print out leading information |
4284 | -try: |
4285 | - f=open(sys.argv[1],'r') |
4286 | -except IOError: |
4287 | - print "need a file for reading" |
4288 | - sys.exit(0) |
4289 | - |
4290 | -try: |
4291 | - g=open(sys.argv[2],'w') |
4292 | -except IOError: |
4293 | - print "need a file for writing" |
4294 | - sys.exit(0) |
4295 | - |
4296 | -while 1: |
4297 | - try: |
4298 | - line=f.readline() |
4299 | - except IOError: |
4300 | - print "Problem reading from file ",sys.argv[1] |
4301 | - sys.exit(0) |
4302 | - if line.find("<event>")==-1: |
4303 | - g.write(line) |
4304 | - else: |
4305 | - break |
4306 | - |
4307 | -f.close() |
4308 | - |
4309 | -#let xml find the event tags |
4310 | -try: |
4311 | - xmldoc = minidom.parse(sys.argv[1]) |
4312 | -except IOError: |
4313 | - print " could not open file for xml parsing ",sys.argv[1] |
4314 | - sys.exit(0) |
4315 | - |
4316 | - |
4317 | -reflist = xmldoc.getElementsByTagName('event') |
4318 | - |
4319 | -for ref in reflist: |
4320 | - lines = ref.toxml() |
4321 | - slines = lines.split("\n") |
4322 | - next = 0 |
4323 | - nup = 0 |
4324 | - nlines = len(slines) |
4325 | - counter = 0 |
4326 | - event = [] |
4327 | - event_description="" |
4328 | - event_poundSign="" |
4329 | - |
4330 | - while counter<nlines: |
4331 | - s=slines[counter] |
4332 | - if s.find("<event>")>-1: |
4333 | - next=1 |
4334 | - elif s.find("</event>")>-1: |
4335 | - pass |
4336 | - elif s.find("#")>-1: |
4337 | - event_poundSign=s |
4338 | - elif next==1: |
4339 | - event_description=s |
4340 | - next=0 |
4341 | - elif not s: |
4342 | - continue |
4343 | - else: |
4344 | - t=[] |
4345 | - for l in s.split(): t.append(parseStringToVars(l)) |
4346 | - nup = nup+1 |
4347 | - event.append(Particle(nup,t)) |
4348 | - counter=counter+1 |
4349 | - |
4350 | - |
4351 | -#default is to skip this |
4352 | - if motherFlag: |
4353 | - |
4354 | - noMotherList=[] |
4355 | - for p in event: |
4356 | - if p.status == -1: continue |
4357 | - idabs = abs(p.id) |
4358 | - idmo = p.mo1 |
4359 | - pmo = event[idmo-1] |
4360 | - if idabs>=11 and idabs<=16: |
4361 | - if p.mo1==1 or (pmo.co1 !=0 or pmo.co2 !=0): |
4362 | - noMotherList.append(p.no) |
4363 | - elif idabs<=5 and abs(pmo.id)==6: |
4364 | - if not ( p.co1==pmo.co1 and p.co2==pmo.co2): |
4365 | - noMotherList.append(p.no) |
4366 | - |
4367 | - nAdded=0 |
4368 | - if len(noMotherList)==0: |
4369 | - pass |
4370 | - elif len(noMotherList)%2 != 0: |
4371 | - print "single orphan; do not know how to process" |
4372 | - else: |
4373 | - ki=0 |
4374 | - while ki<len(noMotherList)-1: |
4375 | - l1=event[noMotherList[ki]-1] |
4376 | - ki=ki+1 |
4377 | - l2=event[noMotherList[ki]-1] |
4378 | - lq=l1.id + l2.id |
4379 | - if lq==-1 or lq==1: |
4380 | - idMom=24*lq |
4381 | - elif lq==0: |
4382 | - idMom=23 |
4383 | - else: |
4384 | - break |
4385 | - lMom=l1.mom+l2.mom |
4386 | - lm=[idMom,2,l1.mo1,l1.mo2,0,0,lMom.px,lMom.py,lMom.pz,lMom.E,lMom.calcMass(),0,0] |
4387 | - nup=nup+1 |
4388 | - nAdded=nAdded+1 |
4389 | - event.append(Particle(nup,lm)) |
4390 | - l1.mo1=l1.mo2=l2.mo1=l2.mo2=nup |
4391 | - ki=ki+1 |
4392 | - |
4393 | -# update number of partons if mothers added |
4394 | - if nAdded>0: |
4395 | - s1=event_description.split()[0] |
4396 | - mySub = re.compile(s1) |
4397 | - event_description = mySub.sub(str(nup),event_description) |
4398 | - |
4399 | - |
4400 | - if nAdded>0: |
4401 | - totalLength = len(event)+1 |
4402 | - newPosition = [] |
4403 | - iPos=0 |
4404 | - while iPos<totalLength: |
4405 | - for p in event: |
4406 | - if p.mo1==iPos: |
4407 | - newPosition.append(p.no) |
4408 | - iPos=iPos+1 |
4409 | - |
4410 | - iUp=1 |
4411 | - event0=[] |
4412 | - for ip in newPosition: |
4413 | - event0.append(event[ip-1]) |
4414 | - |
4415 | - iUp=0 |
4416 | - for p in event0: |
4417 | - iUp=iUp+1 |
4418 | - if p.no != iUp: |
4419 | - ip=iUp |
4420 | - while ip<totalLength-1: |
4421 | - pp=event0[ip] |
4422 | - if pp.mo1==p.no and pp.mo1>pp.no: |
4423 | - pp.mo1=pp.mo2=iUp |
4424 | - ip=ip+1 |
4425 | - p.no=iUp |
4426 | - |
4427 | - iUp=0 |
4428 | - for p in event0: |
4429 | - event[iUp]=event0[iUp] |
4430 | - iUp=iUp+1 |
4431 | - |
4432 | - |
4433 | - |
4434 | - |
4435 | -# identify mothers |
4436 | - particleDict={} |
4437 | - for p in event: |
4438 | - idabs = abs(p.id) |
4439 | - if idabs>=11 and idabs<=16: |
4440 | - if p.mo1==1: |
4441 | - pass |
4442 | - else: |
4443 | - if p.mo1 in particleDict: |
4444 | - l=[particleDict[p.mo1]] |
4445 | - l.append(p.no) |
4446 | - else: |
4447 | - l=p.no |
4448 | - particleDict[p.mo1]=l |
4449 | - |
4450 | -# repair kinematics |
4451 | - for k in particleDict: |
4452 | - t=particleDict[k] |
4453 | - p1=event[t[0]-1] |
4454 | - p1.mom.boost(event[k-1].mom,-1) |
4455 | - p2=event[t[1]-1] |
4456 | - p2.mom.boost(event[k-1].mom,-1) |
4457 | - rsh=event[k-1].mom.m |
4458 | - if p1.id in massDict: p1.mom.m=massDict[p1.id] |
4459 | - if p2.id in massDict: p2.mom.m=massDict[p2.id] |
4460 | - p1.mom.E = (rsh*rsh + p1.mom.m**2 - p2.mom.m**2)/(2.0*rsh) |
4461 | - pmagOld=math.sqrt(p1.mom.px**2+p1.mom.py**2+p1.mom.pz**2) |
4462 | - pmagNew=math.sqrt(p1.mom.E**2-p1.mom.m**2) |
4463 | - p1.mom.reScale(pmagOld,pmagNew) |
4464 | - p2.mom = Momentum(0,0,0,rsh,rsh) - p1.mom |
4465 | - p1.mom.boost(event[k-1].mom,1) |
4466 | - p2.mom.boost(event[k-1].mom,1) |
4467 | - |
4468 | - pSum = Momentum(0,0,0,0,0) |
4469 | - for p in event: |
4470 | - if p.status== 2 : |
4471 | - pass |
4472 | - elif p.status==-1: |
4473 | - pSum = pSum - p.mom |
4474 | - elif p.status==1: |
4475 | - pSum = pSum + p.mom |
4476 | - |
4477 | - if abs(pSum.px)>toler or abs(pSum.py)>toler or abs(pSum.pz)>toler or abs(pSum.E)>toler: |
4478 | - print "Event does not pass tolerance ",toler |
4479 | - pSum.printMe() |
4480 | - |
4481 | - if 1: |
4482 | - g.write("<event>\n") |
4483 | - g.write(event_description+"\n") |
4484 | - for p in event: |
4485 | - g.write(p.writeMe()) |
4486 | - g.write(event_poundSign+"\n") |
4487 | - g.write("</event>\n") |
4488 | -#at the end |
4489 | -g.write("</LesHouchesEvents>\n") |
4490 | -g.close() |
4491 | - |
4492 | - |
4493 | - |
4494 | |
4495 | === removed file 'Template/bin/calculate_crossx' |
4496 | --- Template/bin/calculate_crossx 2010-10-30 03:26:37 +0000 |
4497 | +++ Template/bin/calculate_crossx 1970-01-01 00:00:00 +0000 |
4498 | @@ -1,140 +0,0 @@ |
4499 | -#!/bin/bash |
4500 | -# |
4501 | -# This runs survey,refine,unweight_events, one after the other |
4502 | -# |
4503 | -# First we need to get into the main directory |
4504 | -# |
4505 | -# |
4506 | -# Usage: generate_events compression events parallel [name] |
4507 | -# |
4508 | - |
4509 | -if [[ ! -d ./bin ]]; then |
4510 | - cd ../ |
4511 | - if [[ ! -d ./bin ]]; then |
4512 | - echo "Error: it must be executed from the main, or bin directory" |
4513 | - exit |
4514 | - fi |
4515 | -fi |
4516 | -# |
4517 | -# Now let shell know where to find important executables |
4518 | -# |
4519 | -main=`pwd` |
4520 | -dirbin=$main/bin |
4521 | -pydir=$main/../pythia-pgs/src |
4522 | -pgsdir=$pydir |
4523 | -ERAdir=$main/../ExRootAnalysis |
4524 | -webbin=$dirbin |
4525 | -td=$dirbin/td |
4526 | -web=0 |
4527 | - |
4528 | -echo $$ >> myprocid |
4529 | - |
4530 | -#if ( "$1" == "" ) then |
4531 | -# echo 'Number of unweighted events. This is ingnored and read from run_card.dat ' |
4532 | -# set a = $< |
4533 | -#else |
4534 | -# set a = $1 |
4535 | -#endif |
4536 | -if [[ "$1" == "" ]]; then |
4537 | - echo 'Enter 1 for parallel 0 for serial run' |
4538 | - read p |
4539 | -else |
4540 | - p=$1 |
4541 | -fi |
4542 | -n=MadEvent |
4543 | -if [[ $p -gt 0 ]]; then |
4544 | - if [[ "$2" == "" ]]; then |
4545 | - echo 'Enter name for jobs on pbs queue' |
4546 | - read n |
4547 | - else |
4548 | - n=$2 |
4549 | - fi |
4550 | - if [[ "$3" == "" ]]; then |
4551 | - echo 'Enter run name' |
4552 | - read t |
4553 | - else |
4554 | - t=$3 |
4555 | - fi |
4556 | -else |
4557 | - if [[ "$2" == "" ]]; then |
4558 | - echo 'Enter run name' |
4559 | - read t |
4560 | - else |
4561 | - t=$2 |
4562 | - fi |
4563 | -fi |
4564 | -#set t = TeV2 |
4565 | -if [[ ${#argv} -gt 3 ]]; then |
4566 | - web=1 |
4567 | - webbin="$MADGRAPH_BASE/MG_ME/WebBin" |
4568 | - pydir="$webbin/pythia-pgs" |
4569 | - pgsdir=$pydir |
4570 | - ERAdir="$MADGRAPH_BASE/MG_ME/ExRootAnalysis" |
4571 | - td=$webbin/td |
4572 | - touch Online |
4573 | -fi |
4574 | -date |
4575 | -a=`awk '/^[^#].*=.*nevents/{print $1}' Cards/run_card.dat` |
4576 | -echo Generating $a events |
4577 | -# |
4578 | -# Check if run already exists. If so, store run w/ new name |
4579 | -# and remove old run before starting. |
4580 | -# |
4581 | - |
4582 | -if [[ -e status ]]; then |
4583 | - rm status |
4584 | -fi |
4585 | -if [[ -e error ]]; then |
4586 | - rm error |
4587 | -fi |
4588 | -touch RunWeb |
4589 | -echo "Cleaning directories" > status |
4590 | -$dirbin/gen_crossxhtml-pl $t |
4591 | -$dirbin/clean |
4592 | -touch survey |
4593 | -echo "Starting jobs" > status |
4594 | -$dirbin/gen_crossxhtml-pl $t |
4595 | -$dirbin/survey $p $n $t |
4596 | -if [[ -e error ]]; then |
4597 | - cat error |
4598 | - date |
4599 | - cp -f error status |
4600 | - rm refine |
4601 | - rm RunWeb |
4602 | - $dirbin/gen_crossxhtml-pl $t |
4603 | - $dirbin/gen_cardhtml-pl |
4604 | - exit |
4605 | -fi |
4606 | -# |
4607 | -# Now collect the events - just to get the banner in fact |
4608 | -# |
4609 | -echo "Combining Events" >& status |
4610 | -echo "Combining Events" |
4611 | -$dirbin/gen_crossxhtml-pl $t |
4612 | -pushd ./Source > /dev/null |
4613 | -make ../bin/combine_events |
4614 | -popd > /dev/null |
4615 | -pushd SubProcesses > /dev/null |
4616 | -$dirbin/run_combine $p |
4617 | -mv events.lhe ../Events/ |
4618 | -mv unweighted_events.lhe ../Events/ |
4619 | -popd > /dev/null |
4620 | -# |
4621 | -# do the banner |
4622 | -# |
4623 | -cd ./Events |
4624 | -echo "putting the banner" |
4625 | -$dirbin/put_banner events.lhe |
4626 | -$dirbin/put_banner unweighted_events.lhe |
4627 | -cd ../ |
4628 | -# |
4629 | -# Store Events |
4630 | -# |
4631 | -echo "Storing Events" >& status |
4632 | -$dirbin/gen_crossxhtml-pl $t |
4633 | -$dirbin/store $t |
4634 | -rm -f RunWeb |
4635 | -echo " " >& status |
4636 | -$dirbin/gen_crossxhtml-pl $t |
4637 | -$dirbin/gen_cardhtml-pl |
4638 | -date |
4639 | |
4640 | === removed file 'Template/bin/clean4grid' |
4641 | --- Template/bin/clean4grid 2010-10-30 03:26:37 +0000 |
4642 | +++ Template/bin/clean4grid 1970-01-01 00:00:00 +0000 |
4643 | @@ -1,95 +0,0 @@ |
4644 | -#!/bin/bash |
4645 | -# |
4646 | -################################################################################ |
4647 | -# ## |
4648 | -# MadGraph/MadEvent ## |
4649 | -# ## |
4650 | -# FILE : clean4grid ## |
4651 | -# VERSION : 1.0 ## |
4652 | -# DATE : 29 Jan 2008 ## |
4653 | -# AUTHORS : MH & RF - MadGraph team ## |
4654 | -# ## |
4655 | -# DESCRIPTION : script to clean package for the grid ## |
4656 | -# USAGE : ./clean4grid ## |
4657 | -################################################################################ |
4658 | - |
4659 | -set nonomatch |
4660 | - |
4661 | -if [[ ! -d ./bin ]]; then |
4662 | - cd ../ |
4663 | - if [[ ! -d ./bin ]]; then |
4664 | - echo "Error: it must be executed from the main, or bin directory" |
4665 | - exit |
4666 | - fi |
4667 | -fi |
4668 | - |
4669 | -if [[ -d SubProcesses ]]; then |
4670 | - cd SubProcesses |
4671 | - echo -n "Cleaning SubProcesses" |
4672 | - rm -f *.f >& /dev/null |
4673 | - for i in `cat subproc.mg` ; do |
4674 | - cd $i |
4675 | - echo -n "." |
4676 | - rm -f *.o >& /dev/null |
4677 | - rm -f *.f >& /dev/null |
4678 | -# rm -f madevent >& /dev/null |
4679 | -# rm -f *ajob* >& /dev/null |
4680 | - rm -f gensym >& /dev/null |
4681 | - rm -f matrix*.jpg >& /dev/null |
4682 | - rm -f matrix.ps >& /dev/null |
4683 | - rm -f G*/ftn25 >& /dev/null |
4684 | - rm -f G*/ftn26 >& /dev/null |
4685 | - rm -f G*/events.lhe >& /dev/null |
4686 | - cd .. |
4687 | - done |
4688 | - echo " " |
4689 | - cd ../ |
4690 | -else |
4691 | - echo "Error could not find SubProcesses" |
4692 | - exit |
4693 | -fi |
4694 | -if [[ -d Source ]]; then |
4695 | - echo "Removing Source:" |
4696 | - cd Source |
4697 | - rm -f *.o >& /dev/null |
4698 | - rm -f *.f >& /dev/null |
4699 | - rm -f *.inc >& /dev/null |
4700 | - rm -f DHELAS/*.F >& /dev/null |
4701 | - rm -f DHELAS/*.f >& /dev/null |
4702 | - rm -f DHELAS/*.o >& /dev/null |
4703 | - rm -f DHELAS/*.inc >& /dev/null |
4704 | - rm -rf DHELAS/Doc >& /dev/null |
4705 | - rm -f MODEL/*.f >& /dev/null |
4706 | - rm -f MODEL/*.o >& /dev/null |
4707 | - rm -f MODEL/*.dat >& /dev/null |
4708 | - rm -f MODEL/*.html >& /dev/null |
4709 | - rm -f PDF/*.f >& /dev/null |
4710 | - rm -f PDF/*.o >& /dev/null |
4711 | - rm -f PDF/*.inc >& /dev/null |
4712 | - cd .. |
4713 | -fi |
4714 | -if [[ -d HTML ]]; then |
4715 | - echo "Removing HTML files:" |
4716 | - rm -f HTML/* >& /dev/null |
4717 | -fi |
4718 | -#if [[ -d lib ]]; then |
4719 | -# cd lib |
4720 | -# echo "Cleaning lib:" |
4721 | -# rm -f *.a >& /dev/null |
4722 | -# cd ../ |
4723 | -#else |
4724 | -# echo "Error could not find lib" |
4725 | -# exit |
4726 | -#fi |
4727 | -#if [[ -d bin ]]; then |
4728 | -# cd bin |
4729 | -# echo "Cleaning bin:" |
4730 | -# for i in gen_ximprove scale_events select_events sum_html combine_events; do |
4731 | -# rm -f $i >& /dev/null |
4732 | -# done |
4733 | -# cd ../ |
4734 | -#else |
4735 | -# echo "Error could not find bin" |
4736 | -# exit |
4737 | -#fi |
4738 | - |
4739 | |
4740 | === modified file 'Template/bin/cleanall' |
4741 | --- Template/bin/cleanall 2011-07-06 17:23:07 +0000 |
4742 | +++ Template/bin/cleanall 2012-02-04 00:00:25 +0000 |
4743 | @@ -5,7 +5,7 @@ |
4744 | # executable files |
4745 | # events.dat (Except in Events) |
4746 | # |
4747 | -# Usage: clean |
4748 | +# Usage: cleanall |
4749 | # |
4750 | # |
4751 | # First we need to get into the main directory |
4752 | @@ -17,6 +17,15 @@ |
4753 | exit |
4754 | fi |
4755 | fi |
4756 | +if [[ -d Source ]]; then |
4757 | + cd Source |
4758 | + echo "Cleaning Source:" |
4759 | + make clean >& /dev/null |
4760 | + cd ../ |
4761 | +else |
4762 | + echo "Error could not find Source" |
4763 | + exit |
4764 | +fi |
4765 | if [[ -d SubProcesses ]]; then |
4766 | cd SubProcesses |
4767 | echo -n "Cleaning SubProcesses" |
4768 | @@ -35,23 +44,3 @@ |
4769 | echo "Error could not find SubProcesses" |
4770 | exit |
4771 | fi |
4772 | -if [[ -d Source ]]; then |
4773 | - cd Source |
4774 | - echo "Cleaning Source:" |
4775 | - make clean >& /dev/null |
4776 | - cd ../ |
4777 | -else |
4778 | - echo "Error could not find Source" |
4779 | - exit |
4780 | -fi |
4781 | -if [[ -d bin ]]; then |
4782 | - cd bin |
4783 | - echo "Cleaning bin:" |
4784 | - for i in gen_ximprove scale_events select_events sum_html combine_runs combine_events; do |
4785 | - rm -f $i >& /dev/null |
4786 | - done |
4787 | - cd ../ |
4788 | -else |
4789 | - echo "Error could not find bin" |
4790 | - exit |
4791 | -fi |
4792 | |
4793 | === removed file 'Template/bin/compile' |
4794 | --- Template/bin/compile 2011-07-11 18:32:26 +0000 |
4795 | +++ Template/bin/compile 1970-01-01 00:00:00 +0000 |
4796 | @@ -1,89 +0,0 @@ |
4797 | -#!/bin/bash |
4798 | -# |
4799 | -################################################################################ |
4800 | -# ## |
4801 | -# MadGraph/MadEvent ## |
4802 | -# ## |
4803 | -# FILE : compile ## |
4804 | -# VERSION : 1.0 ## |
4805 | -# DATE : 23 Septembre 2007 ## |
4806 | -# AUTHOR : MH - MadGraph team ## |
4807 | -# ## |
4808 | -# DESCRIPTION : script to compile madevent ## |
4809 | -# USAGE : ./make_package ## |
4810 | -################################################################################ |
4811 | - |
4812 | -# set nonomatch |
4813 | - |
4814 | -if [[ ! -d ./bin ]]; then |
4815 | - cd ../ |
4816 | - if [[ ! -d ./bin ]]; then |
4817 | - echo "Error: it must be executed from the main, or bin directory" |
4818 | - exit |
4819 | - fi |
4820 | -fi |
4821 | - |
4822 | - |
4823 | -# |
4824 | -# If argument is equal to 'd' use dynamic libraries |
4825 | -# |
4826 | -echo $PWD |
4827 | -if [[ "$1" == "dynamic" ]]; then |
4828 | - echo "Using dynamic libraries (might not work under MacOsX)" |
4829 | - export dynamic=true |
4830 | -else |
4831 | - echo "Using static libraries" |
4832 | - unset dynamic |
4833 | -fi |
4834 | - |
4835 | -# Check for LHAPDF |
4836 | -c=`awk '/^[^#].*=.*pdlabel/{print $1}' Cards/run_card.dat` |
4837 | -if [[ $c == "'lhapdf'" ]]; then |
4838 | - echo Using LHAPDF interface! |
4839 | - export lhapdf=true |
4840 | -else |
4841 | - unset lhapdf |
4842 | -fi |
4843 | - |
4844 | -# |
4845 | -# Now let shell know where to find important executables |
4846 | -# |
4847 | - |
4848 | -bin/compile_Source |
4849 | - |
4850 | -if [[ -e error ]];then |
4851 | - exit |
4852 | -fi |
4853 | - |
4854 | -if [[ -d SubProcesses ]]; then |
4855 | - cd SubProcesses |
4856 | - for i in `cat subproc.mg` ; do |
4857 | - cd $i |
4858 | - echo $i |
4859 | - rm -f ajob* >& /dev/null |
4860 | - rm -f wait.ajob* >& /dev/null |
4861 | - rm -f run.ajob* >& /dev/null |
4862 | - rm -f done.ajob* >& /dev/null |
4863 | - make madevent > /dev/null |
4864 | - if [[ $? -ne 0 ]];then |
4865 | - # Make didn't exit successfully |
4866 | - echo Error make madevent not successful > error |
4867 | - cat error |
4868 | - exit |
4869 | - fi |
4870 | - cd .. |
4871 | - done |
4872 | - cd .. |
4873 | -else |
4874 | - echo "Error could not find SubProcesses" |
4875 | - exit |
4876 | -fi |
4877 | - |
4878 | -if [[ -d ../DECAY ]]; then |
4879 | - echo "DECAY directory found, compiling..." |
4880 | - cd ../DECAY |
4881 | - make |
4882 | -fi |
4883 | - |
4884 | -echo "" |
4885 | - |
4886 | |
4887 | === removed file 'Template/bin/compile_Source' |
4888 | --- Template/bin/compile_Source 2011-07-06 22:40:17 +0000 |
4889 | +++ Template/bin/compile_Source 1970-01-01 00:00:00 +0000 |
4890 | @@ -1,32 +0,0 @@ |
4891 | -#!/bin/bash |
4892 | -# |
4893 | -################################################################################ |
4894 | -# ## |
4895 | -# MadGraph/MadEvent ## |
4896 | -# ## |
4897 | -# FILE : compile_Source ## |
4898 | -# VERSION : 1.0 ## |
4899 | -# DATE : 6 July 2011 ## |
4900 | -# AUTHOR : JA - MadGraph team ## |
4901 | -# ## |
4902 | -# DESCRIPTION : script to compile Source ## |
4903 | -################################################################################ |
4904 | - |
4905 | -if [[ -d Source ]]; then |
4906 | - cd Source |
4907 | - for i in ../bin/sum_html ../bin/gen_ximprove all ../bin/combine_events ../bin/combine_runs ../bin/sumall; do |
4908 | - make $i > /dev/null |
4909 | - if [[ $? -ne 0 ]];then |
4910 | - # Make didn't exit successfully |
4911 | - echo Error make $i in Source not successful > ../error |
4912 | - cat ../error |
4913 | - exit |
4914 | - fi |
4915 | - done |
4916 | - cd .. |
4917 | -else |
4918 | - echo 'Error Source directory not found' > error |
4919 | - cat error |
4920 | - exit |
4921 | -fi |
4922 | - |
4923 | |
4924 | === removed file 'Template/bin/cpall' |
4925 | --- Template/bin/cpall 2010-10-30 03:26:37 +0000 |
4926 | +++ Template/bin/cpall 1970-01-01 00:00:00 +0000 |
4927 | @@ -1,4 +0,0 @@ |
4928 | -#!/bin/bash |
4929 | -for i in `cat subproc.mg` ; do |
4930 | - cp -p $1 $i/$1 |
4931 | -done |
4932 | |
4933 | === removed file 'Template/bin/gen_crossxhtml-pl' |
4934 | --- Template/bin/gen_crossxhtml-pl 2011-04-21 15:56:29 +0000 |
4935 | +++ Template/bin/gen_crossxhtml-pl 1970-01-01 00:00:00 +0000 |
4936 | @@ -1,399 +0,0 @@ |
4937 | -#!/usr/bin/perl -w |
4938 | - |
4939 | -$server = $ENV{'SERVER_NAME'}; |
4940 | - |
4941 | - |
4942 | - |
4943 | -&writeHtmlProcessPage; |
4944 | - |
4945 | - |
4946 | -sub writeHtmlProcessPage { |
4947 | - |
4948 | -# |
4949 | -# Make sure we are in the main directory, not bin |
4950 | -# |
4951 | - if (-d "bin") { |
4952 | -# print "We are in main directory \n"; |
4953 | -# print qx(pwd); |
4954 | - } |
4955 | - else{ |
4956 | -# print "Not in correct directory \n"; |
4957 | - chdir("../"); |
4958 | - if (-d "bin") { |
4959 | -# print "We are in main directory \n"; |
4960 | - } |
4961 | - else{ |
4962 | - print "Error gen_crossxhtml-pl must be run from main or bin directory \n"; |
4963 | - exit; |
4964 | - } |
4965 | - } |
4966 | - $directory=qx(pwd); |
4967 | - |
4968 | -# |
4969 | -# name of the output file |
4970 | -# |
4971 | - $htfile = "HTML/crossx" . "\.html"; |
4972 | - open(PAGE,"> $htfile"); |
4973 | -# |
4974 | -# The name of the current run |
4975 | -# |
4976 | - if($#ARGV < 0) { |
4977 | - $RunName="Web"; |
4978 | - } else { |
4979 | - $RunName="$ARGV[0]"; |
4980 | - } |
4981 | - |
4982 | -# |
4983 | -# Write out the current running situation |
4984 | -# |
4985 | - |
4986 | -#-------- |
4987 | -# Getting info |
4988 | -#-------- |
4989 | - if (-e "SubProcesses/procdef_mg5.dat"){ |
4990 | - open (INCARD,"SubProcesses/procdef_mg5.dat") || die "Error reading file proc_card.dat"; |
4991 | - @incard=<INCARD>; |
4992 | - close (INCARD); |
4993 | - } else { |
4994 | - open (INCARD,"Cards/proc_card.dat") || exit; |
4995 | - @incard=<INCARD>; |
4996 | - close (INCARD); |
4997 | - } |
4998 | - |
4999 | - # process |
5000 | - $listpos = 0; |
Since this has receive no feedback and since our meeting about the new interface stated that this one will be based on 1.4.x.
I merge this in the 2.0 series