2 bugs in MadAnalysis

Bug #1198655 reported by Pavel Demin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MadGraph5_aMC@NLO
Fix Released
Undecided
Rikkert Frederix

Bug Description

Looks like I've found 2 bugs in MadAnalysis:

 1. it requires " # typ" in the beginning of the file with at least 2 spaces before the '#' sign and exactly 2 spaces between '#' and 'typ'. The bu is at line 2907 in MadAnalysis/plot_events.f

         do while(index(buff," # typ ") .eq. 0)

MadAnalysis should not be sensible to the number of spaces in comment lines.

Normally, it should just check whether a line starts with '#' or not.

 2. in a file with 4 events MadAnalysis finds only 3 events.

Here is how to reproduce these 2 problems.

Here is my test LHCO file:

## Integrated weight (pb) : 717.23
   # typ
   0 1 0
   1 0 -2.389 2.441 30.81 0.00 0.0 0.0 0.00 0.0 0.0
   2 1 -0.925 -1.023 40.45 0.00 1.0 0.0 0.00 0.0 0.0
   3 6 0.000 -0.480 1.06 0.00 0.0 0.0 0.00 0.0 0.0
   0 2 0
   1 1 -0.972 1.831 48.56 0.00 1.0 0.0 0.00 0.0 0.0
   2 1 -1.200 -2.011 47.22 0.00 -1.0 0.0 0.00 0.0 0.0
   3 4 0.887 -0.193 28.12 6.96 3.0 0.0 0.64 0.0 0.0
   4 6 0.000 -1.570 3.25 0.00 0.0 0.0 0.00 0.0 0.0
   0 3 0
   1 1 -0.190 -2.362 30.79 0.00 -1.0 0.0 0.00 0.0 0.0
   2 1 1.813 0.767 28.00 0.00 1.0 0.0 0.00 0.0 0.0
   3 6 0.000 1.438 2.63 0.00 0.0 0.0 0.00 0.0 0.0
   0 4 0
   1 1 -1.185 2.883 44.47 0.00 -1.0 0.0 0.00 0.0 0.0
   2 1 -0.422 -0.603 40.57 0.00 1.0 0.0 0.00 0.0 0.0
   3 6 0.000 1.370 4.97 0.00 0.0 0.0 0.00 0.0 0.0

 It contains 4 events and 2 comment lines.

 If I run MadAnalysis/plot_events with this file, it seems to work but only
 finds 3 events out of 4:

 {{{
  input name of event file:
  -------------------------
 test.lhco
 Found LHC Olympics (PGS4) Event File
     output file: plots.top
  Classes will be read from file: ./ma_card.dat
  Found the following classes in input classes file:
   class # 0 is mET 12 -12 14 -14 16 -16 122
   class # 1 is jet 1 -1 2 -2 3 -3 4 -4 21
   class # 2 is b 5 -5
  Now start parsing events a first time
  created new class a for particle 22
  created new class e+ for particle -11
  created new class e- for particle 11
  Setting up graphs
           28 plots set up
  Setting up acceptance cuts
  Cuts set up
  SEE plots.log FOR MORE INFO
  Now parsing events to fill histograms

  ----------------------------------------------
                events information
  ----------------------------------------------

    Events in file : 3
    Integrated weight (pb) : 717.230000000000
    Max wgt : 1.00000000000000
    Average wgt : 1.00000000000000

    Passing the cuts (plotted)
    --------------------------

    Events : 3
    Integrated weight (pb) : 717.230000000000
    Max wgt : 1.00000000000000
    Average wgt : 1.00000000000000
 }}}

Now I just remove one space between '#' and 'typ':

 {{{
## Integrated weight (pb) : 717.23
   # typ
   0 1 0
   1 0 -2.389 2.441 30.81 0.00 0.0 0.0 0.00 0.0 0.0
   2 1 -0.925 -1.023 40.45 0.00 1.0 0.0 0.00 0.0 0.0
   3 6 0.000 -0.480 1.06 0.00 0.0 0.0 0.00 0.0 0.0
   0 2 0
   1 1 -0.972 1.831 48.56 0.00 1.0 0.0 0.00 0.0 0.0
   2 1 -1.200 -2.011 47.22 0.00 -1.0 0.0 0.00 0.0 0.0
   3 4 0.887 -0.193 28.12 6.96 3.0 0.0 0.64 0.0 0.0
   4 6 0.000 -1.570 3.25 0.00 0.0 0.0 0.00 0.0 0.0
   0 3 0
   1 1 -0.190 -2.362 30.79 0.00 -1.0 0.0 0.00 0.0 0.0
   2 1 1.813 0.767 28.00 0.00 1.0 0.0 0.00 0.0 0.0
   3 6 0.000 1.438 2.63 0.00 0.0 0.0 0.00 0.0 0.0
   0 4 0
   1 1 -1.185 2.883 44.47 0.00 -1.0 0.0 0.00 0.0 0.0
   2 1 -0.422 -0.603 40.57 0.00 1.0 0.0 0.00 0.0 0.0
   3 6 0.000 1.370 4.97 0.00 0.0 0.0 0.00 0.0 0.0
 }}}

 If I run MadAnalysis/plot_events with this new file, it does not find any
 event:

 {{{
  input name of event file:
  -------------------------
 test.lhco
 Found LHC Olympics (PGS4) Event File
     output file: plots.top
  Classes will be read from file: ./ma_card.dat
  Found the following classes in input classes file:
   class # 0 is mET 12 -12 14 -14 16 -16 122
   class # 1 is jet 1 -1 2 -2 3 -3 4 -4 21
   class # 2 is b 5 -5
  Now start parsing events a first time
  Setting up graphs
            3 plots set up
  Setting up acceptance cuts
  Cuts set up
  SEE plots.log FOR MORE INFO
  Now parsing events to fill histograms

  ----------------------------------------------
                events information
  ----------------------------------------------

    Events in file : 0
    Integrated weight (pb) : 717.230000000000
    Max wgt : -1.00000000000000
    Average wgt : NaN

    Passing the cuts (plotted)
    --------------------------

    Events : 0
    Integrated weight (pb) : 0.00000000000000
    Max wgt : -1.00000000000000
    Average wgt : NaN
 }}}

Changed in madgraph5:
assignee: nobody → Rikkert Frederix (frederix)
Revision history for this message
Rikkert Frederix (frederix) wrote :

Dear Pavel,

About your 2 bugs:

1) At the time that MadAnalysis was designed, only PGS used the lhco event files. Which means that PGS defined the "lhco standard". Therefore, in the MadAnalysis interface this line is not considered as a comment line (it doesn't start with a '#', but with spaces instead).

2) Indeed, this is a bug. I've committed a fix.

Rikkert

Changed in madgraph5:
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.