Merge lp:~maddevelopers/mg5amcnlo/plugin_plus_py8 into lp:~maddevelopers/mg5amcnlo/2.5.0
- plugin_plus_py8
- Merge into 2.5.0
Status: | Merged |
---|---|
Merged at revision: | 296 |
Proposed branch: | lp:~maddevelopers/mg5amcnlo/plugin_plus_py8 |
Merge into: | lp:~maddevelopers/mg5amcnlo/2.5.0 |
Diff against target: |
27350 lines (+17972/-4398) 73 files modified
Template/Common/Cards/delphes_card_ATLAS.dat (+49/-21) Template/Common/Cards/delphes_card_CMS.dat (+32/-15) Template/Common/Cards/delphes_card_default.dat (+32/-15) Template/LO/Cards/pythia8_card_default.dat (+72/-0) Template/LO/Cards/run_card.dat (+50/-50) Template/LO/Source/BIAS/dummy/dummy.f (+44/-0) Template/LO/Source/BIAS/dummy/makefile (+21/-0) Template/LO/Source/BIAS/ptj_bias/makefile (+27/-0) Template/LO/Source/BIAS/ptj_bias/ptj_bias.f (+101/-0) Template/LO/Source/cuts.inc (+7/-3) Template/LO/Source/lhe_event_infos.inc (+16/-0) Template/LO/Source/make_opts (+12/-2) Template/LO/Source/run.inc (+8/-0) Template/LO/Source/rw_events.f (+123/-2) Template/LO/SubProcesses/cuts.f (+1750/-1319) Template/LO/SubProcesses/makefile (+10/-3) Template/LO/SubProcesses/reweight.f (+46/-0) Template/LO/SubProcesses/setcuts.f (+16/-49) Template/LO/SubProcesses/unwgt.f (+34/-21) Template/LO/bin/internal/run_delphes3 (+31/-12) UpdateNotes.txt (+13/-8) VERSION (+2/-1) input/.mg5_configuration_default.txt (+15/-4) madgraph/core/base_objects.py (+0/-2) madgraph/interface/amcatnlo_interface.py (+10/-2) madgraph/interface/amcatnlo_run_interface.py (+121/-106) madgraph/interface/common_run_interface.py (+1496/-232) madgraph/interface/extended_cmd.py (+84/-11) madgraph/interface/launch_ext_program.py (+2/-3) madgraph/interface/loop_interface.py (+21/-7) madgraph/interface/madevent_interface.py (+1346/-218) madgraph/interface/madgraph_interface.py (+238/-98) madgraph/interface/reweight_interface.py (+0/-1) madgraph/iolibs/export_cpp.py (+1/-1) madgraph/iolibs/export_fks.py (+55/-9) madgraph/iolibs/export_v4.py (+130/-55) madgraph/iolibs/template_files/addmothers.f (+5/-4) madgraph/iolibs/template_files/auto_dsig_v4.inc (+10/-3) madgraph/iolibs/template_files/madevent_makefile_source (+4/-0) madgraph/iolibs/template_files/madevent_run_config.inc (+4/-0) madgraph/iolibs/template_files/pythia8/pythia8.2_main_makefile.inc (+1/-1) madgraph/loop/MadLoopBannerStyles.py (+0/-1) madgraph/loop/loop_exporters.py (+0/-2) madgraph/madevent/gen_crossxhtml.py (+352/-154) madgraph/various/banner.py (+1319/-106) madgraph/various/cluster.py (+1/-0) madgraph/various/histograms.py (+210/-30) madgraph/various/lhe_parser.py (+96/-70) madgraph/various/misc.py (+13/-72) madgraph/various/plot_djrs.py (+163/-0) madgraph/various/process_checks.py (+1/-3) madgraph/various/systematics.py (+7/-5) models/check_param_card.py (+25/-0) tests/IOTests.py (+2/-2) tests/acceptance_tests/test_cmd.py (+5/-1) tests/acceptance_tests/test_cmd_madevent.py (+68/-8) tests/input_files/CKKWL_djrs.dat (+1304/-0) tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/auto_dsig.f (+10/-2) tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f (+11/-2) tests/input_files/IOTestsComparison/IOHistogramTest/DJR_histograms/CKKWL_djrs_output.HwU (+1665/-0) tests/input_files/IOTestsComparison/IOHistogramTest/DJR_histograms/CKKWL_djrs_output.gnuplot (+392/-0) tests/input_files/IOTestsComparison/IOHistogramTest/DJR_histograms/MLM_djrs_output.HwU (+1665/-0) tests/input_files/IOTestsComparison/IOHistogramTest/DJR_histograms/MLM_djrs_output.gnuplot (+392/-0) tests/input_files/IOTestsComparison/TestMadWeight/modification_to_cuts/cuts.f (+1728/-1297) tests/input_files/MLM_djrs.dat (+1665/-0) tests/parallel_tests/madevent_comparator.py (+20/-1) tests/parallel_tests/test_MG5aMC_distribution.py (+112/-0) tests/parallel_tests/test_aloha.py (+46/-51) tests/time_db (+264/-249) tests/unit_tests/interface/test_madevent.py (+8/-2) tests/unit_tests/iolibs/test_export_fks.py (+16/-11) tests/unit_tests/iolibs/test_histograms.py (+88/-0) tests/unit_tests/various/test_banner.py (+285/-51) |
To merge this branch: | bzr merge lp:~maddevelopers/mg5amcnlo/plugin_plus_py8 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Olivier Mattelaer | Needs Fixing | ||
Review via email: mp+303947@code.launchpad.net |
Commit message
Description of the change
- 441. By Olivier Mattelaer
-
fix with latest 2.5.0
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
ok I continue
6) in common_
+ # Maybe the user used something like 'logging.INFO'
+ MA5_options[
+ except:
+ try:
+ MA5_options[
would be better to not use eval (this always creates security for the web interface).
Rather use (in both case) getattr(logging, lvl)
7) a bit lower you have the line:
+ logger.warning("LHE event file not found in \n%s\ns"
+ "AboringParton level MA5 analysis is disabled.")
what does that mean?
8) a bit below you have
+ file_candidates = glob.glob(
+ glob.glob(
please replace this be call like
misc.glob(
This is done in order to strenghten the security of the function (and limit bug)
Please check that no direct call to glob.glob are remaining in the file. (I have seen many more)
9) need to check for later: the code of ask_madanalysis
10) concerning run_madanalysis5:
10.1)remove the
#######
+# Here's how to print the MA5 commands generated by MG5aMC
+# for MA5_runtag, MA5_cmds in MA5_cmds_list:
+# misc.sprint(
+# misc.sprint('* Commands for MA5 runtag %s:'%MA5_runtag)
+# misc.sprint(
+# misc.sprint(
+######
(or at least change the temporary)
10.2) Please use the same standard as for other program for the following (one line in bold) [We are not an advertising company]
+ logger.
+ logger.info('Now starting MadAnalysis5 [arXiv:
+ logger.
10.3) concerning
+ if MA5_runtag.
+ # When doing a reconstruction we must first copy the event file
I do not see any cp. so I'm not sure if the comment is accurate.
If it is, please try to avoid to copy event since the filesystem can (often) be quite slow (especially on cluster)
10.4) concerning this:
+ shutil.copy(target, pjoin(self.
Is it possible to specify a path directly in MA5 to not have to move the file.
(multiple output are like this actually in that routine --the full HTML for example--)
11) In do_delphes/
you have remove the use of the multicore method to unzip the file, while editing the question.
I can see an advantges on that for condor cluster if cluster_
12) in do_delphes the line
+ if os.path....
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
Let's go for part III:
14) in madgraph/
I see a misc.sprint remaining.
@@ -595,20 +601,22 @@
+ misc.sprint(data)
15) Note for the functionality review:
Potentially deep change in the auto-completion behavior: Need extensive testing of all auto-completion to check if they still work. (use the opportunity to add unitest on the auto-completion)
- # correct wrong splitting with '-'
- elif line and line[begidx-1] == '-':
+ # correct wrong splitting with '-'/"="
+ elif line and line[begidx-1] in ['-',"=",':']:
16) in extended_cmd, a new parameter self.case is added to the question interfase/
the name is not clear enough if the question is then case sensitive or case insensitive.
Therefore the name has to be modified.
17) in madgraph/
can you check the following change: (the print is kept but not the compilation)
# Make pythia8
print "Running make for pythia8 directory"
- misc.compile(
+ #misc.compile(
18) in madevent_interface for the check_pythia8 command
18.1) you have the line
+ # If not pythia-pgs path
18.2) you have
+ mode = laststep[
+ if mode not in ['auto', 'pythia', 'delphes']:
should not you also support laststep=pythia8
18.3) The following line are not bugged (output_file not define when untarring:
+ input_file = pjoin(self.
+ #output_file = pjoin(self.me_dir, 'Events', 'unweighted_
+ if not os.path.
+ if os.path.
+ misc.gzip(
+ else:
+ raise self.InvalidCmd('No event file corresponding to %s run. '
+ % self.run_name)
19) complete_shower
This use a useless (and dangerous eval)
+ elif len(args)>1 and args[1] in self._interface
+ return eval("self.
+ (args[1]
+ endidx-
this should be replaced by a nicer (splitting in multiple will also be more readable)
return getattr(self, 'complete_%s' % text)(text, args[1]
20) in complete_pythia8:
apply also the replacement for glob.glob in this file/function. (if not done already)
21) in setup_pythia8
Not sure to understand this:
+ # Use defaultSet not to overwrite the current userSet status
+ PY8_Card.
This line never do...
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
and now the final part for the code review.
35) in banner.py
+ self.add_
Why not having it as a list?
36) Valentin are you working on PC? or maybe you like too much xml ;-)
[in banner.py]
# to indicate that he wants to pipe the output. Or \dev\null to turn the
37) in lhe_parser.py: the function do not correspond to the associated comment:
+
+ def unweight(self, outputpath, get_wgt=None, max_wgt=0, trunc_error=0,
+ event_target=0, log_level=
which can either be a fct of the event or a tag in the rwgt list.
max_wgt allow to do partial unweighting.
(stop to write event when target is reached)
+ 'strategy' defines the normalisation mode: 4 -> average. 3-> sum
"""
if not get_wgt:
38) Why not put this in madevent_
This can be a function like in misc. madgraph_interface can obviously call it.
+# Return a warning (if applicable) on the consistency of the current Pythia8
+# and MG5_aMC version specified. It is placed here because it should be accessible
+# from both madgraph5_interface and madevent_interface
+#=====
+def mg5amc_
39)
+def get_MadAnalysis
+ logstream = sys.stdout, loglevel = logging.INFO, forced = True):
39.1) This function need to work with a with statement.
To always ensure that the variable are restored at the end.
or at least restore the variable in case of crash
39.2) the try/except is much too large. many stuff can crash here.
39.3) the import readline might not pass on all machine. (espcecially on VM) so this need to be handle as well (stupid to forbid MA5 on VM right)
To follow the status on those answer, I have put a page on the wiki:
https:/
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
Let move forward on the point 3 of the review:
reviewing the change in cuts.f (not done before to the a windows -> linux conversion on end of line)
3.1) The following is at least weird
C COUNT NUMBER OF MASSLESS OUTGOING PARTICLES, SINCE WE DO NOT WANT
C TO APPLY A CUT FOR JUST A SINGLE MASSIVE PARTICLE IN THE FINAL STATE.
NMASSLESS = 0
DO I=NINCOMING+
& DSQRT(DOT( P(0,I), P(0,I))) .LT. 5D0) THEN
ENDIF
ENDDO
this seems to count in 4F and 5F the b as massles (which sounds bad to me)
should not we use maxjetflavor for this?
3.2) some comment as 3.1 but for ptlund.
C PROCESS WITH EXACTLY TWO MASSLESS OUTGOING PARTICLES IS SPECIAL
C BECAUSE AN ENERGY-SHARING VARIABLE LIKE "Z" DOES NOT MAKE SENSE.
C IN THIS CASE, ONLY APPLY MINIMAL pT W.R.T BEAM CUT.
C THIS CUT WILL ONLY APPLY TO THE TWO-MASSLESS PARTICLE STATE.
NMASSLESS = 0
DO I=NINCOMING+
& DSQRT(DOT( P(0,I), P(0,I))) .LT. 5D0) THEN
ENDIF
ENDDO
So I marked 3 done in the wiki and add two line in the wiki for those two (identical) point
Otherwise here is two additional point
40) the edition of the card does not work
41) the auto-completion of install MadAnalysis does not work after the first option.
(try to auto-complete install MadAnalysis5 --no_root_in_MA5)
42) the instalation of MA5 fails without the option "--no_root_in_MA5 --no_MA5_
would be nice to either automatically switch to those options or at least suggest them to the user when it fails
- 442. By Olivier Mattelaer
-
make some of the change found when doing the review
- 443. By Olivier Mattelaer
-
improve the help command of the card edition interface
- support pythia8 (and madloop)
- parameter can have an optional parameter comment
- this parameter is printed if the user do help on that parameter
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
43) some acceptance test are failing (related to self.proc_defs @NLO)
44) The question for madanalysis should be changed for the display to the user.
44.1)I would propose:
The following switches determine which programs are run:
1 Choose the shower/
2 Choose the detector simulation program: detector = OFF
3 Choose which the plotting/analysis program: analysis = OFF
3 Decay particles with the MadSpin module: madspin = OFF
4 Add weights to the events based on changing model parameters: reweight = OFF
Either type the switch number (1 to 5) to change its setting,
Set any switch explicitly (e.g. type 'madspin=ON' at the prompt)
Type 'help' for the list of all valid option
Type '0', 'auto', 'done' or just press enter when you are done.
Such that
a) we can add other package easily. (like the fortran analysis present in MC@NLO, or interface to Falstlim/Rivet/...)
b) Such that we can choose to use either MA4 or MA5
44.2) Also, contrary to the other options, the default should be to have the plotting routine activated when installed. (at least for the parton level)
44.3) I would propose to have only MA5 as option (equivalent to parton+hadron if shower is run)
(potentially have a way in the madanalysis_hadron card to specify that you want to bypass it if needed)
44.4) Neither madanalysis5_
- 444. By Olivier Mattelaer
-
merge with latest 2.5.0
- 445. By Olivier Mattelaer
-
moving forward in the review
- 446. By Olivier Mattelaer
-
additional fix related to the review
- 447. By Valentin Hirschi
-
1. Fixed a path issue.
2. Prevented any potential border effect in the additional_options argument of install and advanced_install - 448. By Valentin Hirschi
-
1. Safeguarded against border effects in additional_options of advanced_install
2. Removed the random doubling of '--logging=' which caused troubles. - 449. By Valentin Hirschi
-
1. removed left-over print statemnt.
- 450. By Olivier Mattelaer
-
fix review number 5, 37 and 41
- 451. By Olivier Mattelaer
-
fix point of the review #12
- 452. By Valentin Hirschi
-
1. modified the steering of MA5 so that now the switch is of the 'analysis' type.
- 453. By Valentin Hirschi
-
1. Merged with latest version of 2.5.0 with e+ e- systematics
- 454. By Valentin Hirschi
-
1. Treated points 1-23 of the review.
- 455. By Valentin Hirschi
-
1. Minor fix.
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
OK here is the final part of my review (mainly concerning MA5/interface)
45) install MadAnalysis command should install MA5 and not MA4
a new command "install MadAnalysis4" should be include for installing MA4
46) the log of MA5 should be written in a file and not on screen.
47) The auto-completion is now broken by the following command:
launch PROC_sm_0 - i
quit
#still has MadEvent completion command
48) the auto-completion of do_xxx returns now multiple times the same function
49) when running only parton level (no shower) an empty line in the html "hadron_MA5" is present...
50) the launch command (and launch -i) is not put in the history of command (so not accessible with up arrow)
51) Having MA5 running (without crash) both before and after the parton-shower. (lot of progress in that directly! but still work requested.)
Cheers,
Olivier
- 456. By Valentin Hirschi
-
1. changed default value of sys_matchscale
- 457. By Valentin Hirschi
-
1. Esthetics changes
- 458. By Olivier Mattelaer
-
fix for point #17,24,47,48
- 459. By Olivier Mattelaer
-
try to fix point 3 and 4. (plus some other small fix not in the review)
- 460. By Valentin Hirschi
-
1. Several improvements on MA5 steering.
- 461. By Valentin Hirschi
-
1. Changed install MadAnalysis to MadAnalysis4
- 462. By Valentin Hirschi
-
1. Removed one consistency_
warning_ function copy in misc. - 463. By Valentin Hirschi
-
1. Attended to the last points of the review
- 464. By Olivier Mattelaer
-
fixing a unittest
- 465. By Valentin Hirschi
-
1. Fixed a couple tests
- 466. By Olivier Mattelaer
-
fix review point #44 + fix ConfigFile/update tests
- 467. By Olivier Mattelaer
-
fix py8 html display. force sum for py6, improve status of py8
- 468. By Olivier Mattelaer
-
pass via status_update for reporting that MA5 is running
- 469. By Valentin Hirschi
-
1. Fixed the unit tests test_w_nlo_gen
- 470. By Valentin Hirschi
-
1. Small fixes related to what was seen during various tests with Olivier.
- 471. By Olivier Mattelaer
-
fixing multiple bug found thanks to the acceptance test created_
matched_ plot - 472. By Valentin Hirschi
-
1. Fix MG5 crash when MA5 fail to start when generating cards.
- 473. By Olivier Mattelaer
-
remove a debug statement
- 474. By Olivier Mattelaer
-
fixing test related to the automatic consistency of the cards. Checking in detail the new behavior to ensure that no side effect has been introduced
- 475. By Valentin Hirschi
-
1. Fixed the missing process list when doing nlo parrallel generations.
2. Fixed two parallel test. - 476. By Olivier Mattelaer
-
allow question for installation to recognise pre-existing part of installaton
- 477. By Valentin Hirschi
-
1. Merged witht he bias branch
- 478. By Olivier Mattelaer
-
modification for the new strategy of installation of MA5
- 479. By Olivier Mattelaer
-
update IOTEST
- 480. By Olivier Mattelaer
-
add MA5 banner in MA5 log
- 481. By Valentin Hirschi
-
1. updated offline tarballs and added two tests to test them.
2. Updated the do_install function features so as to comply with the new HEPToolsInstaller behavior for MA5. - 482. By Valentin Hirschi
-
1. Change the default name of the fifo pipe to comply with MadAnalysis need of having the .hepmc extension.
- 483. By Valentin Hirschi
-
1. Removed a left over test code.
- 484. By Valentin Hirschi
-
1. Implemented support for the MA5 card tag '@MG5aMC skip_analysis'
2. Improved the printout of the MG5aMC distrib short parrallel tests. - 485. By Olivier Mattelaer
-
fixing the short_parralel tests
- 486. By Valentin Hirschi
-
1. Improved fifo comments in card.
2. Made sure MA5 runs on one fifo only.
Preview Diff
1 | === modified file 'Template/Common/Cards/delphes_card_ATLAS.dat' |
2 | --- Template/Common/Cards/delphes_card_ATLAS.dat 2015-11-10 11:23:55 +0000 |
3 | +++ Template/Common/Cards/delphes_card_ATLAS.dat 2016-09-01 23:40:50 +0000 |
4 | @@ -31,6 +31,8 @@ |
5 | |
6 | NeutrinoFilter |
7 | GenJetFinder |
8 | + GenMissingET |
9 | + |
10 | FastJetFinder |
11 | |
12 | JetEnergyScale |
13 | @@ -138,9 +140,9 @@ |
14 | # set ResolutionFormula {resolution formula as a function of eta and pt} |
15 | |
16 | # resolution formula for charged hadrons |
17 | - set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.06^2 + pt^2*1.3e-3^2) + |
18 | - (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.10^2 + pt^2*1.7e-3^2) + |
19 | - (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.25^2 + pt^2*3.1e-3^2)} |
20 | + set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.01^2 + pt^2*1.5e-4^2) + |
21 | + (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.015^2 + pt^2*2.5e-4^2) + |
22 | + (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.025^2 + pt^2*5.5e-4^2)} |
23 | } |
24 | |
25 | ################################### |
26 | @@ -154,9 +156,9 @@ |
27 | # set ResolutionFormula {resolution formula as a function of eta and energy} |
28 | |
29 | # resolution formula for electrons |
30 | - set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.06^2 + pt^2*1.3e-3^2) + |
31 | - (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.10^2 + pt^2*1.7e-3^2) + |
32 | - (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.25^2 + pt^2*3.1e-3^2)} |
33 | + set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.03^2 + pt^2*1.3e-3^2) + |
34 | + (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.05^2 + pt^2*1.7e-3^2) + |
35 | + (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.15^2 + pt^2*3.1e-3^2)} |
36 | } |
37 | |
38 | ############################### |
39 | @@ -168,11 +170,10 @@ |
40 | set OutputArray muons |
41 | |
42 | # set ResolutionFormula {resolution formula as a function of eta and pt} |
43 | - |
44 | # resolution formula for muons |
45 | - set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.02^2 + pt^2*2.0e-4^2) + |
46 | - (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.03^2 + pt^2*3.0e-4^2) + |
47 | - (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.06^2 + pt^2*6.0e-4^2)} |
48 | + set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.01^2 + pt^2*1.0e-4^2) + |
49 | + (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.015^2 + pt^2*1.5e-4^2) + |
50 | + (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.025^2 + pt^2*3.5e-4^2)} |
51 | } |
52 | |
53 | ############## |
54 | @@ -312,7 +313,7 @@ |
55 | |
56 | set PTMin 0.5 |
57 | |
58 | - set PTRatioMax 0.1 |
59 | + set PTRatioMax 0.12 |
60 | } |
61 | |
62 | ################# |
63 | @@ -358,7 +359,7 @@ |
64 | |
65 | set PTMin 0.5 |
66 | |
67 | - set PTRatioMax 0.1 |
68 | + set PTRatioMax 0.12 |
69 | } |
70 | |
71 | ################# |
72 | @@ -392,7 +393,7 @@ |
73 | |
74 | set PTMin 0.5 |
75 | |
76 | - set PTRatioMax 0.1 |
77 | + set PTRatioMax 0.25 |
78 | } |
79 | |
80 | ################### |
81 | @@ -456,6 +457,18 @@ |
82 | } |
83 | |
84 | |
85 | +######################### |
86 | +# Gen Missing ET merger |
87 | +######################## |
88 | + |
89 | +module Merger GenMissingET { |
90 | +# add InputArray InputArray |
91 | + add InputArray NeutrinoFilter/filteredParticles |
92 | + set MomentumOutputArray momentum |
93 | +} |
94 | + |
95 | + |
96 | + |
97 | ############ |
98 | # Jet finder |
99 | ############ |
100 | @@ -530,23 +543,36 @@ |
101 | # tau-tagging |
102 | ############# |
103 | |
104 | -module TauTagging TauTagging { |
105 | +module TrackCountingTauTagging TauTagging { |
106 | + |
107 | set ParticleInputArray Delphes/allParticles |
108 | set PartonInputArray Delphes/partons |
109 | + set TrackInputArray TrackMerger/tracks |
110 | set JetInputArray JetEnergyScale/jets |
111 | |
112 | - set DeltaR 0.5 |
113 | + set DeltaR 0.2 |
114 | + set DeltaRTrack 0.2 |
115 | |
116 | + set TrackPTMin 1.0 |
117 | + |
118 | set TauPTMin 1.0 |
119 | - |
120 | set TauEtaMax 2.5 |
121 | |
122 | - # add EfficiencyFormula {abs(PDG code)} {efficiency formula as a function of eta and pt} |
123 | + # instructions: {n-prongs} {eff} |
124 | + |
125 | + # 1 - one prong efficiency |
126 | + # 2 - two or more efficiency |
127 | + # -1 - one prong mistag rate |
128 | + # -2 - two or more mistag rate |
129 | + |
130 | + set BitNumber 0 |
131 | + |
132 | + # taken from ATL-PHYS-PUB-2015-045 (medium working point) |
133 | + add EfficiencyFormula {1} {0.70} |
134 | + add EfficiencyFormula {2} {0.60} |
135 | + add EfficiencyFormula {-1} {0.02} |
136 | + add EfficiencyFormula {-2} {0.01} |
137 | |
138 | - # default efficiency formula (misidentification rate) |
139 | - add EfficiencyFormula {0} {0.01} |
140 | - # efficiency formula for tau-jets |
141 | - add EfficiencyFormula {15} {0.6} |
142 | } |
143 | |
144 | ##################################################### |
145 | @@ -582,6 +608,8 @@ |
146 | add Branch Calorimeter/eflowNeutralHadrons EFlowNeutralHadron Tower |
147 | |
148 | add Branch GenJetFinder/jets GenJet Jet |
149 | + add Branch GenMissingET/momentum GenMissingET MissingET |
150 | + |
151 | add Branch UniqueObjectFinder/jets Jet Jet |
152 | add Branch UniqueObjectFinder/electrons Electron Electron |
153 | add Branch UniqueObjectFinder/photons Photon Photon |
154 | |
155 | === modified file 'Template/Common/Cards/delphes_card_CMS.dat' |
156 | --- Template/Common/Cards/delphes_card_CMS.dat 2015-11-10 11:23:55 +0000 |
157 | +++ Template/Common/Cards/delphes_card_CMS.dat 2016-09-01 23:40:50 +0000 |
158 | @@ -31,6 +31,8 @@ |
159 | |
160 | NeutrinoFilter |
161 | GenJetFinder |
162 | + GenMissingET |
163 | + |
164 | FastJetFinder |
165 | |
166 | JetEnergyScale |
167 | @@ -139,9 +141,9 @@ |
168 | |
169 | # resolution formula for charged hadrons |
170 | # based on arXiv:1405.6569 |
171 | - set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.06^2 + pt^2*1.3e-3^2) + |
172 | - (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.10^2 + pt^2*1.7e-3^2) + |
173 | - (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.25^2 + pt^2*3.1e-3^2)} |
174 | + set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.01^2 + pt^2*1.5e-4^2) + |
175 | + (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.015^2 + pt^2*2.5e-4^2) + |
176 | + (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.025^2 + pt^2*5.5e-4^2)} |
177 | } |
178 | |
179 | ################################### |
180 | @@ -156,9 +158,9 @@ |
181 | |
182 | # resolution formula for electrons |
183 | # based on arXiv:1405.6569 |
184 | - set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.06^2 + pt^2*1.3e-3^2) + |
185 | - (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.10^2 + pt^2*1.7e-3^2) + |
186 | - (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.25^2 + pt^2*3.1e-3^2)} |
187 | + set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.03^2 + pt^2*1.3e-3^2) + |
188 | + (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.05^2 + pt^2*1.7e-3^2) + |
189 | + (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.15^2 + pt^2*3.1e-3^2)} |
190 | } |
191 | |
192 | ############################### |
193 | @@ -172,9 +174,9 @@ |
194 | # set ResolutionFormula {resolution formula as a function of eta and pt} |
195 | |
196 | # resolution formula for muons |
197 | - set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.01^2 + pt^2*2.0e-4^2) + |
198 | - (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.02^2 + pt^2*3.0e-4^2) + |
199 | - (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.05^2 + pt^2*6.0e-4^2)} |
200 | + set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.01^2 + pt^2*1.0e-4^2) + |
201 | + (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.015^2 + pt^2*1.5e-4^2) + |
202 | + (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.025^2 + pt^2*3.5e-4^2)} |
203 | } |
204 | |
205 | ############## |
206 | @@ -266,8 +268,10 @@ |
207 | add EnergyFraction {3122} {0.3 0.7} |
208 | |
209 | # set ECalResolutionFormula {resolution formula as a function of eta and energy} |
210 | - set ECalResolutionFormula { (abs(eta) <= 3.0) * sqrt(energy^2*0.007^2 + energy*0.07^2 + 0.35^2) + |
211 | - (abs(eta) > 3.0 && abs(eta) <= 5.0) * sqrt(energy^2*0.107^2 + energy*2.08^2)} |
212 | + # Eta shape from arXiv:1306.2016, Energy shape from arXiv:1502.02701 |
213 | + set ECalResolutionFormula { (abs(eta) <= 1.5) * (1+0.64*eta^2) * sqrt(energy^2*0.008^2 + energy*0.11^2 + 0.40^2) + |
214 | + (abs(eta) > 1.5 && abs(eta) <= 2.5) * (2.16 + 5.6*(abs(eta)-2)^2) * sqrt(energy^2*0.008^2 + energy*0.11^2 + 0.40^2) + |
215 | + (abs(eta) > 2.5 && abs(eta) <= 5.0) * sqrt(energy^2*0.107^2 + energy*2.08^2)} |
216 | |
217 | # set HCalResolutionFormula {resolution formula as a function of eta and energy} |
218 | set HCalResolutionFormula { (abs(eta) <= 3.0) * sqrt(energy^2*0.050^2 + energy*1.50^2) + |
219 | @@ -317,7 +321,7 @@ |
220 | |
221 | set PTMin 0.5 |
222 | |
223 | - set PTRatioMax 0.1 |
224 | + set PTRatioMax 0.12 |
225 | } |
226 | |
227 | ################# |
228 | @@ -363,7 +367,7 @@ |
229 | |
230 | set PTMin 0.5 |
231 | |
232 | - set PTRatioMax 0.1 |
233 | + set PTRatioMax 0.12 |
234 | } |
235 | |
236 | ################# |
237 | @@ -399,7 +403,7 @@ |
238 | |
239 | set PTMin 0.5 |
240 | |
241 | - set PTRatioMax 0.1 |
242 | + set PTRatioMax 0.25 |
243 | } |
244 | |
245 | ################### |
246 | @@ -463,6 +467,17 @@ |
247 | set JetPTMin 20.0 |
248 | } |
249 | |
250 | +######################### |
251 | +# Gen Missing ET merger |
252 | +######################## |
253 | + |
254 | +module Merger GenMissingET { |
255 | +# add InputArray InputArray |
256 | + add InputArray NeutrinoFilter/filteredParticles |
257 | + set MomentumOutputArray momentum |
258 | +} |
259 | + |
260 | + |
261 | |
262 | ############ |
263 | # Jet finder |
264 | @@ -526,7 +541,7 @@ |
265 | # based on arXiv:1211.4462 |
266 | |
267 | # default efficiency formula (misidentification rate) |
268 | - add EfficiencyFormula {0} {0.01+0.00038*pt} |
269 | + add EfficiencyFormula {0} {0.01+0.000038*pt} |
270 | |
271 | # efficiency formula for c-jets (misidentification rate) |
272 | add EfficiencyFormula {4} {0.25*tanh(0.018*pt)*(1/(1+ 0.0013*pt))} |
273 | @@ -591,6 +606,8 @@ |
274 | add Branch Calorimeter/eflowNeutralHadrons EFlowNeutralHadron Tower |
275 | |
276 | add Branch GenJetFinder/jets GenJet Jet |
277 | + add Branch GenMissingET/momentum GenMissingET MissingET |
278 | + |
279 | add Branch UniqueObjectFinder/jets Jet Jet |
280 | add Branch UniqueObjectFinder/electrons Electron Electron |
281 | add Branch UniqueObjectFinder/photons Photon Photon |
282 | |
283 | === modified file 'Template/Common/Cards/delphes_card_default.dat' |
284 | --- Template/Common/Cards/delphes_card_default.dat 2015-11-10 11:23:55 +0000 |
285 | +++ Template/Common/Cards/delphes_card_default.dat 2016-09-01 23:40:50 +0000 |
286 | @@ -31,6 +31,8 @@ |
287 | |
288 | NeutrinoFilter |
289 | GenJetFinder |
290 | + GenMissingET |
291 | + |
292 | FastJetFinder |
293 | |
294 | JetEnergyScale |
295 | @@ -139,9 +141,9 @@ |
296 | |
297 | # resolution formula for charged hadrons |
298 | # based on arXiv:1405.6569 |
299 | - set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.06^2 + pt^2*1.3e-3^2) + |
300 | - (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.10^2 + pt^2*1.7e-3^2) + |
301 | - (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.25^2 + pt^2*3.1e-3^2)} |
302 | + set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.01^2 + pt^2*1.5e-4^2) + |
303 | + (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.015^2 + pt^2*2.5e-4^2) + |
304 | + (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.025^2 + pt^2*5.5e-4^2)} |
305 | } |
306 | |
307 | ################################### |
308 | @@ -156,9 +158,9 @@ |
309 | |
310 | # resolution formula for electrons |
311 | # based on arXiv:1405.6569 |
312 | - set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.06^2 + pt^2*1.3e-3^2) + |
313 | - (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.10^2 + pt^2*1.7e-3^2) + |
314 | - (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.25^2 + pt^2*3.1e-3^2)} |
315 | + set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.03^2 + pt^2*1.3e-3^2) + |
316 | + (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.05^2 + pt^2*1.7e-3^2) + |
317 | + (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.15^2 + pt^2*3.1e-3^2)} |
318 | } |
319 | |
320 | ############################### |
321 | @@ -172,9 +174,9 @@ |
322 | # set ResolutionFormula {resolution formula as a function of eta and pt} |
323 | |
324 | # resolution formula for muons |
325 | - set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.01^2 + pt^2*2.0e-4^2) + |
326 | - (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.02^2 + pt^2*3.0e-4^2) + |
327 | - (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.05^2 + pt^2*6.0e-4^2)} |
328 | + set ResolutionFormula { (abs(eta) <= 0.5) * (pt > 0.1) * sqrt(0.01^2 + pt^2*1.0e-4^2) + |
329 | + (abs(eta) > 0.5 && abs(eta) <= 1.5) * (pt > 0.1) * sqrt(0.015^2 + pt^2*1.5e-4^2) + |
330 | + (abs(eta) > 1.5 && abs(eta) <= 2.5) * (pt > 0.1) * sqrt(0.025^2 + pt^2*3.5e-4^2)} |
331 | } |
332 | |
333 | ############## |
334 | @@ -266,8 +268,10 @@ |
335 | add EnergyFraction {3122} {0.3 0.7} |
336 | |
337 | # set ECalResolutionFormula {resolution formula as a function of eta and energy} |
338 | - set ECalResolutionFormula { (abs(eta) <= 3.0) * sqrt(energy^2*0.007^2 + energy*0.07^2 + 0.35^2) + |
339 | - (abs(eta) > 3.0 && abs(eta) <= 5.0) * sqrt(energy^2*0.107^2 + energy*2.08^2)} |
340 | + # Eta shape from arXiv:1306.2016, Energy shape from arXiv:1502.02701 |
341 | + set ECalResolutionFormula { (abs(eta) <= 1.5) * (1+0.64*eta^2) * sqrt(energy^2*0.008^2 + energy*0.11^2 + 0.40^2) + |
342 | + (abs(eta) > 1.5 && abs(eta) <= 2.5) * (2.16 + 5.6*(abs(eta)-2)^2) * sqrt(energy^2*0.008^2 + energy*0.11^2 + 0.40^2) + |
343 | + (abs(eta) > 2.5 && abs(eta) <= 5.0) * sqrt(energy^2*0.107^2 + energy*2.08^2)} |
344 | |
345 | # set HCalResolutionFormula {resolution formula as a function of eta and energy} |
346 | set HCalResolutionFormula { (abs(eta) <= 3.0) * sqrt(energy^2*0.050^2 + energy*1.50^2) + |
347 | @@ -317,7 +321,7 @@ |
348 | |
349 | set PTMin 0.5 |
350 | |
351 | - set PTRatioMax 0.1 |
352 | + set PTRatioMax 0.12 |
353 | } |
354 | |
355 | ################# |
356 | @@ -363,7 +367,7 @@ |
357 | |
358 | set PTMin 0.5 |
359 | |
360 | - set PTRatioMax 0.1 |
361 | + set PTRatioMax 0.12 |
362 | } |
363 | |
364 | ################# |
365 | @@ -399,7 +403,7 @@ |
366 | |
367 | set PTMin 0.5 |
368 | |
369 | - set PTRatioMax 0.1 |
370 | + set PTRatioMax 0.25 |
371 | } |
372 | |
373 | ################### |
374 | @@ -463,6 +467,17 @@ |
375 | set JetPTMin 20.0 |
376 | } |
377 | |
378 | +######################### |
379 | +# Gen Missing ET merger |
380 | +######################## |
381 | + |
382 | +module Merger GenMissingET { |
383 | +# add InputArray InputArray |
384 | + add InputArray NeutrinoFilter/filteredParticles |
385 | + set MomentumOutputArray momentum |
386 | +} |
387 | + |
388 | + |
389 | |
390 | ############ |
391 | # Jet finder |
392 | @@ -526,7 +541,7 @@ |
393 | # based on arXiv:1211.4462 |
394 | |
395 | # default efficiency formula (misidentification rate) |
396 | - add EfficiencyFormula {0} {0.01+0.00038*pt} |
397 | + add EfficiencyFormula {0} {0.01+0.000038*pt} |
398 | |
399 | # efficiency formula for c-jets (misidentification rate) |
400 | add EfficiencyFormula {4} {0.25*tanh(0.018*pt)*(1/(1+ 0.0013*pt))} |
401 | @@ -591,6 +606,8 @@ |
402 | add Branch Calorimeter/eflowNeutralHadrons EFlowNeutralHadron Tower |
403 | |
404 | add Branch GenJetFinder/jets GenJet Jet |
405 | + add Branch GenMissingET/momentum GenMissingET MissingET |
406 | + |
407 | add Branch UniqueObjectFinder/jets Jet Jet |
408 | add Branch UniqueObjectFinder/electrons Electron Electron |
409 | add Branch UniqueObjectFinder/photons Photon Photon |
410 | |
411 | === added file 'Template/LO/Cards/pythia8_card_default.dat' |
412 | --- Template/LO/Cards/pythia8_card_default.dat 1970-01-01 00:00:00 +0000 |
413 | +++ Template/LO/Cards/pythia8_card_default.dat 2016-09-01 23:40:50 +0000 |
414 | @@ -0,0 +1,72 @@ |
415 | +! |
416 | +! Pythia8 cmd card automatically generated by MadGraph5_aMC@NLO |
417 | +! For more information on the use of the MG5aMC / Pythia8 interface, visit |
418 | +! https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/LOPY8Merging |
419 | +! |
420 | +! ================== |
421 | +! General parameters |
422 | +! ================== |
423 | +! |
424 | +Main:numberOfEvents = -1 |
425 | +! |
426 | +! ------------------------------------------------------------------- |
427 | +! Specify the HEPMC output of the Pythia8 shower. You can set it to: |
428 | +! auto : MG5aMC will automatically place it the run_<i> directory |
429 | +! /dev/null : to turn off the HEPMC output. |
430 | +! <path> : to select where the HEPMC file must written. It will |
431 | +! therefore not be placed in the run_<i> directory. The |
432 | +! specified path, if not absolute, will be relative to |
433 | +! the Event/run_<i> directory of the process output. |
434 | +! fifo : to have MG5aMC setup the piping of the PY8 output to |
435 | +! analysis tools such as MadAnalysis5. |
436 | +! fifo@<fifo_path> : |
437 | +! Same as 'fifo', but selecting a custom path to create the |
438 | +! fifo pipe. (useful to select a mounted drive that supports |
439 | +! fifo). Note that the fifo file extension *must* be '.hepmc.fifo'. |
440 | +! ------------------------------------------------------------------- |
441 | +! |
442 | +HEPMCoutput:file = auto |
443 | +! |
444 | +! -------------------------------------------------------------------- |
445 | +! Parameters relevant only when performing MLM merging, which can be |
446 | +! turned on by setting ickkw to '1' in the run_card and chosing a |
447 | +! positive value for the parameter xqcut. |
448 | +! For details, see section 'Jet Matching' on the left-hand menu of |
449 | +! http://home.thep.lu.se/~torbjorn/pythia81html/Welcome.html |
450 | +! -------------------------------------------------------------------- |
451 | +! If equal to -1.0, MadGraph5_aMC@NLO will set it automatically based |
452 | +! on the parameter 'xqcut' of the run_card.dat |
453 | +JetMatching:qCut = -1.0 |
454 | +! Use default kt-MLM to match parton level jets to those produced by the |
455 | +! shower. But the other Shower-kt scheme is available too with this option. |
456 | +JetMatching:doShowerKt = off |
457 | +! A value of -1 means that it is automatically guessed by MadGraph. |
458 | +! It is however always safer to explicitly set it. |
459 | +JetMatching:nJetMax = -1 |
460 | +! |
461 | +! -------------------------------------------------------------------- |
462 | +! Parameters relevant only when performing CKKW-L merging, which can |
463 | +! be turned on by setting the parameter 'ptlund' *or* 'ktdurham' to |
464 | +! a positive value. |
465 | +! For details, see section 'CKKW-L Merging' on the left-hand menu of |
466 | +! http://home.thep.lu.se/~torbjorn/pythia81html/Welcome.html |
467 | +! -------------------------------------------------------------------- |
468 | +! Central merging scale values you want to be used. |
469 | +! If equal to -1.0, then MadGraph5_aMC@NLO will set this automatically |
470 | +! based on the parameter 'ktdurham' of the run_card.dat |
471 | +Merging:TMS = -1.0 |
472 | +! This must be set manually, according to Pythia8 directives. |
473 | +! An example of possible value is 'pp>LEPTONS,NEUTRINOS' |
474 | +Merging:Process = <set_by_user> |
475 | +! A value of -1 means that it is automatically guessed by MadGraph. |
476 | +! It is however always safer to explicitly set it. |
477 | +Merging:nJetMax = -1 |
478 | +! |
479 | +! For all merging schemes, decide wehter you want the merging scale |
480 | +! variation computed for only the central weights or all other |
481 | +! PDF and scale variation weights as well |
482 | +SysCalc:fullCutVariation = off |
483 | +! |
484 | +! ========================== |
485 | +! User customized parameters |
486 | +! ========================== |
487 | |
488 | === modified file 'Template/LO/Cards/run_card.dat' |
489 | --- Template/LO/Cards/run_card.dat 2016-08-19 12:59:53 +0000 |
490 | +++ Template/LO/Cards/run_card.dat 2016-09-01 23:40:50 +0000 |
491 | @@ -21,10 +21,6 @@ |
492 | #********************************************************************* |
493 | %(run_tag)s = run_tag ! name of the run |
494 | #********************************************************************* |
495 | -# Run to generate the grid pack * |
496 | -#********************************************************************* |
497 | - %(gridpack)s = gridpack !True = setting up the grid pack |
498 | -#********************************************************************* |
499 | # Number of events and rnd seed * |
500 | # Warning: Do not generate more than 1M events in a single run * |
501 | # If you want to run Pythia, avoid more than 50k events in a run. * |
502 | @@ -61,51 +57,55 @@ |
503 | %(dynamical_scale_choice)s = dynamical_scale_choice ! Choose one of the preselected dynamical choices |
504 | %(scalefact)s = scalefact ! scale factor for event-by-event scales |
505 | #********************************************************************* |
506 | -# Time of flight information. (-1 means not run) |
507 | -#********************************************************************* |
508 | - %(time_of_flight)s = time_of_flight ! threshold below which info is not written |
509 | -#********************************************************************* |
510 | -# Matching - Warning! ickkw > 1 is still beta |
511 | -#********************************************************************* |
512 | - %(ickkw)s = ickkw ! 0 no matching, 1 MLM, 2 CKKW matching |
513 | - %(highestmult)s = highestmult ! for ickkw=2, highest mult group |
514 | - %(ktscheme)s = ktscheme ! for ickkw=1, 1 Durham kT, 2 Pythia pTE |
515 | +# Type and output format |
516 | +#********************************************************************* |
517 | + %(gridpack)s = gridpack !True = setting up the grid pack |
518 | + %(time_of_flight)s = time_of_flight ! threshold below which info is not written (-1 means not written) |
519 | + %(lhe_version)s = lhe_version ! Change the way clustering information pass to shower. |
520 | + %(clusinfo)s = clusinfo ! include clustering tag in output |
521 | + %(event_norm)s = event_norm ! average/sum. Normalization of the weight in the LHEF |
522 | + |
523 | +#********************************************************************* |
524 | +# Matching parameter (MLM only) |
525 | +#********************************************************************* |
526 | + %(ickkw)s = ickkw ! 0 no matching, 1 MLM |
527 | %(alpsfact)s = alpsfact ! scale factor for QCD emission vx |
528 | %(chcluster)s = chcluster ! cluster only according to channel diag |
529 | - %(pdfwgt)s = pdfwgt ! for ickkw=1, perform pdf reweighting |
530 | %(asrwgtflavor)s = asrwgtflavor ! highest quark flavor for a_s reweight |
531 | - %(clusinfo)s = clusinfo ! include clustering tag in output |
532 | - %(lhe_version)s = lhe_version ! Change the way clustering information pass to shower. |
533 | -#********************************************************************* |
534 | -#********************************************************** |
535 | -# |
536 | -#********************************************************** |
537 | -# Automatic ptj and mjj cuts if xqcut > 0 |
538 | -# (turn off for VBF and single top processes) |
539 | -#********************************************************** |
540 | - %(auto_ptj_mjj)s = auto_ptj_mjj ! Automatic setting of ptj and mjj |
541 | -#********************************************************** |
542 | + %(auto_ptj_mjj)s = auto_ptj_mjj ! Automatic setting of ptj and mjj if xqcut >0 |
543 | + ! (turn off for VBF and single top processes) |
544 | + %(xqcut)s = xqcut ! minimum kt jet measure between partons |
545 | +#********************************************************************* |
546 | +# |
547 | +#********************************************************************* |
548 | +# handling of the helicities: |
549 | +# 0: sum over all helicities |
550 | +# 1: importance sampling over helicities |
551 | +#********************************************************************* |
552 | + %(nhel)s = nhel ! using helicities importance sampling or not. |
553 | +#********************************************************************* |
554 | +# Generation bias, check the wiki page below for more information: * |
555 | +# 'cp3.irmp.ucl.ac.be/projects/madgraph/wiki/LOEventGenerationBias' * |
556 | +#********************************************************************* |
557 | + %(bias_module)s = bias_module ! Bias type of bias, [None, ptj_bias, <custom_folder>] |
558 | + %(bias_parameters)s = bias_parameters ! Specifies the parameters of the module. |
559 | +# |
560 | +#******************************* |
561 | +# Parton level cuts definition * |
562 | +#******************************* |
563 | # |
564 | -#********************************** |
565 | -# BW cutoff (M+/-bwcutoff*Gamma) |
566 | -#********************************** |
567 | +# |
568 | +#********************************************************************* |
569 | +# BW cutoff (M+/-bwcutoff*Gamma) ! Define on/off-shell for "$" and decay |
570 | +#********************************************************************* |
571 | %(bwcutoff)s = bwcutoff ! (M+/-bwcutoff*Gamma) |
572 | -#********************************************************** |
573 | +#********************************************************************* |
574 | # Apply pt/E/eta/dr/mij/kt_durham cuts on decay products or not |
575 | # (note that etmiss/ptll/ptheavy/ht/sorted cuts always apply) |
576 | -#************************************************************* |
577 | +#********************************************************************* |
578 | %(cut_decays)s = cut_decays ! Cut decay products |
579 | -#************************************************************* |
580 | -# Number of helicities to sum per event (0 = all helicities) |
581 | -# 0 gives more stable result, but longer run time (needed for |
582 | -# long decay chains e.g.). |
583 | -# Use >=2 if most helicities contribute, e.g. pure QCD. |
584 | -#************************************************************* |
585 | - %(nhel)s = nhel ! Number of helicities used per event |
586 | -#******************* |
587 | -# Standard Cuts |
588 | -#******************* |
589 | -# |
590 | +#********************************************************************* |
591 | +# Standard Cuts * |
592 | #********************************************************************* |
593 | # Minimum and maximum pt's (for max, -1 means no cut) * |
594 | #********************************************************************* |
595 | @@ -246,21 +246,20 @@ |
596 | #********************************************************************* |
597 | %(xetamin)s = xetamin ! minimum rapidity for two jets in the WBF case |
598 | %(deltaeta)s = deltaeta ! minimum rapidity for two jets in the WBF case |
599 | -#********************************************************************* |
600 | -# KT DURHAM CUT * |
601 | -#********************************************************************* |
602 | - %(ktdurham)s = ktdurham |
603 | - %(dparameter)s = dparameter |
604 | +#*********************************************************************** |
605 | +# Turn on either the ktdurham or ptlund cut to activate * |
606 | +# CKKW(L) merging with Pythia8 [arXiv:1410.3012, arXiv:1109.4829] * |
607 | +#*********************************************************************** |
608 | + %(ktdurham)s = ktdurham |
609 | + %(dparameter)s = dparameter |
610 | + %(ptlund)s = ptlund |
611 | + %(pdgs_for_merging_cut)s = pdgs_for_merging_cut ! PDGs for two cuts above |
612 | #********************************************************************* |
613 | # maximal pdg code for quark to be considered as a light jet * |
614 | # (otherwise b cuts are applied) * |
615 | #********************************************************************* |
616 | %(maxjetflavor)s = maxjetflavor ! Maximum jet pdg code |
617 | #********************************************************************* |
618 | -# Jet measure cuts * |
619 | -#********************************************************************* |
620 | - %(xqcut)s = xqcut ! minimum kt jet measure between partons |
621 | -#********************************************************************* |
622 | # |
623 | #********************************************************************* |
624 | # Store info for systematics studies * |
625 | @@ -281,3 +280,4 @@ |
626 | # PDF sets and number of members (0 or none for all members). |
627 | %(sys_pdf)s = sys_pdf # separate by && if more than one set. |
628 | # MSTW2008nlo68cl.LHgrid 1 = sys_pdf |
629 | +# |
630 | |
631 | === added directory 'Template/LO/Source/BIAS' |
632 | === added directory 'Template/LO/Source/BIAS/dummy' |
633 | === added file 'Template/LO/Source/BIAS/dummy/dummy.f' |
634 | --- Template/LO/Source/BIAS/dummy/dummy.f 1970-01-01 00:00:00 +0000 |
635 | +++ Template/LO/Source/BIAS/dummy/dummy.f 2016-09-01 23:40:50 +0000 |
636 | @@ -0,0 +1,44 @@ |
637 | +C ************************************************************ |
638 | +C Source for the library implementing a dummt bias function |
639 | +C always returns one |
640 | +C ************************************************************ |
641 | + |
642 | + subroutine bias_wgt(p, original_weight, bias_weight) |
643 | + implicit none |
644 | +C |
645 | +C Parameters |
646 | +C |
647 | + include '../../nexternal.inc' |
648 | +C |
649 | +C Arguments |
650 | +C |
651 | + double precision p(0:3,nexternal) |
652 | + double precision original_weight, bias_weight |
653 | +C |
654 | +C local variables |
655 | +C |
656 | +C |
657 | +C Global variables |
658 | +C |
659 | +C Mandatory common block to be defined in bias modules |
660 | +C |
661 | + double precision stored_bias_weight |
662 | + data stored_bias_weight/1.0d0/ |
663 | + logical impact_xsec, requires_full_event_info |
664 | +C Not impacting the xsec since the bias is 1.0. Therefore |
665 | +C bias_wgt will not be written in the lhe event file. |
666 | +C Setting it to .True. makes sure that it will not be written. |
667 | + data impact_xsec/.True./ |
668 | +C Of course this module does not require the full event |
669 | +C information (color, resonances, helicities, etc..) |
670 | + data requires_full_event_info/.False./ |
671 | + common/bias/stored_bias_weight,impact_xsec, |
672 | + & requires_full_event_info |
673 | + |
674 | +C -------------------- |
675 | +C BEGIN IMPLEMENTATION |
676 | +C -------------------- |
677 | + |
678 | + bias_weight = 1.0d0 |
679 | + |
680 | + end subroutine bias_wgt |
681 | |
682 | === added file 'Template/LO/Source/BIAS/dummy/makefile' |
683 | --- Template/LO/Source/BIAS/dummy/makefile 1970-01-01 00:00:00 +0000 |
684 | +++ Template/LO/Source/BIAS/dummy/makefile 2016-09-01 23:40:50 +0000 |
685 | @@ -0,0 +1,21 @@ |
686 | + |
687 | +include ../../make_opts |
688 | + |
689 | +all: dummy |
690 | + |
691 | +clean: |
692 | + $(RM) *.o $(BIASLIBDIR)$(BIASLIBRARY) |
693 | + |
694 | +# |
695 | +# Compilation of the module dummy |
696 | +# |
697 | + |
698 | +dummy: dummy.o |
699 | + $(call CREATELIB, $(BIASLIBDIR)$(BIASLIBRARY), $^) |
700 | + |
701 | +# |
702 | +# List of the requirements for this module. |
703 | +# 'VALID' is the keyword that *must* be returned if everything is in order. |
704 | +# |
705 | +requirements: |
706 | + @echo "VALID" |
707 | |
708 | === added directory 'Template/LO/Source/BIAS/ptj_bias' |
709 | === added file 'Template/LO/Source/BIAS/ptj_bias/makefile' |
710 | --- Template/LO/Source/BIAS/ptj_bias/makefile 1970-01-01 00:00:00 +0000 |
711 | +++ Template/LO/Source/BIAS/ptj_bias/makefile 2016-09-01 23:40:50 +0000 |
712 | @@ -0,0 +1,27 @@ |
713 | +include ../../make_opts |
714 | + |
715 | +all: ptj_bias |
716 | + |
717 | +clean: |
718 | + $(RM) *.o $(BIASLIBDIR)$(BIASLIBRARY) |
719 | + |
720 | +# |
721 | +# Compilation of the module ptj_bias |
722 | +# |
723 | +ptj_bias.o: ptj_bias.f ../bias.inc |
724 | + $(FC) $(FFLAGS) $(LDFLAGS) -c -o ptj_bias.o ptj_bias.f |
725 | + |
726 | +ptj_bias: ptj_bias.o |
727 | + $(call CREATELIB, $(BIASLIBDIR)$(BIASLIBRARY), $^) |
728 | + |
729 | +# |
730 | +# List of the requirements for this module. |
731 | +# 'VALID' is the keyword that *must* be returned if everything is in order. |
732 | +# |
733 | +requirements: |
734 | +ifeq ($(shell $(call CHECK_MG5AMC_VERSION,2.4.2)),True) |
735 | + @echo "VALID" |
736 | +else |
737 | + @echo "Error:: MG5aMC is not recent enough (found "$(MG5AMC_VERSION)")" |
738 | + @echo "FAIL" |
739 | +endif |
740 | |
741 | === added file 'Template/LO/Source/BIAS/ptj_bias/ptj_bias.f' |
742 | --- Template/LO/Source/BIAS/ptj_bias/ptj_bias.f 1970-01-01 00:00:00 +0000 |
743 | +++ Template/LO/Source/BIAS/ptj_bias/ptj_bias.f 2016-09-01 23:40:50 +0000 |
744 | @@ -0,0 +1,101 @@ |
745 | +C ************************************************************ |
746 | +C Source for the library implementing a bias function that |
747 | +C populates the large pt tale of the leading jet. |
748 | +C |
749 | +C The two options of this subroutine, that can be set in |
750 | +C the run card are: |
751 | +C > (double precision) ptj_bias_target_ptj : target ptj value |
752 | +C > (double precision) ptj_bias_enhancement_power : exponent |
753 | +C |
754 | +C Schematically, the functional form of the enhancement is |
755 | +C bias_wgt = [ptj(evt)/mean_ptj]^enhancement_power |
756 | +C ************************************************************ |
757 | +C |
758 | +C The following lines are read by MG5aMC to set what are the |
759 | +C relevant parameters for this bias module. |
760 | +C |
761 | +C parameters = {'ptj_bias_target_ptj': 1000.0, |
762 | +C 'ptj_bias_enhancement_power': 4.0} |
763 | +C |
764 | + |
765 | + subroutine bias_wgt(p, original_weight, bias_weight) |
766 | + implicit none |
767 | +C |
768 | +C Parameters |
769 | +C |
770 | + include '../../maxparticles.inc' |
771 | + include '../../nexternal.inc' |
772 | + |
773 | +C |
774 | +C Arguments |
775 | +C |
776 | + double precision p(0:3,nexternal) |
777 | + double precision original_weight, bias_weight |
778 | +C |
779 | +C local variables |
780 | +C |
781 | + integer i |
782 | + double precision ptj(nexternal) |
783 | + double precision max_ptj |
784 | +c |
785 | +c local variables defined in the run_card |
786 | +c |
787 | + double precision ptj_bias_target_ptj |
788 | + double precision ptj_bias_enhancement_power |
789 | +C |
790 | +C Global variables |
791 | +C |
792 | +C |
793 | +C Mandatory common block to be defined in bias modules |
794 | +C |
795 | + double precision stored_bias_weight |
796 | + data stored_bias_weight/1.0d0/ |
797 | + logical impact_xsec, requires_full_event_info |
798 | +C We only want to bias distributions, but not impact the xsec. |
799 | + data impact_xsec/.False./ |
800 | +C Of course this module does not require the full event |
801 | +C information (color, resonances, helicities, etc..) |
802 | + data requires_full_event_info/.False./ |
803 | + common/bias/stored_bias_weight,impact_xsec, |
804 | + & requires_full_event_info |
805 | +C |
806 | +C Accessingt the details of the event |
807 | +C |
808 | + logical is_a_j(nexternal),is_a_l(nexternal), |
809 | + & is_a_b(nexternal),is_a_a(nexternal), |
810 | + & is_a_onium(nexternal),is_a_nu(nexternal), |
811 | + & is_heavy(nexternal),do_cuts(nexternal) |
812 | + common/to_specisa/is_a_j,is_a_a,is_a_l,is_a_b,is_a_nu, |
813 | + & is_heavy,is_a_onium,do_cuts |
814 | + |
815 | +C |
816 | +C Setup the value of the parameters from the run_card |
817 | +C |
818 | + include '../bias.inc' |
819 | + |
820 | +C -------------------- |
821 | +C BEGIN IMPLEMENTATION |
822 | +C -------------------- |
823 | + |
824 | + do i=1,nexternal |
825 | + ptj(i)=-1.0d0 |
826 | + if (is_a_j(i)) then |
827 | + ptj(i)=sqrt(p(1,i)**2+p(2,i)**2) |
828 | + endif |
829 | + enddo |
830 | + |
831 | + max_ptj=-1.0d0 |
832 | + do i=1,nexternal |
833 | + max_ptj = max(max_ptj,ptj(i)) |
834 | + enddo |
835 | + if (max_ptj.lt.0.0d0) then |
836 | + bias_weight = 1.0d0 |
837 | + return |
838 | + endif |
839 | + |
840 | + bias_weight = (max_ptj/ptj_bias_target_ptj) |
841 | + & **ptj_bias_enhancement_power |
842 | + |
843 | + return |
844 | + |
845 | + end subroutine bias_wgt |
846 | |
847 | === modified file 'Template/LO/Source/cuts.inc' |
848 | --- Template/LO/Source/cuts.inc 2015-04-09 01:31:09 +0000 |
849 | +++ Template/LO/Source/cuts.inc 2016-09-01 23:40:50 +0000 |
850 | @@ -88,6 +88,10 @@ |
851 | REAL*8 KT_DURHAM, D_PARAMETER |
852 | LOGICAL DO_KT_DURHAM |
853 | COMMON /JET_MEASURE_CUTS/ KT_DURHAM, D_PARAMETER |
854 | - |
855 | - |
856 | - |
857 | \ No newline at end of file |
858 | + |
859 | +C COMMON BLOCK FOR PYTHIA JET MEASURE CUT |
860 | + REAL*8 PT_LUND |
861 | + COMMON /PYTHIA_MEASURE_CUTS/ PT_LUND |
862 | + |
863 | + |
864 | + |
865 | |
866 | === added file 'Template/LO/Source/lhe_event_infos.inc' |
867 | --- Template/LO/Source/lhe_event_infos.inc 1970-01-01 00:00:00 +0000 |
868 | +++ Template/LO/Source/lhe_event_infos.inc 2016-09-01 23:40:50 +0000 |
869 | @@ -0,0 +1,16 @@ |
870 | + integer jpart(7,-nexternal+3:2*nexternal-3) |
871 | + double precision pb(0:4,-nexternal+3:2*nexternal-3) |
872 | + integer isym(nexternal,99),jsym, npart |
873 | + double precision sscale,aaqcd,aaqed |
874 | + character*1000 buff |
875 | + character*(s_bufflen) s_buff(7) |
876 | + integer nclus |
877 | + character*(clus_bufflen) buffclus(nexternal) |
878 | + character*(maxEventLength) event_record |
879 | + logical AlreadySetInBiasModule |
880 | + |
881 | + common/to_lhe_event_info/jpart,pb,s_buff,buff,nclus,buffclus,event_record, |
882 | + & sscale,aaqcd,aaqed,isym,jsym,npart,AlreadySetInBiasModule |
883 | + |
884 | + integer ngroup |
885 | + common/to_group/ngroup |
886 | |
887 | === modified file 'Template/LO/Source/make_opts' |
888 | --- Template/LO/Source/make_opts 2016-08-26 13:55:42 +0000 |
889 | +++ Template/LO/Source/make_opts 2016-09-01 23:40:50 +0000 |
890 | @@ -2,11 +2,16 @@ |
891 | DEFAULT_F_COMPILER=gfortran |
892 | MACFLAG=-mmacosx-version-min=10.7 |
893 | DEFAULT_CPP_COMPILER=clang |
894 | +MG5AMC_VERSION=SpecifiedByMG5aMCAtRunTime |
895 | STDLIB=-lc++ |
896 | +PYTHIA8_PATH=NotInstalled |
897 | STDLIB_FLAG=-stdlib=libc++ |
898 | #end_of_make_opts_variables |
899 | + |
900 | +BIASLIBDIR=../../../lib/ |
901 | +BIASLIBRARY=libbias.$(libext) |
902 | + |
903 | # Rest of the makefile |
904 | - |
905 | ifeq ($(origin FFLAGS),undefined) |
906 | FFLAGS= -O -w -fbounds-check -fPIC |
907 | #FFLAGS+= -g -fbounds-check -ffpe-trap=invalid,zero,overflow,underflow,denormal -Wall |
908 | @@ -90,4 +95,9 @@ |
909 | else |
910 | alfas_functions=alfas_functions |
911 | llhapdf= |
912 | -endif |
913 | \ No newline at end of file |
914 | +endif |
915 | + |
916 | +# Helper function to check MG5 version |
917 | +define CHECK_MG5AMC_VERSION |
918 | +python -c 'import re; from distutils.version import StrictVersion; print StrictVersion("$(MG5AMC_VERSION)") >= StrictVersion("$(1)") if re.match("^[\d\.]+$$","$(MG5AMC_VERSION)") else True;' |
919 | +endef |
920 | \ No newline at end of file |
921 | |
922 | === modified file 'Template/LO/Source/run.inc' |
923 | --- Template/LO/Source/run.inc 2015-04-02 22:56:24 +0000 |
924 | +++ Template/LO/Source/run.inc 2016-09-01 23:40:50 +0000 |
925 | @@ -63,3 +63,11 @@ |
926 | C |
927 | logical MC_grouped_subproc |
928 | common/to_MC_grouped_subproc/MC_grouped_subproc |
929 | + |
930 | +C |
931 | +C Controls what are the PDGs included in the CKKWl merging procedure, i.e. what |
932 | +C are the PDGs subject to the ktdurham cut |
933 | +C |
934 | + integer pdgs_for_merging_cut(0:1000) |
935 | + common/TO_MERGE/pdgs_for_merging_cut |
936 | + |
937 | |
938 | === modified file 'Template/LO/Source/rw_events.f' |
939 | --- Template/LO/Source/rw_events.f 2014-10-07 13:31:57 +0000 |
940 | +++ Template/LO/Source/rw_events.f 2016-09-01 23:40:50 +0000 |
941 | @@ -30,7 +30,6 @@ |
942 | character*(s_bufflen) s_buff(*) |
943 | integer nclus |
944 | character*(clus_bufflen) buffclus(*) |
945 | - |
946 | c |
947 | c Local |
948 | c |
949 | @@ -46,6 +45,10 @@ |
950 | |
951 | data lun_ban/37/ |
952 | data banner_open/.false./ |
953 | + |
954 | + double precision bias_weight |
955 | + logical impact_xsec |
956 | + common/bias/bias_weight,impact_xsec |
957 | c----- |
958 | c Begin Code |
959 | c----- |
960 | @@ -80,6 +83,21 @@ |
961 | buff='' |
962 | endif |
963 | endif |
964 | + |
965 | +c Reading the bias weight (if present) |
966 | + read(lun,'(a300)',end=99,err=99) buftmp |
967 | + if(buftmp(1:6).ne.'<rwgt>') then |
968 | + backspace(lun) |
969 | + bias_weight = 1.0d0 |
970 | + else |
971 | + do while(buftmp(1:7).ne.'</rwgt>') |
972 | + read(lun,'(a300)',end=99,err=99) buftmp |
973 | + if (buftmp(1:16).eq."<wgt id='bias'> ") then |
974 | + read(buftmp(17:31),'(1e15.7)') bias_weight |
975 | + endif |
976 | + enddo |
977 | + endif |
978 | + |
979 | c Systematics info |
980 | read(lun,'(a)',end=99,err=99) s_buff(1) |
981 | if(s_buff(1).ne.'<mgrwt>') then |
982 | @@ -114,9 +132,103 @@ |
983 | 55 format(i3,5e19.11) |
984 | end |
985 | |
986 | + subroutine write_event_to_stream(evt_record,P,wgt,nexternal,ic, |
987 | + & ievent,scale,aqcd, aqed,buff,u_syst,s_buff,nclus,buffclus) |
988 | +c******************************************************************** |
989 | +C This an *exact* copy of write_event, except that it writes it |
990 | +C to a character array argument as opposed to an I/O stream. |
991 | +c******************************************************************** |
992 | + implicit none |
993 | + |
994 | + include 'maxparticles.inc' |
995 | + include 'run_config.inc' |
996 | +c |
997 | +c parameters |
998 | +c |
999 | + double precision pi |
1000 | + parameter (pi = 3.1415926d0) |
1001 | +c |
1002 | +c Arguments |
1003 | +c |
1004 | + character*(maxEventLength) evt_record |
1005 | + integer ievent |
1006 | + integer nexternal, ic(7,*) |
1007 | + double precision P(0:4,*),wgt |
1008 | + double precision aqcd, aqed, scale |
1009 | + character*1000 buff |
1010 | + logical u_syst |
1011 | + character*(s_bufflen) s_buff(*) |
1012 | + integer nclus |
1013 | + character*(clus_bufflen) buffclus(*) |
1014 | +c |
1015 | +c Local |
1016 | +c |
1017 | + integer i,j,k |
1018 | + character*(maxEventLength) largeBuff |
1019 | +c |
1020 | +c Global |
1021 | +c |
1022 | + double precision bias_weight |
1023 | + logical impact_xsec |
1024 | + common/bias/bias_weight,impact_xsec |
1025 | + |
1026 | +c----- |
1027 | +c Begin Code |
1028 | +c----- |
1029 | +c aqed= gal(1)*gal(1)/4d0/pi |
1030 | +c aqcd = g*g/4d0/pi |
1031 | + write(largeBuff,'(a)') '<event>' |
1032 | + evt_record=trim(evt_record)//trim(largeBuff) |
1033 | + write(largeBuff,'(i2,i4,4e15.7)') nexternal,ievent,wgt,scale, |
1034 | + $ aqed,aqcd |
1035 | + evt_record=trim(evt_record)//CHAR(13)//CHAR(10)//trim(largeBuff) |
1036 | + do i=1,nexternal |
1037 | + write(largeBuff,51) ic(1,i),ic(6,i),(ic(j,i),j=2,5), |
1038 | + $ (p(j,i),j=1,3),p(0,i),p(4,i),0.,real(ic(7,i)) |
1039 | + evt_record=trim(evt_record)//CHAR(13)//CHAR(10)//trim(largeBuff) |
1040 | + enddo |
1041 | + if(buff(1:7).eq.'<scales') then |
1042 | + write(largeBuff,'(a)') buff(1:len_trim(buff)) |
1043 | + evt_record=trim(evt_record)//CHAR(13)//CHAR(10)//trim(largeBuff) |
1044 | + endif |
1045 | + if(buff(1:1).eq.'#') then |
1046 | + write(largeBuff,'(a)') buff(1:len_trim(buff)) |
1047 | + evt_record=trim(evt_record)//CHAR(13)//CHAR(10)//trim(largeBuff) |
1048 | + endif |
1049 | + if(.not.impact_xsec) then |
1050 | + write(largeBuff,'(a)') '<rwgt>' |
1051 | + evt_record=trim(evt_record)//CHAR(13)//CHAR(10)//trim(largeBuff) |
1052 | + write(largeBuff,'(a16,1e15.7,a6)') "<wgt id='bias'> ", |
1053 | + $ bias_weight,"</wgt>" |
1054 | + evt_record=trim(evt_record)//CHAR(13)//CHAR(10)//trim(largeBuff) |
1055 | + write(largeBuff,'(a)') '</rwgt>' |
1056 | + evt_record=trim(evt_record)//CHAR(13)//CHAR(10)//trim(largeBuff) |
1057 | + endif |
1058 | + if(u_syst)then |
1059 | + do i=1,7 |
1060 | + write(largeBuff,'(a)') s_buff(i)(1:len_trim(s_buff(i))) |
1061 | + evt_record=trim(evt_record)//CHAR(13)//CHAR(10)//trim(largeBuff) |
1062 | + enddo |
1063 | + endif |
1064 | + do i=1,nclus |
1065 | + write(largeBuff,'(a)') buffclus(i)(1:len_trim(buffclus(i))) |
1066 | + evt_record=trim(evt_record)//CHAR(13)//CHAR(10)//trim(largeBuff) |
1067 | + enddo |
1068 | + write(largeBuff,'(a)') '</event>' |
1069 | + evt_record=trim(evt_record)//CHAR(13)//CHAR(10)//trim(largeBuff) |
1070 | + return |
1071 | + 51 format(i9,5i5,5e19.11,f3.0,f4.0) |
1072 | + end |
1073 | + |
1074 | + |
1075 | subroutine write_event(lun,P,wgt,nexternal,ic,ievent,scale,aqcd, |
1076 | $ aqed,buff,u_syst,s_buff,nclus,buffclus) |
1077 | c******************************************************************** |
1078 | +c |
1079 | +c /!\ When making changes to this subroutine, make sure to accordingly |
1080 | +c update write_event_to_stream |
1081 | +c |
1082 | +c******************************************************************** |
1083 | c Writes one event from data file #lun according to LesHouches |
1084 | c ic(1,*) = Particle ID |
1085 | c ic(2.*) = Mothup(1) |
1086 | @@ -154,6 +266,9 @@ |
1087 | c |
1088 | c Global |
1089 | c |
1090 | + double precision bias_weight |
1091 | + logical impact_xsec |
1092 | + common/bias/bias_weight,impact_xsec |
1093 | |
1094 | c----- |
1095 | c Begin Code |
1096 | @@ -168,7 +283,13 @@ |
1097 | $ (p(j,i),j=1,3),p(0,i),p(4,i),0.,real(ic(7,i)) |
1098 | enddo |
1099 | if(buff(1:7).eq.'<scales') write(lun,'(a)') buff(1:len_trim(buff)) |
1100 | - if(buff(1:1).eq.'#') write(lun,'(a)') buff(1:len_trim(buff)) |
1101 | + if(buff(1:1).eq.'#') write(lun,'(a)') buff(1:len_trim(buff)) |
1102 | + if(.not.impact_xsec) then |
1103 | + write(lun,'(a)') '<rwgt>' |
1104 | + write(lun,'(a16,1e15.7,a6)') "<wgt id='bias'> ",bias_weight, |
1105 | + $ "</wgt>" |
1106 | + write(lun,'(a)') '</rwgt>' |
1107 | + endif |
1108 | if(u_syst)then |
1109 | do i=1,7 |
1110 | write(lun,'(a)') s_buff(i)(1:len_trim(s_buff(i))) |
1111 | |
1112 | === modified file 'Template/LO/SubProcesses/cuts.f' |
1113 | --- Template/LO/SubProcesses/cuts.f 2016-06-07 09:33:55 +0000 |
1114 | +++ Template/LO/SubProcesses/cuts.f 2016-09-01 23:40:50 +0000 |
1115 | @@ -1,1319 +1,1750 @@ |
1116 | - logical function pass_point(p) |
1117 | -c************************************************************************ |
1118 | -c This function is called from sample to see if it needs to |
1119 | -c bother calculating the weight from all the different conficurations |
1120 | -c You can either just return true, or have it call passcuts |
1121 | -c************************************************************************ |
1122 | - implicit none |
1123 | -c |
1124 | -c Arguments |
1125 | -c |
1126 | - double precision p |
1127 | -c |
1128 | -c External |
1129 | -c |
1130 | - logical passcuts |
1131 | - external passcuts |
1132 | -c----- |
1133 | -c Begin Code |
1134 | -c----- |
1135 | - pass_point = .true. |
1136 | -c pass_point = passcuts(p) |
1137 | - end |
1138 | -C |
1139 | - LOGICAL FUNCTION PASSCUTS(P) |
1140 | -C************************************************************************** |
1141 | -C INPUT: |
1142 | -C P(0:3,1) MOMENTUM OF INCOMING PARTON |
1143 | -C P(0:3,2) MOMENTUM OF INCOMING PARTON |
1144 | -C P(0:3,3) MOMENTUM OF ... |
1145 | -C ALL MOMENTA ARE IN THE REST FRAME!! |
1146 | -C COMMON/JETCUTS/ CUTS ON JETS |
1147 | -C OUTPUT: |
1148 | -C TRUE IF EVENTS PASSES ALL CUTS LISTED |
1149 | -C************************************************************************** |
1150 | - IMPLICIT NONE |
1151 | -c |
1152 | -c Constants |
1153 | -c |
1154 | - include 'genps.inc' |
1155 | - include 'nexternal.inc' |
1156 | -C |
1157 | -C ARGUMENTS |
1158 | -C |
1159 | - REAL*8 P(0:3,nexternal) |
1160 | - |
1161 | -C |
1162 | -C LOCAL |
1163 | -C |
1164 | - LOGICAL FIRSTTIME,FIRSTTIME2,pass_bw,notgood,good,foundheavy |
1165 | - LOGICAL DEBUG |
1166 | - integer i,j,njets,nheavyjets,nleptons,hardj1,hardj2 |
1167 | - REAL*8 XVAR,ptmax1,ptmax2,htj,tmp,inclht |
1168 | - real*8 ptemp(0:3), ptemp2(0:3) |
1169 | - character*20 formstr |
1170 | -C |
1171 | -C PARAMETERS |
1172 | -C |
1173 | - real*8 PI |
1174 | - parameter( PI = 3.14159265358979323846d0 ) |
1175 | -C |
1176 | -C EXTERNAL |
1177 | -C |
1178 | - REAL*8 R2,DOT,ET,RAP,DJ,SumDot,pt,ALPHAS,PtDot |
1179 | - logical cut_bw,setclscales |
1180 | - external R2,DOT,ET,RAP,DJ,SumDot,pt,ALPHAS,cut_bw,setclscales,PtDot |
1181 | -C |
1182 | -C GLOBAL |
1183 | -C |
1184 | - include 'run.inc' |
1185 | - include 'cuts.inc' |
1186 | - |
1187 | - double precision ptjet(nexternal) |
1188 | - double precision ptheavyjet(nexternal) |
1189 | - double precision ptlepton(nexternal) |
1190 | - double precision temp |
1191 | - |
1192 | -C VARIABLES TO SPECIFY JETS |
1193 | - DOUBLE PRECISION PJET(NEXTERNAL,0:3) |
1194 | - DOUBLE PRECISION PTMIN |
1195 | - DOUBLE PRECISION PT1,PT2 |
1196 | - INTEGER K,J1,J2 |
1197 | - |
1198 | -C VARIABLES FOR KT CUT |
1199 | - DOUBLE PRECISION PTNOW,COSTH,PABS1,PABS2 |
1200 | - DOUBLE PRECISION ETA1,ETA2,COSH_DETA,COS_DPHI,KT1SQ,KT2SQ, DPHI |
1201 | - |
1202 | - double precision etmin(nincoming+1:nexternal),etamax(nincoming+1:nexternal) |
1203 | - double precision emin(nincoming+1:nexternal) |
1204 | - double precision r2min(nincoming+1:nexternal,nincoming+1:nexternal) |
1205 | - double precision s_min(nexternal,nexternal) |
1206 | - double precision etmax(nincoming+1:nexternal),etamin(nincoming+1:nexternal) |
1207 | - double precision emax(nincoming+1:nexternal) |
1208 | - double precision r2max(nincoming+1:nexternal,nincoming+1:nexternal) |
1209 | - double precision s_max(nexternal,nexternal) |
1210 | - double precision ptll_min(nexternal,nexternal),ptll_max(nexternal,nexternal) |
1211 | - double precision inclHtmin,inclHtmax |
1212 | - common/to_cuts/ etmin, emin, etamax, r2min, s_min, |
1213 | - $ etmax, emax, etamin, r2max, s_max, ptll_min, ptll_max, inclHtmin,inclHtmax |
1214 | - |
1215 | - double precision ptjmin4(4),ptjmax4(4),htjmin4(2:4),htjmax4(2:4) |
1216 | - logical jetor |
1217 | - common/to_jet_cuts/ ptjmin4,ptjmax4,htjmin4,htjmax4,jetor |
1218 | - |
1219 | - double precision ptlmin4(4),ptlmax4(4) |
1220 | - common/to_lepton_cuts/ ptlmin4,ptlmax4 |
1221 | - |
1222 | -c |
1223 | -c Special cuts |
1224 | -c |
1225 | - |
1226 | - integer lbw(0:nexternal) !Use of B.W. |
1227 | - common /to_BW/ lbw |
1228 | -C |
1229 | -C SPECIAL CUTS |
1230 | -C |
1231 | - LOGICAL IS_A_J(NEXTERNAL),IS_A_L(NEXTERNAL) |
1232 | - LOGICAL IS_A_B(NEXTERNAL),IS_A_A(NEXTERNAL),IS_A_ONIUM(NEXTERNAL) |
1233 | - LOGICAL IS_A_NU(NEXTERNAL),IS_HEAVY(NEXTERNAL) |
1234 | - logical do_cuts(nexternal) |
1235 | - COMMON /TO_SPECISA/IS_A_J,IS_A_A,IS_A_L,IS_A_B,IS_A_NU,IS_HEAVY, |
1236 | - . IS_A_ONIUM, do_cuts |
1237 | -C |
1238 | -C Keep track of whether cuts already calculated for this event |
1239 | -C |
1240 | - LOGICAL CUTSDONE,CUTSPASSED |
1241 | - COMMON/TO_CUTSDONE/CUTSDONE,CUTSPASSED |
1242 | - DATA CUTSDONE,CUTSPASSED/.FALSE.,.FALSE./ |
1243 | - |
1244 | -C $B$ MW_NEW_DEF $E$ !this is a tag for MadWeight |
1245 | - |
1246 | - double precision xqcutij(nexternal,nexternal),xqcuti(nexternal) |
1247 | - common/to_xqcuts/xqcutij,xqcuti |
1248 | - |
1249 | -c jet cluster algorithm |
1250 | - integer nQCD !,NJET,JET(nexternal) |
1251 | -c double precision plab(0:3, nexternal) |
1252 | - double precision pQCD(0:3,nexternal)!,PJET(0:3,nexternal) |
1253 | -c double precision rfj,sycut,palg,fastjetdmerge |
1254 | -c integer njet_eta |
1255 | -c Photon isolation |
1256 | - integer nph,nem,nin |
1257 | - double precision ptg,chi_gamma_iso,iso_getdrv40 |
1258 | - double precision Etsum(0:nexternal) |
1259 | - real drlist(nexternal) |
1260 | - double precision pgamma(0:3,nexternal),pem(0:3,nexternal) |
1261 | - logical alliso |
1262 | -C Sort array of results: ismode>0 for real, isway=0 for ascending order |
1263 | - integer ismode,isway,izero,isorted(nexternal) |
1264 | - parameter (ismode=1) |
1265 | - parameter (isway=0) |
1266 | - parameter (izero=0) |
1267 | - |
1268 | - include 'coupl.inc' |
1269 | -C |
1270 | -C |
1271 | -c |
1272 | - DATA FIRSTTIME,FIRSTTIME2/.TRUE.,.TRUE./ |
1273 | - |
1274 | -c put momenta in common block for couplings.f |
1275 | - double precision pp(0:3,max_particles) |
1276 | - common /momenta_pp/pp |
1277 | - |
1278 | - DATA DEBUG/.FALSE./ |
1279 | - |
1280 | -C----- |
1281 | -C BEGIN CODE |
1282 | -C----- |
1283 | - |
1284 | - |
1285 | - |
1286 | - PASSCUTS=.TRUE. !EVENT IS OK UNLESS OTHERWISE CHANGED |
1287 | - IF (FIRSTTIME) THEN |
1288 | - FIRSTTIME=.FALSE. |
1289 | -c Preparation for reweighting by setting up clustering by diagrams |
1290 | - call initcluster() |
1291 | -c |
1292 | -c |
1293 | - write(formstr,'(a,i2.2,a)')'(a10,',nexternal,'i8)' |
1294 | - write(*,formstr) 'Particle',(i,i=nincoming+1,nexternal) |
1295 | - write(formstr,'(a,i2.2,a)')'(a10,',nexternal,'f8.1)' |
1296 | - write(*,formstr) 'Et >',(etmin(i),i=nincoming+1,nexternal) |
1297 | - write(*,formstr) 'E >',(emin(i),i=nincoming+1,nexternal) |
1298 | - write(*,formstr) 'Eta <',(etamax(i),i=nincoming+1,nexternal) |
1299 | - write(*,formstr) 'xqcut: ',(xqcuti(i),i=nincoming+1,nexternal) |
1300 | - write(formstr,'(a,i2.2,a)')'(a,i2,a,',nexternal,'f8.1)' |
1301 | - do j=nincoming+1,nexternal-1 |
1302 | - write(*,formstr) 'd R #',j,' >',(-0.0,i=nincoming+1,j), |
1303 | - & (r2min(i,j),i=j+1,nexternal) |
1304 | - do i=j+1,nexternal |
1305 | - r2min(i,j)=r2min(i,j)*dabs(r2min(i,j)) !Since r2 returns distance squared |
1306 | - r2max(i,j)=r2max(i,j)*dabs(r2max(i,j)) |
1307 | - enddo |
1308 | - enddo |
1309 | - do j=nincoming+1,nexternal-1 |
1310 | - write(*,formstr) 's min #',j,'>', |
1311 | - & (s_min(i,j),i=nincoming+1,nexternal) |
1312 | - enddo |
1313 | - do j=nincoming+1,nexternal-1 |
1314 | - write(*,formstr) 'xqcutij #',j,'>', |
1315 | - & (xqcutij(i,j),i=nincoming+1,nexternal) |
1316 | - enddo |
1317 | - |
1318 | -cc |
1319 | -cc Set the strong coupling |
1320 | -cc |
1321 | -c call set_ren_scale(P,scale) |
1322 | -c |
1323 | -cc Check that the user funtions for setting the scales |
1324 | -cc have been edited if the choice of an event-by-event |
1325 | -cc scale choice has been made |
1326 | -c |
1327 | -c if(.not.fixed_ren_scale) then |
1328 | -c if(scale.eq.0d0) then |
1329 | -c write(6,*) |
1330 | -c write(6,*) '* >>>>>>>>>ERROR<<<<<<<<<<<<<<<<<<<<<<<*' |
1331 | -c write(6,*) ' Dynamical renormalization scale choice ' |
1332 | -c write(6,*) ' selected but user subroutine' |
1333 | -c write(6,*) ' set_ren_scale not edited in file:setpara.f' |
1334 | -c write(6,*) ' Switching to a fixed_ren_scale choice' |
1335 | -c write(6,*) ' with scale=zmass' |
1336 | -c scale=91.2d0 |
1337 | -c write(6,*) 'scale=',scale |
1338 | -c fixed_ren_scale=.true. |
1339 | -c call set_ren_scale(P,scale) |
1340 | -c endif |
1341 | -c endif |
1342 | - |
1343 | -c if(.not.fixed_fac_scale) then |
1344 | -c call set_fac_scale(P,q2fact) |
1345 | -c if(q2fact(1).eq.0d0.or.q2fact(2).eq.0d0) then |
1346 | -c write(6,*) |
1347 | -c write(6,*) '* >>>>>>>>>ERROR<<<<<<<<<<<<<<<<<<<<<<<*' |
1348 | -c write(6,*) ' Dynamical renormalization scale choice ' |
1349 | -c write(6,*) ' selected but user subroutine' |
1350 | -c write(6,*) ' set_fac_scale not edited in file:setpara.f' |
1351 | -c write(6,*) ' Switching to a fixed_fac_scale choice' |
1352 | -c write(6,*) ' with q2fact(i)=zmass**2' |
1353 | -c fixed_fac_scale=.true. |
1354 | -c q2fact(1)=91.2d0**2 |
1355 | -c q2fact(2)=91.2d0**2 |
1356 | -c write(6,*) 'scales=',q2fact(1),q2fact(2) |
1357 | -c endif |
1358 | -c endif |
1359 | - |
1360 | - if(fixed_ren_scale) then |
1361 | - G = SQRT(4d0*PI*ALPHAS(scale)) |
1362 | - call update_as_param() |
1363 | - endif |
1364 | - |
1365 | -c Put momenta in the common block to zero to start |
1366 | - do i=0,3 |
1367 | - do j=1,max_particles |
1368 | - pp(i,j) = 0d0 |
1369 | - enddo |
1370 | - enddo |
1371 | - |
1372 | - ENDIF ! IF FIRSTTIME |
1373 | - |
1374 | - IF (CUTSDONE) THEN |
1375 | - PASSCUTS=CUTSPASSED |
1376 | - RETURN |
1377 | - ENDIF |
1378 | - CUTSDONE=.TRUE. |
1379 | -c CUTSPASSED=.FALSE. |
1380 | - |
1381 | -c |
1382 | -c Make sure have reasonable 4-momenta |
1383 | -c |
1384 | - if (p(0,1) .le. 0d0) then |
1385 | - passcuts=.false. |
1386 | - return |
1387 | - endif |
1388 | - |
1389 | -c Also make sure there's no INF or NAN |
1390 | - do i=1,nexternal |
1391 | - do j=0,3 |
1392 | - if(p(j,i).gt.1d32.or.p(j,i).ne.p(j,i))then |
1393 | - passcuts=.false. |
1394 | - return |
1395 | - endif |
1396 | - enddo |
1397 | - enddo |
1398 | - |
1399 | -c |
1400 | -c Limit S_hat |
1401 | -c |
1402 | -c if (x1*x2*stot .gt. 500**2) then |
1403 | -c passcuts=.false. |
1404 | -c return |
1405 | -c endif |
1406 | - |
1407 | -C $B$ DESACTIVATE_CUT $E$ !This is a tag for MadWeight |
1408 | - |
1409 | - if(debug) write (*,*) '=============================' |
1410 | - if(debug) write (*,*) ' EVENT STARTS TO BE CHECKED ' |
1411 | - if(debug) write (*,*) '=============================' |
1412 | -c |
1413 | -c p_t min & max cuts |
1414 | -c |
1415 | - do i=nincoming+1,nexternal |
1416 | - if(debug) write (*,*) 'pt(',i,')=',pt(p(0,i)),' ',etmin(i), |
1417 | - $ ':',etmax(i) |
1418 | - notgood=(pt(p(0,i)) .lt. etmin(i)).or. |
1419 | - & (etmax(i).ge.0d0.and.pt(p(0,i)) .gt. etmax(i)) |
1420 | - if (notgood) then |
1421 | - if(debug) write (*,*) i,' -> fails' |
1422 | - passcuts=.false. |
1423 | - return |
1424 | - endif |
1425 | - enddo |
1426 | -c |
1427 | -c missing ET min & max cut + Invariant mass of leptons and neutrino |
1428 | -c nb: missing Et defined as the vector sum over the neutrino's pt |
1429 | -c |
1430 | -c-- reset ptemp(0:3) |
1431 | - do j=0,3 |
1432 | - ptemp(j)=0 ! for the neutrino |
1433 | - ptemp2(j)=0 ! for the leptons |
1434 | - enddo |
1435 | -c- sum over the momenta |
1436 | - do i=nincoming+1,nexternal |
1437 | - if(is_a_nu(i)) then |
1438 | - if(debug) write (*,*) i,' -> neutrino ' |
1439 | - do j=0,3 |
1440 | - ptemp(j)=ptemp(j)+p(j,i) |
1441 | - enddo |
1442 | - elseif(is_a_l(i)) then |
1443 | - if(debug) write (*,*) i,' -> lepton ' |
1444 | - do j=0,3 |
1445 | - ptemp2(j)=ptemp2(j)+p(j,i) |
1446 | - enddo |
1447 | - endif |
1448 | - |
1449 | - enddo |
1450 | -c- check the et |
1451 | - if(debug.and.ptemp(0).eq.0d0) write (*,*) 'No et miss in event' |
1452 | - if(debug.and.ptemp(0).gt.0d0) write (*,*) 'Et miss =',pt(ptemp(0)),' ',misset,':',missetmax |
1453 | - if(debug.and.ptemp2(0).eq.0d0) write (*,*) 'No leptons in event' |
1454 | - if(debug.and.ptemp(0).gt.0d0) write (*,*) 'Energy of leptons =',pt(ptemp2(0)) |
1455 | - if(ptemp(0).gt.0d0) then |
1456 | - notgood=(pt(ptemp(0)) .lt. misset).or. |
1457 | - & (missetmax.ge.0d0.and.pt(ptemp(0)) .gt. missetmax) |
1458 | - if (notgood) then |
1459 | - if(debug) write (*,*) ' missing et cut -> fails' |
1460 | - passcuts=.false. |
1461 | - return |
1462 | - endif |
1463 | - endif |
1464 | - if (mmnl.gt.0d0.or.mmnlmax.ge.0d0)then |
1465 | - if(dsqrt(SumDot(ptemp,ptemp2,1d0)).lt.mmnl.or.mmnlmax.ge.0d0.and.dsqrt(SumDot(ptemp, ptemp2,1d0)).gt.mmnlmax) then |
1466 | - if(debug) write (*,*) 'lepton invariant mass -> fails' |
1467 | - passcuts=.false. |
1468 | - return |
1469 | - endif |
1470 | - endif |
1471 | -c |
1472 | -c pt cut on heavy particles |
1473 | -c gives min(pt) for (at least) one heavy particle |
1474 | -c |
1475 | - if(ptheavy.gt.0d0)then |
1476 | - passcuts=.false. |
1477 | - foundheavy=.false. |
1478 | - do i=nincoming+1,nexternal |
1479 | - if(is_heavy(i)) then |
1480 | - if(debug) write (*,*) i,' -> heavy ' |
1481 | - foundheavy=.true. |
1482 | - if(pt(p(0,i)).gt.ptheavy) passcuts=.true. |
1483 | - endif |
1484 | - enddo |
1485 | - |
1486 | - if(.not.passcuts.and.foundheavy)then |
1487 | - if(debug) write (*,*) ' heavy particle cut -> fails' |
1488 | - return |
1489 | - else |
1490 | - passcuts=.true. |
1491 | - endif |
1492 | - endif |
1493 | -c |
1494 | -c E min & max cuts |
1495 | -c |
1496 | - do i=nincoming+1,nexternal |
1497 | - if(debug) write (*,*) 'p(0,',i,')=',p(0,i),' ',emin(i),':',emax(i) |
1498 | - notgood=(p(0,i) .le. emin(i)).or. |
1499 | - & (emax(i).ge.0d0 .and. p(0,i) .gt. emax(i)) |
1500 | - if (notgood) then |
1501 | - if(debug) write (*,*) i,' -> fails' |
1502 | - passcuts=.false. |
1503 | - return |
1504 | - endif |
1505 | - enddo |
1506 | -c |
1507 | -c Rapidity min & max cuts |
1508 | -c |
1509 | - do i=nincoming+1,nexternal |
1510 | - if(debug) write (*,*) 'abs(rap(',i,'))=',abs(rap(p(0,i))),' ',etamin(i),':',etamax(i) |
1511 | - notgood=(etamax(i).ge.0.and.abs(rap(p(0,i))) .gt. etamax(i)).or. |
1512 | - & (abs(rap(p(0,i))) .lt. etamin(i)) |
1513 | - if (notgood) then |
1514 | - if(debug) write (*,*) i,' -> fails' |
1515 | - passcuts=.false. |
1516 | - return |
1517 | - endif |
1518 | - enddo |
1519 | -c |
1520 | -c DeltaR min & max cuts |
1521 | -c |
1522 | - do i=nincoming+1,nexternal-1 |
1523 | - do j=i+1,nexternal |
1524 | - if(debug) write (*,*) 'r2(',i, ',' ,j,')=',dsqrt(r2(p(0,i),p(0,j))) |
1525 | - if(debug) write (*,*) dsqrt(r2min(j,i)),dsqrt(r2max(j,i)) |
1526 | - if(r2min(j,i).gt.0.or.r2max(j,i).ge.0d0) then |
1527 | - tmp=r2(p(0,i),p(0,j)) |
1528 | - notgood=(tmp .lt. r2min(j,i)).or. |
1529 | - $ (r2max(j,i).ge.0d0 .and. tmp .gt. r2max(j,i)) |
1530 | - if (notgood) then |
1531 | - if(debug) write (*,*) i,j,' -> fails' |
1532 | - passcuts=.false. |
1533 | - return |
1534 | - endif |
1535 | - endif |
1536 | - enddo |
1537 | - enddo |
1538 | - |
1539 | - |
1540 | -c s-channel min & max pt of sum of 4-momenta |
1541 | -c |
1542 | - do i=nincoming+1,nexternal-1 |
1543 | - do j=i+1,nexternal |
1544 | - if(debug)write (*,*) 'ptll(',i,',',j,')=',PtDot(p(0,i),p(0,j)) |
1545 | - if(debug)write (*,*) ptll_min(j,i),ptll_max(j,i) |
1546 | - if(ptll_min(j,i).gt.0.or.ptll_max(j,i).ge.0d0) then |
1547 | - tmp=PtDot(p(0,i),p(0,j)) |
1548 | - notgood=(tmp .lt. ptll_min(j,i).or. |
1549 | - $ ptll_max(j,i).ge.0d0 .and. tmp.gt.ptll_max(j,i)) |
1550 | - if (notgood) then |
1551 | - if(debug) write (*,*) i,j,' -> fails' |
1552 | - passcuts=.false. |
1553 | - return |
1554 | - endif |
1555 | - endif |
1556 | - enddo |
1557 | - enddo |
1558 | - |
1559 | - |
1560 | - |
1561 | - |
1562 | -c |
1563 | -c s-channel min & max invariant mass cuts |
1564 | -c |
1565 | - do i=nincoming+1,nexternal-1 |
1566 | - do j=i+1,nexternal |
1567 | - if(debug) write (*,*) 's(',i,',',j,')=',Sumdot(p(0,i),p(0,j),+1d0) |
1568 | - if(debug) write (*,*) s_min(j,i),s_max(j,i) |
1569 | - if(s_min(j,i).gt.0.or.s_max(j,i).ge.0d0) then |
1570 | - tmp=SumDot(p(0,i),p(0,j),+1d0) |
1571 | - if(s_min(j,i).le.s_max(j,i) .or. s_max(j,i).lt.0d0)then |
1572 | - notgood=(tmp .lt. s_min(j,i).or. |
1573 | - $ s_max(j,i).ge.0d0 .and. tmp .gt. s_max(j,i)) |
1574 | - if (notgood) then |
1575 | - if(debug) write (*,*) i,j,' -> fails' |
1576 | - passcuts=.false. |
1577 | - return |
1578 | - endif |
1579 | - else |
1580 | - notgood=(tmp .lt. s_min(j,i).and.tmp .gt. s_max(j,i)) |
1581 | - if (notgood) then |
1582 | - if(debug) write (*,*) i,j,' -> fails' |
1583 | - passcuts=.false. |
1584 | - return |
1585 | - endif |
1586 | - endif |
1587 | - endif |
1588 | - enddo |
1589 | - enddo |
1590 | -C $B$DESACTIVATE_BW_CUT$B$ This is a Tag for MadWeight |
1591 | -c |
1592 | -c B.W. phase space cuts |
1593 | -c |
1594 | - pass_bw=cut_bw(p) |
1595 | -c JA 4/8/11 always check pass_bw |
1596 | - if ( pass_bw.and..not.CUTSPASSED) then |
1597 | - passcuts=.false. |
1598 | - if(debug) write (*,*) ' pass_bw -> fails' |
1599 | - return |
1600 | - endif |
1601 | -C $E$DESACTIVATE_BW_CUT$E$ This is a Tag for MadWeight |
1602 | - CUTSPASSED=.FALSE. |
1603 | -C |
1604 | -C maximal and minimal pt of the jets sorted by pt |
1605 | -c |
1606 | - njets=0 |
1607 | - nheavyjets=0 |
1608 | - |
1609 | -c- fill ptjet with the pt's of the jets. |
1610 | - do i=nincoming+1,nexternal |
1611 | - if(is_a_j(i)) then |
1612 | - njets=njets+1 |
1613 | - ptjet(njets)=pt(p(0,i)) |
1614 | - endif |
1615 | - if(is_a_b(i)) then |
1616 | - nheavyjets=nheavyjets+1 |
1617 | - ptheavyjet(nheavyjets)=pt(p(0,i)) |
1618 | - endif |
1619 | - |
1620 | - enddo |
1621 | - if(debug) write (*,*) 'not yet ordered ',njets,' ',ptjet |
1622 | - |
1623 | -C---------------------------------------------------------------------------- |
1624 | -C DURHAM_KT CUT |
1625 | -C---------------------------------------------------------------------------- |
1626 | - IF(NJETS.GT.0 .AND.KT_DURHAM.GT.0D0) THEN |
1627 | -C RESET JET MOMENTA |
1628 | - njets=0 |
1629 | - DO I=1,NEXTERNAL |
1630 | - DO J=0,3 |
1631 | - PJET(I,J) = 0E0 |
1632 | - ENDDO |
1633 | - ENDDO |
1634 | - |
1635 | - do i=nincoming+1,nexternal |
1636 | - if(is_a_j(i).and.do_cuts(i)) then |
1637 | - njets=njets+1 |
1638 | - DO J=0,3 |
1639 | - PJET(NJETS,J) = P(J,I) |
1640 | - ENDDO |
1641 | - endif |
1642 | - enddo |
1643 | - |
1644 | -C DURHAM KT SEPARATION CUT |
1645 | - |
1646 | - |
1647 | - PTMIN = EBEAM(1) + EBEAM(2) |
1648 | - |
1649 | - DO I=1,NJETS |
1650 | - |
1651 | -C PT WITH RESPECT TO Z AXIS FOR HADRONIC COLLISIONS |
1652 | - IF ( (LPP(1).NE.0) .OR. (LPP(2).NE.0)) THEN |
1653 | - PT1 = DSQRT(PJET(I,1)**2 + PJET(I,2)**2) |
1654 | - PTMIN = MIN( PTMIN, PT1 ) |
1655 | - ENDIF |
1656 | - |
1657 | - DO J=I+1,NJETS |
1658 | -C GET ANGLE BETWEEN JETS |
1659 | - PABS1 = DSQRT(PJET(I,1)**2 + PJET(I,2)**2 + PJET(I,3)**2) |
1660 | - PABS2 = DSQRT(PJET(J,1)**2 + PJET(J,2)**2 + PJET(J,3)**2) |
1661 | -C CHECK IF 3-MOMENTA DO NOT VANISH |
1662 | - IF(PABS1*PABS2 .NE. 0D0) THEN |
1663 | - COSTH = ( PJET(I,1)*PJET(J,1) + PJET(I,2)*PJET(J,2) + PJET(I,3)*PJET(J,3) )/(PABS1*PABS2) |
1664 | - ELSE |
1665 | -C IF 3-MOMENTA VANISH, MAKE JET COSTH = 1D0 SO THAT JET MEASURE VANISHES |
1666 | - COSTH = 1D0 |
1667 | - ENDIF |
1668 | -C GET PT AND ETA OF JETS |
1669 | - PT2 = DSQRT(PJET(J,1)**2 + PJET(J,2)**2) |
1670 | - ETA1 = 0.5D0*LOG( (PJET(I,0) + PJET(I,3)) / (PJET(I,0) - PJET(I,3)) ) |
1671 | - ETA2 = 0.5D0*LOG( (PJET(J,0) + PJET(J,3)) / (PJET(J,0) - PJET(J,3)) ) |
1672 | -C GET COSH OF DELTA ETA, COS OF DELTA PHI |
1673 | - COSH_DETA = DCOSH( ETA1 - ETA2 ) |
1674 | - COS_DPHI = ( PJET(I,1)*PJET(J,1) + PJET(I,2)*PJET(J,2) ) / (PT1*PT2) |
1675 | - DPHI = DACOS( COS_DPHI ) |
1676 | - IF ( (LPP(1).EQ.0) .AND. (LPP(2).EQ.0)) THEN |
1677 | -C KT FOR E+E- COLLISION |
1678 | - PTNOW = DSQRT( 2D0*MIN(PJET(I,0)**2,PJET(J,0)**2)*( 1D0-COSTH ) ) |
1679 | - ELSE |
1680 | -C HADRONIC KT, FASTJET DEFINITION |
1681 | - PTNOW = DSQRT( MIN(PT1**2,PT2**2)*( (ETA1 - ETA2 )**2 + DPHI**2 )/(D_PARAMETER**2) ) |
1682 | - ENDIF |
1683 | - |
1684 | - PTMIN = MIN( PTMIN, PTNOW ) |
1685 | - |
1686 | - ENDDO ! LOOP OVER NJET |
1687 | - |
1688 | - ENDDO ! LOOP OVER NJET |
1689 | - |
1690 | -C CHECK COMPATIBILITY WITH CUT |
1691 | - IF( (PTMIN .LT. KT_DURHAM)) THEN |
1692 | - PASSCUTS = .FALSE. |
1693 | - RETURN |
1694 | - ENDIF |
1695 | - ENDIF ! IF NJETS.GT. 0 .AND. DO_KT_DURHAM |
1696 | - |
1697 | -C---------------------------------------------------------------------------- |
1698 | -C---------------------------------------------------------------------------- |
1699 | - |
1700 | - |
1701 | - |
1702 | -c- check existance of jets if jet cuts are on |
1703 | - if(njets.lt.1.and.(htjmin.gt.0.or.ptj1min.gt.0).or. |
1704 | - $ njets.lt.2.and.ptj2min.gt.0.or. |
1705 | - $ njets.lt.3.and.ptj3min.gt.0.or. |
1706 | - $ njets.lt.4.and.ptj4min.gt.0)then |
1707 | - if(debug) write (*,*) i, ' too few jets -> fails' |
1708 | - passcuts=.false. |
1709 | - return |
1710 | - endif |
1711 | - |
1712 | -c - sort jet pts |
1713 | - do i=1,njets-1 |
1714 | - do j=i+1,njets |
1715 | - if(ptjet(j).gt.ptjet(i)) then |
1716 | - temp=ptjet(i) |
1717 | - ptjet(i)=ptjet(j) |
1718 | - ptjet(j)=temp |
1719 | - endif |
1720 | - enddo |
1721 | - enddo |
1722 | - if(debug) write (*,*) 'ordered ',njets,' ',ptjet |
1723 | -c |
1724 | -c Use "and" or "or" prescriptions |
1725 | -c |
1726 | - inclht=0 |
1727 | - |
1728 | - if(njets.gt.0) then |
1729 | - |
1730 | - notgood=.not.jetor |
1731 | - if(debug) write (*,*) 'jetor :',jetor |
1732 | - if(debug) write (*,*) '0',notgood |
1733 | - |
1734 | - do i=1,min(njets,4) |
1735 | - if(debug) write (*,*) i,ptjet(i), ' ',ptjmin4(i), |
1736 | - $ ':',ptjmax4(i) |
1737 | - if(jetor) then |
1738 | -c--- if one of the jets does not pass, the event is rejected |
1739 | - notgood=notgood.or.(ptjmax4(i).ge.0d0 .and. |
1740 | - $ ptjet(i).gt.ptjmax4(i)) .or. |
1741 | - $ (ptjet(i).lt.ptjmin4(i)) |
1742 | - if(debug) write (*,*) i,' notgood total:', notgood |
1743 | - else |
1744 | -c--- all cuts must fail to reject the event |
1745 | - notgood=notgood.and.(ptjmax4(i).ge.0d0 .and. |
1746 | - $ ptjet(i).gt.ptjmax4(i) .or. |
1747 | - $ (ptjet(i).lt.ptjmin4(i))) |
1748 | - if(debug) write (*,*) i,' notgood total:', notgood |
1749 | - endif |
1750 | - enddo |
1751 | - |
1752 | - |
1753 | - if (notgood) then |
1754 | - if(debug) write (*,*) i, ' multiple pt -> fails' |
1755 | - passcuts=.false. |
1756 | - return |
1757 | - endif |
1758 | - |
1759 | -c--------------------------- |
1760 | -c Ht cuts |
1761 | -C--------------------------- |
1762 | - htj=ptjet(1) |
1763 | - |
1764 | - do i=2,njets |
1765 | - htj=htj+ptjet(i) |
1766 | - if(debug) write (*,*) i, 'htj ',htj |
1767 | - if(debug.and.i.le.4) write (*,*) 'htmin ',i,' ', htjmin4(i),':',htjmax4(i) |
1768 | - if(i.le.4)then |
1769 | - if(htj.lt.htjmin4(i) .or. |
1770 | - $ htjmax4(i).ge.0d0.and.htj.gt.htjmax4(i)) then |
1771 | - if(debug) write (*,*) i, ' ht -> fails' |
1772 | - passcuts=.false. |
1773 | - return |
1774 | - endif |
1775 | - endif |
1776 | - enddo |
1777 | - |
1778 | - if(htj.lt.htjmin.or.htjmax.ge.0d0.and.htj.gt.htjmax)then |
1779 | - if(debug) write (*,*) i, ' htj -> fails' |
1780 | - passcuts=.false. |
1781 | - return |
1782 | - endif |
1783 | - |
1784 | - inclht=htj |
1785 | - |
1786 | - endif !if there are jets |
1787 | - |
1788 | - if(nheavyjets.gt.0) then |
1789 | - do i=1,nheavyjets |
1790 | - inclht=inclht+ptheavyjet(i) |
1791 | - enddo |
1792 | - endif !if there are heavyjets |
1793 | - |
1794 | - if(inclht.lt.inclHtmin.or. |
1795 | - $ inclHtmax.ge.0d0.and.inclht.gt.inclHtmax)then |
1796 | - if(debug) write (*,*) ' inclhtmin=',inclHtmin,' -> fails' |
1797 | - passcuts=.false. |
1798 | - return |
1799 | - endif |
1800 | - |
1801 | -C |
1802 | -C maximal and minimal pt of the leptons sorted by pt |
1803 | -c |
1804 | - nleptons=0 |
1805 | - |
1806 | - if(ptl1min.gt.0.or.ptl2min.gt.0.or.ptl3min.gt.0.or.ptl4min.gt.0.or. |
1807 | - $ ptl1max.ge.0d0.or.ptl2max.ge.0d0.or. |
1808 | - $ ptl3max.ge.0d0.or.ptl4max.ge.0d0) then |
1809 | - |
1810 | -c - fill ptlepton with the pt's of the leptons. |
1811 | - do i=nincoming+1,nexternal |
1812 | - if(is_a_l(i)) then |
1813 | - nleptons=nleptons+1 |
1814 | - ptlepton(nleptons)=pt(p(0,i)) |
1815 | - endif |
1816 | - enddo |
1817 | - if(debug) write (*,*) 'not yet ordered ',njets,' ',ptjet |
1818 | - |
1819 | -c - check existance of leptons if lepton cuts are on |
1820 | - if(nleptons.lt.1.and.ptl1min.gt.0.or. |
1821 | - $ nleptons.lt.2.and.ptl2min.gt.0.or. |
1822 | - $ nleptons.lt.3.and.ptl3min.gt.0.or. |
1823 | - $ nleptons.lt.4.and.ptl4min.gt.0)then |
1824 | - if(debug) write (*,*) i, ' too few leptons -> fails' |
1825 | - passcuts=.false. |
1826 | - return |
1827 | - endif |
1828 | - |
1829 | -c - sort lepton pts |
1830 | - do i=1,nleptons-1 |
1831 | - do j=i+1,nleptons |
1832 | - if(ptlepton(j).gt.ptlepton(i)) then |
1833 | - temp=ptlepton(i) |
1834 | - ptlepton(i)=ptlepton(j) |
1835 | - ptlepton(j)=temp |
1836 | - endif |
1837 | - enddo |
1838 | - enddo |
1839 | - if(debug) write (*,*) 'ordered ',nleptons,' ',ptlepton |
1840 | - |
1841 | - if(nleptons.gt.0) then |
1842 | - |
1843 | - notgood = .false. |
1844 | - do i=1,min(nleptons,4) |
1845 | - if(debug) write (*,*) i,ptlepton(i), ' ',ptlmin4(i),':',ptlmax4(i) |
1846 | -c--- if one of the leptons does not pass, the event is rejected |
1847 | - notgood=notgood.or. |
1848 | - $ (ptlmax4(i).ge.0d0.and.ptlepton(i).gt.ptlmax4(i)).or. |
1849 | - $ (ptlepton(i).lt.ptlmin4(i)) |
1850 | - if(debug) write (*,*) i,' notgood total:', notgood |
1851 | - enddo |
1852 | - |
1853 | - |
1854 | - if (notgood) then |
1855 | - if(debug) write (*,*) i, ' multiple pt -> fails' |
1856 | - passcuts=.false. |
1857 | - return |
1858 | - endif |
1859 | - endif |
1860 | - endif |
1861 | -C>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
1862 | -C SPECIAL CUTS |
1863 | -C<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
1864 | - |
1865 | -C REQUIRE AT LEAST ONE JET WITH PT>XPTJ |
1866 | - |
1867 | - IF(xptj.gt.0d0) THEN |
1868 | - xvar=0 |
1869 | - do i=nincoming+1,nexternal |
1870 | - if(is_a_j(i)) xvar=max(xvar,pt(p(0,i))) |
1871 | - enddo |
1872 | - if (xvar .lt. xptj) then |
1873 | - passcuts=.false. |
1874 | - return |
1875 | - endif |
1876 | - ENDIF |
1877 | - |
1878 | -C REQUIRE AT LEAST ONE PHOTON WITH PT>XPTA |
1879 | - |
1880 | - IF(xpta.gt.0d0) THEN |
1881 | - xvar=0 |
1882 | - do i=nincoming+1,nexternal |
1883 | - if(is_a_a(i)) xvar=max(xvar,pt(p(0,i))) |
1884 | - enddo |
1885 | - if (xvar .lt. xpta) then |
1886 | - passcuts=.false. |
1887 | - return |
1888 | - endif |
1889 | - ENDIF |
1890 | - |
1891 | -C REQUIRE AT LEAST ONE B WITH PT>XPTB |
1892 | - |
1893 | - IF(xptb.gt.0d0) THEN |
1894 | - xvar=0 |
1895 | - do i=nincoming+1,nexternal |
1896 | - if(is_a_b(i)) xvar=max(xvar,pt(p(0,i))) |
1897 | - enddo |
1898 | - if (xvar .lt. xptb) then |
1899 | - passcuts=.false. |
1900 | - return |
1901 | - endif |
1902 | - ENDIF |
1903 | - |
1904 | -C REQUIRE AT LEAST ONE LEPTON WITH PT>XPTL |
1905 | - |
1906 | - IF(xptl.gt.0d0) THEN |
1907 | - xvar=0 |
1908 | - do i=nincoming+1,nexternal |
1909 | - if(is_a_l(i)) xvar=max(xvar,pt(p(0,i))) |
1910 | - enddo |
1911 | - if (xvar .lt. xptl) then |
1912 | - passcuts=.false. |
1913 | - if(debug) write (*,*) ' xptl -> fails' |
1914 | - return |
1915 | - endif |
1916 | - ENDIF |
1917 | -C |
1918 | -C WBF CUTS: TWO TYPES |
1919 | -C |
1920 | -C FIRST TYPE: implemented by FM |
1921 | -C |
1922 | -C 1. FIND THE 2 HARDEST JETS |
1923 | -C 2. REQUIRE |RAP(J)|>XETAMIN |
1924 | -C 3. REQUIRE RAP(J1)*ETA(J2)<0 |
1925 | -C |
1926 | -C SECOND TYPE : added by Simon de Visscher 1-08-2007 |
1927 | -C |
1928 | -C 1. FIND THE 2 HARDEST JETS |
1929 | -C 2. REQUIRE |RAP(J1)-RAP(J2)|>DELTAETA |
1930 | -C 3. REQUIRE RAP(J1)*RAP(J2)<0 |
1931 | -C |
1932 | -C |
1933 | - hardj1=0 |
1934 | - hardj2=0 |
1935 | - ptmax1=0d0 |
1936 | - ptmax2=0d0 |
1937 | - |
1938 | -C-- START IF AT LEAST ONE OF THE CUTS IS ACTIVATED |
1939 | - |
1940 | - IF(XETAMIN.GT.0D0.OR.DELTAETA.GT.0D0) THEN |
1941 | - |
1942 | -C-- FIND THE HARDEST JETS |
1943 | - |
1944 | - do i=nincoming+1,nexternal |
1945 | - if(is_a_j(i)) then |
1946 | -c write (*,*) i,pt(p(0,i)) |
1947 | - if(pt(p(0,i)).gt.ptmax1) then |
1948 | - hardj2=hardj1 |
1949 | - ptmax2=ptmax1 |
1950 | - hardj1=i |
1951 | - ptmax1=pt(p(0,i)) |
1952 | - elseif(pt(p(0,i)).gt.ptmax2) then |
1953 | - hardj2=i |
1954 | - ptmax2=pt(p(0,i)) |
1955 | - endif |
1956 | -c write (*,*) hardj1,hardj2,ptmax1,ptmax2 |
1957 | - endif |
1958 | - enddo |
1959 | - |
1960 | - if (hardj2.eq.0) goto 21 ! bypass vbf cut since not enough jets |
1961 | - |
1962 | -C-- NOW APPLY THE CUT I |
1963 | - |
1964 | - if (abs(rap(p(0,hardj1))) .lt. xetamin |
1965 | - & .or.abs(rap(p(0,hardj2))) .lt. xetamin |
1966 | - & .or.rap(p(0,hardj1))*rap(p(0,hardj2)) .gt.0d0) then |
1967 | - passcuts=.false. |
1968 | - return |
1969 | - endif |
1970 | - |
1971 | - |
1972 | -C-- NOW APPLY THE CUT II |
1973 | - |
1974 | - if (abs(rap(p(0,hardj1))-rap(p(0,hardj2))) .lt. deltaeta) then |
1975 | - passcuts=.false. |
1976 | - return |
1977 | - endif |
1978 | - |
1979 | -c write (*,*) hardj1,hardj2,rap(p(0,hardj1)),rap(p(0,hardj2)) |
1980 | - |
1981 | - ENDIF |
1982 | - |
1983 | -c Begin photon isolation |
1984 | -c NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE |
1985 | -c Use is made of parton cm frame momenta. If this must be |
1986 | -c changed, pQCD used below must be redefined |
1987 | -c NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE |
1988 | -c If we do not require a mimimum jet energy, there's no need to apply |
1989 | -c jet clustering and all that. |
1990 | - if (ptgmin.ne.0d0) then |
1991 | - |
1992 | -c Put all (light) QCD partons in momentum array for jet clustering. |
1993 | -c From the run_card.dat, maxjetflavor defines if b quark should be |
1994 | -c considered here (via the logical variable 'is_a_jet'). nQCD becomes |
1995 | -c the number of (light) QCD partons at the real-emission level (i.e. one |
1996 | -c more than the Born). |
1997 | - |
1998 | - nQCD=0 |
1999 | - do j=nincoming+1,nexternal |
2000 | - if (is_a_j(j)) then |
2001 | - nQCD=nQCD+1 |
2002 | - do i=0,3 |
2003 | - pQCD(i,nQCD)=p(i,j) ! Use C.o.M. frame momenta |
2004 | - enddo |
2005 | - endif |
2006 | - enddo |
2007 | - |
2008 | - nph=0 |
2009 | - do j=nincoming+1,nexternal |
2010 | - if (is_a_a(j)) then |
2011 | - nph=nph+1 |
2012 | - do i=0,3 |
2013 | - pgamma(i,nph)=p(i,j) ! Use C.o.M. frame momenta |
2014 | - enddo |
2015 | - endif |
2016 | - enddo |
2017 | - if(nph.eq.0) goto 444 |
2018 | - |
2019 | - if(isoEM)then |
2020 | - nem=nph |
2021 | - do k=1,nem |
2022 | - do i=0,3 |
2023 | - pem(i,k)=pgamma(i,k) |
2024 | - enddo |
2025 | - enddo |
2026 | - do j=nincoming+1,nexternal |
2027 | - if (is_a_l(j)) then |
2028 | - nem=nem+1 |
2029 | - do i=0,3 |
2030 | - pem(i,nem)=p(i,j) ! Use C.o.M. frame momenta |
2031 | - enddo |
2032 | - endif |
2033 | - enddo |
2034 | - endif |
2035 | - |
2036 | - alliso=.true. |
2037 | - |
2038 | - j=0 |
2039 | - dowhile(j.lt.nph.and.alliso) |
2040 | -c Loop over all photons |
2041 | - j=j+1 |
2042 | - |
2043 | - ptg=pt(pgamma(0,j)) |
2044 | - if(ptg.lt.ptgmin)then |
2045 | - passcuts=.false. |
2046 | - return |
2047 | - endif |
2048 | - |
2049 | -c Isolate from hadronic energy |
2050 | - do i=1,nQCD |
2051 | - drlist(i)=sngl(iso_getdrv40(pgamma(0,j),pQCD(0,i))) |
2052 | - enddo |
2053 | - call sortzv(drlist,isorted,nQCD,ismode,isway,izero) |
2054 | - Etsum(0)=0.d0 |
2055 | - nin=0 |
2056 | - do i=1,nQCD |
2057 | - if(dble(drlist(isorted(i))).le.R0gamma)then |
2058 | - nin=nin+1 |
2059 | - Etsum(nin)=Etsum(nin-1)+pt(pQCD(0,isorted(i))) |
2060 | - endif |
2061 | - enddo |
2062 | - do i=1,nin |
2063 | - alliso=alliso .and. |
2064 | - # Etsum(i).le.chi_gamma_iso(dble(drlist(isorted(i))), |
2065 | - # R0gamma,xn,epsgamma,ptg) |
2066 | - enddo |
2067 | - |
2068 | -c Isolate from EM energy |
2069 | - if(isoEM.and.nem.gt.1)then |
2070 | - do i=1,nem |
2071 | - drlist(i)=sngl(iso_getdrv40(pgamma(0,j),pem(0,i))) |
2072 | - enddo |
2073 | - call sortzv(drlist,isorted,nem,ismode,isway,izero) |
2074 | -c First of list must be the photon: check this, and drop it |
2075 | - if(isorted(1).ne.j.or.drlist(isorted(1)).gt.1.e-4)then |
2076 | - write(*,*)'Error #1 in photon isolation' |
2077 | - write(*,*)j,isorted(1),drlist(isorted(1)) |
2078 | - stop |
2079 | - endif |
2080 | - Etsum(0)=0.d0 |
2081 | - nin=0 |
2082 | - do i=2,nem |
2083 | - if(dble(drlist(isorted(i))).le.R0gamma)then |
2084 | - nin=nin+1 |
2085 | - Etsum(nin)=Etsum(nin-1)+pt(pem(0,isorted(i))) |
2086 | - endif |
2087 | - enddo |
2088 | - do i=1,nin |
2089 | - alliso=alliso .and. |
2090 | - # Etsum(i).le.chi_gamma_iso(dble(drlist(isorted(i))), |
2091 | - # R0gamma,xn,epsgamma,ptg) |
2092 | - enddo |
2093 | - |
2094 | - endif |
2095 | - |
2096 | -c End of loop over photons |
2097 | - enddo |
2098 | - |
2099 | - if(.not.alliso)then |
2100 | - passcuts=.false. |
2101 | - return |
2102 | - endif |
2103 | - endif |
2104 | - |
2105 | - 444 continue |
2106 | -c End photon isolation |
2107 | - |
2108 | - |
2109 | -C...Set couplings if event passed cuts |
2110 | - |
2111 | - 21 if(.not.fixed_ren_scale) then |
2112 | - call set_ren_scale(P,scale) |
2113 | - if(scale.gt.0) G = SQRT(4d0*PI*ALPHAS(scale)) |
2114 | - endif |
2115 | - |
2116 | - if(.not.fixed_fac_scale) then |
2117 | - call set_fac_scale(P,q2fact) |
2118 | - endif |
2119 | - |
2120 | -c |
2121 | -c Here we cluster event and reset factorization and renormalization |
2122 | -c scales on an event-by-event basis, as well as check xqcut for jets |
2123 | -c |
2124 | -c Note the following condition is the first line of setclscales |
2125 | -c if(xqcut.gt.0d0.or.ickkw.gt.0.or.scale.eq.0.or.q2fact(1).eq.0)then |
2126 | -c Do not duplicate it since some variable are set for syscalc in the fct |
2127 | - if(.not.setclscales(p))then |
2128 | - cutsdone=.false. |
2129 | - cutspassed=.false. |
2130 | - passcuts = .false. |
2131 | - if(debug) write (*,*) 'setclscales -> fails' |
2132 | - return |
2133 | - endif |
2134 | -c endif |
2135 | - |
2136 | -c Set couplings in model files |
2137 | - if(.not.fixed_ren_scale.or..not.fixed_couplings) then |
2138 | - if (.not.fixed_couplings)then |
2139 | - do i=0,3 |
2140 | - do j=1,nexternal |
2141 | - pp(i,j)=p(i,j) |
2142 | - enddo |
2143 | - enddo |
2144 | - endif |
2145 | - call update_as_param() |
2146 | - endif |
2147 | - |
2148 | - IF (FIRSTTIME2) THEN |
2149 | - FIRSTTIME2=.FALSE. |
2150 | - write(6,*) 'alpha_s for scale ',scale,' is ', G**2/(16d0*atan(1d0)) |
2151 | - ENDIF |
2152 | - |
2153 | - if(debug) write (*,*) '=============================' |
2154 | - if(debug) write (*,*) ' EVENT PASSED THE CUTS ' |
2155 | - if(debug) write (*,*) '=============================' |
2156 | - |
2157 | - CUTSPASSED=.TRUE. |
2158 | - |
2159 | - RETURN |
2160 | - END |
2161 | - |
2162 | - |
2163 | -C |
2164 | -C FUNCTION FOR ISOLATION |
2165 | -C |
2166 | - |
2167 | - function iso_getdrv40(p1,p2) |
2168 | - implicit none |
2169 | - real*8 iso_getdrv40,p1(0:3),p2(0:3) |
2170 | - real*8 iso_getdr |
2171 | -c |
2172 | - iso_getdrv40=iso_getdr(p1(0),p1(1),p1(2),p1(3), |
2173 | - # p2(0),p2(1),p2(2),p2(3)) |
2174 | - return |
2175 | - end |
2176 | - |
2177 | - |
2178 | - function iso_getdr(en1,ptx1,pty1,pl1,en2,ptx2,pty2,pl2) |
2179 | - implicit none |
2180 | - real*8 iso_getdr,en1,ptx1,pty1,pl1,en2,ptx2,pty2,pl2,deta,dphi, |
2181 | - # iso_getpseudorap,iso_getdelphi |
2182 | -c |
2183 | - deta=iso_getpseudorap(en1,ptx1,pty1,pl1)- |
2184 | - # iso_getpseudorap(en2,ptx2,pty2,pl2) |
2185 | - dphi=iso_getdelphi(ptx1,pty1,ptx2,pty2) |
2186 | - iso_getdr=sqrt(dphi**2+deta**2) |
2187 | - return |
2188 | - end |
2189 | - |
2190 | - |
2191 | - function iso_getpseudorap(en,ptx,pty,pl) |
2192 | - implicit none |
2193 | - real*8 iso_getpseudorap,en,ptx,pty,pl,tiny,pt,eta,th |
2194 | - parameter (tiny=1.d-5) |
2195 | -c |
2196 | - pt=sqrt(ptx**2+pty**2) |
2197 | - if(pt.lt.tiny.and.abs(pl).lt.tiny)then |
2198 | - eta=sign(1.d0,pl)*1.d8 |
2199 | - else |
2200 | - th=atan2(pt,pl) |
2201 | - eta=-log(tan(th/2.d0)) |
2202 | - endif |
2203 | - iso_getpseudorap=eta |
2204 | - return |
2205 | - end |
2206 | - |
2207 | - |
2208 | - function iso_getdelphi(ptx1,pty1,ptx2,pty2) |
2209 | - implicit none |
2210 | - real*8 iso_getdelphi,ptx1,pty1,ptx2,pty2,tiny,pt1,pt2,tmp |
2211 | - parameter (tiny=1.d-5) |
2212 | -c |
2213 | - pt1=sqrt(ptx1**2+pty1**2) |
2214 | - pt2=sqrt(ptx2**2+pty2**2) |
2215 | - if(pt1.ne.0.d0.and.pt2.ne.0.d0)then |
2216 | - tmp=ptx1*ptx2+pty1*pty2 |
2217 | - tmp=tmp/(pt1*pt2) |
2218 | - if(abs(tmp).gt.1.d0+tiny)then |
2219 | - write(*,*)'Cosine larger than 1' |
2220 | - stop |
2221 | - elseif(abs(tmp).ge.1.d0)then |
2222 | - tmp=sign(1.d0,tmp) |
2223 | - endif |
2224 | - tmp=acos(tmp) |
2225 | - else |
2226 | - tmp=1.d8 |
2227 | - endif |
2228 | - iso_getdelphi=tmp |
2229 | - return |
2230 | - end |
2231 | - |
2232 | - function chi_gamma_iso(dr,R0,xn,epsgamma,pTgamma) |
2233 | -c Eq.(3.4) of Phys.Lett. B429 (1998) 369-374 [hep-ph/9801442] |
2234 | - implicit none |
2235 | - real*8 chi_gamma_iso,dr,R0,xn,epsgamma,pTgamma |
2236 | - real*8 tmp,axn |
2237 | -c |
2238 | - axn=abs(xn) |
2239 | - tmp=epsgamma*pTgamma |
2240 | - if(axn.ne.0.d0)then |
2241 | - tmp=tmp*( (1-cos(dr))/(1-cos(R0)) )**axn |
2242 | - endif |
2243 | - chi_gamma_iso=tmp |
2244 | - return |
2245 | - end |
2246 | - |
2247 | - |
2248 | -* |
2249 | -* $Id: sortzv.F,v 1.1.1.1 1996/02/15 17:49:50 mclareni Exp $ |
2250 | -* |
2251 | -* $Log: sortzv.F,v $ |
2252 | -* Revision 1.1.1.1 1996/02/15 17:49:50 mclareni |
2253 | -* Kernlib |
2254 | -* |
2255 | -* |
2256 | -c$$$#include "kerngen/pilot.h" |
2257 | - SUBROUTINE SORTZV (A,INDEX,N1,MODE,NWAY,NSORT) |
2258 | -C |
2259 | -C CERN PROGLIB# M101 SORTZV .VERSION KERNFOR 3.15 820113 |
2260 | -C ORIG. 02/10/75 |
2261 | -C |
2262 | - DIMENSION A(N1),INDEX(N1) |
2263 | -C |
2264 | -C |
2265 | - N = N1 |
2266 | - IF (N.LE.0) RETURN |
2267 | - IF (NSORT.NE.0) GO TO 2 |
2268 | - DO 1 I=1,N |
2269 | - 1 INDEX(I)=I |
2270 | -C |
2271 | - 2 IF (N.EQ.1) RETURN |
2272 | - IF (MODE) 10,20,30 |
2273 | - 10 CALL SORTTI (A,INDEX,N) |
2274 | - GO TO 40 |
2275 | -C |
2276 | - 20 CALL SORTTC(A,INDEX,N) |
2277 | - GO TO 40 |
2278 | -C |
2279 | - 30 CALL SORTTF (A,INDEX,N) |
2280 | -C |
2281 | - 40 IF (NWAY.EQ.0) GO TO 50 |
2282 | - N2 = N/2 |
2283 | - DO 41 I=1,N2 |
2284 | - ISWAP = INDEX(I) |
2285 | - K = N+1-I |
2286 | - INDEX(I) = INDEX(K) |
2287 | - 41 INDEX(K) = ISWAP |
2288 | - 50 RETURN |
2289 | - END |
2290 | -* ======================================== |
2291 | - SUBROUTINE SORTTF (A,INDEX,N1) |
2292 | -C |
2293 | - DIMENSION A(N1),INDEX(N1) |
2294 | -C |
2295 | - N = N1 |
2296 | - DO 3 I1=2,N |
2297 | - I3 = I1 |
2298 | - I33 = INDEX(I3) |
2299 | - AI = A(I33) |
2300 | - 1 I2 = I3/2 |
2301 | - IF (I2) 3,3,2 |
2302 | - 2 I22 = INDEX(I2) |
2303 | - IF (AI.LE.A (I22)) GO TO 3 |
2304 | - INDEX (I3) = I22 |
2305 | - I3 = I2 |
2306 | - GO TO 1 |
2307 | - 3 INDEX (I3) = I33 |
2308 | - 4 I3 = INDEX (N) |
2309 | - INDEX (N) = INDEX (1) |
2310 | - AI = A(I3) |
2311 | - N = N-1 |
2312 | - IF (N-1) 12,12,5 |
2313 | - 5 I1 = 1 |
2314 | - 6 I2 = I1 + I1 |
2315 | - IF (I2.LE.N) I22= INDEX(I2) |
2316 | - IF (I2-N) 7,9,11 |
2317 | - 7 I222 = INDEX (I2+1) |
2318 | - IF (A(I22)-A(I222)) 8,9,9 |
2319 | - 8 I2 = I2+1 |
2320 | - I22 = I222 |
2321 | - 9 IF (AI-A(I22)) 10,11,11 |
2322 | - 10 INDEX(I1) = I22 |
2323 | - I1 = I2 |
2324 | - GO TO 6 |
2325 | - 11 INDEX (I1) = I3 |
2326 | - GO TO 4 |
2327 | - 12 INDEX (1) = I3 |
2328 | - RETURN |
2329 | - END |
2330 | -* ======================================== |
2331 | - SUBROUTINE SORTTI (A,INDEX,N1) |
2332 | -C |
2333 | - INTEGER A,AI |
2334 | - DIMENSION A(N1),INDEX(N1) |
2335 | -C |
2336 | - N = N1 |
2337 | - DO 3 I1=2,N |
2338 | - I3 = I1 |
2339 | - I33 = INDEX(I3) |
2340 | - AI = A(I33) |
2341 | - 1 I2 = I3/2 |
2342 | - IF (I2) 3,3,2 |
2343 | - 2 I22 = INDEX(I2) |
2344 | - IF (AI.LE.A (I22)) GO TO 3 |
2345 | - INDEX (I3) = I22 |
2346 | - I3 = I2 |
2347 | - GO TO 1 |
2348 | - 3 INDEX (I3) = I33 |
2349 | - 4 I3 = INDEX (N) |
2350 | - INDEX (N) = INDEX (1) |
2351 | - AI = A(I3) |
2352 | - N = N-1 |
2353 | - IF (N-1) 12,12,5 |
2354 | - 5 I1 = 1 |
2355 | - 6 I2 = I1 + I1 |
2356 | - IF (I2.LE.N) I22= INDEX(I2) |
2357 | - IF (I2-N) 7,9,11 |
2358 | - 7 I222 = INDEX (I2+1) |
2359 | - IF (A(I22)-A(I222)) 8,9,9 |
2360 | - 8 I2 = I2+1 |
2361 | - I22 = I222 |
2362 | - 9 IF (AI-A(I22)) 10,11,11 |
2363 | - 10 INDEX(I1) = I22 |
2364 | - I1 = I2 |
2365 | - GO TO 6 |
2366 | - 11 INDEX (I1) = I3 |
2367 | - GO TO 4 |
2368 | - 12 INDEX (1) = I3 |
2369 | - RETURN |
2370 | - END |
2371 | -* ======================================== |
2372 | - SUBROUTINE SORTTC (A,INDEX,N1) |
2373 | -C |
2374 | - INTEGER A,AI |
2375 | - DIMENSION A(N1),INDEX(N1) |
2376 | -C |
2377 | - N = N1 |
2378 | - DO 3 I1=2,N |
2379 | - I3 = I1 |
2380 | - I33 = INDEX(I3) |
2381 | - AI = A(I33) |
2382 | - 1 I2 = I3/2 |
2383 | - IF (I2) 3,3,2 |
2384 | - 2 I22 = INDEX(I2) |
2385 | - IF(ICMPCH(AI,A(I22)))3,3,21 |
2386 | - 21 INDEX (I3) = I22 |
2387 | - I3 = I2 |
2388 | - GO TO 1 |
2389 | - 3 INDEX (I3) = I33 |
2390 | - 4 I3 = INDEX (N) |
2391 | - INDEX (N) = INDEX (1) |
2392 | - AI = A(I3) |
2393 | - N = N-1 |
2394 | - IF (N-1) 12,12,5 |
2395 | - 5 I1 = 1 |
2396 | - 6 I2 = I1 + I1 |
2397 | - IF (I2.LE.N) I22= INDEX(I2) |
2398 | - IF (I2-N) 7,9,11 |
2399 | - 7 I222 = INDEX (I2+1) |
2400 | - IF (ICMPCH(A(I22),A(I222))) 8,9,9 |
2401 | - 8 I2 = I2+1 |
2402 | - I22 = I222 |
2403 | - 9 IF (ICMPCH(AI,A(I22))) 10,11,11 |
2404 | - 10 INDEX(I1) = I22 |
2405 | - I1 = I2 |
2406 | - GO TO 6 |
2407 | - 11 INDEX (I1) = I3 |
2408 | - GO TO 4 |
2409 | - 12 INDEX (1) = I3 |
2410 | - RETURN |
2411 | - END |
2412 | -* ======================================== |
2413 | - FUNCTION ICMPCH(IC1,IC2) |
2414 | -C FUNCTION TO COMPARE TWO 4 CHARACTER EBCDIC STRINGS - IC1,IC2 |
2415 | -C ICMPCH=-1 IF HEX VALUE OF IC1 IS LESS THAN IC2 |
2416 | -C ICMPCH=0 IF HEX VALUES OF IC1 AND IC2 ARE THE SAME |
2417 | -C ICMPCH=+1 IF HEX VALUES OF IC1 IS GREATER THAN IC2 |
2418 | - I1=IC1 |
2419 | - I2=IC2 |
2420 | - IF(I1.GE.0.AND.I2.GE.0)GOTO 40 |
2421 | - IF(I1.GE.0)GOTO 60 |
2422 | - IF(I2.GE.0)GOTO 80 |
2423 | - I1=-I1 |
2424 | - I2=-I2 |
2425 | - IF(I1-I2)80,70,60 |
2426 | - 40 IF(I1-I2)60,70,80 |
2427 | - 60 ICMPCH=-1 |
2428 | - RETURN |
2429 | - 70 ICMPCH=0 |
2430 | - RETURN |
2431 | - 80 ICMPCH=1 |
2432 | - RETURN |
2433 | - END |
2434 | - |
2435 | + logical function pass_point(p) |
2436 | +c************************************************************************ |
2437 | +c This function is called from sample to see if it needs to |
2438 | +c bother calculating the weight from all the different conficurations |
2439 | +c You can either just return true, or have it call passcuts |
2440 | +c************************************************************************ |
2441 | + implicit none |
2442 | +c |
2443 | +c Arguments |
2444 | +c |
2445 | + double precision p |
2446 | +c |
2447 | +c External |
2448 | +c |
2449 | + logical passcuts |
2450 | + external passcuts |
2451 | +c----- |
2452 | +c Begin Code |
2453 | +c----- |
2454 | + pass_point = .true. |
2455 | +c pass_point = passcuts(p) |
2456 | + end |
2457 | +C |
2458 | + LOGICAL FUNCTION PASSCUTS(P) |
2459 | +C************************************************************************** |
2460 | +C INPUT: |
2461 | +C P(0:3,1) MOMENTUM OF INCOMING PARTON |
2462 | +C P(0:3,2) MOMENTUM OF INCOMING PARTON |
2463 | +C P(0:3,3) MOMENTUM OF ... |
2464 | +C ALL MOMENTA ARE IN THE REST FRAME!! |
2465 | +C COMMON/JETCUTS/ CUTS ON JETS |
2466 | +C OUTPUT: |
2467 | +C TRUE IF EVENTS PASSES ALL CUTS LISTED |
2468 | +C************************************************************************** |
2469 | + IMPLICIT NONE |
2470 | +c |
2471 | +c Constants |
2472 | +c |
2473 | + include 'genps.inc' |
2474 | + include 'nexternal.inc' |
2475 | +C |
2476 | +C ARGUMENTS |
2477 | +C |
2478 | + REAL*8 P(0:3,nexternal) |
2479 | + |
2480 | +C |
2481 | +C LOCAL |
2482 | +C |
2483 | + LOGICAL FIRSTTIME,FIRSTTIME2,pass_bw,notgood,good,foundheavy |
2484 | + LOGICAL DEBUG |
2485 | + integer i,j,njets,nheavyjets,nleptons,hardj1,hardj2 |
2486 | + REAL*8 XVAR,ptmax1,ptmax2,htj,tmp,inclht |
2487 | + real*8 ptemp(0:3), ptemp2(0:3) |
2488 | + character*20 formstr |
2489 | +C |
2490 | +C PARAMETERS |
2491 | +C |
2492 | + real*8 PI |
2493 | + parameter( PI = 3.14159265358979323846d0 ) |
2494 | +C |
2495 | +C EXTERNAL |
2496 | +C |
2497 | + REAL*8 R2,DOT,ET,RAP,DJ,SumDot,pt,ALPHAS,PtDot |
2498 | + logical cut_bw,setclscales |
2499 | + external R2,DOT,ET,RAP,DJ,SumDot,pt,ALPHAS,cut_bw,setclscales,PtDot |
2500 | +C |
2501 | +C GLOBAL |
2502 | +C |
2503 | + include 'run.inc' |
2504 | + include 'cuts.inc' |
2505 | + |
2506 | + double precision ptjet(nexternal) |
2507 | + double precision ptheavyjet(nexternal) |
2508 | + double precision ptlepton(nexternal) |
2509 | + double precision temp |
2510 | + |
2511 | +C VARIABLES TO SPECIFY JETS |
2512 | + DOUBLE PRECISION PJET(NEXTERNAL,0:3) |
2513 | + DOUBLE PRECISION PTMIN |
2514 | + DOUBLE PRECISION PT1,PT2 |
2515 | + |
2516 | +C INTEGERS FOR COUNTING. |
2517 | + INTEGER K,L,J1,J2 |
2518 | + |
2519 | +C VARIABLES FOR KT CUT |
2520 | + DOUBLE PRECISION PTNOW,COSTH,PABS1,PABS2 |
2521 | + DOUBLE PRECISION ETA1,ETA2,COSH_DETA,COS_DPHI,KT1SQ,KT2SQ, DPHI |
2522 | + |
2523 | + double precision etmin(nincoming+1:nexternal),etamax(nincoming+1:nexternal) |
2524 | + double precision emin(nincoming+1:nexternal) |
2525 | + double precision r2min(nincoming+1:nexternal,nincoming+1:nexternal) |
2526 | + double precision s_min(nexternal,nexternal) |
2527 | + double precision etmax(nincoming+1:nexternal),etamin(nincoming+1:nexternal) |
2528 | + double precision emax(nincoming+1:nexternal) |
2529 | + double precision r2max(nincoming+1:nexternal,nincoming+1:nexternal) |
2530 | + double precision s_max(nexternal,nexternal) |
2531 | + double precision ptll_min(nexternal,nexternal),ptll_max(nexternal,nexternal) |
2532 | + double precision inclHtmin,inclHtmax |
2533 | + common/to_cuts/ etmin, emin, etamax, r2min, s_min, |
2534 | + $ etmax, emax, etamin, r2max, s_max, ptll_min, ptll_max, inclHtmin,inclHtmax |
2535 | + |
2536 | + double precision ptjmin4(4),ptjmax4(4),htjmin4(2:4),htjmax4(2:4) |
2537 | + logical jetor |
2538 | + common/to_jet_cuts/ ptjmin4,ptjmax4,htjmin4,htjmax4,jetor |
2539 | + |
2540 | + double precision ptlmin4(4),ptlmax4(4) |
2541 | + common/to_lepton_cuts/ ptlmin4,ptlmax4 |
2542 | + |
2543 | +c |
2544 | +c Special cuts |
2545 | +c |
2546 | + |
2547 | + integer lbw(0:nexternal) !Use of B.W. |
2548 | + common /to_BW/ lbw |
2549 | +C |
2550 | +C SPECIAL CUTS |
2551 | +C |
2552 | + LOGICAL IS_A_J(NEXTERNAL),IS_A_L(NEXTERNAL) |
2553 | + LOGICAL IS_A_B(NEXTERNAL),IS_A_A(NEXTERNAL),IS_A_ONIUM(NEXTERNAL) |
2554 | + LOGICAL IS_A_NU(NEXTERNAL),IS_HEAVY(NEXTERNAL) |
2555 | + logical do_cuts(nexternal) |
2556 | + COMMON /TO_SPECISA/IS_A_J,IS_A_A,IS_A_L,IS_A_B,IS_A_NU,IS_HEAVY, |
2557 | + . IS_A_ONIUM, do_cuts |
2558 | + |
2559 | +C |
2560 | +C MERGING SCALE CUT |
2561 | +C |
2562 | +C Retrieve which external particles undergo the ktdurham and ptlund cuts. |
2563 | + LOGICAL is_pdg_for_merging_cut(NEXTERNAL) |
2564 | + logical from_decay(-(nexternal+3):nexternal) |
2565 | + COMMON /TO_MERGE_CUTS/is_pdg_for_merging_cut, from_decay |
2566 | + |
2567 | +C |
2568 | +C ADDITIONAL VARIABLES FOR PTLUND CUT |
2569 | +C |
2570 | + INTEGER NMASSLESS |
2571 | + DOUBLE PRECISION PINC(NINCOMING,0:3) |
2572 | + DOUBLE PRECISION PRADTEMP(0:3), PRECTEMP(0:3), PEMTTEMP(0:3) |
2573 | + DOUBLE PRECISION PTMINSAVE, RHOPYTHIA |
2574 | + EXTERNAL RHOPYTHIA |
2575 | +C |
2576 | +C FLAVOUR INFORMATION NECESSARY TO RECONSTRUCT PTLUND |
2577 | +C |
2578 | + INTEGER JETFLAVOUR(NEXTERNAL), INCFLAVOUR(NINCOMING) |
2579 | + include 'maxamps.inc' |
2580 | + integer idup(nexternal,maxproc,maxsproc) |
2581 | + integer mothup(2,nexternal) |
2582 | + integer icolup(2,nexternal,maxflow,maxsproc) |
2583 | + include 'leshouche.inc' |
2584 | + |
2585 | +C |
2586 | +C Keep track of whether cuts already calculated for this event |
2587 | +C |
2588 | + LOGICAL CUTSDONE,CUTSPASSED |
2589 | + COMMON/TO_CUTSDONE/CUTSDONE,CUTSPASSED |
2590 | + DATA CUTSDONE,CUTSPASSED/.FALSE.,.FALSE./ |
2591 | + |
2592 | +C $B$ MW_NEW_DEF $E$ !this is a tag for MadWeight |
2593 | + |
2594 | + double precision xqcutij(nexternal,nexternal),xqcuti(nexternal) |
2595 | + common/to_xqcuts/xqcutij,xqcuti |
2596 | + |
2597 | +c jet cluster algorithm |
2598 | + integer nQCD !,NJET,JET(nexternal) |
2599 | +c double precision plab(0:3, nexternal) |
2600 | + double precision pQCD(0:3,nexternal)!,PJET(0:3,nexternal) |
2601 | +c double precision rfj,sycut,palg,fastjetdmerge |
2602 | +c integer njet_eta |
2603 | +c Photon isolation |
2604 | + integer nph,nem,nin |
2605 | + double precision ptg,chi_gamma_iso,iso_getdrv40 |
2606 | + double precision Etsum(0:nexternal) |
2607 | + real drlist(nexternal) |
2608 | + double precision pgamma(0:3,nexternal),pem(0:3,nexternal) |
2609 | + logical alliso |
2610 | +C Sort array of results: ismode>0 for real, isway=0 for ascending order |
2611 | + integer ismode,isway,izero,isorted(nexternal) |
2612 | + parameter (ismode=1) |
2613 | + parameter (isway=0) |
2614 | + parameter (izero=0) |
2615 | + |
2616 | + include 'coupl.inc' |
2617 | + |
2618 | +C |
2619 | +C |
2620 | +c |
2621 | + DATA FIRSTTIME,FIRSTTIME2/.TRUE.,.TRUE./ |
2622 | + |
2623 | +c put momenta in common block for couplings.f |
2624 | + double precision pp(0:3,max_particles) |
2625 | + common /momenta_pp/pp |
2626 | + |
2627 | + DATA DEBUG/.FALSE./ |
2628 | + |
2629 | +C----- |
2630 | +C BEGIN CODE |
2631 | +C----- |
2632 | + |
2633 | + |
2634 | + |
2635 | + PASSCUTS=.TRUE. !EVENT IS OK UNLESS OTHERWISE CHANGED |
2636 | + IF (FIRSTTIME) THEN |
2637 | + FIRSTTIME=.FALSE. |
2638 | +c Preparation for reweighting by setting up clustering by diagrams |
2639 | + call initcluster() |
2640 | +c |
2641 | +c |
2642 | + write(formstr,'(a,i2.2,a)')'(a10,',nexternal,'i8)' |
2643 | + write(*,formstr) 'Particle',(i,i=nincoming+1,nexternal) |
2644 | + write(formstr,'(a,i2.2,a)')'(a10,',nexternal,'f8.1)' |
2645 | + write(*,formstr) 'Et >',(etmin(i),i=nincoming+1,nexternal) |
2646 | + write(*,formstr) 'E >',(emin(i),i=nincoming+1,nexternal) |
2647 | + write(*,formstr) 'Eta <',(etamax(i),i=nincoming+1,nexternal) |
2648 | + write(*,formstr) 'xqcut: ',(xqcuti(i),i=nincoming+1,nexternal) |
2649 | + write(formstr,'(a,i2.2,a)')'(a,i2,a,',nexternal,'f8.1)' |
2650 | + do j=nincoming+1,nexternal-1 |
2651 | + write(*,formstr) 'd R #',j,' >',(-0.0,i=nincoming+1,j), |
2652 | + & (r2min(i,j),i=j+1,nexternal) |
2653 | + do i=j+1,nexternal |
2654 | + r2min(i,j)=r2min(i,j)*dabs(r2min(i,j)) !Since r2 returns distance squared |
2655 | + r2max(i,j)=r2max(i,j)*dabs(r2max(i,j)) |
2656 | + enddo |
2657 | + enddo |
2658 | + do j=nincoming+1,nexternal-1 |
2659 | + write(*,formstr) 's min #',j,'>', |
2660 | + & (s_min(i,j),i=nincoming+1,nexternal) |
2661 | + enddo |
2662 | + do j=nincoming+1,nexternal-1 |
2663 | + write(*,formstr) 'xqcutij #',j,'>', |
2664 | + & (xqcutij(i,j),i=nincoming+1,nexternal) |
2665 | + enddo |
2666 | + |
2667 | +cc |
2668 | +cc Set the strong coupling |
2669 | +cc |
2670 | +c call set_ren_scale(P,scale) |
2671 | +c |
2672 | +cc Check that the user funtions for setting the scales |
2673 | +cc have been edited if the choice of an event-by-event |
2674 | +cc scale choice has been made |
2675 | +c |
2676 | +c if(.not.fixed_ren_scale) then |
2677 | +c if(scale.eq.0d0) then |
2678 | +c write(6,*) |
2679 | +c write(6,*) '* >>>>>>>>>ERROR<<<<<<<<<<<<<<<<<<<<<<<*' |
2680 | +c write(6,*) ' Dynamical renormalization scale choice ' |
2681 | +c write(6,*) ' selected but user subroutine' |
2682 | +c write(6,*) ' set_ren_scale not edited in file:setpara.f' |
2683 | +c write(6,*) ' Switching to a fixed_ren_scale choice' |
2684 | +c write(6,*) ' with scale=zmass' |
2685 | +c scale=91.2d0 |
2686 | +c write(6,*) 'scale=',scale |
2687 | +c fixed_ren_scale=.true. |
2688 | +c call set_ren_scale(P,scale) |
2689 | +c endif |
2690 | +c endif |
2691 | + |
2692 | +c if(.not.fixed_fac_scale) then |
2693 | +c call set_fac_scale(P,q2fact) |
2694 | +c if(q2fact(1).eq.0d0.or.q2fact(2).eq.0d0) then |
2695 | +c write(6,*) |
2696 | +c write(6,*) '* >>>>>>>>>ERROR<<<<<<<<<<<<<<<<<<<<<<<*' |
2697 | +c write(6,*) ' Dynamical renormalization scale choice ' |
2698 | +c write(6,*) ' selected but user subroutine' |
2699 | +c write(6,*) ' set_fac_scale not edited in file:setpara.f' |
2700 | +c write(6,*) ' Switching to a fixed_fac_scale choice' |
2701 | +c write(6,*) ' with q2fact(i)=zmass**2' |
2702 | +c fixed_fac_scale=.true. |
2703 | +c q2fact(1)=91.2d0**2 |
2704 | +c q2fact(2)=91.2d0**2 |
2705 | +c write(6,*) 'scales=',q2fact(1),q2fact(2) |
2706 | +c endif |
2707 | +c endif |
2708 | + |
2709 | + if(fixed_ren_scale) then |
2710 | + G = SQRT(4d0*PI*ALPHAS(scale)) |
2711 | + call update_as_param() |
2712 | + endif |
2713 | + |
2714 | +c Put momenta in the common block to zero to start |
2715 | + do i=0,3 |
2716 | + do j=1,max_particles |
2717 | + pp(i,j) = 0d0 |
2718 | + enddo |
2719 | + enddo |
2720 | + |
2721 | + ENDIF ! IF FIRSTTIME |
2722 | + |
2723 | + IF (CUTSDONE) THEN |
2724 | + PASSCUTS=CUTSPASSED |
2725 | + RETURN |
2726 | + ENDIF |
2727 | + CUTSDONE=.TRUE. |
2728 | +c CUTSPASSED=.FALSE. |
2729 | + |
2730 | +c |
2731 | +c Make sure have reasonable 4-momenta |
2732 | +c |
2733 | + if (p(0,1) .le. 0d0) then |
2734 | + passcuts=.false. |
2735 | + return |
2736 | + endif |
2737 | + |
2738 | +c Also make sure there's no INF or NAN |
2739 | + do i=1,nexternal |
2740 | + do j=0,3 |
2741 | + if(p(j,i).gt.1d32.or.p(j,i).ne.p(j,i))then |
2742 | + passcuts=.false. |
2743 | + return |
2744 | + endif |
2745 | + enddo |
2746 | + enddo |
2747 | + |
2748 | +c |
2749 | +c Limit S_hat |
2750 | +c |
2751 | +c if (x1*x2*stot .gt. 500**2) then |
2752 | +c passcuts=.false. |
2753 | +c return |
2754 | +c endif |
2755 | + |
2756 | +C $B$ DESACTIVATE_CUT $E$ !This is a tag for MadWeight |
2757 | + |
2758 | + if(debug) write (*,*) '=============================' |
2759 | + if(debug) write (*,*) ' EVENT STARTS TO BE CHECKED ' |
2760 | + if(debug) write (*,*) '=============================' |
2761 | +c |
2762 | +c p_t min & max cuts |
2763 | +c |
2764 | + do i=nincoming+1,nexternal |
2765 | + if(debug) write (*,*) 'pt(',i,')=',pt(p(0,i)),' ',etmin(i), |
2766 | + $ ':',etmax(i) |
2767 | + notgood=(pt(p(0,i)) .lt. etmin(i)).or. |
2768 | + & (etmax(i).ge.0d0.and.pt(p(0,i)) .gt. etmax(i)) |
2769 | + if (notgood) then |
2770 | + if(debug) write (*,*) i,' -> fails' |
2771 | + passcuts=.false. |
2772 | + return |
2773 | + endif |
2774 | + enddo |
2775 | +c |
2776 | +c missing ET min & max cut + Invariant mass of leptons and neutrino |
2777 | +c nb: missing Et defined as the vector sum over the neutrino's pt |
2778 | +c |
2779 | +c-- reset ptemp(0:3) |
2780 | + do j=0,3 |
2781 | + ptemp(j)=0 ! for the neutrino |
2782 | + ptemp2(j)=0 ! for the leptons |
2783 | + enddo |
2784 | +c- sum over the momenta |
2785 | + do i=nincoming+1,nexternal |
2786 | + if(is_a_nu(i)) then |
2787 | + if(debug) write (*,*) i,' -> neutrino ' |
2788 | + do j=0,3 |
2789 | + ptemp(j)=ptemp(j)+p(j,i) |
2790 | + enddo |
2791 | + elseif(is_a_l(i)) then |
2792 | + if(debug) write (*,*) i,' -> lepton ' |
2793 | + do j=0,3 |
2794 | + ptemp2(j)=ptemp2(j)+p(j,i) |
2795 | + enddo |
2796 | + endif |
2797 | + |
2798 | + enddo |
2799 | +c- check the et |
2800 | + if(debug.and.ptemp(0).eq.0d0) write (*,*) 'No et miss in event' |
2801 | + if(debug.and.ptemp(0).gt.0d0) write (*,*) 'Et miss =',pt(ptemp(0)),' ',misset,':',missetmax |
2802 | + if(debug.and.ptemp2(0).eq.0d0) write (*,*) 'No leptons in event' |
2803 | + if(debug.and.ptemp(0).gt.0d0) write (*,*) 'Energy of leptons =',pt(ptemp2(0)) |
2804 | + if(ptemp(0).gt.0d0) then |
2805 | + notgood=(pt(ptemp(0)) .lt. misset).or. |
2806 | + & (missetmax.ge.0d0.and.pt(ptemp(0)) .gt. missetmax) |
2807 | + if (notgood) then |
2808 | + if(debug) write (*,*) ' missing et cut -> fails' |
2809 | + passcuts=.false. |
2810 | + return |
2811 | + endif |
2812 | + endif |
2813 | + if (mmnl.gt.0d0.or.mmnlmax.ge.0d0)then |
2814 | + if(dsqrt(SumDot(ptemp,ptemp2,1d0)).lt.mmnl.or.mmnlmax.ge.0d0.and.dsqrt(SumDot(ptemp, ptemp2,1d0)).gt.mmnlmax) then |
2815 | + if(debug) write (*,*) 'lepton invariant mass -> fails' |
2816 | + passcuts=.false. |
2817 | + return |
2818 | + endif |
2819 | + endif |
2820 | +c |
2821 | +c pt cut on heavy particles |
2822 | +c gives min(pt) for (at least) one heavy particle |
2823 | +c |
2824 | + if(ptheavy.gt.0d0)then |
2825 | + passcuts=.false. |
2826 | + foundheavy=.false. |
2827 | + do i=nincoming+1,nexternal |
2828 | + if(is_heavy(i)) then |
2829 | + if(debug) write (*,*) i,' -> heavy ' |
2830 | + foundheavy=.true. |
2831 | + if(pt(p(0,i)).gt.ptheavy) passcuts=.true. |
2832 | + endif |
2833 | + enddo |
2834 | + |
2835 | + if(.not.passcuts.and.foundheavy)then |
2836 | + if(debug) write (*,*) ' heavy particle cut -> fails' |
2837 | + return |
2838 | + else |
2839 | + passcuts=.true. |
2840 | + endif |
2841 | + endif |
2842 | +c |
2843 | +c E min & max cuts |
2844 | +c |
2845 | + do i=nincoming+1,nexternal |
2846 | + if(debug) write (*,*) 'p(0,',i,')=',p(0,i),' ',emin(i),':',emax(i) |
2847 | + notgood=(p(0,i) .le. emin(i)).or. |
2848 | + & (emax(i).ge.0d0 .and. p(0,i) .gt. emax(i)) |
2849 | + if (notgood) then |
2850 | + if(debug) write (*,*) i,' -> fails' |
2851 | + passcuts=.false. |
2852 | + return |
2853 | + endif |
2854 | + enddo |
2855 | +c |
2856 | +c Rapidity min & max cuts |
2857 | +c |
2858 | + do i=nincoming+1,nexternal |
2859 | + if(debug) write (*,*) 'abs(rap(',i,'))=',abs(rap(p(0,i))),' ',etamin(i),':',etamax(i) |
2860 | + notgood=(etamax(i).ge.0.and.abs(rap(p(0,i))) .gt. etamax(i)).or. |
2861 | + & (abs(rap(p(0,i))) .lt. etamin(i)) |
2862 | + if (notgood) then |
2863 | + if(debug) write (*,*) i,' -> fails' |
2864 | + passcuts=.false. |
2865 | + return |
2866 | + endif |
2867 | + enddo |
2868 | +c |
2869 | +c DeltaR min & max cuts |
2870 | +c |
2871 | + do i=nincoming+1,nexternal-1 |
2872 | + do j=i+1,nexternal |
2873 | + if(debug) write (*,*) 'r2(',i, ',' ,j,')=',dsqrt(r2(p(0,i),p(0,j))) |
2874 | + if(debug) write (*,*) dsqrt(r2min(j,i)),dsqrt(r2max(j,i)) |
2875 | + if(r2min(j,i).gt.0.or.r2max(j,i).ge.0d0) then |
2876 | + tmp=r2(p(0,i),p(0,j)) |
2877 | + notgood=(tmp .lt. r2min(j,i)).or. |
2878 | + $ (r2max(j,i).ge.0d0 .and. tmp .gt. r2max(j,i)) |
2879 | + if (notgood) then |
2880 | + if(debug) write (*,*) i,j,' -> fails' |
2881 | + passcuts=.false. |
2882 | + return |
2883 | + endif |
2884 | + endif |
2885 | + enddo |
2886 | + enddo |
2887 | + |
2888 | + |
2889 | +c s-channel min & max pt of sum of 4-momenta |
2890 | +c |
2891 | + do i=nincoming+1,nexternal-1 |
2892 | + do j=i+1,nexternal |
2893 | + if(debug)write (*,*) 'ptll(',i,',',j,')=',PtDot(p(0,i),p(0,j)) |
2894 | + if(debug)write (*,*) ptll_min(j,i),ptll_max(j,i) |
2895 | + if(ptll_min(j,i).gt.0.or.ptll_max(j,i).ge.0d0) then |
2896 | + tmp=PtDot(p(0,i),p(0,j)) |
2897 | + notgood=(tmp .lt. ptll_min(j,i).or. |
2898 | + $ ptll_max(j,i).ge.0d0 .and. tmp.gt.ptll_max(j,i)) |
2899 | + if (notgood) then |
2900 | + if(debug) write (*,*) i,j,' -> fails' |
2901 | + passcuts=.false. |
2902 | + return |
2903 | + endif |
2904 | + endif |
2905 | + enddo |
2906 | + enddo |
2907 | + |
2908 | + |
2909 | + |
2910 | + |
2911 | +c |
2912 | +c s-channel min & max invariant mass cuts |
2913 | +c |
2914 | + do i=nincoming+1,nexternal-1 |
2915 | + do j=i+1,nexternal |
2916 | + if(debug) write (*,*) 's(',i,',',j,')=',Sumdot(p(0,i),p(0,j),+1d0) |
2917 | + if(debug) write (*,*) s_min(j,i),s_max(j,i) |
2918 | + if(s_min(j,i).gt.0.or.s_max(j,i).ge.0d0) then |
2919 | + tmp=SumDot(p(0,i),p(0,j),+1d0) |
2920 | + if(s_min(j,i).le.s_max(j,i) .or. s_max(j,i).lt.0d0)then |
2921 | + notgood=(tmp .lt. s_min(j,i).or. |
2922 | + $ s_max(j,i).ge.0d0 .and. tmp .gt. s_max(j,i)) |
2923 | + if (notgood) then |
2924 | + if(debug) write (*,*) i,j,' -> fails' |
2925 | + passcuts=.false. |
2926 | + return |
2927 | + endif |
2928 | + else |
2929 | + notgood=(tmp .lt. s_min(j,i).and.tmp .gt. s_max(j,i)) |
2930 | + if (notgood) then |
2931 | + if(debug) write (*,*) i,j,' -> fails' |
2932 | + passcuts=.false. |
2933 | + return |
2934 | + endif |
2935 | + endif |
2936 | + endif |
2937 | + enddo |
2938 | + enddo |
2939 | +C $B$DESACTIVATE_BW_CUT$B$ This is a Tag for MadWeight |
2940 | +c |
2941 | +c B.W. phase space cuts |
2942 | +c |
2943 | + pass_bw=cut_bw(p) |
2944 | +c JA 4/8/11 always check pass_bw |
2945 | + if ( pass_bw.and..not.CUTSPASSED) then |
2946 | + passcuts=.false. |
2947 | + if(debug) write (*,*) ' pass_bw -> fails' |
2948 | + return |
2949 | + endif |
2950 | +C $E$DESACTIVATE_BW_CUT$E$ This is a Tag for MadWeight |
2951 | + CUTSPASSED=.FALSE. |
2952 | +C |
2953 | +C maximal and minimal pt of the jets sorted by pt |
2954 | +c |
2955 | + njets=0 |
2956 | + nheavyjets=0 |
2957 | + |
2958 | +c- fill ptjet with the pt's of the jets. |
2959 | + do i=nincoming+1,nexternal |
2960 | + if(is_a_j(i)) then |
2961 | + njets=njets+1 |
2962 | + ptjet(njets)=pt(p(0,i)) |
2963 | + endif |
2964 | + if(is_a_b(i)) then |
2965 | + nheavyjets=nheavyjets+1 |
2966 | + ptheavyjet(nheavyjets)=pt(p(0,i)) |
2967 | + endif |
2968 | + |
2969 | + enddo |
2970 | + if(debug) write (*,*) 'not yet ordered ',njets,' ',ptjet |
2971 | + |
2972 | +C---------------------------------------------------------------------------- |
2973 | +C DURHAM_KT CUT |
2974 | +C---------------------------------------------------------------------------- |
2975 | + |
2976 | + IF ( KT_DURHAM .GT. 0D0) THEN |
2977 | + |
2978 | +C RESET JET MOMENTA |
2979 | + njets=0 |
2980 | + DO I=1,NEXTERNAL |
2981 | + DO J=0,3 |
2982 | + PJET(I,J) = 0D0 |
2983 | + ENDDO |
2984 | + ENDDO |
2985 | + |
2986 | + do i=nincoming+1,nexternal |
2987 | + if(is_pdg_for_merging_cut(i) .and. .not. from_decay(I) ) then |
2988 | + njets=njets+1 |
2989 | + DO J=0,3 |
2990 | + PJET(NJETS,J) = P(J,I) |
2991 | + ENDDO |
2992 | + endif |
2993 | + enddo |
2994 | + |
2995 | +C COUNT NUMBER OF MASSLESS OUTGOING PARTICLES, SINCE WE DO NOT WANT |
2996 | +C TO APPLY A CUT FOR JUST A SINGLE MASSIVE PARTICLE IN THE FINAL STATE. |
2997 | + NMASSLESS = 0 |
2998 | + DO I=NINCOMING+1,NEXTERNAL |
2999 | + if(is_pdg_for_merging_cut(i) .and. .not. from_decay(I) .and. |
3000 | + & is_a_j(i).or.is_a_b(i)) then |
3001 | + NMASSLESS = NMASSLESS + 1 |
3002 | + ENDIF |
3003 | + ENDDO |
3004 | + |
3005 | +C DURHAM KT SEPARATION CUT |
3006 | + IF(NJETS.GT.0 .AND. NMASSLESS .GT. 0) THEN |
3007 | + |
3008 | + PTMIN = EBEAM(1) + EBEAM(2) |
3009 | + |
3010 | + DO I=1,NJETS |
3011 | + |
3012 | +C PT WITH RESPECT TO Z AXIS FOR HADRONIC COLLISIONS |
3013 | + IF ( (LPP(1).NE.0) .OR. (LPP(2).NE.0)) THEN |
3014 | + PT1 = DSQRT(PJET(I,1)**2 + PJET(I,2)**2) |
3015 | + PTMIN = MIN( PTMIN, PT1 ) |
3016 | + ENDIF |
3017 | + |
3018 | + DO J=I+1,NJETS |
3019 | +C GET ANGLE BETWEEN JETS |
3020 | + PABS1 = DSQRT(PJET(I,1)**2 + PJET(I,2)**2 + PJET(I,3)**2) |
3021 | + PABS2 = DSQRT(PJET(J,1)**2 + PJET(J,2)**2 + PJET(J,3)**2) |
3022 | +C CHECK IF 3-MOMENTA DO NOT VANISH |
3023 | + IF(PABS1*PABS2 .NE. 0D0) THEN |
3024 | + COSTH = ( PJET(I,1)*PJET(J,1) + PJET(I,2)*PJET(J,2) + PJET(I,3)*PJET(J,3) )/(PABS1*PABS2) |
3025 | + ELSE |
3026 | +C IF 3-MOMENTA VANISH, MAKE JET COSTH = 1D0 SO THAT JET MEASURE VANISHES |
3027 | + COSTH = 1D0 |
3028 | + ENDIF |
3029 | +C GET PT AND ETA OF JETS |
3030 | + PT2 = DSQRT(PJET(J,1)**2 + PJET(J,2)**2) |
3031 | + ETA1 = 0.5D0*LOG( (PJET(I,0) + PJET(I,3)) / (PJET(I,0) - PJET(I,3)) ) |
3032 | + ETA2 = 0.5D0*LOG( (PJET(J,0) + PJET(J,3)) / (PJET(J,0) - PJET(J,3)) ) |
3033 | +C GET COSH OF DELTA ETA, COS OF DELTA PHI |
3034 | + COSH_DETA = DCOSH( ETA1 - ETA2 ) |
3035 | + COS_DPHI = ( PJET(I,1)*PJET(J,1) + PJET(I,2)*PJET(J,2) ) / (PT1*PT2) |
3036 | + DPHI = DACOS( COS_DPHI ) |
3037 | + IF ( (LPP(1).EQ.0) .AND. (LPP(2).EQ.0)) THEN |
3038 | +C KT FOR E+E- COLLISION |
3039 | + PTNOW = DSQRT( 2D0*MIN(PJET(I,0)**2,PJET(J,0)**2)*( 1D0-COSTH ) ) |
3040 | + ELSE |
3041 | +C HADRONIC KT, FASTJET DEFINITION |
3042 | + PTNOW = DSQRT( MIN(PT1**2,PT2**2)*( (ETA1 - ETA2 )**2 + DPHI**2 )/(D_PARAMETER**2) ) |
3043 | + ENDIF |
3044 | + |
3045 | + PTMIN = MIN( PTMIN, PTNOW ) |
3046 | + |
3047 | + ENDDO ! LOOP OVER NJET |
3048 | + |
3049 | + ENDDO ! LOOP OVER NJET |
3050 | + |
3051 | +C CHECK COMPATIBILITY WITH CUT |
3052 | + IF( (PTMIN .LT. KT_DURHAM)) THEN |
3053 | + PASSCUTS = .FALSE. |
3054 | + RETURN |
3055 | + ENDIF |
3056 | + |
3057 | + ENDIF ! IF NJETS.GT. 0 |
3058 | + |
3059 | + ENDIF ! KT_DURHAM .GT. 0D0 |
3060 | + |
3061 | +C---------------------------------------------------------------------------- |
3062 | +C PTLUND CUT |
3063 | +C---------------------------------------------------------------------------- |
3064 | + |
3065 | + IF(PT_LUND .GT. 0D0 ) THEN |
3066 | + |
3067 | +C Reset jet momenta |
3068 | + NJETS=0 |
3069 | + DO I=1,NEXTERNAL |
3070 | + JETFLAVOUR(I) = 0 |
3071 | + DO J=0,3 |
3072 | + PJET(I,J) = 0D0 |
3073 | + ENDDO |
3074 | + ENDDO |
3075 | + |
3076 | +C Fill incoming particle momenta |
3077 | + DO I=1,NINCOMING |
3078 | + INCFLAVOUR(I) = IDUP(I,1,1) |
3079 | + DO J=0,3 |
3080 | + PINC(I,J) = P(J,I) |
3081 | + ENDDO |
3082 | + ENDDO |
3083 | + |
3084 | +C Fill final jet momenta |
3085 | + DO I=NINCOMING+1,NEXTERNAL |
3086 | + if(is_pdg_for_merging_cut(i) .and. .not. from_decay(I) ) then |
3087 | + NJETS=NJETS+1 |
3088 | + JETFLAVOUR(NJETS) = IDUP(I,1,1) |
3089 | + DO J=0,3 |
3090 | + PJET(NJETS,J) = P(J,I) |
3091 | + ENDDO |
3092 | + ENDIF |
3093 | + ENDDO |
3094 | + |
3095 | +C PROCESS WITH EXACTLY TWO MASSLESS OUTGOING PARTICLES IS SPECIAL |
3096 | +C BECAUSE AN ENERGY-SHARING VARIABLE LIKE "Z" DOES NOT MAKE SENSE. |
3097 | +C IN THIS CASE, ONLY APPLY MINIMAL pT W.R.T BEAM CUT. |
3098 | +C THIS CUT WILL ONLY APPLY TO THE TWO-MASSLESS PARTICLE STATE. |
3099 | + NMASSLESS = 0 |
3100 | + DO I=NINCOMING+1,NEXTERNAL |
3101 | + if(is_pdg_for_merging_cut(i) .and. .not. from_decay(I) .and. |
3102 | + & is_a_j(i).or.is_a_b(i)) THEN |
3103 | + NMASSLESS = NMASSLESS + 1 |
3104 | + ENDIF |
3105 | + ENDDO |
3106 | + IF (NMASSLESS .EQ. 2 .AND. NJETS .EQ. 2 .AND. |
3107 | + & NEXTERNAL-NINCOMING .EQ. 2) THEN |
3108 | + PTMINSAVE = EBEAM(1) + EBEAM(2) |
3109 | + DO I=NINCOMING+1,NEXTERNAL |
3110 | + if( .not. from_decay(I) ) then |
3111 | + PTMINSAVE = MIN(PTMINSAVE, PT(p(0,i))) |
3112 | + ENDIF |
3113 | + ENDDO |
3114 | +C CHECK COMPATIBILITY WITH CUT |
3115 | + IF ( ((LPP(1).NE.0) .OR. (LPP(2).NE.0)) .AND. |
3116 | + & PTMINSAVE .LT. PT_LUND) THEN |
3117 | + PASSCUTS = .FALSE. |
3118 | + RETURN |
3119 | + ENDIF |
3120 | +C RESET NJETS TO AVOID FURTHER MERGING SCALE CUT. |
3121 | + NJETS=0 |
3122 | + ENDIF |
3123 | + |
3124 | +C PYTHIA PT SEPARATION CUT |
3125 | + IF(NJETS.GT.0 .AND. NMASSLESS .GT. 0) THEN |
3126 | + |
3127 | + PTMINSAVE = EBEAM(1) + EBEAM(2) |
3128 | + |
3129 | + DO I=1,NJETS |
3130 | + |
3131 | + PTMIN = EBEAM(1) + EBEAM(2) |
3132 | + PTMINSAVE = MIN(PTMIN,PTMINSAVE) |
3133 | + |
3134 | +C Compute pythia ISR separation between i-jet and incoming. |
3135 | +C Only SM-like emissions off the beam are possible. |
3136 | + IF ( ( (LPP(1).NE.0) .OR. (LPP(2).NE.0)) .AND. |
3137 | + & ABS(JETFLAVOUR(I)) .LT. 30 ) THEN |
3138 | +C Check separation to first incoming particle |
3139 | + DO L=0,3 |
3140 | + PRADTEMP(L) = PINC(1,L) |
3141 | + PEMTTEMP(L) = PJET(I,L) |
3142 | + PRECTEMP(L) = PINC(2,L) |
3143 | + ENDDO |
3144 | + PT1 = RHOPYTHIA(PRADTEMP, PEMTTEMP, PRECTEMP, INCFLAVOUR(1), |
3145 | + & JETFLAVOUR(I), -1, -1) |
3146 | + PTMIN = MIN( PTMIN, PT1 ) |
3147 | +C Check separation to second incoming particle |
3148 | + DO L=0,3 |
3149 | + PRADTEMP(L) = PINC(2,L) |
3150 | + PEMTTEMP(L) = PJET(I,L) |
3151 | + PRECTEMP(L) = PINC(1,L) |
3152 | + ENDDO |
3153 | + PT2 = RHOPYTHIA(PRADTEMP, PEMTTEMP, PRECTEMP, INCFLAVOUR(2), |
3154 | + & JETFLAVOUR(I), -1, -1) |
3155 | + PTMIN = MIN( PTMIN, PT2 ) |
3156 | + ENDIF |
3157 | + |
3158 | +C Compute pythia FSR separation between two jets, |
3159 | +C without any knowledge of colour connections |
3160 | + DO J=1,NJETS |
3161 | + DO K=1,NJETS |
3162 | + IF ( I .NE. J .AND. I .NE. K .AND. J .NE. K ) THEN |
3163 | + |
3164 | +C Check separation between final partons i and j, with k as spectator |
3165 | + DO L=0,3 |
3166 | + PRADTEMP(L) = PJET(J,L) |
3167 | + PEMTTEMP(L) = PJET(I,L) |
3168 | + PRECTEMP(L) = PJET(K,L) |
3169 | + ENDDO |
3170 | + |
3171 | + TEMP = RHOPYTHIA( PRADTEMP, PEMTTEMP, PRECTEMP, |
3172 | + & JETFLAVOUR(J), JETFLAVOUR(I), 1, 1) |
3173 | +C Only SM-like emissions off the beam are possible, no additional |
3174 | +C BSM particles will be produced as as shower emissions. |
3175 | + IF ( ABS(JETFLAVOUR(I)) .LT. 30 ) THEN |
3176 | + PTMIN = MIN(PTMIN, TEMP); |
3177 | + ENDIF |
3178 | + |
3179 | + TEMP = RHOPYTHIA( PEMTTEMP, PRADTEMP, PRECTEMP, |
3180 | + & JETFLAVOUR(I), JETFLAVOUR(J), 1, 1) |
3181 | +C Only SM-like emissions off the beam are possible, no additional |
3182 | +C BSM particles will be produced as as shower emissions. |
3183 | + IF ( ABS(JETFLAVOUR(J)) .LT. 30 ) THEN |
3184 | + PTMIN = MIN(PTMIN, TEMP); |
3185 | + ENDIF |
3186 | + |
3187 | + ENDIF |
3188 | + |
3189 | + ENDDO ! LOOP OVER NJET |
3190 | + ENDDO ! LOOP OVER NJET |
3191 | + |
3192 | +C Compute pythia FSR separation between two jets, with initial spectator |
3193 | + IF ( (LPP(1).NE.0) .OR. (LPP(2).NE.0)) THEN |
3194 | + DO J=1,NJETS |
3195 | + |
3196 | +C BSM particles can only be radiators, and will not be produced |
3197 | +C as shower emissions. |
3198 | + IF ( ABS(JETFLAVOUR(I)) .GT. 1000000 ) THEN |
3199 | + EXIT |
3200 | + ENDIF |
3201 | + |
3202 | +C Allow both initial partons as recoiler |
3203 | + IF ( I .NE. J ) THEN |
3204 | + |
3205 | +C Check with first initial as recoiler |
3206 | + DO L=0,3 |
3207 | + PRADTEMP(L) = PJET(J,L) |
3208 | + PEMTTEMP(L) = PJET(I,L) |
3209 | + PRECTEMP(L) = PINC(1,L) |
3210 | + ENDDO |
3211 | + TEMP = RHOPYTHIA( PRADTEMP, PEMTTEMP, PRECTEMP, |
3212 | + & JETFLAVOUR(J), JETFLAVOUR(I), 1, -1); |
3213 | + IF ( LPP(1) .NE. 0 ) THEN |
3214 | + PTMIN = MIN(PTMIN, TEMP); |
3215 | + ENDIF |
3216 | + DO L=0,3 |
3217 | + PRADTEMP(L) = PJET(J,L) |
3218 | + PEMTTEMP(L) = PJET(I,L) |
3219 | + PRECTEMP(L) = PINC(2,L) |
3220 | + ENDDO |
3221 | + TEMP = RHOPYTHIA( PRADTEMP, PEMTTEMP, PRECTEMP, |
3222 | + & JETFLAVOUR(J), JETFLAVOUR(I), 1, -1); |
3223 | + IF ( LPP(2) .NE. 0 ) THEN |
3224 | + PTMIN = MIN(PTMIN, TEMP); |
3225 | + ENDIF |
3226 | + ENDIF |
3227 | + ENDDO ! LOOP OVER NJET |
3228 | + ENDIF |
3229 | + |
3230 | + PTMINSAVE = MIN(PTMIN,PTMINSAVE) |
3231 | + |
3232 | + ENDDO ! LOOP OVER NJET |
3233 | + |
3234 | +C CHECK COMPATIBILITY WITH CUT |
3235 | + IF (PTMINSAVE .LT. PT_LUND) THEN |
3236 | + PASSCUTS = .FALSE. |
3237 | + RETURN |
3238 | + ENDIF |
3239 | + |
3240 | + ENDIF ! IF NJETS.GT. 0 |
3241 | + |
3242 | + ENDIF ! PT_LUND .GT. 0D0 |
3243 | + |
3244 | +C---------------------------------------------------------------------------- |
3245 | +C---------------------------------------------------------------------------- |
3246 | + |
3247 | + |
3248 | + |
3249 | + |
3250 | +c- check existance of jets if jet cuts are on |
3251 | + if(njets.lt.1.and.(htjmin.gt.0.or.ptj1min.gt.0).or. |
3252 | + $ njets.lt.2.and.ptj2min.gt.0.or. |
3253 | + $ njets.lt.3.and.ptj3min.gt.0.or. |
3254 | + $ njets.lt.4.and.ptj4min.gt.0)then |
3255 | + if(debug) write (*,*) i, ' too few jets -> fails' |
3256 | + passcuts=.false. |
3257 | + return |
3258 | + endif |
3259 | + |
3260 | +c - sort jet pts |
3261 | + do i=1,njets-1 |
3262 | + do j=i+1,njets |
3263 | + if(ptjet(j).gt.ptjet(i)) then |
3264 | + temp=ptjet(i) |
3265 | + ptjet(i)=ptjet(j) |
3266 | + ptjet(j)=temp |
3267 | + endif |
3268 | + enddo |
3269 | + enddo |
3270 | + if(debug) write (*,*) 'ordered ',njets,' ',ptjet |
3271 | +c |
3272 | +c Use "and" or "or" prescriptions |
3273 | +c |
3274 | + inclht=0 |
3275 | + |
3276 | + if(njets.gt.0) then |
3277 | + |
3278 | + notgood=.not.jetor |
3279 | + if(debug) write (*,*) 'jetor :',jetor |
3280 | + if(debug) write (*,*) '0',notgood |
3281 | + |
3282 | + do i=1,min(njets,4) |
3283 | + if(debug) write (*,*) i,ptjet(i), ' ',ptjmin4(i), |
3284 | + $ ':',ptjmax4(i) |
3285 | + if(jetor) then |
3286 | +c--- if one of the jets does not pass, the event is rejected |
3287 | + notgood=notgood.or.(ptjmax4(i).ge.0d0 .and. |
3288 | + $ ptjet(i).gt.ptjmax4(i)) .or. |
3289 | + $ (ptjet(i).lt.ptjmin4(i)) |
3290 | + if(debug) write (*,*) i,' notgood total:', notgood |
3291 | + else |
3292 | +c--- all cuts must fail to reject the event |
3293 | + notgood=notgood.and.(ptjmax4(i).ge.0d0 .and. |
3294 | + $ ptjet(i).gt.ptjmax4(i) .or. |
3295 | + $ (ptjet(i).lt.ptjmin4(i))) |
3296 | + if(debug) write (*,*) i,' notgood total:', notgood |
3297 | + endif |
3298 | + enddo |
3299 | + |
3300 | + |
3301 | + if (notgood) then |
3302 | + if(debug) write (*,*) i, ' multiple pt -> fails' |
3303 | + passcuts=.false. |
3304 | + return |
3305 | + endif |
3306 | + |
3307 | +c--------------------------- |
3308 | +c Ht cuts |
3309 | +C--------------------------- |
3310 | + htj=ptjet(1) |
3311 | + |
3312 | + do i=2,njets |
3313 | + htj=htj+ptjet(i) |
3314 | + if(debug) write (*,*) i, 'htj ',htj |
3315 | + if(debug.and.i.le.4) write (*,*) 'htmin ',i,' ', htjmin4(i),':',htjmax4(i) |
3316 | + if(i.le.4)then |
3317 | + if(htj.lt.htjmin4(i) .or. |
3318 | + $ htjmax4(i).ge.0d0.and.htj.gt.htjmax4(i)) then |
3319 | + if(debug) write (*,*) i, ' ht -> fails' |
3320 | + passcuts=.false. |
3321 | + return |
3322 | + endif |
3323 | + endif |
3324 | + enddo |
3325 | + |
3326 | + if(htj.lt.htjmin.or.htjmax.ge.0d0.and.htj.gt.htjmax)then |
3327 | + if(debug) write (*,*) i, ' htj -> fails' |
3328 | + passcuts=.false. |
3329 | + return |
3330 | + endif |
3331 | + |
3332 | + inclht=htj |
3333 | + |
3334 | + endif !if there are jets |
3335 | + |
3336 | + if(nheavyjets.gt.0) then |
3337 | + do i=1,nheavyjets |
3338 | + inclht=inclht+ptheavyjet(i) |
3339 | + enddo |
3340 | + endif !if there are heavyjets |
3341 | + |
3342 | + if(inclht.lt.inclHtmin.or. |
3343 | + $ inclHtmax.ge.0d0.and.inclht.gt.inclHtmax)then |
3344 | + if(debug) write (*,*) ' inclhtmin=',inclHtmin,' -> fails' |
3345 | + passcuts=.false. |
3346 | + return |
3347 | + endif |
3348 | + |
3349 | +C |
3350 | +C maximal and minimal pt of the leptons sorted by pt |
3351 | +c |
3352 | + nleptons=0 |
3353 | + |
3354 | + if(ptl1min.gt.0.or.ptl2min.gt.0.or.ptl3min.gt.0.or.ptl4min.gt.0.or. |
3355 | + $ ptl1max.ge.0d0.or.ptl2max.ge.0d0.or. |
3356 | + $ ptl3max.ge.0d0.or.ptl4max.ge.0d0) then |
3357 | + |
3358 | +c - fill ptlepton with the pt's of the leptons. |
3359 | + do i=nincoming+1,nexternal |
3360 | + if(is_a_l(i)) then |
3361 | + nleptons=nleptons+1 |
3362 | + ptlepton(nleptons)=pt(p(0,i)) |
3363 | + endif |
3364 | + enddo |
3365 | + if(debug) write (*,*) 'not yet ordered ',njets,' ',ptjet |
3366 | + |
3367 | +c - check existance of leptons if lepton cuts are on |
3368 | + if(nleptons.lt.1.and.ptl1min.gt.0.or. |
3369 | + $ nleptons.lt.2.and.ptl2min.gt.0.or. |
3370 | + $ nleptons.lt.3.and.ptl3min.gt.0.or. |
3371 | + $ nleptons.lt.4.and.ptl4min.gt.0)then |
3372 | + if(debug) write (*,*) i, ' too few leptons -> fails' |
3373 | + passcuts=.false. |
3374 | + return |
3375 | + endif |
3376 | + |
3377 | +c - sort lepton pts |
3378 | + do i=1,nleptons-1 |
3379 | + do j=i+1,nleptons |
3380 | + if(ptlepton(j).gt.ptlepton(i)) then |
3381 | + temp=ptlepton(i) |
3382 | + ptlepton(i)=ptlepton(j) |
3383 | + ptlepton(j)=temp |
3384 | + endif |
3385 | + enddo |
3386 | + enddo |
3387 | + if(debug) write (*,*) 'ordered ',nleptons,' ',ptlepton |
3388 | + |
3389 | + if(nleptons.gt.0) then |
3390 | + |
3391 | + notgood = .false. |
3392 | + do i=1,min(nleptons,4) |
3393 | + if(debug) write (*,*) i,ptlepton(i), ' ',ptlmin4(i),':',ptlmax4(i) |
3394 | +c--- if one of the leptons does not pass, the event is rejected |
3395 | + notgood=notgood.or. |
3396 | + $ (ptlmax4(i).ge.0d0.and.ptlepton(i).gt.ptlmax4(i)).or. |
3397 | + $ (ptlepton(i).lt.ptlmin4(i)) |
3398 | + if(debug) write (*,*) i,' notgood total:', notgood |
3399 | + enddo |
3400 | + |
3401 | + |
3402 | + if (notgood) then |
3403 | + if(debug) write (*,*) i, ' multiple pt -> fails' |
3404 | + passcuts=.false. |
3405 | + return |
3406 | + endif |
3407 | + endif |
3408 | + endif |
3409 | +C>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
3410 | +C SPECIAL CUTS |
3411 | +C<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
3412 | + |
3413 | +C REQUIRE AT LEAST ONE JET WITH PT>XPTJ |
3414 | + |
3415 | + IF(xptj.gt.0d0) THEN |
3416 | + xvar=0 |
3417 | + do i=nincoming+1,nexternal |
3418 | + if(is_a_j(i)) xvar=max(xvar,pt(p(0,i))) |
3419 | + enddo |
3420 | + if (xvar .lt. xptj) then |
3421 | + passcuts=.false. |
3422 | + return |
3423 | + endif |
3424 | + ENDIF |
3425 | + |
3426 | +C REQUIRE AT LEAST ONE PHOTON WITH PT>XPTA |
3427 | + |
3428 | + IF(xpta.gt.0d0) THEN |
3429 | + xvar=0 |
3430 | + do i=nincoming+1,nexternal |
3431 | + if(is_a_a(i)) xvar=max(xvar,pt(p(0,i))) |
3432 | + enddo |
3433 | + if (xvar .lt. xpta) then |
3434 | + passcuts=.false. |
3435 | + return |
3436 | + endif |
3437 | + ENDIF |
3438 | + |
3439 | +C REQUIRE AT LEAST ONE B WITH PT>XPTB |
3440 | + |
3441 | + IF(xptb.gt.0d0) THEN |
3442 | + xvar=0 |
3443 | + do i=nincoming+1,nexternal |
3444 | + if(is_a_b(i)) xvar=max(xvar,pt(p(0,i))) |
3445 | + enddo |
3446 | + if (xvar .lt. xptb) then |
3447 | + passcuts=.false. |
3448 | + return |
3449 | + endif |
3450 | + ENDIF |
3451 | + |
3452 | +C REQUIRE AT LEAST ONE LEPTON WITH PT>XPTL |
3453 | + |
3454 | + IF(xptl.gt.0d0) THEN |
3455 | + xvar=0 |
3456 | + do i=nincoming+1,nexternal |
3457 | + if(is_a_l(i)) xvar=max(xvar,pt(p(0,i))) |
3458 | + enddo |
3459 | + if (xvar .lt. xptl) then |
3460 | + passcuts=.false. |
3461 | + if(debug) write (*,*) ' xptl -> fails' |
3462 | + return |
3463 | + endif |
3464 | + ENDIF |
3465 | +C |
3466 | +C WBF CUTS: TWO TYPES |
3467 | +C |
3468 | +C FIRST TYPE: implemented by FM |
3469 | +C |
3470 | +C 1. FIND THE 2 HARDEST JETS |
3471 | +C 2. REQUIRE |RAP(J)|>XETAMIN |
3472 | +C 3. REQUIRE RAP(J1)*ETA(J2)<0 |
3473 | +C |
3474 | +C SECOND TYPE : added by Simon de Visscher 1-08-2007 |
3475 | +C |
3476 | +C 1. FIND THE 2 HARDEST JETS |
3477 | +C 2. REQUIRE |RAP(J1)-RAP(J2)|>DELTAETA |
3478 | +C 3. REQUIRE RAP(J1)*RAP(J2)<0 |
3479 | +C |
3480 | +C |
3481 | + hardj1=0 |
3482 | + hardj2=0 |
3483 | + ptmax1=0d0 |
3484 | + ptmax2=0d0 |
3485 | + |
3486 | +C-- START IF AT LEAST ONE OF THE CUTS IS ACTIVATED |
3487 | + |
3488 | + IF(XETAMIN.GT.0D0.OR.DELTAETA.GT.0D0) THEN |
3489 | + |
3490 | +C-- FIND THE HARDEST JETS |
3491 | + |
3492 | + do i=nincoming+1,nexternal |
3493 | + if(is_a_j(i)) then |
3494 | +c write (*,*) i,pt(p(0,i)) |
3495 | + if(pt(p(0,i)).gt.ptmax1) then |
3496 | + hardj2=hardj1 |
3497 | + ptmax2=ptmax1 |
3498 | + hardj1=i |
3499 | + ptmax1=pt(p(0,i)) |
3500 | + elseif(pt(p(0,i)).gt.ptmax2) then |
3501 | + hardj2=i |
3502 | + ptmax2=pt(p(0,i)) |
3503 | + endif |
3504 | +c write (*,*) hardj1,hardj2,ptmax1,ptmax2 |
3505 | + endif |
3506 | + enddo |
3507 | + |
3508 | + if (hardj2.eq.0) goto 21 ! bypass vbf cut since not enough jets |
3509 | + |
3510 | +C-- NOW APPLY THE CUT I |
3511 | + |
3512 | + if (abs(rap(p(0,hardj1))) .lt. xetamin |
3513 | + & .or.abs(rap(p(0,hardj2))) .lt. xetamin |
3514 | + & .or.rap(p(0,hardj1))*rap(p(0,hardj2)) .gt.0d0) then |
3515 | + passcuts=.false. |
3516 | + return |
3517 | + endif |
3518 | + |
3519 | + |
3520 | +C-- NOW APPLY THE CUT II |
3521 | + |
3522 | + if (abs(rap(p(0,hardj1))-rap(p(0,hardj2))) .lt. deltaeta) then |
3523 | + passcuts=.false. |
3524 | + return |
3525 | + endif |
3526 | + |
3527 | +c write (*,*) hardj1,hardj2,rap(p(0,hardj1)),rap(p(0,hardj2)) |
3528 | + |
3529 | + ENDIF |
3530 | + |
3531 | +c Begin photon isolation |
3532 | +c NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE |
3533 | +c Use is made of parton cm frame momenta. If this must be |
3534 | +c changed, pQCD used below must be redefined |
3535 | +c NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE |
3536 | +c If we do not require a mimimum jet energy, there's no need to apply |
3537 | +c jet clustering and all that. |
3538 | + if (ptgmin.ne.0d0) then |
3539 | + |
3540 | +c Put all (light) QCD partons in momentum array for jet clustering. |
3541 | +c From the run_card.dat, maxjetflavor defines if b quark should be |
3542 | +c considered here (via the logical variable 'is_a_jet'). nQCD becomes |
3543 | +c the number of (light) QCD partons at the real-emission level (i.e. one |
3544 | +c more than the Born). |
3545 | + |
3546 | + nQCD=0 |
3547 | + do j=nincoming+1,nexternal |
3548 | + if (is_a_j(j)) then |
3549 | + nQCD=nQCD+1 |
3550 | + do i=0,3 |
3551 | + pQCD(i,nQCD)=p(i,j) ! Use C.o.M. frame momenta |
3552 | + enddo |
3553 | + endif |
3554 | + enddo |
3555 | + |
3556 | + nph=0 |
3557 | + do j=nincoming+1,nexternal |
3558 | + if (is_a_a(j)) then |
3559 | + nph=nph+1 |
3560 | + do i=0,3 |
3561 | + pgamma(i,nph)=p(i,j) ! Use C.o.M. frame momenta |
3562 | + enddo |
3563 | + endif |
3564 | + enddo |
3565 | + if(nph.eq.0) goto 444 |
3566 | + |
3567 | + if(isoEM)then |
3568 | + nem=nph |
3569 | + do k=1,nem |
3570 | + do i=0,3 |
3571 | + pem(i,k)=pgamma(i,k) |
3572 | + enddo |
3573 | + enddo |
3574 | + do j=nincoming+1,nexternal |
3575 | + if (is_a_l(j)) then |
3576 | + nem=nem+1 |
3577 | + do i=0,3 |
3578 | + pem(i,nem)=p(i,j) ! Use C.o.M. frame momenta |
3579 | + enddo |
3580 | + endif |
3581 | + enddo |
3582 | + endif |
3583 | + |
3584 | + alliso=.true. |
3585 | + |
3586 | + j=0 |
3587 | + dowhile(j.lt.nph.and.alliso) |
3588 | +c Loop over all photons |
3589 | + j=j+1 |
3590 | + |
3591 | + ptg=pt(pgamma(0,j)) |
3592 | + if(ptg.lt.ptgmin)then |
3593 | + passcuts=.false. |
3594 | + return |
3595 | + endif |
3596 | + |
3597 | +c Isolate from hadronic energy |
3598 | + do i=1,nQCD |
3599 | + drlist(i)=sngl(iso_getdrv40(pgamma(0,j),pQCD(0,i))) |
3600 | + enddo |
3601 | + call sortzv(drlist,isorted,nQCD,ismode,isway,izero) |
3602 | + Etsum(0)=0.d0 |
3603 | + nin=0 |
3604 | + do i=1,nQCD |
3605 | + if(dble(drlist(isorted(i))).le.R0gamma)then |
3606 | + nin=nin+1 |
3607 | + Etsum(nin)=Etsum(nin-1)+pt(pQCD(0,isorted(i))) |
3608 | + endif |
3609 | + enddo |
3610 | + do i=1,nin |
3611 | + alliso=alliso .and. |
3612 | + # Etsum(i).le.chi_gamma_iso(dble(drlist(isorted(i))), |
3613 | + # R0gamma,xn,epsgamma,ptg) |
3614 | + enddo |
3615 | + |
3616 | +c Isolate from EM energy |
3617 | + if(isoEM.and.nem.gt.1)then |
3618 | + do i=1,nem |
3619 | + drlist(i)=sngl(iso_getdrv40(pgamma(0,j),pem(0,i))) |
3620 | + enddo |
3621 | + call sortzv(drlist,isorted,nem,ismode,isway,izero) |
3622 | +c First of list must be the photon: check this, and drop it |
3623 | + if(isorted(1).ne.j.or.drlist(isorted(1)).gt.1.e-4)then |
3624 | + write(*,*)'Error #1 in photon isolation' |
3625 | + write(*,*)j,isorted(1),drlist(isorted(1)) |
3626 | + stop |
3627 | + endif |
3628 | + Etsum(0)=0.d0 |
3629 | + nin=0 |
3630 | + do i=2,nem |
3631 | + if(dble(drlist(isorted(i))).le.R0gamma)then |
3632 | + nin=nin+1 |
3633 | + Etsum(nin)=Etsum(nin-1)+pt(pem(0,isorted(i))) |
3634 | + endif |
3635 | + enddo |
3636 | + do i=1,nin |
3637 | + alliso=alliso .and. |
3638 | + # Etsum(i).le.chi_gamma_iso(dble(drlist(isorted(i))), |
3639 | + # R0gamma,xn,epsgamma,ptg) |
3640 | + enddo |
3641 | + |
3642 | + endif |
3643 | + |
3644 | +c End of loop over photons |
3645 | + enddo |
3646 | + |
3647 | + if(.not.alliso)then |
3648 | + passcuts=.false. |
3649 | + return |
3650 | + endif |
3651 | + endif |
3652 | + |
3653 | + 444 continue |
3654 | +c End photon isolation |
3655 | + |
3656 | + |
3657 | +C...Set couplings if event passed cuts |
3658 | + |
3659 | + 21 if(.not.fixed_ren_scale) then |
3660 | + call set_ren_scale(P,scale) |
3661 | + if(scale.gt.0) G = SQRT(4d0*PI*ALPHAS(scale)) |
3662 | + endif |
3663 | + |
3664 | + if(.not.fixed_fac_scale) then |
3665 | + call set_fac_scale(P,q2fact) |
3666 | + endif |
3667 | + |
3668 | +c |
3669 | +c Here we cluster event and reset factorization and renormalization |
3670 | +c scales on an event-by-event basis, as well as check xqcut for jets |
3671 | +c |
3672 | +c Note the following condition is the first line of setclscales |
3673 | +c if(xqcut.gt.0d0.or.ickkw.gt.0.or.scale.eq.0.or.q2fact(1).eq.0)then |
3674 | +c Do not duplicate it since some variable are set for syscalc in the fct |
3675 | + if(.not.setclscales(p))then |
3676 | + cutsdone=.false. |
3677 | + cutspassed=.false. |
3678 | + passcuts = .false. |
3679 | + if(debug) write (*,*) 'setclscales -> fails' |
3680 | + return |
3681 | + endif |
3682 | +c endif |
3683 | + |
3684 | +c Set couplings in model files |
3685 | + if(.not.fixed_ren_scale.or..not.fixed_couplings) then |
3686 | + if (.not.fixed_couplings)then |
3687 | + do i=0,3 |
3688 | + do j=1,nexternal |
3689 | + pp(i,j)=p(i,j) |
3690 | + enddo |
3691 | + enddo |
3692 | + endif |
3693 | + call update_as_param() |
3694 | + endif |
3695 | + |
3696 | + IF (FIRSTTIME2) THEN |
3697 | + FIRSTTIME2=.FALSE. |
3698 | + write(6,*) 'alpha_s for scale ',scale,' is ', G**2/(16d0*atan(1d0)) |
3699 | + ENDIF |
3700 | + |
3701 | + if(debug) write (*,*) '=============================' |
3702 | + if(debug) write (*,*) ' EVENT PASSED THE CUTS ' |
3703 | + if(debug) write (*,*) '=============================' |
3704 | + |
3705 | + CUTSPASSED=.TRUE. |
3706 | + |
3707 | + RETURN |
3708 | + END |
3709 | + |
3710 | + |
3711 | +C |
3712 | +C FUNCTION FOR ISOLATION |
3713 | +C |
3714 | + |
3715 | + function iso_getdrv40(p1,p2) |
3716 | + implicit none |
3717 | + real*8 iso_getdrv40,p1(0:3),p2(0:3) |
3718 | + real*8 iso_getdr |
3719 | +c |
3720 | + iso_getdrv40=iso_getdr(p1(0),p1(1),p1(2),p1(3), |
3721 | + # p2(0),p2(1),p2(2),p2(3)) |
3722 | + return |
3723 | + end |
3724 | + |
3725 | + |
3726 | + function iso_getdr(en1,ptx1,pty1,pl1,en2,ptx2,pty2,pl2) |
3727 | + implicit none |
3728 | + real*8 iso_getdr,en1,ptx1,pty1,pl1,en2,ptx2,pty2,pl2,deta,dphi, |
3729 | + # iso_getpseudorap,iso_getdelphi |
3730 | +c |
3731 | + deta=iso_getpseudorap(en1,ptx1,pty1,pl1)- |
3732 | + # iso_getpseudorap(en2,ptx2,pty2,pl2) |
3733 | + dphi=iso_getdelphi(ptx1,pty1,ptx2,pty2) |
3734 | + iso_getdr=sqrt(dphi**2+deta**2) |
3735 | + return |
3736 | + end |
3737 | + |
3738 | + |
3739 | + function iso_getpseudorap(en,ptx,pty,pl) |
3740 | + implicit none |
3741 | + real*8 iso_getpseudorap,en,ptx,pty,pl,tiny,pt,eta,th |
3742 | + parameter (tiny=1.d-5) |
3743 | +c |
3744 | + pt=sqrt(ptx**2+pty**2) |
3745 | + if(pt.lt.tiny.and.abs(pl).lt.tiny)then |
3746 | + eta=sign(1.d0,pl)*1.d8 |
3747 | + else |
3748 | + th=atan2(pt,pl) |
3749 | + eta=-log(tan(th/2.d0)) |
3750 | + endif |
3751 | + iso_getpseudorap=eta |
3752 | + return |
3753 | + end |
3754 | + |
3755 | + |
3756 | + function iso_getdelphi(ptx1,pty1,ptx2,pty2) |
3757 | + implicit none |
3758 | + real*8 iso_getdelphi,ptx1,pty1,ptx2,pty2,tiny,pt1,pt2,tmp |
3759 | + parameter (tiny=1.d-5) |
3760 | +c |
3761 | + pt1=sqrt(ptx1**2+pty1**2) |
3762 | + pt2=sqrt(ptx2**2+pty2**2) |
3763 | + if(pt1.ne.0.d0.and.pt2.ne.0.d0)then |
3764 | + tmp=ptx1*ptx2+pty1*pty2 |
3765 | + tmp=tmp/(pt1*pt2) |
3766 | + if(abs(tmp).gt.1.d0+tiny)then |
3767 | + write(*,*)'Cosine larger than 1' |
3768 | + stop |
3769 | + elseif(abs(tmp).ge.1.d0)then |
3770 | + tmp=sign(1.d0,tmp) |
3771 | + endif |
3772 | + tmp=acos(tmp) |
3773 | + else |
3774 | + tmp=1.d8 |
3775 | + endif |
3776 | + iso_getdelphi=tmp |
3777 | + return |
3778 | + end |
3779 | + |
3780 | + function chi_gamma_iso(dr,R0,xn,epsgamma,pTgamma) |
3781 | +c Eq.(3.4) of Phys.Lett. B429 (1998) 369-374 [hep-ph/9801442] |
3782 | + implicit none |
3783 | + real*8 chi_gamma_iso,dr,R0,xn,epsgamma,pTgamma |
3784 | + real*8 tmp,axn |
3785 | +c |
3786 | + axn=abs(xn) |
3787 | + tmp=epsgamma*pTgamma |
3788 | + if(axn.ne.0.d0)then |
3789 | + tmp=tmp*( (1-cos(dr))/(1-cos(R0)) )**axn |
3790 | + endif |
3791 | + chi_gamma_iso=tmp |
3792 | + return |
3793 | + end |
3794 | + |
3795 | + |
3796 | +* |
3797 | +* $Id: sortzv.F,v 1.1.1.1 1996/02/15 17:49:50 mclareni Exp $ |
3798 | +* |
3799 | +* $Log: sortzv.F,v $ |
3800 | +* Revision 1.1.1.1 1996/02/15 17:49:50 mclareni |
3801 | +* Kernlib |
3802 | +* |
3803 | +* |
3804 | +c$$$#include "kerngen/pilot.h" |
3805 | + SUBROUTINE SORTZV (A,INDEX,N1,MODE,NWAY,NSORT) |
3806 | +C |
3807 | +C CERN PROGLIB# M101 SORTZV .VERSION KERNFOR 3.15 820113 |
3808 | +C ORIG. 02/10/75 |
3809 | +C |
3810 | + DIMENSION A(N1),INDEX(N1) |
3811 | +C |
3812 | +C |
3813 | + N = N1 |
3814 | + IF (N.LE.0) RETURN |
3815 | + IF (NSORT.NE.0) GO TO 2 |
3816 | + DO 1 I=1,N |
3817 | + 1 INDEX(I)=I |
3818 | +C |
3819 | + 2 IF (N.EQ.1) RETURN |
3820 | + IF (MODE) 10,20,30 |
3821 | + 10 CALL SORTTI (A,INDEX,N) |
3822 | + GO TO 40 |
3823 | +C |
3824 | + 20 CALL SORTTC(A,INDEX,N) |
3825 | + GO TO 40 |
3826 | +C |
3827 | + 30 CALL SORTTF (A,INDEX,N) |
3828 | +C |
3829 | + 40 IF (NWAY.EQ.0) GO TO 50 |
3830 | + N2 = N/2 |
3831 | + DO 41 I=1,N2 |
3832 | + ISWAP = INDEX(I) |
3833 | + K = N+1-I |
3834 | + INDEX(I) = INDEX(K) |
3835 | + 41 INDEX(K) = ISWAP |
3836 | + 50 RETURN |
3837 | + END |
3838 | +* ======================================== |
3839 | + SUBROUTINE SORTTF (A,INDEX,N1) |
3840 | +C |
3841 | + DIMENSION A(N1),INDEX(N1) |
3842 | +C |
3843 | + N = N1 |
3844 | + DO 3 I1=2,N |
3845 | + I3 = I1 |
3846 | + I33 = INDEX(I3) |
3847 | + AI = A(I33) |
3848 | + 1 I2 = I3/2 |
3849 | + IF (I2) 3,3,2 |
3850 | + 2 I22 = INDEX(I2) |
3851 | + IF (AI.LE.A (I22)) GO TO 3 |
3852 | + INDEX (I3) = I22 |
3853 | + I3 = I2 |
3854 | + GO TO 1 |
3855 | + 3 INDEX (I3) = I33 |
3856 | + 4 I3 = INDEX (N) |
3857 | + INDEX (N) = INDEX (1) |
3858 | + AI = A(I3) |
3859 | + N = N-1 |
3860 | + IF (N-1) 12,12,5 |
3861 | + 5 I1 = 1 |
3862 | + 6 I2 = I1 + I1 |
3863 | + IF (I2.LE.N) I22= INDEX(I2) |
3864 | + IF (I2-N) 7,9,11 |
3865 | + 7 I222 = INDEX (I2+1) |
3866 | + IF (A(I22)-A(I222)) 8,9,9 |
3867 | + 8 I2 = I2+1 |
3868 | + I22 = I222 |
3869 | + 9 IF (AI-A(I22)) 10,11,11 |
3870 | + 10 INDEX(I1) = I22 |
3871 | + I1 = I2 |
3872 | + GO TO 6 |
3873 | + 11 INDEX (I1) = I3 |
3874 | + GO TO 4 |
3875 | + 12 INDEX (1) = I3 |
3876 | + RETURN |
3877 | + END |
3878 | +* ======================================== |
3879 | + SUBROUTINE SORTTI (A,INDEX,N1) |
3880 | +C |
3881 | + INTEGER A,AI |
3882 | + DIMENSION A(N1),INDEX(N1) |
3883 | +C |
3884 | + N = N1 |
3885 | + DO 3 I1=2,N |
3886 | + I3 = I1 |
3887 | + I33 = INDEX(I3) |
3888 | + AI = A(I33) |
3889 | + 1 I2 = I3/2 |
3890 | + IF (I2) 3,3,2 |
3891 | + 2 I22 = INDEX(I2) |
3892 | + IF (AI.LE.A (I22)) GO TO 3 |
3893 | + INDEX (I3) = I22 |
3894 | + I3 = I2 |
3895 | + GO TO 1 |
3896 | + 3 INDEX (I3) = I33 |
3897 | + 4 I3 = INDEX (N) |
3898 | + INDEX (N) = INDEX (1) |
3899 | + AI = A(I3) |
3900 | + N = N-1 |
3901 | + IF (N-1) 12,12,5 |
3902 | + 5 I1 = 1 |
3903 | + 6 I2 = I1 + I1 |
3904 | + IF (I2.LE.N) I22= INDEX(I2) |
3905 | + IF (I2-N) 7,9,11 |
3906 | + 7 I222 = INDEX (I2+1) |
3907 | + IF (A(I22)-A(I222)) 8,9,9 |
3908 | + 8 I2 = I2+1 |
3909 | + I22 = I222 |
3910 | + 9 IF (AI-A(I22)) 10,11,11 |
3911 | + 10 INDEX(I1) = I22 |
3912 | + I1 = I2 |
3913 | + GO TO 6 |
3914 | + 11 INDEX (I1) = I3 |
3915 | + GO TO 4 |
3916 | + 12 INDEX (1) = I3 |
3917 | + RETURN |
3918 | + END |
3919 | +* ======================================== |
3920 | + SUBROUTINE SORTTC (A,INDEX,N1) |
3921 | +C |
3922 | + INTEGER A,AI |
3923 | + DIMENSION A(N1),INDEX(N1) |
3924 | +C |
3925 | + N = N1 |
3926 | + DO 3 I1=2,N |
3927 | + I3 = I1 |
3928 | + I33 = INDEX(I3) |
3929 | + AI = A(I33) |
3930 | + 1 I2 = I3/2 |
3931 | + IF (I2) 3,3,2 |
3932 | + 2 I22 = INDEX(I2) |
3933 | + IF(ICMPCH(AI,A(I22)))3,3,21 |
3934 | + 21 INDEX (I3) = I22 |
3935 | + I3 = I2 |
3936 | + GO TO 1 |
3937 | + 3 INDEX (I3) = I33 |
3938 | + 4 I3 = INDEX (N) |
3939 | + INDEX (N) = INDEX (1) |
3940 | + AI = A(I3) |
3941 | + N = N-1 |
3942 | + IF (N-1) 12,12,5 |
3943 | + 5 I1 = 1 |
3944 | + 6 I2 = I1 + I1 |
3945 | + IF (I2.LE.N) I22= INDEX(I2) |
3946 | + IF (I2-N) 7,9,11 |
3947 | + 7 I222 = INDEX (I2+1) |
3948 | + IF (ICMPCH(A(I22),A(I222))) 8,9,9 |
3949 | + 8 I2 = I2+1 |
3950 | + I22 = I222 |
3951 | + 9 IF (ICMPCH(AI,A(I22))) 10,11,11 |
3952 | + 10 INDEX(I1) = I22 |
3953 | + I1 = I2 |
3954 | + GO TO 6 |
3955 | + 11 INDEX (I1) = I3 |
3956 | + GO TO 4 |
3957 | + 12 INDEX (1) = I3 |
3958 | + RETURN |
3959 | + END |
3960 | +* ======================================== |
3961 | + FUNCTION ICMPCH(IC1,IC2) |
3962 | +C FUNCTION TO COMPARE TWO 4 CHARACTER EBCDIC STRINGS - IC1,IC2 |
3963 | +C ICMPCH=-1 IF HEX VALUE OF IC1 IS LESS THAN IC2 |
3964 | +C ICMPCH=0 IF HEX VALUES OF IC1 AND IC2 ARE THE SAME |
3965 | +C ICMPCH=+1 IF HEX VALUES OF IC1 IS GREATER THAN IC2 |
3966 | + I1=IC1 |
3967 | + I2=IC2 |
3968 | + IF(I1.GE.0.AND.I2.GE.0)GOTO 40 |
3969 | + IF(I1.GE.0)GOTO 60 |
3970 | + IF(I2.GE.0)GOTO 80 |
3971 | + I1=-I1 |
3972 | + I2=-I2 |
3973 | + IF(I1-I2)80,70,60 |
3974 | + 40 IF(I1-I2)60,70,80 |
3975 | + 60 ICMPCH=-1 |
3976 | + RETURN |
3977 | + 70 ICMPCH=0 |
3978 | + RETURN |
3979 | + 80 ICMPCH=1 |
3980 | + RETURN |
3981 | + END |
3982 | + |
3983 | +c************************************************************************ |
3984 | +c Returns pTLund (i.e. the Pythia8 evolution variable) between two |
3985 | +c particles with momenta prad and pemt with momentum prec as spectator |
3986 | +c************************************************************************ |
3987 | + |
3988 | + DOUBLE PRECISION FUNCTION RHOPYTHIA(PRAD, PEMT, PREC, FLAVRAD, |
3989 | + & FLAVEMT, RADTYPE, RECTYPE) |
3990 | + |
3991 | + IMPLICIT NONE |
3992 | +c |
3993 | +c Arguments |
3994 | +c |
3995 | + DOUBLE PRECISION PRAD(0:3),PEMT(0:3), PREC(0:3) |
3996 | + INTEGER FLAVRAD, FLAVEMT, RADTYPE,RECTYPE |
3997 | +c |
3998 | +c Local |
3999 | +c |
4000 | + DOUBLE PRECISION Q(0:3),SUM(0:3), qBR(0:3), qAR(0:3) |
4001 | + DOUBLE PRECISION Q2, m2Rad, m2Emt, m2Dip, qBR2, qAR2, x1, x2, z |
4002 | + DOUBLE PRECISION m2RadAft, m2EmtAft, m2Rec, m2RadBef, m2ar, rescale |
4003 | + DOUBLE PRECISION TEMP, lambda13, k1, k3, m2Final |
4004 | + DOUBLE PRECISION m0u, m0d, m0c, m0s, m0t, m0b, m0w, m0z, m0x |
4005 | + DOUBLE PRECISION PRECAFT(0:3) |
4006 | + INTEGER emtsign |
4007 | + INTEGER idRadBef |
4008 | + LOGICAL allowed |
4009 | + |
4010 | +c----- |
4011 | +c Begin Code |
4012 | +c----- |
4013 | + |
4014 | +C Set masses. Currently no way of getting those? |
4015 | + m0u = 0.0 |
4016 | + m0d = 0.0 |
4017 | + m0c = 1.5 |
4018 | + m0s = 0.0 |
4019 | + m0t = 172.5 |
4020 | + m0w = 80.4 |
4021 | + m0z = 91.188 |
4022 | + m0x = 400.0 |
4023 | + |
4024 | +C Store recoiler momentum (since FI splittings require recoiler |
4025 | +C rescaling) |
4026 | + PRECAFT(0) = PREC(0) |
4027 | + PRECAFT(1) = PREC(1) |
4028 | + PRECAFT(2) = PREC(2) |
4029 | + PRECAFT(3) = PREC(3) |
4030 | +C Get sign of emitted momentum |
4031 | + emtsign = 1 |
4032 | + if(radtype .eq. -1) emtsign = -1 |
4033 | + |
4034 | +C Get virtuality |
4035 | + Q(0) = pRad(0) + emtsign*pEmt(0) |
4036 | + Q(1) = pRad(1) + emtsign*pEmt(1) |
4037 | + Q(2) = pRad(2) + emtsign*pEmt(2) |
4038 | + Q(3) = pRad(3) + emtsign*pEmt(3) |
4039 | + Q2 = emtsign * ( Q(0)**2 - Q(1)**2 - Q(2)**2 - Q(3)**2 ); |
4040 | + |
4041 | +C Reset allowed |
4042 | + allowed = .true. |
4043 | + |
4044 | +C Splitting not possible for negative virtuality. |
4045 | + if ( Q2 .lt. 0.0 ) allowed = .false. |
4046 | + |
4047 | +C Try to reconstruct flavour of radiator before emission. |
4048 | + idRadBef = 0 |
4049 | +C gluon radiation: idBef = idAft |
4050 | + if (abs(flavEmt) .eq. 21 .or. abs(flavEmt) .eq. 22 ) idRadBef=flavRad |
4051 | +C final state gluon splitting: idBef = 21 |
4052 | + if (radtype .eq. 1 .and. flavEmt .eq. -flavRad) idRadBef=21 |
4053 | +C final state quark -> gluon conversion |
4054 | + if (radtype .eq. 1 .and. abs(flavEmt) .lt. 10 .and. flavRad .eq. 21) idRadBef=flavEmt |
4055 | +C initial state gluon splitting: idBef = -idEmt |
4056 | + if (radtype .eq. -1 .and. abs(flavEmt) .lt. 10 .and. flavRad .eq. 21) idRadBef=-flavEmt |
4057 | +C initial state gluon -> quark conversion |
4058 | + if (radtype .eq. -1 .and. abs(flavEmt) .lt. 10 .and. flavRad .eq. flavEmt) idRadBef=21 |
4059 | +C W-boson radiation |
4060 | + if (flavEmt .eq. 24) idRadBef = flavRad+1 |
4061 | + if (flavEmt .eq. -24) idRadBef = flavRad-1 |
4062 | + |
4063 | +C Set particle masses. |
4064 | + m2RadAft = 0.0 |
4065 | + m2EmtAft = 0.0 |
4066 | + m2Rec = 0.0 |
4067 | + m2RadBef = 0.0 |
4068 | + |
4069 | + m2RadAft = pRad(0)*pRad(0)-pRad(1)*pRad(1)-pRad(2)*pRad(2)-pRad(3)*pRad(3) |
4070 | + m2EmtAft = pEmt(0)*pEmt(0)-pEmt(1)*pEmt(1)-pEmt(2)*pEmt(2)-pEmt(3)*pEmt(3) |
4071 | + m2Rec = pRec(0)*pRec(0)-pRec(1)*pRec(1)-pRec(2)*pRec(2)-pRec(3)*pRec(3) |
4072 | + |
4073 | + if (m2RadAft .lt. 1d-4) m2RadAft = 0.0 |
4074 | + if (m2EmtAft .lt. 1d-4) m2EmtAft = 0.0 |
4075 | + if (m2Rec .lt. 1d-4) m2Rec = 0.0 |
4076 | + |
4077 | + if (abs(flavRad) .ne. 21 .and. abs(flavRad) .ne. 22 .and. |
4078 | + & abs(flavEmt) .ne. 24 .and. |
4079 | + & abs(flavRad) .ne. abs(flavEmt)) then |
4080 | + m2RadBef = m2RadAft |
4081 | + else if (abs(flavEmt) .eq. 24) then |
4082 | + if (idRadBef .ne. 0) then |
4083 | + if( abs(idRadBef) .eq. 4 ) m2RadBef = m0c**2 |
4084 | + if( abs(idRadBef) .eq. 5 ) m2RadBef = m0b**2 |
4085 | + if( abs(idRadBef) .eq. 6 ) m2RadBef = m0t**2 |
4086 | + if( abs(idRadBef) .eq. 9000001 ) m2RadBef = m0x**2 |
4087 | + endif |
4088 | + else if (radtype .eq. -1) then |
4089 | + if (abs(flavRad) .eq. 21 .and. abs(flavEmt) .eq. 21) m2RadBef = m2EmtAft |
4090 | + endif |
4091 | + |
4092 | +C Calculate dipole mass for final-state radiation. |
4093 | + m2Final = 0.0 |
4094 | + m2Final = m2Final + (pRad(0) + pRec(0) + pEmt(0))**2 |
4095 | + m2Final = m2Final - (pRad(1) + pRec(1) + pEmt(1))**2 |
4096 | + m2Final = m2Final - (pRad(2) + pRec(2) + pEmt(2))**2 |
4097 | + m2Final = m2Final - (pRad(3) + pRec(3) + pEmt(3))**2 |
4098 | + |
4099 | +C Final state splitting not possible for negative dipole mass. |
4100 | + if ( radtype .eq. 1 .and. m2Final .lt. 0.0 ) allowed = .false. |
4101 | + |
4102 | +C Rescale recoiler for final-intial splittings. |
4103 | + rescale = 1.0 |
4104 | + if (radtype .eq. 1 .and. rectype .eq. -1) then |
4105 | + m2ar = m2Final - 2.0*Q2 + 2.0*m2RadBef |
4106 | + rescale = (1.0 - (Q2 - m2RadBef) / (m2ar-m2RadBef)) |
4107 | + & /(1.0 + (Q2 - m2RadBef) / (m2ar-m2RadBef)) |
4108 | + pRecAft(0) = pRecAft(0)*rescale |
4109 | + pRecAft(1) = pRecAft(1)*rescale |
4110 | + pRecAft(2) = pRecAft(2)*rescale |
4111 | + pRecAft(3) = pRecAft(3)*rescale |
4112 | + endif |
4113 | + |
4114 | +C Final-initial splitting not possible for negative rescaling. |
4115 | + if ( rescale .lt. 0.0 ) allowed = .false. |
4116 | + |
4117 | +C Construct dipole momentum for FSR. |
4118 | + sum(0) = pRad(0) + pRecAft(0) + pEmt(0) |
4119 | + sum(1) = pRad(1) + pRecAft(1) + pEmt(1) |
4120 | + sum(2) = pRad(2) + pRecAft(2) + pEmt(2) |
4121 | + sum(3) = pRad(3) + pRecAft(3) + pEmt(3) |
4122 | + m2Dip = sum(0)**2 - sum(1)**2 - sum(2)**2 - sum(3)**2 |
4123 | + |
4124 | +C Construct 2->3 variables for FSR |
4125 | + x1 = 2. * ( sum(0)*pRad(0) - sum(1)*pRad(1) |
4126 | + & - sum(2)*pRad(2) - sum(3)*pRad(3) ) / m2Dip |
4127 | + x2 = 2. * ( sum(0)*pRecAft(0) - sum(1)*pRecAft(1) |
4128 | + & - sum(2)*pRecAft(2) - sum(3)*pRecAft(3) ) / m2Dip |
4129 | + |
4130 | +C Final state splitting not possible for ill-defined |
4131 | +C 3-body-variables. |
4132 | + if ( radtype .eq. 1 .and. x1 .lt. 0.0 ) allowed = .false. |
4133 | + if ( radtype .eq. 1 .and. x1 .gt. 1.0 ) allowed = .false. |
4134 | + if ( radtype .eq. 1 .and. x2 .lt. 0.0 ) allowed = .false. |
4135 | + if ( radtype .eq. 1 .and. x2 .gt. 1.0 ) allowed = .false. |
4136 | + |
4137 | +C Auxiliary variables for massive FSR |
4138 | + lambda13 = DSQRT( (Q2 - m2RadAft - m2EmtAft )**2 - 4.0 * m2RadAft*m2EmtAft) |
4139 | + k1 = ( Q2 - lambda13 + (m2EmtAft - m2RadAft ) ) / ( 2.0 * Q2) |
4140 | + k3 = ( Q2 - lambda13 - (m2EmtAft - m2RadAft ) ) / ( 2.0 * Q2) |
4141 | + |
4142 | +C Construct momenta of dipole before/after splitting for ISR |
4143 | + qBR(0) = pRad(0) + pRec(0) - pEmt(0) |
4144 | + qBR(1) = pRad(1) + pRec(1) - pEmt(1) |
4145 | + qBR(2) = pRad(2) + pRec(2) - pEmt(2) |
4146 | + qBR(3) = pRad(3) + pRec(3) - pEmt(3) |
4147 | + qBR2 = qBR(0)**2 - qBR(1)**2 - qBR(2)**2 - qBR(3)**2 |
4148 | + |
4149 | + qAR(0) = pRad(0) + pRec(0) |
4150 | + qAR(1) = pRad(1) + pRec(1) |
4151 | + qAR(2) = pRad(2) + pRec(2) |
4152 | + qAR(3) = pRad(3) + pRec(3) |
4153 | + qAR2 = qAR(0)**2 - qAR(1)**2 - qAR(2)**2 - qAR(3)**2 |
4154 | + |
4155 | +C Calculate z of splitting, different for FSR and ISR |
4156 | + z = 1.0 / (1.0 - k1 -k3) * ( x1 / (2.0-x2) - k3) |
4157 | + if(radtype .eq. -1 ) z = qBR2 / qAR2; |
4158 | + |
4159 | +C Splitting not possible for ill-defined energy sharing. |
4160 | + if ( z .lt. 0.0 .or. z .gt. 1.0 ) allowed = .false. |
4161 | + |
4162 | +C pT^2 = separation * virtuality (corrected with mass for FSR) |
4163 | + if (radtype .eq. 1) temp = z*(1-z)*(Q2 - m2RadBef) |
4164 | + if (radtype .eq. -1) temp = (1-z)*Q2 |
4165 | + |
4166 | +C Check threshold in ISR |
4167 | + if (radtype .ne. 1) then |
4168 | + if ((abs(flavRad) .eq. 4 .or. abs(flavEmt) .eq. 4) |
4169 | + & .and. dsqrt(temp) .le. 2.0*m0c**2 ) temp = (1.-z)*(Q2+m0c**2) |
4170 | + if ((abs(flavRad) .eq. 5 .or. abs(flavEmt) .eq. 5) |
4171 | + & .and. dsqrt(temp) .le. 2.0*m0b**2 ) temp = (1.-z)*(Q2+m0b**2) |
4172 | + endif |
4173 | + |
4174 | +C Kinematically impossible splittings should not be included in the |
4175 | +C pT definition! |
4176 | + if( .not. allowed) temp = 1d15 |
4177 | + |
4178 | + if(temp .lt. 0.0) temp = 0.0 |
4179 | + |
4180 | +C Return pT |
4181 | + rhoPythia = dsqrt(temp); |
4182 | + |
4183 | + RETURN |
4184 | + END |
4185 | |
4186 | === modified file 'Template/LO/SubProcesses/makefile' |
4187 | --- Template/LO/SubProcesses/makefile 2016-05-26 23:36:59 +0000 |
4188 | +++ Template/LO/SubProcesses/makefile 2016-09-01 23:40:50 +0000 |
4189 | @@ -1,6 +1,13 @@ |
4190 | include ../../Source/make_opts |
4191 | FFLAGS+= -w |
4192 | |
4193 | +# Load additional dependencies of the bias module, if present |
4194 | +ifeq (,$(wildcard ../bias_dependencies)) |
4195 | +BIASDEPENDENCIES = |
4196 | +else |
4197 | +include ../bias_dependencies |
4198 | +endif |
4199 | + |
4200 | # Definitions |
4201 | |
4202 | LIBDIR = ../../lib/ |
4203 | @@ -17,9 +24,9 @@ |
4204 | MADLOOP_LIB = |
4205 | endif |
4206 | |
4207 | -LINKLIBS = $(LINK_MADLOOP_LIB) $(LINK_LOOP_LIBS) -L../../lib/ -ldhelas -ldsample -lmodel -lgeneric -lpdf -lcernlib $(llhapdf) |
4208 | +LINKLIBS = $(LINK_MADLOOP_LIB) $(LINK_LOOP_LIBS) -L../../lib/ -ldhelas -ldsample -lmodel -lgeneric -lpdf -lcernlib $(llhapdf) -lbias |
4209 | |
4210 | -LIBS = $(LIBDIR)libdhelas.$(libext) $(LIBDIR)libdsample.$(libext) $(LIBDIR)libgeneric.$(libext) $(LIBDIR)libpdf.$(libext) $(LIBDIR)libmodel.$(libext) $(LIBDIR)libcernlib.$(libext) $(MADLOOP_LIB) $(LOOP_LIBS) |
4211 | +LIBS = $(LIBDIR)libbias.$(libext) $(LIBDIR)libdhelas.$(libext) $(LIBDIR)libdsample.$(libext) $(LIBDIR)libgeneric.$(libext) $(LIBDIR)libpdf.$(libext) $(LIBDIR)libmodel.$(libext) $(LIBDIR)libcernlib.$(libext) $(MADLOOP_LIB) $(LOOP_LIBS) |
4212 | |
4213 | # Source files |
4214 | |
4215 | @@ -34,7 +41,7 @@ |
4216 | # Binaries |
4217 | |
4218 | $(PROG): $(PROCESS) auto_dsig.o $(LIBS) |
4219 | - $(FC) -o $(PROG) $(PROCESS) $(LINKLIBS) $(LDFLAGS) |
4220 | + $(FC) -o $(PROG) $(PROCESS) $(LINKLIBS) $(LDFLAGS) $(BIASDEPENDENCIES) |
4221 | |
4222 | gensym: $(SYMMETRY) configs.inc $(LIBDIR)libmodel.$(libext) $(LIBDIR)libgeneric.$(libext) |
4223 | $(FC) -o gensym $(SYMMETRY) -L../../lib/ -lmodel -lgeneric $(LDFLAGS) |
4224 | |
4225 | === modified file 'Template/LO/SubProcesses/reweight.f' |
4226 | --- Template/LO/SubProcesses/reweight.f 2016-08-09 13:20:59 +0000 |
4227 | +++ Template/LO/SubProcesses/reweight.f 2016-09-01 23:40:50 +0000 |
4228 | @@ -1087,7 +1087,53 @@ |
4229 | endif |
4230 | return |
4231 | end |
4232 | + |
4233 | + double precision function custom_bias(p, original_weight, numproc) |
4234 | +c*********************************************************** |
4235 | +c Returns a bias weight as instructed by the bias module |
4236 | +c*********************************************************** |
4237 | + implicit none |
4238 | + |
4239 | + include 'nexternal.inc' |
4240 | + include 'maxparticles.inc' |
4241 | + include 'run_config.inc' |
4242 | + include 'lhe_event_infos.inc' |
4243 | + include 'run.inc' |
4244 | + |
4245 | + DOUBLE PRECISION P(0:3,NEXTERNAL) |
4246 | + integer numproc |
4247 | + |
4248 | + double precision original_weight |
4249 | + |
4250 | + double precision bias_weight |
4251 | + logical is_bias_dummy, requires_full_event_info |
4252 | + common/bias/bias_weight,is_bias_dummy,requires_full_event_info |
4253 | + |
4254 | |
4255 | +C If the bias module necessitates the full event information |
4256 | +C then we must call write_leshouches here already so as to set it. |
4257 | +C The weight specified at this stage is irrelevant since we |
4258 | +C use do_write_events set to .False. |
4259 | + AlreadySetInBiasModule = .False. |
4260 | + if (requires_full_event_info) then |
4261 | + call write_leshouche(p,-1.0d0,numproc,.False.) |
4262 | +C Write the event in the string evt_record, part of the |
4263 | +C lhe_event_info common block |
4264 | + event_record(:) = '' |
4265 | + call write_event_to_stream(event_record,pb(0,1),1.0d0,npart, |
4266 | + & jpart(1,1),ngroup,sscale,aaqcd,aaqed,buff,use_syst, |
4267 | + & s_buff, nclus, buffclus) |
4268 | + AlreadySetInBiasModule = .True. |
4269 | + else |
4270 | + AlreadySetInBiasModule = .False. |
4271 | + endif |
4272 | +C Apply the bias weight. The default run_card entry 'None' for the |
4273 | +c 'bias_weight' option will implement a constant bias_weight of 1.0 below. |
4274 | + call bias_wgt(p, original_weight, bias_weight) |
4275 | + custom_bias = bias_weight |
4276 | + |
4277 | + end |
4278 | + |
4279 | double precision function rewgt(p) |
4280 | c************************************************** |
4281 | c reweight the hard me according to ckkw |
4282 | |
4283 | === modified file 'Template/LO/SubProcesses/setcuts.f' |
4284 | --- Template/LO/SubProcesses/setcuts.f 2016-06-16 15:03:59 +0000 |
4285 | +++ Template/LO/SubProcesses/setcuts.f 2016-09-01 23:40:50 +0000 |
4286 | @@ -81,6 +81,11 @@ |
4287 | logical do_cuts(nexternal) |
4288 | COMMON /TO_SPECISA/IS_A_J,IS_A_A,IS_A_L,IS_A_B,IS_A_NU,IS_HEAVY, |
4289 | . IS_A_ONIUM, do_cuts |
4290 | + |
4291 | +c Store which external particles undergo the ktdurham and ptlund cuts. |
4292 | + LOGICAL is_pdg_for_merging_cut(NEXTERNAL) |
4293 | + COMMON /TO_MERGE_CUTS/is_pdg_for_merging_cut, from_decay |
4294 | + |
4295 | c |
4296 | c |
4297 | c reading parameters |
4298 | @@ -228,55 +233,17 @@ |
4299 | if (abs(idup(i,1,iproc)).eq.16) is_a_nu(i)=.true. ! no cuts on vt vt~ |
4300 | if (pmass(i).gt.10d0) is_heavy(i)=.true. ! heavy fs particle |
4301 | c-onium |
4302 | -c if (idup(i,1,iproc).eq.441) is_a_onium(i)=.true. ! charmonium |
4303 | -c if (idup(i,1,iproc).eq.10441) is_a_onium(i)=.true. ! charmonium |
4304 | -c if (idup(i,1,iproc).eq.100441) is_a_onium(i)=.true. ! charmonium |
4305 | -c if (idup(i,1,iproc).eq.443) is_a_onium(i)=.true. ! charmonium |
4306 | -c if (idup(i,1,iproc).eq.10443) is_a_onium(i)=.true. ! charmonium |
4307 | -c if (idup(i,1,iproc).eq.20443) is_a_onium(i)=.true. ! charmonium |
4308 | -c if (idup(i,1,iproc).eq.100443) is_a_onium(i)=.true. ! charmonium |
4309 | -c if (idup(i,1,iproc).eq.30443) is_a_onium(i)=.true. ! charmonium |
4310 | -c if (idup(i,1,iproc).eq.9000443) is_a_onium(i)=.true. ! charmonium |
4311 | -c if (idup(i,1,iproc).eq.9010443) is_a_onium(i)=.true. ! charmonium |
4312 | -c if (idup(i,1,iproc).eq.9020443) is_a_onium(i)=.true. ! charmonium |
4313 | -c if (idup(i,1,iproc).eq.445) is_a_onium(i)=.true. ! charmonium |
4314 | -c if (idup(i,1,iproc).eq.9000445) is_a_onium(i)=.true. ! charmonium |
4315 | - |
4316 | -c if (idup(i,1,iproc).eq.551) is_a_onium(i)=.true. ! bottomonium |
4317 | -c if (idup(i,1,iproc).eq.10551) is_a_onium(i)=.true. ! bottomonium |
4318 | -c if (idup(i,1,iproc).eq.100551) is_a_onium(i)=.true. ! bottomonium |
4319 | -c if (idup(i,1,iproc).eq.110551) is_a_onium(i)=.true. ! bottomonium |
4320 | -c if (idup(i,1,iproc).eq.200551) is_a_onium(i)=.true. ! bottomonium |
4321 | -c if (idup(i,1,iproc).eq.210551) is_a_onium(i)=.true. ! bottomonium |
4322 | -c if (idup(i,1,iproc).eq.553) is_a_onium(i)=.true. ! bottomonium |
4323 | -c if (idup(i,1,iproc).eq.10553) is_a_onium(i)=.true. ! bottomonium |
4324 | -c if (idup(i,1,iproc).eq.20553) is_a_onium(i)=.true. ! bottomonium |
4325 | -c if (idup(i,1,iproc).eq.30553) is_a_onium(i)=.true. ! bottomonium |
4326 | -c if (idup(i,1,iproc).eq.100553) is_a_onium(i)=.true. ! bottomonium |
4327 | -c if (idup(i,1,iproc).eq.110553) is_a_onium(i)=.true. ! bottomonium |
4328 | -c if (idup(i,1,iproc).eq.120553) is_a_onium(i)=.true. ! bottomonium |
4329 | -c if (idup(i,1,iproc).eq.130553) is_a_onium(i)=.true. ! bottomonium |
4330 | -c if (idup(i,1,iproc).eq.200553) is_a_onium(i)=.true. ! bottomonium |
4331 | -c if (idup(i,1,iproc).eq.210553) is_a_onium(i)=.true. ! bottomonium |
4332 | -c if (idup(i,1,iproc).eq.220553) is_a_onium(i)=.true. ! bottomonium |
4333 | -c if (idup(i,1,iproc).eq.300553) is_a_onium(i)=.true. ! bottomonium |
4334 | -c if (idup(i,1,iproc).eq.9000553) is_a_onium(i)=.true. ! bottomonium |
4335 | -c if (idup(i,1,iproc).eq.9010553) is_a_onium(i)=.true. ! bottomonium |
4336 | -c if (idup(i,1,iproc).eq.555) is_a_onium(i)=.true. ! bottomonium |
4337 | -c if (idup(i,1,iproc).eq.10555) is_a_onium(i)=.true. ! bottomonium |
4338 | -c if (idup(i,1,iproc).eq.20555) is_a_onium(i)=.true. ! bottomonium |
4339 | -c if (idup(i,1,iproc).eq.100555) is_a_onium(i)=.true. ! bottomonium |
4340 | -c if (idup(i,1,iproc).eq.110555) is_a_onium(i)=.true. ! bottomonium |
4341 | -c if (idup(i,1,iproc).eq.200555) is_a_onium(i)=.true. ! bottomonium |
4342 | -c if (idup(i,1,iproc).eq.557) is_a_onium(i)=.true. ! bottomonium |
4343 | -c if (idup(i,1,iproc).eq.100557) is_a_onium(i)=.true. ! bottomonium |
4344 | - |
4345 | -c if (idup(i,1,iproc).eq.541) is_a_onium(i)=.true. ! Bc |
4346 | -c if (idup(i,1,iproc).eq.10541) is_a_onium(i)=.true. ! Bc |
4347 | -c if (idup(i,1,iproc).eq.543) is_a_onium(i)=.true. ! Bc |
4348 | -c if (idup(i,1,iproc).eq.10543) is_a_onium(i)=.true. ! Bc |
4349 | -c if (idup(i,1,iproc).eq.20543) is_a_onium(i)=.true. ! Bc |
4350 | -c if (idup(i,1,iproc).eq.545) is_a_onium(i)=.true. ! Bc |
4351 | + |
4352 | +c Remember mergeable particles |
4353 | + do j=1,pdgs_for_merging_cut(0) |
4354 | + if ( pdgs_for_merging_cut(j) .ne. 0 |
4355 | + $ .and. abs(idup(i,1,iproc)) .eq.pdgs_for_merging_cut(j) |
4356 | + $ .and..not.from_decay(i) ) then |
4357 | + is_pdg_for_merging_cut(i)=.true. |
4358 | + exit |
4359 | + endif |
4360 | + enddo |
4361 | + |
4362 | enddo |
4363 | |
4364 | |
4365 | |
4366 | === modified file 'Template/LO/SubProcesses/unwgt.f' |
4367 | --- Template/LO/SubProcesses/unwgt.f 2016-08-22 13:52:25 +0000 |
4368 | +++ Template/LO/SubProcesses/unwgt.f 2016-09-01 23:40:50 +0000 |
4369 | @@ -240,9 +240,9 @@ |
4370 | c call write_event(p,uwgt) |
4371 | c write(29,'(2e15.5)') matrix,wgt |
4372 | c $B$ S-COMMENT_C $B$ |
4373 | - call write_leshouche(p,uwgt,numproc) |
4374 | + call write_leshouche(p,uwgt,numproc,.True.) |
4375 | elseif (xwgt .gt. 0d0 .and. nw .lt. 5) then |
4376 | - call write_leshouche(p,wgt/twgt*1d-6,numproc) |
4377 | + call write_leshouche(p,wgt/twgt*1d-6,numproc,.True.) |
4378 | c $E$ S-COMMENT_C $E$ |
4379 | endif |
4380 | maxwgt=max(maxwgt,xwgt) |
4381 | @@ -441,7 +441,7 @@ |
4382 | c close(lun) |
4383 | end |
4384 | |
4385 | - SUBROUTINE write_leshouche(p,wgt,numproc) |
4386 | + SUBROUTINE write_leshouche(p,wgt,numproc,do_write_events) |
4387 | C************************************************************************** |
4388 | C Writes out information for event |
4389 | C************************************************************************** |
4390 | @@ -464,15 +464,16 @@ |
4391 | c |
4392 | double precision p(0:3,nexternal),wgt |
4393 | integer numproc |
4394 | + logical do_write_events |
4395 | c |
4396 | c Local |
4397 | c |
4398 | integer i,j,k,iini,ifin |
4399 | double precision sum_wgt,sum_wgt2, xtarget,targetamp(maxflow) |
4400 | - integer ip, np, ic, nc, jpart(7,-nexternal+3:2*nexternal-3) |
4401 | + integer ip, np, ic, nc |
4402 | integer ida(2),ito(-nexternal+3:nexternal),ns,nres,ires,icloop |
4403 | integer iseed |
4404 | - double precision pboost(0:3),pb(0:4,-nexternal+3:2*nexternal-3) |
4405 | + double precision pboost(0:3) |
4406 | double precision beta, get_betaz |
4407 | double precision ebi(0:3), ebo(0:3) |
4408 | double precision ptcltmp(nexternal), pdum(0:3) |
4409 | @@ -481,19 +482,14 @@ |
4410 | integer mothup(2,nexternal) |
4411 | integer icolup(2,nexternal,maxflow,maxsproc) |
4412 | |
4413 | - integer isym(nexternal,99), nsym, jsym |
4414 | + integer nsym |
4415 | |
4416 | - double precision sscale,aaqcd,aaqed |
4417 | - integer ievent,npart |
4418 | + integer ievent |
4419 | logical flip |
4420 | |
4421 | real ran1 |
4422 | external ran1 |
4423 | |
4424 | - character*1000 buff |
4425 | - character*(s_bufflen) s_buff(7) |
4426 | - integer nclus |
4427 | - character*(clus_bufflen) buffclus(nexternal) |
4428 | character*40 cfmt |
4429 | C |
4430 | C GLOBAL |
4431 | @@ -514,9 +510,6 @@ |
4432 | integer mincfig, maxcfig |
4433 | common/to_configs/mincfig, maxcfig |
4434 | |
4435 | - integer ngroup |
4436 | - common/to_group/ngroup |
4437 | - |
4438 | double precision stot,m1,m2 |
4439 | common/to_stot/stot,m1,m2 |
4440 | c |
4441 | @@ -533,17 +526,24 @@ |
4442 | c data ncolflow/maxamps*0/ |
4443 | c data ncolalt/maxamps*0/ |
4444 | |
4445 | + include 'coupl.inc' |
4446 | + |
4447 | + include 'lhe_event_infos.inc' |
4448 | + data AlreadySetInBiasModule/.False./ |
4449 | + |
4450 | include 'symswap.inc' |
4451 | - include 'coupl.inc' |
4452 | C----- |
4453 | C BEGIN CODE |
4454 | C----- |
4455 | |
4456 | - if (nw .ge. maxevents) return |
4457 | - |
4458 | -c Store weight for event |
4459 | - nw = nw+1 |
4460 | - swgt(nw)=wgt |
4461 | + if ((nw .ge. maxevents).and.do_write_events) return |
4462 | + |
4463 | +C if all the necessary inputs to write the events have already been |
4464 | +C computed in the bias module, then directly jump to write_events |
4465 | + if (AlreadySetInBiasModule) then |
4466 | + goto 1123 |
4467 | + endif |
4468 | + |
4469 | c |
4470 | c In case of identical particles symmetry, choose assignment |
4471 | c |
4472 | @@ -742,6 +742,19 @@ |
4473 | write(buffclus(nexternal),'(a)')'</clustering>' |
4474 | endif |
4475 | |
4476 | +C If the arguments of write_event have already been set in the |
4477 | +C bias module, then the beginning of the routine will directly |
4478 | +C jump here. |
4479 | + |
4480 | + 1123 continue |
4481 | + if (.not.do_write_events) then |
4482 | + return |
4483 | + endif |
4484 | + |
4485 | +c Store weight for event |
4486 | + nw = nw+1 |
4487 | + swgt(nw)=wgt |
4488 | + |
4489 | call write_event(lun,pb(0,1),wgt,npart,jpart(1,1),ngroup, |
4490 | & sscale,aaqcd,aaqed,buff,use_syst,s_buff,nclus,buffclus) |
4491 | if(btest(mlevel,1)) |
4492 | |
4493 | === modified file 'Template/LO/bin/internal/run_delphes3' |
4494 | --- Template/LO/bin/internal/run_delphes3 2013-02-25 00:52:53 +0000 |
4495 | +++ Template/LO/bin/internal/run_delphes3 2016-09-01 23:40:50 +0000 |
4496 | @@ -9,6 +9,7 @@ |
4497 | run=$2 |
4498 | tag=$3 |
4499 | cross=$4 |
4500 | +file=$5 |
4501 | |
4502 | main=`pwd` |
4503 | |
4504 | @@ -22,17 +23,35 @@ |
4505 | exit |
4506 | fi |
4507 | |
4508 | +if [ ${file: -3} == ".gz" ] |
4509 | +then |
4510 | + if [ ${file: -7} == ".hep.gz" ] |
4511 | + then |
4512 | + gunzip --stdout $file | $delphesdir/DelphesSTDHEP ../Cards/delphes_card.dat ${run}/${tag}_delphes_events.root |
4513 | + else |
4514 | + gunzip --stdout $file | $delphesdir/DelphesHepMC ../Cards/delphes_card.dat ${run}/${tag}_delphes_events.root |
4515 | + fi |
4516 | +else |
4517 | + if [ ${file: -4} == ".hep" ] |
4518 | + then |
4519 | + $delphesdir/DelphesSTDHEP ../Cards/delphes_card.dat ${run}/${tag}_delphes_events.root $file |
4520 | + else |
4521 | + $delphesdir/DelphesHepMC ../Cards/delphes_card.dat ${run}/${tag}_delphes_events.root $file |
4522 | + fi |
4523 | +fi |
4524 | + |
4525 | echo $$ >> ../myprocid |
4526 | |
4527 | -# Set delphes path in delphes_card.dat |
4528 | - |
4529 | -$delphesdir/DelphesSTDHEP ../Cards/delphes_card.dat delphes.root pythia_events.hep |
4530 | -$delphesdir/root2lhco delphes.root delphes_events.lhco |
4531 | - |
4532 | -if [ -e delphes_events.lhco ]; then |
4533 | -# write the delphes banner |
4534 | - sed -e "s/^/#/g" ${run}/${run}_${tag}_banner.txt > ${run}/${tag}_delphes_events.lhco |
4535 | - echo "## Integrated weight (pb) : ${cross}" >> ${run}/${tag}_delphes_events.lhco |
4536 | - cat delphes_events.lhco >> ${run}/${tag}_delphes_events.lhco |
4537 | - rm -f delphes_events.lhco |
4538 | -fi |
4539 | +# Uncomment the following to have the LHCO file: |
4540 | +# |
4541 | +# |
4542 | +#$delphesdir/root2lhco ${run}/${tag}_delphes.root delphes_events.lhco |
4543 | +# |
4544 | +#if [ -e delphes_events.lhco ]; then |
4545 | +## write the delphes banner |
4546 | +# sed -e "s/^/#/g" ${run}/${run}_${tag}_banner.txt > ${run}/${tag}_delphes_events.lhco |
4547 | +# echo "## Integrated weight (pb) : ${cross}" >> ${run}/${tag}_delphes_events.lhco |
4548 | +# cat delphes_events.lhco >> ${run}/${tag}_delphes_events.lhco |
4549 | +# gzip ${run}/${tag}_delphes_events.lhco |
4550 | +# rm -f delphes_events.lhco |
4551 | +#fi |
4552 | |
4553 | === modified file 'UpdateNotes.txt' |
4554 | --- UpdateNotes.txt 2016-08-26 13:55:42 +0000 |
4555 | +++ UpdateNotes.txt 2016-09-01 23:40:50 +0000 |
4556 | @@ -4,22 +4,22 @@ |
4557 | 2.5.0 (xx/xx/xx) |
4558 | FUNCTIONALITY |
4559 | ------------- |
4560 | + VH+OM: Adding an official interface to PY8 for the parton-shower |
4561 | OM: Introduces a new function for LO/NLO interface "systematics" |
4562 | This function allows to compute systematics uncertainty from the event sample |
4563 | It requires the event sample to have been generated with |
4564 | - use_syst = T (for LO sample) |
4565 | - store_reweight_info = T (for NLO sample) |
4566 | At LO the code is run automatically if use_syst=T (but if SysCalc is installed) |
4567 | - |
4568 | + VH+SP: extend support for CKKWL |
4569 | + VH: extend install command to install: lhapdf/pythia8 |
4570 | VH: adding the possibility to install COLLIER and to use it to reduce the loop-matrix element |
4571 | OM+VH: At the first loop/NLO computation, a new question will now be asked to choose which program |
4572 | to install to compute the loop. You can still install additional method later via the "install" command |
4573 | - OM: add an automatic update of the param_card to write the correct value for all dependent parameter. |
4574 | - OM: add the check that the param_card is compatible with the model restriction. |
4575 | - OM: NLO/LO Re-weighting works in multi-core |
4576 | - |
4577 | - CODE IMPROVMENT |
4578 | - --------------- |
4579 | + |
4580 | + |
4581 | + CODE IMPROVMENT / small feature |
4582 | + ------------------------------- |
4583 | OM: Modify the structure of the output format such that all the internal format have the same structure |
4584 | OM: Adding the Plugin directory. Three kind of plugin are currently supported |
4585 | - plugin defining a new type of output format |
4586 | @@ -27,6 +27,12 @@ |
4587 | - plugin modifying the main interface of MG5aMCnlo |
4588 | More informations/examples are available here: |
4589 | https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Plugin |
4590 | + OM: Adding the possiblity of having detailled help at the time of the edition of the cards. |
4591 | + help mass / help mt / help nevents provided some information on the parameters. |
4592 | + OM: NLO/LO Re-weighting works in multi-core |
4593 | + OM: add an automatic update of the param_card to write the correct value for all dependent parameter. |
4594 | + OM: add the check that the param_card is compatible with the model restriction. |
4595 | + OM: Adding the run_card options "event_norm" for the LO run_card (same meaning as NLO one) |
4596 | |
4597 | BUG FIXING |
4598 | ---------- |
4599 | @@ -34,7 +40,6 @@ |
4600 | OM: Fix a bug in the reweight_card where relative path was not understood from the local directory |
4601 | where the program was runned by the user. |
4602 | |
4603 | - |
4604 | 2.4.3 (01/08/16) |
4605 | OM: Reduce the amount of log file/output generated for LO run (output can use up to three times less output). |
4606 | OM: For the LO combination of events (unweighting) pass to the method previously used for loop-induced. |
4607 | |
4608 | === modified file 'VERSION' |
4609 | --- VERSION 2016-08-26 13:55:42 +0000 |
4610 | +++ VERSION 2016-09-01 23:40:50 +0000 |
4611 | @@ -1,5 +1,6 @@ |
4612 | version = 2.5.0.alpha |
4613 | -date = 2016-08-26 |
4614 | +date = 2016-08-28 |
4615 | + |
4616 | |
4617 | |
4618 | |
4619 | |
4620 | === modified file 'input/.mg5_configuration_default.txt' |
4621 | --- input/.mg5_configuration_default.txt 2016-06-16 09:04:34 +0000 |
4622 | +++ input/.mg5_configuration_default.txt 2016-09-01 23:40:50 +0000 |
4623 | @@ -56,10 +56,17 @@ |
4624 | # timeout = 60 |
4625 | |
4626 | #! Pythia8 path. |
4627 | -#! Defines the path to the main pythia8 directory (i.e. that containing |
4628 | -#! the pythia8 configure script) . |
4629 | +#! Defines the path to the pythia8 installation directory (i.e. the |
4630 | +#! on containing the lib, bin and include directories) . |
4631 | #! If using a relative path, that starts from the mg5 directory |
4632 | -# pythia8_path = |
4633 | +# pythia8_path = ./HEPTools/pythia8 |
4634 | + |
4635 | +#! MG5aMC_PY8_interface path |
4636 | +#! Defines the path of the C++ driver file that is used by MG5_aMC to |
4637 | +#! steer the Pythia8 shower. |
4638 | +#! Can be installed directly from within MG5_aMC with the following command: |
4639 | +#! MG5_aMC> install mg5amc_py8_interface |
4640 | +# mg5amc_py8_interface_path = ./HEPTools/MG5aMC_PY8_interface |
4641 | |
4642 | #! Herwig++ paths |
4643 | #! specify here the paths also to HepMC ant ThePEG |
4644 | @@ -132,10 +139,14 @@ |
4645 | #! relative path start from main directory |
4646 | # delphes_path = ./Delphes |
4647 | |
4648 | -#! MadAnalysis Package [For Drawing output] |
4649 | +#! MadAnalysis4 fortran-based package [for basic analysis] |
4650 | #! relative path start from main directory |
4651 | # madanalysis_path = ./MadAnalysis |
4652 | |
4653 | +#! MadAnalysis5 python-based Package [For advanced analysis] |
4654 | +#! relative path start from main directory |
4655 | +# madanalysis5_path = ./HEPTools/madanalysis5/madanalysis5 |
4656 | + |
4657 | #! ExRootAnalysis Package |
4658 | #! relative path start from main directory |
4659 | # exrootanalysis_path = ./ExRootAnalysis |
4660 | |
4661 | === modified file 'madgraph/core/base_objects.py' |
4662 | --- madgraph/core/base_objects.py 2016-08-15 14:06:30 +0000 |
4663 | +++ madgraph/core/base_objects.py 2016-09-01 23:40:50 +0000 |
4664 | @@ -1270,8 +1270,6 @@ |
4665 | self.name2part = {} |
4666 | for part in self.get("particle_dict").values(): |
4667 | self.name2part[part.get('name')] = part |
4668 | - |
4669 | - |
4670 | |
4671 | def get_lorentz(self, name): |
4672 | """return the lorentz object from the associate name""" |
4673 | |
4674 | === modified file 'madgraph/interface/amcatnlo_interface.py' |
4675 | --- madgraph/interface/amcatnlo_interface.py 2016-06-20 11:08:55 +0000 |
4676 | +++ madgraph/interface/amcatnlo_interface.py 2016-09-01 23:40:50 +0000 |
4677 | @@ -323,9 +323,7 @@ |
4678 | |
4679 | def __init__(self, mgme_dir = '', *completekey, **stdin): |
4680 | """ Special init tasks for the Loop Interface """ |
4681 | - |
4682 | mg_interface.MadGraphCmd.__init__(self, mgme_dir = '', *completekey, **stdin) |
4683 | - misc.sprint(type(self.history)) |
4684 | self.setup() |
4685 | |
4686 | def setup(self): |
4687 | @@ -462,6 +460,8 @@ |
4688 | |
4689 | self.proc_validity(myprocdef,'aMCatNLO_%s'%proc_type[1]) |
4690 | |
4691 | + self._curr_proc_defs.append(myprocdef) |
4692 | + |
4693 | # if myprocdef['perturbation_couplings']!=['QCD']: |
4694 | # message = ""FKS for reals only available in QCD for now, you asked %s" \ |
4695 | # % ', '.join(myprocdef['perturbation_couplings'])" |
4696 | @@ -519,6 +519,8 @@ |
4697 | if self._export_format in ['NLO']: |
4698 | self._curr_exporter = export_v4.ExportV4Factory(self, noclean, |
4699 | output_type='amcatnlo',group_subprocesses=group_processes) |
4700 | + |
4701 | + self._curr_exporter.pass_information_from_cmd(self) |
4702 | |
4703 | # check if a dir with the same name already exists |
4704 | if not force and not noclean and os.path.isdir(self._export_dir)\ |
4705 | @@ -546,6 +548,9 @@ |
4706 | # Perform export and finalize right away |
4707 | self.export(nojpeg, main_file_name, group_processes=group_processes) |
4708 | |
4709 | + # Pass potential new information generated during the export. |
4710 | + self._curr_exporter.pass_information_from_cmd(self) |
4711 | + |
4712 | # Automatically run finalize |
4713 | self.finalize(nojpeg) |
4714 | |
4715 | @@ -655,7 +660,9 @@ |
4716 | global glob_directories_map |
4717 | glob_directories_map = [] |
4718 | |
4719 | + # Save processes instances generated |
4720 | self.born_processes_for_olp = [] |
4721 | + self.born_processes = [] |
4722 | for ime, me in \ |
4723 | enumerate(self._curr_matrix_elements.get('matrix_elements')): |
4724 | if not self.options['low_mem_multicore_nlo_generation']: |
4725 | @@ -667,6 +674,7 @@ |
4726 | path,self.options['OLP']) |
4727 | self._fks_directories.extend(self._curr_exporter.fksdirs) |
4728 | self.born_processes_for_olp.append(me.born_matrix_element.get('processes')[0]) |
4729 | + self.born_processes.append(me.born_matrix_element.get('processes')) |
4730 | else: |
4731 | glob_directories_map.append(\ |
4732 | [self._curr_exporter, me, self._curr_helas_model, |
4733 | |
4734 | === modified file 'madgraph/interface/amcatnlo_run_interface.py' |
4735 | --- madgraph/interface/amcatnlo_run_interface.py 2016-08-26 16:21:09 +0000 |
4736 | +++ madgraph/interface/amcatnlo_run_interface.py 2016-09-01 23:40:50 +0000 |
4737 | @@ -1222,6 +1222,8 @@ |
4738 | if not mode in ['LO', 'NLO', 'noshower', 'noshowerLO'] \ |
4739 | and not options['parton']: |
4740 | self.run_mcatnlo(evt_file, options) |
4741 | + self.exec_cmd('madanalysis5_hadron --no_default', postcmd=False, printcmd=False) |
4742 | + |
4743 | elif mode == 'noshower': |
4744 | logger.warning("""You have chosen not to run a parton shower. NLO events without showering are NOT physical. |
4745 | Please, shower the Les Houches events before using them for physics analyses.""") |
4746 | @@ -2962,14 +2964,14 @@ |
4747 | |
4748 | |
4749 | # libdl may be needded for pythia 82xx |
4750 | - if shower == 'PYTHIA8' and not \ |
4751 | - os.path.exists(pjoin(self.options['pythia8_path'], 'xmldoc')) and \ |
4752 | - 'dl' not in self.shower_card['extralibs'].split(): |
4753 | - # 'dl' has to be linked with the extralibs |
4754 | - self.shower_card['extralibs'] += ' dl' |
4755 | - logger.warning("'dl' was added to extralibs from the shower_card.dat.\n" + \ |
4756 | - "It is needed for the correct running of PY8.2xx.\n" + \ |
4757 | - "If this library cannot be found on your system, a crash will occur.") |
4758 | + #if shower == 'PYTHIA8' and not \ |
4759 | + # os.path.exists(pjoin(self.options['pythia8_path'], 'xmldoc')) and \ |
4760 | + # 'dl' not in self.shower_card['extralibs'].split(): |
4761 | + # # 'dl' has to be linked with the extralibs |
4762 | + # self.shower_card['extralibs'] += ' dl' |
4763 | + # logger.warning("'dl' was added to extralibs from the shower_card.dat.\n" + \ |
4764 | + # "It is needed for the correct running of PY8.2xx.\n" + \ |
4765 | + # "If this library cannot be found on your system, a crash will occur.") |
4766 | |
4767 | misc.call(['./MCatNLO_MadFKS.inputs'], stdout=open(mcatnlo_log, 'w'), |
4768 | stderr=open(mcatnlo_log, 'w'), |
4769 | @@ -3298,96 +3300,91 @@ |
4770 | |
4771 | ############################################################################ |
4772 | def set_run_name(self, name, tag=None, level='parton', reload_card=False): |
4773 | - """define the run name, the run_tag, the banner and the results.""" |
4774 | - |
4775 | - # when are we force to change the tag new_run:previous run requiring changes |
4776 | - upgrade_tag = {'parton': ['parton','pythia','pgs','delphes','shower'], |
4777 | - 'pythia': ['pythia','pgs','delphes'], |
4778 | - 'shower': ['shower'], |
4779 | - 'pgs': ['pgs'], |
4780 | - 'delphes':['delphes'], |
4781 | - 'plot':[]} |
4782 | - |
4783 | - |
4784 | - |
4785 | - if name == self.run_name: |
4786 | - if reload_card: |
4787 | - run_card = pjoin(self.me_dir, 'Cards','run_card.dat') |
4788 | - self.run_card = banner_mod.RunCardNLO(run_card) |
4789 | - |
4790 | - #check if we need to change the tag |
4791 | - if tag: |
4792 | - self.run_card['run_tag'] = tag |
4793 | - self.run_tag = tag |
4794 | - self.results.add_run(self.run_name, self.run_card) |
4795 | - else: |
4796 | - for tag in upgrade_tag[level]: |
4797 | - if getattr(self.results[self.run_name][-1], tag): |
4798 | - tag = self.get_available_tag() |
4799 | - self.run_card['run_tag'] = tag |
4800 | - self.run_tag = tag |
4801 | - self.results.add_run(self.run_name, self.run_card) |
4802 | - break |
4803 | - return # Nothing to do anymore |
4804 | - |
4805 | - # save/clean previous run |
4806 | - if self.run_name: |
4807 | - self.store_result() |
4808 | - # store new name |
4809 | - self.run_name = name |
4810 | - |
4811 | - # Read run_card |
4812 | - run_card = pjoin(self.me_dir, 'Cards','run_card.dat') |
4813 | - self.run_card = banner_mod.RunCardNLO(run_card) |
4814 | - |
4815 | - new_tag = False |
4816 | - # First call for this run -> set the banner |
4817 | - self.banner = banner_mod.recover_banner(self.results, level, self.run_name, tag) |
4818 | - if tag: |
4819 | - self.run_card['run_tag'] = tag |
4820 | - new_tag = True |
4821 | - elif not self.run_name in self.results and level =='parton': |
4822 | - pass # No results yet, so current tag is fine |
4823 | - elif not self.run_name in self.results: |
4824 | - #This is only for case when you want to trick the interface |
4825 | - logger.warning('Trying to run data on unknown run.') |
4826 | - self.results.add_run(name, self.run_card) |
4827 | - self.results.update('add run %s' % name, 'all', makehtml=True) |
4828 | - else: |
4829 | - for tag in upgrade_tag[level]: |
4830 | - |
4831 | - if getattr(self.results[self.run_name][-1], tag): |
4832 | - # LEVEL is already define in the last tag -> need to switch tag |
4833 | - tag = self.get_available_tag() |
4834 | - self.run_card['run_tag'] = tag |
4835 | - new_tag = True |
4836 | - break |
4837 | - if not new_tag: |
4838 | - # We can add the results to the current run |
4839 | - tag = self.results[self.run_name][-1]['tag'] |
4840 | - self.run_card['run_tag'] = tag # ensure that run_tag is correct |
4841 | - |
4842 | - |
4843 | - if name in self.results and not new_tag: |
4844 | - self.results.def_current(self.run_name) |
4845 | - else: |
4846 | - self.results.add_run(self.run_name, self.run_card) |
4847 | - |
4848 | - self.run_tag = self.run_card['run_tag'] |
4849 | - |
4850 | - # Return the tag of the previous run having the required data for this |
4851 | - # tag/run to working wel. |
4852 | - if level == 'parton': |
4853 | - return |
4854 | - elif level == 'pythia': |
4855 | - return self.results[self.run_name][0]['tag'] |
4856 | - else: |
4857 | - for i in range(-1,-len(self.results[self.run_name])-1,-1): |
4858 | - tagRun = self.results[self.run_name][i] |
4859 | - if tagRun.pythia: |
4860 | - return tagRun['tag'] |
4861 | - |
4862 | - |
4863 | + """define the run name, the run_tag, the banner and the results.""" |
4864 | + |
4865 | + # when are we force to change the tag new_run:previous run requiring changes |
4866 | + upgrade_tag = {'parton': ['parton','delphes','shower','madanalysis5_hadron'], |
4867 | + 'shower': ['shower','delphes','madanalysis5_hadron'], |
4868 | + 'delphes':['delphes'], |
4869 | + 'madanalysis5_hadron':['madanalysis5_hadron'], |
4870 | + 'plot':[]} |
4871 | + |
4872 | + if name == self.run_name: |
4873 | + if reload_card: |
4874 | + run_card = pjoin(self.me_dir, 'Cards','run_card.dat') |
4875 | + self.run_card = banner_mod.RunCardNLO(run_card) |
4876 | + |
4877 | + #check if we need to change the tag |
4878 | + if tag: |
4879 | + self.run_card['run_tag'] = tag |
4880 | + self.run_tag = tag |
4881 | + self.results.add_run(self.run_name, self.run_card) |
4882 | + else: |
4883 | + for tag in upgrade_tag[level]: |
4884 | + if getattr(self.results[self.run_name][-1], tag): |
4885 | + tag = self.get_available_tag() |
4886 | + self.run_card['run_tag'] = tag |
4887 | + self.run_tag = tag |
4888 | + self.results.add_run(self.run_name, self.run_card) |
4889 | + break |
4890 | + return # Nothing to do anymore |
4891 | + |
4892 | + # save/clean previous run |
4893 | + if self.run_name: |
4894 | + self.store_result() |
4895 | + # store new name |
4896 | + self.run_name = name |
4897 | + |
4898 | + # Read run_card |
4899 | + run_card = pjoin(self.me_dir, 'Cards','run_card.dat') |
4900 | + self.run_card = banner_mod.RunCardNLO(run_card) |
4901 | + |
4902 | + new_tag = False |
4903 | + # First call for this run -> set the banner |
4904 | + self.banner = banner_mod.recover_banner(self.results, level, self.run_name, tag) |
4905 | + if tag: |
4906 | + self.run_card['run_tag'] = tag |
4907 | + new_tag = True |
4908 | + elif not self.run_name in self.results and level =='parton': |
4909 | + pass # No results yet, so current tag is fine |
4910 | + elif not self.run_name in self.results: |
4911 | + #This is only for case when you want to trick the interface |
4912 | + logger.warning('Trying to run data on unknown run.') |
4913 | + self.results.add_run(name, self.run_card) |
4914 | + self.results.update('add run %s' % name, 'all', makehtml=True) |
4915 | + else: |
4916 | + for tag in upgrade_tag[level]: |
4917 | + |
4918 | + if getattr(self.results[self.run_name][-1], tag): |
4919 | + # LEVEL is already define in the last tag -> need to switch tag |
4920 | + tag = self.get_available_tag() |
4921 | + self.run_card['run_tag'] = tag |
4922 | + new_tag = True |
4923 | + break |
4924 | + if not new_tag: |
4925 | + # We can add the results to the current run |
4926 | + tag = self.results[self.run_name][-1]['tag'] |
4927 | + self.run_card['run_tag'] = tag # ensure that run_tag is correct |
4928 | + |
4929 | + |
4930 | + if name in self.results and not new_tag: |
4931 | + self.results.def_current(self.run_name) |
4932 | + else: |
4933 | + self.results.add_run(self.run_name, self.run_card) |
4934 | + |
4935 | + self.run_tag = self.run_card['run_tag'] |
4936 | + |
4937 | + # Return the tag of the previous run having the required data for this |
4938 | + # tag/run to working wel. |
4939 | + if level == 'parton': |
4940 | + return |
4941 | + elif level == 'pythia': |
4942 | + return self.results[self.run_name][0]['tag'] |
4943 | + else: |
4944 | + for i in range(-1,-len(self.results[self.run_name])-1,-1): |
4945 | + tagRun = self.results[self.run_name][i] |
4946 | + if tagRun.pythia: |
4947 | + return tagRun['tag'] |
4948 | |
4949 | |
4950 | def store_result(self): |
4951 | @@ -4457,10 +4454,10 @@ |
4952 | options['reweightonly'] = False |
4953 | |
4954 | |
4955 | - void = 'NOT INSTALLED' |
4956 | - switch_order = ['order', 'fixed_order', 'shower','madspin', 'reweight'] |
4957 | + void = 'Not installed' |
4958 | + switch_order = ['order', 'fixed_order', 'shower','madspin', 'reweight','madanalysis5'] |
4959 | switch_default = {'order': 'NLO', 'fixed_order': 'OFF', 'shower': void, |
4960 | - 'madspin': void,'reweight':'OFF'} |
4961 | + 'madspin': void,'reweight':'OFF','madanalysis5':void} |
4962 | if not switch: |
4963 | switch = switch_default |
4964 | else: |
4965 | @@ -4472,18 +4469,26 @@ |
4966 | 'fixed_order': default_switch, |
4967 | 'shower': default_switch, |
4968 | 'madspin': default_switch, |
4969 | - 'reweight': default_switch} |
4970 | + 'reweight': default_switch, |
4971 | + 'madanalysis5':['OFF','HADRON']} |
4972 | + |
4973 | + if not os.path.exists(pjoin(self.me_dir, 'Cards', |
4974 | + 'madanalysis5_hadron_card_default.dat')): |
4975 | + allowed_switch_value['madanalysis5']=[] |
4976 | |
4977 | description = {'order': 'Perturbative order of the calculation:', |
4978 | 'fixed_order': 'Fixed order (no event generation and no MC@[N]LO matching):', |
4979 | 'shower': 'Shower the generated events:', |
4980 | 'madspin': 'Decay particles with the MadSpin module:', |
4981 | - 'reweight': 'Add weights to the events based on changing model parameters:'} |
4982 | + 'reweight': 'Add weights to the events based on changing model parameters:', |
4983 | + 'madanalysis5':'Run MadAnalysis5 on the events generated:'} |
4984 | |
4985 | force_switch = {('shower', 'ON'): {'fixed_order': 'OFF'}, |
4986 | ('madspin', 'ON'): {'fixed_order':'OFF'}, |
4987 | ('reweight', 'ON'): {'fixed_order':'OFF'}, |
4988 | - ('fixed_order', 'ON'): {'shower': 'OFF', 'madspin': 'OFF', 'reweight':'OFF'} |
4989 | + ('fixed_order', 'ON'): {'shower': 'OFF', 'madspin': 'OFF', 'reweight':'OFF','madanalysis5':'OFF'}, |
4990 | + ('madanalysis5','HADRON'): {'shower': 'ON','fixed_order':'OFF'}, |
4991 | + ('shower','OFF'): {'madanalysis5': 'OFF'}, |
4992 | } |
4993 | special_values = ['LO', 'NLO', 'aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO'] |
4994 | |
4995 | @@ -4494,10 +4499,12 @@ |
4996 | switch['shower'] = 'Not available for decay' |
4997 | switch['madspin'] = 'Not available for decay' |
4998 | switch['reweight'] = 'Not available for decay' |
4999 | + switch['madanalysis5'] = 'Not available for decay' |
5000 | allowed_switch_value['fixed_order'] = ['ON'] |
Here is a first partial run on the code changes:
1) some comment about the pythia8_card.
1.1) Need to explain what HEPMCoutput:file = auto means.
1.2) I do not understand what you mean by
! <path> : to select where the HEPMC file must written. It will
! therefore *not* be available in the process output.
Could you rephrase
1.3) The line JetMatching:nJetMax = -1 is present two times. What happens if you modify only one?
1.4) How do we choose which of the MLM/CKKW is running (would be nice to be written)?
1.5) The link to the wiki explaining the MG/PY interface should be written in the cards.
2) somme comment about the run card
2.1) wtf is this:
# Number of helicities to sum per event (0 = all helicities)
# 0 gives more stable result, but longer run time (needed for
# long decay chains e.g.).
# Use >=2 if most helicities contribute, e.g. pure QCD.
3)some bad change has been done to Template/ LO/SubProcesses /cuts.f
forbidding review of the file (100% diff) -> need to be done manually later.
4) in setcuts.f I see: for_merging_ cut(0) merging_ cut(j) .ne. 0 i,1,iproc) ) .eq.pdgs_ for_merging_ cut(j) ) then for_merging_ cut(i)= .true.
+c Remember mergeable particles
+ do j=1,pdgs_
+ if ( pdgs_for_
+ $ .and. abs(idup(
+ is_pdg_
+ exit
+ endif
+ enddo
should not we set this on True only if from_decay(i)=false ?
5) I guess that the following is wrong: run_interface line 3306: ,'pythia' ,'pgs', 'delphes' ,'shower' ],
'pythia' : ['pythia' ,'pgs', 'delphes' ],
'shower' : ['shower'],
'pgs' : ['pgs'],
'delphes' :['delphes' ],
'madanalysis5 _hadron' :['madanalysis5 _hadron' ],
'plot' :[]} run_interface) .
amcatnlo_
# when are we force to change the tag new_run:previous run requiring changes
upgrade_tag = {'parton': ['parton'
your change did not make sense to me (neither why those lines are in AMC@NLO_
This will be the source for bug I guess.
need to continue at file interface/ common_ run_interface. py'
=== modified file 'madgraph/
will continue as soon as possible.