Skip to content

Commit d764dde

Browse files
amorschsawenzel
authored andcommitted
hooks and configuration for POWHEG
1 parent 3e6fde1 commit d764dde

File tree

3 files changed

+107
-3
lines changed

3 files changed

+107
-3
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
Beams:eCM 13000. # GeV
2+
### processes
3+
Next:numberShowLHA = 1
4+
Next:numberShowInfo = 1
5+
Next:numberShowProcess = 1
6+
Next:numberShowEvent = 1
7+
Main:timesAllowErrors = 10
8+
! Read LHE file from POWHEG
9+
Beams:frameType = 4
10+
Beams:LHEF = powheg.lhe
11+
12+
! Number of outgoing particles of POWHEG Born level process
13+
! (i.e. not counting additional POWHEG radiation)
14+
POWHEG:nFinal = 2
15+
16+
! How vetoing is performed:
17+
! 0 - No vetoing is performed (userhooks are not loaded)
18+
! 1 - Showers are started at the kinematical limit.
19+
! Emissions are vetoed if pTemt > pThard.
20+
! See also POWHEG:vetoCount below
21+
POWHEG:veto = 1
22+
23+
! After 'vetoCount' accepted emissions in a row, no more emissions
24+
! are checked. 'vetoCount = 0' means that no emissions are checked.
25+
! Use a very large value, e.g. 10000, to have all emissions checked.
26+
POWHEG:vetoCount = 3
27+
28+
! Selection of pThard (note, for events where there is no
29+
! radiation, pThard is always set to be SCALUP):
30+
! 0 - pThard = SCALUP (of the LHA/LHEF standard)
31+
! 1 - the pT of the POWHEG emission is tested against all other
32+
! incoming and outgoing partons, with the minimal value chosen
33+
! 2 - the pT of all final-state partons is tested against all other
34+
! incoming and outgoing partons, with the minimal value chosen
35+
POWHEG:pThard = 2
36+
37+
! Selection of pTemt:
38+
! 0 - pTemt is pT of the emitted parton w.r.t. radiating parton
39+
! 1 - pT of the emission is checked against all incoming and outgoing
40+
! partons. pTemt is set to the minimum of these values
41+
! 2 - the pT of all final-state partons is tested against all other
42+
! incoming and outgoing partons, with the minimal value chosen
43+
! WARNING: the choice here can give significant variations in the final
44+
! distributions, notably in the tail to large pT values.
45+
POWHEG:pTemt = 0
46+
47+
! Selection of emitted parton for FSR
48+
! 0 - Pythia definition of emitted
49+
! 1 - Pythia definition of radiator
50+
! 2 - Random selection of emitted or radiator
51+
! 3 - Both are emitted and radiator are tried
52+
POWHEG:emitted = 0
53+
54+
! pT definitions
55+
! 0 - POWHEG ISR pT definition is used for both ISR and FSR
56+
! 1 - POWHEG ISR pT and FSR d_ij definitions
57+
! 2 - Pythia definitions
58+
POWHEG:pTdef = 1
59+
60+
! MPI vetoing
61+
! 0 - No MPI vetoing is done
62+
! 1 - When there is no radiation, MPIs with a scale above pT_1 are vetoed,
63+
! else MPIs with a scale above (pT_1 + pT_2 + pT_3) / 2 are vetoed
64+
POWHEG:MPIveto = 0
65+
! Note that POWHEG:MPIveto = 1 should be combined with
66+
! MultipartonInteractions:pTmaxMatch = 2
67+
! which here is taken care of in main31.cc.
68+
69+
! QED vetoing
70+
! 0 - No QED vetoing is done for pTemt > 0.
71+
! 1 - QED vetoing is done for pTemt > 0.
72+
! 2 - QED vetoing is done for pTemt > 0. If a photon is found
73+
! with pT>pThard from the Born level process, the event is accepted
74+
! and no further veto of this event is allowed (for any pTemt).
75+
POWHEG:QEDveto = 2
76+
77+
### decays
78+
ParticleDecays:limitTau0 on
79+
ParticleDecays:tau0Max 10.

Generators/src/GeneratorFactory.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@ void GeneratorFactory::setPrimaryGenerator(o2::conf::SimConfig const& conf, Fair
216216
auto py8config = std::string(std::getenv("O2_ROOT")) + "/share/Generators/egconfig/pythia8_hi.cfg";
217217
auto py8 = makePythia8Gen(py8config);
218218
primGen->AddGenerator(py8);
219+
} else if (genconfig.compare("pythia8powheg") == 0) {
220+
// pythia8 with powheg
221+
auto py8config = std::string(std::getenv("O2_ROOT")) + "/share/Generators/egconfig/pythia8_powheg.cfg";
222+
auto py8 = makePythia8Gen(py8config);
223+
primGen->AddGenerator(py8);
219224
#endif
220225
} else if (genconfig.compare("external") == 0 || genconfig.compare("extgen") == 0) {
221226
// external generator via configuration macro

Generators/src/GeneratorPythia8.cxx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "SimulationDataFormat/MCGenProperties.h"
2323
#include "SimulationDataFormat/ParticleStatus.h"
2424
#include "Pythia8/HIUserHooks.h"
25+
#include "Pythia8Plugins/PowhegHooks.h"
2526
#include "TSystem.h"
2627
#include "ZDCBase/FragmentParam.h"
2728

@@ -107,7 +108,28 @@ Bool_t GeneratorPythia8::Init()
107108
/** inhibit hadron decays **/
108109
mPythia.readString("HadronLevel:Decay off");
109110
#endif
110-
111+
if (mPythia.settings.mode("Beams:frameType") == 4) {
112+
// Hook for POWHEG
113+
// Read in key POWHEG merging settings
114+
int vetoMode = mPythia.settings.mode("POWHEG:veto");
115+
int MPIvetoMode = mPythia.settings.mode("POWHEG:MPIveto");
116+
bool loadHooks = (vetoMode > 0 || MPIvetoMode > 0);
117+
// Add in user hooks for shower vetoing
118+
std::shared_ptr<Pythia8::PowhegHooks> powhegHooks;
119+
if (loadHooks) {
120+
// Set ISR and FSR to start at the kinematical limit
121+
if (vetoMode > 0) {
122+
mPythia.readString("SpaceShower:pTmaxMatch = 2");
123+
mPythia.readString("TimeShower:pTmaxMatch = 2");
124+
}
125+
// Set MPI to start at the kinematical limit
126+
if (MPIvetoMode > 0) {
127+
mPythia.readString("MultipartonInteractions:pTmaxMatch = 2");
128+
}
129+
powhegHooks = std::make_shared<Pythia8::PowhegHooks>();
130+
mPythia.setUserHooksPtr((Pythia8::UserHooksPtr)powhegHooks);
131+
}
132+
}
111133
/** initialise **/
112134
if (!mPythia.init()) {
113135
LOG(fatal) << "Failed to init \'Pythia8\': init returned with error";
@@ -123,8 +145,6 @@ Bool_t GeneratorPythia8::Init()
123145
Bool_t
124146
GeneratorPythia8::generateEvent()
125147
{
126-
/** generate event **/
127-
128148
/** generate event **/
129149
if (!mPythia.next()) {
130150
return false;

0 commit comments

Comments
 (0)