SysCalc fails to parse XML in 2.5.1

Bug #1642338 reported by Philipp Pigard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MadGraph5_aMC@NLO
Fix Released
Undecided
Alexis Kalogeropoulos

Bug Description

Dear Authors,

The 2.5.1 update included the feature to bias the event generation. Even when deactivated, this causes a new block to be added to the LHE:
<rwgt>
<wgt id='bias'> 0.1000000E+01</wgt>
</rwgt>

The XML parser in SysCalc 1.1.6 cannot handle this new layout when the rwgt block comes before the mgrwt one. The FirstChildElement function of the parser should be able to find the <mgrwt> block when its after the <rwgt> block, but fails in practice.

Aside from this issue, could you comment on whether SysCalc is actually needed to do the PDF reweighing, or can this be done in the main code now? If yes, is there some documentation to port the syscalc card to the new format?

Cheers
Philipp

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote : Re: [Bug 1642338] [NEW] SysCalc fails to parse XML in 2.5.1
Download full text (3.5 KiB)

Dear Philipp,

I’m actually not able to reproduce your bug.
This is actually deeper than that, since I do not have any event with that information written.

> <rwgt>
> <wgt id='bias'> 0.1000000E+01</wgt>
> </rwgt>

Can you give me more details on how you are performing your event generation, such that I can try to reproduce your problem.
(I did not check if the above happens for gridpack for example)

> The XML parser in SysCalc 1.1.6 cannot handle this new layout when the
> rwgt block comes before the mgrwt one. The FirstChildElement function of
> the parser should be able to find the <mgrwt> block when its after the
> <rwgt> block, but fails in practice.

I will assign this to the main SysCalc author. I have actually no idea if that code is still maintained or not.

> Aside from this issue, could you comment on whether SysCalc is actually
> needed to do the PDF reweighing, or can this be done in the main code
> now? If yes, is there some documentation to port the syscalc card to the
> new format?

So yes, we have a python method which can do the same.
It requires that lhapdf6 is installed and that it can be linked to python (so it requires some python library)
Here is the documentation: https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Systematics
The only parameter of SysCalc which is not supported in this new module is the scalecorrelation option.
(you can only do the full 9 scale variation or vary them one at the time.)

Cheers,

Olivier

> On Nov 16, 2016, at 18:19, Philipp Pigard <email address hidden> wrote:
>
> Public bug reported:
>
> Dear Authors,
>
> The 2.5.1 update included the feature to bias the event generation. Even when deactivated, this causes a new block to be added to the LHE:
> <rwgt>
> <wgt id='bias'> 0.1000000E+01</wgt>
> </rwgt>
>
> The XML parser in SysCalc 1.1.6 cannot handle this new layout when the
> rwgt block comes before the mgrwt one. The FirstChildElement function of
> the parser should be able to find the <mgrwt> block when its after the
> <rwgt> block, but fails in practice.
>
> Aside from this issue, could you comment on whether SysCalc is actually
> needed to do the PDF reweighing, or can this be done in the main code
> now? If yes, is there some documentation to port the syscalc card to the
> new format?
>
> Cheers
> Philipp
>
> ** Affects: mg5amcnlo
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to
> MadGraph5_aMC@NLO.
> https://bugs.launchpad.net/bugs/1642338
>
> Title:
> SysCalc fails to parse XML in 2.5.1
>
> Status in MadGraph5_aMC@NLO:
> New
>
> Bug description:
> Dear Authors,
>
> The 2.5.1 update included the feature to bias the event generation. Even when deactivated, this causes a new block to be added to the LHE:
> <rwgt>
> <wgt id='bias'> 0.1000000E+01</wgt>
> </rwgt>
>
> The XML parser in SysCalc 1.1.6 cannot handle this new layout when the
> rwgt block comes before the mgrwt one. The FirstChildElement function
> of the parser should be able to find the <mgrwt> block when its after
> the <rwgt> bl...

Read more...

Changed in mg5amcnlo:
assignee: nobody → Alexis Kalogeropoulos (alkaloge)
Revision history for this message
Philipp Pigard (p-pigard) wrote :

