hepmc to root file

Asked by Soumyadip Barman

Hi,

I am getting an "events_PYTHIA8_0.hepmc.gz" hepmc type of a file after showering the events with pythia8. But for my analysis I want to get the file in root format. Is there any way that I can convert that hepmc file in the root file?

And one more thing, I am getting this error repeatedly,

INFO: Using LHAPDF v6.1.6 interface for PDFs
INFO: Trying to download NNPDF23_nlo_as_0119_qed
ERROR: Unable to download /cvmfs/sft.cern.ch/lcg/external/lhapdfsets/current/NNPDF23_nlo_as_0119_qed.tar.gz
ERROR: Unable to download /afs/cern.ch/sw/lcg/external/lhapdfsets/current/NNPDF23_nlo_as_0119_qed.tar.gz

**********************************************************************************
And this the end part of the info -

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
WARNING: Trying to shower events using the same PDF in the shower as used in the generation of the events using LHAPDF. However, no valid LHAPDF installation found with the needed PDF set. Will use default internal PDF for the shower instead. To use the same set as was used in the event generation install LHAPDF and set the path using "set /path_to_lhapdf/bin/lhapdf-config" from the MadGraph5_aMC@NLO python shell
INFO: Compiling MCatNLO for PYTHIA8...
INFO: ... done
INFO: Showering events...
INFO: (Running in /home/soumyadip/Package/Madgraph/MG5_aMC_v2_6_5/ttbar_QCD_NLO_2.6.5/MCatNLO/RUN_PYTHIA8_4)
INFO: Idle: 0, Running: 1, Completed: 0 [ current time: 20h28 ]
INFO: Idle: 0, Running: 0, Completed: 1 [ 58s ]
INFO: Idle: 0, Running: 0, Completed: 0 [ current time: 20h29 ]
INFO: The file /home/soumyadip/Package/Madgraph/MG5_aMC_v2_6_5/ttbar_QCD_NLO_2.6.5/Events/run_02/events_PYTHIA8_0.hepmc.gz has been generated.
It contains showered and hadronized events in the HEPMC format obtained showering the parton-level event file /home/soumyadip/Package/Madgraph/MG5_aMC_v2_6_5/ttbar_QCD_NLO_2.6.5/Events/run_02/events.lhe.gz with PYTHIA8
INFO: Run complete
INFO:

Could you please help me about this two matters?

Thanks,
Soumyadip

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
Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi,

Concerning root file,
this maybe done automatically if you install ExRootAnalysis package but no gaurantee.
Otherwise, they are plenty tools that convert HepMC to root, just google hepmc2root to find a couple of those.

Concerning the PDF issue,
lhapdf did a lot of modification recently which can be the source of that issue since you are using an old version of MG5aMC, where could not apply any work-around.
I see two solutions here:
1. pass to the latest version of MG5aMC (and re-install lhapdf)
2. just download manually that pdf set and put it in the correct place
HEPTOOLS/lhapdf6/share/LHAPDF

Cheers,

Olivier

