From 1c80a7d7d19ee65787d9851293032af8d237fe39 Mon Sep 17 00:00:00 2001 From: Markus Seidel Date: Tue, 21 Jun 2022 15:31:29 +0200 Subject: [PATCH 1/2] Powheg+Vincia matching --- .../plugins/Pythia8Hadronizer.cc | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc b/GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc index c2eea4c9ea51b..a57782cf36c01 100644 --- a/GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc +++ b/GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc @@ -29,6 +29,7 @@ using namespace Pythia8; // Emission Veto Hooks // #include "Pythia8Plugins/PowhegHooks.h" +#include "Pythia8Plugins/PowhegHooksVincia.h" #include "GeneratorInterface/Pythia8Interface/plugins/EmissionVetoHook1.h" // Resonance scale hook @@ -132,6 +133,7 @@ class Pythia8Hadronizer : public Py8InterfaceBase { // Emission Veto Hooks // std::shared_ptr fEmissionVetoHook; + std::shared_ptr fEmissionVetoHookVincia; std::shared_ptr fEmissionVetoHook1; // Resonance scale hook @@ -383,7 +385,9 @@ bool Pythia8Hadronizer::initializeForInternalPartons() { (fUserHooksVector->hooks).push_back(fEmissionVetoHook1); } - if (fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) { + bool VinciaShower = fMasterGen->settings.mode("PartonShowers:Model") == 2; + + if ((fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) && !VinciaShower) { if (fJetMatchingHook.get() || fEmissionVetoHook1.get()) throw edm::Exception(edm::errors::Configuration, "Pythia8Interface") << " Attempt to turn on PowhegHooks by pythia8 settings but there are incompatible hooks on \n Incompatible " @@ -396,6 +400,13 @@ bool Pythia8Hadronizer::initializeForInternalPartons() { (fUserHooksVector->hooks).push_back(fEmissionVetoHook); } + if (fMasterGen->settings.mode("POWHEG:veto") > 0 && VinciaShower) { + edm::LogInfo("Pythia8Interface") << "Turning on Vincia Emission Veto Hook from pythia8 code"; + if (!fEmissionVetoHookVincia.get()) + fEmissionVetoHookVincia.reset(new PowhegHooksVincia()); + (fUserHooksVector->hooks).push_back(fEmissionVetoHookVincia); + } + bool PowhegRes = fMasterGen->settings.flag("POWHEGres:calcScales"); if (PowhegRes) { edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface"; @@ -542,7 +553,9 @@ bool Pythia8Hadronizer::initializeForExternalPartons() { } } - if (fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) { + bool VinciaShower = fMasterGen->settings.mode("PartonShowers:Model") == 2; + + if ((fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) && !VinciaShower) { if (fJetMatchingHook.get() || fEmissionVetoHook1.get()) throw edm::Exception(edm::errors::Configuration, "Pythia8Interface") << " Attempt to turn on PowhegHooks by pythia8 settings but there are incompatible hooks on \n Incompatible " @@ -555,6 +568,13 @@ bool Pythia8Hadronizer::initializeForExternalPartons() { (fUserHooksVector->hooks).push_back(fEmissionVetoHook); } + if (fMasterGen->settings.mode("POWHEG:veto") > 0 && VinciaShower) { + edm::LogInfo("Pythia8Interface") << "Turning on Vincia Emission Veto Hook from pythia8 code"; + if (!fEmissionVetoHookVincia.get()) + fEmissionVetoHookVincia.reset(new PowhegHooksVincia()); + (fUserHooksVector->hooks).push_back(fEmissionVetoHookVincia); + } + bool PowhegRes = fMasterGen->settings.flag("POWHEGres:calcScales"); if (PowhegRes) { edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface"; From 9f3c75959e71142403f741acc42580440baebbc7 Mon Sep 17 00:00:00 2001 From: Markus Seidel Date: Wed, 22 Jun 2022 18:33:55 +0200 Subject: [PATCH 2/2] Apply code-format --- .../Pythia8Interface/plugins/Pythia8Hadronizer.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc b/GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc index a57782cf36c01..6a051a327d2e4 100644 --- a/GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc +++ b/GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc @@ -387,7 +387,8 @@ bool Pythia8Hadronizer::initializeForInternalPartons() { bool VinciaShower = fMasterGen->settings.mode("PartonShowers:Model") == 2; - if ((fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) && !VinciaShower) { + if ((fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) && + !VinciaShower) { if (fJetMatchingHook.get() || fEmissionVetoHook1.get()) throw edm::Exception(edm::errors::Configuration, "Pythia8Interface") << " Attempt to turn on PowhegHooks by pythia8 settings but there are incompatible hooks on \n Incompatible " @@ -555,7 +556,8 @@ bool Pythia8Hadronizer::initializeForExternalPartons() { bool VinciaShower = fMasterGen->settings.mode("PartonShowers:Model") == 2; - if ((fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) && !VinciaShower) { + if ((fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) && + !VinciaShower) { if (fJetMatchingHook.get() || fEmissionVetoHook1.get()) throw edm::Exception(edm::errors::Configuration, "Pythia8Interface") << " Attempt to turn on PowhegHooks by pythia8 settings but there are incompatible hooks on \n Incompatible "