Hello Olivier,

thank you for the rapid response! I encountered the issue for the gridpack generation (while porting the new MG code into the CMS workflow).

I will have a look if we can switch to the python code instead of SysCalc, but I know that the we use the scalecorrelation option.

Cheers
Philipp

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote : Re: [Bug 1642338] SysCalc fails to parse XML in 2.5.1

Hi Philipp,

Here is a patch (end of the message) to avoid this bias information to be written during the gridpack mode.
That was actually a tricky bug.

> I will have a look if we can switch to the python code instead of
> SysCalc, but I know that the we use the scalecorrelation option.

If that’s a limitation, I can certainly update add a function to handle something like that.
My understanding is that cms was using that to re-order the weight which does not seems something
critical/important.

Cheers,

Olivier

=== modified file 'madgraph/iolibs/template_files/madevent_makefile_source'
--- madgraph/iolibs/template_files/madevent_makefile_source 2016-09-01 09:14:58 +0000
+++ madgraph/iolibs/template_files/madevent_makefile_source 2016-11-18 09:37:14 +0000
@@ -54,8 +54,8 @@

 $(BINDIR)gen_ximprove: gen_ximprove.o ranmar.o rw_routines.o open_file.o
  $(FC) $(LDFLAGS) -o $@ $^
-$(BINDIR)combine_events: $(COMBINE) $(LIBDIR)libmodel.$(libext) $(LIBDIR)libpdf.$(libext) run_card.inc
- $(FC) $(LDFLAGS) -o $@ $(COMBINE) -L$(LIBDIR) -lmodel -lpdf $(llhapdf) $(LDFLAGS)
+$(BINDIR)combine_events: $(COMBINE) $(LIBDIR)libmodel.$(libext) $(LIBDIR)libpdf.$(libext) run_card.inc $(LIBDIR)libbias.$(libext)
+ $(FC) $(LDFLAGS) -o $@ $(COMBINE) -L$(LIBDIR) -lmodel -lpdf $(llhapdf) $(LDFLAGS) -lbias
 $(BINDIR)gensudgrid: $(GENSUDGRID) $(LIBDIR)libpdf.$(libext) $(LIBDIR)libcernlib.$(libext)
  $(FC) $(LDFLAGS) -o $@ $(GENSUDGRID) -L$(LIBDIR) -lmodel -lpdf -lcernlib $(llhapdf) $(LDFLAGS)

> On Nov 17, 2016, at 15:11, Philipp Pigard <email address hidden> wrote:
>
> Hello Olivier,
>
> thank you for the rapid response! I encountered the issue for the
> gridpack generation (while porting the new MG code into the CMS
> workflow).
>
> I will have a look if we can switch to the python code instead of
> SysCalc, but I know that the we use the scalecorrelation option.
>
> Cheers
> Philipp
>
> --
> You received this bug notification because you are subscribed to
> MadGraph5_aMC@NLO.
> https://bugs.launchpad.net/bugs/1642338
>
> Title:
> SysCalc fails to parse XML in 2.5.1
>
> Status in MadGraph5_aMC@NLO:
> New
>
> Bug description:
> Dear Authors,
>
> The 2.5.1 update included the feature to bias the event generation. Even when deactivated, this causes a new block to be added to the LHE:
> <rwgt>
> <wgt id='bias'> 0.1000000E+01</wgt>
> </rwgt>
>
> The XML parser in SysCalc 1.1.6 cannot handle this new layout when the
> rwgt block comes before the mgrwt one. The FirstChildElement function
> of the parser should be able to find the <mgrwt> block when its after
> the <rwgt> block, but fails in practice.
>
> Aside from this issue, could you comment on whether SysCalc is
> actually needed to do the PDF reweighing, or can this be done in the
> main code now? If yes, is there some documentation to port the syscalc
> card to the new format?
>
> Cheers
> Philipp
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/mg5amcnlo/+bug/1642338/+subscriptions

Changed in mg5amcnlo:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.