Syntax for sys_pdf when using multiple PDFs in SysCalc

Asked by Hannes

Dear authors,

I am trying to add weights to an LHE file corresponding to multiple PDFs.
In particular, I want to add all weights for some and only the nominal weights for other sets.
Is this supported and if so, how would I do this?

Here is what I tried:

Using all members of one pdf works fine:
PDF1 = sys_pdf

Using one member of one pdf works fine:
PDF1 1 = sys_pdf

Using all members of two pdf sets works fine:
PDF1 PDF2 = sys_pdf

But how do I use all members of PDF1 but only one of pdf two?
PDF1 0 PDF2 1 = sys_pdf
will, for some reason, only generate one PDF weight.

Using the follwing syntax, which I though might be supported
PDF1 0 && PDF2 1 = sys_pdf
will lead to a strange error:
"INFO: Trying to download P
WARNING: No matching PDFs for pattern: P",
where P is the first character in PDF1.
This is somehow related to this [1] line in the code, but just trying to hack this strange "join" command only introduces the behavior above.

[1]
line ' '.join(self.run_card['sys_pdf'])
https://bazaar.launchpad.net/~madteam/mg5amcnlo/series2.0/view/head:/madgraph/interface/common_run_interface.py#L1652

Question information

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

Hi,

Thanks this reminds me, that I have to hide the support for SysCalc
Since the authors does not plan to support it anymore (actually they have stop development on it years ago).
.
The correct fix should be the following one but the installation of SysCalc fail on my machine so I can not test:

=== modified file 'madgraph/interface/common_run_interface.py'
--- madgraph/interface/common_run_interface.py 2018-04-25 21:20:23 +0000
+++ madgraph/interface/common_run_interface.py 2018-04-25 21:28:05 +0000
@@ -1745,7 +1745,10 @@
             # Check that all pdfset are correctly installed
             if 'sys_pdf' in self.run_card:
                 if '&&' in self.run_card['sys_pdf']:
- line = ' '.join(self.run_card['sys_pdf'])
+ if isinstance(self.run_card['sys_pdf'], list):
+ line = ' '.join(self.run_card['sys_pdf'])
+ else:
+ line = self.run_card['sys_pdf']
                     sys_pdf = line.split('&&')
                     lhaid += [l.split()[0] for l in sys_pdf]
                 else:

I actually advise to rather use the python version for computing the systematics.
(This will be the default in 2.6.2 actually)

Cheers,

Olivier

> On 25 Apr 2018, at 19:26, Hannes <email address hidden> wrote:
>
> New question #668258 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/668258
>
> Dear authors,
>
> I am trying to add weights to an LHE file corresponding to multiple PDFs.
> In particular, I want to add all weights for some and only the nominal weights for other sets.
> Is this supported and if so, how would I do this?
>
> Here is what I tried:
>
> Using all members of one pdf works fine:
> PDF1 = sys_pdf
>
> Using one member of one pdf works fine:
> PDF1 1 = sys_pdf
>
> Using all members of two pdf sets works fine:
> PDF1 PDF2 = sys_pdf
>
> But how do I use all members of PDF1 but only one of pdf two?
> PDF1 0 PDF2 1 = sys_pdf
> will, for some reason, only generate one PDF weight.
>
> Using the follwing syntax, which I though might be supported
> PDF1 0 && PDF2 1 = sys_pdf
> will lead to a strange error:
> "INFO: Trying to download P
> WARNING: No matching PDFs for pattern: P",
> where P is the first character in PDF1.
> This is somehow related to this [1] line in the code, but just trying to hack this strange "join" command only introduces the behavior above.
>
> [1]
> line ' '.join(self.run_card['sys_pdf'])
> https://bazaar.launchpad.net/~madteam/mg5amcnlo/series2.0/view/head:/madgraph/interface/common_run_interface.py#L1652
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Hannes (hannes3) said :
#2

Hi Olivier,

thanks for the prompt response.

Just to be sure, does this mean that adding weights corresponding to scale and pdf variations can then no longer be steered via the run_card.dat in 2.6.2 but one needs to write a separate syscalc_card.dat and then run the standalone script, sth like './syscalc input.lhe syscalc_card.dat output.lhe'? So none of alpsfact, reweight_pdf, reweight_scale etc will remain valid entries to the run_card?

Cheers,
Hannes

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

Hi,

we actually support two code for the computation of such weights:
- SysCalc
- systematics (a python program shipped with MG5aMC)

so we only hide the support for SysCalc and always recomment to use the python program.

The new default run_card will look like this:

> #*********************************************************************
> # Store info for systematics studies *
> # WARNING: Do not use for interference type of computation *
> #*********************************************************************
> True = use_syst ! Enable systematics studies
> systematics = systematics_program ! none, systematics [python], SysCalc [depreceted, C++]
> ['--mur=0.5,1,2', '--muf=0.5,1,2', '--pdf=errorset'] = systematics_arguments ! see: https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Systematics#Systematicspythonmodule
> # Syscalc is deprecated but to see the associate options type 'update syscalc'

If in the shell asking you to edit the cards, you then type "update syscalc", you will still see
the various SysCalc options as they are now. and you are still allowed to use SysCalc from the run_card
in any case.

> So none of alpsfact, reweight_pdf,
> reweight_scale etc will remain valid entries to the run_card?

They are still valid just that they are not written in the run_card by default anymore.

Cheers,

Olivier

> On 26 Apr 2018, at 00:37, Hannes <email address hidden> wrote:
>
> Question #668258 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/668258
>
> Hannes posted a new comment:
> Hi Olivier,
>
> thanks for the prompt response.
>
> Just to be sure, does this mean that adding weights corresponding to
> scale and pdf variations can then no longer be steered via the
> run_card.dat in 2.6.2 but one needs to write a separate syscalc_card.dat
> and then run the standalone script, sth like './syscalc input.lhe
> syscalc_card.dat output.lhe'? So none of alpsfact, reweight_pdf,
> reweight_scale etc will remain valid entries to the run_card?
>
> Cheers,
> Hannes
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Hannes (hannes3) said :
#4

Hi Olivier,

thanks a lot for the explanation, I have to admit I was actually unaware of the existence of the systematics module and I also did not realize that it starts when SysCalc is not installed, which confused me quite a bit.

To confirm, with the fix the systematics program is also working with the '&&' syntax but SysCalc still has an error.

We are thinking of switching from SysCalc to systematics, from what MG version on is this included and produces, to your knowledge, reasonable results?

Cheers,
Hannes

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

Hi,

It was introduced in 2.5.0 for LO run and 2.5.1 for NLO run.
I never hear of huge bugs/issue on this module so those should be ok,
now 2.5.2 states some improvment:
      OM: improve systematics (thanks to Philipp Pigard)
So I would suggest to have at least that version.

Cheers,

Olivier

> On 26 Apr 2018, at 15:37, Hannes <email address hidden> wrote:
>
> Question #668258 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/668258
>
> Hannes posted a new comment:
> Hi Olivier,
>
> thanks a lot for the explanation, I have to admit I was actually unaware
> of the existence of the systematics module and I also did not realize
> that it starts when SysCalc is not installed, which confused me quite a
> bit.
>
> To confirm, with the fix the systematics program is also working with
> the '&&' syntax but SysCalc still has an error.
>
> We are thinking of switching from SysCalc to systematics, from what MG
> version on is this included and produces, to your knowledge, reasonable
> results?
>
> Cheers,
> Hannes
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Hannes (hannes3) said :
#6

thanks!

Can you help with this problem?

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

To post a message you must log in.