Cuts and Checks

Asked by s on 2020-06-01

Hi,

I have added a cut which looks at the lab frame momentum. I made a basic print out to see if it was working (inside the .f files in MadGraph). It showed me that the cut at least at that point in the code was working set to true/false accordingly.

Anyway, now I see from trying to attempt some analysis that the cut may have in fact not be in place.

The analysis uses the LHE directly, is there a reason an LHE output would not have custom cuts applied? If they are done inside cuts.f and have a "passcuts" set to true/false accordingly? I know adding cuts in this way is not advised but for our purposes its what we want to do.

Another thing - is it possible to add a custom value to the LHE file output? For example, if I just added lab frame momentum to the LHE it would help me assess this situation? Is that possible, and if so, how?

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
2020-06-02
Last reply:
2020-06-02

You might need to generate the code with
set group_subprocesses False

to have such cut compatible with symmetry/optimization performed by madgraph for the evaluation of the matrix-element and of the phase-space integration

Cheers,

Olivier

> On 1 Jun 2020, at 17:05, s <email address hidden> wrote:
>
> New question #691074 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/691074
>
> Hi,
>
> I have added a cut which looks at the lab frame momentum. I made a basic print out to see if it was working (inside the .f files in MadGraph). It showed me that the cut at least at that point in the code was working set to true/false accordingly.
>
> Anyway, now I see from trying to attempt some analysis that the cut may have in fact not be in place.
>
> The analysis uses the LHE directly, is there a reason an LHE output would not have custom cuts applied? If they are done inside cuts.f and have a "passcuts" set to true/false accordingly? I know adding cuts in this way is not advised but for our purposes its what we want to do.
>
> Another thing - is it possible to add a custom value to the LHE file output? For example, if I just added lab frame momentum to the LHE it would help me assess this situation? Is that possible, and if so, how?
>
> Thanks
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

s (midd1989) said : #2

Ah ok, yes, this makes sense since I doubt the rest of the MG calculations know what I want. Is this done on the command line? Or in the proc_card?

the one you want.

s (midd1989) said : #4

Ok, sure, I guess the proc card to ensure it's always set would be better for sustainability but for now, I'll just do it in the command line. I am seeing some errors. In the terminal upon running, I see "The following floating-point exceptions are signaling: IEEE_INVALID_FLAG, rm: cannot remove 'results.dat': No such file or directory". The log file gives this detail:

"""
generate_events run_01

Traceback (most recent call last):

  File "/home/sophie/Desktop/MADGraph/MG5_aMC_v2_7_1_2/madgraph/interface/extended_cmd.py", line 1515, in onecmd

    return self.onecmd_orig(line, **opt)

  File "/home/sophie/Desktop/MADGraph/MG5_aMC_v2_7_1_2/madgraph/interface/extended_cmd.py", line 1464, in onecmd_orig

    return func(arg, **opt)

  File "/home/sophie/Desktop/MADGraph/MG5_aMC_v2_7_1_2/madgraph/interface/madevent_interface.py", line 2469, in do_generate_events

    self.run_generate_events(switch_mode, args)

  File "/home/sophie/Desktop/MADGraph/MG5_aMC_v2_7_1_2/madgraph/interface/common_run_interface.py", line 6963, in new_fct

    original_fct(obj, *args, **opts)

  File "/home/sophie/Desktop/MADGraph/MG5_aMC_v2_7_1_2/madgraph/interface/madevent_interface.py", line 2511, in run_generate_events

    self.exec_cmd('refine %s' % nb_event, postcmd=False)

  File "/home/sophie/Desktop/MADGraph/MG5_aMC_v2_7_1_2/madgraph/interface/extended_cmd.py", line 1544, in exec_cmd

    stop = Cmd.onecmd_orig(current_interface, line, **opt)

  File "/home/sophie/Desktop/MADGraph/MG5_aMC_v2_7_1_2/madgraph/interface/extended_cmd.py", line 1464, in onecmd_orig

    return func(arg, **opt)

  File "/home/sophie/Desktop/MADGraph/MG5_aMC_v2_7_1_2/madgraph/interface/madevent_interface.py", line 3469, in do_refine

    x_improve.launch() # create the ajob for the refinment.

  File "/home/sophie/Desktop/MADGraph/MG5_aMC_v2_7_1_2/madgraph/madevent/gen_ximprove.py", line 860, in launch

    main_dir=pjoin(self.cmd.me_dir,'SubProcesses')) #main_dir is for gridpack readonly mode

  File "/home/sophie/Desktop/MADGraph/MG5_aMC_v2_7_1_2/madgraph/madevent/sum_html.py", line 747, in collect_result

    P_comb.add_results(os.path.basename(G), path, mfactors[G])

  File "/home/sophie/Desktop/MADGraph/MG5_aMC_v2_7_1_2/madgraph/madevent/sum_html.py", line 425, in add_results

    oneresult.read_results(filepath)

  File "/home/sophie/Desktop/MADGraph/MG5_aMC_v2_7_1_2/madgraph/madevent/sum_html.py", line 315, in read_results

    % (error_code, open(log).read())

Exception: Reported error: End code 1.0

 Full associated log:

 Process in group number 1

 No PDF is used, alpha_s(MZ) from param_card is used

 Value of alpha_s from param_card: 0.11839999999999999

 The default order of alpha_s running is fixed to 2

 Define smin to 0.88080289712100002
"""