> On 31 Jul 2020, at 17:05, Soumyadip Barman <email address hidden> wrote:
>
> New question #692159 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/692159
>
> Hi,
>
> I am getting an "events_PYTHIA8_0.hepmc.gz" hepmc type of a file after showering the events with pythia8. But for my analysis I want to get the file in root format. Is there any way that I can convert that hepmc file in the root file?
>
> And one more thing, I am getting this error repeatedly,
>
> INFO: Using LHAPDF v6.1.6 interface for PDFs
> INFO: Trying to download NNPDF23_nlo_as_0119_qed
> ERROR: Unable to download /cvmfs/sft.cern.ch/lcg/external/lhapdfsets/current/NNPDF23_nlo_as_0119_qed.tar.gz
> ERROR: Unable to download /afs/cern.ch/sw/lcg/external/lhapdfsets/current/NNPDF23_nlo_as_0119_qed.tar.gz
>
> **********************************************************************************
> And this the end part of the info -
>
> gzip: stdin: not in gzip format
> tar: Child returned status 1
> tar: Error is not recoverable: exiting now
> WARNING: Trying to shower events using the same PDF in the shower as used in the generation of the events using LHAPDF. However, no valid LHAPDF installation found with the needed PDF set. Will use default internal PDF for the shower instead. To use the same set as was used in the event generation install LHAPDF and set the path using "set /path_to_lhapdf/bin/lhapdf-config" from the MadGraph5_aMC@NLO python shell
> INFO: Compiling MCatNLO for PYTHIA8...
> INFO: ... done
> INFO: Showering events...
> INFO: (Running in /home/soumyadip/Package/Madgraph/MG5_aMC_v2_6_5/ttbar_QCD_NLO_2.6.5/MCatNLO/RUN_PYTHIA8_4)
> INFO: Idle: 0, Running: 1, Completed: 0 [ current time: 20h28 ]
> INFO: Idle: 0, Running: 0, Completed: 1 [ 58s ]
> INFO: Idle: 0, Running: 0, Completed: 0 [ current time: 20h29 ]
> INFO: The file /home/soumyadip/Package/Madgraph/MG5_aMC_v2_6_5/ttbar_QCD_NLO_2.6.5/Events/run_02/events_PYTHIA8_0.hepmc.gz has been generated.
> It contains showered and hadronized events in the HEPMC format obtained showering the parton-level event file /home/soumyadip/Package/Madgraph/MG5_aMC_v2_6_5/ttbar_QCD_NLO_2.6.5/Events/run_02/events.lhe.gz with PYTHIA8
> INFO: Run complete
> INFO:
>
>
>
> Could you please help me about this two matters?
>
> Thanks,
> Soumyadip
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Soumyadip Barman (soumyadipbarman) said :
#2

Hi,

I have installed ExRootAnalysis package, with it I can convert lhe file into root file but I am unable to convert hepmc file into root file using that package.

Actually, I want to do some validation plots with 2.6.5 and 2.7.3. I dont find any issue with the 2.7.3. One thing I have noticed that in 2.6.5 lhapdf version is v6.1.6 and for 2.7.3 is v6.2.3. So, is there anyway that I can change the lhapdf version in 2.6.5 or the solution you pointed is the only solution i.e. to download that particular pdf sets ?

Thanks,
Soumyadip

Revision history for this message
Soumyadip Barman (soumyadipbarman) said :
#3

Hi,

I have solved the above problem. Thanks for your suggestions.

I have a naive question though. I want to know is reweighting is necessary for physics analysis? I have generated the p p > t t~ [QCD] , NLO process and showered with Pythia8. Can I use the generated hepmc file for my analysis right away or I have to do reweighting before use it for physics analysis? If I want to know why it is necessary, could you please explain it or point to any document why it is necessary or not?

Thanks,
Soumyadip

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#4

Hi,

In our code we distinguish two type of reweighting
1) one for the scale/pdf uncertainty
2) on for BSM theory

The first one is a convenient method to get an estimation of the theoretical uncertainties while the second can allow you to re-use a sample and predict another benchmark point.

In both case, you can decide to run those or not. You can get the same curve by dedicated run rather than using re-weighting method. So this is not mandatory.

However any relevant analysis need to include the scale/pdf uncertainty and using re-weighting is certainly faster than re-running more than 100 times the same run with different PDF/scale uncertainty.
So in general someone (supervisor, referee,...) will force you to compute such uncertainties...

Cheers,

Olivier

> On 3 Aug 2020, at 17:55, Soumyadip Barman <email address hidden> wrote:
>
> Question #692159 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/692159
>
> Soumyadip Barman posted a new comment:
> Hi,
>
> I have solved the above problem. Thanks for your suggestions.
>
> I have a naive question though. I want to know is reweighting is
> necessary for physics analysis? I have generated the p p > t t~ [QCD] ,
> NLO process and showered with Pythia8. Can I use the generated hepmc
> file for my analysis right away or I have to do reweighting before use
> it for physics analysis? If I want to know why it is necessary, could
> you please explain it or point to any document why it is necessary or
> not?
>
> Thanks,
> Soumyadip
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Soumyadip Barman (soumyadipbarman) said :
#5

