Can I Split a LHE file in to number of LHE file using script?

Asked by suman

I like to shower a ME LHE file from Madgraph with pythia. Now if there is a script for spliting the LHE file in number of LHE file then these files can be run in parallel which can save lots of time and the output root file can be merge in to a single root file for final result. If there is a general script for this purpose please give the link.

Thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
Last query:
Last reply:
Revision history for this message
Best Olivier Mattelaer (olivier-mattelaer) said :
#1

We do the same for the muti-core andling of py8.
We use our lhe_parser class for doing that.
You will find it in madgraph/various/lhe_parser.py

For the object EventFile you have the function:

    def split(self, nb_event=0, partition=None, cwd=os.path.curdir, zip=False):
        """split the file in multiple file. Do not change the weight!"""

Note that in such case, it might be smarter to set the attribute parsing of the EventFile to False

Cheers,

Olivier
On 26 Aug 2018, at 21:57, suman <<email address hidden><mailto:<email address hidden>>> wrote:

New question #673005 on MadGraph5_aMC@NLO:
https://answers.launchpad.net/mg5amcnlo/+question/673005

I like to shower a ME LHE file from Madgraph with pythia. Now if there is a script for spliting the LHE file in number of LHE file then these files can be run in parallel which can save lots of time and the output root file can be merge in to a single root file for final result. If there is a general script for this purpose please give the link.

Thanks in advance.

--
You received this question notification because you are an answer
contact for MadGraph5_aMC@NLO.

Revision history for this message
suman (sumanmg5) said :
#2

Ok. I will check the lhe_parser.py.Thanks.

Revision history for this message
suman (sumanmg5) said :
#3

Thanks Olivier Mattelaer, that solved my question.