Events missing after delphes simulation

Asked by Winston

Hi experts,
        I generated 100k evnents, after delphes simulation there are only 800k+ events left. Why there are events missing?
If I simulate dectector alone in Delphes dicrectory using command: ./DelphesHepMC config_file output_file [input_file(s)].
there are no events missing. which method is appropriate?

Question information

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

> I generated 100k evnents, after delphes simulation there are only 800k+ events left. Why there are events missi

Funny typo. 800k is bigger than 100k.

> If I simulate dectector alone in Delphes dicrectory using command: ./DelphesHepMC config_file output_file [input_file(s)].

How many events are present in the HepMC? Are you using matching/merging method for generating this hepmc?

>there are no events missing. which method is appropriate?

Are you sure that the weight of all those events are different of zero?
Are you sure that you run on the same event file? and that your config file is the same?
Are you calling the same Delphes version?

To be honest, I'm not sure how I can help you here, we use Delphes as a black box and suggest user to contact Delphes support for any issue into Delphes. Our way to call Delphes is the same as you:
$delphesdir/DelphesHepMC ../Cards/delphes_card.dat ${run}/${tag}_delphes_events.root $file

Cheers,

Olivier

Revision history for this message
Winston (adampan) said :
#2

there are 80+k events left, sorry I made an error. why there are alwasys missing evetns after Delphes?

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

Hi,

you did not answer any of my questions actually.

Cheers,

Olivier

Revision history for this message
Winston (adampan) said :
#4

Hi Olivier,
   I just copy a hepmc file generated by Madgraph from /bin/process/Events, then put in in /Delphes and run ./DelphesHepMC config_file output_file [input_file(s)]. There are 100k events in the hepmc file. the weights of all events after delphes simulation are nonzore. the same hepmc file, config file and delphes version are used. the config file is cards/delphes_card_CMS.tcl.
 thanks for your help
Best regards,
Wisnton

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

Hi,

In order to be able to reproduce this, we will need to reproduce this...
What is the OS that you are using?
and also can you confirm that you are using the latest version of MG5aMC and the latest version of Delphes?

Thanks,

Olivier

Revision history for this message
Winston (adampan) said :
#7

Hi Olivier,
    I am using Madgraph in Ubuntu-16 and the version of Madgraph I using is MG5_aMC_v2_7_2.
The Delphes i using is just inside the package MG5_aMC_v2_7_2.

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

Could you then try the following patch:

=== modified file 'madgraph/interface/madevent_interface.py'
--- madgraph/interface/madevent_interface.py 2020-05-21 10:51:17 +0000
+++ madgraph/interface/madevent_interface.py 2020-06-08 13:48:30 +0000
@@ -4693,7 +4693,7 @@
                             devnull.close()
                             if pid == 0:
                                 misc.call('head -n -1 %s | tail -n +%d > %s/tmpfile' %
- (hepmc_file, n_head, os.path.dirname(hepmc_file)), shell=True)
+ (hepmc_file, n_head+1, os.path.dirname(hepmc_file)), shell=True)
                                 misc.call(['mv', 'tmpfile', os.path.basename(hepmc_file)], cwd=os.path.dirname(hepmc_file))
                             elif sys.platform == 'darwin':
                                 # sed on MAC has slightly different synthax than on

Thanks,

Olivier