Fork me on GitHub

Opened 8 months ago

Closed 8 months ago

#1332 closed How to (fixed)

Delphes does not store the correct weight

Reported by: Abdualazem Owned by:
Priority: minor Milestone:
Component: Delphes code Version: Delphes 3
Keywords: Cc:


Dear Delphes Authors,

I am having a problem retrieving the correct weight from Delphes root file. Here how I get the root file:

cat /tmp/amoohamm/hepmc.fifo | ./DelphesHepMC cards/delphes_card_ATLAS.tcl output.root

The hepmc.fifo is produced via Pythia8 from Les Houches file with the following format:

     15  10001  1.36506E+01  2.05720E+01 -1.00000E+00  1.77837E-01
       3    -1     0     0   507     0  0.000000000E+00  0.000000000E+00  3.866309873E+02  3.866309873E+02  0.000000000E+00  0.00000E+00  9.000E+00
      21    -1     0     0   511   502  0.000000000E+00  0.000000000E+00 -1.121473065E+02  1.121473065E+02  0.000000000E+00  0.00000E+00  9.000E+00
      -6     2     1     2     0   502  1.039979686E+00  2.799223146E+01  1.504222825E+02  2.306348911E+02  1.725715601E+02  0.00000E+00  9.000E+00
       6     2     1     2   507     0  1.533759779E+01 -4.044145820E+01  1.511016994E+02  2.341671436E+02  1.735850630E+02  0.00000E+00  9.000E+00
     -24     2     3     3     0     0 -1.078311255E+01  3.431724357E+01  1.744392277E+02  1.952668130E+02  8.003833691E+01  0.00000E+00  9.000E+00
      24     2     4     4     0     0 -2.785773239E+00  3.859294509E+01  4.886098652E+01  1.021446287E+02  8.092560301E+01  0.00000E+00  9.000E+00
     -11     1     6     6     0     0 -2.590232044E+01  5.527099496E+01  3.047187124E+01  6.822278230E+01  2.407909617E-06  0.00000E+00  9.000E+00
      12     1     6     6     0     0  2.311654720E+01 -1.667804987E+01  1.838911527E+01  3.392184639E+01  6.743495762E-07  0.00000E+00  9.000E+00
      13     1     5     5     0     0 -3.639585533E+01  2.601163309E+01  4.650143087E+01  6.452632341E+01  9.536743164E-07  0.00000E+00  9.000E+00
     -14     1     5     5     0     0  2.561274278E+01  8.305610487E+00  1.279377968E+02  1.307404896E+02  2.697398305E-06  0.00000E+00  9.000E+00
       5     1     4     4   513     0  7.947326197E+00 -6.224428178E+01  8.586790926E+01  1.064583061E+02  4.750000000E+00  0.00000E+00  9.000E+00
      -5     1     3     3     0   512  1.095248248E+01  5.475384760E+00 -1.743428319E+01  2.182781347E+01  4.750000000E+00  0.00000E+00  9.000E+00
       3     1     1     2   511     0 -1.637757747E+01  1.244922674E+01 -2.704030117E+01  3.397625903E+01  1.066240300E-06  0.00000E+00  9.000E+00
      21     1     3     3   512   502  8.706097532E-01 -1.180039687E+01 -6.582662004E+00  1.354026465E+01  3.371747881E-07  0.00000E+00  9.000E+00
      21     1     4     4   507   513  1.017604483E+01 -1.679012151E+01  1.637280368E+01  2.556420875E+01  2.384185791E-07  0.00000E+00  9.000E+00
#rwgt            1          16  0.11585110755460491                1    71004330           0

In my analysis code, I store the weight as follows:

 HepMCEvent *eve = (HepMCEvent*) branchEvent->At(0);
            weight = eve->Weight;
cout <<" Weight: "<<weight<< endl;

So this always picks up the third column in the first line of the event block which is 1.36506E+01. However, this is not the weight that I want.The weight that I'm interested to get is:


This weight is not the same for all the events. Notice that I tried to fetch the variables of the weight in the root file all of them agreed with the wrong weight. So it does not even store the correct weight in the root file.

I would appreciate it if someone can help with this. Thanks a lot.

Kind regards,

Attachments (1)

test.hepmc (19.7 MB) - added by Abdualazem 8 months ago.
hepmc file

Change History (5)

comment:1 Changed 8 months ago by pavel

However, this is not the weight that I want.The weight that I'm interested to get is:

Do you see the 0.83853E+01 weight in the hepmc.fifo file?

Normally, if Pythia8 correctly copies the weights from the Les Houches file to the HepMC files, then all the weights should be in the Weight branch of the ROOT file created by Delphes.

Changed 8 months ago by Abdualazem

hepmc file

comment:2 Changed 8 months ago by Abdualazem

Hi there,

Thanks a lot for the quick response.

Do you see the 0.83853E+01 weight in the hepmc.fifo file?

I think it is there. I just attached a hepmc file with 100 events to check.


comment:3 Changed 8 months ago by pavel

Thanks for the HepMC file.

The weights are the last floating point value(s) at the end of the E line.

Here is the first E line from your file:

E 0 -1 2.9986499999999999e+01 1.5676100000000001e-01 7.7201820624642091e-03 9999 0 914 1 2 0 1 1.3650600000000001e+01

There is only one weight 1.3650600000000001e+01. There is no trace of the 0.83853E+01 weight. So, the problem is with Pythia8 not copying the weights from the Les Houches file.

comment:4 Changed 8 months ago by pavel

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.