Hi,

Thanks, Olivier for your detailed reply. Actually I am doing different settings to get the proper results. In that case, I have one more clarification to make.

I am aware of the fact that f1 and f2 must be same in the run_card, otherwise, the code crashes. Is there anyway that I can use different f1, f2 values i.e. they are not the same. I want to use like f1 = 0.5, f2=1.0 and k=0.5. Is there anyway ? Also, is there anyway to stable top in the shower card for pythia8?

Thanks,
Soumyadip

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#6

Here I do not understand your question.

1. Could you define f1
2. Could you define f2
3. Could your define k
4. if by "stable" you mean not decay the top within pythia8, i guess you have to put the associated option within the pythia8 card . I'm not an expert of pythia8 so i will not be able to tell you what you have to write for that, I would suggest to read the pythia8 manual.

Cheers,

Olivier

> On 5 Aug 2020, at 17:41, Soumyadip Barman <email address hidden> wrote:
>
> Question #692159 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/692159
>
> Status: Answered => Open
>
> Soumyadip Barman is still having a problem:
> Hi,
>
> Thanks, Olivier for your detailed reply. Actually I am doing different
> settings to get the proper results. In that case, I have one more
> clarification to make.
>
> I am aware of the fact that f1 and f2 must be same in the run_card,
> otherwise, the code crashes. Is there anyway that I can use different
> f1, f2 values i.e. they are not the same. I want to use like f1 = 0.5,
> f2=1.0 and k=0.5. Is there anyway ? Also, is there anyway to stable top
> in the shower card for pythia8?
>
> Thanks,
> Soumyadip
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Soumyadip Barman (soumyadipbarman) said :
#7

Hi,

Mu_alpha = f_alpha * R [alpha = 1, 2]

Here, R = H_T/2 = Reference scale
            Mu = starting scale
             k = multiplication factor
            f_alpha = k * f_alpha{hat}

Thanks,
Soumyadip

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#8

Still not clear?

1. What is Mu_alpha?
the factorization scale or the renormalization scale?
(or both depending of the value of alpha)?

You define Mu as starting scale, so I guess that you know that value?
(and you know R as well so this formulla makes no sense)

2. What is f_alpha{hat}? you did not define it. Those

In any case at LO, the easiest is to hack the file systematics.py if you need to have more general variant of scale variation.

Cheers,

Olivier

> On 5 Aug 2020, at 18:11, Soumyadip Barman <email address hidden> wrote:
>
> Question #692159 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/692159
>
> Status: Answered => Open
>
> Soumyadip Barman is still having a problem:
> Hi,
>
> Mu_alpha = f_alpha * R [alpha = 1, 2]
>
> Here, R = H_T/2 = Reference scale
> Mu = starting scale
> k = multiplication factor
> f_alpha = k * f_alpha{hat}
>
>
> Thanks,
> Soumyadip
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Soumyadip Barman (soumyadipbarman) said :
#9

Hi,

Is there anyway to check the fraction of negative weighted events in hepmc file generated after showering with pythia8?

Thanks,
Soumyadip

Revision history for this message
Best Olivier Mattelaer (olivier-mattelaer) said :
#10

The easiest is likely to use the C++ HepMC library.

> On 14 Aug 2020, at 00:41, Soumyadip Barman <email address hidden> wrote:
>
> Question #692159 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/692159
>
> Status: Answered => Open
>
> Soumyadip Barman is still having a problem:
> Hi,
>
> Is there anyway to check the fraction of negative weighted events in
> hepmc file generated after showering with pythia8?
>
> Thanks,
> Soumyadip
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Soumyadip Barman (soumyadipbarman) said :
#11

Thanks Olivier Mattelaer, that solved my question.