16 #include <TClonesArray.h> 37 #ifdef __GENIE_PYTHIA8_ENABLED__ 38 #include "Pythia8/Pythia.h" 41 using namespace genie;
59 #ifdef __GENIE_PYTHIA8_ENABLED__ 65 #ifdef __GENIE_PYTHIA8_ENABLED__
70 #ifdef __GENIE_PYTHIA8_ENABLED__ 74 <<
"Calling GENIE/PYTHIA8 hadronization modules without enabling PYTHIA8";
81 #ifdef __GENIE_PYTHIA8_ENABLED__
86 #ifdef __GENIE_PYTHIA8_ENABLED__ 87 LOG(
"Pythia8Had",
pNOTICE) <<
"Running PYTHIA8 hadronizer";
91 double W = kinematics.
W();
96 <<
", W = " << W <<
" GeV";
100 LOG(
"Pythia8Had",
pDEBUG) <<
"Reseting PYTHIA8 event";
101 fPythia->event.reset();
108 <<
"Leading quark mass = " << mA
109 <<
" GeV, remnant diqurak mass = " << mB <<
", GeV";
112 double pzAcm = 0.5 * Pythia8::sqrtpos(
113 (W + mA + mB) * (W - mA - mB) * (W - mA + mB) * (W + mA - mB) ) /
W;
114 double pzBcm = -pzAcm;
115 double eA = sqrt(mA*mA + pzAcm*pzAcm);
116 double eB = sqrt(mB*mB + pzBcm*pzBcm);
119 <<
"Quark: (pz = " << pzAcm <<
", E = " << eA <<
") GeV, " 120 <<
"Diquark: (pz = " << pzBcm <<
", E = " << eB <<
") GeV";
124 LOG(
"Pythia8Had",
pDEBUG) <<
"Appending quark/diquark into the PYTHIA8 event";
125 fPythia->event.append(
fLeadingQuark, 23, 101, 0, 0., 0., pzAcm, eA, mA);
126 fPythia->event.append(
fRemnantDiquark, 23, 0, 101, 0., 0., pzBcm, eB, mB);
127 fPythia->event.list();
129 LOG(
"Pythia8Had",
pDEBUG) <<
"Generating next PYTHIA8 event";
133 fPythia->event.list();
137 LOG(
"Pythia8Had",
pDEBUG) <<
"Copying PYTHIA8 event record into GENIE's";
139 int np = fEvent.size();
142 TClonesArray * particle_list =
new TClonesArray(
"genie::GHepParticle", np);
143 particle_list->SetOwner(
true);
146 TLorentzVector p4Had = kinematics.
HadSystP4();
149 TVector3 unitvq = p4Had.Vect().Unit();
152 TVector3 beta(0,0,p4Had.P()/p4Had.Energy());
159 int mom =
event->FinalStateHadronicSystemPosition();
164 const TLorentzVector & vtx = *(neutrino->
X4());
167 for (
int i = 0; i < np; i++) {
169 if (fEvent[i].
id() == 90)
continue;
172 int particle_pdg_code = fEvent[i].id();
173 int pythia_particle_status = fEvent[i].status();
176 if(pythia_particle_status > 0) {
181 <<
"Hadronization failed! Bare quarks appear in final state!";
189 bool copy = (pythia_particle_status==-23) || (pythia_particle_status > 0);
197 fEvent[i].px(), fEvent[i].py(), fEvent[i].pz(), fEvent[i].
e());
199 TVector3 p3 = p4o.Vect();
201 TLorentzVector p4(p3,p4o.Energy());
209 bool is_gamma = (particle_pdg_code ==
kPdgGamma);
212 bool not_hadr = is_gamma || is_nu || is_lchg;
220 if(pythia_particle_status > 0) {
246 <<
"Adding final state particle pdgc = " << particle.
Pdg()
247 <<
" with status = " << particle.
Status();
250 event->AddParticle(particle);
263 #ifdef __GENIE_PYTHIA8_ENABLED__ 274 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__ 276 <<
"Original PYTHIA6 decay flags:" 293 #ifdef __GENIE_PYTHIA8_ENABLED__ 308 #ifdef __GENIE_PYTHIA8_ENABLED__ 337 #ifdef __GENIE_PYTHIA8_ENABLED__ 339 fPythia->settings.parm(
"Diffraction:primKTwidth",
fGaussianPt2);
345 fPythia->settings.parm(
"StringZ:aLund",
fLunda);
346 fPythia->settings.parm(
"StringZ:bLund",
fLundb);
347 fPythia->settings.parm(
"StringZ:aExtraDiquark",
fLundaDiq);
358 #ifdef __GENIE_PYTHIA8_ENABLED__ 359 fPythia =
new Pythia8::Pythia();
361 fPythia->readString(
"ProcessLevel:all = off");
362 fPythia->readString(
"Print:quiet = on");
366 long int seed = rnd->
GetSeed();
367 fPythia->readString(
"Random:setSeed = on");
368 fPythia->settings.mode(
"Random:seed", seed);
370 <<
"PYTHIA8 seed = " << fPythia->settings.mode(
"Random:seed");
const int kPdgP33m1232_DeltaPP
double W(bool selected=false) const
double fGaussianPt2
gaussian pt2 distribution width
THE MAIN GENIE PROJECT NAMESPACE
virtual void LoadConfig(void)
static RandomGen * Instance()
Access instance.
enum genie::EGHepStatus GHepStatus_t
void RestoreOriginalDecayFlags(void) const
bool IsNucleus(void) const
void CopyOriginalDecayFlags(void) const
Generated/set kinematical variables for an event.
double fRemainingECutoff
remaining E cutoff stopping fragmentation
bool IsChargedLepton(int pdgc)
const TLorentzVector & HadSystP4(void) const
void SetDesiredDecayFlags(void) const
double fDiQuarkSuppression
di-quark suppression parameter
double fLundaDiq
adjustment of Lund a for di-quark
A singleton holding random number generator classes. All random number generation in GENIE should tak...
GHepStatus_t Status(void) const
virtual const Registry & GetConfig(void) const
const int kPdgP33m1232_DeltaP
const int kPdgP33m1232_DeltaM
double fSVMesonSuppression
strange vector meson suppression
Summary information for an interaction.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
void Configure(const Registry &config)
long int GetSeed(void) const
const Kinematics & Kine(void) const
virtual void Configure(const Registry &config)
double fLundb
Lund b 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.
virtual void ProcessEventRecord(GHepRecord *event) const
const int kPdgP33m1232_Delta0
bool IsNeutralLepton(int pdgc)
bool Hadronize(GHepRecord *event) const
void ProcessEventRecord(GHepRecord *event) const
virtual ~Pythia8Hadronization()
const TLorentzVector * X4(void) const
A registry. Provides the container for algorithm configuration parameters.
double fLightVMesonSuppression
light vector meson suppression
double fLunda
Lund a parameter.
const InitialState & InitState(void) const
double fNonGaussianPt2Tail
non gaussian pt2 tail parameterization
const Target & Tgt(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 fSSBarSuppression
ssbar suppression
Event finding and building.