15 #include <TClonesArray.h>
36 #ifdef __GENIE_PYTHIA8_ENABLED__
37 #include "Pythia8/Pythia.h"
40 using namespace genie;
41 using namespace genie::constants;
58 #ifdef __GENIE_PYTHIA8_ENABLED__
64 #ifdef __GENIE_PYTHIA8_ENABLED__
69 #ifdef __GENIE_PYTHIA8_ENABLED__
73 <<
"Calling GENIE/PYTHIA8 hadronization modules without enabling PYTHIA8";
80 #ifdef __GENIE_PYTHIA8_ENABLED__
85 #ifdef __GENIE_PYTHIA8_ENABLED__
86 LOG(
"Pythia8Had",
pNOTICE) <<
"Running PYTHIA8 hadronizer";
90 double W = kinematics.
W();
95 <<
", W = " << W <<
" GeV";
99 LOG(
"Pythia8Had",
pDEBUG) <<
"Reseting PYTHIA8 event";
100 fPythia->event.reset();
107 <<
"Leading quark mass = " << mA
108 <<
" GeV, remnant diqurak mass = " << mB <<
", GeV";
111 double pzAcm = 0.5 * Pythia8::sqrtpos(
112 (W + mA + mB) * (W - mA - mB) * (W - mA + mB) * (W + mA - mB) ) /
W;
113 double pzBcm = -pzAcm;
114 double eA = sqrt(mA*mA + pzAcm*pzAcm);
115 double eB = sqrt(mB*mB + pzBcm*pzBcm);
118 <<
"Quark: (pz = " << pzAcm <<
", E = " << eA <<
") GeV, "
119 <<
"Diquark: (pz = " << pzBcm <<
", E = " << eB <<
") GeV";
123 LOG(
"Pythia8Had",
pDEBUG) <<
"Appending quark/diquark into the PYTHIA8 event";
124 fPythia->event.append(
fLeadingQuark, 23, 101, 0, 0., 0., pzAcm, eA, mA);
125 fPythia->event.append(
fRemnantDiquark, 23, 0, 101, 0., 0., pzBcm, eB, mB);
126 fPythia->event.list();
128 LOG(
"Pythia8Had",
pDEBUG) <<
"Generating next PYTHIA8 event";
132 fPythia->event.list();
136 LOG(
"Pythia8Had",
pDEBUG) <<
"Copying PYTHIA8 event record into GENIE's";
137 Pythia8::Event &fEvent = fPythia->event;
138 int np = fEvent.size();
141 TClonesArray * particle_list =
new TClonesArray(
"genie::GHepParticle", np);
142 particle_list->SetOwner(
true);
145 TLorentzVector p4Had = kinematics.
HadSystP4();
148 TVector3 unitvq = p4Had.Vect().Unit();
151 TVector3 beta(0,0,p4Had.P()/p4Had.Energy());
158 int mom =
event->FinalStateHadronicSystemPosition();
163 const TLorentzVector & vtx = *(neutrino->
X4());
166 for (
int i = 0; i < np; i++) {
168 if (fEvent[i].
id() == 90)
continue;
171 int particle_pdg_code = fEvent[i].id();
172 int pythia_particle_status = fEvent[i].status();
175 if(pythia_particle_status > 0) {
180 <<
"Hadronization failed! Bare quarks appear in final state!";
188 bool copy = (pythia_particle_status==-23) || (pythia_particle_status > 0);
196 fEvent[i].px(), fEvent[i].py(), fEvent[i].pz(), fEvent[i].
e());
198 TVector3 p3 = p4o.Vect();
200 TLorentzVector p4(p3,p4o.Energy());
208 bool is_gamma = (particle_pdg_code ==
kPdgGamma);
211 bool not_hadr = is_gamma || is_nu || is_lchg;
219 if(pythia_particle_status > 0) {
245 <<
"Adding final state particle pdgc = " << particle.
Pdg()
246 <<
" with status = " << particle.
Status();
249 event->AddParticle(particle);
262 #ifdef __GENIE_PYTHIA8_ENABLED__
273 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
275 <<
"Original PYTHIA6 decay flags:"
292 #ifdef __GENIE_PYTHIA8_ENABLED__
307 #ifdef __GENIE_PYTHIA8_ENABLED__
336 #ifdef __GENIE_PYTHIA8_ENABLED__
338 fPythia->settings.parm(
"Diffraction:primKTwidth",
fGaussianPt2);
344 fPythia->settings.parm(
"StringZ:aLund",
fLunda);
345 fPythia->settings.parm(
"StringZ:bLund",
fLundb);
346 fPythia->settings.parm(
"StringZ:aExtraDiquark",
fLundaDiq);
357 #ifdef __GENIE_PYTHIA8_ENABLED__
358 fPythia =
new Pythia8::Pythia();
360 fPythia->readString(
"ProcessLevel:all = off");
361 fPythia->readString(
"Print:quiet = on");
365 long int seed = rnd->
GetSeed();
366 fPythia->readString(
"Random:setSeed = on");
367 fPythia->settings.mode(
"Random:seed", seed);
369 <<
"PYTHIA8 seed = " << fPythia->settings.mode(
"Random:seed");
double fSSBarSuppression
ssbar suppression
virtual void LoadConfig(void)
const int kPdgP33m1232_DeltaPP
double W(bool selected=false) const
void ProcessEventRecord(GHepRecord *event) const
static RandomGen * Instance()
Access instance.
bool IsNucleus(void) const
Generated/set kinematical variables for an event.
virtual void ProcessEventRecord(GHepRecord *event) const
double fGaussianPt2
gaussian pt2 distribution width
bool IsChargedLepton(int pdgc)
const TLorentzVector & HadSystP4(void) const
double fDiQuarkSuppression
di-quark suppression parameter
A singleton holding random number generator classes. All random number generation in GENIE should tak...
virtual ~Pythia8Hadro2019()
GHepStatus_t Status(void) const
void Configure(const Registry &config)
virtual const Registry & GetConfig(void) const
const int kPdgP33m1232_DeltaP
double fSVMesonSuppression
strange vector meson suppression
const int kPdgP33m1232_DeltaM
double W(const Interaction *const i)
bool Hadronize(GHepRecord *event) const
Summary information for an interaction.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
double fLightVMesonSuppression
light vector meson suppression
double fLundaDiq
adjustment of Lund a for di-quark
long int GetSeed(void) const
const Kinematics & Kine(void) const
virtual void Configure(const Registry &config)
double fNonGaussianPt2Tail
non gaussian pt2 tail parameterization
double fLunda
Lund a parameter.
Base class for the Pythia (6 and 8) hadronization modules in GENIE. In particular, the base class provides common checks and basic assignments of quark/diquark codes for a no frills interface to Pythia hadronization routines.
const int kPdgP33m1232_Delta0
void CopyOriginalDecayFlags(void) const
bool IsNeutralLepton(int pdgc)
void SetDesiredDecayFlags(void) const
const TLorentzVector * X4(void) const
A registry. Provides the container for algorithm configuration parameters.
const InitialState & InitState(void) const
double fLundb
Lund b parameter.
const Target & Tgt(void) const
void RestoreOriginalDecayFlags(void) const
GENIE's GHEP MC event record.
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
STDHEP-like event record entry that can fit a particle or a nucleus.
double fRemainingECutoff
remaining E cutoff stopping fragmentation
enum genie::EGHepStatus GHepStatus_t