diff --git a/Generators/EvgenProdTools/src/FixHepMC.cxx b/Generators/EvgenProdTools/src/FixHepMC.cxx index 45fbe8675a3ba6bc0657259795a9f8b0ca20c74b..1f4ba737627ca56dcb1170650df344a37bf7c483 100644 --- a/Generators/EvgenProdTools/src/FixHepMC.cxx +++ b/Generators/EvgenProdTools/src/FixHepMC.cxx @@ -46,6 +46,7 @@ StatusCode FixHepMC::execute() { // Some heuristics std::vector<HepMC::GenParticlePtr> tofix; + // Herwig7+EvtGen has problems with bad pdg id. 16.11.2021 std::vector<HepMC::GenParticlePtr> bad_pdg_id_particles; for (auto ip: evt->particles()) { // Skip this particle if (somehow) its pointer is null @@ -60,6 +61,15 @@ StatusCode FixHepMC::execute() { if (pdg_id == 43 || pdg_id == 44 || pdg_id == -43 || pdg_id == -44 || pdg_id == 30353 || pdg_id == -30353 || pdg_id == 30343 || pdg_id == -30343) bad_pdg_id_particles.push_back(ip); } + // SHERPA has problems with bad beam particles. 16.11.2021 + auto beams_t = evt->beams(); + if (beams_t.size() != 2) { + ATH_MSG_INFO("Invalid number of beam particles " << beams_t.size() << ". Will try to fix."); + std::vector<HepMC::GenParticlePtr> bparttoremove; + for (auto bpart: beams_t) if (bpart->id() == 0 && bpart->production_vertex()) bparttoremove.push_back(bpart); + for (auto bpart: bparttoremove) bpart->production_vertex()->remove_particle_out(bpart); + } + /// AV: In case we have 3 particles, we try to add a vertex that correspond to 1->2 and 1->1 splitting. if (tofix.size() == 3 || tofix.size() == 2) { size_t no_endv = 0; diff --git a/Generators/Sherpa_i/src/Sherpa_i.cxx b/Generators/Sherpa_i/src/Sherpa_i.cxx index 33dc2d47c02f9979fb06c9a6cfc97577d708f2be..6af340906e9864d12d449d690916804e90af8cd4 100644 --- a/Generators/Sherpa_i/src/Sherpa_i.cxx +++ b/Generators/Sherpa_i/src/Sherpa_i.cxx @@ -237,7 +237,8 @@ StatusCode Sherpa_i::fillEvt(HepMC::GenEvent* event) { #ifdef HEPMC3 // units correction - event->set_units(HepMC3::Units::MEV, HepMC3::Units::MM); + event->set_units(HepMC3::Units::GEV, HepMC3::Units::MM); + GeVToMeV(event); //uncomment to list HepMC3 events // std::cout << " print::listing Sherpa " << std::endl; // HepMC3::Print::listing(std::cout, *event);