merging two LHE files using merge.pl

Asked by Arka Santra on 2018-12-03

Hi,
  I have generated LHE files for two processes:
1. p p > e+ e- with nn23lo1 PDF, 100K events
2. a a > e+ e- with LUXqed PDF, 100K events
I want to merge those two LHE files from those processes to get the combined LHE file. Is there any script to do that inside MadGraph?

 I tried to merge those two LHE files using this script:
https://cp3.irmp.ucl.ac.be/projects/madgraph/attachment/wiki/MultiRun/merge.pl.txt

This is the command I used:

./merge.pl unweighted_events_1.lhe.gz unweighted_events_2.lhe.gz merged_file.lhe.gz merged_banner.txt.

Even though I see that merged_file.lhe is produced, this is the message the code is printing:

Use of uninitialized value $num_events1 in substitution (s///) at ./merge.pl line 68.
Use of uninitialized value $num_events1 in substitution (s///) at ./merge.pl line 68.
Use of uninitialized value $xsec1 in substitution (s///) at ./merge.pl line 69.
Use of uninitialized value $xsec1 in substitution (s///) at ./merge.pl line 69.
Use of uninitialized value $num_events2 in substitution (s///) at ./merge.pl line 72.
Use of uninitialized value $num_events2 in substitution (s///) at ./merge.pl line 72.
Use of uninitialized value $xsec2 in substitution (s///) at ./merge.pl line 73.
Use of uninitialized value $xsec2 in substitution (s///) at ./merge.pl line 73.
File unweighted_events_2.lhe read with events and xsec
File merged_file.lhe read with events and xsec
Argument "" isn't numeric in subtraction (-) at ./merge.pl line 77.
Argument "" isn't numeric in subtraction (-) at ./merge.pl line 77.
Illegal division by zero at ./merge.pl line 77.

What is a way out? Does this mean the output lhe file is corrupted?

Thank you,
Arka

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Last query:
2018-12-04
Last reply:
2018-12-04

Hi,

You can not merge two lhe file generated with different PDF since the header of the file is unique (and that the information in the header of the file contains the PDF used for the generation of the events).
So the output will not follow the official lhe standard and code using those events (like parton-shower) are likely to crash due to that.

Additionally merge.pl is not designed for that specific case (where the sample to merge does not have the same cross-section up to statistical uncertainty.)

Cheers,

Olivier

> On 3 Dec 2018, at 16:57, Arka Santra <email address hidden> wrote:
>
> New question #676565 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/676565
>
> Hi,
> I have generated LHE files for two processes:
> 1. p p > e+ e- with nn23lo1 PDF, 100K events
> 2. a a > e+ e- with LUXqed PDF, 100K events
> I want to merge those two LHE files from those processes to get the combined LHE file. Is there any script to do that inside MadGraph?
>
> I tried to merge those two LHE files using this script:
> https://cp3.irmp.ucl.ac.be/projects/madgraph/attachment/wiki/MultiRun/merge.pl.txt
>
> This is the command I used:
>
> ./merge.pl unweighted_events_1.lhe.gz unweighted_events_2.lhe.gz merged_file.lhe.gz merged_banner.txt.
>
>
>
> Even though I see that merged_file.lhe is produced, this is the message the code is printing:
>
>
>
> Use of uninitialized value $num_events1 in substitution (s///) at ./merge.pl line 68.
> Use of uninitialized value $num_events1 in substitution (s///) at ./merge.pl line 68.
> Use of uninitialized value $xsec1 in substitution (s///) at ./merge.pl line 69.
> Use of uninitialized value $xsec1 in substitution (s///) at ./merge.pl line 69.
> Use of uninitialized value $num_events2 in substitution (s///) at ./merge.pl line 72.
> Use of uninitialized value $num_events2 in substitution (s///) at ./merge.pl line 72.
> Use of uninitialized value $xsec2 in substitution (s///) at ./merge.pl line 73.
> Use of uninitialized value $xsec2 in substitution (s///) at ./merge.pl line 73.
> File unweighted_events_2.lhe read with events and xsec
> File merged_file.lhe read with events and xsec
> Argument "" isn't numeric in subtraction (-) at ./merge.pl line 77.
> Argument "" isn't numeric in subtraction (-) at ./merge.pl line 77.
> Illegal division by zero at ./merge.pl line 77.
>
>
>
>
>
> What is a way out? Does this mean the output lhe file is corrupted?
>
>
> Thank you,
> Arka
>
>
>
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Arka Santra (santra-arka) said : #2

Hi Olivier,
  Thank you for your answer. If I want to get the LHE file combining these two processes:

1. p p > e+ e-
2. a a > e+ e-

( say I use nn23lo1 PDF for both the processes), what should be the procedure? Is it possible in MadGraph to use:

 p p > e+ e- && a a > e+ e-

or something like that?

Cheers,
Arka

Arka Santra (santra-arka) said : #3

Hi Olivier,
  I found this way to generate both the processes at one go:

> generate p p > e+ e-
> add process a a > e+ e-

Is there any way I can use nn23lo1 PDF for p p > e+ e- and LUXqed PDF for a a > e+ e-? If not, probably, I need to use the same PDF for the processes.

Cheers,
Arka

> Is there any way I can use nn23lo1 PDF for p p > e+ e- and LUXqed PDF
> for a a > e+ e-?

No this will break the LHEF convention so we do not allow it.

You either have to keep to separate file or use the same PDF.

Cheers,

Olivier

> On 4 Dec 2018, at 13:47, Arka Santra <email address hidden> wrote:
>
> Question #676565 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/676565
>
> Arka Santra gave more information on the question:
> Hi Olivier,
> I found this way to generate both the processes at one go:
>
>> generate p p > e+ e-
>> add process a a > e+ e-
>
> Is there any way I can use nn23lo1 PDF for p p > e+ e- and LUXqed PDF
> for a a > e+ e-? If not, probably, I need to use the same PDF for the
> processes.
>
>
> Cheers,
> Arka
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Can you help with this problem?

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

To post a message you must log in.