Skip to content

Commit 904e5d7

Browse files
committed
Integrating recoilToTop Userhook into CMSSW
1 parent 79a2173 commit 904e5d7

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

GeneratorInterface/Pythia8Interface/plugins/Pythia8HepMC3Hadronizer.cc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ using namespace Pythia8;
1717

1818
#include "GeneratorInterface/Pythia8Interface/interface/Py8HMC3InterfaceBase.h"
1919

20-
#include "GeneratorInterface/Pythia8Interface/plugins/ReweightUserHooks.h"
20+
#include "ReweightUserHooks.h"
2121
#include "GeneratorInterface/Pythia8Interface/interface/CustomHook.h"
22+
#include "TopRecoilHook.h"
2223

2324
// PS matchning prototype
2425
//
@@ -150,6 +151,9 @@ class Pythia8HepMC3Hadronizer : public Py8HMC3InterfaceBase {
150151
//Generic customized hooks vector
151152
std::shared_ptr<UserHooksVector> fCustomHooksVector;
152153

154+
//RecoilToTop userhook
155+
std::shared_ptr<TopRecoilHook> fTopRecoilHook;
156+
153157
int EV1_nFinal;
154158
bool EV1_vetoOn;
155159
int EV1_maxVetoCount;
@@ -412,6 +416,14 @@ bool Pythia8HepMC3Hadronizer::initializeForInternalPartons() {
412416
(fUserHooksVector->hooks).push_back(fPowhegHooksBB4L);
413417
}
414418

419+
bool TopRecoilHook1 = fMasterGen->settings.flag("TopRecoilHook:doTopRecoilIn");
420+
if (TopRecoilHook1) {
421+
edm::LogInfo("Pythia8Interface") << "Turning on RecoilToTop hook from Pythia8Interface";
422+
if (!fTopRecoilHook.get())
423+
fTopRecoilHook.reset(new TopRecoilHook());
424+
(fUserHooksVector->hooks).push_back(fTopRecoilHook);
425+
}
426+
415427
//adapted from main89.cc in pythia8 examples
416428
bool internalMatching = fMasterGen->settings.flag("JetMatching:merge");
417429
bool internalMerging = !(fMasterGen->settings.word("Merging:Process") == "void");
@@ -571,6 +583,14 @@ bool Pythia8HepMC3Hadronizer::initializeForExternalPartons() {
571583
(fUserHooksVector->hooks).push_back(fPowhegHooksBB4L);
572584
}
573585

586+
bool TopRecoilHook1 = fMasterGen->settings.flag("TopRecoilHook:doTopRecoilIn");
587+
if (TopRecoilHook1) {
588+
edm::LogInfo("Pythia8Interface") << "Turning on RecoilToTop hook from Pythia8Interface";
589+
if (!fTopRecoilHook.get())
590+
fTopRecoilHook.reset(new TopRecoilHook());
591+
(fUserHooksVector->hooks).push_back(fTopRecoilHook);
592+
}
593+
574594
//adapted from main89.cc in pythia8 examples
575595
bool internalMatching = fMasterGen->settings.flag("JetMatching:merge");
576596
bool internalMerging = !(fMasterGen->settings.word("Merging:Process") == "void");

GeneratorInterface/Pythia8Interface/src/Py8HMC3InterfaceBase.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ namespace gen {
9898
fMasterGen->settings.addParm("PTFilter:quarkRapidity", 10.0, true, true, 0.0, 10.);
9999
fMasterGen->settings.addParm("PTFilter:quarkPt", -.1, true, true, -.1, 100.);
100100

101+
//add settings for RecoilToTop tool
102+
fMasterGen->settings.addFlag("TopRecoilHook:doTopRecoilIn", false);
103+
fMasterGen->settings.addFlag("TopRecoilHook:useOldDipoleIn", false);
104+
fMasterGen->settings.addFlag("TopRecoilHook:doListIn", false);
105+
101106
//add settings for powheg resonance scale calculation
102107
fMasterGen->settings.addFlag("POWHEGres:calcScales", false);
103108
fMasterGen->settings.addFlag("POWHEG:bb4l", false);

0 commit comments

Comments
 (0)