I think this must be cause by my cuts but a "print to file" shows me only physical looking momenta. It runs through around 9000 out of 10000 events before hitting this error. Any help would be appreciated. thanks

You should run with a debugger (gdb) in order to find where you have a division by zero.

Cheers,

Olivier

s (midd1989) said : #6

Yes, that make sense, but how can you run gdb within MadGraph?

1. you have to edit Source/make_opts
to add the gdb flag

2. you have to force to recompile the code
cd Source
make clean
make

3, In madgraph output, you have the following directory structure

SubProcesses/P0_XXXXXXXXX
(0 can be a different digit in some cases)

go to the one problematic and run
make

4. the executable is then create as madevent

5. in that directory you should have a bunch of directory starting with the letter G
in each of them you have a file input_app.txt (sometimes called slightly differently)

6. a normal run of the code is from that directory
../madevent < input_app.txt

so you can change it to
gdb ../madevent

Cheers,

Olivier

s (midd1989) said : #8

Thanks, what is the gdb flag exactly? Just so I get this right?

s (midd1989) said : #9

I assume the line with -g which is commented out?

should be -g if I'm correct

Olivier

> On 2 Jun 2020, at 22:20, s <email address hidden> wrote:
>
> Question #691074 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/691074
>
> Status: Answered => Open
>
> s is still having a problem:
> Thanks, what is the gdb flag exactly? Just so I get this right?
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

You can use that one yes. They are more flags than just gdb one but that's fine.

Olivier

> On 2 Jun 2020, at 22:25, s <email address hidden> wrote:
>
> Question #691074 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/691074
>
> s gave more information on the question:
> I assume the line with -g which is commented out?
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

s (midd1989) said : #12

Great, I did that. The output is still quite hard to decipher:

it begins with this:

Program received signal SIGFPE, Arithmetic exception.
0x00005555555a7e8d in discretesampler::ds_get_point_with_binid (
    dim_name=<error reading variable: value requires 3247530288 bytes, which is more than max-value-size>, random_variable=0.56314492225646973, mbinid=...,
    jacobian_weight=1,
    mode=<error reading variable: value requires 3247530480 bytes, which is more than max-value-size>, convoluted_grid_names=<incomplete type>, _dim_name=17,
    _mode=4, _convoluted_grid_names=15) at DiscreteSampler.f:2049
2049 average_contrib = sampling_norm / size(mGrid%bins)

it doesnt give me any details about my own code - i guess it means its attempting some infinity somewhere? Possible a divide by 0 but it doesnt tell me where in my code sadly

Indeed that will not help you. too bad.

Can you help with this problem?

Provide an answer of your own, or ask s for more information if necessary.

To post a message you must log in.