sherpa is hosted by Hepforge, IPPP Durham
close Warning: Can't synchronize with repository "(default)" (/hepforge/svn/sherpa does not appear to be a Subversion repository.). Look in the Trac log for more information.

Ticket #246: 0001-Fix-bug-in-Output_HepMC2_Short-subevents.patch

File 0001-Fix-bug-in-Output_HepMC2_Short-subevents.patch, 1.2 KB (added by Generic User (don't modify these fields), 12 years ago)
  • SHERPA/Tools/Output_HepMC2_Short.C

    From 79210fed6cb8ecff2c86129a794ac595b91692ef Mon Sep 17 00:00:00 2001
    From: Valery Yundin <yuvalery@gmail.com>
    Date: Fri, 4 May 2012 22:02:59 +0200
    Subject: [PATCH 1/2] Fix bug in Output_HepMC2_Short (subevents)
    
    ---
     SHERPA/Tools/Output_HepMC2_Short.C |   13 ++++++++++++-
     1 file changed, 12 insertions(+), 1 deletion(-)
    
    diff --git a/SHERPA/Tools/Output_HepMC2_Short.C b/SHERPA/Tools/Output_HepMC2_Short.C
    index 8f882ab..50fb748 100644
    a b void Output_HepMC2_Short::Output(Blob_List* blobs, const double weight) 
    5959#ifdef USING__HEPMC2__IOGENEVENT
    6060  p_event->clear();
    6161  m_hepmc2.Sherpa2ShortHepMC(blobs, *p_event, weight);
     62  std::vector<HepMC::GenEvent*> subevents(m_hepmc2.GenSubEventList());
    6263#ifdef HEPMC_HAS_CROSS_SECTION
    6364  p_event->set_cross_section(*p_xs);
     65  for (size_t i(0); i<subevents.size(); ++i) {
     66    subevents[i]->set_cross_section(*p_xs);
     67  }
    6468#endif
    65   p_iogenevent->write_event(p_event);
     69  if (subevents.size()) {
     70    for (size_t i(0); i<subevents.size(); ++i) {
     71      p_iogenevent->write_event(subevents[i]);
     72    }
     73    m_hepmc2.DeleteGenSubEventList();
     74  } else {
     75    p_iogenevent->write_event(p_event);
     76  }
    6677#endif
    6778}
    6879