sytematics module: problematic characters in lhe comments

Asked by Hannes on 2020-09-23

Hi,

when calculating weights with the python systematic module, the LHE file will contain comments like these: "</weightgroup> # PDFSET -> PDFSET".
This causes us problems when the weights are read from the parton shower program, due to the ">" character, which is falsely interpreted as xml.
In fact, the LHE standard recommends:
"However, to avoid conflicts with XML parsers, it is recommendable to avoid the reserved symbols<,>and&, except as part of some proper XML syntax."

It would thus be great if you could change the "->" to something else.

Cheers,
Hannes

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Hannes
Solved:
2020-09-23
Last query:
2020-09-23
Last reply:
2020-09-23

Sure:

This will be part of 2.8.1:

=== modified file 'madgraph/various/systematics.py'
--- madgraph/various/systematics.py 2020-01-08 14:13:32 +0000
+++ madgraph/various/systematics.py 2020-09-23 13:38:50 +0000
@@ -564,7 +564,7 @@

                 if pdf.lhapdfID in self.pdfsets:
                     if in_pdf:
- text += "</weightgroup> # PDFSET -> PDFSET\n"
+ text += "</weightgroup> # PDFSET to PDFSET\n"
                     pdfset = self.pdfsets[pdf.lhapdfID]
                     descrip = pdfset.description.replace('=>',';').replace('>','.gt.').replace('<','.lt.')
                     text +="<weightgroup name=\"%s\" combine=\"%s\"> # %s: %s\n" %\
@@ -572,14 +572,14 @@
                     in_pdf=pdf.lhapdfID
                 elif pdf.memberID == 0 and (pdf.lhapdfID - pdf.memberID) in self.pdfsets:
                     if in_pdf:
- text += "</weightgroup> # PDFSET -> PDFSET\n"
+ text += "</weightgroup> # PDFSET to PDFSET\n"
                     pdfset = self.pdfsets[pdf.lhapdfID - 1]
                     descrip = pdfset.description.replace('=>',';').replace('>','.gt.').replace('<','.lt.')
                     text +="<weightgroup name=\"%s\" combine=\"%s\"> # %s: %s\n" %\
                             (pdfset.name, pdfset.errorType,pdfset.lhapdfID, descrip)
                     in_pdf=pdfset.lhapdfID
                 elif in_pdf and pdf.lhapdfID - pdf.memberID != in_pdf:
- text += "</weightgroup> # PDFSET -> PDF\n"
+ text += "</weightgroup> # PDFSET to PDF\n"
                     in_pdf = False
             elif in_pdf:
                 text += "</weightgroup> PDF \n"

Cheers,

Olivier

Hannes (hannes3) said : #2

thanks!